Procházet zdrojové kódy

增加列表子级和员工的信息修改

mork před 6 dny
rodič
revize
d4fea6078a

+ 10 - 0
package-lock.json

@@ -16,6 +16,7 @@
         "element-plus": "^2.9.10",
         "json-editor-vue": "^0.18.1",
         "mapbox-gl": "^3.21.0",
+        "moment": "^2.30.1",
         "vue": "^3.2.13",
         "vue-carousel-3d": "^1.0.1",
         "vue-clipboard3": "^2.0.0",
@@ -9045,6 +9046,15 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/moment": {
+      "version": "2.30.1",
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
+      "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
+      "license": "MIT",
+      "engines": {
+        "node": "*"
+      }
+    },
     "node_modules/mrmime": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz",

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
     "axios": "^0.27.2",
     "echarts": "^5.6.0",
     "element-plus": "^2.9.10",
+    "moment": "^2.30.1",
     "json-editor-vue": "^0.18.1",
     "mapbox-gl": "^3.21.0",
     "vue": "^3.2.13",

+ 5 - 1
public/static/config/config.js

@@ -3,9 +3,13 @@ var webConfig = {
     systemName: "数据可视化平台",
     AUTH_USER_TOKEN_KEY: "SKY_OAUTH_USER_TOKEN",
     LOGIN_FAIL_CODE: [206, 207, 208, 212], // loginFailCodes
+    /* 通用全局变量 */
+    defaultAccount: {
+        username: "user_yztmh_dev", // 默认游客用户名
+        adminRoleId: "1", //默认管理员角色id,Oauth中配置“系统管理员”角色
+    },
 
     columnArr: [{id:"1742",mid:"1793",name:"申勤员工"}],
-
     // oauth 服务ID
     serviceId: '0',
     SCRIPT_OAUTH_URL: 'http://121.43.55.7:10086',

+ 118 - 0
src/api/content.js

@@ -0,0 +1,118 @@
+import { postform, postFile, getFile, getFileStream } from "../utils/request";
+
+// 获取简略内容列表
+const getSimpleContentList = (data) => {
+  return postform(webConfig.DMS_URL + "/content/selectContentList", data);
+};
+
+// 修改内容状态
+const updateContentState = (data) => {
+  return postform(webConfig.DMS_URL + "/content/updateAudit", data);
+};
+// 获取栏目模型
+const getColumnModel = (data) => {
+  return postform(webConfig.DMS_URL + "/model/getModelById", data);
+};
+
+// 编辑模型
+const updateModel = (data) => {
+  let url = "/model/updateProperty";
+  if (data.type == 1) {
+    url = "/model/updateFields";
+  }
+  return postform(webConfig.DMS_URL + url, data);
+};
+
+// 获取某选择列表详细信息
+const getCheckDetail = (params) => {
+  return postform(webConfig.DMS_URL + "/select/getSelectBySName", params);
+};
+
+// 获取类别信息
+const getCategoryDetail = (params) => {
+  return postform(webConfig.DMS_URL + "/category/selectByCNameAType", params);
+};
+
+// 上传文件
+const uploadFile = (params) => {
+  return postFile(webConfig.DMS_URL + "/file/uploadFile", params);
+};
+
+// 获取文件
+const getContentFile = (url) => {
+  if (url.indexOf("http") > -1) {
+    return getFile(url);
+  } else {
+    return getFile(webConfig.DMS_URL + url);
+  }
+};
+
+// 新增内容
+const addContent = (params) => {
+  return postform(webConfig.DMS_URL + "/content/addContent", params);
+};
+
+// 修改内容
+const updateContent = (params) => {
+  return postform(webConfig.DMS_URL + "/content/updateContent", params);
+};
+
+// 获取内容
+const getContentById = (params) => {
+  return postform(webConfig.DMS_URL + "/content/selectContentById", params);
+};
+
+// 导入内容
+const importContentFile = (params, type) => {
+  if (type === "geojson" || type === "shape") {
+    return postFile(webConfig.DMS_URL + "/content/contentImportFileSpaceData", params);
+  } else if (type === "excel" || type === "json") {
+    return postFile(webConfig.DMS_URL + "/content/contentImportExcelJsonFileData", params);
+  } else if (type === "dms") {
+    return postFile(webConfig.DMS_URL + "/content/importDMS", params);
+  }
+};
+
+// 导出内容
+const exportContentFile = (params) => {
+  return getFileStream(webConfig.DMS_URL + "/content/exportFile", params);
+};
+
+// 导出内容
+const exportContentFileToDMS = (params) => {
+  return getFileStream(webConfig.DMS_URL + "/content/exportDMS", params);
+};
+
+// 获取操作权限
+const getColumnAuth = (params) => {
+  return postform(webConfig.DMS_URL + "/permission/getColumnByPermission", params);
+};
+
+// 批量修改字段
+const updateBatchFieldValue = (params) => {
+  return postform(webConfig.DMS_URL + "/column/updateContentByConditions", params);
+};
+
+export default {
+  getSimpleContentList,
+  updateContentState,
+  getColumnModel,
+  updateModel,
+
+  getCheckDetail,
+  getCategoryDetail,
+  exportContentFileToDMS,
+
+  uploadFile,
+  getContentFile,
+  exportContentFile,
+  importContentFile,
+
+  addContent,
+  updateContent,
+  getContentById,
+
+  getColumnAuth,
+
+  updateBatchFieldValue,
+};

+ 61 - 12
src/components/LeftMenu.vue

@@ -11,28 +11,40 @@
             clearable :clear-icon="CloseBold"
             @select="handleSelect"
             >
-            <!-- <template slot-scope="{ item }">
-                <div>{{ item.value }}</div>
-                <div class="additional-info">{{ item.address }}</div>
-            </template> -->
             <template #append>共{{dataNumber}}条</template>
             </el-autocomplete>
         </div>
         <div class="menu-content" ref="menuContent">
-            <!-- <div v-for="(item,index) in restaurants" :key="item" class="menu-item" :class="{'active':index==checkItem}"  @click="selectItem(item,index)">
-                <p style="color: #fff;">{{item.value}}</p>
-                <p style="font-size:12px;color:#d8ecff;">{{item.address}}</p>
-            </div> -->
             <!-- // accordion -->
-             <el-collapse expand-icon-position="left" v-model="activeNames" @change="handleChange">
+             <!-- <el-collapse expand-icon-position="left" v-model="activeNames" @change="handleChange">
                 <el-collapse-item :title="list+'('+restaurants.filter(item => list.includes(item['市(区)'])).length+')'" :name="i" v-for="(list,i) in CITY_CODE_LIST" :key="list" >
                   <div v-for="(item) in restaurants.filter(item => list.includes(item['市(区)']))" :key="item" class="menu-item" :class="{'active':item.checkItem==checkItem}"  @click="selectItem(item)">
                       <p style="color: #fff;">{{item.value}}</p>
                       <p style="font-size:12px;color:#d8ecff;">{{item.address}}</p>
                   </div>
                 </el-collapse-item>
-              </el-collapse>
+              </el-collapse> -->
 
+              <el-collapse expand-icon-position="left" v-model="activeNames" @change="handleChange">
+                <el-collapse-item :title="list+'('+restaurants.filter(item => list.includes(item['市(区)'])).length+')'" :name="i" v-for="(list,i) in CITY_CODE_LIST" :key="list" >
+                      <div :name="i2" v-for="(tree,i2) in treeFilter" :key="tree">
+                        <div v-if="list.includes(tree.lable)">
+                          <el-collapse class="inner-collapse" expand-icon-position="left" v-model="activeChildrenNames" @change="handleChange">
+                            <el-collapse-item :title="tree.value+'('+restaurants.filter(item => (tree.value=='未知'?'':tree.value) == item['管理区域(内部口径)'] && tree.lable.includes(item['市(区)'])).length+')'"  >
+                              <div v-for="(item2) in restaurants.filter(item => (tree.value=='未知'?'':tree.value) == item['管理区域(内部口径)'] && tree.lable.includes(item['市(区)']))" :key="item2" class="menu-item" :class="{'active':item2.checkItem==checkItem}"  @click="selectItem(item2)">
+                                  <p style="color: #fff;">{{item2.value}}</p>
+                                  <p style="font-size:12px;color:#d8ecff;">{{item2.address}}</p>
+                              </div>
+                            </el-collapse-item>
+                          </el-collapse>
+                        </div>
+                      </div>
+                      <div v-for="(item3) in restaurants.filter(item => list.includes(item['市(区)']) && (item['管理区域(内部口径)'].includes(list) || item['管理区域(内部口径)'].includes('中心区')))" :key="item3" class="menu-item" :class="{'active':item3.checkItem==checkItem}"  @click="selectItem(item3)">
+                          <p style="color: #fff;">{{item3.value}}</p>
+                          <p style="font-size:12px;color:#d8ecff;">{{item3.address}}</p>
+                      </div>
+                </el-collapse-item>
+              </el-collapse>
 
       </div>
     </div>
@@ -60,6 +72,9 @@ export default {
         isOpen: true,
         isOpenText: "<",
         activeNames: [],
+        activeChildrenNames: [],
+        arrParam: ["补查查询串","补查相似度","补查原因","补查匹配地址","补查点坐标","补查匹配名称","补查buffer_m","补查状态"], //过滤字段
+        treeFilter: [],
     };
   },
   props: {
@@ -79,12 +94,14 @@ export default {
     },
     getDataList(){
         let that = this;
+        that.treeFilter = [];
         let timer = setInterval(() => {
           if(that.$props.dataList.features){
             if(that.$props.dataList.features.length>0){
                 that.$props.dataList.features.forEach(item => {
                     item.properties.value = item.properties['项目名称']
                     item.properties.address = item.properties['项目地址']
+                    that.treeFilter.push({value:item.properties['管理区域(内部口径)']==""?"未知":item.properties['管理区域(内部口径)'],lable:item.properties['市(区)']});
                     const center = turf.centerOfMass(item.geometry)
                     item.properties.center = center.geometry.coordinates;
                     that.restaurants.push(item.properties);
@@ -95,6 +112,14 @@ export default {
                 if(that.restaurants){
                   clearInterval(timer);
                 }
+                // 列表过滤标签
+                that.treeFilter = [...new Map(that.treeFilter.map(item => [[item.value,item.lable].join('|'), item])).values()];
+                that.CITY_CODE_LIST.forEach(list => {
+                    that.treeFilter =  that.treeFilter.filter(item => !item.value.includes(list));
+                })
+                that.treeFilter =  that.treeFilter.filter(item => !item.value.includes("中心区"));
+
+                // console.log("===========",that.treeFilter);
             }
           }
         }, 500);
@@ -115,7 +140,7 @@ export default {
 
         let str = ""
           for (var item in param) {
-            if(UTIL.isChinese(item)){
+            if (UTIL.isChinese(item) && !that.arrParam.includes(item)) {
               str += `<p style="margin:2px 0;">${item}:${param[item]}</p>`;
             }
           }
@@ -143,7 +168,7 @@ export default {
           if (moreBtn) {
             moreBtn.addEventListener('click', () => {
               let pro = {properties:param}
-              that.$parent.handleMoreClick(pro);
+              that.$parent.handleMoreClick(pro.properties.GUID);
             });
           }
         }, 0);
@@ -159,6 +184,7 @@ export default {
             that.checkItem = null;
             that.dataNumber = that.restaurants.length || 0;
             that.activeNames = [];
+            that.activeChildrenNames = [];
              clearTimeout(that.timeout);
             that.timeout = setTimeout(() => {
                 cb([]);
@@ -184,6 +210,7 @@ export default {
     handleSelect(item) {
         let that = this;
         that.activeNames = [];
+        that.activeChildrenNames = [];
         if(item){
             var restaurants = that.restaurants;
             var results = item.value ? restaurants.filter(that.createStateFilter(item.value)) : restaurants;
@@ -193,6 +220,11 @@ export default {
                     that.activeNames.push(index)
                   }
                 })
+                that.treeFilter.forEach((item,index) => {
+                  if(item.value.includes(element['管理区域(内部口径)'])){
+                    that.activeChildrenNames.push(index)
+                  }
+                })
             })
 
             that.restaurants = results
@@ -258,6 +290,14 @@ export default {
     background-color: transparent !important;
     color: #ffffff;
 }
+/* 只给嵌套内层的标题缩进30px */
+.el-collapse.inner-collapse .el-collapse-item__header {
+    padding-left: 30px !important;
+    padding-right: 10px !important;
+}
+.el-collapse.inner-collapse .el-collapse-item__wrap {
+    padding-left: 10px;
+}
 </style>
 <style lang="less" scoped>
 
@@ -360,4 +400,13 @@ export default {
 /deep/.el-collapse-icon-position-left .el-collapse-item__header{
   padding: 0px 10px !important;
 }
+/* 嵌套的 collapse 样式 */
+/deep/ .el-collapse.inner-collapse .el-collapse-item__header {
+  padding-left: 30px !important;
+  padding-right: 10px !important;
+}
+/deep/ .el-collapse.inner-collapse .el-collapse-item__wrap {
+  padding-left: 10px;
+}
+
 </style>

+ 181 - 16
src/components/Map.vue

@@ -5,7 +5,18 @@
 
   <VueJsonEditor v-if="editWinFlag" :editDataList="editDataList"></VueJsonEditor>
 
-  <Table :tableData="tableData" :columnModel="columnModel" :searchText="tableSearchText" v-if="tableShow" :isview="tableShow" ></Table>
+  <Table :tableData="tableData" :columnModel="columnModel" :searchText="tableSearchText" v-if="tableShow" :isview="tableShow" :close="handleClose"></Table>
+
+  <editManage
+    v-if="isContentShow"
+    :isShow="isContentShow"
+    :column-model="columnModel"
+    :column="columnData"
+    :dialog-title="dialogTitle"
+    :item="contentItem"
+    :is-view="isContentView"
+    :close="handleEditClose"
+  ></editManage>
 
    <!-- 十字准线元素 -->
   <div class="map-center-crosshair" v-if="btn_Aim_show"></div>
@@ -14,6 +25,26 @@
     <div id="tipsText" @click="copyDivText('#tipsText')">位置信息:{{mouseCenter}}</div>
   </div>
 
+  <div class="select-item" v-if="btn_data_show">
+    <el-select
+      v-model="selectText"
+      multiple
+      collapse-tags
+      collapse-tags-tooltip
+      placeholder="请选择"
+      size="small"
+      @change="handleSelChange"
+      style="width: 270px"
+    >
+      <el-option
+        v-for="item in options"
+        :key="item.value"
+        :label="item.label"
+        :value="item.value"
+      />
+    </el-select>
+  </div>
+
   <div class="right-btn">
       <el-icon size="20" :color="btn_Aim_show == true ? '#067bc9' : '#000'" title="中心基准线" class="icon" @click="toggleItem('1');">
         <Aim />
@@ -43,12 +74,15 @@ import VueJsonEditor from '@/components/JsonEditor.vue';
 import Table from '@/components/Table.vue';
 import UTIL from '@/utils/util'
 import commonAPI from '@/api/common'
+import api from '@/api/content'
+import editManage from '@/components/editManage.vue';
 export default {
   name: "Map",
   components: {
     VueJsonEditor,
     LeftMenu,
     Table,
+    editManage,
     },
   data() {
     return {
@@ -69,6 +103,20 @@ export default {
       editDataList: {},
       editFlag: false,
       editWinFlag: false,
+
+      dialogTitle: "员工信息",
+      isContentShow: false,
+      isContentView: false,
+      // columnModel: {},
+      columnData: {
+        title: "",
+      },
+      contentItem: {},
+
+      arrParam: ["补查查询串","补查相似度","补查原因","补查匹配地址","补查点坐标","补查匹配名称","补查buffer_m","补查状态"], //过滤字段
+      selectText: [],
+      options: [],
+      fontText:["concat"]// "concat", ["get", "GUID"], "\n", ["get", "match_status"],"\n", ["get", "range_shape"]
     };
   },
   mounted() {
@@ -129,10 +177,12 @@ export default {
           this.btn_data_show = false;
           window.mapboxMap.setLayoutProperty('data-fill-layer', 'visibility', 'none')
           window.mapboxMap.setLayoutProperty('data-line-layer', 'visibility', 'none')
+          window.mapboxMap.setLayoutProperty('data-symbol-layer', 'visibility', 'none')
         }else{
           this.btn_data_show = true;
           window.mapboxMap.setLayoutProperty('data-fill-layer', 'visibility', 'visible')
           window.mapboxMap.setLayoutProperty('data-line-layer', 'visibility', 'visible')
+          window.mapboxMap.setLayoutProperty('data-symbol-layer', 'visibility', 'visible')
         }
       }else if(item == "3"){
         this.editDataList = {};
@@ -178,12 +228,49 @@ export default {
       let requestParams = {
         modelId: webConfig.columnArr[0].mid, // 申勤员工ID
       };
-      commonAPI.getModelById(requestParams).then((res) => {
+      api.getColumnModel(requestParams).then((res) => {
+        // console.log(res);
+        
         if (res.code === 200) {
           that.columnModel = res.content;
+          that.columnModel.modelId = webConfig.columnArr[0].mid;
+          that.columnModel.columnId = webConfig.columnArr[0].id;
+          that.columnData = that.columnModel;
+        }
+      });
+    },
+    //根据内容id查询内容详情
+    getContentById(item) {
+      let that = this;
+      let requestParams = {
+        columnId: item.column_id,
+        contentId: item.id,
+      };
+      // console.log(item);
+      api.getContentById(requestParams).then((data) => {
+        if (data.code === 200) {
+          that.contentItem = data.content;
+          // that.contentItem.phone = that.formatPhoneNumber(that.contentItem.phone);
+          that.isContentShow = true;
+          that.isContentView = false;
         }
       });
     },
+    //关闭编辑弹窗
+    handleEditClose() {
+      let guid = sessionStorage.getItem('guid');
+      if(guid){
+        this.handleMoreClick(guid);
+      }else{
+        this.$parent.getDmsDataList();
+        this.isContentShow = false;
+        this.isContentView = false;
+        this.contentItem = {};
+      }
+    },
+    handleClose() {
+      this.tableShow = false;
+    },
     creatMap() {
       let that = this;
       mapboxgl.accessToken = webConfig.MAPBOX_ACCESS_TOKEN;
@@ -192,7 +279,12 @@ export default {
           //style: 'mapbox://styles/mapbox/standard',
           //stype:'mapbox://styles/mapbox/streets-v11',
           //style: 'mapbox://styles/mapbox/satellite-v9', // 使用卫星图作为基础样式,你也可以选择其他基础样式或者设置为空字符串''来创建空白底图
-          style: { "version": 8, "sources": {}, "layers": [] }, // 自定义空白样式
+          style: { 
+            "version": 8, 
+            "sources": {}, 
+            "layers": [],
+            "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf" // 添加字体服务
+          },
           projection: 'equirectangular', // globe 球体投影   mercator 平面墨卡托投影  equirectangular WGS84平面投影
           zoom: 12, // 初始大小
           minZoom:9,
@@ -416,9 +508,11 @@ export default {
         
         // console.log("仅获取 data-fill-layer 的要素:", fet);
         // 以下弹窗(注意要使用 fet.properties)
+        
         let str = "";
         for (let item in fet.properties) {
-          if (UTIL.isChinese(item)) {
+          // console.log(item);
+          if (UTIL.isChinese(item) && !that.arrParam.includes(item)) {
             str += `<p style="margin:2px 0;">${item}:${fet.properties[item]}</p>`;
           }
         }
@@ -444,31 +538,33 @@ export default {
           const moreBtn = document.getElementById('popup-more-btn');
           if (moreBtn) {
             moreBtn.addEventListener('click', () => {
-              that.handleMoreClick(fet);
+              // that.tableShow = false;
+              that.handleMoreClick(fet.properties.GUID);
+              sessionStorage.setItem('guid', fet.properties.GUID);
             });
           }
         }, 0);
       
     },
     // 处理弹窗中"更多"按钮点击
-    handleMoreClick(fet) {
+    handleMoreClick(guid) {
       const that = this;
-      that.tableShow = false;
       //1743 项目数据  1742 申勤员工
       // 排序条件orderByType  1 升序 2 降序
       let requestParams = {
         columnId: webConfig.columnArr[0].id,
-        states: 0,
-        orderBy: JSON.stringify([{ field: "create_time", orderByType: 2 }]),
+        states: "0,1,2,3",
+        orderBy: JSON.stringify([{ field: "update_time", orderByType: 2 }]),
         pageSize: 9999,
         page: 0,
       };
+      console.log("guid:", guid);
       requestParams.search = JSON.stringify([
         ...(requestParams.search ? JSON.parse(requestParams.search) : []),
         {
           field: "c_xmguid",  // 申勤员工 c_xmguid   项目数据 c_guid
           searchType: 2,
-          content: { value: fet.properties.GUID },
+          content: { value: guid },
         },
       ]);
       commonAPI.getDmsDataList(requestParams).then((res) => {
@@ -490,23 +586,39 @@ export default {
           })
           // console.log("data:", data);
           that.tableData = data;
+          that.tableData.sort((a, b) => a.c_xm.localeCompare(b.c_xm, 'zh-CN'))
           that.tableSearchText = "";
-          that.tableShow = true;
+          if(!that.tableShow){
+            that.tableShow = true;
+          }
+
+          that.contentItem = data;
+          that.isContentShow = false;
+          that.isContentView = false;
+
         }else{
           this.$message({ message: '无员工数据', type: 'info' })
         }
       });
     },
+    upTableData(data){
+      // console.log("data:", data);
+      const that = this;
+      that.tableData = data;
+      that.tableData.sort((a, b) => a.c_xm.localeCompare(b.c_xm, 'zh-CN'))
+    },
     setTableShow(data,text){
+      // console.log("data:", data);
       const that = this;
       that.tableShow = false;
-      that.tableSearchText = text;
-      that.tableData = data;
       // 使用 $nextTick 确保组件先销毁再重建
       that.$nextTick(() => {
         that.tableShow = true;
+        that.tableSearchText = text;
+        that.tableData = data;
+        that.tableData.sort((a, b) => a.c_xm.localeCompare(b.c_xm, 'zh-CN'))
       });
-      console.log("that.tableSearchText:", that.tableSearchText);
+      // console.log("that.tableSearchText:", that.tableSearchText);
     },
     // 复制指定元素内的文本
     copyDivText(selector) {
@@ -537,7 +649,7 @@ export default {
     toggleEditMode(isEdit){
       let that = this;
       that.editFlag = isEdit;
-      console.log("isEdit:", isEdit);
+      // console.log("isEdit:", isEdit);
       // if(isEdit){
       //    this.editWinFlag = true;
       //    window.mapboxMap.off('click', that.mapClickValue)
@@ -735,6 +847,14 @@ export default {
     },
     createVectorLayer(vectorData) {
       let that = this;
+      // console.log(vectorData);
+      that.options = [];
+      for (let o in vectorData.features[0].properties) {
+          that.options.push({
+            value: o,
+            label: o,
+          })
+        }
       that.dataList = vectorData;
       if(window.mapboxMap.getSource('vector-data')){
         window.mapboxMap.getSource('vector-data').setData(vectorData);
@@ -763,7 +883,41 @@ export default {
               'line-width': 2 // 线宽度
           }
         });
+       
+        window.mapboxMap.addLayer({
+          'id': 'data-symbol-layer',
+          'type': 'symbol',
+          'source': 'vector-data',
+          "layout": {
+            "text-field": this.fontText, // 正确使用 text-field 属性
+            // "text-font": ["Open Sans Bold", "Arial Unicode MS Bold"], // 设置字体
+            "text-size": 10, // 设置字体大小(可选)
+            "text-anchor": "top", // 设置文本锚点(可选)
+            "text-offset": [0, 0.6], // 设置文本偏移量(可选)
+            "text-allow-overlap": false, // 是否允许文本重叠(可选)
+          },
+          "paint": {
+            "icon-color":"#fff",
+            "text-color":"#000"
+          }
+        });
       }
+    },
+    handleSelChange(){
+      // 在每个字段后面添加换行符
+      const withNewlines = this.selectText.reduce((acc, item, index, array) => {
+        acc.push(["get", item]);
+        if (index < array.length - 1) {
+          acc.push("\n");
+        }
+        return acc;
+      }, []);
+      this.fontText = ["concat", ...withNewlines];
+      this.changeTextField(this.fontText);
+    },
+    // 动态改变文本字段内容(例如,改为显示名称)
+    changeTextField(newField) {
+        window.mapboxMap.setLayoutProperty('data-symbol-layer', 'text-field', newField);
     }
   }
 };
@@ -785,7 +939,9 @@ export default {
 </style>
 
 <style lang="less" scoped>
-
+/deep/ .el-select__wrapper{
+  min-height: 30px !important;
+}
 // 隐藏地图控件(mapboxgl-ctrl-bottom-left)
 /deep/.mapboxgl-ctrl-bottom-left div{
   display:none !important;
@@ -867,6 +1023,15 @@ export default {
   
 }
 
+.select-item{
+    position: absolute;
+    z-index: 1000;
+    bottom: 156px;
+    right: 50px;
+    background: #01346f99;
+    border-radius: 6px;
+}
+
 /* 十字准线样式 */
 .map-center-crosshair {
   position: absolute;

+ 57 - 11
src/components/Table.vue

@@ -1,18 +1,26 @@
 <template>
-  <el-dialog v-model="dialogTableVisible" title="员工信息" width="1200" draggable>
+  <el-dialog v-model="dialogTableVisible" title="员工信息" width="1200" draggable :close-on-click-modal="false"
+      :before-close="dialogBeforeClose">
     <div style="padding: 10px;">
         <el-input v-model="searchText2" style="color: #000 !important;" size="small" placeholder="请输入姓名搜索" clearable :clear-icon="CloseBold" />
     </div>
     <el-table :data="paginatedTableData" style="height: 500px; overflow: auto;" >
         <el-table-column
-          v-for="columnModel in modelFieldList"
-          :key="columnModel.id"
-          :fixed="columnModel.name == 'c_xm' ? true : false"
-          :property="columnModel.name"
-          :label="columnModel.alias"
+          v-for="item in modelFieldList"
+          :key="item.id"
+          :fixed="item.name == 'c_xm' ? true : false"
+          :property="item.name"
+          :label="item.alias"
           :width="150"
           show-overflow-tooltip
         />
+        <el-table-column fixed="right" label="操作" min-width="120" v-if="$getUserType() == 3">
+            <template #default="scope">
+                <el-button link type="primary" size="small" @click="handleEditClick(scope.row)">
+                编辑
+                </el-button>
+            </template>
+        </el-table-column>
     </el-table>
 
     <!-- 分页控件 -->
@@ -32,15 +40,18 @@
 </template>
 
 <script>
-export default {
 
+export default {
+    components: {
+        
+    },
     data() {
         return {
             dialogTableVisible: false,
             modelFieldList:[],
             currentPage: 1,
             pageSize: 10,
-            searchText2:""
+            searchText2:"",
         }
     },
     props: {
@@ -59,16 +70,28 @@ export default {
         searchText:{
             type: String,
             default: ''
-        }
+        },
+        close: Function,
+    },
+    watch: {
+        tableData: {
+            handler: function (newVal, oldVal) {
+                // tableData 变化时重置分页到第一页
+                console.log("newVal:", newVal);
+                this.currentPage = 1;
+            },
+            deep: true
+        },
     },
     created() {
         let that = this;
         that.searchText2 = that.searchText;
         that.dialogTableVisible = that.isview;
-        console.log("that.searchText:", that.searchText);
+        // console.log("that.searchText:", that.searchText);
         let modelFields = JSON.parse(this.columnModel.fieldList);
         // 无序
         let keys = Object.keys(modelFields);
+
         for (let i = 0; i < keys.length; i++) {
             let obj = modelFields[keys[i]];
             if (!obj.name) {
@@ -80,6 +103,7 @@ export default {
             }
             that.modelFieldList.push(obj);
         }
+        // console.log("that.modelFieldList:", that.modelFieldList);
         this.modelFieldList.sort((a, b) => {
             return a.index > b.index ? 1 : -1;
         });
@@ -88,6 +112,12 @@ export default {
     },
     computed: {
         filteredTableData() {
+            this.tableData.forEach((data) => {
+                data.sfzhm = data.c_sfzhm;
+                data.sjhm = data.c_sjhm;
+                data.c_sfzhm = this.formatCardNumber(data.c_sfzhm);
+                data.c_sjhm = this.formatPhoneNumber(data.c_sjhm);
+            })
             if (!this.searchText2) {
                 return this.tableData;
             }
@@ -112,7 +142,23 @@ export default {
         },
         handleCurrentChange(val) {
             this.currentPage = val;
-        }
+        },
+        formatCardNumber(cardNumber) {
+            if (!cardNumber) return "";
+            return cardNumber.replace(/(.{8})$/, '*'.repeat(8));
+        },
+        formatPhoneNumber(phone) {
+            if (!phone) return "";
+            return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
+        },
+        handleEditClick(row) {
+            // console.log(row);
+            this.$parent.getContentById(row);
+        },
+        dialogBeforeClose() {
+            this.close();
+        },
+       
     }
 }
 </script>

+ 1488 - 0
src/components/editManage.vue

@@ -0,0 +1,1488 @@
+<template>
+  <div>
+    <el-dialog
+      :class="'ContentDetail'"
+      v-model="isDialogShow"
+      width="650px"
+      top="7%"
+      title="员工信息"
+      :close-on-click-modal="false"
+      :before-close="dialogBeforeClose"
+      draggable
+      style="overflow: auto; height: 700px"
+    >
+      <el-form :model="dataForm" :rules="dataFormRules" label-width="150px" ref="dataForm">
+        <el-form-item :label="'ID(内置)'" v-show="false">
+          <el-input v-model="dataForm.id" />
+        </el-form-item>
+        <el-form-item :label="'标题(内置)'" prop="title" :rules="dataFormRules.required">
+          <el-input v-model="dataForm.title" :placeholder="'请输入标题'" :disabled="isView" />
+        </el-form-item>
+        <el-form-item :label="'描述(内置)'" prop="content" :rules="dataFormRules.required">
+          <el-input v-model="dataForm.content" :placeholder="'请输入描述'" :disabled="isView" />
+        </el-form-item>
+        <!-- :label="formItem.alias + ':'" -->
+        <el-form-item
+          v-for="formItem in modelFieldList"
+          :key="formItem.name"
+          :prop="formItem.name"
+          :rules="formItem.must ? dataFormRules.required : false"
+        >
+          <template #label>
+            <!-- <span title="这里是额外的信息">用户名</span> -->
+            <span class="el-form-item-label" :title="formItem.alias">{{ formItem.alias }}:</span>
+          </template>
+
+          <!--文本内容  formItem.describe-->
+
+           <el-input
+              v-if="['varchar', 'content', 'text'].indexOf(formItem.frontType) > -1"
+              v-model="dataForm[formItem.name]"
+              :type="formItem.itemType == 'password' ? 'password' : 'text'"
+              :placeholder="`请输入${formItem.alias}`"
+              :disabled="isView"
+            >
+              <!-- 后缀插槽:放置眼睛图标 -->
+              <template #suffix v-if="formItem.name == 'password'">
+                <el-icon
+                  class="cursor-pointer"
+                  @click="togglePassword(formItem)"
+                >
+                  <View v-if="showPassword" />
+                  <Hide v-else />
+                </el-icon>
+              </template>
+            </el-input>
+
+          <!-- <el-input
+            v-if="['varchar', 'content', 'text'].indexOf(formItem.frontType) > -1"
+            v-model="dataForm[formItem.name]"
+            :type="formItem.name == 'password' ? 'password' : 'text'"
+            :placeholder="`请输入${formItem.alias}`"
+            :disabled="isView"
+          /> -->
+          <!--日期时间  formItem.describe-->
+          <span v-else-if="['date_time'].indexOf(formItem.frontType) > -1">
+            <el-date-picker
+              v-if="!isView"
+              type="datetime"
+              v-model="dataForm[formItem.name]"
+              value-format="x"
+              :placeholder="`请输入${formItem.alias}`"
+            />
+            <span v-else>{{
+              dataForm[formItem.name] == "" ||
+              dataForm[formItem.name] == undefined ||
+              dataForm[formItem.name] == null
+                ? "无数据"
+                : handleDateFormat(dataForm[formItem.name], formItem.dateType)
+            }}</span>
+          </span>
+
+          <!--整数类型  formItem.describe-->
+          <el-input-number
+            v-if="['int_num'].indexOf(formItem.frontType) > -1"
+            style="width: 80%"
+            v-model="dataForm[formItem.name]"
+            :placeholder="`请输入${formItem.alias}`"
+            :disabled="isView"
+          />
+          <!--浮点类型  formItem.describe-->
+          <el-input-number
+            v-if="['float_num'].indexOf(formItem.frontType) > -1"
+            :min="formItem.min"
+            :max="formItem.max"
+            style="width: 80%"
+            v-model="dataForm[formItem.name]"
+            :placeholder="`请输入${formItem.alias}`"
+            :disabled="isView"
+          />
+          <!--布尔类型  formItem.describe-->
+          <span v-if="['boolean'].indexOf(formItem.frontType) > -1">
+            <el-switch
+              :active-text="'true'"
+              :inactive-text="'false'"
+              v-model="dataForm[formItem.name]"
+              :disabled="isView"
+            />
+            <span style="font-size: 7px; color: #606266; display: inline-block; margin-left: 8px">
+              [{{ formItem.alias }}]
+            </span>
+          </span>
+
+          <!--单选类型-->
+          <el-radio-group
+            v-if="['check'].indexOf(formItem.frontType) > -1"
+            v-model="dataForm[formItem.name]"
+            :disabled="isView"
+          >
+            <el-radio
+              v-for="itemItem in itemLists[formItem.extendId]"
+              :key="itemItem.index"
+              :label="itemItem.index"
+            >
+              {{ itemItem.name }}
+            </el-radio>
+          </el-radio-group>
+          <!--多选类型-->
+          <el-checkbox-group
+            v-if="['multiple_check'].indexOf(formItem.frontType) > -1"
+            v-model="dataForm[formItem.name]"
+            :disabled="isView"
+          >
+            <el-checkbox
+              v-for="item in itemLists[formItem.extendId]"
+              :key="item.index"
+              :label="item.index"
+            >
+              {{ item.name }}
+            </el-checkbox>
+          </el-checkbox-group>
+          <!--类别 formItem.describe-->
+          <el-select
+            clearable
+            v-if="['select'].indexOf(formItem.frontType) > -1"
+            v-model="dataForm[formItem.name]"
+            :placeholder="`请输入${formItem.alias}`"
+            :disabled="isView"
+          >
+            <el-option
+              v-for="item in itemLists[formItem.extendId]"
+              :key="item.index"
+              :label="item.name"
+              :value="item.index"
+            >
+              <div
+                :style="{
+                  width: '100%',
+                  height: '100%',
+                  'background-color': item.bgColor,
+                }"
+              >
+                <el-image
+                  style="width: 25px; height: 25px; vertical-align: middle; margin-right: 3px"
+                  :src="item.icon"
+                  fit="fill"
+                >
+                  <template #error>
+                    <div class="image-slot"></div>
+                  </template>
+                </el-image>
+                <span :style="{ color: item.frontColor }">{{ item.name }}</span>
+              </div>
+            </el-option>
+          </el-select>
+          <!--多级类别-->
+          <el-cascader
+            clearable
+            v-if="['multiple_select'].indexOf(formItem.frontType) > -1"
+            v-model="dataForm[formItem.name]"
+            :options="itemLists[formItem.extendId]"
+            :props="{
+              label: 'name',
+              value: 'index',
+              checkStrictly: true,
+              emitPath: false,
+            }"
+            :disabled="isView"
+          >
+            <template #default="{ node, data }">
+              <div style="display: none">{{ node }}</div>
+              <div
+                :style="{
+                  width: '100%',
+                  height: '100%',
+                  'background-color': data.bgColor,
+                }"
+              >
+                <el-image
+                  style="width: 25px; height: 25px; vertical-align: middle; margin-right: 3px"
+                  :src="data.icon"
+                  fit="fill"
+                >
+                  <template #error>
+                    <div class="image-slot"></div>
+                  </template>
+                </el-image>
+                <span :style="{ color: data.frontColor }">{{ data.name }}</span>
+              </div>
+            </template>
+          </el-cascader>
+
+          <!-- 经纬度、点、线、面选择 formItem.describe-->
+          <span
+            v-if="
+              [
+                'latlng',
+                'point',
+                'polyline',
+                'polygon',
+                'spoint',
+                'spolyline',
+                'spolygon',
+                'map_draw',
+              ].indexOf(formItem.frontType) > -1
+            "
+          >
+            <el-input v-show="false" v-model="dataForm[formItem.name]" />
+            <el-button @click="handleMapSelect(formItem)">
+              <span>{{ isView ? "查看" : "设置" }}</span
+              >地理元素
+            </el-button>
+            <el-icon
+              :color="'green'"
+              style="margin: 0 5px"
+              v-if="dataForm[formItem.name] && dataForm[formItem.name] != ''"
+            >
+              <ElIconCircleCheck />
+            </el-icon>
+            <span style="font-size: 10px; color: #606266; display: inline-block; margin-left: 5px">
+              {{ formItem.alias }}
+            </span>
+          </span>
+
+          <!--文件/图片/音频/视频 formItem.describe-->
+          <span v-if="['files', 'picture', 'video', 'audio'].indexOf(formItem.frontType) > -1">
+            <el-upload
+              :ref="formItem.name + '-upload'"
+              :file-list="dataForm[formItem.name + '-fileList']"
+              :limit="1"
+              :http-request="(options) => handleUpload(options, formItem.name)"
+              :before-upload="
+                (rawFile) =>
+                  handleBeforeUpload(rawFile, formItem.name + '-upload', formItem.frontType)
+              "
+              :on-exceed="(val) => handleUploadExceed(val, formItem.name)"
+              :before-remove="(val) => handleUploadRemove(val, formItem.name)"
+              :on-preview="(file) => handlePreview(file, formItem.frontType)"
+              :disabled="isView"
+            >
+              <el-input v-model="dataForm[formItem.name]" :disabled="true" v-show="false" />
+              <el-button type="primary" :disabled="isView">选择文件</el-button>
+              <el-icon
+                :color="'green'"
+                style="margin: 0 5px"
+                v-if="
+                  dataForm[formItem.name + '-fileStatus'] !== -1 &&
+                  dataForm[formItem.name] &&
+                  dataForm[formItem.name] != ''
+                "
+              >
+                <ElIconCircleCheck />
+              </el-icon>
+              <span v-if="dataForm[formItem.name + '-fileStatus'] === -1">
+                <el-popover
+                  placement="top-start"
+                  trigger="hover"
+                  popper-class="file_warning"
+                  content="文件无法访问"
+                >
+                  <template #reference>
+                    <el-icon :color="'orange'" style="margin: 0 5px; cursor: help">
+                      <ElIconWarning />
+                    </el-icon>
+                  </template>
+                </el-popover>
+              </span>
+              <template #tip>
+                <span class="el-upload__tip" style="display: inline-block; margin-left: 10px">
+                  {{ formItem.alias }}
+                </span>
+              </template>
+            </el-upload>
+          </span>
+
+          <!--带地理位置的图片、音频、视频 formItem.describe-->
+          <span
+            v-if="
+              ['picture_location', 'audio_location', 'video_location'].indexOf(formItem.frontType) >
+              -1
+            "
+          >
+            <el-upload
+              :ref="formItem.name + '-upload'"
+              :file-list="dataForm[formItem.name + '-fileList']"
+              :limit="1"
+              :http-request="(options) => handleUpload(options, formItem.name + '-file', true)"
+              :before-upload="
+                (rawFile) => handleBeforeUpload(rawFile, formItem.name, formItem.frontType)
+              "
+              :on-exceed="(val) => handleUploadExceed(val, formItem.name + '-file')"
+              :before-remove="(val) => handleUploadRemove(val, formItem.name + '-file', true)"
+              :on-preview="(file) => handlePreview(file, formItem.frontType)"
+              :disabled="isView"
+            >
+              <el-button type="primary" :disabled="isView">选择文件</el-button>
+              <el-icon
+                :color="'green'"
+                style="margin: 0 5px"
+                v-if="
+                  dataForm[formItem.name + '-fileStatus'] !== -1 &&
+                  dataForm[formItem.name + '-file'] &&
+                  dataForm[formItem.name + '-file'] != ''
+                "
+              >
+                <ElIconCircleCheck />
+              </el-icon>
+              <span v-if="dataForm[formItem.name + '-fileStatus'] === -1">
+                <el-popover
+                  placement="top-start"
+                  trigger="hover"
+                  popper-class="file_warning"
+                  content="文件无法访问"
+                >
+                  <template #reference>
+                    <el-icon :color="'orange'" style="margin: 0 5px; cursor: help">
+                      <ElIconWarning />
+                    </el-icon>
+                  </template>
+                </el-popover>
+              </span>
+              <template #tip>
+                <span class="el-upload__tip" style="display: inline-block; margin-left: 10px">
+                  {{ formItem.alias }}
+                </span>
+              </template>
+            </el-upload>
+            <el-button @click="handleMapSelect(formItem, formItem.name + '-location')">
+              <span>{{ isView ? "查看" : "设置" }}</span
+              >地理位置
+            </el-button>
+            <el-icon
+              :color="'green'"
+              style="margin: 0 5px"
+              v-if="
+                dataForm[formItem.name + '-location'] && dataForm[formItem.name + '-location'] != ''
+              "
+            >
+              <ElIconCircleCheck />
+            </el-icon>
+          </span>
+
+          <!--图册-->
+          <el-upload
+            v-if="['pictures'].indexOf(formItem.frontType) > -1"
+            list-type="picture-card"
+            :file-list="dataForm[formItem.name + '-fileList']"
+            :disabled="isView"
+            :http-request="(options) => handleTCUpload(options, formItem.name)"
+            :on-preview="(file) => handleTCPreview(file)"
+          >
+            <el-icon v-if="!isView">
+              <ElIconPlus />
+            </el-icon>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button type="primary" @click="sure" v-if="!isView">确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      :class="'ContentMap'"
+      v-model="isMapShow"
+      v-if="isMapShow"
+      width="1200px"
+      top="7%"
+      bottom="5%"
+      title="地图选择"
+      :close-on-click-modal="false"
+      :before-close="mapDialogBeforeClose"
+    >
+      <div style="width: 100%; height: 40px; padding-bottom: 5px" v-if="!isView">
+        <el-button
+          style="margin: 5px"
+          @click="mapMarkPoint"
+          v-if="
+            [
+              'map_draw',
+              'latlng',
+              'point',
+              'spoint',
+              'picture_location',
+              'audio_location',
+              'video_location',
+            ].indexOf(currMapItem.frontType) > -1
+          "
+          >点标记</el-button
+        >
+        <el-button
+          style="margin: 5px"
+          @click="mapMarkLine"
+          v-if="['map_draw', 'polyline', 'spolyline'].indexOf(currMapItem.frontType) > -1"
+          >线标记</el-button
+        >
+        <el-button
+          style="margin: 5px"
+          @click="mapMarkPolygon"
+          v-if="['map_draw', 'polygon', 'spolygon'].indexOf(currMapItem.frontType) > -1"
+          >面标记</el-button
+        >
+        <el-button style="margin: 5px" @click="calcelMark">取消标记</el-button>
+      </div>
+      <div id="mapContent">
+        <div id="mapPicker" style="width: 100%; height: 100%"></div>
+      </div>
+      <div id="mapRight">
+        <el-form :label-position="'top'">
+          <el-form-item :label="'地理信息预览:'">
+            <!-- <json-viewer
+              :style="{ height: '350px', overflow: 'auto' }"
+              :value="JSON.parse(JSON.stringify(geoJsons))"
+              :expand-depth="5"
+              copyable
+              boxed
+              sort
+            ></json-viewer> -->
+            <div
+              style="position: absolute; z-index: 9; top: 2px; right: 50px; cursor: pointer"
+              @click="copyText(geoJsons)"
+            >
+              复制
+            </div>
+            <json-editor-vue
+              class="json-editor"
+              :modeList="couldView"
+              :style="{ height: '370px', width: '100%', overflow: 'auto' }"
+              :modelValue="JSON.parse(JSON.stringify(geoJsons))"
+              @update:modelValue="changeValue"
+            />
+          </el-form-item>
+        </el-form>
+      </div>
+      <template #footer>
+        <el-button type="primary" @click="mapSure()" v-if="!isView">确定</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog v-if="isMediaShow" v-model="isMediaShow" title="资源预览">
+      <span v-if="currMedia.images">
+        <!-- style="width: 200px; height: 200px; margin: 5px" -->
+        <el-image
+          w-full
+          v-for="(item, index) in currMedia.images"
+          :key="index"
+          :src="item"
+          :fit="fit"
+        />
+      </span>
+      <span v-if="currMedia.video">
+        <video width="500" height="300" :src="currMedia.video" controls></video>
+      </span>
+      <span v-if="currMedia.audio">
+        <audio :src="currMedia.audio" controls></audio>
+      </span>
+      <span v-if="currMedia.file">
+        <el-button>
+          <a :href="currMedia.file" :download="currMedia.file">点击下载</a>
+        </el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { toRaw } from "vue";
+import api from "@/api/content";
+import { genFileId, ElLoading } from "element-plus";
+import moment from "moment";
+export default {
+  name: "contentDetail",
+  data() {
+    return {
+      isDialogShow: true,
+      dataForm: {},
+      dataFormRules: {
+        required: [
+          { required: true, message: "该字段不能为空", trigger: "blur" },
+          { required: true, message: "该字段不能为空", trigger: "change" },
+        ],
+      },
+      modelFieldList: [],
+      itemLists: {},
+      showPassword: false,
+      map: {},
+      currMapItem: {},
+      isMapShow: true,
+      mapMarkers: {
+        layers: [],
+        points: [],
+        linePoints: [],
+        polPoints: [],
+        lines: [],
+        pols: [],
+      },
+      mapLines: [],
+      geoJsons: [],
+
+      isMediaShow: false,
+      currMedia: {
+        images: [],
+      },
+      mediaTypes: {
+        image: ["image/gif", "image/jpeg", "image/jpg", "image/bmp", "image/png"],
+        video: ["video/mp4"],
+        audio: ["audio/mpeg"],
+      },
+      couldView: ["code"], // "tree", "code", "form", "view"
+    };
+  },
+  props: {
+    isShow: Boolean,
+    columnModel: Object,
+    column: Object,
+    item: Object,
+    isView: Boolean,
+    close: Function,
+  },
+  created() {
+    let that = this;
+    let modelFields = JSON.parse(this.columnModel.fieldList);
+    // 无序
+    let keys = Object.keys(modelFields);
+    for (let i = 0; i < keys.length; i++) {
+      let obj = modelFields[keys[i]];
+      if (!obj.name) {
+        obj = JSON.parse(obj);
+      }
+      obj["key"] = keys[i];
+      if (["check", "multiple_check"].indexOf(obj.frontType) > -1) {
+        this.getCheckItems(obj, 1);
+      } else if (["select", "multiple_select"].indexOf(obj.frontType) > -1) {
+        this.getCheckItems(obj, 2);
+      }
+      // console.log("==========" + obj);
+      obj.itemType = obj.name;
+      this.modelFieldList.push(obj);
+    }
+    // 有序
+    // for (let key in modelFields) {
+    //   let obj = modelFields[key];
+    //   if (!obj.name) {
+    //     obj = JSON.parse(obj);
+    //   }
+    //   obj["key"] = key;
+    //   if (["check", "multiple_check"].indexOf(obj.frontType) > -1) {
+    //     this.getCheckItems(obj, 1);
+    //   } else if (["select", "multiple_select"].indexOf(obj.frontType) > -1) {
+    //     this.getCheckItems(obj, 2);
+    //   }
+    //   debugger
+    //   console.log(1111);
+
+    //   this.modelFieldList.push(obj);
+    // }
+    this.modelFieldList.sort((a, b) => {
+      // return a.index > b.index ? 1 : a.sequence > b.sequence ? 1 : -1;
+      return a.index > b.index ? 1 : -1;
+    });
+    if (this.item && this.item !== "" && JSON.stringify(this.item) != "{}") {
+      this.modelFieldList.forEach((data) => {
+        if (
+          ["latlng", "point", "polyline", "polygon", "spoint", "spolyline", "spolygon"].indexOf(
+            data.frontType
+          ) > -1
+        ) {
+          that.item[data.name] = that.item[data.name];
+        } else if (
+          ["picture_location", "audio_location", "video_location"].indexOf(data.frontType) > -1
+        ) {
+          let obj = JSON.parse(that.item[data.name]);
+          that.item[data.name + "-file"] = obj.url;
+          api
+            .getContentFile(obj.url)
+            .then((response) => {
+              that.item[data.name + "-fileList"] = [];
+              let file = new File(
+                [response],
+                that.item[data.name].substr(
+                  that.item[data.name].length - 40,
+                  that.item[data.name].length
+                )
+              );
+              file.serverUrl = obj.url;
+              that.item[data.name + "-fileList"].push(file);
+            })
+            .catch((err) => {
+              if (err.response.status !== 200) {
+                that.item[data.name + "-fileStatus"] = -1;
+              }
+            });
+          that.item[data.name + "-location"] = obj.location;
+        } else if ("multiple_check" == data.frontType) {
+          if (!that.item[data.name]) {
+            that.item[data.name] = [];
+          } else {
+            let val = [];
+            let splice = that.item[data.name].split(",");
+            for (let i = 0; i < splice.length; i++) {
+              val.push(Number(splice[i]));
+            }
+            that.item[data.name] = val;
+          }
+        } else if (["check", "select", "multiple_select"].indexOf(data.frontType) > -1) {
+          that.item[data.name] = isNaN(Number(that.item[data.name])) ? '' : Number(that.item[data.name]);
+        } else if (["files", "picture", "audio", "video"].indexOf(data.frontType) > -1) {
+          if (!that.item[data.name]) return;
+          api
+            .getContentFile(that.item[data.name])
+            .then((response) => {
+              that.item[data.name + "-fileList"] = [];
+              let file = new File(
+                [response],
+                that.item[data.name].substr(
+                  that.item[data.name].length - 40,
+                  that.item[data.name].length
+                )
+              );
+              file.serverUrl = that.item[data.name];
+              that.item[data.name + "-fileList"].push(file);
+            })
+            .catch((err) => {
+              if (err.response.status !== 200) {
+                that.item[data.name + "-fileStatus"] = -1;
+              }
+            });
+        } else if ("pictures" === data.frontType) {
+          if (!that.item[data.name]) {
+            that.item[data.name + "-fileList"] = [];
+            return;
+          }
+
+          let obj = JSON.parse(that.item[data.name]);
+          that.item[data.name + "-fileList"] = [];
+          obj.forEach((i) => {
+            let url =
+              i.indexOf(systemConfig.dmsDataProxy) !== 0 ? systemConfig.dmsDataProxy + i : i;
+            that.item[data.name + "-fileList"].push({
+              name: i.substr(i.length - 40, i.length),
+              url: url,
+              serverUrl: i,
+            });
+          });
+        }
+      });
+    }
+    this.dataForm = this.item;
+    // console.log(this.dataForm)
+  },
+  mounted() {
+    this.isMapShow = false;
+  },
+  methods: {
+    async textToCopy() {
+      let that = this;
+      // copyText(JSON.stringify(that.geoJsons))
+      await navigator.clipboard.writeText(JSON.stringify(that.geoJsons));
+      this.$message({ message: "复制成功", type: "success" });
+    },
+    togglePassword(formItem) {
+      if(this.showPassword){
+        formItem.itemType = "password";
+      }else{
+        formItem.itemType = "text";
+      }
+      this.showPassword = !this.showPassword;
+    },
+    changeValue(json) {
+      let that = this;
+      let Icon = L.divIcon({
+        className: "my-div-icon", //自定义icon css样式
+        iconSize: [10, 10], //点大小
+      });
+      that.geoJsons = json;
+      let center = that.geoJsons[0].geometry.coordinates;
+      let type = that.geoJsons[0].geometry.type;
+      if (type == "Point") {
+        //更新点坐标
+        that.mapMarkers.points[0].setLatLng([center[1], center[0]]);
+      } else if (type == "LineString") {
+        // 更新面数据
+        let geojsons = [];
+        that.mapMarkers.layers.forEach((item) => {
+          that.map.removeLayer(item);
+        });
+        that.mapMarkers = {
+          layers: [],
+          points: [],
+          linePoints: [],
+          polPoints: [],
+          lines: [],
+          pols: [],
+        };
+
+        for (var i = 0; i < that.geoJsons.length; i++) {
+          that.geoJsons[i].geometry.coordinates.forEach((item) => {
+            let marker = L.marker([item[1], item[0]], {
+              icon: Icon,
+            }).addTo(that.map);
+            if (["polyline", "spolyline"].indexOf(that.currMapItem.frontType) > -1) {
+              that.mapMarkers.lines.forEach((item) => {
+                that.map.removeLayer(item);
+              });
+              that.mapMarkers.lines = [];
+              geojsons = [];
+            }
+            //添加点到地图中
+            that.mapMarkers.linePoints.push(marker);
+            that.mapMarkers.layers.push(marker);
+            if (that.mapMarkers.linePoints.length > 1) {
+              let points = [];
+              that.mapMarkers.linePoints.forEach((item) => {
+                points.push([item._latlng.lat, item._latlng.lng]);
+              });
+              let line = L.polyline(points, {
+                color: "red",
+              }).addTo(that.map);
+              that.mapMarkers.layers.push(line);
+              if (
+                that.currMapItem.frontType == "map_draw" &&
+                that.mapMarkers.linePoints.length > 2
+              ) {
+                let lastLine = that.mapMarkers.lines[that.mapMarkers.lines.length - 1];
+                that.map.removeLayer(lastLine);
+                that.mapMarkers.lines.splice(that.mapMarkers.lines.length - 1, 1);
+                geojsons.splice(geojsons.length - 1, 1);
+              }
+              that.mapMarkers.lines.push(line);
+              geojsons.push(line.toGeoJSON());
+            }
+          });
+        }
+        that.geoJsons = geojsons;
+      } else if (type == "Polygon") {
+        let geojsons = [];
+        that.mapMarkers.layers.forEach((item) => {
+          that.map.removeLayer(item);
+        });
+        that.mapMarkers = {
+          layers: [],
+          points: [],
+          linePoints: [],
+          polPoints: [],
+          lines: [],
+          pols: [],
+        };
+        for (var i = 0; i < that.geoJsons.length; i++) {
+          that.geoJsons[i].geometry.coordinates.forEach((coordItem) => {
+            coordItem.forEach((item) => {
+              let marker = L.marker([item[1], item[0]], {
+                icon: Icon,
+              }).addTo(that.map);
+              //添加点到地图中
+              that.mapMarkers.polPoints.push(marker);
+              that.mapMarkers.layers.push(marker);
+
+              if (["polygon", "spolygon"].indexOf(that.currMapItem.frontType) > -1) {
+                that.mapMarkers.pols.forEach((item) => {
+                  that.map.removeLayer(item);
+                });
+                that.mapMarkers.pols = [];
+                geojsons = [];
+              }
+
+              if (that.mapMarkers.polPoints.length > 2) {
+                let points = [];
+                that.mapMarkers.polPoints.forEach((item) => {
+                  points.push([item._latlng.lat, item._latlng.lng]);
+                });
+                let polygon = L.polygon(points, {
+                  color: "red",
+                }).addTo(that.map);
+                that.mapMarkers.layers.push(polygon);
+                if (
+                  that.currMapItem.frontType == "map_draw" &&
+                  that.mapMarkers.polPoints.length > 3
+                ) {
+                  let lastPol = that.mapMarkers.pols[that.mapMarkers.pols.length - 1];
+                  that.map.removeLayer(lastPol);
+                  that.mapMarkers.pols.splice(that.mapMarkers.pols.length - 1, 1);
+                  geojsons.splice(geojsons.length - 1, 1);
+                }
+                that.mapMarkers.pols.push(polygon);
+                geojsons.push(polygon.toGeoJSON());
+              }
+            });
+          });
+        }
+        that.geoJsons = geojsons;
+      }
+      let bboxObj = {
+        type: "FeatureCollection",
+        features: that.geoJsons.map(function (item) {
+          if (item.type == "Feature") {
+            return item;
+          } else {
+            return {
+              type: "Feature",
+              geometry: item,
+            };
+          }
+        }),
+      };
+      let extent = turf.bbox(bboxObj);
+      var bounds = L.latLngBounds([
+        [extent[3], extent[2]],
+        [extent[1], extent[0]],
+      ]);
+
+      //定位到矩形
+      that.map.fitBounds(bounds, { padding: [10, 10], maxZoom: 15 });
+    },
+    dialogBeforeClose() {
+      this.close();
+    },
+    mapDialogBeforeClose() {
+      this.isMapShow = false;
+      this.calcelMark();
+      this.geoJsons = [];
+      this.mapMarkers = {
+        layers: [],
+        points: [],
+        linePoints: [],
+        polPoints: [],
+        lines: [],
+        pols: [],
+      };
+    },
+    handleMapFileChange(name) {
+      if (
+        this.dataForm[name + "-file"] &&
+        this.dataForm[name + "-file"] !== "" &&
+        this.dataForm[name + "-location"] &&
+        this.dataForm[name + "-location"] !== ""
+      ) {
+        let obj = {
+          location: this.dataForm[name + "-location"],
+          url: this.dataForm[name + "-file"],
+        };
+        this.dataForm[name] = obj;
+      } else {
+        this.dataForm[name] = "";
+      }
+      this.$refs.dataForm.validateField(name);
+    },
+    mapSure() {
+      this.isMapShow = false;
+      if (this.geoJsons.length < 1) {
+        this.dataForm[this.currMapItem.name] = null;
+      } else {
+        if (
+          [
+            "latlng",
+            "point",
+            "spoint",
+            "polyline",
+            "spolyline",
+            "polygon",
+            "spolygon",
+            "picture_location",
+            "audio_location",
+            "video_location",
+          ].indexOf(this.currMapItem.frontType) > -1
+        ) {
+          this.dataForm[this.currMapItem.name] = this.$WKT.convert(this.geoJsons[0].geometry);
+        } else {
+          let geoCollection = {
+            type: "FeatureCollection",
+            features: [],
+          };
+          this.geoJsons.forEach((item) => {
+            geoCollection.features.push(toRaw(item));
+          });
+          this.dataForm[this.currMapItem.name] = JSON.stringify(geoCollection);
+        }
+      }
+      if (
+        ["picture_location", "audio_location", "video_location"].indexOf(
+          this.currMapItem.frontType
+        ) > -1
+      ) {
+        this.handleMapFileChange(this.currMapItem.name.substr(0, this.currMapItem.name.length - 9));
+      }
+      this.calcelMark();
+      this.geoJsons = [];
+      this.mapMarkers = {
+        layers: [],
+        points: [],
+        linePoints: [],
+        polPoints: [],
+        lines: [],
+        pols: [],
+      };
+    },
+    mapMarkPoint() {
+      let that = this;
+      that.map.off("click");
+      let Icon = L.divIcon({
+        className: "my-div-icon", //自定义icon css样式
+        iconSize: [10, 10], //点大小
+      });
+      that.map.on("click", function (e) {
+        var lat = e.latlng.lat; //纬度
+        var lng = e.latlng.lng; //经度
+        //打点
+        if (
+          [
+            "latlng",
+            "point",
+            "spoint",
+            "picture_location",
+            "audio_location",
+            "video_location",
+          ].indexOf(that.currMapItem.frontType) > -1 &&
+          that.mapMarkers.points.length > 0
+        ) {
+          //更新点坐标
+          that.mapMarkers.points[0].setLatLng([lat, lng]);
+          that.geoJsons[0] = that.mapMarkers.points[0].toGeoJSON();
+        } else {
+          let marker = L.marker([lat, lng], {
+            icon: Icon,
+          }).addTo(that.map);
+          //添加点到地图中
+          that.mapMarkers.points.push(marker);
+          that.mapMarkers.layers.push(marker);
+          that.geoJsons.push(marker.toGeoJSON());
+        }
+      });
+    },
+    mapMarkLine() {
+      let that = this;
+      if (this.currMapItem.frontType == "map_draw") {
+        that.mapMarkers.linePoints = [];
+      }
+      that.map.off("click");
+      let Icon = L.divIcon({
+        className: "my-div-icon", //自定义icon css样式
+        iconSize: [10, 10], //点大小
+      });
+      that.map.on("click", function (e) {
+        var lat = e.latlng.lat; //纬度
+        var lng = e.latlng.lng; //经度
+        let marker = L.marker([lat, lng], {
+          icon: Icon,
+        }).addTo(that.map);
+        if (["polyline", "spolyline"].indexOf(that.currMapItem.frontType) > -1) {
+          that.mapMarkers.lines.forEach((item) => {
+            that.map.removeLayer(item);
+          });
+          that.mapMarkers.lines = [];
+          that.geoJsons = [];
+        }
+        //添加点到地图中
+        that.mapMarkers.linePoints.push(marker);
+        that.mapMarkers.layers.push(marker);
+        if (that.mapMarkers.linePoints.length > 1) {
+          let points = [];
+          that.mapMarkers.linePoints.forEach((item) => {
+            points.push([item._latlng.lat, item._latlng.lng]);
+          });
+          let line = L.polyline(points, {
+            color: "red",
+          }).addTo(that.map);
+          that.mapMarkers.layers.push(line);
+          if (that.currMapItem.frontType == "map_draw" && that.mapMarkers.linePoints.length > 2) {
+            let lastLine = that.mapMarkers.lines[that.mapMarkers.lines.length - 1];
+            that.map.removeLayer(lastLine);
+            that.mapMarkers.lines.splice(that.mapMarkers.lines.length - 1, 1);
+            that.geoJsons.splice(that.geoJsons.length - 1, 1);
+          }
+          that.mapMarkers.lines.push(line);
+          that.geoJsons.push(line.toGeoJSON());
+        }
+      });
+    },
+    mapMarkPolygon() {
+      let that = this;
+      if (this.currMapItem.frontType == "map_draw") {
+        that.mapMarkers.polPoints = [];
+      }
+      that.map.off("click");
+      let Icon = L.divIcon({
+        className: "my-div-icon", //自定义icon css样式
+        iconSize: [10, 10], //点大小
+      });
+      that.map.on("click", function (e) {
+        var lat = e.latlng.lat; //纬度
+        var lng = e.latlng.lng; //经度
+        let marker = L.marker([lat, lng], {
+          icon: Icon,
+        }).addTo(that.map);
+        //添加点到地图中
+        that.mapMarkers.polPoints.push(marker);
+        that.mapMarkers.layers.push(marker);
+
+        if (["polygon", "spolygon"].indexOf(that.currMapItem.frontType) > -1) {
+          that.mapMarkers.pols.forEach((item) => {
+            that.map.removeLayer(item);
+          });
+          that.mapMarkers.pols = [];
+          that.geoJsons = [];
+        }
+
+        if (that.mapMarkers.polPoints.length > 2) {
+          let points = [];
+          that.mapMarkers.polPoints.forEach((item) => {
+            points.push([item._latlng.lat, item._latlng.lng]);
+          });
+          let polygon = L.polygon(points, {
+            color: "red",
+          }).addTo(that.map);
+          that.mapMarkers.layers.push(polygon);
+          if (that.currMapItem.frontType == "map_draw" && that.mapMarkers.polPoints.length > 3) {
+            let lastPol = that.mapMarkers.pols[that.mapMarkers.pols.length - 1];
+            that.map.removeLayer(lastPol);
+            that.mapMarkers.pols.splice(that.mapMarkers.pols.length - 1, 1);
+            that.geoJsons.splice(that.geoJsons.length - 1, 1);
+          }
+          that.mapMarkers.pols.push(polygon);
+          that.geoJsons.push(polygon.toGeoJSON());
+        }
+      });
+    },
+    calcelMark() {
+      let that = this;
+      that.map.off("click");
+      that.mapMarkers.layers.forEach((item) => {
+        that.map.removeLayer(item);
+      });
+      that.mapMarkers = {
+        layers: [],
+        points: [],
+        linePoints: [],
+        polPoints: [],
+        lines: [],
+        pols: [],
+      };
+      this.geoJsons = [];
+    },
+    handleMapSelect(item, alias) {
+      this.isMapShow = true;
+      item = JSON.parse(JSON.stringify(item));
+      if (alias && alias != "") {
+        item.name = alias;
+      }
+      this.currMapItem = item;
+      let that = this;
+      this.$nextTick(() => {
+        that.map = that.$L.map("mapPicker", {
+          minZoom: 3,
+          maxZoom: 20,
+          // center: [39.915457, 116.453437],
+          center: [31.175188130627745, 121.26786280328167],
+          zoom: 15,
+          zoomControl: false,
+          attributionControl: false,
+          crs: L.CRS.EPSG4326,
+        });
+        that.$L
+          .tileLayer(systemConfig.VEC_C + systemConfig.TDT_TK, {
+            maxZoom: 20,
+            tileSize: 256,
+            zoomOffset: 1,
+          })
+          .addTo(that.map);
+        that.$L
+          .tileLayer(systemConfig.CVA_C + systemConfig.TDT_TK, {
+            maxZoom: 20,
+            tileSize: 256,
+            zoomOffset: 1,
+          })
+          .addTo(that.map);
+        if (that.dataForm[item.name]) {
+          let Icon = L.divIcon({
+            className: "my-div-icon", //自定义icon css样式
+            iconSize: [10, 10], //点大小
+          });
+          let geojsons = [];
+          if (that.currMapItem.frontType != "map_draw") {
+            if (that.dataForm[item.name].value) {
+              geojsons.push(that.$WKT.parse(that.dataForm[item.name].value));
+            } else {
+              geojsons.push(that.$WKT.parse(that.dataForm[item.name]));
+            }
+          } else {
+            let obj = JSON.parse(that.dataForm[item.name]);
+            if (obj.features && obj.features !== "") {
+              obj.features.forEach((i) => geojsons.push(i));
+            }
+          }
+
+          let bboxObj = {
+            type: "FeatureCollection",
+            features: geojsons.map(function (item) {
+              if (item.type == "Feature") {
+                return item;
+              } else {
+                return {
+                  type: "Feature",
+                  geometry: item,
+                };
+              }
+            }),
+          };
+          let extent = turf.bbox(bboxObj);
+          var bounds = L.latLngBounds([
+            [extent[3], extent[2]],
+            [extent[1], extent[0]],
+          ]);
+
+          //定位到矩形
+          that.map.fitBounds(bounds);
+
+          // console.log(t)
+
+          for (let i = 0; i < geojsons.length; i++) {
+            let layer = that.$L
+              .geoJSON(geojsons[i], {
+                onEachFeature: function (feature, layer) {
+                  if (feature.properties && feature.properties.name) {
+                    layer.bindTooltip(feature.properties.name);
+                    layer.bindPopup(feature.properties.address);
+                  }
+                },
+                pointToLayer: function (feature, latlng) {
+                  let marker = L.marker(latlng, {
+                    icon: Icon,
+                  });
+                  that.mapMarkers.points.push(marker);
+                  return marker;
+                },
+              })
+              .addTo(that.map);
+            that.geoJsons.push(layer.toGeoJSON().features[0]);
+          }
+        }
+      });
+    },
+
+    handleBeforeUpload(file, ref, type) {
+      let fileType = file.type;
+      let fileSize = file.size / 1024 / 1024;
+      // 判断类型
+      if (["picture", "picture_location"].indexOf(type) > -1) {
+        if (this.mediaTypes.image.indexOf(fileType) < 0) {
+          this.$message({ message: "不支持的图片类型", type: "warning" });
+          return false;
+        }
+      } else if (["audio", "audio_location"].indexOf(type) > -1) {
+        if (this.mediaTypes.audio.indexOf(fileType) < 0) {
+          this.$message({ message: "不支持的音频类型", type: "warning" });
+          return false;
+        }
+      } else if (["video", "video_location"].indexOf(type) > -1) {
+        if (this.mediaTypes.video.indexOf(fileType) < 0) {
+          this.$message({ message: "不支持的视频类型", type: "warning" });
+          return false;
+        }
+      }
+      // 判断大小
+      if (["video", "video_location"].indexOf(type) > -1) {
+        if (fileSize > 40) {
+          this.$message({ message: "文件不能超过40M", type: "warning" });
+          return false;
+        }
+      } else {
+        if (fileSize > 10) {
+          this.$message({ message: "文件不能超过10M", type: "warning" });
+          return false;
+        }
+      }
+      return true;
+    },
+    handleUpload(options, ref, isMapFile, isMulti) {
+      let that = this;
+      let params = {
+        columnId: this.columnModel.id,
+        contentId: this.item.id,
+        paraName: options.file.name,
+        type: 0,
+        file: options.file,
+      };
+      const loadingInstance = ElLoading.service({
+        customClass: "content-detail-upload-loading",
+        fullscreen: true,
+        text: "上传中,请稍后...",
+      });
+      api.uploadFile(params).then((res) => {
+        if (res.code === 200) {
+          loadingInstance.close();
+          that.dataForm[ref + "-fileStatus"] = null;
+          options.file.serverUrl = res.content;
+          if (isMulti) {
+            let urls = [];
+            that.dataForm[ref + "-fileList"].forEach((i) => {
+              let serverUrl = i.raw ? i.raw.serverUrl : i.serverUrl ? i.serverUrl : "";
+              urls.push(serverUrl);
+            });
+            that.dataForm[ref] = urls;
+          } else {
+            that.dataForm[ref] = res.content;
+          }
+          if (isMapFile) {
+            this.handleMapFileChange(ref.substr(0, ref.length - 5));
+          }
+        } else {
+          loadingInstance.close();
+          that.$message({ message: res.content, type: "error" });
+        }
+      });
+    },
+    handleUploadExceed(file, ref) {
+      this.$refs[ref + "-upload"][0].clearFiles();
+      file = file[0];
+      file.uid = genFileId();
+      this.$refs[ref + "-upload"][0].handleStart(file);
+      this.$refs[ref + "-upload"][0].submit();
+    },
+    handleUploadRemove(file, ref, isMapFile) {
+      this.dataForm[ref] = "";
+      if (isMapFile) {
+        this.handleMapFileChange(ref.substr(0, ref.length - 5));
+      }
+    },
+    handlePreview(file, type) {
+      this.isMediaShow = true;
+      this.currMedia = {};
+      let serverUrl = file.raw ? file.raw.serverUrl : file.serverUrl ? file.serverUrl : "";
+      let url =
+        serverUrl.indexOf(systemConfig.dmsDataProxy) !== 0
+          ? systemConfig.dmsDataProxy + serverUrl
+          : serverUrl;
+      if (["picture", "picture_location"].indexOf(type) > -1) {
+        this.currMedia.images = [url];
+      } else if (["video", "video_location"].indexOf(type) > -1) {
+        this.currMedia.video = url;
+      } else if (["audio", "audio_location"].indexOf(type) > -1) {
+        this.currMedia.audio = url;
+      } else {
+        this.currMedia.file = url;
+      }
+    },
+
+    handleTCUpload(options, ref) {
+      let that = this;
+      let params = {
+        columnId: this.columnModel.id,
+        contentId: this.item.id,
+        paraName: options.file.name,
+        type: 0,
+        file: options.file,
+      };
+      // loading
+      const loadingInstance = ElLoading.service({
+        customClass: "content-detail-upload-loading",
+        fullscreen: true,
+        text: "上传中,请稍后...",
+      });
+      api.uploadFile(params).then((res) => {
+        if (res.code === 200) {
+          loadingInstance.close();
+          that.dataForm[ref + "-fileStatus"] = null;
+          options.file.serverUrl = res.content;
+          let url = systemConfig.dmsDataProxy + res.content;
+          that.dataForm[ref + "-fileList"].push({
+            name: options.file.name,
+            url: url,
+            serverUrl: res.content,
+          });
+        } else {
+          loadingInstance.close();
+          that.$message({ message: res.content, type: "error" });
+        }
+      });
+    },
+    handleTCPreview(file) {
+      file = toRaw(file);
+      let serverUrl = file.raw ? file.raw.serverUrl : file.serverUrl ? file.serverUrl : "";
+      let url =
+        serverUrl.indexOf(systemConfig.dmsDataProxy) !== 0
+          ? systemConfig.dmsDataProxy + serverUrl
+          : serverUrl;
+      this.currMedia.images = [url];
+      this.isMediaShow = true;
+    },
+
+    handleDateFormat(val, fmt) {
+      if (!fmt || fmt == "") {
+        fmt = "0";
+      }
+      if (fmt == "0") {
+        return moment(val).format("YYYY-MM-DD");
+      } else if (fmt == "1") {
+        return moment(val).format("YYYY-MM-DD HH:mm:ss");
+      } else if (fmt == "2") {
+        return moment(val).format("YYYY-MM-DD HH:mm:ss.ssss");
+      } else {
+        return moment(val).format("YYYY-MM-DD HH:mm:ss");
+      }
+    },
+    sure() {
+      let that = this;
+      this.$refs.dataForm.validate((valid) => {
+        if (valid) {
+          // console.log("[ eeeee ] >");
+          let content = {};
+          content["id"] = that.dataForm["id"];
+          content["title"] = that.dataForm["title"];
+          content["content"] = that.dataForm["content"];
+          that.modelFieldList.forEach((field) => {
+            if (field.frontType == "multiple_check") {
+              if (that.dataForm[field.name] == undefined) that.dataForm[field.name] = [];
+              let str = that.dataForm[field.name].join(",");
+              str.replace("[", "");
+              str.replace("]", "");
+              content[field.name] = str;
+            } else if (field.frontType == "date_time") {
+              content[field.name] = that.dataForm[field.name];
+            } else if (field.frontType == "pictures") {
+              content[field.name] = [];
+              if (that.dataForm[field.name + "-fileList"]) {
+                that.dataForm[field.name + "-fileList"].forEach((i) => {
+                  content[field.name].push(i.serverUrl);
+                });
+              }
+              content[field.name] = JSON.stringify(content[field.name]);
+            } else {
+              content[field.name] = that.dataForm[field.name];
+            }
+          });
+          let params = {
+            content: JSON.stringify(content),
+            columnId: that.column.columnId,
+            modelId: that.column.modelId,
+          };
+          if (content.id && content.id !== "") {
+            api
+              .updateContent(params)
+              .then((res) => {
+                if (res.code === 200) {
+                  that.close(true);
+                  that.$message({ message: "修改成功", type: "success" });
+                } else {
+                  that.$message({ message: res.content, type: "error" });
+                }
+              })
+              .catch((err) => {
+                that.$message({ message: err.message, type: "error" });
+              });
+          } else {
+            api
+              .addContent(params)
+              .then((res) => {
+                if (res.code === 200) {
+                  that.close(true);
+                  let message = "添加成功";
+                  that.$message({ message: message, type: "success" });
+                } else {
+                  that.$message({ message: res.content, type: "error" });
+                }
+              })
+              .catch((err) => {
+                that.$message({ message: err.message, type: "error" });
+              });
+          }
+        }
+      });
+    },
+    getCheckItems(item, type) {
+      let that = this;
+      // console.log("[ eee ] >");
+      if (type === 1) {
+        api.getCheckDetail({ sName: item.extendId }).then((res) => {
+          if (res.code == 200) {
+            that.itemLists[item.extendId] = res.content;
+          }
+        });
+      } else if (type === 2) {
+        let cType =
+          item.frontType === "select" ? 0 : item.frontType === "multiple_select" ? 1 : null;
+        api.getCategoryDetail({ type: cType, cName: item.extendId }).then((res) => {
+          if (res.code == 200) {
+            that.itemLists[item.extendId] = res.content;
+          }
+        });
+      }
+    },
+  },
+};
+</script>
+
+<style>
+.jsoneditor-menu {
+  display: none;
+}
+.jsoneditor-statusbar {
+  display: none;
+}
+.jsoneditor-validation-errors-container {
+  display: none;
+}
+div.jsoneditor-outer.has-main-menu-bar {
+  margin-top: 0px;
+  padding-top: 40px;
+  background-color: #e2f1fa;
+}
+.full-screen {
+  right: 10px !important;
+  background-color: #d9d9d9 !important;
+}
+
+#mapContent {
+  height: 400px;
+  width: 70%;
+  display: inline-block;
+}
+
+#mapRight {
+  padding-left: 10px;
+  height: 400px;
+  width: 25%;
+  display: inline-block;
+  vertical-align: top;
+}
+
+.my-div-icon {
+  width: 15px;
+  height: 15px;
+  background-color: red;
+  border-radius: 50%;
+}
+
+.file_warning {
+  background-color: #fdf6ec !important;
+  color: #e8a84a !important;
+  font-weight: bold;
+}
+
+.el-form-item .el-form-item-label {
+  display: inline-block;
+  text-align: right;
+  /* 防止文本换行 */
+  white-space: nowrap;
+  /* 隐藏溢出的内容 */
+  overflow: hidden;
+  /* 显示省略符号 */
+  text-overflow: ellipsis;
+}
+
+.content-detail-upload-loading svg {
+  width: 80px;
+  height: 90px;
+}
+
+.content-detail-upload-loading .el-loading-text {
+  font-size: 20px;
+}
+</style>
+
+<style lang="less" scoped>
+/deep/.el-input__inner{
+    color: #000;
+}
+
+</style>

+ 27 - 0
src/main.js

@@ -18,6 +18,33 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
     initApp.component(key, component)
 }
 
+// 添加自定义方法,得到用户类型【1:游客;2:普通用户;3:管理员】
+const getUserType = () => {
+  console.log("=====userInfo==="+JSON.stringify(store.state.userInfo));
+  if (store.state.userInfo && store.state.userInfo.id != null) {
+    // 得到用户id
+    let userId = store.state.userInfo.id;
+    // 得到角色ids
+    let roleIds = store.state.userInfo.roleId;
+    // 得到默认管理员角色id(roleId,在Oauth中配置)
+    let adminRoleId = webConfig.defaultAccount.adminRoleId;
+    if (!store.state.userInfo || !userId || !roleIds) {
+      // 游客
+      return 1;
+    } else if (roleIds.split(",").includes(adminRoleId)) {
+      // 管理员
+      return 3;
+    } else {
+      // 普通用户
+      return 2;
+    }
+  } else {
+    // 游客
+    return 1;
+  }
+};
+initApp.config.globalProperties.$getUserType = getUserType;
+
 // 剪切板
 import useClipboard from 'vue-clipboard3'
 initApp.config.globalProperties.$copyText = function (text) {

+ 21 - 0
src/utils/loading.js

@@ -0,0 +1,21 @@
+import { ElLoading } from 'element-plus';
+
+let loadingInstance;
+
+export const showLoading = (options = {}) => {
+  if (!loadingInstance) {
+    loadingInstance = ElLoading.service({
+      lock: true,
+      text: options.text || '加载中...',
+      background: options.background || 'rgba(0, 0, 0, 0.7)',
+      fullscreen: true,
+    });
+  }
+};
+
+export const hideLoading = () => {
+  if (loadingInstance) {
+    loadingInstance.close();
+    loadingInstance = null;
+  }
+};

+ 1 - 1
src/utils/util.js

@@ -81,5 +81,5 @@ function geojsonToWkt(geojson) {
 export default {
   terminalType,
   isChinese,
-  geojsonToWkt
+  geojsonToWkt,
 }

+ 21 - 4
src/views/IndexView.vue

@@ -51,6 +51,7 @@ import commonAPI from "@/api/common";
 import Map from "@/components/Map.vue";
 import Header from "@/components/Header.vue";
 import DrawMap from "@/components/DrawMap.vue";
+import { showLoading, hideLoading } from "@/utils/loading";
 
 export default {
   name: "IndexView",
@@ -82,8 +83,8 @@ export default {
       const that = this;
       let requestParams = {
         columnId: webConfig.columnArr[0].id,
-        states: 0,
-        orderBy: JSON.stringify([{ field: "create_time", orderByType: 2 }]),
+        states: "0,1,2,3",
+        orderBy: JSON.stringify([{ field: "update_time", orderByType: 2 }]),
         pageSize: 99999,
         page: 0,
       };
@@ -95,6 +96,7 @@ export default {
       //     content: { value: that.searchText },
       //   },
       // ]);
+      showLoading();
       commonAPI.getDmsDataList(requestParams).then((res) => {
         if (res.code == 200){
           let data = res.content.data;
@@ -114,11 +116,18 @@ export default {
           })
           // console.log("data:", data);
           that.dataList = data;
+          // 数据更新后立即刷新表格
+          that.upTableData();
+          hideLoading();
         }else{
           this.$message({ message: '无员工数据', type: 'info' })
+          hideLoading();
         }
       });
     },
+    upTableData(){
+      this.$refs.childRef.upTableData(this.dataList);
+    },
     selectMap(map){
       this.baseMap = map;
       if(map == 'zwb'){
@@ -237,6 +246,7 @@ export default {
             }
           }
         }else{
+          sessionStorage.setItem('guid', "");
           that.$refs.childRef.setTableShow(that.dataList,that.searchText)
         }
     },
@@ -249,16 +259,23 @@ export default {
 <style>
 .el-select__wrapper{
   min-height: 40px !important;
+  background: transparent  !important;
+  /* box-shadow: 0 0 0 1px #01346fe0 inset; */
 }
 .el-select__placeholder{
   color: #fff !important;
 }
-.el-select__wrapper.is-focused{
-  min-height: 40px !important;
+.el-tag.el-tag--info{
+    --el-tag-text-color: #ffffff !important;
 }
+.el-tag.el-tag--info {
+    --el-tag-bg-color: #f3f3f700;
+}
+
 .el-popper.is-light{
   background: #01346fe0 !important;
   border: 1px solid #01346fe0 !important;
+  max-width: none !important;
 }
 .el-select-dropdown__item{
   color: #fff !important;