Commit 3f4348d0 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 6436a4d9 be3844a9
<template> <template>
<div class="app"> <div class="app">
<router-view></router-view> <router-view></router-view>
<NetworkError :isShowError="isShowError"></NetworkError>
</div> </div>
</template> </template>
<script> <script>
import local from "@/utils/local"; import local from "@/utils/local";
import NetworkError from "@/components/NetworkError.vue";
import mq from "@/mixin/mq"; import mq from "@/mixin/mq";
import { getHomeInfo } from "@/api"; import { getHomeInfo } from "@/api";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
export default { export default {
mixins: [mq], mixins: [mq],
components: {
NetworkError,
},
data() { data() {
return { return {
routeQuery: "", routeQuery: "",
devicenum: "", devicenum: "",
linkDom: null, // 换皮 linkDom: null, // 换皮
isShowError: false,
}; };
}, },
watch: { watch: {
...@@ -58,6 +64,17 @@ export default { ...@@ -58,6 +64,17 @@ export default {
this.WebSocketMq(obj); this.WebSocketMq(obj);
} }
}, },
mounted() {
// 设备在线
window.addEventListener("online", () => {
this.isShowError = false;
location.reload();
});
// 设备离线
window.addEventListener("offline", () => {
this.isShowError = true;
});
},
methods: { methods: {
...mapMutations(["SET_homeInfo", "SET_datumList", "SET_matterList"]), ...mapMutations(["SET_homeInfo", "SET_datumList", "SET_matterList"]),
// 简析url // 简析url
......
<template> <template>
<div class="header flex aic jcb"> <div class="header flex aic jcc">
<slot name="left">
<div class="back-one flex aic pointer" @click="handleBack">
<img class="mr10" src="../assets/img/31fanhui1.png" />
<span class="back-text">返回上一级</span>
</div>
</slot>
<slot name="title" class="title"> <slot name="title" class="title">
<div></div> <div></div>
</slot> </slot>
<slot name="right"><div></div></slot> <div class="right-box flex aic">
<div class="back-one flex aic jcc pointer" @click="handleBack">
<span class="back-text">返回</span>
</div>
<slot name="right"><div></div></slot>
</div>
</div> </div>
</template> </template>
...@@ -31,10 +30,16 @@ export default { ...@@ -31,10 +30,16 @@ export default {
.header { .header {
width: 100%; width: 100%;
height: 100px; height: 100px;
padding: 0px 60px; // padding: 0px 40px;
background: url("../assets/img/title.jpg") no-repeat center; margin-bottom: 10px;
background: url("../assets/img/title_1.jpg") no-repeat center;
background-size: 100% 100%; background-size: 100% 100%;
// background: var(--main-theme-color);
box-shadow: 0px 2px 6px 6px #ccc; box-shadow: 0px 2px 6px 6px #ccc;
.right-box {
position: absolute;
right: 40px;
}
.back-text { .back-text {
font-size: 28px; font-size: 28px;
color: #ffffff; color: #ffffff;
...@@ -45,5 +50,23 @@ export default { ...@@ -45,5 +50,23 @@ export default {
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
} }
.back-one {
width: 150px;
height: 64px;
border: 1px solid var(--main-h1-color);
border-radius: 8px;
cursor: pointer;
.el-icon-arrow-left,
.icon-home {
font-size: 26px;
color: var(--main-h1-color);
}
span {
font-size: 28px;
font-family: Microsoft YaHei;
color: var(--main-h1-color);
}
}
} }
</style> </style>
<template>
<div class="network_error" v-show="isShowError">
<div class="network_error_box">
<img class="network_error_img" src="../assets/img/网络出错@3x.png" />
</div>
</div>
</template>
<script>
export default {
props: {
isShowError: {
type: Boolean,
required: true,
default: false,
},
},
};
</script>
<style lang="less" scoped>
.network_error {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0px;
left: 0px;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
.network_error_box {
width: 400px;
height: 400px;
background-color: #fff;
border-radius: 4px;
.network_error_img {
width: 100%;
height: 100%;
}
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="search-box" :style="{ width }"> <div class="search-box" :style="{ width }">
<el-input placeholder="输入关键词查询" :value="value" @input="changeInput"> <el-input
placeholder="输入关键词查询"
:value="value"
@keyup.native.enter="handleSearch"
@input="changeInput"
>
<i <i
v-show="value" v-show="value"
slot="suffix" slot="suffix"
......
...@@ -32,7 +32,11 @@ ...@@ -32,7 +32,11 @@
<div class="flex flexc aic"> <div class="flex flexc aic">
<img class="mb32" width="700" src="../../assets/img/png_title@2x.png" /> <img class="mb32" width="700" src="../../assets/img/png_title@2x.png" />
<div class="search-box"> <div class="search-box">
<el-input v-model="search" placeholder="输入关键词查询"> <el-input
v-model="search"
placeholder="输入关键词查询"
@keyup.native.enter="handleSearch"
>
<i <i
v-show="search" v-show="search"
slot="suffix" slot="suffix"
......
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
<div class="write-page flex flexc"> <div class="write-page flex flexc">
<Header> <Header>
<div slot="title" class="title">样表展示</div> <div slot="title" class="title">样表展示</div>
<div slot="right" class="back-home flex aic" @click="handleBackHome"> <div
<img class="mr10" src="../../assets/img/shouye.png" /> slot="right"
返回首页 class="back-home flex aic jcc ml20"
@click="handleBackHome"
>
<i class="iconfont icon-home mr10"></i>
<span>首页</span>
</div> </div>
</Header> </Header>
<div class="main flex1 flex jcc scroll3"> <div class="main flex1 flex jcc scroll3">
...@@ -179,10 +183,21 @@ export default { ...@@ -179,10 +183,21 @@ export default {
height: 100%; height: 100%;
background-color: #f5f5f5; background-color: #f5f5f5;
.back-home { .back-home {
font-size: 28px; width: 150px;
font-family: Source Han Sans CN; height: 64px;
color: #ffffff; border: 1px solid var(--main-h1-color);
border-radius: 8px;
cursor: pointer; cursor: pointer;
.el-icon-arrow-left,
.icon-home {
font-size: 26px;
color: var(--main-h1-color);
}
span {
font-size: 28px;
font-family: Microsoft YaHei;
color: var(--main-h1-color);
}
} }
} }
.main { .main {
...@@ -304,6 +319,7 @@ export default { ...@@ -304,6 +319,7 @@ export default {
top: 50px; top: 50px;
.sidebar-btn-title { .sidebar-btn-title {
writing-mode: vertical-lr; writing-mode: vertical-lr;
letter-spacing: 3px;
} }
} }
} }
......
...@@ -387,3 +387,9 @@ ...@@ -387,3 +387,9 @@
.el-tooltip__popper { .el-tooltip__popper {
max-width: 20%; max-width: 20%;
} }
.el-drawer__header{
margin-bottom: 20px !important;
}
.el-drawer__body{
border-top:1px solid #ececec;
}
...@@ -124,10 +124,10 @@ ...@@ -124,10 +124,10 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="操作" width="150"> <el-table-column align="center" label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex jca"> <div class="flex jca">
<span <!-- <span
v-if="scope.row.active !== 1" v-if="scope.row.active !== 1"
class="primary pointer" class="primary pointer"
@click="handleActive(scope.row)" @click="handleActive(scope.row)"
...@@ -138,16 +138,19 @@ ...@@ -138,16 +138,19 @@
style="opacity: 0" style="opacity: 0"
class="primary" class="primary"
>激活</span >激活</span
> -->
<span class="primary pointer" @click="handleBound(scope.row)"
>绑定表单</span
> >
<span class="primary pointer" @click="handleEdit(scope.row)" <!-- <span class="primary pointer" @click="handleEdit(scope.row)"
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="handleDel(scope.row.id)" <span class="delete pointer" @click="handleDel(scope.row.id)"
>删除</span >删除</span
> > -->
</div> </div>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pagination" v-if="total"> <div class="pagination" v-if="total">
...@@ -171,11 +174,14 @@ ...@@ -171,11 +174,14 @@
:title="title" :title="title"
ref="AddDevice" ref="AddDevice"
></AddDevice> ></AddDevice>
<!-- 关联事项 -->
<AddMatter ref="AddMatter" :matterDrawer.sync="matterDrawer"></AddMatter>
</div> </div>
</template> </template>
<script> <script>
import TableHeader from "@/components/TableHeader.vue"; import TableHeader from "@/components/TableHeader.vue";
import AddMatter from "./modal/AddMatter.vue";
import AddDevice from "./modal/AddDevice.vue"; import AddDevice from "./modal/AddDevice.vue";
import { getDeviceList } from "@/api/device"; import { getDeviceList } from "@/api/device";
import local from "@/utils/local"; import local from "@/utils/local";
...@@ -183,6 +189,7 @@ export default { ...@@ -183,6 +189,7 @@ export default {
components: { components: {
TableHeader, TableHeader,
AddDevice, AddDevice,
AddMatter,
}, },
data() { data() {
return { return {
...@@ -198,6 +205,7 @@ export default { ...@@ -198,6 +205,7 @@ export default {
dialogVisible: false, dialogVisible: false,
title: "新增数字样表设备", title: "新增数字样表设备",
loading: false, loading: false,
matterDrawer: false,
}; };
}, },
created() { created() {
...@@ -291,6 +299,13 @@ export default { ...@@ -291,6 +299,13 @@ export default {
handleChange(row) { handleChange(row) {
console.log(row); console.log(row);
}, },
// 绑定表单
handleBound(row) {
this.matterDrawer = true;
this.$nextTick(() => {
this.$refs.AddMatter.getDevInfo(row);
});
},
}, },
}; };
</script> </script>
......
<template>
<div>
<el-drawer size="70%" title="我是标题" :visible.sync="drawer">
<span slot="title"
>绑定样表(设备名称:{{ devInfo.deviceName || "--" }}</span
>
<div class="main flex1 flex aic">
<div class="left">
<div class="header mb20">
已选择事项<span class="header-count primary"
>(已选择:事项3个 | 材料12个)</span
>
</div>
<!-- 列表 -->
<div class="matter-list">
<div class="matter-item flex flexc jcc" v-for="v in 20" :key="v">
<div class="matter-item-title">
机动车登记证、行驶证核发机动车登记证、行驶证核发机动车登记证、行驶证核发机动车登记证、行驶证核发
</div>
<div class="matter-item-count">材料数量:6</div>
</div>
</div>
</div>
<div class="right">
<div class="title mb20">选择事项</div>
<TableHeader>
<div slot="left">
<el-button
size="small"
plain
type="primary"
@click="handleJoinAll"
>批量加入</el-button
>
</div>
<div slot="right" class="flex">
<el-select
v-model="department"
size="small"
placeholder="选择部门"
class="autoWidth"
filterable
>
<template slot="prefix">
{{
(deptList.find((s) => s.deptNumber === department) || {})
.name
}}
</template>
<el-option
v-for="item in deptList"
:key="item.deptNumber"
:label="item.name"
:value="item.deptNumber"
>
</el-option>
</el-select>
<el-input
size="small"
v-model="searchVal"
style="width: 200px"
class="ml10 mr10"
placeholder="请输入事项全称搜索"
@keyup.native.enter="handleSearch"
></el-input>
<el-button size="small" type="primary" @click="handleSearch"
>搜索</el-button
>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
</TableHeader>
<!-- 表格 -->
<div class="table-content">
<div @click.stop>
<el-table
ref="curTable"
v-loading="loading"
:data="tableData"
size="small"
tooltip-effect="dark"
style="width: 100%"
max-height="650px"
border
:row-key="(row) => row.id"
>
<el-table-column
type="selection"
reserve-selection
width="40"
align="center"
>
</el-table-column>
<el-table-column
type="index"
label="序号"
width="50"
align="center"
:index="(index) => (current - 1) * size + index + 1"
>
</el-table-column>
<el-table-column
prop="name"
show-overflow-tooltip
label="事项名称"
>
<template slot-scope="scope">
<p class="short">{{ scope.row.matterName }}</p>
<p class="full-name">
事项全称:{{ scope.row.matterFullName }}
</p>
</template>
</el-table-column>
<el-table-column
label="部门"
align="center"
width="180"
prop="deptName"
>
</el-table-column>
<el-table-column
prop="datumCount"
label="材料数量"
align="center"
width="80"
>
</el-table-column>
<el-table-column align="center" label="操作" width="80">
<template>
<span class="primary pointer">选择</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="pagination" v-if="total">
<el-pagination
background
layout="total,sizes,prev,pager,next,jumper"
:pager-count="5"
:total="total"
:current-page="current"
:page-size="size"
:page-sizes="pageSizes"
@current-change="changePagination"
@size-change="changeSize"
>
</el-pagination>
</div>
</div>
</div>
<div class="footer">
<el-button size="small" @click="handleClose"> </el-button>
<el-button type="primary" size="small" @click="handleClose"
> </el-button
>
</div>
</el-drawer>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import TableHeader from "@/components/TableHeader.vue";
import { getWriteMatterList } from "@/api/matter";
import local from "@/utils/local";
export default {
components: {
TableHeader,
},
props: {
matterDrawer: {
type: Boolean,
required: true,
default: false,
},
},
data() {
return {
loading: false,
siteId: local.getLocal("writeSiteId")
? local.getLocal("writeSiteId")
: "",
department: "",
searchVal: "",
current: 1,
size: 10,
total: 0,
tableData: [],
pageSizes: [10, 20, 30, 40, 50, 100, 200],
selectionKeys: [],
devInfo: {},
};
},
computed: {
drawer: {
get() {
return this.matterDrawer;
},
set(val) {
this.$emit("update:matterDrawer", val);
},
},
...mapGetters(["deptList"]),
},
created() {},
methods: {
getDevInfo(row) {
this.devInfo = row;
this.getWriteMatterList();
},
// 获取填单系统事项列表
async getWriteMatterList() {
this.loading = true;
let res = await getWriteMatterList({
page: this.current,
size: this.size,
matterFullName: `%${this.searchVal}%`,
deptCode: this.department,
siteId: this.siteId,
});
this.loading = false;
if (res.data.code === 1) {
let { data, total } = res.data.data;
this.tableData = data;
this.total = total;
this.$refs.curTable.bodyWrapper.scrollTop = 0;
}
},
// 搜索
handleSearch() {
this.current = 1;
this.getWriteMatterList();
},
// 重置
handleReset() {
this.department = "";
this.searchVal = "";
this.current = 1;
this.getWriteMatterList();
},
// 翻页
changePagination(cur) {
this.current = cur;
this.getWriteMatterList();
},
// 改变每页显示数量
changeSize(size) {
this.size = size;
this.getWriteMatterList();
},
// 表格批量选中
handleSelectionChange(select) {
this.selectionKeys = select.map((v) => v.id);
console.log(select);
},
// 批量加入
handleJoinAll() {
if (!this.selectionKeys.length) {
this.$message.warning("请先勾选数据");
return;
}
},
// 关闭弹窗
handleClose() {
this.$refs.curTable.clearSelection();
this.department = "";
this.searchVal = "";
this.current = 1;
this.size = 10;
this.drawer = false;
},
},
};
</script>
<style lang="less" scoped>
:deep(.el-drawer__body) {
display: flex;
flex-direction: column;
}
.main {
width: 100%;
overflow-y: auto;
}
.left {
height: 100%;
width: 35%;
padding: 20px;
border-right: 1px solid #ececec;
overflow-y: auto;
.matter-item {
height: 60px;
margin-bottom: 20px;
padding: 0px 20px;
border-left: 4px solid #06a16b;
border-radius: 4px;
font-size: 14px;
background-color: #f0f9f6;
.matter-item-title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.matter-item-count {
margin-top: 4px;
color: #06a16b;
}
}
}
.right {
height: 100%;
width: 65%;
padding: 20px;
overflow-y: auto;
}
.footer {
height: 50px;
padding: 0px 20px;
display: flex;
align-items: center;
justify-content: flex-end;
border-top: 1px solid #ececec;
}
.short {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.full-name {
color: rgb(172, 170, 170);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
effect="dark" effect="dark"
:key="item.id" :key="item.id"
:content="item.hotwords" :content="item.hotwords"
v-if="item.hotwords?.length > 6" v-if="item.hotwords && item.hotwords.length > 6"
placement="top-start" placement="top-start"
> >
<el-tag <el-tag
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
:disable-transitions="false" :disable-transitions="false"
@close="handleClose(item.hotwords)" @close="handleClose(item.hotwords)"
> >
{{ `${item.hotwords?.slice(0, 6)}...` }} {{ `${item.hotwords.slice(0, 6)}...` }}
</el-tag> </el-tag>
</el-tooltip> </el-tooltip>
<el-tag <el-tag
......
...@@ -407,6 +407,7 @@ export default { ...@@ -407,6 +407,7 @@ export default {
handleCurrentChange(currentRow) { handleCurrentChange(currentRow) {
if (currentRow) { if (currentRow) {
this.activeDep = currentRow; this.activeDep = currentRow;
this.rightCurrent = 1;
this.getMaterialsList(); this.getMaterialsList();
} }
}, },
...@@ -414,6 +415,7 @@ export default { ...@@ -414,6 +415,7 @@ export default {
setCurrent() { setCurrent() {
this.$refs.leftTable.setCurrentRow(); this.$refs.leftTable.setCurrentRow();
this.activeDep = {}; this.activeDep = {};
this.rightCurrent = 1;
this.getMaterialsList(); this.getMaterialsList();
}, },
// 左边翻页 // 左边翻页
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment