瀏覽代碼

bug 修改

wandequan 3 年之前
父節點
當前提交
c6052cc741

二進制
src/assets/images/layerZJImage/fujianZJ.png


二進制
src/assets/images/layerZJImage/fujianZJ_back.png


二進制
src/assets/images/layerZJImage/jiekouZJ.png


二進制
src/assets/images/layerZJImage/jiekouZJ_back.png


+ 1 - 0
src/components/Currency/DataTable/MetadataListContainer.vue

@@ -69,6 +69,7 @@
       v-bind="{
         isShow: isShowAddSingleDataDialog,
         edit: true,
+        type: 1,
         title: '增加内容',
         beforeClose: beforeCloseAddSingleDataDialog,
         updateData: searchData,

+ 1 - 0
src/components/Currency/DataTable/MetadataListContainer/MetadataList.vue

@@ -4,6 +4,7 @@
       v-bind="{
         isShow: isShowAddSingleDataDialog,
         edit: edit,
+        type: 2,
         title: title,
         beforeClose: beforeCloseAddSingleDataDialog,
         updateData: updateData,

+ 162 - 54
src/components/Currency/DataTable/MetadataListContainer/SingleData.vue

@@ -1,16 +1,37 @@
 <template>
-  <el-dialog :class="'singleDataDialog'" :visible.sync="isShow" width="700px" top="7%" :close-on-click-modal="false"
-    :before-close="dialogBeforeClose">
-    <el-form :model="fromDataRender" class="singledata" ref="single_form" label-width="80px" :rules="rules">
+  <el-dialog
+    :class="'singleDataDialog'"
+    :visible.sync="isShow"
+    width="700px"
+    top="7%"
+    :close-on-click-modal="false"
+    :before-close="dialogBeforeClose"
+  >
+    <el-form
+      :model="fromDataRender"
+      class="singledata"
+      ref="single_form"
+      label-width="80px"
+      :rules="rules"
+    >
       <el-row>
         <el-col :span="11">
           <el-form-item label="名称" prop="title">
-            <el-input v-model="fromDataRender.title" :readonly="!edit" maxlength="20" show-word-limit></el-input>
+            <el-input
+              v-model="fromDataRender.title"
+              :readonly="!edit"
+              maxlength="20"
+              show-word-limit
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="11">
           <el-form-item label="行政区划编码" prop="areaCode">
-            <el-input v-model="fromDataRender.areaCode" :readonly="!edit" show-word-limit></el-input>
+            <el-input
+              v-model="fromDataRender.areaCode"
+              :readonly="!edit"
+              show-word-limit
+            ></el-input>
           </el-form-item>
         </el-col>
         <!-- <el-col :span="11">
@@ -34,55 +55,95 @@
       <el-row>
         <el-col :span="11">
           <el-form-item label="第三方ID" prop="threeId">
-            <el-input v-model="fromDataRender.threeId" :readonly="!edit" show-word-limit></el-input>
+            <el-input
+              v-model="fromDataRender.threeId"
+              :readonly="!edit"
+              show-word-limit
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="11">
           <el-form-item label="第三方表名" prop="tableName">
-            <el-input v-model="fromDataRender.tableName" :readonly="!edit" show-word-limit></el-input>
+            <el-input
+              v-model="fromDataRender.tableName"
+              :readonly="!edit"
+              show-word-limit
+            ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="11">
           <el-form-item label="中心经度" prop="centerLon">
-            <el-input v-model="fromDataRender.centerLon" :readonly="!edit"></el-input>
+            <el-input
+              v-model="fromDataRender.centerLon"
+              type="number"
+              :readonly="!edit"
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="11">
           <el-form-item label="中心纬度" prop="centerLat">
-            <el-input v-model="fromDataRender.centerLat" :readonly="!edit"></el-input>
+            <el-input
+              v-model="fromDataRender.centerLat"
+              type="number"
+              :readonly="!edit"
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="2">
-          <el-button v-if="edit" :style="{
-            fontSize: '23px',
-            padding: '7px',
-            float: 'right',
-          }" :title="'中心点修改'" @click="openCenterLocation(fromDataRender)" icon="el-icon-location-outline">
+          <el-button
+            v-if="edit"
+            :style="{
+              fontSize: '23px',
+              padding: '7px',
+              float: 'right',
+            }"
+            :title="'中心点修改'"
+            @click="openCenterLocation(fromDataRender)"
+            icon="el-icon-location-outline"
+          >
           </el-button>
         </el-col>
       </el-row>
+      <el-row style="margin-bottom: 10px; color: #c9c9c9; padding-left: 100px">
+        注:中心经度,中心纬度仅可输入数字
+      </el-row>
       <el-row v-if="modelParams.geotype != 0">
         <el-col :span="22">
           <el-form-item label="点集">
             <!-- :readonly="!edit" -->
-            <el-input v-model="fromDataRender.locations" readonly="false" disabled="false"></el-input>
+            <el-input
+              v-model="fromDataRender.locations"
+              readonly="false"
+              disabled="false"
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="2">
-          <el-button v-if="edit" :style="{
-            fontSize: '23px',
-            padding: '7px',
-            float: 'right',
-          }" :title="'点集修改'" @click="openGeometryLocation(fromDataRender)" icon="el-icon-edit">
+          <el-button
+            v-if="edit"
+            :style="{
+              fontSize: '23px',
+              padding: '7px',
+              float: 'right',
+            }"
+            :title="'点集修改'"
+            @click="openGeometryLocation(fromDataRender)"
+            icon="el-icon-edit"
+          >
           </el-button>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="22">
           <el-form-item label="描述" prop="content">
