From 3cab871cbfa61bfcf6cfeb231171784728db71f6 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 11 Apr 2023 10:11:06 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E4=BC=A0=E5=8F=82bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataBoard/renfang/cpts/rkfx.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/dataBoard/renfang/cpts/rkfx.vue b/src/views/dataBoard/renfang/cpts/rkfx.vue index 022f38a0e..18c03ba11 100644 --- a/src/views/dataBoard/renfang/cpts/rkfx.vue +++ b/src/views/dataBoard/renfang/cpts/rkfx.vue @@ -105,7 +105,7 @@ const { type, name - } = item; + } = item.data; this.$router.push({ path: "/dataBoard/renfang/resi-analyze", query: { From 9add0f1b7dff4fdbc21b39803aa6b6873b46bb05 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 11 Apr 2023 13:37:27 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/community/roomDetail.vue | 2 +- src/views/modules/base/community/roomForm.vue | 2 +- .../modules/base/community/roomTable.vue | 35 ++++++++++--------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/views/modules/base/community/roomDetail.vue b/src/views/modules/base/community/roomDetail.vue index 2ea3c8f56..f23bff00e 100644 --- a/src/views/modules/base/community/roomDetail.vue +++ b/src/views/modules/base/community/roomDetail.vue @@ -273,7 +273,7 @@ export default { view_real_data: { //显示【显示脱敏信息】按钮 type: Boolean, - default: false, + default: true, }, }, }; diff --git a/src/views/modules/base/community/roomForm.vue b/src/views/modules/base/community/roomForm.vue index 3c5d2aa60..db27b6ad7 100644 --- a/src/views/modules/base/community/roomForm.vue +++ b/src/views/modules/base/community/roomForm.vue @@ -466,7 +466,7 @@ export default { props: { view_real_data: {//显示【显示脱敏信息】按钮 type: Boolean, - default: false, + default: true, } } } diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index d46ff95cc..dd60e0df5 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -2,8 +2,9 @@
+
- +
+ 导出 - + 批量删除 @@ -67,14 +69,15 @@
+ 下载房屋模板
-
+
导出一户一档
- -
+
@@ -153,13 +153,19 @@ export default { showInfo(index) { let item = this.srcTableData[index]; - this.displayedId = item.building_id; - - this.breadList.push({ - meta: { - title: "预警人员列表", - }, - }); + // this.displayedId = item.building_id; + this.$router.push({ + path:"/dataBoard/renfang/warn-resi", + query:{ + building_id:item.building_id, + resident_type:this.type_id + } + }) + // this.breadList.push({ + // meta: { + // title: "预警人员列表", + // }, + // }); }, handlePageNoChange(pageNo) { diff --git a/src/views/dataBoard/renfang/warn/resi.vue b/src/views/dataBoard/renfang/warn/resi.vue index 18534820d..793b027b6 100644 --- a/src/views/dataBoard/renfang/warn/resi.vue +++ b/src/views/dataBoard/renfang/warn/resi.vue @@ -1,5 +1,10 @@
@@ -396,547 +396,534 @@ import daiMap from "@/utils/dai-map"; var map; export default { - components: { Tinymce }, - - props: { - formId: { - type: String, - default: "", - }, - formType: { - type: String, - default: "info", - }, - formBtnFixed: { - type: Boolean, - default: true, - }, - idName: { - type: String, - default: "", - }, - addUrl: { - type: String, - default: "", - }, - editUrl: { - type: String, - default: "", - }, - delUrl: { - type: String, - default: "", - }, - infoUrl: { - type: String, - default: "", - }, - - editParams: { - type: Array, - default: () => [], - }, - editFixedParams: { - type: Object, - default: () => ({}), - }, - editParamsDiv: { - type: Number, - default: 0, - }, - editElseRules: { - type: Object, - default: () => ({}), - }, - editConfig: { - type: Object, - default: () => ({}), - }, - }, - - data() { - return { - iniLoaded: false, - loading: false, - btnDisable: false, - - fmData: {}, - - editParams1: [], - editParams2: [], - - uploadUrl: - window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", - customerId: localStorage.getItem("customerId"), - - // 做搜索地址用 - searchAddressOptions: [], - searchAddressKeyword: "", - }; - }, - computed: {}, - watch: { - editParams: { - handler() { - this.computeFmData(); - }, - deep: true, - }, - }, - - async mounted() { - this.initForm(); - }, - - methods: { - async initForm() { - this.iniFmData(); - - if (this.formId && this.formType != "add") { - this.getInfo(); - } - }, - - computeFmData() { - console.log(this.fmData); - }, - - iniFmData() { - const { editParams, fmData } = this; - editParams.forEach((list, listIndex) => { - list.forEach((item, index) => { - if (typeof item.value == "function") { - fmData[item.keyName] = item.value(); - } else if ( - typeof item.value == "string" || - typeof item.value == "number" || - typeof item.value == "boolean" - ) { - fmData[item.keyName] = item.value; - } else if (typeof item.value == "undefined") { - fmData[item.keyName] = ""; - } else { - fmData[item.keyName] = item.value || ""; - console.error( - "不应该直接传入数组或对象的值,这样会导致传入的值被子组件修改。editParams-------------cpts/base/cpts/edit.vue", - item - ); - } - - if (item.supValues) { - item.supValues.forEach((value, index) => { - if (typeof value == "function") { - fmData[item.supKeys[index]] = value(); - } else if ( - typeof value == "string" || - typeof value == "number" || - typeof value == "boolean" - ) { - fmData[item.supKeys[index]] = value; - } else if (typeof value == "undefined") { - fmData[item.supKeys[index]] = ""; - } else { - fmData[item.supKeys[index]] = value; - console.error( - "不应该直接传入数组或对象的值,这样会导致传入的值被子组件修改。editParams-------------cpts/base/cpts/edit.vue", - item - ); - } - }); - } - - if (item.type == "select" || item.type == "cascader") { - if (item.optionUrl) { - this.getFmOptions( - listIndex, - index, - item.optionUrl, - item.optionUrlParams || {}, - item.optionCook || null - ); - } - } else if (item.type == "address") { - this.$nextTick(async () => { - await nextTick(300); - - this.initMap(item); - }); - } - }); - }); - - this.fmData = { ...fmData }; - console.log("------------------------------------", this.fmData); - this.iniLoaded = true; - }, - - handleClickHtmlNode(e) { - //在判断事件目标节点的时候,考虑到兼容性应该统一转换成大写或小写进行判断 - if (e.target.localName.toLowerCase() === "a") { - // 通过判端目标节点以后,就能在这里对其进行操作啦。 - let url = e.target.getAttribute("src"); //获取a标签属性,我这里自定义了一个属性data-id并将id赋值给了该属性,如何需要获取click方法的参数,需要获取a标签的click属性,并手动解析获取里面的参数 - window.open(url); - } - }, - - async getFmOptions(listIndex, index, url, params, cookFn) { - const { data, code, msg } = await requestPost(url, { - ...params, - }); - - if (code === 0) { - this.editParams[listIndex][index].optionList = - typeof cookFn == "function" ? cookFn(data) : data || []; - } else { - this.$message.error("请求检索基础数据失败!"); - } - }, - - handleChangeCascader(vals, item) { - this.fmData[item["keyName"]] = vals; - if (typeof item.handleChangeFn == "function") { - item.handleChangeFn(vals, item, this); - } - }, - handleChangeSelect(vals, item) { - console.log(vals, item); - this.fmData[item["keyName"]] = vals; - if (typeof item.handleChangeFn == "function") { - item.handleChangeFn(vals, item, this); - } - }, - - beforeImgUpload(file, item) { - if (typeof item.beforeImgUpload == "function") { - if (!item.beforeImgUpload(file, item, this)) return false; - } - return true; - }, - - handleImgRemove(file, item) { - console.log("handleImgRemove", file); - let url = file.response ? file.response.data.url : file.url; - if (url) { - let { fmData } = this; - this.fmData[item.keyName] = fmData[item.keyName].filter( - (item) => item.url !== url - ); - if (item.supKeys && Array.isArray(item.supKeys)) { - if (item.supKeys.length > 0) { - this.fmData[item.supKeys[0]] = fmData[item.keyName].map( - (item) => item.url - ); - } - if (item.supKeys.length > 1) { - this.fmData[item.supKeys[1]] = - this.fmData[item.supKeys[0]][0] || ""; - } - } - } - }, - - handleImgExceed(res, item) { - console.log(res); - // this.$message({ - // type: "warning", - // message: "文件数量最多不超过三个", - // }); - }, - - handleImgSuccess(res, file, item) { - console.log("handleImgSuccess", res); - if (res.code === 0 && res.msg === "success") { - let { fmData } = this; - // let picItem = { - // url: res.data.url, - // name: file.name, - // size: file.size, - // type: file.type, - // format: file.name.split(".").pop(), - // }; - let picItem = file; - picItem.url = res.data.url; - picItem.format = file.name.split(".").pop(); - - if (Array.isArray(this.fmData[item.keyName])) { - this.fmData[item.keyName].push(picItem); - } else { - this.fmData[item.keyName] = [picItem]; - } - if (item.supKeys && Array.isArray(item.supKeys)) { - if (item.supKeys.length > 0) { - this.fmData[item.supKeys[0]] = fmData[item.keyName].map( - (item) => item.url - ); - } - if (item.supKeys.length > 1) { - this.fmData[item.supKeys[1]] = - this.fmData[item.supKeys[0]][0] || ""; - } - } - } else { - this.$message.error(res.msg); - } - }, - - handleImgError(res, file, item) { - console.log(res); - }, - - // 地图初始化函数,本例取名为init,开发者可根据实际情况定义 - initMap(item) { - let { latitude, longitude } = this.$store.state.user; - - map = new daiMap( - document.getElementById("map"), - { latitude, longitude }, - { - zoom: 16.2, // 设置地图缩放级别 - pitch: 43.5, // 设置俯仰角 - rotation: 45, // 设置地图旋转角度 - } - ); - - // 监听地图平移结束 - map.on("dragend", (e) => { - this.handleMoveCenter(item, e); - }); - map.setCenter(latitude, longitude); - map.setMarker(latitude, longitude); - }, - - async handleSearchMap(item) { - const { msg, data } = await map.searchNearby( - this.fmData[item.keyName] - ); - if (msg == "success") { - const { lat, lng } = data; - map.setCenter(lat, lng); - map.setMarker(lat, lng); - this.fmData[item.supKeys[0]] = lng; - this.fmData[item.supKeys[1]] = lat; - } else { - this.$message.error("未检索到相关位置坐标"); - } - }, - - async handleMoveCenter(item, e) { - console.log("handleMoveCenter", e); - //修改地图中心点 - const { lat, lng } = map.getCenter(); - console.log("getCenter", lat); - - this.fmData[item.supKeys[0]] = parseFloat(lng); - this.fmData[item.supKeys[1]] = parseFloat(lat); - map.setMarker(lat, lng); - console.log("setMarker", lat); - - let { msg, data } = await map.getAddress(lat, lng); - if (msg == "success") { - this.fmData[item.keyName] = data.address; - this.searchAddressOptions = []; - } - }, - - async remoteMethod(query) { - if (query !== "") { - this.loading = true; - - const { msg, data } = await map.searchNearby(query); - this.loading = false; - console.log("搜索结果", data); - - if ( - msg == "success" && - data.resultList && - data.resultList.length > 0 - ) { - this.searchAddressOptions = data.resultList.map( - (item, index) => { - return { - ...item, - value: `${item.lonlat + item.address}`, - label: `${item.address + item.name}`, - }; - } - ); - } else { - this.searchAddressOptions = [ - { - value: "0", - label: "未检索到结果", - }, - ]; - } - } else { - this.searchAddressOptions = []; - } - }, - - handleClickKey(item, fmItem) { - console.log("搜索结果", item); - let lonlat = item.lonlat.split(" "); - map.setCenter(lonlat[1], lonlat[0]); - map.setMarker(lonlat[1], lonlat[0]); - - this.fmData[fmItem.supKeys[0]] = parseFloat(lonlat[1]); - this.fmData[fmItem.supKeys[1]] = parseFloat(lonlat[0]); - this.fmData[fmItem.keyName] = item.label; - }, - - async getInfo() { - let url = this.infoUrl; - if (!url) return; - const { idName, formId } = this; - - if (url.endsWith("/")) { - url += formId; - } - - const params = { - [idName]: formId, - }; - - let { data, code, msg } = await requestPost(url, params); - if (code === 0) { - const { editConfig } = this; - console.log("xxxxxxxxxxxxxxxxxxxxxx", editConfig); - if (editConfig && typeof editConfig.cookInfoFn == "function") { - data = editConfig.cookInfoFn(data); - } - - if (data.latitude && data.longitude) { - data.latitude = parseFloat(data.latitude); - data.longitude = parseFloat(data.longitude); - } - - this.fmData = { - ...this.fmData, - ...data, - }; - - await nextTick(600); - if (map) { - if (data.latitude) { - map.setCenter(data.longitude,data.latitude ); - map.setMarker(data.longitude,data.latitude); - } else { - if ( - this.formType == "edit" && - this.$refs && - this.$refs.mapSearch - ) { - this.$refs.mapSearch[0].handleClick(); - } - } - } - } else { - this.$message.error(msg); - } - }, - - watchImg(src) { - window.open(src); - }, - - // 过滤文本 - dormatHtml(content) { - if ( - content.startsWith( - "\n\n\n\n\n" - ) && - content.endsWith("\n\n") - ) { - content = content.slice(45, -16); - } - return content; - }, - - cookBeforeSubmit(data) { - Object.keys(data).forEach((k) => { - if (typeof data[k] == "string") { - data[k] = this.dormatHtml(data[k]); - } - }); - return data; - }, - - async handleComfirm() { - this.btnDisable = true; - setTimeout(() => { - this.btnDisable = false; - }, 5000); - - console.log(this.$refs["ref_form"]); - - this.$refs["ref_form"].validate((valid, messageObj) => { - console.log(valid, messageObj); - if (!valid) { - app.util.validateRule(messageObj); - this.btnDisable = false; - } else { - if (this.editElseRules) { - const validator = new Schema(this.editElseRules); - validator - .validate(this.fmData) - .then(() => { - this.submit(); - }) - .catch(({ err, fields }) => { - console.log("--------------", err, fields); - app.util.validateRule(fields); - }); - } else { - this.submit(); - } - } - }); - }, - - async submit() { - const { editConfig, fmData, formType, editFixedParams } = this; - if ( - typeof editConfig.beforeSubmit == "function" && - !editConfig.beforeSubmit(formType, fmData, this) - ) { - return; - } - - let url = ""; - let params = { - ...fmData, - ...editFixedParams, - // serviceType: this.fmData.serviceTypeArr.join(","), - }; - - params = this.cookBeforeSubmit(params); - - if (this.formType === "add") { - url = this.addUrl; - } else { - url = this.editUrl; - } - - const { data, code, msg } = await requestPost(url, params); - - if (code === 0) { - this.$message({ - type: "success", - message: "操作成功", - }); - this.handleCancle(); - this.$emit("afterEdit"); - this.btnDisable = false; - } else { - this.btnDisable = false; - this.$message.error(msg); - } - }, - - handleCancle() { - this.$emit("close"); - }, - }, + components: { Tinymce }, + + props: { + formId: { + type: String, + default: "", + }, + formType: { + type: String, + default: "info", + }, + formBtnFixed: { + type: Boolean, + default: true, + }, + idName: { + type: String, + default: "", + }, + addUrl: { + type: String, + default: "", + }, + editUrl: { + type: String, + default: "", + }, + delUrl: { + type: String, + default: "", + }, + infoUrl: { + type: String, + default: "", + }, + + editParams: { + type: Array, + default: () => [], + }, + editFixedParams: { + type: Object, + default: () => ({}), + }, + editParamsDiv: { + type: Number, + default: 0, + }, + editElseRules: { + type: Object, + default: () => ({}), + }, + editConfig: { + type: Object, + default: () => ({}), + }, + }, + + data() { + return { + iniLoaded: false, + loading: false, + btnDisable: false, + + fmData: {}, + + editParams1: [], + editParams2: [], + + uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", + customerId: localStorage.getItem("customerId"), + + // 做搜索地址用 + searchAddressOptions: [], + searchAddressKeyword: "", + }; + }, + computed: {}, + watch: { + editParams: { + handler() { + this.computeFmData(); + }, + deep: true, + }, + }, + + async mounted() { + this.initForm(); + }, + + methods: { + async initForm() { + this.iniFmData(); + + if (this.formId && this.formType != "add") { + this.getInfo(); + } + }, + + computeFmData() { + console.log(this.fmData); + }, + + iniFmData() { + const { editParams, fmData } = this; + editParams.forEach((list, listIndex) => { + list.forEach((item, index) => { + if (typeof item.value == "function") { + fmData[item.keyName] = item.value(); + } else if ( + typeof item.value == "string" || + typeof item.value == "number" || + typeof item.value == "boolean" + ) { + fmData[item.keyName] = item.value; + } else if (typeof item.value == "undefined") { + fmData[item.keyName] = ""; + } else { + fmData[item.keyName] = item.value || ""; + console.error( + "不应该直接传入数组或对象的值,这样会导致传入的值被子组件修改。editParams-------------cpts/base/cpts/edit.vue", + item + ); + } + + if (item.supValues) { + item.supValues.forEach((value, index) => { + if (typeof value == "function") { + fmData[item.supKeys[index]] = value(); + } else if ( + typeof value == "string" || + typeof value == "number" || + typeof value == "boolean" + ) { + fmData[item.supKeys[index]] = value; + } else if (typeof value == "undefined") { + fmData[item.supKeys[index]] = ""; + } else { + fmData[item.supKeys[index]] = value; + console.error( + "不应该直接传入数组或对象的值,这样会导致传入的值被子组件修改。editParams-------------cpts/base/cpts/edit.vue", + item + ); + } + }); + } + + if (item.type == "select" || item.type == "cascader") { + if (item.optionUrl) { + this.getFmOptions( + listIndex, + index, + item.optionUrl, + item.optionUrlParams || {}, + item.optionCook || null + ); + } + } else if (item.type == "address") { + this.$nextTick(async () => { + await nextTick(300); + + this.initMap(item); + }); + } + }); + }); + + this.fmData = { ...fmData }; + console.log("------------------------------------", this.fmData); + this.iniLoaded = true; + }, + + handleClickHtmlNode(e) { + //在判断事件目标节点的时候,考虑到兼容性应该统一转换成大写或小写进行判断 + if (e.target.localName.toLowerCase() === "a") { + // 通过判端目标节点以后,就能在这里对其进行操作啦。 + let url = e.target.getAttribute("src"); //获取a标签属性,我这里自定义了一个属性data-id并将id赋值给了该属性,如何需要获取click方法的参数,需要获取a标签的click属性,并手动解析获取里面的参数 + window.open(url); + } + }, + + async getFmOptions(listIndex, index, url, params, cookFn) { + const { data, code, msg } = await requestPost(url, { + ...params, + }); + + if (code === 0) { + this.editParams[listIndex][index].optionList = + typeof cookFn == "function" ? cookFn(data) : data || []; + } else { + this.$message.error("请求检索基础数据失败!"); + } + }, + + handleChangeCascader(vals, item) { + this.fmData[item["keyName"]] = vals; + if (typeof item.handleChangeFn == "function") { + item.handleChangeFn(vals, item, this); + } + }, + handleChangeSelect(vals, item) { + console.log(vals, item); + this.fmData[item["keyName"]] = vals; + if (typeof item.handleChangeFn == "function") { + item.handleChangeFn(vals, item, this); + } + }, + + beforeImgUpload(file, item) { + if (typeof item.beforeImgUpload == "function") { + if (!item.beforeImgUpload(file, item, this)) return false; + } + return true; + }, + + handleImgRemove(file, item) { + console.log("handleImgRemove", file); + let url = file.response ? file.response.data.url : file.url; + if (url) { + let { fmData } = this; + this.fmData[item.keyName] = fmData[item.keyName].filter( + (item) => item.url !== url + ); + if (item.supKeys && Array.isArray(item.supKeys)) { + if (item.supKeys.length > 0) { + this.fmData[item.supKeys[0]] = fmData[item.keyName].map( + (item) => item.url + ); + } + if (item.supKeys.length > 1) { + this.fmData[item.supKeys[1]] = + this.fmData[item.supKeys[0]][0] || ""; + } + } + } + }, + + handleImgExceed(res, item) { + console.log(res); + // this.$message({ + // type: "warning", + // message: "文件数量最多不超过三个", + // }); + }, + + handleImgSuccess(res, file, item) { + console.log("handleImgSuccess", res); + if (res.code === 0 && res.msg === "success") { + let { fmData } = this; + // let picItem = { + // url: res.data.url, + // name: file.name, + // size: file.size, + // type: file.type, + // format: file.name.split(".").pop(), + // }; + let picItem = file; + picItem.url = res.data.url; + picItem.format = file.name.split(".").pop(); + + if (Array.isArray(this.fmData[item.keyName])) { + this.fmData[item.keyName].push(picItem); + } else { + this.fmData[item.keyName] = [picItem]; + } + if (item.supKeys && Array.isArray(item.supKeys)) { + if (item.supKeys.length > 0) { + this.fmData[item.supKeys[0]] = fmData[item.keyName].map( + (item) => item.url + ); + } + if (item.supKeys.length > 1) { + this.fmData[item.supKeys[1]] = + this.fmData[item.supKeys[0]][0] || ""; + } + } + } else { + this.$message.error(res.msg); + } + }, + + handleImgError(res, file, item) { + console.log(res); + }, + + // 地图初始化函数,本例取名为init,开发者可根据实际情况定义 + initMap(item) { + let { latitude, longitude } = this.$store.state.user; + + map = new daiMap( + document.getElementById("map"), + { latitude, longitude }, + { + zoom: 16.2, // 设置地图缩放级别 + pitch: 43.5, // 设置俯仰角 + rotation: 45, // 设置地图旋转角度 + } + ); + + // 监听地图平移结束 + map.on("dragend", (e) => { + this.handleMoveCenter(item, e); + }); + map.setCenter(latitude, longitude); + map.setMarker(latitude, longitude); + }, + + async handleSearchMap(item) { + const { msg, data } = await map.searchNearby(this.fmData[item.keyName]); + if (msg == "success") { + const { lat, lng } = data; + map.setCenter(lat, lng); + map.setMarker(lat, lng); + this.fmData[item.supKeys[0]] = lng; + this.fmData[item.supKeys[1]] = lat; + } else { + this.$message.error("未检索到相关位置坐标"); + } + }, + + async handleMoveCenter(item, e) { + console.log("handleMoveCenter", e); + //修改地图中心点 + const { lat, lng } = map.getCenter(); + console.log("getCenter", lat); + + this.fmData[item.supKeys[0]] = parseFloat(lng); + this.fmData[item.supKeys[1]] = parseFloat(lat); + map.setMarker(lat, lng); + console.log("setMarker", lat); + + let { msg, data } = await map.getAddress(lat, lng); + if (msg == "success") { + this.fmData[item.keyName] = data.address; + this.searchAddressOptions = []; + } + }, + + async remoteMethod(query) { + if (query !== "") { + this.loading = true; + + const { msg, data } = await map.searchNearby(query); + this.loading = false; + console.log("搜索结果", data); + + if (msg == "success" && data.resultList && data.resultList.length > 0) { + this.searchAddressOptions = data.resultList.map((item, index) => { + return { + ...item, + value: `${item.lonlat + item.address}`, + label: `${item.address + item.name}`, + }; + }); + } else { + this.searchAddressOptions = [ + { + value: "0", + label: "未检索到结果", + }, + ]; + } + } else { + this.searchAddressOptions = []; + } + }, + + handleClickKey(item, fmItem) { + console.log("搜索结果", item); + let lonlat = item.lonlat.split(" "); + map.setCenter(lonlat[1], lonlat[0]); + map.setMarker(lonlat[1], lonlat[0]); + + this.fmData[fmItem.supKeys[0]] = parseFloat(lonlat[1]); + this.fmData[fmItem.supKeys[1]] = parseFloat(lonlat[0]); + this.fmData[fmItem.keyName] = item.label; + }, + + async getInfo() { + let url = this.infoUrl; + if (!url) return; + const { idName, formId } = this; + + if (url.endsWith("/")) { + url += formId; + } + + const params = { + [idName]: formId, + }; + + let { data, code, msg } = await requestPost(url, params); + if (code === 0) { + const { editConfig } = this; + console.log("xxxxxxxxxxxxxxxxxxxxxx", editConfig); + if (editConfig && typeof editConfig.cookInfoFn == "function") { + data = editConfig.cookInfoFn(data); + } + + if (data.latitude && data.longitude) { + data.latitude = parseFloat(data.latitude); + data.longitude = parseFloat(data.longitude); + } + + this.fmData = { + ...this.fmData, + ...data, + }; + + await nextTick(600); + if (map) { + if (data.latitude) { + map.setCenter(data.longitude, data.latitude); + map.setMarker(data.longitude, data.latitude); + } else { + if (this.formType == "edit" && this.$refs && this.$refs.mapSearch) { + this.$refs.mapSearch[0].handleClick(); + } + } + } + } else { + this.$message.error(msg); + } + }, + + watchImg(src) { + window.open(src); + }, + + // 过滤文本 + dormatHtml(content) { + if ( + content.startsWith( + "\n\n\n\n\n" + ) && + content.endsWith("\n\n") + ) { + content = content.slice(45, -16); + } + return content; + }, + + cookBeforeSubmit(data) { + Object.keys(data).forEach((k) => { + if (typeof data[k] == "string") { + data[k] = this.dormatHtml(data[k]); + } + }); + return data; + }, + + async handleComfirm() { + this.btnDisable = true; + setTimeout(() => { + this.btnDisable = false; + }, 5000); + + console.log(this.$refs["ref_form"]); + + this.$refs["ref_form"].validate((valid, messageObj) => { + console.log(valid, messageObj); + if (!valid) { + app.util.validateRule(messageObj); + this.btnDisable = false; + } else { + if (this.editElseRules) { + const validator = new Schema(this.editElseRules); + validator + .validate(this.fmData) + .then(() => { + this.submit(); + }) + .catch(({ err, fields }) => { + console.log("--------------", err, fields); + app.util.validateRule(fields); + }); + } else { + this.submit(); + } + } + }); + }, + + async submit() { + const { editConfig, fmData, formType, editFixedParams } = this; + if ( + typeof editConfig.beforeSubmit == "function" && + !editConfig.beforeSubmit(formType, fmData, this) + ) { + return; + } + + let url = ""; + let params = { + ...fmData, + ...editFixedParams, + // serviceType: this.fmData.serviceTypeArr.join(","), + }; + + params = this.cookBeforeSubmit(params); + + if (this.formType === "add") { + url = this.addUrl; + } else { + url = this.editUrl; + } + + const { data, code, msg } = await requestPost(url, params); + + if (code === 0) { + this.$message({ + type: "success", + message: "操作成功", + }); + this.handleCancle(); + this.$emit("afterEdit"); + this.btnDisable = false; + } else { + this.btnDisable = false; + this.$message.error(msg); + } + }, + + handleCancle() { + this.$emit("close"); + }, + }, }; @@ -944,193 +931,193 @@ export default { @import "@/assets/scss/c/function.scss"; .g-cpt { - max-height: calc(83vh - 80px); - padding: 30px 78px 40px; - overflow-y: auto; - @include scrollBar; + max-height: calc(83vh - 80px); + padding: 30px 78px 40px; + overflow-y: auto; + @include scrollBar; } .m-operate { - display: flex; - margin-top: 10px; - // flex-direction: row-reverse; - .diy-button--white { - margin-left: auto; - } + display: flex; + margin-top: 10px; + // flex-direction: row-reverse; + .diy-button--white { + margin-left: auto; + } } .m-fm { - margin-top: 30px; - .list { - display: flex; - flex-wrap: wrap; - - /deep/ .el-form-item { - margin-right: 0; - } - } - - &.z-watch { - .list { - .item { - } - ::v-deep .item { - // 默认输入框placeholder样式 - .el-input.is-disabled .el-input__inner, - .el-textarea.is-disabled textarea.el-textarea__inner { - color: #333; - background-color: rgba(#000, 0); - border-color: rgba(#000, 0); - resize: none; - transform: translateX(-15px); - cursor: default; - &::placeholder { - color: rgba(#fff, 0); - } - } - .el-input.is-disabled .el-input__suffix { - display: none; - } - .el-checkbox.is-disabled.is-checked .el-checkbox__label { - color: #333; - } - .el-form-item__label { - // position: relative; - // text-align: left; - // padding-left: 35px; - - // &::before { - // content: ""; - // display: block; - // position: absolute; - // top: 0; - // bottom: 0; - // left: 20px; - // width: 6px; - // height: 6px; - // margin: auto; - // background: #0c81fe; - // border-radius: 3px; - // margin-right: 10px; - // } - - // &::after { - // content: " :"; - // display: inline; - // color: #333; - // } - } - } - } - } - - &.z-div { - .list { - display: flex; - flex-wrap: wrap; - - .item { - /deep/ .item-rich-text { - width: 817px; - max-height: 500px; - overflow: auto; - - img { - max-width: 100%; - height: auto; - } - &.z-show { - box-sizing: border-box; - padding: 15px; - border: 1px solid #eee; - height: auto; - } - } - } - } - - .item-show { - width: 176px; - } - - .item-input { - width: 176px; - } - .item-select { - width: 176px; - } - .item-number { - width: 176px; - } - - .address-item { - width: 176px * 3 + 200px; - - .address-item-input { - width: 74%; - } - .address-item-input2 { - margin-left: 5px; - width: 40%; - } - } - } - - .avatar-uploader { - &.z-full { - /deep/ .el-upload.el-upload--picture-card { - display: none !important; - } - } - - a { - display: flex; - align-items: center; - justify-content: center; - color: #65a5f9; - i { - margin-right: 4px; - color: #65a5f9; - font-size: 18px; - } - &:hover { - text-decoration: none; - } - } - } - - .item-rich-text { - width: 600px; - height: 500px; - img { - max-width: 100%; - } - .item-show { - width: 100%; - } - } - - .item-select, - .item-show, - .item-input { - width: 450px; - } - .item-number { - width: 225px; - } - - .address-item { - width: 450px; - - .address-item-input { - width: 85%; - } - .address-item-input2 { - margin-left: 5px; - width: 40%; - } - } - .div_map { - margin-top: 10px; - } + margin-top: 30px; + .list { + display: flex; + flex-wrap: wrap; + + /deep/ .el-form-item { + margin-right: 0; + } + } + + &.z-watch { + .list { + .item { + } + ::v-deep .item { + // 默认输入框placeholder样式 + .el-input.is-disabled .el-input__inner, + .el-textarea.is-disabled textarea.el-textarea__inner { + color: #333; + background-color: rgba(#000, 0); + border-color: rgba(#000, 0); + resize: none; + transform: translateX(-15px); + cursor: default; + &::placeholder { + color: rgba(#fff, 0); + } + } + .el-input.is-disabled .el-input__suffix { + display: none; + } + .el-checkbox.is-disabled.is-checked .el-checkbox__label { + color: #333; + } + .el-form-item__label { + // position: relative; + // text-align: left; + // padding-left: 35px; + + // &::before { + // content: ""; + // display: block; + // position: absolute; + // top: 0; + // bottom: 0; + // left: 20px; + // width: 6px; + // height: 6px; + // margin: auto; + // background: #0c81fe; + // border-radius: 3px; + // margin-right: 10px; + // } + + // &::after { + // content: " :"; + // display: inline; + // color: #333; + // } + } + } + } + } + + &.z-div { + .list { + display: flex; + flex-wrap: wrap; + + .item { + /deep/ .item-rich-text { + width: 817px; + max-height: 500px; + overflow: auto; + + img { + max-width: 100%; + height: auto; + } + &.z-show { + box-sizing: border-box; + padding: 15px; + border: 1px solid #eee; + height: auto; + } + } + } + } + + .item-show { + width: 176px; + } + + .item-input { + width: 176px; + } + .item-select { + width: 176px; + } + .item-number { + width: 176px; + } + + .address-item { + width: 176px * 3 + 200px; + + .address-item-input { + width: 74%; + } + .address-item-input2 { + margin-left: 5px; + width: 40%; + } + } + } + + .avatar-uploader { + &.z-full { + /deep/ .el-upload.el-upload--picture-card { + display: none !important; + } + } + + a { + display: flex; + align-items: center; + justify-content: center; + color: #65a5f9; + i { + margin-right: 4px; + color: #65a5f9; + font-size: 18px; + } + &:hover { + text-decoration: none; + } + } + } + + .item-rich-text { + width: 600px; + height: 500px; + img { + max-width: 100%; + } + .item-show { + width: 100%; + } + } + + .item-select, + .item-show, + .item-input { + width: 450px; + } + .item-number { + width: 225px; + } + + .address-item { + width: 450px; + + .address-item-input { + width: 85%; + } + .address-item-input2 { + margin-left: 5px; + width: 40%; + } + } + .div_map { + margin-top: 10px; + } } From 7d151a20f58d4abbb6a84758c24608d2ef23f0f3 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 11 Apr 2023 17:06:15 +0800 Subject: [PATCH 8/9] =?UTF-8?q?bug#80=E6=9F=A5=E7=9C=8B=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E4=B8=8B=E6=96=B9=E6=93=8D=E4=BD=9C=E6=A0=8F=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue b/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue index 0c8c7de19..21fe1d3b1 100644 --- a/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue +++ b/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue @@ -241,7 +241,7 @@ Date: Wed, 12 Apr 2023 09:54:28 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E7=9B=91=E6=8E=A7=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/communityService/policy/addPolicy.vue | 2 +- .../shequzhili/tuceng/zhonghe/shebei/cpts/record.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue index fcbf35091..d0c1f2a84 100644 --- a/src/views/modules/communityService/policy/addPolicy.vue +++ b/src/views/modules/communityService/policy/addPolicy.vue @@ -654,7 +654,7 @@ export default { const url = "/actual/base/serviceitem/listServerOrg"; let params = { serviceTypeId: this.formData.policyCategoryL2, - serverOrgType: this.formData.assignInfo.serverOrgType, + serverOrgType: this.newFormData.serverOrgType ||this.formData.assignInfo.serverOrgType, businessType: "common_service", }; console.log(this.formData); diff --git a/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue b/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue index 21fe1d3b1..9b9db75b7 100644 --- a/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue +++ b/src/views/modules/shequzhili/tuceng/zhonghe/shebei/cpts/record.vue @@ -385,12 +385,12 @@ export default { }, optionResult: [ { - label: "合格", - value: "0", + label: "正常", + value: "1", }, { - label: "不合格", - value: "1", + label: "异常", + value: "0", }, ], optionStaff: [