![]()
{
return [
index + 1,
diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue
index 8b24bca15..b37725b32 100644
--- a/src/views/modules/base/community/communityTable.vue
+++ b/src/views/modules/base/community/communityTable.vue
@@ -504,7 +504,7 @@ export default {
xcxmLoading: false,
agencyObj: {}, //树所选的组织对象
-
+ treeObj:{},
tableData: [],
validTableDataNum: 0, //有效的数据数量,即有权限操作的数据数量
selection: [],
@@ -636,7 +636,7 @@ export default {
});
},
async loadTable(fromTree, treeObj) {
- console.log(111, treeObj);
+ this.treeObj = {... treeObj}
// 是否显示补全一房一码信息按钮
this.roleList = localStorage.getItem("roleList");
let conditions = [];
@@ -1337,11 +1337,11 @@ export default {
handleSizeChange(val) {
this.pageSize = val;
this.pageNo = 1;
- this.loadTable();
+ this.loadTable(this.treeObj);
},
handleCurrentChange(val) {
this.pageNo = val;
- this.loadTable();
+ this.loadTable(this.treeObj);
},
// 开启加载动画
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 @@
+
下载房屋模板
-
+
导出一户一档
-
-
+
+
查看
-
+ 编辑
-
-
+
@@ -281,8 +284,8 @@
top="5vh"
class="dialog-h"
@closed="detailFormCancle">
+
diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue
index 5522eee4b..d0c1f2a84 100644
--- a/src/views/modules/communityService/policy/addPolicy.vue
+++ b/src/views/modules/communityService/policy/addPolicy.vue
@@ -242,6 +242,7 @@
:disabled="formType === 'detail'"
:rules="newDataRule"
ref="ref_policy_form1"
+ v-if="newFormData"
>
{
// this.btnDisable = false;
@@ -763,7 +772,7 @@ export default {
// this.addFuwu();
// }
// });
- this.addFuwu();
+ await this.addFuwu();
},
getLastItem(list, vals, key) {
let LIST = list || [];
@@ -771,7 +780,6 @@ export default {
// console.log(item[key]);
for (let i of vals) {
if (item[key] === i) {
- console.log(item[key]);
this.sarr.push(item);
} else if (item["objectType"] == "district") {
this.getLastItem(item.children, vals, key);
@@ -814,6 +822,7 @@ export default {
async addFuwu() {
// 处理服务范围数据
await this.operationOption();
+ // 文件上传新增没问题,编辑执行这一步会多多一个文件对象
// this.formData.attachmentList = [...this.fileList];
// this.fileList.forEach(item=>{
// this.formData.attachmentList.push({
@@ -835,7 +844,7 @@ export default {
this.formData.policyId = this.policyId;
}
//为什么不能传null还要返回null呢?
- if (this.formType == "copy"&& this.formData.assignFlag == 0) {
+ if (this.formType == "copy" && this.formData.assignFlag == 0) {
this.formData.assignInfo = {
noticeApproches: [],
serverOrgId: "",
@@ -844,7 +853,7 @@ export default {
serviceTimeEnd: "",
serviceTimeStart: "",
};
- this.formData.attachmentList = []
+ this.formData.attachmentList = [];
}
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icServiceProject/service/initiate'
let params = {
diff --git a/src/views/modules/communityService/policy/policyList.vue b/src/views/modules/communityService/policy/policyList.vue
index 01a58dec3..685f9dca0 100644
--- a/src/views/modules/communityService/policy/policyList.vue
+++ b/src/views/modules/communityService/policy/policyList.vue
@@ -35,8 +35,9 @@
-
+
-
+
至
@@ -185,7 +186,7 @@
>
{{
- scope.row.expiredFlag === "1" ? "已过期" : "未过期"
+ scope.row.expiredFlag ? "已过期" : "未过期"
}}
@@ -287,27 +288,31 @@ export default {
user: {},
agencyId: "",
policyLevelArray: [
- { value: "0", label: "市级" },
- { value: "1", label: "区级" },
- { value: "2", label: "街道级" },
+ { value: 0, label: "市级" },
+ { value: 1, label: "区级" },
+ { value: 2, label: "街道级" },
], //政策级别下拉
tableData: [],
statusArray: [
{
- value: "1",
+ value: true,
label: "是",
},
{
- value: "0",
+ value: false,
label: "否",
},
],
formData: {
title: "", // 政策标题
- content: "", //政策内容
- expiredFlag: "", //是否过期;1:已过期;0:未过期
+ // content: "", //政策内容
+ expiredFlag: null, //是否过期;1:已过期;0:未过期
+ policyLevel:null,//政策级别。0市级;1区级;2街道级
+ resiSearchTagName:"",//人员标签搜索关键词
+ createdTimeStart:"",//yyyy-MM-dd 发布时间,起始
+ createdTimeEnd:"",//yyyy-MM-dd 发布时间,结束
},
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
@@ -478,7 +483,7 @@ export default {
pageNo,
...formData,
});
-
+ console.log(this.formData);
this.tableLoading = false;
if (code === 0) {
this.total = data.total || 0;
@@ -552,8 +557,11 @@ export default {
resetSearch() {
this.formData = {
title: "", // 政策标题
- content: "", //政策内容
- expiredFlag: "", //是否过期;1:已过期;0:未过期
+ expiredFlag: null, //是否过期;1:已过期;0:未过期
+ policyLevel:null,//政策级别。0市级;1区级;2街道级
+ resiSearchTagName:"",//人员标签搜索关键词
+ createdTimeStart:"",//yyyy-MM-dd 发布时间,起始
+ createdTimeEnd:"",//yyyy-MM-dd 发布时间,结束
};
this.pageNo = 1;
diff --git a/src/views/modules/cpts/base2/cpts/edit.vue b/src/views/modules/cpts/base2/cpts/edit.vue
index ead2d1097..4969824f4 100644
--- a/src/views/modules/cpts/base2/cpts/edit.vue
+++ b/src/views/modules/cpts/base2/cpts/edit.vue
@@ -285,7 +285,7 @@
formType == 'add' ||
(formType == 'edit' && !item.editDisable)
"
- v-model="searchAddressKeyword"
+ v-model="searchAddressKeyword || fmData.location"
filterable
class="item-input"
size="small"
@@ -306,15 +306,13 @@
>
+
{{ fmData[item.keyName] || "--" }}
-
-
-
-
-
-
+
+
@@ -398,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.latitude, data.longitude);
- map.setMarker(data.latitude, data.longitude);
- } 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");
+ },
+ },
};
@@ -946,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;
+ }
}
diff --git a/src/views/modules/shequzhili/tuceng/anquan/shebei/addForm.vue b/src/views/modules/shequzhili/tuceng/anquan/shebei/addForm.vue
index 248e74f72..1133dd632 100644
--- a/src/views/modules/shequzhili/tuceng/anquan/shebei/addForm.vue
+++ b/src/views/modules/shequzhili/tuceng/anquan/shebei/addForm.vue
@@ -137,10 +137,10 @@ export default {
data() {
let checkMObile = (rule, value, callback) => {
if (value === '') {
- callback(new Error('请输入手机号'));
+ callback(new Error('请输入联系电话'));
} else {
if (!isMobile(value)) {
- callback(new Error('手机号格式不正确'));
+ callback(new Error('联系电话格式不正确'));
}
callback();
}
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..9b9db75b7 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 @@