| | |
| | | }, |
| | | |
| | | /** |
| | | * è·åæ»ä»»å¡ççç®¡åºæ¯çæ¬ä¿¡æ¯ |
| | | */ |
| | | fetchMonitorObjectVersion(taskId) { |
| | | return $fysp.get(`monitorobjectversion/task/${taskId}`).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * æ¥è¯¢æ»ä»»å¡ |
| | | * @param {Object} param |
| | | * @returns |
| | |
| | | export interface GlobalComponents { |
| | | BaseContentLayout: typeof import('./components/core/BaseContentLayout.vue')['default'] |
| | | BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default'] |
| | | CompInfoSearch: typeof import('./components/search-option/CompInfoSearch.vue')['default'] |
| | | CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default'] |
| | | Content: typeof import('./components/core/Content.vue')['default'] |
| | | copy: typeof import('./components/list-item/ItemScene copy.vue')['default'] |
| | | ElAside: typeof import('element-plus/es')['ElAside'] |
| | | ElAvatar: typeof import('element-plus/es')['ElAvatar'] |
| | | ElBacktop: typeof import('element-plus/es')['ElBacktop'] |
| | |
| | | ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] |
| | | ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] |
| | | ElCard: typeof import('element-plus/es')['ElCard'] |
| | | ElCascader: typeof import('element-plus/es')['ElCascader'] |
| | | ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
| | |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | ElTooltip: typeof import('element-plus/es')['ElTooltip'] |
| | | ElTree: typeof import('element-plus/es')['ElTree'] |
| | | ElUpload: typeof import('element-plus/es')['ElUpload'] |
| | | Footer: typeof import('./components/core/Footer.vue')['default'] |
| | | FormCol: typeof import('./components/layout/FormCol.vue')['default'] |
| | | FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default'] |
| | | FYBgTaskDialog: typeof import('./components/bg-task/FYBgTaskDialog.vue')['default'] |
| | | FYBgTaskItem: typeof import('./components/bg-task/FYBgTaskItem.vue')['default'] |
| | | FYForm: typeof import('./components/form/FYForm.vue')['default'] |
| | | FYInfoSearch: typeof import('./components/search-option/FYInfoSearch.vue')['default'] |
| | | FYList: typeof import('./components/table/FYList.vue')['default'] |
| | | FYOptionLocation: typeof import('./components/search-option/FYOptionLocation.vue')['default'] |
| | | FYOptionOnlineStatus: typeof import('./components/search-option/FYOptionOnlineStatus.vue')['default'] |
| | |
| | | FYSearchBar: typeof import('./components/search-option/FYSearchBar.vue')['default'] |
| | | FYTable: typeof import('./components/table/FYTable.vue')['default'] |
| | | Header: typeof import('./components/core/Header.vue')['default'] |
| | | ItemMonitorObj: typeof import('./components/list-item/ItemMonitorObj.vue')['default'] |
| | | ItemScene: typeof import('./components/list-item/ItemScene.vue')['default'] |
| | | ItemUser: typeof import('./components/list-item/ItemUser.vue')['default'] |
| | | MenuItems: typeof import('./components/core/MenuItems.vue')['default'] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- <el-card shadow="hover"> --> |
| | | <div class="wrapper"> |
| | | <div> |
| | | <el-text>{{ item.displayid }}ã</el-text> |
| | | <el-text truncated class="w-250px">{{ item.sensename }}</el-text> |
| | | </div> |
| | | <!-- <div> |
| | | <el-text>å°åï¼{{ item.location }}</el-text> |
| | | </div> --> |
| | | <el-row justify="space-between" style="margin-top: 4px"> |
| | | <el-space> |
| | | <el-tag type="info" effect="plain" size="small"> |
| | | {{ item.sceneType }} |
| | | </el-tag> |
| | | <el-tag type="info" effect="plain" size="small"> |
| | | 计åç管次æ°ï¼{{ item.monitornum }} |
| | | </el-tag> |
| | | </el-space> |
| | | <slot :item="item"></slot> |
| | | <!-- <el-button size="small" type="success" @click="add">æ·»å </el-button> --> |
| | | </el-row> |
| | | </div> |
| | | <!-- </el-card> --> |
| | | </template> |
| | | <script setup> |
| | | /** |
| | | * ç管对象 |
| | | */ |
| | | |
| | | |
| | | const props = defineProps({ |
| | | item: { |
| | | type: Object, |
| | | default: () => {} |
| | | } |
| | | }); |
| | | |
| | | const emit = defineEmits(['add']); |
| | | |
| | | function add() { |
| | | emit('add', props.item); |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .wrapper { |
| | | width: 300px; |
| | | border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-border-radius-base); |
| | | padding: 4px 8px; |
| | | } |
| | | </style> |
| | |
| | | </div> --> |
| | | <el-row justify="space-between" style="margin-top: 4px"> |
| | | <el-space> |
| | | <el-tag type="primary" effect="plain" size="small"> |
| | | <el-tag type="info" effect="plain" size="small"> |
| | | {{ item.districtname }} |
| | | </el-tag> |
| | | <el-tag type="primary" effect="plain" size="small"> |
| | | <el-tag type="info" effect="plain" size="small"> |
| | | {{ item.type }} |
| | | </el-tag> |
| | | <el-tag :type="item.extension1 == '0' ? 'info' : 'success'" size="small"> |
| | | {{ onlineFormat(item.extension1) }} |
| | | </el-tag> |
| | | </el-space> |
| | | <el-button size="small" type="success" @click="add">æ·»å </el-button> |
| | | <slot> |
| | | <el-button size="small" type="success" @click="add">æ·»å </el-button> |
| | | </slot> |
| | | </el-row> |
| | | </div> |
| | | <!-- </el-card> --> |
| | |
| | | function add() { |
| | | emit('add', props.item); |
| | | } |
| | | |
| | | function onlineFormat(s) { |
| | | if (s == '0') { |
| | | return 'ä¸çº¿'; |
| | | } else { |
| | | return 'ä¸çº¿'; |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .wrapper { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <FYSearchBar @search="search" :loading="loading"> |
| | | <template #options> |
| | | <FYOptionText v-bind="$attrs" v-model:value="searchText" width="200px"></FYOptionText> |
| | | </template> |
| | | </FYSearchBar> |
| | | <div> |
| | | <el-scrollbar v-if="data.length > 0" :height="scrollHeight" class="item-box" :loading="loading"> |
| | | <el-space direction="vertical" alignment="start" fill style="width: 100%"> |
| | | <div v-for="(item, index) in data" :key="index"> |
| | | <slot :row="item"></slot> |
| | | </div> |
| | | </el-space> |
| | | </el-scrollbar> |
| | | <el-empty v-else description="ææ è®°å½" /> |
| | | </div> |
| | | <el-pagination |
| | | v-if="pageShow && data.length > 0" |
| | | size="small" |
| | | ref="paginationRef" |
| | | class="el-pagination" |
| | | v-model:current-page="currentPage" |
| | | v-model:page-size="pageSize" |
| | | :page-sizes="pageSizes" |
| | | :background="true" |
| | | layout="total, sizes, prev, pager, next" |
| | | :total="total" |
| | | /> |
| | | </template> |
| | | |
| | | <script> |
| | | import { usePagination } from '@/composables/pagination'; |
| | | |
| | | /** |
| | | * 带æå页é»è¾çä¿¡æ¯æ£ç´¢å表 |
| | | */ |
| | | export default { |
| | | setup() { |
| | | // å页é»è¾ |
| | | const { currentPage, pageSize, addPageEvent } = usePagination(); |
| | | return { currentPage, pageSize, addPageEvent }; |
| | | }, |
| | | props: { |
| | | // label: { |
| | | // type: String, |
| | | // default: 'æ£ç´¢é¡¹' |
| | | // }, |
| | | // placeholder: { |
| | | // type: String, |
| | | // default: 'è¾å
¥å
³é®åæ£ç´¢' |
| | | // }, |
| | | // æ°æ®å表 |
| | | data: { |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | } |
| | | }, |
| | | // æ¥è¯¢å½æ° |
| | | onSearch: { |
| | | type: Function, |
| | | default: () => {} |
| | | }, |
| | | // æ¯å¦æ¾ç¤ºå页 |
| | | pageShow: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | // æ¯é¡µå¯éæ°é |
| | | pageSizes: { |
| | | type: Array, |
| | | default: () => { |
| | | return [10, 20, 50, 100]; |
| | | } |
| | | }, |
| | | // æ»æ°æ®é |
| | | total: { |
| | | type: Number, |
| | | default: 0 |
| | | }, |
| | | scrollHeight: { |
| | | type: String, |
| | | default: '38vh' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | searchText: '', |
| | | loading: false |
| | | }; |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | | async search() { |
| | | this.loading = true; |
| | | const param = { |
| | | text: this.searchText, |
| | | page: this.currentPage, |
| | | pageSize: this.pageSize |
| | | }; |
| | | await this.onSearch(param); |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.addPageEvent(this.search); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .select-box { |
| | | border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-border-radius-base); |
| | | padding: 0 8px; |
| | | } |
| | | .item-box { |
| | | /* border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-border-radius-base); |
| | | margin-top: 20px; */ |
| | | } |
| | | .el-pagination { |
| | | /* background-color: var(--el-color-white); */ |
| | | border-top: 1px solid rgba(0, 0, 0, 0.096); |
| | | /* background-color: aliceblue; */ |
| | | } |
| | | </style> |
| | |
| | | // ] |
| | | // }, |
| | | { |
| | | path: '/fysp/task/manage', |
| | | icon: 'CircleCheck', |
| | | name: 'ç管任å¡' |
| | | }, |
| | | { |
| | | path: '/fysp/procheck', |
| | | icon: 'CircleCheck', |
| | | name: 'é®é¢å®¡æ ¸' |
| | |
| | | component: () => import('@/views/fysp/scenereport/StorageReport.vue') |
| | | }, |
| | | { |
| | | //çç®¡ä»»å¡ |
| | | name: 'taskmanage', |
| | | path: '/fysp/task/manage', |
| | | component: () => import('@/views/fysp/task/TaskManage.vue'), |
| | | meta: { keepAlive: false } |
| | | }, |
| | | { |
| | | //ç管任å¡åºæ¯ç¼è¾ |
| | | name: 'monitorObjEdit', |
| | | path: '/fysp/task/edit', |
| | | component: () => import('@/views/fysp/task/MonitorObjEdit.vue') |
| | | }, |
| | | { |
| | | //é®é¢å®¡æ ¸ |
| | | name: 'procheck', |
| | | path: '/fysp/procheck', |
| | |
| | | default: var(--el-component-size-default), |
| | | large: var(--el-component-size-large) |
| | | ); |
| | | $ws: (20px, 40px, 60px, 100px, 150px, 300px); |
| | | $ws: (20px, 40px, 60px, 100px, 150px, 250px, 300px); |
| | | @each $name, $value in $csize { |
| | | .w-#{$name} { |
| | | width: #{$value}; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-page-header @back="$router.back()" class="page-header"> |
| | | <template #content> |
| | | <span> æ»ä»»å¡ç¼è¾ </span> |
| | | </template> |
| | | </el-page-header> |
| | | <el-divider /> |
| | | <el-row gutter="20"> |
| | | <el-col :span="16"> |
| | | <div> |
| | | <el-text>å·²éåºæ¯</el-text> |
| | | </div> |
| | | <el-divider /> |
| | | <CompMonitorObj :data="curMonitorObjList" @tab-change="changeSceneType" :showDelete="true"> |
| | | <!-- <template #default="{ item }"> |
| | | <el-button size="small" type="danger" @click="deleteMov(item)">ç§»é¤</el-button> |
| | | </template> --> |
| | | </CompMonitorObj> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div> |
| | | <el-text>å¯éåºæ¯</el-text> |
| | | </div> |
| | | <el-divider /> |
| | | <FYInfoSearch |
| | | label="" |
| | | placeholder="请è¾å
¥åºæ¯åç§°å
³é®å" |
| | | :data="showSceneList" |
| | | :on-search="searchScene" |
| | | :total="total" |
| | | scroll-height="70vh" |
| | | :page-show="false" |
| | | > |
| | | <template #default="{ row, click }"> |
| | | <ItemScene :item="row"> |
| | | <el-button-group> |
| | | <el-button size="small" type="primary" @click="insertDialog = true">æå
¥</el-button> |
| | | <el-button size="small" type="primary" @click="addDialog = true">æ°å¢</el-button> |
| | | </el-button-group> |
| | | </ItemScene> |
| | | </template> |
| | | </FYInfoSearch> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-dialog v-model="insertDialog" title="æå
¥åºæ¯è³ç©ºä½ç¼å·" width="500"> |
| | | <div>以ä¸ä¸ºå¯éç空ä½ç¼å·</div> |
| | | <el-radio-group v-model="selectedIndex" size="default"> |
| | | <el-radio-button v-for="item in valibleIndex" :key="item" :label="item" :value="item" /> |
| | | </el-radio-group> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="insertDialog = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="insertDialog = false"> 确认 </el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="addDialog" title="æ°å¢åºæ¯ç¼å·é¡ºå»¶" width="500"> |
| | | <div>顺延ç¼å·ä¸º:{{ lastIndex }}</div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="addDialog = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="addDialog = false"> 确认 </el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import CompMonitorObj from './components/CompMonitorObj.vue'; |
| | | import svUserApi from '@/api/fysp/userApi'; |
| | | import sceneApi from '@/api/fysp/sceneApi'; |
| | | |
| | | export default { |
| | | components: { CompMonitorObj }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | // çç®¡åºæ¯ |
| | | curMonitorObjList: [], |
| | | // è¡æ¿åºå |
| | | area: {}, |
| | | // ææåºæ¯ |
| | | sceneList: [], |
| | | total: 0, |
| | | |
| | | // å½åçéçåºæ¯ç±»å |
| | | curSceneType: undefined, |
| | | |
| | | insertDialog: false, |
| | | selectedIndex: undefined, |
| | | addDialog: false |
| | | }; |
| | | }, |
| | | computed: { |
| | | // å½ååºæ¯ç±»åä¸çå±ç¤ºåºæ¯ |
| | | showSceneList() { |
| | | return this.sceneList.filter((v) => { |
| | | const index = this.curMonitorObjList.findIndex((o) => { |
| | | return o.sguid == v.guid; |
| | | }); |
| | | return index == -1 && v.type == this.curSceneType; |
| | | }); |
| | | }, |
| | | showMonitorObjList() { |
| | | return this.curMonitorObjList.filter((v) => { |
| | | return v.sceneType == this.curSceneType; |
| | | }); |
| | | }, |
| | | // å½ååºæ¯ç±»åä¸ç坿å
¥ç¼å· |
| | | valibleIndex() { |
| | | // ååè¡¨å·²ç»æç
§ç¼å·é¡ºåºæå |
| | | let index = 1; |
| | | const indexList = []; |
| | | this.showMonitorObjList.forEach((l) => { |
| | | while (l.displayid > index) { |
| | | indexList.push(index); |
| | | index++; |
| | | } |
| | | index++; |
| | | }); |
| | | return indexList; |
| | | }, |
| | | lastIndex() { |
| | | const len = this.showMonitorObjList.length; |
| | | if (len > 0) { |
| | | return this.showMonitorObjList[len - 1].displayid + 1; |
| | | } else { |
| | | return undefined; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ¥è¯¢ |
| | | searchScene({ text, page, pageSize }) { |
| | | this.area.sceneName = text; |
| | | return sceneApi.searchScene(this.area, 1, 10000).then((res) => { |
| | | if (res.success) { |
| | | // æ¥è¯¢ç»æ |
| | | this.sceneList = res.data; |
| | | // æ»æ°æ®é |
| | | this.total = res.head.totalCount; |
| | | } |
| | | }); |
| | | }, |
| | | changeSceneType(tabName) { |
| | | this.curSceneType = tabName; |
| | | }, |
| | | deleteMov(item) { |
| | | }, |
| | | insertMov() {}, |
| | | addMov() {} |
| | | }, |
| | | mounted() { |
| | | // çç®¡åºæ¯ä¿¡æ¯ |
| | | this.curMonitorObjList = JSON.parse(decodeURIComponent(this.$route.query.data)); |
| | | // æ ¹æ®æ»ä»»å¡è·åè¡æ¿åºåä¿¡æ¯ |
| | | const task = JSON.parse(decodeURIComponent(this.$route.query.task)); |
| | | this.area = { |
| | | provincecode: task.provincecode, |
| | | provincename: task.provincename, |
| | | citycode: task.citycode, |
| | | cityname: task.cityname, |
| | | districtcode: task.districtcode, |
| | | districtname: task.districtname, |
| | | towncode: task.towncode, |
| | | townname: task.townname, |
| | | online: true |
| | | }; |
| | | this.searchScene({ text: '' }); |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BaseContentLayout> |
| | | <template #header> |
| | | <FYSearchBar @search="search"> |
| | | <template #options> |
| | | <!-- åºå¿ --> |
| | | <FYOptionLocation |
| | | :allOption="true" |
| | | :level="3" |
| | | :checkStrictly="false" |
| | | v-model:value="formSearch.locations" |
| | | ></FYOptionLocation> |
| | | </template> |
| | | <!-- <template #buttons> |
| | | <slot name="buttons"></slot> |
| | | </template> --> |
| | | </FYSearchBar> |
| | | </template> |
| | | <template #aside> |
| | | <SideList :items="tasks" :loading="sideLoading" @item-click="chooseTask"></SideList> |
| | | </template> |
| | | <template #main> |
| | | <ToolBar |
| | | :title="curTask.title" |
| | | :descriptions="taskStatus" |
| | | :buttons="buttons" |
| | | :loading="mainLoading" |
| | | ></ToolBar> |
| | | <el-scrollbar |
| | | v-if="curMonitorObjList.length > 0" |
| | | class="el-scrollbar" |
| | | v-loading="mainLoading" |
| | | > |
| | | <div><el-text>ç管计å</el-text></div> |
| | | <el-divider></el-divider> |
| | | <el-button type="primary" size="small" @click="editTask">åºæ¯è°æ´</el-button> |
| | | <div><el-text>çç®¡åºæ¯</el-text></div> |
| | | <CompMonitorObj :data="curMonitorObjList"></CompMonitorObj> |
| | | <!-- <div><el-text>çç®¡åºæ¯</el-text></div> |
| | | <div> |
| | | <el-space wrap> |
| | | <ItemMonitorObj |
| | | v-for="item in curMonitorObjList" |
| | | :key="item.movid" |
| | | :item="item" |
| | | ></ItemMonitorObj> |
| | | </el-space> |
| | | </div> --> |
| | | </el-scrollbar> |
| | | <el-empty v-else description="ææ è®°å½" v-loading="mainLoading" /> |
| | | </template> |
| | | </BaseContentLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import CompMonitorObj from './components/CompMonitorObj.vue'; |
| | | export default { |
| | | components: { CompMonitorObj }, |
| | | data() { |
| | | return { |
| | | formSearch: { |
| | | _locations: {}, |
| | | searchText: '', |
| | | _scenetype: {}, |
| | | online: {} |
| | | }, |
| | | // 左侧èåæ å è½½ç¶æ |
| | | sideLoading: false, |
| | | // å³ä¾§å
容æ å è½½ç¶æ |
| | | mainLoading: false, |
| | | // ä»»å¡å表 |
| | | tasks: [], |
| | | // å½åä»»å¡çç管对象 |
| | | curMonitorObjList: [], |
| | | //å½åéä¸çä»»å¡ |
| | | curTask: {}, |
| | | //æä½æé® |
| | | buttons: [ |
| | | { |
| | | name: '计åè°æ´', |
| | | color: 'success' |
| | | }, |
| | | { |
| | | name: 'åºæ¯è°æ´', |
| | | color: 'warning' |
| | | } |
| | | ] |
| | | }; |
| | | }, |
| | | computed: { |
| | | // æ»ä»»å¡ç¶æç»è®¡ |
| | | taskStatus() { |
| | | return [ |
| | | { name: 'åºæ¯æ°', value: 100 }, |
| | | { name: 'æªå·¡æ¥', value: 0 }, |
| | | { name: '已巡æ¥', value: 0 } |
| | | ]; |
| | | } |
| | | }, |
| | | methods: { |
| | | search(formSearch) { |
| | | this.sideLoading = true; |
| | | this.mainLoading = true; |
| | | this.curMonitorObjList = []; |
| | | this.curTask = {}; |
| | | taskApi.getTopTask().then((res) => { |
| | | const list = res.map((r) => { |
| | | const t = this.getTaskType(r); |
| | | return { |
| | | type: t, |
| | | title: r.name, |
| | | categoly: this.$fm.formatYM(r.starttime), |
| | | data: r |
| | | }; |
| | | }); |
| | | this.tasks = list; |
| | | if (list.length == 0) { |
| | | this.sideLoading = false; |
| | | this.mainLoading = false; |
| | | } |
| | | }); |
| | | }, |
| | | //è·åä»»å¡ç宿æ
åµ |
| | | getTaskType(s) { |
| | | let type = 0; |
| | | switch (s.runingstatus) { |
| | | case 'æªæ§è¡': |
| | | type = 0; |
| | | break; |
| | | case 'æ£å¨æ§è¡': |
| | | type = 1; |
| | | break; |
| | | case 'å·²ç»æ': |
| | | type = 2; |
| | | break; |
| | | default: |
| | | type = 0; |
| | | break; |
| | | } |
| | | return type; |
| | | }, |
| | | chooseTask(task) { |
| | | this.sideLoading = false; |
| | | this.mainLoading = true; |
| | | taskApi |
| | | .fetchMonitorObjectVersion(task.data.tguid) |
| | | .then((res) => { |
| | | this.curMonitorObjList = res; |
| | | this.curTask = task; |
| | | }) |
| | | .finally(() => { |
| | | this.mainLoading = false; |
| | | }); |
| | | }, |
| | | editTask() { |
| | | this.$router.push({ |
| | | name: 'monitorObjEdit', |
| | | query: { |
| | | data: encodeURIComponent(JSON.stringify(this.curMonitorObjList)), |
| | | task: encodeURIComponent(JSON.stringify(this.curTask.data)) |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.search(); |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .select-box { |
| | | /* border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-border-radius-base); |
| | | padding: 0 8px; */ |
| | | } |
| | | |
| | | .el-scrollbar { |
| | | height: calc((100vh - 60px * 2 - 20px * 2 - var(--height-toolbar))); |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-tabs v-model="activeName" type="border-card" @tab-change="tabChange"> |
| | | <el-tab-pane |
| | | v-for="item in tabDataList" |
| | | :key="item.title" |
| | | :label="item.title" |
| | | :name="item.title" |
| | | > |
| | | <!-- <div> --> |
| | | <el-space wrap> |
| | | <ItemMonitorObj v-for="obj in item.children" :key="obj.movid" :item="obj"> |
| | | <template #default="{ item }"> |
| | | <!-- <slot :item="item"></slot> --> |
| | | <el-button v-if="showDelete" size="small" type="danger" @click="deleteMov(item)" |
| | | >ç§»é¤</el-button |
| | | > |
| | | </template> |
| | | </ItemMonitorObj> |
| | | </el-space> |
| | | <!-- </div> --> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </template> |
| | | |
| | | <script> |
| | | const defaultTabName = 'å
¨é¨'; |
| | | export default { |
| | | props: { |
| | | data: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | // æ¯å¦æ·»å é»è®¤çå
¨é¨é项 |
| | | allOption: Boolean, |
| | | showDelete: Boolean |
| | | }, |
| | | emits: ['tabChange'], |
| | | data() { |
| | | return { |
| | | activeName: defaultTabName |
| | | }; |
| | | }, |
| | | computed: { |
| | | tabDataList() { |
| | | const itemMap = new Map(); |
| | | this.data.forEach((t) => { |
| | | itemMap.has(t.sceneType) ? itemMap.get(t.sceneType).push(t) : itemMap.set(t.sceneType, [t]); |
| | | }); |
| | | const list = []; |
| | | if (this.allOption) { |
| | | list.push({ |
| | | title: defaultTabName, |
| | | children: this.data |
| | | }); |
| | | } |
| | | for (const [key, value] of itemMap) { |
| | | list.push({ |
| | | title: key, |
| | | children: value |
| | | }); |
| | | } |
| | | return list; |
| | | } |
| | | }, |
| | | watch: { |
| | | tabDataList: { |
| | | handler(nV, oV) { |
| | | if (nV != oV && nV.length > 0) { |
| | | this.activeName = nV[0].title; |
| | | this.tabChange(this.activeName); |
| | | } |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | methods: { |
| | | tabChange(tabName) { |
| | | this.$emit('tabChange', tabName); |
| | | }, |
| | | deleteMov(item) { |
| | | const tab = this.tabDataList.find((v) => { |
| | | return v.title == this.activeName; |
| | | }); |
| | | const i = tab.children.indexOf(item); |
| | | tab.children.splice(i, 1); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped></style> |