-            <el-input v-model="fromDataRender.content" :readonly="!edit" maxlength="100" show-word-limit></el-input>
+            <el-input
+              v-model="fromDataRender.content"
+              :readonly="!edit"
+              maxlength="100"
+              show-word-limit
+            ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
@@ -101,30 +162,56 @@
         </el-form-item>
       </el-row>-->
       <el-row>
-        <el-button type="text" style="float: right" @click="changeAdvancedOptionsStatue()">
+        <el-button
+          type="text"
+          style="float: right"
+          @click="changeAdvancedOptionsStatue()"
+        >
           高级选项
-          <i v-show="!advancedOptionsShow" class="el-icon-caret-bottom el-icon--right"></i>
-          <i v-show="advancedOptionsShow" class="el-icon-caret-top el-icon--right"></i>
+          <i
+            v-show="!advancedOptionsShow"
+            class="el-icon-caret-bottom el-icon--right"
+          ></i>
+          <i
+            v-show="advancedOptionsShow"
+            class="el-icon-caret-top el-icon--right"
+          ></i>
         </el-button>
         <!-- el-icon-caret-bottom -->
         <!-- el-icon-caret-top -->
       </el-row>
       <!-- 高级选项 table -->
       <div v-if="advancedOptionsShow">
-        <el-table :data="listData" :class="['advanceOptionsTable']" max-height="250">
+        <el-table
+          :data="listData"
+          :class="['advanceOptionsTable']"
+          max-height="250"
+        >
           <el-table-column label="名称">
             <template slot-scope="scope">
-              <el-input placeholder="例:建筑金额" v-model="scope.row.name" :readonly="!edit"></el-input>
+              <el-input
+                placeholder="例:建筑金额"
+                v-model="scope.row.name"
+                :readonly="!edit"
+              ></el-input>
             </template>
           </el-table-column>
           <el-table-column label="内容">
             <template slot-scope="scope">
-              <el-input placeholder="例:14" v-model="scope.row.value" :readonly="!edit"></el-input>
+              <el-input
+                placeholder="例:14"
+                v-model="scope.row.value"
+                :readonly="!edit"
+              ></el-input>
             </template>
           </el-table-column>
           <el-table-column label="单位">
             <template slot-scope="scope">
-              <el-input placeholder="例:万元" v-model="scope.row.unit" :readonly="!edit"></el-input>
+              <el-input
+                placeholder="例:万元"
+                v-model="scope.row.unit"
+                :readonly="!edit"
+              ></el-input>
             </template>
           </el-table-column>
 
@@ -135,7 +222,10 @@
               </el-button>
             </template>
             <template slot-scope="scope">
-              <el-button size="mini" @click="deleteAdvancedOptionsRow(scope.$index, scope)">
+              <el-button
+                size="mini"
+                @click="deleteAdvancedOptionsRow(scope.$index, scope)"
+              >
                 <i class="el-icon-minus"></i>
               </el-button>
             </template>
@@ -145,22 +235,28 @@
       <!-- 高级选项 table end -->
     </el-form>
     <!-- centerPoint: centerPoint, -->
-    <CenterLocation1 v-if="isShowUpdateCenterDialog" v-bind="{
-      isShow: isShowUpdateCenterDialog,
-      title: '中心点修改',
-      centerPoint: centerPoint,
-      beforeClose: beforeCloseUpdateCenterDialog,
-      updateData: updateDataCenterLocation,
-    }"></CenterLocation1>
+    <CenterLocation1
+      v-if="isShowUpdateCenterDialog"
+      v-bind="{
+        isShow: isShowUpdateCenterDialog,
+        title: '中心点修改',
+        centerPoint: centerPoint,
+        beforeClose: beforeCloseUpdateCenterDialog,
+        updateData: updateDataCenterLocation,
+      }"
+    ></CenterLocation1>
 
-    <CenterLocation2 v-if="isShowUpdateGeometryDialog" v-bind="{
-      isShow: isShowUpdateGeometryDialog,
-      title: '点集',
-      geometry: geometry,
-      drawType: modelParams.geotype,
-      beforeClose: beforeCloseUpdateGeometryDialog,
-      updateData: updateDataGeometryLocation,
-    }"></CenterLocation2>
+    <CenterLocation2
+      v-if="isShowUpdateGeometryDialog"
+      v-bind="{
+        isShow: isShowUpdateGeometryDialog,
+        title: '点集',
+        geometry: geometry,
+        drawType: modelParams.geotype,
+        beforeClose: beforeCloseUpdateGeometryDialog,
+        updateData: updateDataGeometryLocation,
+      }"
+    ></CenterLocation2>
 
     <span slot="title" class="dialog-title">
       <div class="title">
