管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-03 c609695d14564f0bf4a2b119718400b2a2be037e
属性查询高级查询修改,数据查询工点表属性查询
已修改4个文件
301 ■■■■ 文件已修改
src/assets/css/configure.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuTop.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapSpacePop.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/SpatialData.vue 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/configure.css
@@ -393,4 +393,8 @@
.el-table .el-table__body-wrapper {
    flex: 1;
}
.el-table th.gutter {
    display: table-cell !important;
}
src/components/MapView/mapMenuTop.vue
@@ -294,13 +294,13 @@
      if (data.code != 200) {
        this.$message.error("列表调用失败")
      }
      var val = data.result.filter(res => {
        if (res.rows != 0) {
          return res
        }
      })
      debugger
      // var val = data.result.filter(res => {
      //   if (res.rows != 0) {
      //     return res
      //   }
      // })
      var val = data.result
      var std = [];
      val.filter((item) => {
        if (std.indexOf(item.bak) == -1) {
@@ -308,7 +308,7 @@
          this.layerData.push(
            {
              val: item.bak,
              label: item.tabDesc,
              label: item.bak,
              children: [],
            }
          )
@@ -324,20 +324,6 @@
        })
      })
      // for (var i in option) {
      //   var val_Data = option[i]
      //   val_Data.id = "1" + i
      //   val_Data.label = val_Data.tabDesc
      //   if (option[i].ns == "bd") {
      //     this.layerData[0].children.push(val_Data)
      //   } else {
      //     this.layerData[1].children.push(val_Data)
      //   }
      // }
    },
    //获取选择树的节点
    getCheckedNodes() {
src/components/MapView/mapSpacePop.vue
@@ -194,6 +194,7 @@
      spaceLayer: '',
      imagePoint: null,
      domainsLayer: null,
      querytype: null,
    };
  },
  watch: {
@@ -243,7 +244,7 @@
      this.options = [];
      var std = [];
      this.querytype = obj.type
      if (obj.type == "text" || obj.type == "blob") {
        std = this.conditions[0];
      } else if (obj.type == "date" || obj.type == "datetime") {
@@ -271,6 +272,7 @@
      this.formInline.name = val_date.field;
      this.options = [];
      var std = [];
      this.querytype = val_date.type
      if (val_date.type == "text" || val_date.type == "blob") {
        std = this.conditions[0];
      } else if (val_date.type == "date" || val_date.type == "datetime") {
@@ -337,13 +339,41 @@
      if (this.formInline.input == undefined || this.formInline.input == null) {
        this.listdata.filter = null;
      } else {
        var val;
        var value = this.formInline.input
        if (this.querytype == "long" || this.querytype == "integer") {
          val = parseInt(value);
        } else if (this.querytype == 'double') {
          if (this.formSql.value.indexOf(".") != -1) {
            val = value;
          } else {
            val = parseFloat(value).toFixed(1)
          }
        } else if (querytype == "date" || querytype == "datetime") {
          var time = new Date(value);
          var m = time.getMonth() + 1;
          var d = time.getDate();
          var y = time.getFullYear();
          val = "'" + y +
            '-' +
            this.add0(m) +
            '-' +
            this.add0(d) + "'";
        } else {
          val = "'" + value + "'";
        }
        this.listdata.filter =
          this.formInline.name +
          ' ' +
          this.formInline.region +
          ' ' +
          this.formInline.input;
          this.formInline.name + " " + this.formInline.region + " " + val
      }
      debugger
      const data = await dataQuerySelectByPage(this.listdata);
      if (data.code != 200) {
        this.$message.error('列表调用失败');
@@ -383,6 +413,7 @@
          this.$store.state.primitLayer = null;
        }
        var wkt = this.$wkt.parse(val1);
        this.setMapLoaction(wkt, row);
      }
    },
@@ -402,6 +433,7 @@
        this.$store.state.primitLayer = null;
      }
      var coord = res.coordinates;
      debugger
      if (res.type == 'Point') {
        var val = Cesium.Cartesian3.fromDegrees(
          res.coordinates[0],
@@ -457,12 +489,16 @@
        }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
      } else if (res.type == 'MultiPolygon' || res.type == 'LineString') {
        var val = res.coordinates[0][0];
        var std = [];
        for (var i in val) {
          std.push({ x: val[i][0], y: val[i][1] })
          std.push(val[i][0])
          std.push(val[i][1])
        }
        this.$store.state.primitLayer = Viewer.entities.add({
          polyline: {
            positions: Cesium.Cartesian3.fromDegreesArray(std),
@@ -506,7 +542,6 @@
  border: 1px solid gray;
  float: left;
  .centTable {
    margin-top: 1%;
    position: absolute;
    height: 66%;
    width: 98%;
@@ -524,5 +559,8 @@
    position: absolute;
    bottom: 3%;
  }
  /dep/.el-form-item {
    margin-bottom: 0px;
  }
}
</style>
src/views/datamanage/SpatialData.vue
@@ -132,12 +132,7 @@
              width="20"
              align="center"
            />
            <!--            <el-table-column
              width="60"
              align="center"
              type="index"
              :label="$t('common.index')"
            />-->
            <el-table-column
              min-width="135"
              v-for="(item, index) in attributeData"
@@ -442,13 +437,65 @@
      </div>
    </el-dialog>
    <el-dialog
      :title="attribute.name"
      :title="attribute.title"
      :append-to-body="false"
      :visible.sync="AttributedialogVisible"
      width="70%"
      width="80%"
      :close-on-click-modal="false"
    >
      <div class="attributeBox">
        <div class="attrubuteLeft">
          <ul>
            <li
              v-for="item in attrbuteOption"
              :class="{active:attributeFlag === item.name}"
              @click="setChangeAttrubuteData(item)"
            >
              {{item.name}}
            </li>
          </ul>
        </div>
        <div class="attrubuteRight">
          <el-table
            ref="refAttributeTable"
            :data="attributeTable"
            style="width:100%;"
            border
            height="calc(100% - 50px)"
          >
            <el-table-column
              type="selection"
              align="center"
            />
            <el-table-column
              min-width="135"
              v-for="(item, index) in attributeData"
              :key="index"
              :label="item.alias"
              :prop="item.field"
              show-overflow-tooltip
              align="center"
            ></el-table-column>
          </el-table>
          <div
            class="pagination_box"
            style="margin-top: 10px"
          >
            <el-pagination
              @size-change="attributeSizeChange"
              @current-change="attributeCurrentChange"
              :current-page="attribute.pageIndex"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="attribute.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="attribute.count"
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
@@ -574,7 +621,13 @@
        pageIndex: 1,
        pageSize: 10,
        count: 0,
      }
        title: null
      },
      attrbuteOption: [],
      attributeFlag: null,
      attributeTable: [],
      attributeLayer: null,
      attributeFild: null,
    };
  },
  created() {
@@ -590,10 +643,111 @@
  },
  methods: {
    getAttributeTable(idnex, row) {
      this.attribute.name = row.workname;
      this.AttributedialogVisible = true;
    //分页点击事件
    attributeSizeChange(val) {
      this.attribute.pageSize = val;
      this.attribute.pageIndex = 1;
      //获取table信息
      this.setAttributeTableData(this.attributeLayer);
    },
    attributeCurrentChange(val) {
      this.attribute.pageIndex = val;
      //获取table信息
      this.setAttributeTableData(this.attributeLayer);
    },
    getAttributeTable(idnex, row) {
      this.attribute.title = row.workname;
      this.attrbuteOption = workSite;
      this.AttributedialogVisible = true;
      this.setChangeAttrubuteData(this.attrbuteOption[0])
    },
    setChangeAttrubuteData(res) {
      this.attributeFlag = res.name;
      this.attribute.pageIndex = 1;
      this.attribute.pageSize = 10;
      this.attribute.count = 0;
      this.attributeLayer = res;
      this.setAttributeTableData(res)
    },
    setAttributeTableData(res) {
      var name = res.table.replaceAll("_", "");
      this.attribute.name = name;
      var value = this.getAttributeDomFiled(name)
      this.getAttributeTableData(value, res)
    },
    //获取每个表字段名称及阈值
    async getAttributeDomFiled(res) {
      //查询字段信息;
      const fileds = await dataQuery_selectFields({
        name: res,
      });
      if (fileds.code != 200) {
        this.$message.error("调用列表失败,请联系工作人员!");
        return;
      }
      //查询阈值信息;
      const domains = await dataQuery_selectDomains({
        name: res,
      });
      if (domains.code != 200) {
        this.$message.error("调用列表失败,请联系工作人员!");
        return;
      }
      var data1 = fileds.result;
      var data2 = domains.result;
      var std = [];
      this.filedsOption = [];
      for (var i in data1) {
        if (data1[i].type != 'geometry' && data1[i].type) {
          this.filedsOption.push(data1[i]);
        }
        if (data1[i].showtype == 1) {
          if (data1[i].domainNa != null) {
            data1[i].domainNa = this.getDomainNaFild(data1[i].domainNa, data2);
          }
          std.push(data1[i]);
        }
      }
      return std;
    },
    //获取表格信息
    async getAttributeTableData(res, result) {
      res.then((val) => {
        this.attributeFild = val;
      });
      this.attribute.filter = "workname = " + "'" + this.attribute.title + "'";
      const data = await dataQuery_selectByPage(this.attribute);
      if (data.code != 200) {
        this.$message.error("调用列表失败,请联系工作人员!");
        return;
      }
      this.attributeTable = []
      var res_val = this.attributeFild;
      this.attribute.count = data.count;
      for (var i in data.result) {
        let val_Data = data.result[i];
        for (var j in res_val) {
          if (res_val[j].domainNa != null && res_val[j].domainNa != undefined) {
            val_Data[res_val[j].field] = res_val[j].domainNa;
          }
        }
      }
      this.attributeTable = data.result;
    },
    matchState1(state = "", reg) {
      var row = state.row;
      if (
@@ -800,7 +954,7 @@
          this.tree.push(
            {
              val: item.bak,
              label: item.tabDesc,
              label: item.bak,
              children: [],
            }
          )
@@ -815,6 +969,7 @@
          }
        })
      })
      this.handleNodeClick(this.tree[0].children[0]);
    },
    //授权管理
@@ -1318,6 +1473,38 @@
    width: 100%;
    position: relative;
  }
  .attributeBox {
    height: 63vh;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: space-between;
    .attrubuteLeft {
      width: calc(20% - 20px);
      height: calc(100% - 20px);
      border: 1px solid #dcdfe6;
      border-radius: 5px;
      padding: 10px;
      li {
        border-bottom: 1px solid #dcdfe6;
        line-height: 30px;
        text-align: center;
      }
      li:hover {
        background: rgba(255, 255, 255, 0.3);
        color: #409eff;
      }
      .active {
        color: #409eff;
      }
    }
    .attrubuteRight {
      width: 79%;
      height: 100%;
      border: 1px solid #dcdfe6;
      border-radius: 5px;
    }
  }
}
.table_box2 {