From 91513e171078ed6b0887f87b9fced33895d6d3fb Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 08 七月 2025 08:35:50 +0800 Subject: [PATCH] 2025.7.8 --- src/enum/device/device.js | 24 ++ src/enum/device/monitorDevice.js | 77 ++++++ src/views/visualization/SubtaskVisual.vue | 2 src/components/inspection/SceneDevice.vue | 392 +++++++++++++++++-------------- src/enum/device/treatmentDevice.js | 75 ++++++ src/views/visualization/SupervisionVisual.vue | 2 src/views/management/TaskStats.vue | 24 + src/enum/device/productionDevice.js | 67 +++++ src/components.d.ts | 7 src/components/inspection/TaskItem.vue | 5 src/views/main/MonitorView.vue | 3 11 files changed, 495 insertions(+), 183 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index 3f60b91..8b4b89b 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -11,15 +11,22 @@ BaseMap: typeof import('./components/map/BaseMap.vue')['default'] BaseTable: typeof import('./components/BaseTable.vue')['default'] CoreHeader: typeof import('./components/core/CoreHeader.vue')['default'] + ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElCalendar: typeof import('element-plus/es')['ElCalendar'] ElCard: typeof import('element-plus/es')['ElCard'] ElCascader: typeof import('element-plus/es')['ElCascader'] ElCol: typeof import('element-plus/es')['ElCol'] + ElCollapse: typeof import('element-plus/es')['ElCollapse'] + ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] + ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] + ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElEmpty: typeof import('element-plus/es')['ElEmpty'] + ElForm: typeof import('element-plus/es')['ElForm'] + ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElLink: typeof import('element-plus/es')['ElLink'] diff --git a/src/components/inspection/SceneDevice.vue b/src/components/inspection/SceneDevice.vue index 18a8f77..fb0e95f 100644 --- a/src/components/inspection/SceneDevice.vue +++ b/src/components/inspection/SceneDevice.vue @@ -4,158 +4,190 @@ <!-- 閫夐」 --> <!-- 璁惧绫诲瀷 --> <el-row> - <el-col> - <el-tabs class="child_select" placeholder="璁惧绫诲瀷" v-model="currSelect.topDeviceTypeId"> - <el-tab-pane v-for="item in deviceTopTypes" :key="item.id" :name="item.id"> - <template #label> - <el-badge :value="item.count" :type="item.count == 0 ? 'danger' : 'primary'"> - <span class="custom-tabs-label"> - <span>{{ item.label }}</span> - </span> - </el-badge> - </template> - </el-tab-pane> - </el-tabs> - </el-col> + <el-tabs style="width: 100%" placeholder="璁惧绫诲瀷" v-model="currSelect.topDeviceTypeId"> + <el-tab-pane v-for="item in deviceTopTypes" :key="item.id" :name="item.id"> + <template #label> + <el-badge :value="item.count" :type="item.count == 0 ? 'danger' : 'primary'"> + <span class="custom-tabs-label"> + <span>{{ item.label }}</span> + </span> + </el-badge> + </template> + </el-tab-pane> + </el-tabs> </el-row> - <el-collapse v-model="activeNames" style="border: 4px"> - <el-collapse-item - v-for="item in formInfo" - :key="item.id" - :name="item.id" - class="collapse-item-class" - > - <template #title> - <div style="display: flex; width: 100%; justify-content: space-between"> - <div style=""> - <el-descriptions style="" :column="3" size="small" border> - <el-descriptions-item - width="64px" - :label="currSelect.topDeviceTypeId == 0 ? '绔欑偣鍚嶇О' : '璁惧鍚嶇О'" - :span="3" - >{{ item.name || '鏃�' }}</el-descriptions-item - > - <el-descriptions-item label="渚涘簲鍟�">{{ - item.supplier || '鏃�' - }}</el-descriptions-item> - <el-descriptions-item label="杩愮淮鍟�">{{ - item.maintainer || '鏃�' - }}</el-descriptions-item> - <el-descriptions-item label="杩愮淮棰戞"> - <el-select - v-model="item.maintainFrequency" - :disabled="isDisabled" - style="width: 150px" - > - <el-option - v-for="frequency of maintainFrequencysArray" - :key="frequency.key" - :label="frequency.value" - :value="frequency.key" - ></el-option> - </el-select> - </el-descriptions-item> - <el-descriptions-item label="杩愮淮浜哄憳">{{ - item.maintainStaff || '鏃�' - }}</el-descriptions-item> - <el-descriptions-item label="杩愮淮鑱旂郴鏂瑰紡">{{ - item.maintainTel || '鏃�' - }}</el-descriptions-item> - <el-descriptions-item label="鍝佺墝鍨嬪彿">{{ - item.brandModel || '鏃�' - }}</el-descriptions-item> - <el-descriptions-item label="杩愯鐘舵��"> - <el-select v-model="item.runningStatus" :disabled="isDisabled" style="width: 150px"> - <el-option - v-for="status of runStatusArray" - :key="status.key" - :label="status.value" - :value="status.key" - ></el-option> - </el-select> - </el-descriptions-item> - <el-descriptions-item label="绫诲瀷"> - {{ item._typename || '鏃�' }} - </el-descriptions-item> - </el-descriptions> - </div> - - <div style="display: flex"> - <!-- <div class="sub-title">{{ item.name }}</div> --> - <!-- 鍥剧墖 --> - <div class="image-container"> - <div - class="block-div" - @click="onClickPic($event)" - v-for="(status, index) in item._statusList" - :key="index" - > - <el-image - v-if="index == 0" - fit="cover" - class="pic-style" - :src="status._picUrl" - :preview-src-list="Array.of(status._picUrl)" - /> - <span class="abstract_pic_text" v-if="index == 0">{{ - `鏈�鏂扮姸鎬佸浘鐗� ${status.dlCreateTime.slice(0, 10)}` - }}</span> + <el-scrollbar :height="height" v-loading="loading"> + <!-- <el-collapse v-model="activeNames" style="border: 4px"> --> + <!-- <el-collapse-item + v-for="item in formInfo" + :key="item.id" + :name="item.id" + class="collapse-item-class" + > --> + <!-- <template #title> --> + <div v-for="item in formInfo" :key="item.id" :name="item.id" class="collapse-item-class"> + <el-card class="m-b-10"> + <div style="text-align: start"> + <el-row> + <el-col :span="12"> + <div> + <el-text>{{ + (currSelect.topDeviceTypeId == 0 ? '绔欑偣鍚嶇О锛�' : '璁惧鍚嶇О锛�') + + (item.name || '鏃�') + }}</el-text> </div> - </div> - </div> + <template v-if="item._showMore"> + <div> + <el-text>{{ '渚涘簲鍟嗭細' + (item.supplier || '鏃�') }}</el-text> + </div> + <div> + <el-text>{{ '杩愮淮鍟嗭細' + (item.maintainer || '鏃�') }}</el-text> + </div> + <el-space> + <el-text>{{ '杩愮淮棰戞锛�' }}</el-text> + <el-select + v-model="item.maintainFrequency" + :disabled="isDisabled" + style="width: 100px" + > + <el-option + v-for="frequency of maintainFrequencysArray" + :key="frequency.key" + :label="frequency.value" + :value="frequency.key" + ></el-option> + </el-select> + </el-space> + </template> + </el-col> + <el-col :span="12"> + <div> + <el-text>{{ '绫诲瀷锛�' + (item._typename || '鏃�') }}</el-text> + </div> + <template v-if="item._showMore"> + <div> + <el-text>{{ '杩愮淮浜哄憳锛�' + (item.maintainStaff || '鏃�') }}</el-text> + </div> + <div> + <el-text>{{ '鑱旂郴鏂瑰紡锛�' + (item.maintainTel || '鏃�') }}</el-text> + </div> + <div> + <el-text>{{ '鍝佺墝鍨嬪彿锛�' + (item.brandModel || '鏃�') }}</el-text> + </div> + <el-space> + <el-text>{{ '杩愯鐘舵�侊細' }}</el-text> + <el-select + v-model="item.runningStatus" + :disabled="isDisabled" + style="width: 100px" + > + <el-option + v-for="status of runStatusArray" + :key="status.key" + :label="status.value" + :value="status.key" + ></el-option> + </el-select> + </el-space> + </template> + </el-col> + </el-row> + <el-row justify="end"> + <el-link type="success" @click="item._showMore = !item._showMore"> + <el-icon> + <Bottom v-if="!item._showMore" /> + <Top v-else /> + </el-icon> + {{ item._showMore ? '鏀惰捣鏇村' : '鏇村淇℃伅' }} + </el-link> + </el-row> + <!-- <div style="display: flex"> + <div class="image-container"> + <div + class="block-div" + @click="onClickPic($event)" + v-for="(status, index) in item._statusList" + :key="index" + > + <el-image + v-if="index == 0" + fit="cover" + class="pic-style" + :src="status._picUrl" + :preview-src-list="Array.of(status._picUrl)" + /> + <span class="abstract_pic_text" v-if="index == 0">{{ + `鏈�鏂扮姸鎬佸浘鐗� ${status.dlCreateTime.slice(0, 10)}` + }}</span> + </div> + </div> + </div> --> </div> - </template> - <!-- 璇︾粏鍐呭寮�濮� --> - <el-form :model="item" class="form_class"> - <el-form-item label="鐘舵��"> + <!-- </template> --> + <!-- 璇︾粏鍐呭寮�濮� --> + <el-space> + <div> + <div>璁�</div> + <div>澶�</div> + <div>鐘�</div> + <div>鎬�</div> + </div> <el-tabs tab-position="top"> <el-tab-pane v-for="(status, i) in item._statusList" :label="status.dlCreateTime.slice(0, 10)" :key="i" > - <el-form :model="status" class="form-class"> - <el-form-item label="浣嶇疆" style="margin-bottom: 10px"> - {{ status.dlLocation }} - </el-form-item> - <el-form-item label="鍥剧墖"> - <!-- 鍥剧墖 --> - <el-space> - <div v-if="status._paths && status._paths.length > 0"> - <el-image - v-for="(path, i) in status._paths" - fit="cover" - class="pic-style" - :src="path" - :preview-src-list="Array.of(path)" - :key="i" - /> - </div> - <el-empty v-else></el-empty> - </el-space> - </el-form-item> - </el-form> + <!-- <el-form :model="status" class="form-class"> --> + <!-- <el-form-item label=""> --> + <!-- 鍥剧墖 --> + <el-space> + <div v-if="status._paths && status._paths.length > 0"> + <el-image + v-for="(path, i) in status._paths" + fit="cover" + class="pic-style" + :src="path" + :preview-src-list="Array.of(path)" + :key="i" + /> + </div> + <el-empty v-else></el-empty> + </el-space> + <!-- </el-form-item> --> + <el-form-item v-if="status.dlLocation" label="浣嶇疆" style="margin-bottom: 10px"> + {{ status.dlLocation }} + </el-form-item> + <!-- </el-form> --> </el-tab-pane> </el-tabs> - </el-form-item> - </el-form> - <!-- 璇︾粏鍐呭缁撴潫 --> - </el-collapse-item> - </el-collapse> - <!-- 绌虹姸鎬� --> - <el-empty v-if="isEmpty" /> + </el-space> + </el-card> + </div> + + <!-- 璇︾粏鍐呭缁撴潫 --> + <!-- </el-collapse-item> --> + <!-- </el-collapse> --> + <!-- 绌虹姸鎬� --> + <el-empty v-if="isEmpty" /> + </el-scrollbar> <!-- </template> </CompGenericWrapper> --> </template> <script> +import { reactive } from 'vue' import deviceApi from '@/api/fysp/deviceApi' import { $fysp } from '@/api/index' import { toLabel } from '@/enum/device/device' export default { components: {}, props: { - scene: Object + scene: Object, + height: { + type: String, + default: '70vh' + } }, watch: { // 閫夋嫨鏀瑰彉鐩戝惉 @@ -164,10 +196,16 @@ this.getList() }, deep: true + }, + scene(nV, oV) { + if (nV != oV) { + this.init() + } } }, data() { return { + loading: false, activeNames: [], // 鎺у埗鏄惁灞曠ず绌虹姸鎬� isEmpty: false, @@ -180,7 +218,7 @@ }, // 鎺у埗琛ㄥ崟鏄惁鍙互缂栬緫 isDisabled: true, - formInfo: {}, + formInfo: [], rules: [], // 璁惧绫诲瀷 deviceTopTypes: [ @@ -206,8 +244,7 @@ ownershipArray: [ { key: 0, value: '璐拱' }, { key: 1, value: '绉熻祦' } - ], - scene: {} + ] } }, @@ -234,10 +271,7 @@ showDetail(item) { item._isDetail = !item._isDetail }, - init(scene) { - // 鐖剁粍浠朵富鍔ㄨ皟鐢ㄥ垵濮嬪寲瀛愮粍浠剁殑鏂规硶 - this.scene = scene - + init() { this.getList() this.getTabsCount() }, @@ -262,51 +296,55 @@ newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1) newObj[newKey] = obj[key] } - return newObj + return reactive(newObj) }, // 鏂板瀛楁 initFormData(data) { data._isDetail = false }, getList() { - deviceApi.fetchDevices(this.scene.guid, this.currSelect.topDeviceTypeId).then((result) => { - this.initList() - if (result.data == null || result.data.length <= 0) { - this.isEmpty = true - return - } - // 鏍囧噯鍖栧睘鎬у悕 - for (let index = 0; index < result.data.length; index++) { - var element = this.convertKeys(result.data[index]) - this.initFormData(element) - // 鑾峰彇璁惧鐘舵�佷俊鎭� - let data = { - deviceId: element.id, - sceneId: element.sceneGuid, - deviceTypeId: this.currSelect.topDeviceTypeId + this.loading = true + deviceApi + .fetchDevices(this.scene.guid, this.currSelect.topDeviceTypeId) + .then((result) => { + this.initList() + if (result.data == null || result.data.length <= 0) { + this.isEmpty = true + return } - deviceApi.fetchDeviceStatus(data).then((status) => { - var statusData = status.data - var imgPaths = [] - if (statusData) { - if (statusData.length == 0) { - this.formInfo.push(element) - return - } - element = this.convertKeys(result.data[index]) - element = this.setDeviceType(element) - element._picUrls = imgPaths - for (let index = 0; index < statusData.length; index++) { - const statusItem = statusData[index] - // 璁惧瀵硅薄娣诲姞涓�涓睘鎬у垪琛ㄥ睘鎬х敤鏉ヤ繚瀛樿澶囩姸鎬� - this.saveStatus(element, statusItem) - element.dlLocation = statusItem.dlLocation - this.formInfo.push(element) - } + // 鏍囧噯鍖栧睘鎬у悕 + for (let index = 0; index < result.data.length; index++) { + var element = this.convertKeys(result.data[index]) + this.initFormData(element) + // 鑾峰彇璁惧鐘舵�佷俊鎭� + let data = { + deviceId: element.id, + sceneId: element.sceneGuid, + deviceTypeId: this.currSelect.topDeviceTypeId } - }) - } - }) + deviceApi.fetchDeviceStatus(data).then((status) => { + var statusData = status.data + var imgPaths = [] + if (statusData) { + if (statusData.length == 0) { + this.formInfo.push(element) + return + } + element = this.convertKeys(result.data[index]) + element = this.setDeviceType(element) + element._picUrls = imgPaths + for (let index = statusData.length - 1; index >= 0; index--) { + const statusItem = statusData[index] + // 璁惧瀵硅薄娣诲姞涓�涓睘鎬у垪琛ㄥ睘鎬х敤鏉ヤ繚瀛樿澶囩姸鎬� + this.saveStatus(element, statusItem) + element.dlLocation = statusItem.dlLocation + } + this.formInfo.push(element) + } + }) + } + }) + .finally(() => (this.loading = false)) }, setDeviceType(element) { var type = [] @@ -330,7 +368,7 @@ } // 鎺掑簭 device._statusList.sort(function (x, y) { - return new Date(x.dlCreateTime) - new Date(y.dlCreateTime) // 闄嶅簭锛屽崌搴忓垯鍙嶄箣 + return new Date(y.dlCreateTime) - new Date(x.dlCreateTime) // 闄嶅簭锛屽崌搴忓垯鍙嶄箣 }) }, submit() {}, @@ -390,8 +428,8 @@ /* overflow: hidden; 纭繚鍥剧墖涓嶄細瓒呭嚭瀹瑰櫒 */ } .pic-style { - width: 150px; - height: 150px; + width: 100px; + height: 100px; border-radius: 4px; } .card-style { diff --git a/src/components/inspection/TaskItem.vue b/src/components/inspection/TaskItem.vue index dcd6f49..fb1e1e7 100644 --- a/src/components/inspection/TaskItem.vue +++ b/src/components/inspection/TaskItem.vue @@ -85,7 +85,7 @@ <div> <div class="text_title">鏃ョ▼杩涘害</div> <el-space> - <el-text style="color: transparent;">鏃ョ▼</el-text> + <el-text style="color: transparent">鏃ョ▼</el-text> <el-progress style="width: 350px" type="line" @@ -130,7 +130,7 @@ return planEndTime.daysInMonth() } }) -const dateStr = computed(()=>{ +const dateStr = computed(() => { const today = dayjs() const planEndTime = dayjs(areaStore.area.endtime) if (today.isBefore(planEndTime)) { @@ -160,6 +160,7 @@ box-shadow: var(--el-box-shadow-lighter); background-color: rgba(161, 161, 161, 0.068); padding: 8px 8px; + margin-bottom: 4px; } .text_title { diff --git a/src/enum/device/device.js b/src/enum/device/device.js new file mode 100644 index 0000000..842bd36 --- /dev/null +++ b/src/enum/device/device.js @@ -0,0 +1,24 @@ +import monitor from './monitorDevice'; +import treatment from './treatmentDevice'; +import production from './productionDevice'; + +function enumDevice() { + return [ + { value: 0, label: '鐩戞帶璁惧' }, + { value: 1, label: '娌荤悊璁惧' }, + { value: 2, label: '鐢熶骇璁惧' } + ]; +} + +function toLabel(sceneType, deviceType, valueArr) { + switch (deviceType + '') { + case '0': + return monitor.toLabel(sceneType, valueArr); + case '1': + return treatment.toLabel(sceneType, valueArr); + case '2': + return production.toLabel(sceneType, valueArr); + } +} + +export { enumDevice, toLabel }; diff --git a/src/enum/device/monitorDevice.js b/src/enum/device/monitorDevice.js new file mode 100644 index 0000000..76cd9c8 --- /dev/null +++ b/src/enum/device/monitorDevice.js @@ -0,0 +1,77 @@ +const dustDeviceType = [ + { + label: '鎵皹', + value: '1', + children: [ + { + label: '鐩戞祴璁惧', + value: '1', + }, + ], + }, +]; + +const fumeDeviceType = [ + { + label: '娌圭儫', + value: '1', + children: [ + { + label: '鐩戞祴璁惧', + value: '1', + }, + ], + }, +]; + +const vocDeviceType = [ + { + label: 'VOC', + value: '1', + children: [ + { + label: '鐩戞祴璁惧', + value: '1', + }, + ], + }, +]; + +// 鐩戞祴璁惧绫诲瀷 +function monitorDevices(sceneType) { + switch (parseInt(sceneType)) { + // 宸ュ湴,鐮佸ご,鎼呮媽绔�,鍫嗗満 + case 1: + case 2: + case 3: + case 14: + return dustDeviceType; + // 椁愰ギ + case 5: + return fumeDeviceType; + // 宸ヤ笟浼佷笟,姹戒慨 + case 4: + case 6: + return vocDeviceType; + default: + return dustDeviceType; + } +} + +function toLabel(sceneType, valueArr) { + const labelArr = []; + let options = monitorDevices(sceneType); + valueArr.forEach(v => { + if (options) { + const op = options.find(o => { + return (o.value + '') == (v + ''); + }); + labelArr.push(op.label); + options = op.children; + } + }); + + return labelArr; +} + +export default { monitorDevices, toLabel }; diff --git a/src/enum/device/productionDevice.js b/src/enum/device/productionDevice.js new file mode 100644 index 0000000..70ba509 --- /dev/null +++ b/src/enum/device/productionDevice.js @@ -0,0 +1,67 @@ +const dustDeviceType = [ + { + label: '闈為亾', + value: '1', + children: [ + { label: '鎸栨帢鏈�', value: '1' }, + { label: '鍙夎溅', value: '2' }, + { label: '灞ュ甫鍚�', value: '3' }, + { label: '閾茶溅', value: '4' }, + { label: '鍙戝姩鏈�', value: '5' }, + ], + }, +]; + +const fumeDeviceType = [ + { + label: '鍘ㄥ叿', + value: '1', + children: [{ label: '鍘ㄥ叿', value: '1' }], + }, +]; + +const vocDeviceType = [ + { + label: 'VOC', + value: '1', + children: [{ label: 'VOC', value: '1' }], + }, +]; + +// 鐢熶骇璁惧绫诲瀷 +function productionDevices(sceneType) { + switch (parseInt(sceneType)) { + // 宸ュ湴,鐮佸ご,鎼呮媽绔�,鍫嗗満 + case 1: + case 2: + case 3: + case 14: + return dustDeviceType; + // 椁愰ギ + case 5: + return fumeDeviceType; + // 宸ヤ笟浼佷笟,姹戒慨 + case 4: + case 6: + return vocDeviceType; + default: + return dustDeviceType; + } +} + +function toLabel(sceneType, valueArr) { + const labelArr = []; + let options = productionDevices(sceneType); + valueArr.forEach(v => { + if (options) { + const op = options.find(o => { + return (o.value + '') == (v + ''); + }); + labelArr.push(op.label); + options = op.children; + } + }); + return labelArr; +} + +export default { productionDevices, toLabel }; diff --git a/src/enum/device/treatmentDevice.js b/src/enum/device/treatmentDevice.js new file mode 100644 index 0000000..28efcf5 --- /dev/null +++ b/src/enum/device/treatmentDevice.js @@ -0,0 +1,75 @@ +const dustDeviceType = [ + { + label: '鎶�闃�', + value: '1', + children: [ + { label: '鐜繚娲掓按杞︼紙澶у瀷闈炵數鍔級', value: '1' }, + { label: '鐢靛姩闆剧偖杞�', value: '2' }, + { label: '鐢靛姩娲掓按杞︼紙灏忓瀷锛�', value: '3' }, + { label: '闆剧偖杞︼紙鍥哄畾鎴栬疆寮忥級', value: '4' }, + { label: '鑷姩鍐叉礂瑁呯疆锛堝皝闂紡锛�', value: '5' }, + { label: '楂樻晥娲楄疆鏈�', value: '6' }, + { label: '楂樺帇姘存灙', value: '7' }, + { label: '鏅�氭按绠℃垨娑堥槻鏍�', value: '8' }, + { label: '濉斿悐鍠锋穻', value: '9' }, + { label: '鍥村鍠锋穻', value: '10' }, + { label: '鎵皹鐩戞祴涓庡柗娣嬭仈鍔�', value: '11' }, + { label: '鍫嗗満鍠锋穻', value: '12' }, + { label: '鐢熶骇鍖哄柗娣�', value: '13' }, + ], + }, +]; + +const fumeDeviceType = [ + { + label: '鍑�鍖�', + value: '1', + children: [{ label: '娌圭儫鍑�鍖�', value: '1' }], + }, +]; + +const vocDeviceType = [ + { + label: '鍑�鍖�', + value: '1', + children: [{ label: '鍥哄簾鍑�鍖�', value: '1' }], + }, +]; + +// 娌荤悊璁惧绫诲瀷 +function treatmentDevices(sceneType) { + switch (parseInt(sceneType)) { + // 宸ュ湴,鐮佸ご,鎼呮媽绔�,鍫嗗満 + case 1: + case 2: + case 3: + case 14: + return dustDeviceType; + // 椁愰ギ + case 5: + return fumeDeviceType; + // 宸ヤ笟浼佷笟,姹戒慨 + case 4: + case 6: + return vocDeviceType; + default: + return dustDeviceType; + } +} + +function toLabel(sceneType, valueArr) { + const labelArr = []; + let options = treatmentDevices(sceneType); + valueArr.forEach(v => { + if (options) { + const op = options.find(o => { + return (o.value + '') == (v + ''); + }); + labelArr.push(op.label); + options = op.children; + } + }); + return labelArr; +} + +export default { treatmentDevices, toLabel }; diff --git a/src/views/main/MonitorView.vue b/src/views/main/MonitorView.vue index 0640fd7..096d0f6 100644 --- a/src/views/main/MonitorView.vue +++ b/src/views/main/MonitorView.vue @@ -20,11 +20,12 @@ </el-col> <el-col :span="7" class="page-right"> <el-scrollbar height="var(--fy-body-height)" class="p-events-auto"> + <SupervisionVisual></SupervisionVisual> <ManagementView></ManagementView> </el-scrollbar> </el-col> </el-row> - <SupervisionVisual class="supervision-view"></SupervisionVisual> + <!-- <SupervisionVisual class="supervision-view"></SupervisionVisual> --> <WorkStream class="work-stream"></WorkStream> <!-- <ProblemTrack class="problem-track"></ProblemTrack> --> diff --git a/src/views/management/TaskStats.vue b/src/views/management/TaskStats.vue index 271414c..2a7d86a 100644 --- a/src/views/management/TaskStats.vue +++ b/src/views/management/TaskStats.vue @@ -39,6 +39,8 @@ import { useSubtaskStore } from '@/stores/subtask.js' +import taskApi from '@/api/fysp/taskApi.js' + /** * 浠诲姟瀹屾垚鎯呭喌 */ @@ -48,6 +50,7 @@ const subtaskStore = useSubtaskStore() const tasks = ref([]) const sceneTaskMap = ref(new Map()) +const subtaskLoading = ref(false) function onGetTaskInfo(tInfoList) { const resList = [] @@ -95,8 +98,27 @@ tasks.value = resList } +const area = { + provincecode: null, + provincename: '涓婃捣甯�', + citycode: undefined, + cityname: undefined, + districtcode: undefined, + districtname: undefined, + starttime: '2025-06-01 00:00:00', + endtime: '2025-06-30 23:59:59', + scensetypeid: undefined +} function cal() { - subtaskStore.onAllTaskRefreshed(onGetTaskInfo) + subtaskLoading.value = true + taskApi + .fetchTopTaskProgress(area) + .then((res) => { + if (res.data.length == 0) return + onGetTaskInfo(res.data) + }) + .finally(() => (subtaskLoading.value = false)) + // subtaskStore.onAllTaskRefreshed(onGetTaskInfo) } onMounted(() => { diff --git a/src/views/visualization/SubtaskVisual.vue b/src/views/visualization/SubtaskVisual.vue index 3d0196e..e65e73b 100644 --- a/src/views/visualization/SubtaskVisual.vue +++ b/src/views/visualization/SubtaskVisual.vue @@ -57,7 +57,7 @@ ></FYImageSelectDialog> </div> <div v-show="value == '璁惧璁炬柦'"> - + <SceneDevice :scene="scene" height="500px"></SceneDevice> </div> </el-card> </el-scrollbar> diff --git a/src/views/visualization/SupervisionVisual.vue b/src/views/visualization/SupervisionVisual.vue index 3c1c421..ff58fa7 100644 --- a/src/views/visualization/SupervisionVisual.vue +++ b/src/views/visualization/SupervisionVisual.vue @@ -9,7 +9,7 @@ ></OptionLocation> <OptionSceneType :type="2" - :width="120" + :width="100" :initValue="false" v-model="sceneType" ></OptionSceneType> -- Gitblit v1.9.3