From 98e7690b6bd6bbc456cca73f37421bd2686d8779 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 10 四月 2024 18:17:47 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/permission.js | 2 src/views/screen/components/screen-examine/components/examine-chart.vue | 9 src/views/screen/components/wrapper-title/index.vue | 27 src/views/system/data-manage/index.vue | 28 src/views/system/platform/index.vue | 412 ++++++++++ src/assets/icons/setting.png | 0 src/views/screen/components/screen-wrapper/index.vue | 31 src/views/system/equipment/index.vue | 437 ++++++++++ src/views/screen/components/screen-map/index.vue | 14 src/views/screen/components/select-item/index.vue | 2 src/router/index.js | 13 src/views/screen/components/screen-table/index.vue | 130 +- src/views/system/calculate/record/index.vue | 50 src/views/screen/components/screen-examine/index.vue | 3 src/assets/icons/arrow.png | 0 /dev/null | 471 ----------- src/views/screen/components/screen-data/index.vue | 141 +++ src/api/platform/platform.js | 44 + src/views/screen/components/screen-examine/components/examine-hola.vue | 6 src/views/system/rule/index.vue | 399 +++++++++ src/views/system/calculate/report/index.vue | 52 + src/views/system/template/index.vue | 73 + 22 files changed, 1,720 insertions(+), 624 deletions(-) diff --git a/src/api/platform/platform.js b/src/api/platform/platform.js new file mode 100644 index 0000000..5fe4eb7 --- /dev/null +++ b/src/api/platform/platform.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 鏌ヨ骞冲彴杩愯鐩戞帶鍒楄〃 +export function listPlatform(query) { + return request({ + url: '/platform/platformMonitor/list', + method: 'get', + params: query + }) +} + +// 鏌ヨ骞冲彴杩愯鐩戞帶璇︾粏 +export function getPlatform(id) { + return request({ + url: '/platform/platformMonitor/' + id, + method: 'get' + }) +} + +// 鏂板骞冲彴杩愯鐩戞帶 +export function addPlatform(data) { + return request({ + url: '/platform/platformMonitor', + method: 'post', + data: data + }) +} + +// 淇敼骞冲彴杩愯鐩戞帶 +export function updatePlatform(data) { + return request({ + url: '/platform/platformMonitor', + method: 'put', + data: data + }) +} + +// 鍒犻櫎骞冲彴杩愯鐩戞帶 +export function delPlatform(id) { + return request({ + url: '/platform/platformMonitor/' + id, + method: 'delete' + }) +} diff --git a/src/assets/icons/arrow.png b/src/assets/icons/arrow.png new file mode 100644 index 0000000..5a0f2ed --- /dev/null +++ b/src/assets/icons/arrow.png Binary files differ diff --git a/src/assets/icons/setting.png b/src/assets/icons/setting.png new file mode 100644 index 0000000..4ff2803 --- /dev/null +++ b/src/assets/icons/setting.png Binary files differ diff --git a/src/permission.js b/src/permission.js index 45c6285..462668d 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,7 +8,7 @@ NProgress.configure({ showSpinner: false }) -const whiteList = ['/login', '/register'] +const whiteList = ['/login', '/register', '/screen'] router.beforeEach((to, from, next) => { NProgress.start() diff --git a/src/router/index.js b/src/router/index.js index 8067cb4..b9f2252 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,6 +60,19 @@ ] }, { + path: '/car/equipment', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + name: 'equipment', + component: () => import('@/views/system/equipment/index'), + meta: { title: '璧勪骇绠$悊', activeMenu: '/system/equipment' } + } + ] + }, + { path: '/check-result/contract', component: Layout, hidden: true, diff --git a/src/views/screen/components/screen-data/index.vue b/src/views/screen/components/screen-data/index.vue new file mode 100644 index 0000000..f6eba29 --- /dev/null +++ b/src/views/screen/components/screen-data/index.vue @@ -0,0 +1,141 @@ +<template> + <div class="data-container"> + <wrapper-title :title="'宸ュ崟鏁版嵁'" :path="'/monitorServe/car'"></wrapper-title> + + <div class="data-content"> + <div class="data-panel"> + + </div> + <div class="data-panel"> + <div class="panel-title"> + <div class="icon"> + <img src="@/assets/icons/arrow.png" alt=""> + </div> + <div class="title"> + 鍒嗗尯宸ュ崟鏁� + </div> + </div> + <div class="echart-container"> + <div id="barChart" ref="barChart"></div> + </div> + </div> + </div> + </div> +</template> + +<script> +import * as echarts from 'echarts'; +import WrapperTitle from '../wrapper-title/index'; +let chart = null; +export default { + name: 'ScreenData', + components: { + WrapperTitle + }, + data() { + return { + dataList: { + name: ['瀵岄『鍘�', '鑽e幙', '楂樻柊鍖�', '鑷祦浜曞尯', '璐′簳鍖�', '澶у畨鍖�', '娌挎哗鍖�'], + data1: [210, 310, 40, 102, 111, 201, 123], + data2: [20, 30, 10, 10, 11, 21, 5], + }, + } + }, + methods: { + initEchart() { + const option = { + grid: { + right: 0, + }, + legend: { + right: 0, + textStyle: { + color: '#447ED6' + } + }, + tooltip: {}, + xAxis: { + type: 'category', + axisLabel: { + color: '#447ED6', + rotate: 45 + }, + data: this.dataList.name + }, + yAxis: { + axisLabel: { + color: '#4D76B0', + }, + }, + series: [ + { + type: 'bar', + name: '宸插鐞嗗伐鍗曟暟', + stack: 'total', + itemStyle: { + color: '#4ea8ff' + }, + data: this.dataList.data1 + }, + { + type: 'bar', + name: '鏈鐞嗗伐鍗曟暟', + stack: 'total', + itemStyle: { + color: '#dfc639' + }, + data: this.dataList.data2 + }, + ] + } + chart.setOption(option, true); + + } + }, + mounted() { + chart = echarts.init(this.$refs.barChart); + this.initEchart(); + } +} +</script> + +<style lang="scss" scoped> +.data-container { + width: 100%; + height: 450px; + display: flex; + flex-direction: column; + + .data-content { + flex: 1; + background: rgba(67, 102, 155, 0.3); + border: 1px solid rgba(47, 91, 157, 0.8); + padding: 20px; + box-sizing: border-box; + } +} + +.echart-container { + width: 100%; + height: 300px; + + #barChart { + width: 100%; + height: 100%; + } +} + +.panel-title { + color: #b9b9b9; + display: flex; + align-items: center; + .icon { + width: 20px; + margin-right: 5px; + img { + width: 100%; + display: block; + } + } +} +</style> \ No newline at end of file diff --git a/src/views/screen/components/screen-examine/components/examine-chart.vue b/src/views/screen/components/screen-examine/components/examine-chart.vue index 803c32a..553971d 100644 --- a/src/views/screen/components/screen-examine/components/examine-chart.vue +++ b/src/views/screen/components/screen-examine/components/examine-chart.vue @@ -25,10 +25,7 @@ { id: 3, name: '妗f鑰冩牳姣�', value: 60, routerUrl: '/car/vehicle-data-monitor/index' }, { id: 4, name: '鐐逛綅鍦ㄧ嚎鐜�', value: 40, routerUrl: '/car/vehicle-data-monitor/index' }, { id: 5, name: '褰曞儚鍙敤鐜�', value: 80, routerUrl: '/car/vehicle-data-monitor/index' }, - { id: 6, name: '閲嶇偣鐐逛綅褰曞儚鍙敤鐜�', value: 20, routerUrl: '/car/vehicle-data-monitor/index' }, - { id: 7, name: '淇℃伅閲囬泦鍑嗙‘鐜�', value: 60, routerUrl: '/car/vehicle-data-monitor/index' }, - { id: 8, name: '杞﹁締杩囧崱鍙f暟鎹竴鑷存��', value: 40, routerUrl: '/car/vehicle-data-monitor/index' }, - + { id: 6, name: '閲嶇偣鐐逛綅褰曞儚鍙敤鐜�', value: 20, routerUrl: '/car/vehicle-data-monitor/index' } ] } }, @@ -59,8 +56,8 @@ .hola-item { flex-shrink: 0; - width: 180px; - height: 180px; + width: 140px; + height: 140px; } } } diff --git a/src/views/screen/components/screen-examine/components/examine-hola.vue b/src/views/screen/components/screen-examine/components/examine-hola.vue index a4c2d87..0bcc4bd 100644 --- a/src/views/screen/components/screen-examine/components/examine-hola.vue +++ b/src/views/screen/components/screen-examine/components/examine-hola.vue @@ -3,7 +3,7 @@ <div class="progressChart"> <div class="chart" id="progressChart" ref="chartRef"></div> <el-link class="bottom le-0-font" :underline="false" @click="handleDetail(routerPath)"> - <label >{{ bottomTitle }}</label> + <label>{{ bottomTitle }}</label> </el-link> </div> </template> @@ -85,7 +85,7 @@ detail: { // width: 50, // height: 14, - fontSize: 14, + fontSize: 20, color: 'auto' }, data: [ @@ -162,7 +162,7 @@ width: 100%; color: #01f8ff; text-align: center; - font-size: 16px; + font-size: 14px; margin-top: 10px; } } diff --git a/src/views/screen/components/screen-examine/index.vue b/src/views/screen/components/screen-examine/index.vue index 161dbfe..5747188 100644 --- a/src/views/screen/components/screen-examine/index.vue +++ b/src/views/screen/components/screen-examine/index.vue @@ -72,10 +72,11 @@ <style lang="scss" scoped> .examine-container { + flex: 1; width: 100%; - height: 100%; display: flex; flex-direction: column; + margin-bottom: 20px } .examine-content { diff --git a/src/views/screen/components/screen-map/index.vue b/src/views/screen/components/screen-map/index.vue index 89992b9..d949913 100644 --- a/src/views/screen/components/screen-map/index.vue +++ b/src/views/screen/components/screen-map/index.vue @@ -2,6 +2,7 @@ <div class="map-container"> <wrapper-title :title="'鍖哄煙鍦板浘'"></wrapper-title> <div class="map-content"> + <div ref="map" class="map-style"></div> </div> </div> @@ -13,6 +14,7 @@ import 'echarts-gl'; import mapData from '@/assets/map/zigong1.json'; import WrapperTitle from '../wrapper-title/index'; +import ScreenData from '../screen-data/index'; echarts.registerMap('zigong', mapData); let mapChart = null; @@ -161,7 +163,8 @@ } }, components: { - WrapperTitle + WrapperTitle, + ScreenData }, methods: { filterData(name) { @@ -236,6 +239,7 @@ .map-content { flex: 1; + position: relative; // background: rgba(67, 102, 155, 0.3); // border: 1px solid rgba(47, 91, 157, 0.8); } @@ -245,4 +249,12 @@ height: 100%; } } + +.data-container { + width: 100%; + display: flex; + position: absolute; + top: 0; + left: 0; +} </style> \ No newline at end of file diff --git a/src/views/screen/components/screen-table/index.vue b/src/views/screen/components/screen-table/index.vue index bb24e4c..0629df0 100644 --- a/src/views/screen/components/screen-table/index.vue +++ b/src/views/screen/components/screen-table/index.vue @@ -1,71 +1,81 @@ <template> <div class="table-container"> + <wrapper-title :title="'鍖哄煙璁惧鏁版嵁'" :path="'/monitorServe/face'"></wrapper-title> <div class="table-content" ref="tabContent"> - <el-table :data="tableData" border :height="tableHeight" :max-height="tableHeight" class="rank-table"> - <el-table-column prop="name" label="鍦板尯" align="center" width="100"> - </el-table-column> + <div class="table-wrapper"> + <el-table :data="tableData" border :height="tableHeight" :max-height="tableHeight" class="rank-table"> + <el-table-column prop="name" label="鍦板尯" align="center" width="100"> + </el-table-column> - <el-table-column label="浜鸿劯璁惧姝e父鐜�" align="center"> - <template slot-scope="scope"> - <el-tooltip placement="top"> - <div slot="content"> - <div class="tip-item"> - <div class="tip-label">璁惧姝e父鏁�:</div> - <div class="tip-info tip-success">12</div> + <el-table-column label="浜鸿劯璁惧姝e父鐜�" align="center"> + <template slot-scope="scope"> + <el-tooltip placement="top"> + <div slot="content"> + <div class="tip-item"> + <div class="tip-label">璁惧姝e父鏁�:</div> + <div class="tip-info tip-success">12</div> + </div> + <div class="tip-item"> + <div class="tip-label">璁惧寮傚父鏁�:</div> + <div class="tip-info tip-danger">4</div> + </div> </div> - <div class="tip-item"> - <div class="tip-label">璁惧寮傚父鏁�:</div> - <div class="tip-info tip-danger">4</div> - </div> - </div> - <div class="tip-num">75%</div> - </el-tooltip> - </template> - </el-table-column> + <div class="tip-num">75%</div> + </el-tooltip> + </template> + </el-table-column> - <el-table-column label="杞﹁締璁惧姝e父鐜�" align="center"> - <template slot-scope="scope"> - <el-tooltip placement="top"> - <div slot="content"> - <div class="tip-item"> - <div class="tip-label">璁惧姝e父鏁�:</div> - <div class="tip-info tip-success">12</div> + <el-table-column label="杞﹁締璁惧姝e父鐜�" align="center"> + <template slot-scope="scope"> + <el-tooltip placement="top"> + <div slot="content"> + <div class="tip-item"> + <div class="tip-label">璁惧姝e父鏁�:</div> + <div class="tip-info tip-success">12</div> + </div> + <div class="tip-item"> + <div class="tip-label">璁惧寮傚父鏁�:</div> + <div class="tip-info tip-danger">4</div> + </div> </div> - <div class="tip-item"> - <div class="tip-label">璁惧寮傚父鏁�:</div> - <div class="tip-info tip-danger">4</div> - </div> - </div> - <div class="tip-num">75%</div> - </el-tooltip> - </template> - </el-table-column> + <div class="tip-num">75%</div> + </el-tooltip> + </template> + </el-table-column> - <el-table-column label="瑙嗛璁惧姝e父鐜�" align="center"> - <template slot-scope="scope"> - <el-tooltip placement="top"> - <div slot="content"> - <div class="tip-item"> - <div class="tip-label">璁惧姝e父鏁�:</div> - <div class="tip-info tip-success">12</div> + <el-table-column label="瑙嗛璁惧姝e父鐜�" align="center"> + <template slot-scope="scope"> + <el-tooltip placement="top"> + <div slot="content"> + <div class="tip-item"> + <div class="tip-label">璁惧姝e父鏁�:</div> + <div class="tip-info tip-success">12</div> + </div> + <div class="tip-item"> + <div class="tip-label">璁惧寮傚父鏁�:</div> + <div class="tip-info tip-danger">4</div> + </div> </div> - <div class="tip-item"> - <div class="tip-label">璁惧寮傚父鏁�:</div> - <div class="tip-info tip-danger">4</div> - </div> - </div> - <div class="tip-num">75%</div> - </el-tooltip> - </template> - </el-table-column> - </el-table> + <div class="tip-num">75%</div> + </el-tooltip> + </template> + </el-table-column> + </el-table> + </div> </div> </div> </template> <script> +import WrapperTitle from '../wrapper-title/index'; + export default { + name: 'ScreenTable', + + components: { + WrapperTitle + }, data() { return { tableHeight: 40, @@ -137,14 +147,18 @@ // flex: 1; height: 350px; position: relative; - background: rgba(67, 102, 155, 0.3); - border: 1px solid rgba(47, 91, 157, 0.8); + + display: flex; + flex-direction: column; .table-content { - position: absolute; - width: 100%; - top: 0; - bottom: 0; + flex: 1; + background: rgba(67, 102, 155, 0.3); + border: 1px solid rgba(47, 91, 157, 0.8); + // position: absolute; + // width: 100%; + // top: 0; + // bottom: 0; } } diff --git a/src/views/screen/components/screen-wrapper/index.vue b/src/views/screen/components/screen-wrapper/index.vue index d375a26..dbc3d1b 100644 --- a/src/views/screen/components/screen-wrapper/index.vue +++ b/src/views/screen/components/screen-wrapper/index.vue @@ -1,8 +1,8 @@ <template> <div class="wrapper-container"> <select-item></select-item> - <div class="return-button"> - <el-button type="primary" @click="returnPath">绠$悊绯荤粺</el-button> + <div class="return-button" @click="returnPath"> + 杩斿洖 </div> <div class="wrapper-content"> <div class="left-container wrapper"> @@ -18,6 +18,7 @@ </div> <div class="right-container wrapper"> <screen-examine class="animate-enter-x enter-right"></screen-examine> + <screen-data></screen-data> </div> </div> </div> @@ -25,22 +26,24 @@ <script> import SelectItem from '../select-item/index'; -import ScreenFace from '../screen-face/index'; import ScreenExamine from '../screen-examine/index'; +import ScreenFace from '../screen-face/index'; import ScreenVideo from '../screen-video/index'; import ScreenCar from '../screen-car/index'; import ScreenMap from '../screen-map/index'; import ScreenTable from '../screen-table/index'; +import ScreenData from '../screen-data/index'; export default { name: 'ScreenWrapper', components: { SelectItem, - ScreenFace, ScreenExamine, + ScreenMap, + ScreenTable, + ScreenFace, ScreenVideo, ScreenCar, - ScreenMap, - ScreenTable + ScreenData }, methods: { returnPath() { @@ -54,7 +57,13 @@ .return-button { position: absolute; right: 20px; - top: 40px; + top: 10px; + border-radius: 4px; + border: 1px solid #4481DD; + background-color: rgba(67, 102, 155, 0.4); + color: #4481DD; + padding: 5px 20px; + cursor: pointer; } .wrapper-container { @@ -67,8 +76,8 @@ .wrapper-content { width: 100%; - height: calc(100% - 100px); - margin-top: 100px; + height: calc(100% - 60px); + margin-top: 60px; position: relative; box-sizing: border-box; padding: 20px; @@ -79,7 +88,7 @@ } .wrapper { - width: 20%; + width: 25%; height: 100%; box-sizing: border-box; padding: 0 10px; @@ -97,7 +106,7 @@ } .center-wrapper { - width: 60%; + width: 50%; height: 100%; box-sizing: border-box; padding: 0 10px; diff --git a/src/views/screen/components/select-item/index.vue b/src/views/screen/components/select-item/index.vue index 53a40cd..75ee4bb 100644 --- a/src/views/screen/components/select-item/index.vue +++ b/src/views/screen/components/select-item/index.vue @@ -87,7 +87,7 @@ <style lang="scss" scoped> .select-container { position: absolute; - top: 40px; + top: 10px; left: 20px; display: flex; align-items: center; diff --git a/src/views/screen/components/wrapper-title/index.vue b/src/views/screen/components/wrapper-title/index.vue index 6351d2b..265b777 100644 --- a/src/views/screen/components/wrapper-title/index.vue +++ b/src/views/screen/components/wrapper-title/index.vue @@ -3,11 +3,12 @@ <span class="title">{{ title }}</span> <div class="more-button" v-if="path" @click="toPath"> - <dv-border-box-12> - <div class="button-text"> - 璇︽儏 - </div> - </dv-border-box-12> + <div class="icon"> + <img src="@/assets/icons/setting.png" alt=""> + </div> + <div class="button-text"> + 鏌ョ湅鏇村 + </div> </div> </div> </template> @@ -26,7 +27,7 @@ } }, methods: { - toPath () { + toPath() { this.$router.push(this.path); } } @@ -56,9 +57,19 @@ } .more-button { - width: 100px; height: 40px; cursor: pointer; + display: flex; + align-items: center; + .icon { + width: 20px; + margin-top: 4px; + margin-right: 2px; + img { + width: 100%; + display: block; + } + } .button-text { width: 100%; @@ -67,7 +78,7 @@ justify-content: center; align-items: center; color: #ffffff81; - font-size: 20px; + font-size: 16px; } } } diff --git a/src/views/system/calculate/record/index.vue b/src/views/system/calculate/record/index.vue index e132a74..b321768 100644 --- a/src/views/system/calculate/record/index.vue +++ b/src/views/system/calculate/record/index.vue @@ -2,14 +2,12 @@ <div class="app-container"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form-item label="鍗曚綅鍚�" prop="checkUnitId"> - <el-select v-model="queryParams.checkUnitId" clearable @clear="handleQuery" placeholder="璇烽�夋嫨鍗曚綅"> + <el-select v-model="form.unitId" placeholder="璇烽�夋嫨"> <el-option - label="鎴愰兘x杩愮淮" - value="1"> - </el-option> - <el-option - label="鎴愰兘a杩愮淮" - value="2"> + v-for="item in unitList" + :key="item.id" + :label="item.value" + :value="item.id"> </el-option> </el-select> </el-form-item> @@ -90,8 +88,8 @@ <div v-if="scope.row.unitId == 2">鎴愰兘x杩愮淮</div> </template> </el-table-column> - <el-table-column label="鎬绘湇鍔¤垂" align="center" prop="totalAmount" /> - <el-table-column label="鎵e噺鏈嶅姟璐�" align="center" prop="deductAmount" /> + <!-- <el-table-column label="鎬绘湇鍔¤垂" align="center" prop="totalAmount" /> --> + <!-- <el-table-column label="鎵e噺鏈嶅姟璐�" align="center" prop="deductAmount" /> --> <el-table-column label="鑰冩牳鍒嗘暟" align="center" prop="score" /> <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> @@ -125,15 +123,18 @@ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form-item label="鏍哥畻瀵硅薄" prop="checkUnitId"> - <el-select v-model="queryParams.checkUnitId" clearable @clear="handleQuery" placeholder="鏍哥畻瀵硅薄"> + <el-select v-model="form.unitId" placeholder="璇烽�夋嫨"> <el-option - label="鎴愰兘x杩愮淮" - value="1"> + v-for="item in unitList" + :key="item.id" + :label="item.value" + :value="item.id"> </el-option> - <el-option - label="鎴愰兘a杩愮淮" - value="2"> - </el-option> + </el-select> + </el-form-item> + <el-form-item label="鏍哥畻瑙勫垯" prop="ruleId"> + <el-select v-model="form.ruleId" placeholder="璇烽�夋嫨"> + <el-option label="鎴愰兘x杩愮淮鑰冩牳缁撴灉搴旂敤瑙勫垯" value="1">鎴愰兘x杩愮淮鑰冩牳缁撴灉搴旂敤瑙勫垯</el-option> </el-select> </el-form-item> <el-form-item label="鏍哥畻璁板綍鏃ユ湡" prop="date" > @@ -144,12 +145,12 @@ placeholder="璇烽�夋嫨鏍哥畻璁板綍鏃ユ湡"> </el-date-picker> </el-form-item> - <el-form-item label="鎬绘湇鍔¤垂" prop="totalAmount"> + <!-- <el-form-item label="鎬绘湇鍔¤垂" prop="totalAmount"> <el-input v-model="form.totalAmount" placeholder="璇疯緭鍏ユ�绘湇鍔¤垂" /> - </el-form-item> - <el-form-item label="鎵e噺鏈嶅姟璐�" prop="deductAmount"> + </el-form-item> --> + <!-- <el-form-item label="鎵e噺鏈嶅姟璐�" prop="deductAmount"> <el-input v-model="form.deductAmount" placeholder="璇疯緭鍏ユ墸鍑忔湇鍔¤垂" /> - </el-form-item> + </el-form-item> --> <el-form-item label="鑰冩牳鍒嗘暟" prop="score"> <el-input v-model="form.score" placeholder="璇疯緭鍏ヨ�冩牳鍒嗘暟" /> </el-form-item> @@ -164,7 +165,7 @@ <script> import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/platform/calculate-record"; - +import {unitSelect} from "@/api/platform/unit"; export default { name: "Record", data() { @@ -210,8 +211,15 @@ }, created() { this.getList(); + this.selectUnit(); }, methods: { + // 杩愮淮鍏徃涓嬫媺鏁版嵁 + selectUnit() { + unitSelect().then(res => { + this.unitList = res.data; + }) + }, /** 鏌ヨ鏍哥畻璁板綍鍒楄〃 */ getList() { this.loading = true; diff --git a/src/views/system/calculate/report/index.vue b/src/views/system/calculate/report/index.vue index 25100df..6dea7bd 100644 --- a/src/views/system/calculate/report/index.vue +++ b/src/views/system/calculate/report/index.vue @@ -64,7 +64,7 @@ <el-card class="box-card" v-for="(item) in checkResultList"> <div slot="header" class="clearfix"> <span>{{ checkUnitName }}</span> - <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">璇︽儏</el-button> + <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">鏍哥畻</el-button> </div> <div class="text item">鍚堝悓<span class="time">{{ checkUnitName }}</span></div> <div class="text item">鎬婚噾棰�<span class="time">{{ "1000鍏�" }}</span></div> @@ -85,7 +85,7 @@ @pagination="getList" /> - <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="700px" append-to-body> + <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="760px" append-to-body> <el-descriptions class="margin-top" :column="3" border> <!-- <template slot="extra">--> <!-- <el-button type="primary" size="small">鎿嶄綔</el-button>--> @@ -109,7 +109,7 @@ :data="tableData" show-summary :summary-method="getSummaries" - style="width: 100%"> + style="width: 100%;text-align:center"> <el-table-column prop="time" label="鏍哥畻鏃ユ湡" @@ -121,11 +121,34 @@ width="180" doNotSum> </el-table-column> - <el-table-column + <el-table-column + prop="score" + label="鎵e垎绯绘暟" + width="180"> + <template slot-scope="scope"> + <el-tooltip class="item" effect="dark" :content="'鑰冩牳瑙勫垯锛�' + scope.row.description" placement="top"> + <span>{{ scope.row.value }}</span> + </el-tooltip> + </template> + </el-table-column> + <el-table-column + label="鎵e噺閲戦(鍏�)" prop="money" - label="鎵e噺閲戦(鍏�)"> - </el-table-column> + width="180"> + <template slot-scope="scope"> + <el-input type="number" + :precision="2" :step="0.1" + :min="0" :max="1000000" + v-model="scope.row.money" + placeholder="璇疯緭鍏ユ墸鍑忛噾棰�"> + </el-input> + </template> + </el-table-column> </el-table> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> </el-dialog> <!-- 娣诲姞鎴栦慨鏀硅�冩牳缁撴灉瀵硅瘽妗� --> @@ -156,11 +179,15 @@ tableData: [{ time: '2024-03-03', score: '94', - money: '10', + value: '0.01', + money: '', + description: '姣忓皯1鍒嗘墸褰撴湀鎬绘湇鍔¤垂鐨�1%銆備緥濡傦細褰撴湀鑰冩牳寰楀垎91.5鍒嗭紝鎵i櫎褰撴湀鏈嶅姟璐�3.5%鐨勯噾棰�', }, { time: '2024-04-03', score: '95', - money: '0', + value: '0', + money: '', + description: '姣忓皯1鍒嗘墸褰撴湀鎬绘湇鍔¤垂鐨�1%銆備緥濡傦細褰撴湀鑰冩牳寰楀垎91.5鍒嗭紝鎵i櫎褰撴湀鏈嶅姟璐�3.5%鐨勯噾棰�', }, ], manualScoreOpen: false, manualScoreForm: {}, @@ -234,7 +261,7 @@ }, // 鍙栨秷鎸夐挳 cancel() { - this.open = false; + this.detailOpen = false; this.reset(); }, // 琛ㄥ崟閲嶇疆 @@ -270,9 +297,10 @@ }) }, handleDetail(row) { + console.log("row", row) this.detail = row; this.detail.carOnlineRate = '97%'; - this.detailTitle = row.checkUnitName + '鑰冩牳缁撴灉'; + this.detailTitle = this.checkUnitName + '鑰冩牳缁撴灉'; this.detailOpen = true; }, @@ -322,6 +350,7 @@ }, /** 鎻愪氦鎸夐挳 */ submitForm() { + this.detailOpen = false; this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != null) { @@ -378,6 +407,9 @@ if (column.property === 'score') { sums[index] = '-'; // 鎴栬�呭叾浠栦綘鎯宠鏄剧ず鐨勫唴瀹� } + if (column.property === 'value') { + sums[index] = '-'; // 鎴栬�呭叾浠栦綘鎯宠鏄剧ず鐨勫唴瀹� + } } else { sums[index] = 'N/A'; } diff --git a/src/views/system/data-manage/index.vue b/src/views/system/data-manage/index.vue index 103baba..c4268bc 100644 --- a/src/views/system/data-manage/index.vue +++ b/src/views/system/data-manage/index.vue @@ -89,6 +89,26 @@ </el-col> </el-row> </div> + + <div class="container"> + <el-row type="flex" justify="center"> + <el-col :span="24"> + <h3 style="color: rgb(104,104,103);padding-top: 20px;padding-bottom: 20px;">璧勪骇绠$悊</h3> + </el-col> + </el-row> + + <el-row type="flex" justify="center"> + <el-col :span="6" v-for="(item, index) in equipment" :key="index"> + <el-link @click="handleDetail(item)" :style="item.name == '' ? 'display:none' : ''"> + <el-card style="width:150px;height: 150px;text-align: center;"> + <i style="font-size: 40px;padding: 15px;" :class="item.icon"></i> + <div>{{ item.name }}</div> + </el-card> + </el-link> + </el-col> + </el-row> + <br/> + </div> <br/><br/><br/><br/> </div> </template> @@ -144,6 +164,14 @@ { name: '', icon: 'el-icon-timer', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, { name: '', icon: 'el-icon-money', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, { name: '', icon: 'el-icon-data-analysis', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, + ], + equipment: [ + { name: '璧勪骇绠$悊', icon: 'el-icon-wallet', description: '鎻忚堪淇℃伅', routerUrl: '/car/equipment/index' }, + { name: '', icon: 'el-icon-pie-chart', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, + { name: '', icon: 'el-icon-data-line', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, + { name: '', icon: 'el-icon-timer', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, + { name: '', icon: 'el-icon-money', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, + { name: '', icon: 'el-icon-data-analysis', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }, ] } }, diff --git a/src/views/system/equipment/index.vue b/src/views/system/equipment/index.vue new file mode 100644 index 0000000..ada2e73 --- /dev/null +++ b/src/views/system/equipment/index.vue @@ -0,0 +1,437 @@ +<template> + + <div class="app-container"> + + <el-card class="box-card" > + <el-row type="flex" align="middle" justify="space-between"> + <el-col :xl="8" :lg="8" :md="10" :sm="8" :xs="6"> + <div class="icon-container" style="background-color: #5599F7"> + <i class="el-icon-wallet"></i> + </div> + </el-col> + <el-col :xl="14" :lg="14" :md="12" :sm="14" :xs="16"> + <div class="dashboard"> + <div class="dashboard-item"> + <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3> + <p>璁惧鎬绘暟</p > + </div> + <div class="dashboard-item"> + <h3 style="color: #3eba45">{{ count.totalMembers }}</h3> + <p>姝e父鏁�</p > + </div> + <div class="dashboard-item"> + <h3 style="color: #fe640d">{{ count.postsPercentage }}</h3> + <p>寮傚父鏁�</p > + </div> + <div class="dashboard-item"> + <h3>{{ count.totalViews }}</h3> + <p>鐢熸垚寮傚父宸ュ崟鏁�</p > + </div> + <div class="dashboard-item"> + <h3>{{ count.noStore }}</h3> + <p>鏃犲瓨鍌�</p > + </div> + <div class="dashboard-item"> + <h3>{{ count.partStore }}</h3> + <p>閮ㄥ垎瀛樺偍</p > + </div> + <div class="dashboard-item"> + <h3>{{ count.viewsPercentage }}%</h3> + <p>璁惧杩愯鐜�</p > + </div> + </div> + </el-col> + </el-row> + </el-card> + + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> + <el-form-item label="鍏抽敭瀛�" prop="name"> + <el-input + v-model="queryParams.name" + placeholder="璇疯緭鍏ュ叧閿瓧" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鍖哄煙" prop="onState"> + <el-select + v-model="queryParams.address" + placeholder="璇烽�夋嫨鍖哄煙" + clearable + > + <el-option label="鑷础甯�" value="鑷础甯�"/> + <el-option label="娌挎哗鍖�" value="娌挎哗鍖�"/> + <el-option label="澶у畨鍖�" value="澶у畨鍖�"/> + <el-option label="璐′簳鍖�" value="璐′簳鍖�"/> + <el-option label="鑷祦浜曞尯" value="鑷祦浜曞尯"/> + <el-option label="楂樻柊鍖�" value="楂樻柊鍖�"/> + <el-option label="鑽e幙" value="鑽e幙"/> + <el-option label="瀵岄『鍘�" value="瀵岄『鍘�"/> + </el-select> + </el-form-item> + <el-form-item label="璁惧鐘舵��" prop="onState"> + <el-select + v-model="queryParams.onState" + placeholder="璁惧鐘舵��" + clearable + style="width: 100px" + > + <el-option + v-for="dict in dict.type.camera_state" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鏄惁鐢熸垚寮傚父宸ュ崟" prop="defaultOrder" label-width="130px"> + <el-select + v-model="queryParams.defaultOrder" + placeholder="鏄惁鐢熸垚寮傚父宸ュ崟" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.platform_yes_no" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + >瀵煎嚭</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="monitorList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" align="center" /> + <el-table-column label="璁惧鍚嶇О" align="center" prop="name" width="280" fixed/> + <el-table-column label="璁惧缂栫爜" align="center" prop="serialNumber" width="180"/> + <el-table-column label="鏍囩" align="center" prop="publicSecurity" width="180" v-if="columns[0].visible"/> + <el-table-column label="鍖哄煙" align="center" prop="address" width="180" v-if="columns[1].visible"/> + <el-table-column label="璁惧鐘舵��" align="center" prop="onState" v-if="columns[2].visible"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.camera_state" :value="scope.row.onState"/> + </template> + </el-table-column> + <el-table-column label="鏄惁鐢熸垚寮傚父宸ュ崟" align="center" prop="defaultOrder" width="180" v-if="columns[3].visible"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.platform_yes_no" :value="scope.row.defaultOrder"/> + </template> + </el-table-column> + <el-table-column label="鏁版嵁鏃堕棿" align="center" prop="installedTime" width="180" v-if="columns[4].visible"/> + <el-table-column label="绠$悊鍗曚綅" align="center" prop="managementUnit" width="180" v-if="columns[5].visible"/> + <el-table-column label="淇′护鏃跺欢(ms)" align="center" prop="sipDelay" width="180" v-if="columns[6].visible"/> + <el-table-column label="瑙嗛鏃跺欢(ms)" align="center" prop="videoDelay" width="180" v-if="columns[7].visible"/> + <el-table-column label="鍏抽敭甯ф椂寤�(ms)" align="center" prop="iframeDelay" width="180" v-if="columns[8].visible"/> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" fixed="right"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-view" + @click="handleView(scope.row,scope.index)" + >璇︾粏</el-button> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 璁惧璧勪骇璇︽儏 --> + <el-dialog title="鎿嶄綔鏃ュ織璇︾粏" :visible.sync="open" width="800px" append-to-body> + <el-form ref="form" :model="form" label-width="150px" size="mini"> + <el-row> + <el-col :span="12"> + <el-form-item label="璁惧缂栫爜锛�">{{ form.serialNumber }}</el-form-item> + <el-form-item label="璁惧鍚嶇О锛�">{{ form.name }} </el-form-item> + <el-form-item label="鍦板尯锛�">{{ form.address }} </el-form-item> + <el-form-item label="涓婃姤閮ㄩ棬锛�">{{ form.deptName }} </el-form-item> + <el-form-item label="璁惧鐘舵�侊細"> + <div v-if="form.onState === 1">鍙敤</div> + <div v-else-if="form.onState === 2">涓嶅彲鐢�</div> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="鍦板潃锛�">{{ form.address }}</el-form-item> + <el-form-item label="鏄惁鐢熸垚寮傚父宸ュ崟锛�"> + <div v-if="form.defaultOrder === 1">鏄�</div> + <div v-else-if="form.defaultOrder === 2">鍚�</div> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="瀹夎鏃堕棿锛�">{{ form.installedTime }}</el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="绠$悊鍗曚綅锛�">{{ form.managementUnit }}</el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="淇′护鏃跺欢(ms)锛�"></el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="瑙嗛鏃跺欢(ms)锛�"></el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="鍏抽敭甯ф椂寤�(ms)锛�"></el-form-item> + </el-col> + </el-row> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button @click="open = false">鍏� 闂�</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor"; +export default { + name: "Monitor", + dicts: ['sys_normal_disable', 'platform_yes_no','camera_state'], + data() { + return { + // 鍒椾俊鎭� + columns: [ + { key: 0, label: `鏍囩`, visible: true }, + { key: 1, label: `鍖哄煙`, visible: true }, + { key: 2, label: `璁惧鐘舵�乣, visible: true }, + { key: 3, label: `鏄惁鐢熸垚寮傚父宸ュ崟`, visible: true }, + { key: 4, label: `鏁版嵁鏃堕棿`, visible: true }, + { key: 5, label: `绠$悊鍗曚綅`, visible: true }, + { key: 6, label: `淇′护鏃跺欢`, visible: true }, + { key: 7, label: `瑙嗛鏃跺欢`, visible: true }, + { key: 8, label: `鍏抽敭甯ф椂寤禶, visible: true } + ], + count: { + totalPosts: 0, + totalMembers: 0, + postsPercentage: 0, + totalViews: 0, + noStore: 0, + partStore: 0, + viewsPercentage: 0 + }, + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 璁惧璧勪骇琛ㄦ牸鏁版嵁 + monitorList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + serialNumber: null, + name: null, + onState: null, + address: null, + installedTime: null, + managementUnit: null, + defaultOrder: null, + cameraFunType: 1, + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + serialNumber: [ + { required: true, message: "璁惧缂栫爜涓嶈兘涓虹┖", trigger: "blur" } + ], + name: [ + { required: true, message: "璁惧鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } + ], + onState: [ + { required: true, message: "璁惧鐘舵��", trigger: "blur" } + ], + address: [ + { required: true, message: "鍦板潃涓嶈兘涓虹┖", trigger: "blur" } + ], + } + }; + }, + created() { + this.getVideoCount(); + this.getList(); + this.getCountyList(); + }, + methods: { + /** 鏌ヨ璁惧璧勪骇鍒楄〃 */ + getList() { + this.loading = true; + listMonitor(this.queryParams).then(response => { + this.monitorList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + /** 鏌ヨ璁惧璧勪骇缁熻鏁� */ + getVideoCount() { + videoCount('1').then(response => { + this.count = response.data; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + serialNumber: null, + name: null, + onState: null, + address: null, + installedTime: null, + managementUnit: null, + defaultOrder: null, + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.queryParams.cameraFunType = 1; + this.getList(); + this.getVideoCount(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "娣诲姞璁惧璧勪骇"; + }, + /** 璇︾粏鎸夐挳鎿嶄綔 */ + handleView(row) { + this.open = true; + this.form = row; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getMonitor(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "淇敼璁惧璧勪骇"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateMonitor(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addMonitor(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎璁惧璧勪骇缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { + return delMonitor(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('system/monitor/export', { + ...this.queryParams + }, `monitor_${new Date().getTime()}.xlsx`) + } + } +}; +</script> +<style lang="scss" scoped> + +.box-card { + background-color: #F5F9FE; + width: 100%; + margin-bottom: 20px; + height: 120px +} +.icon-container { + display: flex; + justify-content: center; + align-items: center; + border-radius: 20px; + width: 20%; + height: 80px; + margin-left: 5%; +} +.el-icon-wallet { + font-size: 50px; + color: #FFFFFF; +} + +.dashboard { + display: flex; + gap: 10%; + align-items: center; + margin-left: -50%; +} + +.dashboard-item { + text-align: center; +} +</style> diff --git a/src/views/system/platform/index.vue b/src/views/system/platform/index.vue new file mode 100644 index 0000000..34d5f02 --- /dev/null +++ b/src/views/system/platform/index.vue @@ -0,0 +1,412 @@ +<template> + <div class="app-container"> + <el-card class="box-card" > + <el-row type="flex" align="middle" justify="space-between"> + <el-col :xl="8" :lg="8" :md="10" :sm="8" :xs="6"> + <div class="icon-container" style="background-color: #5599F7"> + <i class="el-icon-connection"></i> + </div> + </el-col> + <el-col :xl="14" :lg="14" :md="12" :sm="14" :xs="16"> + <div class="dashboard"> + <div class="dashboard-item"> + <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3> + <p>璁惧鎬绘暟</p > + </div> + <div class="dashboard-item"> + <h3 style="color: #3eba45">{{ count.totalMembers }}</h3> + <p>姝e父鏁�</p > + </div> + <div class="dashboard-item"> + <h3 style="color: #fe640d">{{ count.postsPercentage }}</h3> + <p>寮傚父鏁�</p > + </div> + <div class="dashboard-item"> + <h3>{{ count.totalViews }}</h3> + <p>鐢熸垚寮傚父宸ュ崟鏁�</p > + </div> + </div> + </el-col> + </el-row> + </el-card> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="骞冲彴缂栫爜" prop="platformCode"> + <el-input + v-model="queryParams.platformCode" + placeholder="璇疯緭鍏ュ钩鍙扮紪鐮�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="骞冲彴鍚嶇О" prop="platformName"> + <el-input + v-model="queryParams.platformName" + placeholder="璇疯緭鍏ュ钩鍙板悕绉�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="璁惧鐘舵��" prop="onState"> + <el-select + v-model="queryParams.status" + placeholder="璁惧鐘舵��" + clearable + style="width: 100px" + > + <el-option + v-for="dict in dict.type.camera_state" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鏄惁鐢熸垚寮傚父宸ュ崟" prop="defaultOrder" label-width="130px"> + <el-select + v-model="queryParams.status" + placeholder="鏄惁鐢熸垚寮傚父宸ュ崟" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.platform_yes_no" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <!-- <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['platform:platform:add']" + >鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['platform:platform:edit']" + >淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['platform:platform:remove']" + >鍒犻櫎</el-button> + </el-col> --> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['platform:platform:export']" + >瀵煎嚭</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="platformList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="骞冲彴缂栫爜" align="center" prop="platformCode" /> + <el-table-column label="骞冲彴鍚嶇О" align="center" prop="platformName" /> + <!-- <el-table-column label="骞冲彴鑱旂郴浜�" align="center" prop="platformContact" /> + <el-table-column label="骞冲彴鑱旂郴浜虹數璇�" align="center" prop="platformContactPhone" /> --> + <el-table-column label="鐘舵��" align="center" prop="status"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.camera_state" :value="scope.row.status"/> + </template> + </el-table-column> + <el-table-column label="鏄惁鐢熸垚寮傚父宸ュ崟" align="center" prop="defaultOrder" width="180"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.platform_yes_no" :value="scope.row.status"/> + </template> + </el-table-column> + <!-- <el-table-column label="澶囨敞" align="center" prop="remark" /> --> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['platform:platform:edit']" + >淇敼</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['platform:platform:remove']" + >鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 娣诲姞鎴栦慨鏀瑰钩鍙拌繍琛岀洃鎺у璇濇 --> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="骞冲彴缂栫爜" prop="platformCode"> + <el-input v-model="form.platformCode" placeholder="璇疯緭鍏ュ钩鍙扮紪鐮�" /> + </el-form-item> + <el-form-item label="骞冲彴鍚嶇О" prop="platformName"> + <el-input v-model="form.platformName" placeholder="璇疯緭鍏ュ钩鍙板悕绉�" /> + </el-form-item> + <el-form-item label="骞冲彴鑱旂郴浜�" prop="platformContact"> + <el-input v-model="form.platformContact" placeholder="璇疯緭鍏ュ钩鍙拌仈绯讳汉" /> + </el-form-item> + <el-form-item label="骞冲彴鑱旂郴浜虹數璇�" prop="platformContactPhone"> + <el-input v-model="form.platformContactPhone" placeholder="璇疯緭鍏ュ钩鍙拌仈绯讳汉鐢佃瘽" /> + </el-form-item> + <el-form-item label="澶囨敞" prop="remark"> + <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { listPlatform, getPlatform, delPlatform, addPlatform, updatePlatform } from "@/api/platform/platform"; +import { videoCount } from "@/api/platform/monitor"; +export default { + name: "Platform", + dicts: ['sys_normal_disable', 'platform_yes_no','camera_state'], + data() { + return { + count: { + totalPosts: 0, + totalMembers: 0, + postsPercentage: 0, + totalViews: 0, + noStore: 0, + partStore: 0, + viewsPercentage: 0 + }, + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 骞冲彴杩愯鐩戞帶琛ㄦ牸鏁版嵁 + platformList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + platformCode: null, + platformName: null, + platformContact: null, + platformContactPhone: null, + status: null, + remark: null, + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + platformCode: [ + { required: true, message: "骞冲彴缂栫爜涓嶈兘涓虹┖", trigger: "blur" } + ], + platformName: [ + { required: true, message: "骞冲彴鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } + ], + platformContact: [ + { required: true, message: "骞冲彴鑱旂郴浜轰笉鑳戒负绌�", trigger: "blur" } + ], + platformContactPhone: [ + { required: true, message: "骞冲彴鑱旂郴浜虹數璇濅笉鑳戒负绌�", trigger: "blur" } + ], + } + }; + }, + created() { + this.getList(); + this.getVideoCount(); + }, + methods: { + /** 鏌ヨ骞冲彴杩愯鐩戞帶鍒楄〃 */ + getList() { + this.loading = true; + listPlatform(this.queryParams).then(response => { + this.platformList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + /** 鏌ヨ璁惧璧勪骇缁熻鏁� */ + getVideoCount() { + videoCount('1').then(response => { + this.count = response.data; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + platformCode: null, + platformName: null, + platformContact: null, + platformContactPhone: null, + status: null, + remark: null, + createTime: null, + updateTime: null, + deleted: null + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "娣诲姞骞冲彴杩愯鐩戞帶"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getPlatform(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "淇敼骞冲彴杩愯鐩戞帶"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updatePlatform(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addPlatform(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎骞冲彴杩愯鐩戞帶缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { + return delPlatform(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('platform/platform/export', { + ...this.queryParams + }, `platform_${new Date().getTime()}.xlsx`) + } + } +}; +</script> +<style lang="scss" scoped> + +.box-card { + background-color: #F5F9FE; + width: 100%; + margin-bottom: 20px; + height: 120px +} +.icon-container { + display: flex; + justify-content: center; + align-items: center; + border-radius: 20px; + width: 20%; + height: 80px; + margin-left: 5%; +} +.el-icon-connection { + font-size: 50px; + color: #FFFFFF; +} + +.dashboard { + display: flex; + gap: 10%; + align-items: center; + margin-left: -50%; +} + +.dashboard-item { + text-align: center; +} +</style> \ No newline at end of file diff --git a/src/views/system/rule/index.vue b/src/views/system/rule/index.vue new file mode 100644 index 0000000..75d534d --- /dev/null +++ b/src/views/system/rule/index.vue @@ -0,0 +1,399 @@ +<template> + <div> + + <div class="container"> + <el-row type="flex" justify="start"> + <el-col :span="24"> + <h3 style="color: rgb(104,104,103);padding-top: 20px;padding-bottom: 20px;">瑙嗛鑰冩牳瑙勫垯</h3> + </el-col> + </el-row> + + <el-row type="flex" justify="start" v-for="(items, index) in groupData(videoData)"> + <el-col :span="4" v-for="item in items" :key="item.id"> + <el-card :style="{ borderBottomColor: getStatusColor(item.auditStatus) }"style="width:150px;height: 150px;text-align: center;border-bottom-width: 3px;"> + <i style="font-size: 40px;padding: 15px;" :class="item.icon"></i> + <div style="font-size:12px; text-align: center; height: 25px;">{{ item.name }} </div> + <div class="bottom clearfix"> + <el-button type="text" class="button" @click="handleAudit(item)">瀹℃牳</el-button> + <el-button type="text" class="button" @click="handleUpdate(item)">淇敼</el-button> + </div> + </el-card> + <br/> + </el-col> + </el-row> + </div> + + <div class="container"> + <el-row type="flex" justify="center"> + <el-col :span="24"> + <h3 style="color: rgb(104,104,103);padding-top: 20px;padding-bottom: 20px;">杞﹁締鑰冩牳瑙勫垯</h3> + </el-col> + </el-row> + + <el-row type="flex" justify="start" v-for="(items, index) in groupData(carData)"> + <el-col :span="4" v-for="item in items" :key="item.id"> + <el-card :style="{ borderBottomColor: getStatusColor(item.auditStatus) }"style="width:150px;height: 150px;text-align: center;border-bottom-width: 3px;"> + <i style="font-size: 40px;padding: 15px;" :class="item.icon"></i> + <div style="font-size:12px; text-align: center; height: 25px;">{{ item.name }} </div> + <div class="bottom clearfix"> + <el-button type="text" class="button" @click="handleAudit(item)">瀹℃牳</el-button> + <el-button type="text" class="button" @click="handleUpdate(item)">淇敼</el-button> + </div> + </el-card> + <br/> + </el-col> + </el-row> + </div> + + <div class="container"> + <el-row type="flex" justify="center"> + <el-col :span="24"> + <h3 style="color: rgb(104,104,103);padding-top: 20px;padding-bottom: 20px;">浜鸿劯鑰冩牳瑙勫垯</h3> + </el-col> + </el-row> + + <el-row type="flex" justify="start" v-for="(items, index) in groupData(faceData)"> + <el-col :span="4" v-for="item in items" :key="item.id"> + <el-card :style="{ borderBottomColor: getStatusColor(item.auditStatus) }"style="width:150px;height: 150px;text-align: center;border-bottom-width: 3px;"> + <i style="font-size: 40px;padding: 15px;" :class="item.icon"></i> + <div style="font-size:12px; text-align: center; height: 25px;">{{ item.name }} </div> + <div class="bottom clearfix"> + <el-button type="text" class="button" @click="handleAudit(item)">瀹℃牳</el-button> + <el-button type="text" class="button" @click="handleUpdate(item)">淇敼</el-button> + </div> + </el-card> + <br/> + </el-col> + </el-row> + </div> + <br/><br/><br/><br/> + + <!-- 娣诲姞鎴栦慨鏀硅�冩牳瑙勫垯瀵硅瘽妗� --> + <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="瑙勫垯鍚嶇О" prop="ruleName"> + <el-input v-model="form.name" placeholder="璇疯緭鍏ヨ鍒欏悕绉�"/> + </el-form-item> + <el-form-item label="鑰冩牳绫诲瀷" prop="examineCategory"> + <el-select v-model="form.examineCategory" placeholder="鑰冩牳绫诲瀷"> + <el-option + v-for="dict in dict.type.platform_examine_category" + :key="dict.value" + :label="dict.label" + :value="parseInt(dict.value)" + /> + </el-select> + </el-form-item> + <el-form-item label="瑙勫垯绫诲瀷" prop="ruleCategory"> + <el-select v-model="form.ruleCategory" placeholder="瑙勫垯绫诲瀷"> + <el-option + v-for="dict in dict.type.platform_rule_category" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="瑙勫垯鎻忚堪" prop="ruleDescription"> + <el-input v-model="form.ruleDescription" type="textarea" :autosize="{ minRows: 4, maxRows: 6}" placeholder="璇疯緭鍏ヨ鍒欏悕绉�"/> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + + + <!-- 瀹℃牳鑰冩牳瑙勫垯瀵硅瘽妗� --> + <el-dialog :title="title" :visible.sync="auditOpen" width="600px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="瑙勫垯鍚嶇О" prop="ruleName"> + <el-input v-model="form.ruleName" placeholder="璇疯緭鍏ヨ鍒欏悕绉�" disabled/> + </el-form-item> + <el-form-item label="鑰冩牳绫诲瀷" prop="examineCategory"> + <el-select v-model="form.examineCategory" placeholder="鑰冩牳绫诲瀷" disabled> + <el-option + v-for="dict in dict.type.platform_examine_category" + :key="dict.value" + :label="dict.label" + :value="parseInt(dict.value)" + /> + </el-select> + </el-form-item> + <el-form-item label="瑙勫垯绫诲瀷" prop="ruleCategory"> + <el-select v-model="form.ruleCategory" placeholder="鑰冩牳绫诲瀷" disabled> + <el-option + v-for="dict in dict.type.platform_rule_category" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="瑙勫垯鎻忚堪" prop="ruleDescription"> + <el-input v-model="form.ruleDescription" type="textarea" placeholder="璇疯緭鍏ヨ鍒欏悕绉�" disabled/> + </el-form-item> + + + <el-form-item label="瀹℃牳缁撴灉" prop="auditState" > + <el-radio-group v-model="form.auditState"> + <el-radio :label="1">閫氳繃</el-radio> + <el-radio :label="2">椹冲洖</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="瀹℃牳璇存槑" prop="auditDescription" > + <el-input v-model="form.auditDescription" type="textarea" show-word-limit maxlength="100" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + + </div> +</template> + +<script> +import { listCheckRule, getCheckRule, delCheckRule, addCheckRule, updateCheckRule } from "@/api/platform/check-rule"; +import { templateSelect} from "@/api/platform/check-template" +export default { + name: "CheckRule", + dicts: ['platform_audit_state','platform_examine_category','platform_rule_category'], + data() { + return { + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + templateList:[], + // 鑰冩牳瑙勫垯琛ㄦ牸鏁版嵁 + checkRuleList: [], + daterangeCreateTime: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏄惁鏄剧ず寮瑰嚭灞� + auditOpen: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + ruleName: null, + createTime: null, + ruleCategory: null, + templateId: null, + examineCategory: 1, + }, + videoData: [ + { name: '骞冲彴鍦ㄧ嚎鐜�', icon: 'el-icon-connection', ruleDescription: '鐪佸巺瀵瑰競绾у叡浜拰鑱旂綉骞冲彴杩涜瀹炴椂鐩戞祴锛屽競绾у叡浜�/鑱旂綉骞冲彴姣忔湀绂荤嚎鎬绘椂闀垮湪30鍒嗛挓浠ュ唴鐨勫钩鍙板湪绾跨巼涓�100%锛屾瘡瓒呰繃30鍒嗛挓鎵�10涓櫨鍒嗙偣锛屾墸瀹屼负姝€��' + + '姣忎釜鏈堝簳鏈�鍚�4涓伐浣滄棩涓洪鐣欑殑璋冭瘯鏃堕棿锛屽彲杩涜骞冲彴瀵规帴璋冭瘯鎴栬�呭崌绾ф敼閫狅紝骞冲彴瀵规帴璋冭瘯鎴栬�呭崌绾ф敼閫犻』鎻愬墠鍚戠渷鍘呮姤澶囥�傞櫎' + + '姣忔湀搴�4涓伐浣滄棩锛屽叾浣欐椂闂存姤澶囨瘡娆℃墸10涓櫨鍒嗙偣锛屾瘡娆℃姤澶囦笉瓒呰繃24灏忔椂锛屾瘡鏈堜笉瓒呰繃3娆°�傦紙閲嶅ぇ鐗规畩鎯呭喌锛屽閲嶅ぇ鑷劧鐏惧绛夋姤鍘呴瀵兼壒绀猴級', examineCategory:0,ruleCategory:'0', auditStatus: 'approved'}, + { name: '涓�鏈轰竴妗e悎鏍肩巼', icon: 'el-icon-folder', ruleDescription: '杩愮淮骞冲彴姣忔湀鍒濆鍚勫湴涓婁紶鑷宠仈缃戝钩鍙扮殑鈥滀竴鏈轰竴妗b�濇暟鎹簱涓殑鎽勫儚鏈烘。妗堟暟鎹繘琛岃川閲忔牎楠岋紝瀵瑰繀濉」濉姤鍑嗙‘銆佽鑼冪殑妗f鏁版嵁瑙嗕负鍚堟牸銆俓n' + + '涓�鏈轰竴妗e悎鏍肩巼=鍚堟牸鐨勬。妗堟暟鎹潯鏁�/妗f鏁版嵁鎬绘潯鏁�', examineCategory:0,ruleCategory:'0', auditStatus: 'pending' }, + { name: '涓�鏈轰竴妗f敞鍐岀巼', icon: 'el-icon-folder', ruleDescription: '杩愮淮骞冲彴姣忔湀瀵圭渷鍘呰鍥惧簱鐨勫墠绔憚鍍忔満鐐逛綅鏁伴噺鍜屼竴鏈轰竴妗g殑鏁版嵁鍖归厤銆傦紙涓婃湀搴曟渶鍚庝竴澶╃‘璁や竴鏈轰竴妗h溅杈嗐�佷汉鑴哥偣浣嶆暟锛�1鍙风敱瑙嗗浘搴撲晶杩涜鑰冩牳锛塡n' + + '浜鸿劯鍗″彛璧勪骇娉ㄥ唽鐜�=璧勪骇搴撶櫥璁板湪鐢ㄧ殑浜鸿劯鍗″彛鏁伴噺/锛堟湭娉ㄥ唽鐨勫湪绾夸汉鑴稿崱鍙f暟閲�+璧勪骇搴撶櫥璁板湪鐢ㄧ殑浜鸿劯鍗″彛鏁伴噺锛塡n' + + '杞﹁締鍗″彛璧勪骇娉ㄥ唽鐜�=璧勪骇搴撶櫥璁板湪鐢ㄧ殑浜鸿劯鍗″彛鏁伴噺/锛堟湭娉ㄥ唽鐨勫湪绾夸汉鑴稿崱鍙f暟閲�+璧勪骇搴撶櫥璁板湪鐢ㄧ殑浜鸿劯鍗″彛鏁伴噺锛�', examineCategory:0,ruleCategory:'0', auditStatus: 'rejected' }, + { name: '妗f鑰冩牳姣�', icon: 'el-icon-folder', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved' }, + { name: '鐐逛綅鍦ㄧ嚎鐜�', icon: 'el-icon-search', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved'}, + { name: '褰曞儚鍙敤鐜�', icon: 'el-icon-turn-off', ruleDescription: '鎻忚堪淇℃伅',examineCategory:0,ruleCategory:'0',auditStatus: 'approved'}, + { name: '鏍囨敞姝g‘鐜�', icon: 'el-icon-place', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved' }, + { name: '鏍℃椂姝g‘鐜�', icon: 'el-icon-place', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved' }, + { name: '閲嶇偣鐐逛綅鍦ㄧ嚎鐜�', icon: 'el-icon-place', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved'}, + { name: '閲嶇偣鐐逛綅鏍℃椂姝g‘鐜�', icon: 'el-icon-place', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved' }, + { name: '閲嶇偣鎸囨尌鍥惧儚鍦ㄧ嚎鐜�', icon: 'el-icon-place', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved' }, + { name: '瑙嗛鍥惧儚璧勬簮瀹夊叏绠$悊', icon: 'el-icon-place', ruleDescription: '鎻忚堪淇℃伅', examineCategory:0,ruleCategory:'0',auditStatus: 'approved' }, + ], + carData: [ + { name: '瑙嗗浘搴撳鎺ョǔ瀹氭��', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '鐐逛綅鍦ㄧ嚎鐜�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '鑱旂綉鍗″彛璁惧鐩綍涓�鑷寸巼', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛淇℃伅閲囬泦鍑嗙‘鐜�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁瀹屾暣鎬�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁鍑嗙‘鎬�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛璁惧鏃堕挓鍑嗙‘鎬�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁涓婁紶鍙婃椂鎬�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛璁惧url鍙敤鎬�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬�', icon: 'el-icon-truck', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + ], + faceData: [ + { name: '瑙嗗浘搴撳鎺ョǔ瀹氭��', icon: 'el-icon-alarm-clock', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '鐐逛綅鍦ㄧ嚎鐜�', icon: 'el-icon-user', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '鐩綍涓�鑷寸巼', icon: 'el-icon-data-line', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '浜鸿劯鍗″彛淇℃伅閲囬泦鍑嗙‘鐜�', icon: 'el-icon-timer', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '璁惧鎶撴媿鍥剧墖鍚堟牸鎬�', icon: 'el-icon-money', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '璁惧鎶撴媿鍥剧墖鏃堕挓鍑嗙‘鎬�', icon: 'el-icon-data-analysis', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '鎶撴媿浜鸿劯鏁版嵁涓婁紶鍙婃椂鎬�', icon: 'el-icon-data-analysis', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + { name: '浜鸿劯鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬�', icon: 'el-icon-data-analysis', ruleDescription: '鎻忚堪淇℃伅', auditStatus: 'approved' }, + ], + activeIndex: '0', + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + ruleName: [ + { required: true, message: "瑙勫垯鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } + ], + } + }; + }, + created() { + + }, + methods: { + groupData(data) { + // 灏嗘暟鎹寜姣忓叚涓竴缁勮繘琛屽垎缁� + const groupedData = []; + for (let i = 0; i < data.length; i += 6) { + groupedData.push(data.slice(i, i + 6)); + } + return groupedData; + }, + /** 鑰冩牳妯℃澘涓嬫媺鍒楄〃 */ + getTemplateSelect() { + templateSelect().then((res) => { + this.templateList = res.data; + }) + }, + /** 鏌ヨ鑰冩牳瑙勫垯鍒楄〃 */ + getList() { + this.loading = true; + if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { + this.queryParams["start"] = this.daterangeCreateTime[0]; + this.queryParams["end"] = this.daterangeCreateTime[1]; + } + listCheckRule(this.queryParams).then(response => { + this.checkRuleList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.auditOpen = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + ruleName: null, + ruleDetail: null, + videoPointNum: null, + vehicleCheckpointNum: null, + faceChceckpointNum: null, + createTime: null, + updateTime: null, + deleted: null + }; + this.resetForm("form"); + }, + handleSelect(key, keyPath) { + console.log(key, keyPath); + }, + getStatusColor(status) { + switch (status) { + case 'pending': + return '#ffffff'; // '#00a1d6'钃濊壊锛岃〃绀哄緟瀹℃牳 + case 'approved': + return '#ffffff'; // '#00e297'缁胯壊锛岃〃绀哄凡瀹℃牳 + case 'rejected': + return '#f56c6c'; // 绾㈣壊锛岃〃绀哄鏍告湭閫氳繃 + default: + return '#ffffff'; // 鐧借壊锛岄粯璁ょ姸鎬� + } + }, + + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "娣诲姞鑰冩牳瑙勫垯"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(item) { + this.reset(); + const id = item.id || this.ids + this.form = item; + this.open = true; + this.title = "淇敼鑰冩牳瑙勫垯"; + }, + /** 瀹℃牳鎸夐挳鎿嶄綔 */ + handleAudit(row) { + this.reset(); + const id = row.id || this.ids + getCheckRule(id).then(response => { + this.form = response.data; + this.auditOpen = true; + this.title = "瀹℃牳鑰冩牳瑙勫垯"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateCheckRule(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.auditOpen = false; + this.getList(); + }); + } else { + addCheckRule(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.auditOpen = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎鑰冩牳瑙勫垯缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { + return delCheckRule(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('system/checkRule/export', { + ...this.queryParams + }, `checkRule_${new Date().getTime()}.xlsx`) + } + } +}; +</script> + +<style scoped> +.container { + width: 90%; + margin: 10px auto; +} +.el-menu{ + margin: 10px auto; +} +</style> diff --git a/src/views/system/template/city/index.vue b/src/views/system/template/index.vue similarity index 87% rename from src/views/system/template/city/index.vue rename to src/views/system/template/index.vue index c38e5ef..1f715a7 100644 --- a/src/views/system/template/city/index.vue +++ b/src/views/system/template/index.vue @@ -1,7 +1,7 @@ <template> <div class="app-container"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="鐘舵��" prop="status"> + <!-- <el-form-item label="鐘舵��" prop="status"> <el-input v-model="queryParams.status" placeholder="璇疯緭鍏ョ姸鎬�" @@ -27,7 +27,17 @@ start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" ></el-date-picker> - </el-form-item> + </el-form-item> --> + <el-form-item label="鑰冩牳绫诲瀷" prop="examineCategory"> + <el-select v-model="queryParams.status" placeholder="鑰冩牳绫诲瀷" clearable @keyup.enter.native="handleQuery"> + <el-option + v-for="dict in dict.type.platform_examine_category" + :key="dict.value" + :label="dict.label" + :value="parseInt(dict.value)" + /> + </el-select> + </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> @@ -44,7 +54,7 @@ @click="handleAdd" >鏂板</el-button> </el-col> - <el-col :span="1.5"> + <!-- <el-col :span="1.5"> <el-button type="success" plain @@ -62,7 +72,7 @@ size="mini" :disabled="multiple" @click="handleDelete" - >鍒犻櫎</el-button> + >鍒犻櫎</el-button> --> </el-col> <el-col :span="1.5"> <el-button @@ -76,34 +86,19 @@ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> - <el-table v-loading="loading" :data="checkTemplateList" @selection-change="handleSelectionChange"> - <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="妯℃澘鍚嶇О" align="center" prop="templateName" width="220px"/> - <el-table-column label="鑰冩牳绫诲瀷" align="center" prop="examineCategory" > - <template slot-scope="scope"> - <dict-tag :options="dict.type.platform_examine_category" :value="scope.row.examineCategory"/> - </template> - </el-table-column> - <el-table-column label="鑰冩牳瀵硅薄" align="center" prop="deptId" width="400px" /> - <el-table-column label="璋冩暣绯绘暟" align="center" prop="adjustCoefficient" /> - <el-table-column label="璋冩暣绯绘暟璁$畻鏂瑰紡" align="center" prop="adjustWay"/> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> - <template slot-scope="scope"> - <el-button - size="mini" - type="text" - icon="el-icon-edit" - @click="handleUpdate(scope.row)" - >淇敼</el-button> - <el-button - size="mini" - type="text" - icon="el-icon-delete" - @click="handleDelete(scope.row)" - >鍒犻櫎</el-button> - </template> - </el-table-column> - </el-table> + <el-card class="box-card" v-for="item in checkTemplateList" :key="item"> + <div class="text item">妯℃澘鍚嶇О锛歿{ item.templateName }}</div> + <div class="text item">鑰冩牳绫诲瀷锛歿{ item.examineCategory == 0 ? '鐪佸巺鑰冩牳' : '鍖哄煙鑰冩牳' }}</div> + <div class="text item">鑰冩牳瀵硅薄锛歿{ item.deptId }}</div> + <div class="text item">鍙戝竷鐘舵�侊細{{ item.status == 0 ? '鍚敤' : '鍋滅敤' }}</div> + <div class="bottom clearfix"> + <el-button type="text" class="button" @click="">瀹℃牳</el-button> + <el-button type="text" class="button" @click="">鍙戝竷</el-button> + <el-button type="text" class="button" @click="">澶嶅埗</el-button> + <el-button type="text" class="button" @click="handleUpdate(item)">淇敼</el-button> + <el-button type="text" class="button" @click="handleDelete(item)">鍒犻櫎</el-button> + </div> + </el-card> <pagination v-show="total>0" @@ -435,4 +430,18 @@ display: flex; flex-direction: row; } +.text { + font-size: 14px; + } + + .item { + margin-bottom: 18px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .box-card { + width: 20%; + } </style> diff --git a/src/views/system/template/province/index.vue b/src/views/system/template/province/index.vue deleted file mode 100644 index 2ed927d..0000000 --- a/src/views/system/template/province/index.vue +++ /dev/null @@ -1,471 +0,0 @@ -<template> - <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="鐘舵��" prop="status"> - <el-input - v-model="queryParams.status" - placeholder="璇疯緭鍏ョ姸鎬�" - clearable - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <el-form-item label="鑰冩牳瀵硅薄" prop="unitName"> - <el-input - v-model="queryParams.status" - placeholder="璇疯緭鍏ヨ�冩牳瀵硅薄" - clearable - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <el-form-item label="鍒涘缓鏃堕棿"> - <el-date-picker - v-model="daterangeCreateTime" - style="width: 240px" - value-format="yyyy-MM-dd" - type="daterange" - range-separator="-" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" - ></el-date-picker> - </el-form-item> - <el-form-item> - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> - </el-form-item> - </el-form> - - <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> - <el-button - type="primary" - plain - icon="el-icon-plus" - size="mini" - @click="handleAdd" - >鏂板</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="success" - plain - icon="el-icon-edit" - size="mini" - :disabled="single" - @click="handleUpdate" - >淇敼</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="danger" - plain - icon="el-icon-delete" - size="mini" - :disabled="multiple" - @click="handleDelete" - >鍒犻櫎</el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="warning" - plain - icon="el-icon-download" - size="mini" - @click="handleExport" - >瀵煎嚭</el-button> - </el-col> - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> - </el-row> - - <el-table v-loading="loading" :data="checkTemplateList" @selection-change="handleSelectionChange"> - <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="妯℃澘鍚嶇О" align="center" prop="templateName" width="220px"/> - <el-table-column label="鑰冩牳绫诲瀷" align="center" prop="examineCategory" /> - <el-table-column label="鑰冩牳瀵硅薄" align="center" prop="unitId" width="400px" > - <template slot-scope="scope"> - <div v-if="scope.row.unitId === 2">鎴愰兘x杩愮淮</div> - <div v-else-if="scope.row.unitId === 3">瀵岄『鍘�,鑽e幙,楂樻柊鍖�,鑷祦浜曞尯,璐′簳鍖�,澶у畨鍖�,娌挎哗鍖�</div> - </template> - </el-table-column> - <el-table-column label="璋冩暣绯绘暟" align="center" prop="adjustCoefficient" /> - <el-table-column label="璋冩暣绯绘暟璁$畻鏂瑰紡" align="center" prop="adjustWay"/> - <el-table-column label="鐘舵��" align="center" prop="status" /> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> - <template slot-scope="scope"> - <el-button - size="mini" - type="text" - icon="el-icon-edit" - @click="handleUpdate(scope.row)" - >淇敼</el-button> - <el-button - size="mini" - type="text" - icon="el-icon-delete" - @click="handleDelete(scope.row)" - >鍒犻櫎</el-button> - </template> - </el-table-column> - </el-table> - - <pagination - v-show="total>0" - :total="total" - :page.sync="queryParams.pageNum" - :limit.sync="queryParams.pageSize" - @pagination="getList" - /> - - <!-- 娣诲姞鎴栦慨鏀硅�冩牳妯℃澘瀵硅瘽妗� --> - <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> - <el-form ref="form" :model="form" :rules="rules" label-width="80px"> - <el-form-item label="妯℃澘鍚嶇О" prop="templateName"> - <el-input v-model="form.templateName" placeholder="璇疯緭鍏ユā鏉垮悕绉�" /> - </el-form-item> - <el-form-item label="鑰冩牳绫诲瀷" prop="examineCategory"> - <el-select v-model="form.examineCategory" placeholder="璇烽�夋嫨鑰冩牳绫诲瀷"> - <el-option label="鐪佸巺鑰冩牳" value="鐪佸巺鑰冩牳"/> - <el-option label="鍖哄幙鑰冩牳" value="鍖哄幙鑰冩牳"/> - <el-option label="杩愮淮鑰冩牳" value="鍏徃鑰冩牳"/> - </el-select> - </el-form-item> - <el-form-item label="鑰冩牳瀵硅薄" prop="unitName"> - <div class="block"> - <span class="demonstration"></span> - <el-cascader - v-model="value" - :options="options" - :props = "props" - @change="handleChange"></el-cascader> - </div> - - </el-form-item> - <el-form-item label="鑰冩牳瑙勫垯" prop="tempRuleFormList"> - <div class="row-warp"> - <div class="row" v-for="(form) in tempRuleFormList"> - <div class="row-left"> - <div>瑙勫垯</div> - <div class="margin-5"> - <el-select v-model="form.ruleId" placeholder="璇烽�夋嫨"> - <el-option - v-for="item in ruleList" - :key="item.id" - :label="item.value" - :value="item.id"> - </el-option> - </el-select> - </div> - </div> - <div class="row-right"> - <div>鏉冮噸</div> - <div class="margin-5"> - <el-input type="number" v-model="form.weight"/> - </div> - </div> - <div class="item-op"> - <el-button @click="removeRule(form)" type="danger" icon="el-icon-delete" circle></el-button> - </div> - </div> - <div style="margin-top: 25px"> - <el-button type="success" @click="nextAdd" size="mini" plain>娣诲姞</el-button> - </div> - </div> - </el-form-item> - <el-form-item label="璋冩暣绯绘暟" prop="adjustCoefficient"> - <el-input v-model="form.adjustCoefficient" placeholder="璇疯緭鍏ョ郴鏁板��" /> - </el-form-item> - <el-form-item label="璋冩暣鏂瑰紡" prop="adjustWay"> - <el-select v-model="form.adjustWay" placeholder="璇烽�夋嫨璋冩暣绯绘暟璁$畻鏂瑰紡"> - <el-option - label="涔�" - value="*"> - </el-option> - <el-option - label="闄�" - value="/"> - </el-option> - </el-select> - </el-form-item> - <el-form-item label="鐘舵��" prop="status"> - <el-radio v-model="form.status" label="use">鍚敤</el-radio> - <el-radio v-model="form.status" label="stop">鍋滅敤</el-radio> - </el-form-item> - </el-form> - <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> - <el-button @click="cancel">鍙� 娑�</el-button> - </div> - </el-dialog> - </div> -</template> - -<script> -import { listCheckTemplate, getCheckTemplate, delCheckTemplate, addCheckTemplate, updateCheckTemplate } from "@/api/platform/check-template"; -// import { ruleSelect } from '@/api/platform/check-rule' -import { unitSelect } from '@/api/platform/unit' - -export default { - name: "CheckTemplate", - data() { - return { - props: { multiple: true }, - value: [], - options: [{ - value: 'city', - label: '鍖哄幙', - children: [{ - value: 'fushun', - label: '瀵岄『鍘�', - }, { - value: 'rong', - label: '鑽e幙', - },{ - value: 'gaoxin', - label: '楂樻柊鍖�', - },{ - value: 'ziliujing', - label: '鑷祦浜曞尯', - },{ - value: 'gongjing', - label: '璐′簳鍖�', - },{ - value: 'daan', - label: '澶у畨鍖�', - },{ - value: 'yantan', - label: '娌挎哗鍖�', - }, - ] - }, { - value: 'company', - label: '鍏徃', - children: [{ - value: 'yunwei', - label: '鎴愰兘x杩愮淮', - }, { - value: 'yunwei2', - label: '鑷础x杩愮淮', - }, ] - }, - ], - ruleList: [], - unitList: [], - // 涓存椂瑙勫垯琛ㄥ崟 - tempRuleForm: {}, - // 涓存椂瑙勫垯琛ㄥ崟鍒楄〃 - tempRuleFormList: [{"ruleId": null, "adjustCoefficient": null}], - // 鏈�缁� - ruleFormList: [], - // 閬僵灞� - loading: true, - // 閫変腑鏁扮粍 - ids: [], - // 闈炲崟涓鐢� - single: true, - // 闈炲涓鐢� - multiple: true, - // 鏄剧ず鎼滅储鏉′欢 - showSearch: true, - // 鎬绘潯鏁� - total: 0, - // 鑰冩牳妯℃澘琛ㄦ牸鏁版嵁 - checkTemplateList: [], - // 寮瑰嚭灞傛爣棰� - title: "", - // 鏄惁鏄剧ず寮瑰嚭灞� - open: false, - // 鐘舵�佹椂闂磋寖鍥� - daterangeCreateTime: [], - // 鏌ヨ鍙傛暟 - queryParams: { - pageNum: 1, - pageSize: 10, - status: null, - createTime: null, - }, - // 琛ㄥ崟鍙傛暟 - form: {}, - // 琛ㄥ崟鏍¢獙 - rules: { - templateName: [ - { required: true, message: "妯℃澘鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } - ], - adjustCoefficient: [ - { required: true, message: "璋冩暣绯绘暟涓嶈兘涓虹┖", trigger: "blur" } - ], - adjustWay: [ - { required: true, message: "璋冩暣鏂瑰紡锛氫箻闄や笉鑳戒负绌�", trigger: "blur" } - ], - } - }; - }, - created() { - this.getList(); - this.selectCheckRule(); - this.selectUnit(); - }, - methods: { - handleChange(value) { - console.log(value); - }, - removeRule(form) { - console.log(form) - this.ruleFormList = this.ruleFormList.filter(item => item !== form); - this.tempRuleFormList = this.tempRuleFormList.filter(item => item !== form) - }, - nextAdd() { - // if (this.tempRuleFormList.length === 0) { - // this.tempRuleFormList.push({"ruleId": null, "weight": null}) - // } else { - // this.ruleFormList.push(this.tempRuleForm); - // this.tempRuleFormList.push(this.tempRuleForm); - // this.tempRuleForm = {}; - // } - this.tempRuleFormList.push({"ruleId": null, "weight": null}) - }, - // 鑰冩牳瑙勫垯涓嬫媺鏁版嵁 - // selectCheckRule() { - // ruleSelect().then(res => { - // this.ruleList = res.data; - // }) - // }, - // 杩愮淮鍏徃涓嬫媺鏁版嵁 - selectUnit() { - unitSelect().then(res => { - this.unitList = res.data; - }) - }, - /** 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */ - getList() { - this.loading = true; - if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { - this.queryParams["start"] = this.daterangeCreateTime[0]; - this.queryParams["end"] = this.daterangeCreateTime[1]; - } - listCheckTemplate(this.queryParams).then(response => { - this.checkTemplateList = response.data; - this.total = response.total; - this.loading = false; - }); - }, - // 鍙栨秷鎸夐挳 - cancel() { - this.open = false; - this.reset(); - }, - // 琛ㄥ崟閲嶇疆 - reset() { - this.form = { - id: null, - adjustCoefficient: null, - adjustWay: null, - status: null, - createTime: null, - updateTime: null, - deleted: null - }; - this.resetForm("form"); - }, - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, - /** 閲嶇疆鎸夐挳鎿嶄綔 */ - resetQuery() { - this.daterangeCreateTime = []; - this.resetForm("queryForm"); - this.handleQuery(); - }, - // 澶氶�夋閫変腑鏁版嵁 - handleSelectionChange(selection) { - this.ids = selection.map(item => item.id) - this.single = selection.length!==1 - this.multiple = !selection.length - }, - /** 鏂板鎸夐挳鎿嶄綔 */ - handleAdd() { - this.reset(); - this.open = true; - this.title = "娣诲姞鑰冩牳妯℃澘"; - }, - /** 淇敼鎸夐挳鎿嶄綔 */ - handleUpdate(row) { - this.reset(); - const id = row.id || this.ids - getCheckTemplate(id).then(response => { - this.form = response.data; - this.tempRuleFormList = this.form.ruleFormList; - this.ruleFormList = this.form.ruleFormList; - this.open = true; - this.title = "淇敼鑰冩牳妯℃澘"; - }); - }, - /** 鎻愪氦鎸夐挳 */ - submitForm() { - this.$refs["form"].validate(valid => { - if (valid) { - this.form.ruleFormList = this.tempRuleFormList; - if (this.form.id != null) { - updateCheckTemplate(this.form).then(response => { - this.$modal.msgSuccess("淇敼鎴愬姛"); - this.open = false; - this.tempRuleFormList = []; - this.form = {}; - this.getList(); - }); - } else { - addCheckTemplate(this.form).then(response => { - this.$modal.msgSuccess("鏂板鎴愬姛"); - this.open = false; - this.getList(); - }); - } - } - }); - }, - /** 鍒犻櫎鎸夐挳鎿嶄綔 */ - handleDelete(row) { - const ids = row.id || this.ids; - this.$modal.confirm('鏄惁纭鍒犻櫎鑰冩牳妯℃澘缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { - return delCheckTemplate(ids); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); - }, - /** 瀵煎嚭鎸夐挳鎿嶄綔 */ - handleExport() { - this.download('system/checkTemplate/export', { - ...this.queryParams - }, `checkTemplate_${new Date().getTime()}.xlsx`) - } - } -}; -</script> - -<style scoped> -.margin-5 { - margin-left: 5px; -} -.row-warp { - display: flex; - flex-direction: column; -} -.row { - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - margin: 5px 0; -} -.row-left { - flex: 1; - display: flex; - flex-direction: row; -} -.row-right { - flex: 1; - display: flex; - flex-direction: row; -} -</style> -- Gitblit v1.8.0