From 512d5d7e79e0a64b36e24cbe5d7c5f8d0adc0b94 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 26 九月 2024 17:46:48 +0800
Subject: [PATCH] 1.升级了element-plus版本 2.对外支持模块新设备匹配工地功能完成 3.新增设备匹配模块单挑匹配记录编辑功能(未完成)
---
src/components/list-item/ItemScene.vue | 45 ++
src/views/fysp/config/device/CompInfoSearch.vue | 131 ++++++
src/views/fysp/config/device/CompDeviceMatchEdit.vue | 202 ++++++++++
src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue | 37 +
package-lock.json | 14
src/composables/pagination.js | 26 +
src/views/fysp/config/DeviceMatch.vue | 65 +++
src/components.d.ts | 5
src/components/table/FYList.vue | 73 +++
src/api/index.js | 6
src/composables/event.js | 26 +
src/components/SearchBar.vue | 35 -
src/components/core/SiderMenu.vue | 69 +-
src/components/search-option/FYOptionScene.vue | 2
src/components/search-option/CompQuickSet.vue | 31
src/views/fysp/support/NewDevice.vue | 14
src/api/fysp/userApi.js | 14
src/components/search-option/FYSearchBar.vue | 6
src/router/index.js | 2
src/components/table/FYTable.vue | 58 ++
/dev/null | 34 -
src/composables/dialog.js | 47 ++
src/enum/scene.js | 65 ++-
src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue | 65 +-
package.json | 2
src/views/fysp/evaluation/components/CompReport.vue | 1
src/components/list-item/ItemUser.vue | 46 ++
src/views/fysp/evaluation/EvalutationRecord.vue | 3
src/views/fysp/support/components/DeviceMatch.vue | 39 +
29 files changed, 961 insertions(+), 202 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index ca20189..7d0a226 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,7 +13,7 @@
"@vueuse/core": "^9.7.0",
"axios": "^1.2.1",
"dayjs": "^1.11.10",
- "element-plus": "^2.4.3",
+ "element-plus": "^2.8.3",
"js-base64": "^3.7.5",
"md5": "^2.3.0",
"pinia": "^2.0.26",
@@ -3782,9 +3782,9 @@
"license": "ISC"
},
"node_modules/element-plus": {
- "version": "2.4.3",
- "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
- "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
+ "version": "2.8.3",
+ "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.8.3.tgz",
+ "integrity": "sha512-BXQOyDf0s7JHyNEV8iaO+iaOzTZPsBXVKMzMI967vLCodUBDLrtiY5vglAn1YEebQcUOEUMhGcttTpIvEkcBjQ==",
"dependencies": {
"@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.3.1",
@@ -10069,9 +10069,9 @@
"dev": true
},
"element-plus": {
- "version": "2.4.3",
- "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
- "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
+ "version": "2.8.3",
+ "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.8.3.tgz",
+ "integrity": "sha512-BXQOyDf0s7JHyNEV8iaO+iaOzTZPsBXVKMzMI967vLCodUBDLrtiY5vglAn1YEebQcUOEUMhGcttTpIvEkcBjQ==",
"requires": {
"@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.3.1",
diff --git a/package.json b/package.json
index 2d30896..6d0b5e4 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"@vueuse/core": "^9.7.0",
"axios": "^1.2.1",
"dayjs": "^1.11.10",
- "element-plus": "^2.4.3",
+ "element-plus": "^2.8.3",
"js-base64": "^3.7.5",
"md5": "^2.3.0",
"pinia": "^2.0.26",
diff --git a/src/api/fysp/userApi.js b/src/api/fysp/userApi.js
index 389bf87..fc38ad2 100644
--- a/src/api/fysp/userApi.js
+++ b/src/api/fysp/userApi.js
@@ -27,5 +27,19 @@
*/
autoCreateAccount(sId) {
return $fysp.post(`userinfo/create?sceneId=${sId}`).then((res) => res.data);
+ },
+
+ /**
+ * 鐢ㄦ埛妯$硦鎼滅储
+ * @param {object} area 鍖哄煙鑼冨洿鏉′欢
+ * @param {String} keyword 鎼滅储鍏抽敭瀛�
+ * @param {Number} userType 鐢ㄦ埛绫诲瀷锛岄粯璁�3锛氫紒涓�
+ * @returns
+ */
+ searchUser(area, keyword, page = 1, perPage = 20, userType = 3) {
+ const param = `?keyword=${keyword}&userType=${userType}&page=${page}&per_page=${perPage}`
+ return $fysp
+ .post(`userinfo/search${param}`, area)
+ .then((res) => res.data);
}
};
diff --git a/src/api/index.js b/src/api/index.js
index 36408b4..a31a27c 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -11,9 +11,9 @@
let ip2_file = 'https://fyami.com.cn/';
if (debug) {
- ip1 = 'http://192.168.0.138:8082/';
- // ip1_file = 'http://47.100.191.150:9005/';
- ip2 = 'http://192.168.0.138:8080/';
+ ip1 = 'http://192.168.0.138:9091/';
+ // ip1_file = 'http://192.168.0.138:8080/';
+ // ip2 = 'http://192.168.0.138:8080/';
// ip2_file = 'https://fyami.com.cn/';
}
diff --git a/src/components.d.ts b/src/components.d.ts
index c8c66a3..99aa4bb 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -9,6 +9,7 @@
export interface GlobalComponents {
BaseContentLayout: typeof import('./components/core/BaseContentLayout.vue')['default']
BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default']
+ CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default']
Content: typeof import('./components/core/Content.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
@@ -52,7 +53,6 @@
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
- ElScorllbar: typeof import('element-plus/es')['ElScorllbar']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSpace: typeof import('element-plus/es')['ElSpace']
@@ -76,6 +76,7 @@
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']
+ 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']
FYOptionScene: typeof import('./components/search-option/FYOptionScene.vue')['default']
@@ -87,6 +88,8 @@
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']
+ 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']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
diff --git a/src/components/SearchBar.vue b/src/components/SearchBar.vue
index 50fd81e..ca5c7e2 100644
--- a/src/components/SearchBar.vue
+++ b/src/components/SearchBar.vue
@@ -4,23 +4,18 @@
<el-form :inline="true" :model="formSearch">
<el-form-item label="鎬讳换鍔�">
<!-- <el-input v-model="formSearch.topTaskId" placeholder="鎬讳换鍔�" /> -->
- <el-select v-model="formSearch.topTaskId" placeholder="鎬讳换鍔�">
- <el-option
- v-for="s in topTasks"
- :key="s.value"
- :label="s.label"
- :value="s.value"
- />
+ <el-select v-model="formSearch.topTaskId" placeholder="鎬讳换鍔�" style="width: 260px">
+ <el-option v-for="s in topTasks" :key="s.value" :label="s.label" :value="s.value" />
</el-select>
</el-form-item>
+ <!-- <FYOptionScene
+ :allOption="false"
+ :type="2"
+ v-model:value="formSearch.scenetype"
+ ></FYOptionScene> -->
<el-form-item label="鍦烘櫙绫诲瀷">
- <el-select v-model="formSearch.sceneTypeId" placeholder="鍦烘櫙绫诲瀷">
- <el-option
- v-for="s in sceneTypes"
- :key="s.value"
- :label="s.label"
- :value="s.value"
- />
+ <el-select v-model="formSearch.sceneTypeId" placeholder="鍦烘櫙绫诲瀷" style="width: 150px">
+ <el-option v-for="s in sceneTypes" :key="s.value" :label="s.label" :value="s.value" />
</el-select>
</el-form-item>
<el-form-item>
@@ -38,7 +33,7 @@
<script>
import taskApi from '@/api/fysp/taskApi';
-import { enumScene } from "@/enum/scene";
+import { enumScene } from '@/enum/scene';
export default {
emits: ['onSubmit'],
@@ -48,8 +43,8 @@
sceneTypes: enumScene(2, false),
formSearch: {
topTaskId: '',
- sceneTypeId: '',
- },
+ sceneTypeId: ''
+ }
};
},
methods: {
@@ -63,7 +58,7 @@
label: r.name,
towncode: r.towncode,
districtCode: r.districtcode,
- month: r.starttime.slice(0, 7),
+ month: r.starttime.slice(0, 7)
});
});
this.topTasks = list;
@@ -75,12 +70,12 @@
onSubmit() {
// console.log(this.formSearch.sceneTypeId)
this.$emit('onSubmit', this.formSearch);
- },
+ }
},
mounted() {
this.formSearch.sceneTypeId = this.sceneTypes[0].value;
this.getOptions();
- },
+ }
};
</script>
diff --git a/src/components/core/SiderMenu.vue b/src/components/core/SiderMenu.vue
index d4541a2..d38af30 100644
--- a/src/components/core/SiderMenu.vue
+++ b/src/components/core/SiderMenu.vue
@@ -27,15 +27,18 @@
>
<template #reference>
<div class="fy-button-div" @click="popVisible = !popVisible">
- <div style="font-size: 12px; color: gray; margin-left: 24px; margin-bottom: 4px">
+ <div
+ v-show="!collapse"
+ style="font-size: 12px; color: gray; margin-left: 24px; margin-bottom: 4px;"
+ >
褰撳墠绯荤粺
</div>
- <el-row justify="space-between" align="middle">
+ <el-row justify="space-between" align="middle" style="flex-wrap: nowrap;">
<el-space>
<el-icon :size="16"><Open /></el-icon>
- <span>{{ sysName }}</span>
+ <span v-show="!collapse">{{ sysName }}</span>
</el-space>
- <el-icon><ArrowRight /></el-icon>
+ <el-icon v-show="!collapse"><ArrowRight /></el-icon>
</el-row>
</div>
</template>
@@ -60,7 +63,7 @@
</template>
<script>
-import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '@/constants/index'
+import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '@/constants/index';
export default {
name: 'CoreSiderMenu',
@@ -83,61 +86,61 @@
{ name: '椋炵窘鐜', des: '' },
{ name: '鎺掓薄鎶借繍', des: '' }
]
- }
+ };
},
computed: {
homePage() {
- const paths = this.menuPath(this.menus[0])
- return paths[paths.length - 1].path
+ const paths = this.menuPath(this.menus[0]);
+ return paths[paths.length - 1].path;
},
sysName() {
- return this.sysNames[this.sysIndex].name
+ return this.sysNames[this.sysIndex].name;
},
menus() {
- return [MENU_FYSP, MENU_FYTZ, MENU_FYPW][this.sysIndex]
+ return [MENU_FYSP, MENU_FYTZ, MENU_FYPW][this.sysIndex];
}
},
methods: {
handleOpen() {},
handleClose() {},
choseSys(i) {
- this.sysIndex = i
- const paths = this.menuPath(this.menus[0])
- this.navPage(...paths)
- const p = paths[paths.length - 1].path
- this.$router.push(p)
- this.popVisible = false
+ this.sysIndex = i;
+ const paths = this.menuPath(this.menus[0]);
+ this.navPage(...paths);
+ const p = paths[paths.length - 1].path;
+ this.$router.push(p);
+ this.popVisible = false;
},
navPage(...item) {
const titles = item.map((value) => {
- return value.name
- })
- this.$emit('navPage', titles)
+ return value.name;
+ });
+ this.$emit('navPage', titles);
},
calMenuHeight() {
- const h1 = this.$refs.headerRef.$el.offsetHeight
- const h2 = this.$refs.header2Ref.$el.offsetHeight
- const h3 = this.$refs.subTitleRef.$el.offsetHeight
- return `calc(100vh - ${h1}px - ${h2}px - ${h3}px)`
+ const h1 = this.$refs.headerRef.$el.offsetHeight;
+ const h2 = this.$refs.header2Ref.$el.offsetHeight;
+ const h3 = this.$refs.subTitleRef.$el.offsetHeight;
+ return `calc(100vh - ${h1}px - ${h2}px - ${h3}px)`;
},
menuPath(m) {
if (m.children) {
- const arr = this.menuPath(m.children)
- arr.shift(m)
- return arr
+ const arr = this.menuPath(m.children);
+ arr.shift(m);
+ return arr;
} else {
- return [m]
+ return [m];
}
}
},
created() {
- this.$router.push(this.homePage)
- this.navPage(...this.menuPath(this.menus[0]))
+ this.$router.push(this.homePage);
+ this.navPage(...this.menuPath(this.menus[0]));
},
mounted() {
- this.menuHeight = this.calMenuHeight()
+ this.menuHeight = this.calMenuHeight();
}
-}
+};
</script>
<style scoped>
@@ -181,4 +184,8 @@
.el-menu--collapse {
min-height: 100vh;
}
+
+.fy-button-div {
+ white-space: nowrap;
+}
</style>
diff --git a/src/components/list-item/ItemScene.vue b/src/components/list-item/ItemScene.vue
new file mode 100644
index 0000000..e6759d1
--- /dev/null
+++ b/src/components/list-item/ItemScene.vue
@@ -0,0 +1,45 @@
+<template>
+ <!-- <el-card shadow="hover"> -->
+ <div class="wrapper">
+ <div>
+ <el-text>{{ item.index }}銆�</el-text>
+ <el-text>{{ item.name }}</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="primary" effect="plain" size="small">
+ {{ item.districtname }}
+ </el-tag>
+ <el-tag type="primary" effect="plain" size="small">
+ {{ item.type }}
+ </el-tag>
+ </el-space>
+ <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 {
+ border: 1px solid var(--el-border-color);
+ border-radius: var(--el-border-radius-base);
+ padding: 4px 8px;
+}
+</style>
diff --git a/src/components/list-item/ItemUser.vue b/src/components/list-item/ItemUser.vue
new file mode 100644
index 0000000..69af00b
--- /dev/null
+++ b/src/components/list-item/ItemUser.vue
@@ -0,0 +1,46 @@
+<template>
+ <!-- <el-card shadow="hover"> -->
+ <div class="wrapper">
+ <div>
+ <el-text>{{ item.realname }}</el-text>
+ <el-divider direction="vertical" />
+ <el-text>璐﹀彿锛歿{ item.acountname }}</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="primary" effect="plain" size="small">
+ {{ item.district }}
+ </el-tag>
+ <!-- <el-tag type="primary" effect="plain" size="small">
+ {{ item.usertype }}
+ </el-tag> -->
+ </el-space>
+ <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 {
+ border: 1px solid var(--el-border-color);
+ border-radius: var(--el-border-radius-base);
+ padding: 4px 8px;
+}
+</style>
diff --git a/src/views/fysp/evaluation/components/CompQuickSet.vue b/src/components/search-option/CompQuickSet.vue
similarity index 86%
rename from src/views/fysp/evaluation/components/CompQuickSet.vue
rename to src/components/search-option/CompQuickSet.vue
index b7b614b..f2da498 100644
--- a/src/views/fysp/evaluation/components/CompQuickSet.vue
+++ b/src/components/search-option/CompQuickSet.vue
@@ -1,9 +1,14 @@
<template>
<el-form-item label="蹇嵎閫夋嫨">
<el-space>
- <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" size="small" @click="quickSet(v)">{{
- v.name
- }}</el-button>
+ <el-button
+ v-for="(v, i) in quickSetting"
+ :key="i"
+ type="primary"
+ size="small"
+ @click="quickSet(v)"
+ >{{ v.name }}</el-button
+ >
</el-space>
</el-form-item>
</template>
@@ -22,10 +27,10 @@
cCode: '3100',
cName: '涓婃捣甯�',
dCode: '310106',
- dName: '闈欏畨鍖�',
+ dName: '闈欏畨鍖�'
},
scenetype: { label: '宸ュ湴', value: '1' },
- sourceType: 2,
+ sourceType: 2
},
{
name: '寰愭眹椁愰ギ',
@@ -38,7 +43,7 @@
dName: '寰愭眹鍖�'
},
scenetype: { label: '椁愰ギ', value: '5' },
- sourceType: 2,
+ sourceType: 2
},
{
name: '閲戝北宸ュ湴',
@@ -51,7 +56,7 @@
dName: '閲戝北鍖�'
},
scenetype: { label: '宸ュ湴', value: '1' },
- sourceType: 2,
+ sourceType: 2
},
{
name: '閲戝北鐮佸ご',
@@ -64,7 +69,7 @@
dName: '閲戝北鍖�'
},
scenetype: { label: '鐮佸ご', value: '2' },
- sourceType: 2,
+ sourceType: 2
},
{
name: '閲戝北鎼呮媽绔�',
@@ -77,8 +82,8 @@
dName: '閲戝北鍖�'
},
scenetype: { label: '鎼呮媽绔�', value: '3' },
- sourceType: 2,
- },
+ sourceType: 2
+ }
// {
// name: '寰愭眹姹戒慨',
// locations: {
@@ -92,7 +97,7 @@
// scenetype: { label: '姹戒慨', value: '7' },
// sourceType: 1,
// }
- ]
+ ];
}
}
},
@@ -106,10 +111,10 @@
// this.formSearch.locations = set.locations
// this.formSearch.scenetype = set.scenetype
- this.$emit('quickSet', set)
+ this.$emit('quickSet', set);
}
}
-}
+};
</script>
<style scoped>
.row {
diff --git a/src/components/search-option/FYOptionScene.vue b/src/components/search-option/FYOptionScene.vue
index 6cf9b1b..d9df528 100644
--- a/src/components/search-option/FYOptionScene.vue
+++ b/src/components/search-option/FYOptionScene.vue
@@ -23,7 +23,7 @@
},
// 1:椋炵窘鐜绯荤粺锛�2锛氶缇界洃绠$郴缁燂紱
type: {
- type: Number,
+ type: Number || String,
default: 1
},
// 杩斿洖缁撴灉
diff --git a/src/components/search-option/FYSearchBar.vue b/src/components/search-option/FYSearchBar.vue
index fc96c81..eaca995 100644
--- a/src/components/search-option/FYSearchBar.vue
+++ b/src/components/search-option/FYSearchBar.vue
@@ -1,5 +1,5 @@
<template>
- <el-form :inline="true">
+ <el-form :inline="true" :size="size">
<slot name="options"></slot>
<el-form-item>
<el-button icon="Search" type="primary" :loading="loading" @click="search">{{ btnText }}</el-button>
@@ -11,6 +11,10 @@
<script>
export default {
props: {
+ size: {
+ type: String,
+ default: 'default'
+ },
btnText: {
type: String,
default: '鏌ヨ'
diff --git a/src/components/table/FYList.vue b/src/components/table/FYList.vue
new file mode 100644
index 0000000..48fd1ae
--- /dev/null
+++ b/src/components/table/FYList.vue
@@ -0,0 +1,73 @@
+<template>
+ <el-scrollbar>
+ <!-- <div v-for="(item, index) in data" :key="index">
+
+ </div> -->
+ <slot></slot>
+ </el-scrollbar>
+ <el-pagination
+ v-if="pageShow"
+ 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, jumper"
+ :total="total"
+ />
+</template>
+
+<script>
+import { usePagination } from '@/composables/pagination';
+
+export default {
+ setup() {
+ // 鍒嗛〉閫昏緫
+ const { currentPage, pageSize, addPageEvent } = usePagination();
+ return { currentPage, pageSize, addPageEvent };
+ },
+ props: {
+ data: {
+ type: Array,
+ default: () => {
+ return [];
+ }
+ },
+ // 鏄惁鏄剧ず鍒嗛〉
+ pageShow: {
+ type: Boolean,
+ default: true
+ },
+ // 姣忛〉鍙�夋暟閲�
+ pageSizes: {
+ type: Array,
+ default: () => {
+ return [10, 20, 50, 100];
+ }
+ },
+ // 鎬绘暟鎹噺
+ total: {
+ type: Number,
+ default: 0
+ }
+ },
+ emits: ['pageChange'],
+ methods: {
+ search() {
+ this.$emit('pageChange', this.currentPage, this.pageSize);
+ }
+ },
+ mounted() {
+ this.addPageEvent(this.search);
+ }
+};
+</script>
+<style scoped>
+.el-pagination {
+ background-color: var(--el-color-white);
+ padding-top: 20px;
+ border-top: 1px solid rgba(0, 0, 0, 0.096);
+ /* margin-top: 2px; */
+}
+</style>
diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue
index e00929f..bec9d06 100644
--- a/src/components/table/FYTable.vue
+++ b/src/components/table/FYTable.vue
@@ -9,18 +9,34 @@
</template>
</FYSearchBar>
</el-row>
- <el-row ref="expandRef">
- <slot name="options-expand"></slot>
+ <el-row ref="expandRef" justify="space-between">
+ <el-col span="22">
+ <slot name="options-expand"></slot>
+ </el-col>
+ <el-col span="2">
+ <el-space :wrap="false">
+ <el-text size="small">瀛椾綋</el-text>
+ <el-radio-group v-model="fontSize" size="small">
+ <el-radio-button value="small">灏�</el-radio-button>
+ <el-radio-button value="default">涓�</el-radio-button>
+ <el-radio-button value="large">澶�</el-radio-button>
+ </el-radio-group>
+ </el-space>
+ </el-col>
</el-row>
+ <div ref="expand2Ref">
+ <slot name="options-expand2"></slot>
+ </div>
<el-table
:data="tableData"
v-loading="loading"
table-layout="fixed"
:row-class-name="tableRowClassName"
:height="tableHeight"
+ :size="fontSize"
border
>
- <slot name="table-column"></slot>
+ <slot name="table-column" :size="fontSize"></slot>
</el-table>
<el-pagination
@@ -51,6 +67,11 @@
pagination: {
type: Boolean,
default: true
+ },
+ // '' | 'small' | 'default' | 'large'
+ size: {
+ type: String,
+ default: 'default'
}
},
data() {
@@ -60,7 +81,8 @@
total: 0,
currentPage: 1,
pageSize: 20,
- loading: false
+ loading: false,
+ fontSize: 'default'
};
},
emits: ['search'],
@@ -73,6 +95,30 @@
pageSize(nValue, oValue) {
if (nValue != oValue) {
this.onSearch();
+ }
+ },
+ size: {
+ handler(nValue, oValue) {
+ if (nValue != oValue) {
+ this.fontSize = nValue;
+ }
+ },
+ immediate: true
+ }
+ },
+ computed: {
+ cTableHeight() {
+ if (this.$refs.searchRef) {
+ const h1 = this.$refs.searchRef.$el.offsetHeight;
+ const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
+ const h3 = this.$refs.expandRef.$el.offsetHeight;
+ const h4 = this.$refs.expand2Ref.offsetHeight;
+
+ const h = h1 + h2 + h3 + h4;
+ // return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`;
+ return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`;
+ } else {
+ return '500';
}
}
},
@@ -101,7 +147,9 @@
const h1 = this.$refs.searchRef.$el.offsetHeight;
const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
const h3 = this.$refs.expandRef.$el.offsetHeight;
- const h = h1 + h2 + h3;
+ const h4 = this.$refs.expand2Ref.offsetHeight;
+
+ const h = h1 + h2 + h3 + h4;
// return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`;
return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`;
},
diff --git a/src/composables/dialog.js b/src/composables/dialog.js
new file mode 100644
index 0000000..db9f9f5
--- /dev/null
+++ b/src/composables/dialog.js
@@ -0,0 +1,47 @@
+import { ref, watch } from 'vue';
+import { useMessageBoxTip, useMessageBox } from './messageBox';
+
+// 鍚勭被寮瑰嚭妗嗗紑鍏抽�昏緫
+export function useDialog() {
+ const show = ref(false);
+ function confirmClick() {
+ if (options.tip) {
+ useMessageBoxTip({
+ confirmMsg: options.confrim.msg,
+ confirmTitle: options.confrim.title,
+ onConfirm: async () => {
+ const res = options.confrim.do();
+ show.value = false;
+ return res;
+ }
+ });
+ } else {
+ useMessageBox({
+ confirmMsg: options.cancel.msg,
+ confirmTitle: options.cancel.title,
+ onConfirm: () => {
+ const res = options.cancel.do();
+ show.value = false;
+ return res;
+ }
+ });
+ }
+ }
+ function cancelClick() {
+ show.value = false;
+ }
+ const options = {
+ tip: false,
+ cancel: {
+ title: '鍙栨秷',
+ msg: '鏄惁鏀惧純宸茬紪杈戠殑鍐呭锛�',
+ do: () => {}
+ },
+ confirm: {
+ title: '鎻愪氦',
+ msg: '纭鏄惁鎻愪氦锛�',
+ do: () => {}
+ }
+ };
+ return { show, confirmClick, cancelClick, options };
+}
diff --git a/src/composables/event.js b/src/composables/event.js
new file mode 100644
index 0000000..e4e1601
--- /dev/null
+++ b/src/composables/event.js
@@ -0,0 +1,26 @@
+// 寤惰繜浜嬩欢绠$悊
+export function useEvent() {
+ // 浜嬩欢鍒楄〃
+ let eventList = [];
+
+ // 娣诲姞浜嬩欢
+ function addEvent(event) {
+ eventList.push(event);
+ }
+
+ // 鎵ц浜嬩欢
+ function invokeEvent() {
+ eventList.forEach((e) => {
+ if (typeof e === 'function') {
+ e();
+ }
+ });
+ }
+
+ // 娓呯┖浜嬩欢
+ function clearEvent() {
+ eventList = []
+ }
+
+ return { addEvent, invokeEvent, clearEvent };
+}
diff --git a/src/composables/pagination.js b/src/composables/pagination.js
new file mode 100644
index 0000000..cbe95ac
--- /dev/null
+++ b/src/composables/pagination.js
@@ -0,0 +1,26 @@
+// 鍒嗛〉閫昏緫绠$悊
+import { ref, watch } from 'vue';
+import { useEvent } from './event';
+
+/**
+ * 鍒嗛〉鐩戝惉閫昏緫
+ * 1. 鐩戝惉椤电爜鍜屽崟椤垫暟鎹噺鍙樻崲
+ * 2. 鍙坊鍔犲搷搴旇Е鍙戜簨浠�
+ */
+export function usePagination() {
+ const { invokeEvent, addEvent: addPageEvent } = useEvent();
+ const currentPage = ref(1);
+ const pageSize = ref(20);
+ watch(currentPage, (nValue, oValue) => {
+ if (nValue != oValue) {
+ invokeEvent();
+ }
+ });
+ watch(pageSize, (nValue, oValue) => {
+ if (nValue != oValue) {
+ invokeEvent();
+ }
+ });
+
+ return { currentPage, pageSize, addPageEvent };
+}
diff --git a/src/enum/scene.js b/src/enum/scene.js
index 80aa423..5aeb977 100644
--- a/src/enum/scene.js
+++ b/src/enum/scene.js
@@ -5,7 +5,7 @@
*/
function enumScene(type, allOption = true) {
let l;
- switch (type) {
+ switch (parseInt(type)) {
case 1:
l = _enumScene_1();
break;
@@ -36,44 +36,44 @@
return [
{
label: '鍏ㄩ儴',
- value: null,
+ value: null
},
{
label: '椁愰ギ',
- value: '1',
+ value: '1'
},
{
label: '宸ュ湴',
- value: '2',
+ value: '2'
},
{
label: '鐮佸ご',
- value: '3',
+ value: '3'
},
{
label: '鍫嗗満',
- value: '4',
+ value: '4'
},
{
label: '鎼呮媽绔�',
- value: '5',
+ value: '5'
},
{
label: '宸ヤ笟浼佷笟',
- value: '6',
+ value: '6'
},
{
label: '姹戒慨',
- value: '7',
+ value: '7'
},
{
label: '瀹為獙瀹�',
- value: '8',
+ value: '8'
},
{
label: '鍖荤枟鏈烘瀯',
- value: '9',
- },
+ value: '9'
+ }
];
}
@@ -82,45 +82,62 @@
return [
{
label: '鍏ㄩ儴',
- value: null,
+ value: null
},
{
label: '宸ュ湴',
- value: '1',
+ value: '1'
},
{
label: '鐮佸ご',
- value: '2',
+ value: '2'
},
{
label: '鎼呮媽绔�',
- value: '3',
+ value: '3'
},
{
label: '宸ヤ笟浼佷笟',
- value: '4',
+ value: '4'
},
{
label: '椁愰ギ',
- value: '5',
+ value: '5'
},
{
label: '姹戒慨',
- value: '6',
+ value: '6'
},
{
label: '閬撹矾鎵皹鐩戞祴鐐�',
- value: '9',
+ value: '9'
},
{
label: '閬撹矾',
- value: '10',
+ value: '10'
},
{
label: '鍫嗗満',
- value: '14',
- },
+ value: '14'
+ }
];
}
-export { enumScene, getSceneName };
+/**
+ * 椋炵窘鐩戠绯荤粺 鍦烘櫙绫诲瀷杞� 椋炵窘鐜绯荤粺
+ * @param {*} sceneTypeId
+ */
+function svToTz(sceneTypeId) {
+ const sv = _enumScene_2();
+ const tz = _enumScene_1();
+
+ const scType = sv.find((v) => {
+ return v.value == sceneTypeId + '';
+ });
+ const tzType = tz.find((v) => {
+ return v.label == scType.label;
+ });
+ return tzType ? tzType : scType;
+}
+
+export { enumScene, getSceneName, svToTz };
diff --git a/src/router/index.js b/src/router/index.js
index 7f1db70..b33e0fd 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -88,7 +88,7 @@
name: 'fyspEvalutationTask',
path: '/fysp/evaluation/evalutationTask',
component: () => import('@/views/fysp/evaluation/EvalutationTask.vue'),
- meta: { keepAlive: true }
+ meta: { keepAlive: false }
},
{
//璇勪及绠$悊
diff --git a/src/views/fysp/config/DeviceMatch.vue b/src/views/fysp/config/DeviceMatch.vue
index 82eafd2..2bf5f74 100644
--- a/src/views/fysp/config/DeviceMatch.vue
+++ b/src/views/fysp/config/DeviceMatch.vue
@@ -1,5 +1,5 @@
<template>
- <FYTable @search="onSearch" :pagination="true" ref="tableRef">
+ <FYTable @search="onSearch" :pagination="false" ref="tableRef" size="small">
<template #options>
<!-- 鍖哄幙 -->
<FYOptionLocation
@@ -24,11 +24,48 @@
</el-form>
</template>
- <template #table-column>
- <el-table-column prop="sceneName" :show-overflow-tooltip="true" label="鍚嶇О">
+ <!-- <template #options-expand2>
+ <CompDeviceMatchEdit :area="area"></CompDeviceMatchEdit>
+ </template> -->
+
+ <template #table-column>
+ <el-table-column fixed="left" type="index" label="#" width="40" index="1"></el-table-column>
+ <el-table-column
+ prop="deviceCode"
+ :show-overflow-tooltip="true"
+ label="鐩戞祴璁惧缂栧彿"
+ width="160"
+ >
+ </el-table-column>
+ <el-table-column prop="deviceName" :show-overflow-tooltip="true" label="鐩戞祴璁惧鍚嶇О">
+ </el-table-column>
+ <el-table-column prop="svUserName" :show-overflow-tooltip="true" label="鐩戠鐢ㄦ埛鍚嶇О">
+ </el-table-column>
+ <el-table-column prop="tzUserName" :show-overflow-tooltip="true" label="瀹堟硶鑷姪鐢ㄦ埛鍚嶇О">
+ </el-table-column>
+ <el-table-column
+ prop="createTime"
+ :show-overflow-tooltip="true"
+ label="鍒涘缓鏃堕棿"
+ :formatter="timeFormat"
+ >
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="100">
+ <template #default="{ row }">
+ <el-button type="primary" size="small" @click="itemEdit(row)">缂栬緫</el-button>
+ </template>
</el-table-column>
</template>
</FYTable>
+ <el-drawer
+ v-model="drawerShow"
+ title="璁惧鍖归厤璁板綍缂栬緫"
+ direction="btt"
+ size="80%"
+ destroy-on-close
+ >
+ <CompDeviceMatchEdit :data="selectedItem" :area="area"></CompDeviceMatchEdit>
+ </el-drawer>
</template>
<script setup>
/**
@@ -37,10 +74,13 @@
import dayjs from 'dayjs';
import { ref, reactive, computed, getCurrentInstance } from 'vue';
import userMapApi from '@/api/fysp/userMapApi';
-import CompQuickSet from '@/views/fysp/evaluation/components/CompQuickSet.vue';
+import CompDeviceMatchEdit from '@/views/fysp/config/device/CompDeviceMatchEdit.vue';
+
+// fixme 2024.9.26 鍚庣画鍙互鐢╲ueuse涓殑鏃堕棿鏍煎紡鍖栨柟娉曟潵浠f浛
const { $fm } = getCurrentInstance().appContext.config.globalProperties;
+/******** 鍖归厤璁板綍鏌ヨ ********/
const tableRef = ref();
const formSearch = reactive({
locations: {},
@@ -78,4 +118,21 @@
// formSearch.sourceType = param.sourceType;
tableRef.value.onSearch();
}
+
+function timeFormat(row) {
+ const time = row.createTime;
+ if (time) {
+ return $fm.formatYMDH(time);
+ } else {
+ return '';
+ }
+}
+
+/******** 鍖归厤璁板綍缂栬緫 ********/
+const drawerShow = ref(false);
+const selectedItem = ref(null);
+function itemEdit(row) {
+ selectedItem.value = row;
+ drawerShow.value = true;
+}
</script>
diff --git a/src/views/fysp/config/device/CompDeviceMatchEdit.vue b/src/views/fysp/config/device/CompDeviceMatchEdit.vue
new file mode 100644
index 0000000..ee429b8
--- /dev/null
+++ b/src/views/fysp/config/device/CompDeviceMatchEdit.vue
@@ -0,0 +1,202 @@
+<template>
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <CompInfoSearch
+ v-model="device"
+ label="璁惧"
+ placeholder="杈撳叆璁惧MN鐮佹垨鍚嶇О"
+ @search="searchDevice"
+ >
+ <template #selected="{ row }">
+ <div>
+ <el-text>缂栧彿锛歿{ row.deviceCode }}</el-text>
+ </div>
+ <div>
+ <el-text>鍚嶇О锛歿{ row.deviceName }}</el-text>
+ </div>
+ </template>
+ <template #default="{ row, click }">
+ <el-text>deviceInfo</el-text>
+ </template>
+ </CompInfoSearch>
+ </el-col>
+ <el-col :span="8">
+ <CompInfoSearch
+ v-model="svUser"
+ label="鐩戠鐢ㄦ埛"
+ placeholder="杈撳叆鐢ㄦ埛鍚嶇О"
+ @search="searchSVUser"
+ >
+ <template #selected="{ row }">
+ <div>
+ <el-text>缂栧彿锛歿{ row.svUserId }}</el-text>
+ </div>
+ <div>
+ <el-text>鍚嶇О锛歿{ row.svUserName }}</el-text>
+ </div>
+ </template>
+ <template #default="{ row, click }">
+ <ItemUser :item="row" @add="selectSVUser(row, click)" />
+ </template>
+ </CompInfoSearch>
+ </el-col>
+ <el-col :span="8">
+ <CompInfoSearch
+ v-model="tzUser"
+ label="鐜鐢ㄦ埛"
+ placeholder="杈撳叆鐢ㄦ埛鍚嶇О"
+ @search="searchTZUser"
+ >
+ <template #selected="{ row }">
+ <div>
+ <el-text>缂栧彿锛歿{ row.tzUserId }}</el-text>
+ </div>
+ <div>
+ <el-text>鍚嶇О锛歿{ row.tzUserName }}</el-text>
+ </div>
+ </template>
+ <template #default="{ row, click }">
+ <ItemUser :item="row" @add="selectTZUser(row, click)" />
+ </template>
+ </CompInfoSearch>
+ </el-col>
+ </el-row>
+</template>
+
+<script>
+import { useCloned } from '@vueuse/core';
+import CompInfoSearch from './CompInfoSearch.vue';
+import tzUserApi from '@/api/fytz/userApi';
+import svUserApi from '@/api/fysp/userApi';
+import { svToTz } from '@/enum/scene';
+
+export default {
+ components: { CompInfoSearch },
+ props: {
+ // 璁惧璐︽埛鍖归厤淇℃伅
+ data: Object,
+ // 妫�绱㈣寖鍥达紙鍖呭惈琛屾斂鍖哄垝銆佸満鏅被鍨嬶級
+ area: Object
+ },
+ data() {
+ return {
+ // 鐩戞祴璁惧
+ device: {},
+ // 鐩戠鐢ㄦ埛
+ svUser: {},
+ // 鐜鐢ㄦ埛
+ tzUser: {}
+ };
+ },
+ watch: {
+ data: {
+ handler(nValue, oValue) {
+ if (nValue != oValue) {
+ this.device = {
+ deviceCode: nValue.deviceCode,
+ deviceName: nValue.deviceName
+ };
+ this.svUser = {
+ svUserId: nValue.svUserId,
+ svUserName: nValue.svUserName
+ };
+ this.tzUser = {
+ tzUserId: nValue.tzUserId,
+ tzUserName: nValue.tzUserName
+ };
+ }
+ },
+ immediate: true
+ }
+ },
+ methods: {
+ // 鏌ヨ鐩戞祴璁惧
+ searchDevice() {},
+ // 鏌ヨ鐩戠鐢ㄦ埛
+ searchSVUser(param, callback) {
+ const { text, page, pageSize } = param;
+ const { cloned: area } = useCloned(this.area);
+ area.value.sceneName = text;
+ return svUserApi
+ .searchUser(area.value, text, page, pageSize)
+ .then((res) => {
+ if (res.success) {
+ const l = res.data.map((value) => {
+ return {
+ guid: value.guid,
+ realname: value.realname,
+ acountname: value.acountname,
+ district: value.remark
+ };
+ });
+ callback({
+ data: l,
+ total: res.head.totalCount
+ });
+ }
+ })
+ .finally(() => {
+ callback();
+ });
+ },
+ // 鏌ヨ鐜锛堝畧娉曡嚜鍔╁皬绋嬪簭锛夌敤鎴�
+ searchTZUser(param, callback) {
+ const { text, page, pageSize } = param;
+ const area = {};
+ // 琛屾斂鍖哄垝
+ area.provinceCode = this.area.provincecode;
+ area.provinceName = this.area.provincename;
+ area.cityCode = this.area.citycode;
+ area.cityName = this.area.cityname;
+ area.districtCode = this.area.districtcode;
+ area.districtName = this.area.districtname;
+ area.townCode = this.area.towncode;
+ area.townName = this.area.townname;
+ // 鍦烘櫙绫诲瀷
+ const tzSceneType = svToTz(this.area.scensetypeid)
+ area.sceneTypes = [tzSceneType.value];
+ // 涓婁笅绾跨姸鎬�
+ area.online = this.area.online;
+ // 鍏抽敭瀛�
+ area.searchText = text;
+
+ tzUserApi
+ .fetchUser(page, pageSize, area)
+ .then((res) => {
+ if (res) {
+ const l = res.data.map((value) => {
+ return {
+ guid: value.userInfo.guid,
+ realname: value.userInfo.realname,
+ acountname: value.userInfo.acountname,
+ district: value.userInfo.extension1
+ };
+ });
+ callback({
+ data: l,
+ total: res.head.totalCount
+ });
+ }
+ })
+ .finally(() => {
+ callback();
+ });
+ },
+ selectDevice() {},
+ selectSVUser(row, click) {
+ const p = {
+ svUserId: row.guid,
+ svUserName: row.realname
+ };
+ click(p);
+ },
+ selectTZUser(row, click) {
+ const p = {
+ tzUserId: row.guid,
+ tzUserName: row.realname
+ };
+ click(p);
+ }
+ }
+};
+</script>
diff --git a/src/views/fysp/config/device/CompInfoSearch.vue b/src/views/fysp/config/device/CompInfoSearch.vue
new file mode 100644
index 0000000..bee891b
--- /dev/null
+++ b/src/views/fysp/config/device/CompInfoSearch.vue
@@ -0,0 +1,131 @@
+<template>
+ <!-- <div v-if="modelValue"> -->
+ <el-divider content-position="left">閫夋嫨{{ label }}</el-divider>
+ <div class="select-box">
+ <div>
+ <el-text size="small" type="info">褰撳墠閫夋嫨</el-text>
+ </div>
+ <slot name="selected" :row="modelValue"></slot>
+ </div>
+ <!-- </div> -->
+ <el-divider content-position="left">{{ label }}妫�绱�</el-divider>
+ <FYSearchBar @search="search" :loading="loading">
+ <template #options>
+ <FYOptionText
+ label=""
+ :placeholder="placeholder"
+ v-model:value="searchText"
+ width="200px"
+ ></FYOptionText>
+ </template>
+ </FYSearchBar>
+ <div>
+ <el-scrollbar v-if="dataList.length > 0" height="38vh" class="item-box">
+ <el-space direction="vertical" alignment="start" fill>
+ <div v-for="(item, index) in dataList" :key="index">
+ <slot :row="item" :click="select"></slot>
+ </div>
+ </el-space>
+ </el-scrollbar>
+ </div>
+ <el-pagination
+ v-if="pageShow && dataList.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: {
+ modelValue: Object,
+ label: {
+ type: String,
+ default: '妫�绱㈤」'
+ },
+ placeholder: {
+ type: String,
+ default: '杈撳叆鍏抽敭瀛楁绱�'
+ },
+ // 鏄惁鏄剧ず鍒嗛〉
+ pageShow: {
+ type: Boolean,
+ default: true
+ },
+ // 姣忛〉鍙�夋暟閲�
+ pageSizes: {
+ type: Array,
+ default: () => {
+ return [10, 20, 50, 100];
+ }
+ }
+ },
+ emits: ['search', 'update:modelValue'],
+ data() {
+ return {
+ searchText: '',
+ dataList: [],
+ total: 0,
+ loading: false
+ };
+ },
+ watch: {},
+ methods: {
+ search() {
+ this.loading = true;
+ const param = {
+ text: this.searchText,
+ page: this.currentPage,
+ pageSize: this.pageSize
+ };
+ this.$emit('search', param, (res) => {
+ if (res) {
+ this.dataList = res.data;
+ this.total = res.total ? res.total : 0;
+ }
+ this.loading = false;
+ });
+ },
+ select(e) {
+ this.$emit('update:modelValue', e);
+ }
+ },
+ 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>
diff --git a/src/views/fysp/evaluation/EvalutationRecord.vue b/src/views/fysp/evaluation/EvalutationRecord.vue
index 5727f66..190fc16 100644
--- a/src/views/fysp/evaluation/EvalutationRecord.vue
+++ b/src/views/fysp/evaluation/EvalutationRecord.vue
@@ -88,12 +88,11 @@
import dayjs from 'dayjs';
import evaluateApi from '@/api/fysp/evaluateApi';
import { envCreditCode } from '@/constants/index';
-import CompQuickSet from './components/CompQuickSet.vue';
import CompReport from './components/CompReport.vue';
export default {
name: 'ResultManage',
- components: { CompQuickSet, CompReport },
+ components: { CompReport },
data() {
return {
formSearch: {
diff --git a/src/views/fysp/evaluation/components/CompReport.vue b/src/views/fysp/evaluation/components/CompReport.vue
index 7ef12fd..7d1a7b0 100644
--- a/src/views/fysp/evaluation/components/CompReport.vue
+++ b/src/views/fysp/evaluation/components/CompReport.vue
@@ -6,7 +6,6 @@
v-model="dialogVisible"
title="瑙勮寖鎬ц瘎浼颁笌鍒嗘瀽鎶ュ憡鐢熸垚"
width="500"
- :before-close="handleClose"
>
<el-text tag="b" size="large">鏁版嵁鑼冨洿纭</el-text>
<el-text tag="div">鍖哄煙锛歿{ locationText }}</el-text>
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue
index 457a050..b2ce350 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue
@@ -8,6 +8,36 @@
<FYForm ref="formRef" :rules="evaConditionRules" :showButtons="false" @submit="nextStep">
<template #form-item="{ formObj }">
<CompQuickSet @quick-set="setOptions"></CompQuickSet>
+ <el-form-item label="涓绘暟鎹簮" prop="sourceType">
+ <el-radio-group
+ v-model="formObj.sourceType"
+ size="small"
+ @change="sceneOptionSourceInit = true"
+ >
+ <el-radio-button :value="1">瀹堟硶鏈嶅姟璁板綍</el-radio-button>
+ <el-radio-button :value="2">鐜板満宸℃煡璁板綍</el-radio-button>
+ </el-radio-group>
+ <el-tooltip placement="bottom-start" effect="light">
+ <template #content>
+ <el-text tag="i" size="default" type="warning"
+ >璇ラ�夐」鏄敤浜庡喅瀹氳瘎浼颁富浣撳璞$殑鑾峰彇鏂瑰紡</el-text
+ ><br />
+ <el-text tag="b" size="small">瀹堟硶鏈嶅姟璁板綍锛�</el-text><br />
+ <el-text size="small"
+ >琛ㄧず鍦ㄨ瘎浼版椂锛岃瘎浼板璞℃槸浠庡畧娉曟湇鍔″皬绋嬪簭绯荤粺涓幏鍙栫殑褰撳墠鍙敤鐨勭敤鎴凤紱<br />
+ 涓�鑸儏鍐典笅锛屽綋璇勪及瀵硅薄娌℃湁杩涜鐜板満宸℃煡锛屽彧鏈夊畧娉曟湇鍔$浉鍏宠褰曟椂锛岄噰鐢ㄦ閫夐」锛�</el-text
+ ><br />
+ <el-text tag="b" size="small">鐜板満宸℃煡璁板綍锛�</el-text><br />
+ <el-text size="small"
+ >琛ㄧず鍦ㄨ瘎浼版椂锛岃瘎浼板璞℃槸浠庣幇鍦哄贰鏌ョ洃绠$郴缁熶腑鑾峰彇鐨勬�讳换鍔′笅鐨勬墍鏈夌洃绠″満鏅紱<br />
+ 涓�鑸儏鍐典笅锛屽綋璇勪及瀵硅薄鏈夎繘琛岀幇鍦哄贰鏌ワ紝閲囩敤姝ら�夐」锛� </el-text
+ ><br />
+ </template>
+ <el-icon class="m-l-8 cursor-p" :size="16" color="var(--el-color-warning)"
+ ><QuestionFilled
+ /></el-icon>
+ </el-tooltip>
+ </el-form-item>
<!-- 鍖哄幙 -->
<FYOptionLocation
:allOption="false"
@@ -31,39 +61,6 @@
type="month"
v-model:value="formObj.time"
></FYOptionTime>
- <el-form-item label="涓绘暟鎹簮" prop="sourceType">
- <!-- <el-switch v-model="formObj.sourceType" @change="sceneOptionSourceInit = true" /> -->
- <el-radio-group
- v-model="formObj.sourceType"
- size="small"
- @change="sceneOptionSourceInit = true"
- >
- <el-radio-button label="1">瀹堟硶鏈嶅姟璁板綍</el-radio-button>
- <el-radio-button label="2">鐜板満宸℃煡璁板綍</el-radio-button>
- </el-radio-group>
- <!-- <span class="m-l-16">{{ formObj.sourceType ? '瀹堟硶鏈嶅姟璁板綍' : '鐜板満宸℃煡璁板綍' }}</span> -->
- <el-tooltip placement="bottom-start" effect="light">
- <template #content>
- <!-- <el-text tag="b" size="default">璇存槑</el-text><br /> -->
- <el-text tag="i" size="default" type="warning"
- >璇ラ�夐」鏄敤浜庡喅瀹氳瘎浼颁富浣撳璞$殑鑾峰彇鏂瑰紡</el-text
- ><br />
- <el-text tag="b" size="small">瀹堟硶鏈嶅姟璁板綍锛�</el-text><br />
- <el-text size="small"
- >琛ㄧず鍦ㄨ瘎浼版椂锛岃瘎浼板璞℃槸浠庡畧娉曟湇鍔″皬绋嬪簭绯荤粺涓幏鍙栫殑褰撳墠鍙敤鐨勭敤鎴凤紱<br />
- 涓�鑸儏鍐典笅锛屽綋璇勪及瀵硅薄娌℃湁杩涜鐜板満宸℃煡锛屽彧鏈夊畧娉曟湇鍔$浉鍏宠褰曟椂锛岄噰鐢ㄦ閫夐」锛�</el-text
- ><br />
- <el-text tag="b" size="small">鐜板満宸℃煡璁板綍锛�</el-text><br />
- <el-text size="small"
- >琛ㄧず鍦ㄨ瘎浼版椂锛岃瘎浼板璞℃槸浠庣幇鍦哄贰鏌ョ洃绠$郴缁熶腑鑾峰彇鐨勬�讳换鍔′笅鐨勬墍鏈夌洃绠″満鏅紱<br />
- 涓�鑸儏鍐典笅锛屽綋璇勪及瀵硅薄鏈夎繘琛岀幇鍦哄贰鏌ワ紝閲囩敤姝ら�夐」锛� </el-text
- ><br />
- </template>
- <el-icon class="m-l-8 cursor-p" :size="16" color="var(--el-color-warning)"
- ><QuestionFilled
- /></el-icon>
- </el-tooltip>
- </el-form-item>
</template>
</FYForm>
</FormCol>
@@ -78,13 +75,11 @@
</template>
<script>
-import CompQuickSet from '../../CompQuickSet.vue';
/**
* 璇勪及鑼冨洿鍚堣鎬ф鏌�
*/
export default {
- components: { CompQuickSet },
props: {
// 姝ラ涓嬫爣
modelValue: Number
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
index 6348a1b..33c01fb 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -3,7 +3,6 @@
<template #header>
<div><el-text tag="b" size="large">鏁版嵁婧愭鏌�</el-text></div>
<el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
- <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
</template>
<FormCol>
<template v-for="(v, i) in checkResults" :key="i">
@@ -91,10 +90,24 @@
async fetch() {
this.loading = true;
setTimeout(async () => {
- const res = await _fetch();
- this.pass = res ? res.pass : undefined;
- this.des = res ? res.des : undefined;
- this.loading = false;
+ if (_fetch != undefined) {
+ _fetch()
+ .then((res) => {
+ this.pass = res ? res.pass : undefined;
+ this.des = res ? res.des : undefined;
+ })
+ .catch(() => {
+ this.pass = false;
+ this.des = '缃戠粶閾炬帴閿欒';
+ })
+ .finally(() => {
+ this.loading = false;
+ });
+ } else {
+ this.pass = undefined;
+ this.des = undefined;
+ this.loading = false;
+ }
}, 1000);
}
};
@@ -160,7 +173,7 @@
});
}),
// 鍖哄煙鑼冨洿鍐呯殑鐩戞祴鏁版嵁鏄惁瀛樺湪銆佹暟鎹椂闂磋法搴︽槸鍚﹀畬鏁淬�佹暟鎹殑鍒濇鍒嗘瀽鏄惁瀹屾垚
- baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}),
+ baseCheckItem('鐜板満鐩戞祴鏁版嵁', ''),
// 鍖哄煙鑼冨洿鍐呯殑姣忎釜鐩戠鐐逛綅涓庣洃娴嬩华鍣ㄧ殑鍖归厤璁板綍鏄惁瀛樺湪锛岀己澶辨儏鍐电瓑
baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {
return userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
@@ -192,14 +205,12 @@
return { pass, des };
});
}),
+ // complaintApi.fetchComplaints();
// 鍖哄煙鑼冨洿鍐呯殑淇¤鎶曡瘔璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
- baseCheckItem('淇¤鎶曡瘔', '', () => {
- // complaintApi.fetchComplaints();
- }),
+ baseCheckItem('淇¤鎶曡瘔', ''),
+ // complaintApi.fetchPunishment();
// 鍖哄煙鑼冨洿鍐呯殑琛屾斂澶勭綒璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
- baseCheckItem('琛屾斂澶勭綒', '', () => {
- // complaintApi.fetchPunishment();
- })
+ baseCheckItem('琛屾斂澶勭綒', '')
]
};
},
@@ -253,7 +264,7 @@
// online: true,
// sourceType: v.sourceType
// };
- this.areaInfo = value
+ this.areaInfo = value;
this.checkResults.forEach((e) => {
e.fetch();
diff --git a/src/views/fysp/support/NewDevice.vue b/src/views/fysp/support/NewDevice.vue
index e84c783..0dd825a 100644
--- a/src/views/fysp/support/NewDevice.vue
+++ b/src/views/fysp/support/NewDevice.vue
@@ -17,7 +17,7 @@
</el-scrollbar>
</el-col>
<el-col :span="8">
- <DeviceMatch :device="selectedDevice" :scene="selectedScene"></DeviceMatch>
+ <DeviceMatch :device="selectedDevice" :scene="selectedScene" @success="onUploadSuccess"></DeviceMatch>
</el-col>
<el-col :span="8">
<el-text>鐩戠宸ュ湴</el-text>
@@ -48,7 +48,6 @@
import { useFetchData } from '@/composables/fetchData';
import ItemDevice from './components/ItemDevice.vue';
-import ItemScene from './components/ItemScene.vue';
import DeviceMatch from './components/DeviceMatch.vue';
const { loading, fetchData } = useFetchData();
@@ -92,6 +91,17 @@
function addScene(item) {
selectedScene.value = item;
}
+
+/**
+ * 涓婁紶璁惧瀹屾垚
+ */
+function onUploadSuccess() {
+ const i = deviceList.value.indexOf(selectedDevice.value)
+ deviceList.value.splice(i, 1)
+ selectedDevice.value = null
+ selectedScene.value = null
+
+}
</script>
<style scoped>
.device-scene-wrap {
diff --git a/src/views/fysp/support/components/DeviceMatch.vue b/src/views/fysp/support/components/DeviceMatch.vue
index e9b046f..1cb78e1 100644
--- a/src/views/fysp/support/components/DeviceMatch.vue
+++ b/src/views/fysp/support/components/DeviceMatch.vue
@@ -15,11 +15,13 @@
>褰曞叆璁惧淇℃伅</el-button
>
</div>
- <el-button type="danger" :disabled="!enabled">涓婁紶鍖归厤淇℃伅</el-button>
+ <el-button type="danger" :disabled="!enabled" @click="uploadMatchScene"
+ >涓婁紶鍖归厤淇℃伅</el-button
+ >
</el-row>
<div v-if="newDevice">
<el-text>鏂板璁惧</el-text>
- <FormDevice :form-info="newDevice" :is-edit="true" ></FormDevice>
+ <FormDevice :form-info="newDevice" :is-edit="true"></FormDevice>
</div>
<div v-if="deviceList.length > 0">
<el-text>宸叉湁璁惧</el-text>
@@ -31,6 +33,9 @@
<script setup>
import { ref, computed, watch } from 'vue';
import deviceApi from '@/api/fysp/deviceApi';
+import constructionApi from '@/api/additional-jingan/constructionApi';
+import { useFetchData } from '@/composables/fetchData';
+import { ElMessage } from 'element-plus';
import FormDevice from './FormDevice.vue';
@@ -38,6 +43,8 @@
device: Object,
scene: Object
});
+
+const emit = defineEmits(['success']);
// 鏂板璁惧淇℃伅
const newDevice = ref();
@@ -52,7 +59,7 @@
() => props.scene,
(nV, oV) => {
if (nV != oV) {
- fetchDeviceInfo();
+ // fetchDeviceInfo();
}
}
);
@@ -74,4 +81,30 @@
diRemoved: false
};
}
+
+const { loading, fetchData } = useFetchData();
+/**
+ * 涓婁紶璁惧鍏宠仈宸ュ湴
+ */
+function uploadMatchScene() {
+ const param = {
+ name: props.scene.name,
+ address: props.scene.location,
+ street: props.scene.townname,
+ lon: props.device.lon,
+ lat: props.device.lat,
+ sbCode: props.device.code,
+ sbName: props.device.name
+ };
+
+ fetchData(() => {
+ return constructionApi.uploadConstructionDevice(param).then((res) => {
+ ElMessage({
+ message: res.message,
+ type: 'success'
+ });
+ emit('success');
+ });
+ });
+}
</script>
diff --git a/src/views/fysp/support/components/ItemScene.vue b/src/views/fysp/support/components/ItemScene.vue
deleted file mode 100644
index bdfeb45..0000000
--- a/src/views/fysp/support/components/ItemScene.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-<template>
- <el-card shadow="hover">
- <el-row justify="space-between">
- <div>
- <el-text>{{ item.index }}銆�</el-text>
- <el-text>{{ item.name }}</el-text>
- </div>
- <div>
- <el-text>绫诲瀷锛歿{ item.type }}</el-text>
- </div>
- </el-row>
- <div>
- <el-text>鍖哄幙锛�</el-text>
- <el-text>{{ item.districtname }}</el-text>
- </div>
- <el-row justify="start">
- <el-button size="small" type="success" @click="add">娣诲姞</el-button>
- </el-row>
- </el-card>
-</template>
-<script setup>
-const props = defineProps({
- item: {
- type: Object,
- default: () => {}
- }
-});
-
-const emit = defineEmits(['add']);
-
-function add() {
- emit('add', props.item);
-}
-</script>
--
Gitblit v1.9.3