@@ -190,6 +286,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    type: {
+      type: Number,
+      default: 1, //1 新增 2 修改
+    },
     title: {
       type: String,
       default: "",
@@ -290,12 +390,12 @@ export default {
 
         centerLon: [
           { required: true, message: "请填写中心点经度", trigger: "blur" },
-          { validator: checkLon, trigger: 'blur' }
+          { validator: checkLon, trigger: "blur" },
           // { type: "number", message: "中心经度必须数字值" },
         ],
         centerLat: [
           { required: true, message: "请填写中心点纬度", trigger: "blur" },
-          { validator: checkLat, trigger: 'blur' }
+          { validator: checkLat, trigger: "blur" },
           // { type: "number", message: "中心纬度必须数字值" },
         ],
         threeId: [
@@ -335,7 +435,7 @@ export default {
       this.$refs["single_form"].validate((valid) => {
         if (valid) {
           let data;
-          if (that.modelParams) {
+          if (that.type == 1) {
             data = Object.assign({}, that.fromDataRender, that.modelParams);
             data.jsonStr = JSON.stringify(that.listData);
             if (data.type == 0)
@@ -363,7 +463,7 @@ export default {
     addSingleData(data) {
       let that = this;
       // 上传loading
-      const loading = this.$createLoading("数据新增中,请勿刷新!")
+      const loading = this.$createLoading("数据新增中,请勿刷新!");
       api
         .addSingleData(data)
         .then((result) => {
@@ -392,7 +492,7 @@ export default {
     updateSingleData(data) {
       let that = this;
       // 上传loading
-      const loading = this.$createLoading("数据更新中,请勿刷新!")
+      const loading = this.$createLoading("数据更新中,请勿刷新!");
       api
         .updateSingleData(data)
         .then((result) => {
@@ -452,10 +552,9 @@ export default {
       } else {
         that.$message({
           type: "warning",
-          message: "当前坐标有误,请正确填写后查看或修改位置"
-        })
+          message: "当前坐标有误,请正确填写后查看或修改位置",
+        });
       }
-
     },
 
     // 更新 中心点
@@ -477,7 +576,7 @@ export default {
 
     // 更新 点集
     updateDataGeometryLocation(item) {
-      this.fromDataRender.locations = item
+      this.fromDataRender.locations = item;
     },
 
     // 关闭 点集修改
@@ -565,7 +664,9 @@ export default {
     margin-top: 20px;
   }
 
-  /deep/ .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before {
+  /deep/
+    .el-form-item.is-required:not(.is-no-asterisk)
+    > .el-form-item__label:before {
     content: " ";
     width: 0px;
     margin-right: 0px;
@@ -576,5 +677,12 @@ export default {
     color: #3f9dfe;
     font-size: 150%;
   }
+  ::v-deep input::-webkit-outer-spin-button,
+  ::v-deep input::-webkit-inner-spin-button {
+    -webkit-appearance: none !important;
+  }
+  ::v-deep input[type="number"] {
+    -moz-appearance: textfield !important;
+  }
 }
 </style>

+ 2 - 2
src/components/Currency/ListContainer.vue

@@ -26,8 +26,8 @@
                     <el-col v-for="(item_, index_) in listField" :key="index_" :span="item_.span">
                         <div
                             v-if="item_.name.toLowerCase().indexOf('time') >= 0"
-                            :title="transDateFormat(item[item_.name], 'yyyy-MM-DD hh:mm:ss')"
-                        >{{ transDateFormat(item[item_.name], 'yyyy-MM-DD hh:mm:ss') }}</div>
+                            :title="transDateFormat(item[item_.name], 'yyyy-MM-DD HH:mm:ss')"
+                        >{{ transDateFormat(item[item_.name], 'yyyy-MM-DD HH:mm:ss') }}</div>
                         <!-- <div
                             v-else-if="item_.name.toLowerCase().indexOf('request') >= 0"
                             :title="item[item_.name]"

+ 9 - 6
src/components/DataDisplay/LayerDisplay/Buffer.vue

@@ -32,14 +32,17 @@
           </el-col>
         </el-row>
       </div>
-      <div class="result" v-show="resultArr.length > 0">
+      <div class="result" v-if="resultArr != null">
         <div class="title">
-          共
+          当前
           <span>{{ resultArr.length }}</span>
           个地点
         </div>
         <div class="content">
-          <ul>
+          <ul v-if="resultArr.length == 0">
+            <li>暂无数据</li>
+          </ul>
+          <ul v-else>
             <li
               v-for="(item, index) in resultArr"
               :key="index"
@@ -92,7 +95,7 @@ export default {
       drawCompleted: false,
       centerPoint: null,
       circleGeojson: null,
-      resultArr: [],
+      resultArr: null,
     };
   },
   mounted() {},
@@ -212,7 +215,7 @@ export default {
     reset() {
       this.radius = 5;
       this.resetLayer();
-      this.resultArr = [];
+      this.resultArr = null;
       this.clearFocusSource();
     },
     // 重置图层
@@ -250,7 +253,7 @@ export default {
     close() {
       this.radius = 5;
       this.resetLayer();
-      this.resultArr = [];
+      this.resultArr = null;
       this.closeCallback();
       this.clearFocusSource();
       this.removeFocusLayer();

+ 19 - 13
src/components/DataLayer/Icon.vue

@@ -188,19 +188,25 @@ export default {
           that.beforeClose();
         });
       } else {
-        setInitImg(obj.url, (file) => {
-          let filedata = new FormData();
-          filedata.append("file", file);
-          filedata.append("id", obj.id);
-          filedata.append("type", obj.type);
-          filedata.append("iconName", obj.name);
-          that.updateIconFunc(filedata).then(() => {
-            that.typeList = [];
-            that.value = "";
-            that.upload_file = null;
-            that.beforeClose();
-          });
-        });
+        let type = obj.url.split(".")[obj.url.split(".").length - 1];
+        type = type == "jpg" ? "jpeg" : type;
+        setInitImg(
+          obj.url,
+          (file) => {
+            let filedata = new FormData();
+            filedata.append("file", file);
+            filedata.append("id", obj.id);
+            filedata.append("type", obj.type);
+            filedata.append("iconName", obj.name);
+            that.updateIconFunc(filedata).then(() => {
+              that.typeList = [];
+              that.value = "";
+              that.upload_file = null;
+              that.beforeClose();
+            });
+          },
+          type
+        );
       }
     },
   },

+ 15 - 3
src/components/DataLayer/IconLibraryManagement.vue

@@ -109,13 +109,17 @@ export default {
     addNewIcon(params) {
       let that = this;
       // 添加图标后更新列表 getIcon()
-      const loading = this.$createLoading("图标上传增加中,请稍后!")
+      const loading = this.$createLoading("图标上传增加中,请稍后!");
       return new Promise((resolve, reject) => {
         iconApi
           .addNewIcon(params)
           .then((result) => {
             loading.close();
             if (result.code == 200) {
+              that.$message({
+                type: "success",
+                message: "图标上传增加成功!",
+              });
               getIcon(); // icon 更新
               resolve();
             } else {
@@ -142,12 +146,16 @@ export default {
       })
         .then(() => {
           // 调用删除图标接口 更新列表 getIcon()
-          const loading = that.$createLoading("图标删除中,请稍后!")
+          const loading = that.$createLoading("图标删除中,请稍后!");
           iconApi
             .delIcon({ id: item.id })
             .then((result) => {
               loading.close();
               if (result.code == 200) {
+                that.$message({
+                  type: "success",
+                  message: "图标删除成功!",
+                });
                 getIcon(); // icon 更新
               } else {
                 that.$checkRequestCode(result);
@@ -171,13 +179,17 @@ export default {
     updateIcon(params) {
       let that = this;
       // 更新图标后更新列表 getIcon()
-      const loading = this.$createLoading("图标信息更新中,请稍后!")
+      const loading = this.$createLoading("图标信息更新中,请稍后!");
       return new Promise((resolve, reject) => {
         iconApi
           .updateIcon(params)
           .then((result) => {
             loading.close();
             if (result.code == 200) {
+              that.$message({
+                type: "success",
+                message: "图标信息更新成功!",
+              });
               getIcon(); // icon 更新
               resolve();
             } else {

+ 6 - 4
src/components/DataLayer/LayerDetail.vue

@@ -103,6 +103,7 @@
               v-model="fromDataRender.geometryType"
               placeholder="请选择"
               :readonly="!edit"
+              :disabled="!edit"
             >
               <el-option
                 v-for="item in geoTypeArr"
@@ -125,6 +126,7 @@
           >
             <el-color-picker
               v-model="fromDataRender.fillColor"
+              :disabled="!edit"
               color-format="hex"
             ></el-color-picker>
           </el-form-item>
@@ -269,10 +271,10 @@ export default {
           name: "点",
           value: "Point",
         },
-        {
-          name: "线",
-          value: "LineString",
-        },
+        // {
+        //   name: "线",
+        //   value: "LineString",
+        // },
         // {
         //   name: "面",
         //   value: "Polygon",

+ 71 - 32
src/components/DataQualityInspection/Process/ExcelQualityInspection.vue

@@ -1,7 +1,9 @@
 <template>
   <el-container>
     <el-row class="header">
-      <el-button type="primary" @click="addRules">添加规则</el-button>
+      <el-button type="primary" @click="addRules"
+        >增加数据完整性检查项</el-button
+      >
     </el-row>
 
     <div class="ruleContent" ref="ruleContent">
@@ -12,7 +14,7 @@
         :max-height="tableMaxHeight"
         style="width: 100%"
       >
-        <el-table-column prop="index" label="序号" width="50" align="center">
+        <el-table-column type="index" label="序号" width="50" align="center">
         </el-table-column>
         <el-table-column
           prop="name"
@@ -66,13 +68,49 @@
             <el-input v-else v-model="scope.row.fieldName"></el-input>
           </template>
         </el-table-column>
+        <el-table-column label="操作" width="50" align="center">
+          <template slot-scope="scope">
+            <el-popover
+              v-if="scope.row.type == 'dataIntegrality'"
+              placement="top-end"
+              width="160"
+              trigger="hover"
+              :ref="`popover-${scope.$index}`"
+            >
+              <p style="padding: 10px 0">确定要删除此检查项吗?</p>
+              <div style="text-align: right; margin: 0">
+                <el-button
+                  size="mini"
+                  type="text"
+                  @click="
+                    scope._self.$refs[`popover-${scope.$index}`].doClose()
+                  "
+                >
+                  取消
+                </el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click="deleteRules(scope.$index, scope.row, scope)"
+                >
+                  确定
+                </el-button>
+              </div>
+              <el-button
+                slot="reference"
+                icon="el-icon-delete iconfont"
+                :style="{ color: '#999999' }"
+                size="mini"
+                :title="'删除'"
+                circle
+              ></el-button>
+            </el-popover>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
 
     <el-row>
-      <!-- <el-button class="uploadbtn" type="primary" @click="uploadFile">
-        上传文件
-      </el-button> -->
       <el-upload
         class="uploadbtn"
         ref="upload"
@@ -83,9 +121,9 @@
         :limit="1"
         :before-upload="uploadFile"
       >
-        <el-button type="primary" class="add-item" @click="beforeUploadFile"
-          >上传文件</el-button
-        >
+        <el-button type="primary" class="add-item" @click="beforeUploadFile">
+          上传文件
+        </el-button>
       </el-upload>
     </el-row>
   </el-container>
@@ -99,7 +137,6 @@ export default {
     return {
       tableMaxHeight: 450,
       defaultField: {
-        index: 1,
         isCheck: 1,
         checkContent: "数据完整性",
         checkDescribe:
@@ -110,7 +147,6 @@ export default {
       },
       checkDefaultDetail: [
         {
-          index: 1,
           isCheck: 1,
           checkContent: "数据完整性",
           checkDescribe:
@@ -120,7 +156,6 @@ export default {
           type: "dataIntegrality",
         },
         {
-          index: 2,
           isCheck: 1,
           checkContent: "省级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字的行政区划编码',
@@ -129,7 +164,6 @@ export default {
           type: "provinceCode",
         },
         {
-          index: 3,
           isCheck: 1,
           checkContent: "市级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字且至少4位的行政区划编码',
@@ -138,7 +172,6 @@ export default {
           delBtn: false,
         },
         {
-          index: 4,
           isCheck: 1,
           checkContent: "县级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字且至少6位的行政区划编码',
@@ -147,7 +180,6 @@ export default {
           delBtn: false,
         },
         {
-          index: 5,
           isCheck: 1,
           checkContent: "经纬度验证",
           checkDescribe: "经纬度是否在河北省境内",
@@ -170,7 +202,6 @@ export default {
           ],
         },
         {
-          index: 6,
           isCheck: 1,
           checkContent: "行政区划+经纬度验证",
           checkDescribe:
@@ -231,10 +262,11 @@ export default {
     addRules() {
       let obj = JSON.parse(JSON.stringify(this.defaultField));
       this.checkDetail.unshift(obj);
-      this.checkDetail = this.checkDetail.map(function (item, index) {
-        item.index = index + 1;
-        return item;
-      });
+      this.checkDetail = JSON.parse(JSON.stringify(this.checkDetail));
+    },
+    deleteRules(index, data, scope) {
+      scope._self.$refs["popover-" + scope.$index].doClose();
+      this.checkDetail.splice(index, 1);
     },
     beforeUploadFile(e) {
       let that = this;
@@ -246,13 +278,17 @@ export default {
             if (!param.children) {
               switch (param.type) {
                 case "dataIntegrality":
-                  if (that.webMessage(param.fieldName, param.checkContent))
+                  if (
+                    that.webMessage(param.fieldName.trim(), param.checkContent)
+                  )
                     return false;
                   break;
                 case "provinceCode":
                 case "cityCode":
                 case "countyCode":
-                  if (that.webMessage(param.fieldName, param.checkContent))
+                  if (
+                    that.webMessage(param.fieldName.trim(), param.checkContent)
+                  )
                     return false;
                   break;
                 default:
@@ -262,29 +298,29 @@ export default {
               switch (param.type) {
                 case "latlon":
                   let judge1 = that.webMessage(
-                    param.children[0].fieldName,
+                    param.children[0].fieldName.trim(),
                     param.checkContent
                   );
                   if (judge1) return false;
                   let judge2 = that.webMessage(
-                    param.children[1].fieldName,
+                    param.children[1].fieldName.trim(),
                     param.checkContent
                   );
                   if (judge2) return false;
                   break;
                 case "areaLatlon":
                   let judge3 = that.webMessage(
-                    param.children[0].fieldName,
+                    param.children[0].fieldName.trim(),
                     param.checkContent
                   );
                   if (judge3) return false;
                   let judge4 = that.webMessage(
-                    param.children[1].fieldName,
+                    param.children[1].fieldName.trim(),
                     param.checkContent
                   );
                   if (judge4) return false;
                   let judge5 = that.webMessage(
-                    param.children[2].fieldName,
+                    param.children[2].fieldName.trim(),
                     param.checkContent
                   );
                   if (judge5) return false;
@@ -308,12 +344,12 @@ export default {
           if (!param.children) {
             switch (param.type) {
               case "dataIntegrality":
-                completeArr.push(param.fieldName);
+                completeArr.push(param.fieldName.trim());
                 break;
               case "provinceCode":
               case "cityCode":
               case "countyCode":
-                obj.append(param.type, param.fieldName);
+                obj.append(param.type, param.fieldName.trim());
                 break;
               default:
                 break;
@@ -330,14 +366,17 @@ export default {
                   //     param.children[1].fieldName,
                   //   ],
                   // }
-                  [param.children[0].fieldName, param.children[1].fieldName]
+                  [
+                    param.children[0].fieldName.trim(),
+                    param.children[1].fieldName.trim(),
+                  ]
                 );
                 break;
               case "areaLatlon":
                 obj.append(param.type, [
-                  param.children[0].fieldName,
-                  param.children[1].fieldName,
-                  param.children[2].fieldName,
+                  param.children[0].fieldName.trim(),
+                  param.children[1].fieldName.trim(),
+                  param.children[2].fieldName.trim(),
                 ]);
                 break;
               default:

+ 162 - 29
src/components/DataQualityInspection/Process/GeojsonQualityInspection.vue

@@ -1,7 +1,9 @@
 <template>
   <el-container>
     <el-row class="header">
-      <el-button type="primary" @click="addRules">添加规则</el-button>
+      <el-button type="primary" @click="addRules">
+        增加数据完整性检查项
+      </el-button>
     </el-row>
 
     <div class="ruleContent" ref="ruleContent">
@@ -12,7 +14,7 @@
         :max-height="tableMaxHeight"
         style="width: 100%"
       >
-        <el-table-column prop="index" label="序号" width="50" align="center">
+        <el-table-column type="index" label="序号" width="50" align="center">
         </el-table-column>
         <el-table-column
           prop="name"
@@ -66,6 +68,45 @@
             <el-input v-else v-model="scope.row.fieldName"></el-input>
           </template>
         </el-table-column>
+        <el-table-column label="操作" width="50" align="center">
+          <template slot-scope="scope">
+            <el-popover
+              v-if="scope.row.type == 'dataIntegrality'"
+              placement="top-end"
+              width="160"
+              trigger="hover"
+              :ref="`popover-${scope.$index}`"
+            >
+              <p style="padding: 10px 0">确定要删除此检查项吗?</p>
+              <div style="text-align: right; margin: 0">
+                <el-button
+                  size="mini"
+                  type="text"
+                  @click="
+                    scope._self.$refs[`popover-${scope.$index}`].doClose()
+                  "
+                >
+                  取消
+                </el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click="deleteRules(scope.$index, scope.row, scope)"
+                >
+                  确定
+                </el-button>
+              </div>
+              <el-button
+                slot="reference"
+                icon="el-icon-delete iconfont"
+                :style="{ color: '#999999' }"
+                size="mini"
+                :title="'删除'"
+                circle
+              ></el-button>
+            </el-popover>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
 
@@ -83,7 +124,9 @@
         :limit="1"
         :before-upload="uploadFile"
       >
-        <el-button type="primary" class="add-item">上传文件</el-button>
+        <el-button type="primary" class="add-item" @click="beforeUploadFile">
+          上传文件
+        </el-button>
       </el-upload>
     </el-row>
   </el-container>
@@ -97,7 +140,6 @@ export default {
     return {
       tableMaxHeight: 450,
       defaultField: {
-        index: 1,
         isCheck: 1,
         checkContent: "数据完整性",
         checkDescribe:
@@ -108,7 +150,6 @@ export default {
       },
       checkDefaultDetail: [
         {
-          index: 1,
           isCheck: 1,
           checkContent: "数据完整性",
           checkDescribe:
@@ -118,7 +159,6 @@ export default {
           type: "dataIntegrality",
         },
         {
-          index: 2,
           isCheck: 1,
           checkContent: "省级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字的行政区划编码',
@@ -127,7 +167,6 @@ export default {
           type: "provinceCode",
         },
         {
-          index: 3,
           isCheck: 1,
           checkContent: "市级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字且至少4位的行政区划编码',
@@ -136,7 +175,6 @@ export default {
           delBtn: false,
         },
         {
-          index: 4,
           isCheck: 1,
           checkContent: "县级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字且至少6位的行政区划编码',
@@ -145,7 +183,6 @@ export default {
           delBtn: false,
         },
         {
-          index: 5,
           isCheck: 1,
           checkContent: "经纬度验证",
           checkDescribe: "经纬度是否在河北省境内",
@@ -168,7 +205,6 @@ export default {
           ],
         },
         {
-          index: 6,
           isCheck: 1,
           checkContent: "行政区划+经纬度验证",
           checkDescribe:
@@ -229,14 +265,98 @@ export default {
     addRules() {
       let obj = JSON.parse(JSON.stringify(this.defaultField));
       this.checkDetail.unshift(obj);
-      this.checkDetail = this.checkDetail.map(function (item, index) {
-        item.index = index + 1;
-        return item;
-      });
+      this.checkDetail = JSON.parse(JSON.stringify(this.checkDetail));
+    },
+    deleteRules(index, data, scope) {
+      scope._self.$refs["popover-" + scope.$index].doClose();
+      this.checkDetail.splice(index, 1);
+    },
+    beforeUploadFile(e) {
+      let that = this;
+      if (!jy()) e.stopPropagation();
+      function jy() {
+        for (let i = 0; i < that.checkDetail.length; i++) {
+          let param = that.checkDetail[i];
+          if (param.isCheck) {
+            if (!param.children) {
+              switch (param.type) {
+                case "dataIntegrality":
+                  if (
+                    that.webMessage(param.fieldName.trim(), param.checkContent)
+                  )
+                    return false;
+                  break;
+                case "provinceCode":
+                case "cityCode":
+                case "countyCode":
+                  if (
+                    that.webMessage(param.fieldName.trim(), param.checkContent)
+                  )
+                    return false;
+                  break;
+                default:
+                  break;
+              }
+            } else {
+              switch (param.type) {
+                case "latlon":
+                  let str1 = param.children[0].fieldName.trim();
+                  let str2 = param.children[1].fieldName.trim();
+                  if (
+                    (str1 == "" && str2 == "") ||
+                    (str1 != "" && str2 != "")
+                  ) {
+                  } else {
+                    let judge1 = that.webMessage(
+                      param.children[0].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge1) return false;
+                    let judge2 = that.webMessage(
+                      param.children[1].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge2) return false;
+                  }
+
+                  break;
+                case "areaLatlon":
+                  let judge3 = that.webMessage(
+                    param.children[0].fieldName.trim(),
+                    param.checkContent
+                  );
+                  if (judge3) return false;
+
+                  let str4 = param.children[1].fieldName.trim();
+                  let str5 = param.children[2].fieldName.trim();
+                  if (
+                    (str4 == "" && str4 == "") ||
+                    (str5 != "" && str5 != "")
+                  ) {
+                  } else {
+                    let judge4 = that.webMessage(
+                      param.children[1].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge4) return false;
+                    let judge5 = that.webMessage(
+                      param.children[2].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge5) return false;
+                  }
+                  break;
+                default:
+                  break;
+              }
+            }
+          }
+        }
+        return true;
+      }
     },
     uploadFile(file) {
       let that = this;
-      // let ceshiObj = {};
       let obj = new FormData();
       let completeArr = [];
       for (let i = 0; i < this.checkDetail.length; i++) {
@@ -245,32 +365,45 @@ export default {
           if (!param.children) {
             switch (param.type) {
               case "dataIntegrality":
-                if (that.webMessage(param.fieldName, param.checkContent))
-                  return;
                 completeArr.push(param.fieldName);
                 break;
               default:
-                if (that.webMessage(param.fieldName, param.checkContent))
-                  return;
-                obj.append(param.type, param.fieldName);
-                // ceshiObj[param.type] = param.fieldName;
+                obj.append(param.type, param.fieldName.trim());
                 break;
             }
           } else {
-            let arr = [];
-            for (let k = 0; k < param.children.length; k++) {
-              const item = param.children[k];
-              if (that.webMessage(item.fieldName, item.checkContent)) return;
-              arr.push(item.fieldName);
+            switch (param.type) {
+              case "latlon":
+                obj.append(
+                  param.type,
+                  // {
+                  //   check: true,
+                  //   lonlat: [
+                  //     param.children[0].fieldName,
+                  //     param.children[1].fieldName,
+                  //   ],
+                  // }
+                  [
+                    param.children[0].fieldName.trim(),
+                    param.children[1].fieldName.trim(),
+                  ]
+                );
+                break;
+              case "areaLatlon":
+                obj.append(param.type, [
+                  param.children[0].fieldName.trim(),
+                  param.children[1].fieldName.trim(),
+                  param.children[2].fieldName.trim(),
+                ]);
+                break;
+              default:
+                break;
             }
-            obj.append(param.type, arr);
-            // ceshiObj[param.type] = arr;
           }
         }
       }
       if (completeArr.length > 0) {
         obj.append("dataIntegrality", completeArr);
-        // ceshiObj["dataIntegrality"] = completeArr;
       }
       const loading = this.$createLoading("数据质检中,请稍后!");
       obj.append("file", file);

+ 167 - 33
src/components/DataQualityInspection/Process/ShapefileQualityInspection.vue

@@ -1,7 +1,9 @@
 <template>
   <el-container>
     <el-row class="header">
-      <el-button type="primary" @click="addRules">添加规则</el-button>
+      <el-button type="primary" @click="addRules">
+        增加数据完整性检查项
+      </el-button>
     </el-row>
 
     <div class="ruleContent" ref="ruleContent">
@@ -12,7 +14,7 @@
         :max-height="tableMaxHeight"
         style="width: 100%"
       >
-        <el-table-column prop="index" label="序号" width="50" align="center">
+        <el-table-column type="index" label="序号" width="50" align="center">
         </el-table-column>
         <el-table-column
           prop="name"
@@ -66,13 +68,49 @@
             <el-input v-else v-model="scope.row.fieldName"></el-input>
           </template>
         </el-table-column>
+        <el-table-column label="操作" width="50" align="center">
+          <template slot-scope="scope">
+            <el-popover
+              v-if="scope.row.type == 'dataIntegrality'"
+              placement="top-end"
+              width="160"
+              trigger="hover"
+              :ref="`popover-${scope.$index}`"
+            >
+              <p style="padding: 10px 0">确定要删除此检查项吗?</p>
+              <div style="text-align: right; margin: 0">
+                <el-button
+                  size="mini"
+                  type="text"
+                  @click="
+                    scope._self.$refs[`popover-${scope.$index}`].doClose()
+                  "
+                >
+                  取消
+                </el-button>
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click="deleteRules(scope.$index, scope.row, scope)"
+                >
+                  确定
+                </el-button>
+              </div>
+              <el-button
+                slot="reference"
+                icon="el-icon-delete iconfont"
+                :style="{ color: '#999999' }"
+                size="mini"
+                :title="'删除'"
+                circle
+              ></el-button>
+            </el-popover>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
 
     <el-row>
-      <!-- <el-button class="uploadbtn" type="primary" @click="uploadFile">
-        上传文件
-      </el-button> -->
       <el-upload
         class="uploadbtn"
         ref="upload"
@@ -83,7 +121,9 @@
         :limit="1"
         :before-upload="uploadFile"
       >
-        <el-button type="primary" class="add-item">上传文件</el-button>
+        <el-button type="primary" class="add-item" @click="beforeUploadFile">
+          上传文件
+        </el-button>
       </el-upload>
     </el-row>
   </el-container>
@@ -97,7 +137,6 @@ export default {
     return {
       tableMaxHeight: 450,
       defaultField: {
-        index: 1,
         isCheck: 1,
         checkContent: "数据完整性",
         checkDescribe:
@@ -108,7 +147,6 @@ export default {
       },
       checkDefaultDetail: [
         {
-          index: 1,
           isCheck: 1,
           checkContent: "数据完整性",
           checkDescribe:
@@ -118,7 +156,6 @@ export default {
           type: "dataIntegrality",
         },
         {
-          index: 2,
           isCheck: 1,
           checkContent: "省级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字的行政区划编码',
@@ -127,7 +164,6 @@ export default {
           type: "provinceCode",
         },
         {
-          index: 3,
           isCheck: 1,
           checkContent: "市级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字且至少4位的行政区划编码',
@@ -136,7 +172,6 @@ export default {
           delBtn: false,
         },
         {
-          index: 4,
           isCheck: 1,
           checkContent: "县级行政区划编码检查",
           checkDescribe: '验证是否是以"13"开头的纯数字且至少6位的行政区划编码',
@@ -145,7 +180,6 @@ export default {
           delBtn: false,
         },
         {
-          index: 5,
           isCheck: 1,
           checkContent: "经纬度验证",
           checkDescribe: "经纬度是否在河北省境内",
@@ -168,7 +202,6 @@ export default {
           ],
         },
         {
-          index: 6,
           isCheck: 1,
           checkContent: "行政区划+经纬度验证",
           checkDescribe:
@@ -229,14 +262,98 @@ export default {
     addRules() {
       let obj = JSON.parse(JSON.stringify(this.defaultField));
       this.checkDetail.unshift(obj);
-      this.checkDetail = this.checkDetail.map(function (item, index) {
-        item.index = index + 1;
-        return item;
-      });
+      this.checkDetail = JSON.parse(JSON.stringify(this.checkDetail));
+    },
+    deleteRules(index, data, scope) {
+      scope._self.$refs["popover-" + scope.$index].doClose();
+      this.checkDetail.splice(index, 1);
+    },
+    beforeUploadFile(e) {
+      let that = this;
+      if (!jy()) e.stopPropagation();
+      function jy() {
+        for (let i = 0; i < that.checkDetail.length; i++) {
+          let param = that.checkDetail[i];
+          if (param.isCheck) {
+            if (!param.children) {
+              switch (param.type) {
+                case "dataIntegrality":
+                  if (
+                    that.webMessage(param.fieldName.trim(), param.checkContent)
+                  )
+                    return false;
+                  break;
+                case "provinceCode":
+                case "cityCode":
+                case "countyCode":
+                  if (
+                    that.webMessage(param.fieldName.trim(), param.checkContent)
+                  )
+                    return false;
+                  break;
+                default:
+                  break;
+              }
+            } else {
+              switch (param.type) {
+                case "latlon":
+                  let str1 = param.children[0].fieldName.trim();
+                  let str2 = param.children[1].fieldName.trim();
+                  if (
+                    (str1 == "" && str2 == "") ||
+                    (str1 != "" && str2 != "")
+                  ) {
+                  } else {
+                    let judge1 = that.webMessage(
+                      param.children[0].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge1) return false;
+                    let judge2 = that.webMessage(
+                      param.children[1].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge2) return false;
+                  }
+
+                  break;
+                case "areaLatlon":
+                  let judge3 = that.webMessage(
+                    param.children[0].fieldName.trim(),
+                    param.checkContent
+                  );
+                  if (judge3) return false;
+
+                  let str4 = param.children[1].fieldName.trim();
+                  let str5 = param.children[2].fieldName.trim();
+                  if (
+                    (str4 == "" && str4 == "") ||
+                    (str5 != "" && str5 != "")
+                  ) {
+                  } else {
+                    let judge4 = that.webMessage(
+                      param.children[1].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge4) return false;
+                    let judge5 = that.webMessage(
+                      param.children[2].fieldName.trim(),
+                      param.checkContent
+                    );
+                    if (judge5) return false;
+                  }
+                  break;
+                default:
+                  break;
+              }
+            }
+          }
+        }
+        return true;
+      }
     },
     uploadFile(file) {
       let that = this;
-      // let ceshiObj = {};
       let obj = new FormData();
       let completeArr = [];
       for (let i = 0; i < this.checkDetail.length; i++) {
@@ -245,32 +362,49 @@ export default {
           if (!param.children) {
             switch (param.type) {
               case "dataIntegrality":
-                if (that.webMessage(param.fieldName, param.checkContent))
-                  return;
-                completeArr.push(param.fieldName);
+                completeArr.push(param.fieldName.trim());
+                break;
+              case "provinceCode":
+              case "cityCode":
+              case "countyCode":
+                obj.append(param.type, param.fieldName.trim());
                 break;
               default:
-                if (that.webMessage(param.fieldName, param.checkContent))
-                  return;
-                obj.append(param.type, param.fieldName);
-                // ceshiObj[param.type] = param.fieldName;
                 break;
             }
           } else {
-            let arr = [];
-            for (let k = 0; k < param.children.length; k++) {
-              const item = param.children[k];
-              if (that.webMessage(item.fieldName, item.checkContent)) return;
-              arr.push(item.fieldName);
+            switch (param.type) {
+              case "latlon":
+                obj.append(
+                  param.type,
+                  // {
+                  //   check: true,
+                  //   lonlat: [
+                  //     param.children[0].fieldName,
+                  //     param.children[1].fieldName,
+                  //   ],
+                  // }
+                  [
+                    param.children[0].fieldName.trim(),
+                    param.children[1].fieldName.trim(),
+                  ]
+                );
+                break;
+              case "areaLatlon":
+                obj.append(param.type, [
+                  param.children[0].fieldName.trim(),
+                  param.children[1].fieldName.trim(),
+                  param.children[2].fieldName.trim(),
+                ]);
+                break;
+              default:
+                break;
             }
-            obj.append(param.type, arr);
-            // ceshiObj[param.type] = arr;
           }
         }
       }
       if (completeArr.length > 0) {
         obj.append("dataIntegrality", completeArr);
-        // ceshiObj["dataIntegrality"] = completeArr;
       }
       obj.append("file", file);
       const loading = this.$createLoading("数据质检中,请稍后!");

+ 9 - 7
src/utils/imgUrlToFile.js

@@ -1,9 +1,9 @@
-function setInitImg(url, callback) {
+function setInitImg(url, callback, imgType) {
     let img = url;//这里是淘宝上随便找的一张图片
     let _ = this
     let imgRes
-    getBase64(img, (dataURL) => {
-        imgRes = dataURLtoFile(dataURL, img);
+    getBase64(img, imgType, (dataURL) => {
+        imgRes = dataURLtoFile(dataURL, img, imgType);
         // console.log(imgRes)
         callback(imgRes)
     });
@@ -18,7 +18,9 @@ function buildGuid() {
         text += possible.charAt(Math.floor(Math.random() * possible.length));
     return mar + "_" + new Date().getTime().toString() + text;
 }
-function getBase64(url, callback) {
+function getBase64(url, imgType, callback) {
+    let type = "png"
+    if (imgType) type = imgType
     //通过构造函数来创建的 img 实例,在赋予 src 值后就会立刻下载图片,相比 createElement() 创建 <img> 省去了 append(),也就避免了文档冗余和污染
     var Img = new Image(),
         dataURL = "";
@@ -32,12 +34,12 @@ function getBase64(url, callback) {
         canvas.width = width;
         canvas.height = height;
         canvas.getContext("2d").drawImage(Img, 0, 0, width, height); //将图片绘制到canvas中
-        dataURL = canvas.toDataURL("image/png"); //转换图片为dataURL
+        dataURL = canvas.toDataURL("image/" + type); //转换图片为dataURL
         callback ? callback(dataURL) : null; //调用回调函数
     };
 }
 
-function dataURLtoFile(dataurl, filename) {
+function dataURLtoFile(dataurl, filename, imgType) {
     //将base64转换为文件,dataurl为base64字符串,filename为文件名(必须带后缀名,如.jpg,.png)
     var arr = dataurl.split(","),
         mime = arr[0].match(/:(.*?);/)[1],
@@ -47,7 +49,7 @@ function dataURLtoFile(dataurl, filename) {
     while (n--) {
         u8arr[n] = bstr.charCodeAt(n);
     }
-    return new File([u8arr], buildGuid() + ".png", { type: mime });
+    return new File([u8arr], buildGuid() + "." + imgType, { type: mime });
 }
 
 export {