From 9913f6564c1eb8592029ac4966bb6b1306e15c6b Mon Sep 17 00:00:00 2001 From: monkeyhouyi Date: Wed, 31 Jul 2024 16:33:08 +0800 Subject: [PATCH] 巡查上报 --- src/components/SelsctLoad/index.vue | 36 +++++++++++++++++------------------- src/filters/index.js | 20 ++++++++++++++++++++ src/views/baseSystemInfo/InspectForm.vue | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------- src/views/baseSystemInfo/index.vue | 20 +++++++------------- 4 files changed, 98 insertions(+), 66 deletions(-) diff --git a/src/components/SelsctLoad/index.vue b/src/components/SelsctLoad/index.vue index 2c33373..2ad6d5a 100644 --- a/src/components/SelsctLoad/index.vue +++ b/src/components/SelsctLoad/index.vue @@ -7,13 +7,14 @@ clearable reserve-keyword placeholder="请输入关平台名称" - :remote-method="search" v-loadMore="nextList" - :loading="loading" - @change="onChange" + @select="onChange" + @blur="onInput" @clear="clearHandle" @focus="search" + :loading="loading && !this.options.length" > + { - let list = []; - data.list.length && - data.list.forEach((item) => { - list.push({ - label: item.SysytemInfo.SystemName, - value: item.SysytemInfo.Id, - }); - }); - this.options = [...this.options, ...list]; - }); + this.searchList.pageIndex += 1; + this.$nextTick(() => { + this.loadList(); + }) }, - search(query) { + search() { this.options = []; this.searchList = { pageIndex: 1, @@ -75,11 +68,11 @@ export default { sort: "desc", sidx: "", }; - this.loadList(query); + this.loadList(); }, - loadList(query) { + loadList() { this.loading = true; - getInfoList({ ...this.searchList, keyword: query }).then(({ data }) => { + getInfoList({ ...this.searchList, keyword: this.value }).then(({ data }) => { let list = []; data.list.length && data.list.forEach((item) => { @@ -105,6 +98,11 @@ export default { this.$emit("input", this.options.map((item) => item.value == v).label); this.$emit("change", v); }, + + onInput(e) { + this.$emit("input", e.target.value); + this.$emit("change", e.target.value); + } }, watch: { value(val) { diff --git a/src/filters/index.js b/src/filters/index.js index 516e837..f0b0008 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -162,6 +162,26 @@ export function dynamicText(value, options) { if (!item || !item.fullName) return value return item.fullName } +export function dynamicTextUP(value, options) { + if (!value) return '' + if (Array.isArray(value)) { + if (!options || !Array.isArray(options)) return value.join() + let textList = [] + for (let i = 0; i < value.length; i++) { + let item = options.filter(o => o.id == value[i])[0] + if (!item || !item.fullName) { + textList.push(value[i]) + } else { + textList.push(item.fullName) + } + } + return textList.join() + } + if (!options || !Array.isArray(options)) return value + let item = options.filter(o => o.Id == value)[0] + if (!item || !item.FullName) return value + return item.FullName +} // 代码生成器数据匹配 Code export function dynamicTextCode(value, options) { diff --git a/src/views/baseSystemInfo/InspectForm.vue b/src/views/baseSystemInfo/InspectForm.vue index fc84ce2..e4036a9 100644 --- a/src/views/baseSystemInfo/InspectForm.vue +++ b/src/views/baseSystemInfo/InspectForm.vue @@ -17,40 +17,37 @@ :disabled="!!isDetail" :rules="rules" > - - - - + + + + + + - - + - + :label="item.Id" + >{{ item.FullName }} + - + - + - - - + + - + + + + + + + - + - - + + + + + +