管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-25 1a2d7710561c2ca22632ca7dbb1ecae46502ec7e
src/views/datamanage/SpatialData.vue
@@ -1,331 +1,481 @@
<template>
  <div class="authorityManagement_box">
    <My-bread :list="['数据管理', '空间数据']"></My-bread>
  <div class="Spatialbox">
    <My-bread :list="[
        `${$t('dataManage.dataManage')}`,
        `${$t('dataManage.dataRetrieval')}`,
      ]"></My-bread>
    <el-divider />
    <div class="searchComp">
      <el-form ref="ruleForm" :model="ruleForm" :inline="true">
        <el-form-item label="关键字" prop="name">
          <el-input v-model="ruleForm.name" placeholder="请输入" />
        </el-form-item>
        <el-form-item>
          <el-button
            @click="submitForm('ruleForm')"
            icon="el-icon-search"
            type="primary"
            size="small"
            >查询</el-button
          >
          <el-button
            @click="resetForm('ruleForm')"
            icon="el-icon-refresh"
            type="info"
            size="small"
            >重置</el-button
          >
          <el-button
          v-if="btnStatus.delete"
            @click="DelFormData"
            icon="el-icon-delete"
            type="danger"
            size="small"
            >删除</el-button
          >
          <el-button
            v-if="!FBtest"
            @click="testfb()"
            icon="el-icon-position"
            type="success"
            size="small"
            >发布</el-button
          >
          <el-button
            v-else
            @click="testfb()"
            icon="el-icon-position"
            type="success"
            size="small"
            >取消</el-button
          >
        </el-form-item>
        <el-form-item>
          <span v-if="FBtest">
            <i class="dotClass" style="background-color: springgreen"></i>
          </span>
          <span v-else>
            <i class="dotClass" style="background-color: gray"></i>
          </span>
        </el-form-item>
        <el-form-item v-if="FBtest">
          发布地址:http://192.168.20.39/SG/default/streamer.ashx
        </el-form-item>
      </el-form>
    </div>
    <div class="bottom">
      <div class="leftTree">
        <el-tree
          :data="data"
          :props="defaultProps"
          :default-expanded-keys="[1]"
          node-key="id"
          @node-click="handleNodeClick"
        ></el-tree>
    <div class="spatialContent ">
      <div
        class="spatial_leftTree subpage_Div "
        style="border: 1px solid #dcdfe6;"
      >
        <el-input
          v-model="filterText"
          style="width:220px;"
          :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueone')"
          suffix-icon="el-icon-search"
        ></el-input>
        <div style="width:300px">
          <el-tree
            :data="tree"
            :props="defaultProps"
            node-key="id"
            :current-node-key="10"
            @node-click="handleNodeClick"
            :filter-node-method="filterNode"
            ref="tree"
          ></el-tree>
        </div>
      </div>
      <div class="rightTable">
        <div class="table_box">
          <el-table
            ref="filterTable"
            :data="tableData"
            height="99%"
            border
            style="width: 100%"
            @selection-change="handleSelectionChange"
      <div class="contentshuju">
        <div class="contentshujutou">
          <el-form
            ref="ruleForm"
            :model="ruleForm"
            :inline="true"
          >
            <el-table-column type="selection" width="55" />
            <el-table-column width="50" type="index" label="序号" />
            <el-table-column min-width="150" prop="pipename" label="管道名称" />
            <el-table-column
              min-width="150"
              v-if="tableType == '场站点'"
              prop="sitename"
              label="场站名称"
            />
            <el-table-column
              min-width="150"
              v-if="tableType == '场站点'"
              prop="type"
              label="场站类型"
            />
            <el-table-column
              min-width="150"
              v-if="tableType == '管道中心线'"
              prop="seriesname"
              label="站列名称"
            />
            <el-table-column
              min-width="50"
              v-if="tableType == '管道中心线'"
              prop="stationvalue"
              label="站列里程"
            />
            <el-table-column
              min-width="50"
              v-if="tableType == '管道中心线'"
              prop="transportm"
              label="输送介质"
            />
            <el-table-column
              min-width="50"
              v-if="tableType == '管道中心线'"
              prop="diameter"
              label="管径"
            />
            <el-table-column
              min-width="150"
              v-if="tableType == '标桩'"
              prop="name"
              label="标桩名称"
            />
            <el-table-column
              min-width="150"
              v-if="tableType == '标桩'"
              prop="type"
              label="标桩类型"
            />
            <el-form-item>
              <!-- type="textarea" disabled-->
              <el-input
                v-model="ruleForm.fileName"
                class="nm-skin-pretty"
                show-word-limit
                :rows="2"
                resize='none'
                style="width: 220px;"
                :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueone')"
                suffix-icon="el-icon-edit"
              ></el-input>
            </el-form-item>
            <el-form-item style="float: right">
              <el-button
                @click="getSpaceMapVisibale"
                size="small"
                type="primary"
              >{{
              $t('synthesis.rangequery')
            }}</el-button>
            </el-form-item>
            <el-form-item style="float: right">
              <el-button
                @click="resetForm"
                type="info"
                size="small"
                icon="el-icon-refresh"
              >{{$t('common.reset')}}</el-button>
            </el-form-item>
            <el-form-item style="float: right">
              <el-button
                @click="submitForm"
                type="primary"
                size="small"
                icon="el-icon-search"
              >{{$t('common.iquery')}}</el-button>
            </el-form-item>
            <el-form-item style="float: right">
              <el-button
                v-if="btnStatus.insert"
                @click="conditionVisible = true"
                size="small"
                icon="el-icon-plus"
                type="success"
              >{{$t('common.append')}}</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div class="dividing-line"></div>
        <div
          class="table_box"
          style="height:calc(100% - 89px)"
        >
          <!--          border-->
          <!--          ref="filterTable"-->
          <!--          :data="tableData"-->
          <!--          style="width: 100%"-->
          <!--          height="calc(100% - 57px)"-->
          <!--          :header-cell-style="{background:'#e6eaee',color:'#181818', 'text-align': 'center'}  "-->
          <el-table
            :data="tableData"
            style="width: 100%"
            height="calc(100% - 57px)"
          >
            <el-table-column
              min-width="70"
              prop="create_user"
              label="入库人员"
              type="selection"
              width="55"
            />
            <el-table-column
              min-width="100"
              prop="create_time"
              label="入库时间"
              width="60"
              align="center"
              type="index"
              :label="$t('common.index')"
            />
            <el-table-column min-width="80" label="操作">
            <el-table-column
              v-for="(item, index) in attributeData"
              :key="index"
              :label="item.alias"
              :prop="item.field"
              show-overflow-tooltip
              align="center"
            ></el-table-column>
            <el-table-column
              min-width="180"
              :label="$t('common.operate')"
            >
              <template slot-scope="scope">
                <el-link @click="showDetail(scope.$index, scope.row)"
                  >查看</el-link
                >
                <el-link
                  @click="handleEdit(scope.$index, scope.row)"
                  style="margin-left: 10px"
                  >修改</el-link
                >
                <el-button
                  type="primary"
                  plain
                  size="small"
                  @click="showDetail(scope.$index, scope.row)"
                >{{$t('common.details')}}</el-button>
                <el-button
                  plain
                  size="small"
                  @click="getAttachTable(scope.$index, scope.row)"
                  style="margin-left: 20px;  "
                >{{$t('common.enclosure')}}</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div
          style="margin-top: 20px; margin-left: 200px"
          class="pagination_box"
        >
          <el-pagination
            v-if="changePag"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="10"
            layout="total, sizes, prev, pager, next, jumper"
            :total="count"
          >
          </el-pagination>
          <div class="pagination_box">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="listData.pageIndex"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="listData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count"
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </div>
    <div class="infoBox" v-show="showinfoBox">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>详细信息</span>
          <div style="float: right; cursor: pointer" @click="closeDetial">
    <div
      class="infoBox_box"
      v-show="showinfoBox"
    >
      <div class="infoBox box_div">
        <div
          slot="header"
          class="clearfix"
        >
          <span>{{$t('common.details')}}</span>
          <div
            style="float: right; cursor: pointer"
            @click="closeDetial"
          >
            <i class="el-icon-close"></i>
          </div>
          <el-divider></el-divider>
        </div>
        <div class="contentBox">
          <p>管道名称:{{ itemdetail.pipename }}</p>
          <el-divider></el-divider>
          <div v-if="tableType == '场站点'">
            <p>场站名称:{{ itemdetail.sitename }}</p>
            <el-divider></el-divider>
            <p>场站类型:{{ itemdetail.type }}</p>
            <el-divider></el-divider>
          </div>
          <div v-if="tableType == '管道中心线'">
            <p>站列名称:{{ itemdetail.seriesname }}</p>
            <el-divider></el-divider>
            <p>站列里程:{{ itemdetail.stationvalue }}</p>
            <el-divider></el-divider>
            <p>输送介质:{{ itemdetail.transportm }}</p>
            <el-divider></el-divider>
            <p>管径:{{ itemdetail.diameter }}</p>
            <el-divider></el-divider>
          </div>
          <div v-if="tableType == '标桩'">
            <p>标桩名称:{{ itemdetail.name }}</p>
            <el-divider></el-divider>
            <p>标桩类型:{{ itemdetail.type }}</p>
            <el-divider></el-divider>
          </div>
          <p>入库人员:{{ itemdetail.create_user }}</p>
          <el-divider></el-divider>
          <p>入库时间:{{ itemdetail.create_time }}</p>
          <ul>
            <li v-for="(item, index) in itemdetail">
              <p>
                <label> {{ item.label }}:</label>
                <label class="boxlabel">{{ item.value }}</label>
              </p>
              <el-divider></el-divider>
            </li>
          </ul>
        </div>
      </el-card>
      </div>
    </div>
    <el-dialog title="修改详情" :visible.sync="dialogFormVisible">
      <el-form :model="upform">
        <el-form-item label="管道名称" :label-width="formLabelWidth">
          <el-input v-model="upform.pipename" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item
          v-if="tableType == '场站点'"
          label="场站名称"
          :label-width="formLabelWidth"
    <el-dialog
      :title="$t('common.attachinform')"
      top="2vh"
      :visible.sync="dialogFormVisible"
    >
      <div style="height: 500px; overflow: auto">
        <el-form
          :model="formInline"
          class="demo-form-inline"
          label-position="top"
        >
          <el-input v-model="upform.sitename" autocomplete="off"></el-input>
          <el-form-item>
            <el-input
              v-model="formInline.file"
              style="width: 300px; margin-right: 20px"
              :placeholder="$t('common.choose')"
              disabled
            ></el-input>
            <input
              name="file1"
              type="file"
              id="insertFile"
              multiple="multiple"
              style="display: none"
              @change="insertFile( )"
            />
            <el-link
              @click="getInsertFile( )"
              :underline="false"
            ><i class="el-icon-folder-opened"></i></el-link>
          </el-form-item>
          <el-form-item>
            <el-row>
              <el-col :span="3">
                <el-link
                  v-if="btnStatus.insert"
                  class="elLink"
                  :underline="false"
                  @click="setAttachInsert"
                >{{$t('common.append')}}</el-link>
              </el-col>
              <el-col :span="3">
                <el-link
                  v-if="btnStatus.delete"
                  class="elLink"
                  :underline="false"
                  @click="setAttachDel"
                >{{$t('common.delete')}}</el-link>
              </el-col>
              <!-- <el-col :span="3">  <el-link  class="elLink" :underline="false" >{{$t('common.reset')}}</i></el-link></el-col> -->
            </el-row>
          </el-form-item>
          <el-form-item>
            <el-table
              :data="tableAttach"
              ref="filterTable"
              height="100%"
              border
              style="width: 100%"
              @selection-change="handleAttatchChange"
            >
              <el-table-column
                type="selection"
                width="55"
              />
              <el-table-column
                width="60"
                type="index"
                :label="$t('common.index')"
              />
              <el-table-column
                prop="date"
                :label="$t('common.fileNme')"
              />
              <el-table-column
                prop="name"
                :label="$t('common.filePath')"
              />
            </el-table>
          </el-form-item>
          <!-- <el-form-item>
          <el-row :gutter="20">
            <el-col
              :span="12"
              :offset="8"
            >
              <el-button
                type="primary"
                size="small"
                @click="dialogFormVisible = false"
              >确认</el-button>
              <el-button
                type="info"
                size="small"
                @click="dialogFormVisible = false"
              >取消</el-button>
            </el-col>
          </el-row>
        </el-form-item> -->
        </el-form>
      </div>
    </el-dialog>
    <el-dialog
      :visible.sync="conditionVisible"
      title="查询条件"
      :before-close="handleconditionClose"
      width="44%"
    >
      <el-form
        :inline="
      true"
        :model="formSql"
        class="demo-form-inline"
        label-position="top"
      >
        <el-form-item>
          <el-select
            @change="fieldChange($event)"
            v-model="formSql.field"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in filedsOption"
              :key="item.field"
              :label="item.alias"
              :value="item.field"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          v-if="tableType == '场站点'"
          label="场站类型"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.type" autocomplete="off"></el-input>
        <el-form-item>
          <el-select
            :popper-append-to-body="false"
            v-model="formSql.condition"
          >
            <el-option
              v-for="item in condOption"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          v-if="tableType == '管道中心线'"
          label="站列名称"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.seriesname" autocomplete="off"></el-input>
        <el-form-item v-show="!fromSqlflag">
          <el-input v-model="formSql.value"></el-input>
        </el-form-item>
        <el-form-item
          v-if="tableType == '管道中心线'"
          label="站列里程"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.stationvalue" autocomplete="off"></el-input>
        <el-form-item v-show="fromSqlflag">
          <el-date-picker
            v-model="formSql.date"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item
          v-if="tableType == '管道中心线'"
          label="输送介质"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.transportm" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item
          v-if="tableType == '管道中心线'"
          label="管径"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.diameter" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item
          v-if="tableType == '标桩'"
          label="标桩名称"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item
          v-if="tableType == '标桩'"
          label="标桩类型"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.type" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="updateForm">确 定</el-button>
        <el-button @click="dialogFormVisible = false">取 消</el-button>
      <span
        slot="footer"
        class="dialog-footer"
      >
        <el-button
          size="small"
          @click="startFiledAndcondition"
        >取 消</el-button>
        <el-button
          class="primaries"
          size="small"
          @click="appendQueryFilter"
        >确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :title=" $t('synthesis.rangequery')"
      :visible.sync="dialogMapVisible"
      width="90%"
      top="10vh"
      :before-close="handleMapClose"
    >
      <div style="height:700px">
        <map-sdk v-if='showMapVisible'></map-sdk>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import MapSdk from "../../components/mapsdk.vue";
import $ from "jquery";
import { conditions } from "../Archive/Archive.js";
import {
  querySitePointCount,
  querySitePoint,
  queryMarkerCount,
  queryMarker,
  queryStationSeries,
  queryStationSeriesCount,
  UpdateSitePoint,
  UpdateStationSeries,
  UpdatgeMarker,
  dltSitePoint,
  dltStationSeries,
  dltMarker,
  dataQuery_selectTabs,
  dataQuery_selectDomains,
  dataQuery_selectFields,
  dataQuery_selectByPage,
  dataQuery_uploadFiles,
  dataQuery_selectFiles,
  dataQuery_deletes,
} from "../../api/api";
import { getToken } from "../../utils/auth.js";
import catalogueTree from "../../components/catalogueTree.vue";
import MyBread from "../../components/MyBread.vue";
export default {
  //import引入的组件需要注入到对象中才能使用
  name: "dataSearch",
  components: { MyBread, catalogueTree },
  components: { MyBread, catalogueTree, MapSdk },
  data() {
    return {
      data: [
      attachtable: [
        "b_pac_geologic_hazard",
        "b_hydrogeology",
        "b_pac_meteorological",
        "b_pac_marine_meteorological",
        "b_pac_frozensoil",
        "s_borehole",
        "m_marker",
        "m_hydraulic_protection",
        "m_equipment_nameplate",
      ],
      formInline: {
        file: "",
      },
      formSql: {
        field: "",
        condition: "",
        value: "",
        type: "",
        date: "",
      },
      fromSqlflag: false,
      tree: [
        {
          tabDesc: "基础数据",
          label: "基础数据",
          value: "BD",
          ns: "bd",
          id: 1,
          label: "空间入库数据",
          children: [
            {
              label: "场站点",
            },
            {
              label: "管道中心线",
            },
            {
              label: "标桩",
            },
          ],
          children: [],
        },
        {
          id: 2,
          tabDesc: "业务数据",
          label: "业务数据",
          value: "BS",
          ns: "bs",
          children: [],
        },
        {
          id: 3,
          tabDesc: "元数据",
          label: "元数据",
          value: "MD",
          ns: "md",
          children: [],
        },
      ],
      tableAttach: [],
      filedsOption: [],
      condOption: [],
      defaultProps: {
        children: "children",
        label: "label",
      },
      btnStatus: {
        select: false,
        delete: false,
        upload: false,
        download: false,
        insert: false,
        update: false,
      },
      tableType: null,
      ruleForm: {
        fileName: "",
      },
      FBtest: false,
      tableData: [],
      formLabelWidth: "120px",
      dialogFormVisible: false,
      upform: {
@@ -339,86 +489,386 @@
        diameter: "",
        name: "",
      },
      tableType: null,
      defaultProps: {
        children: "children",
        label: "label",
      },
      changePag: true,
      showinfoBox: false,
      itemdetail: {},
      ruleForm: {
        name: "",
      },
      count: 0,
      pageSize: 10,
      pageNum: 1,
      tableData: [],
      attributeData: [],
      currentPage: 1,
      searchName: "",
      multipleSelection: [],
      btnStatus: {
        select: false,
        delete: false,
        upload: false,
        download: false,
        insert: false,
        update: false,
      filedsLayer: null,
      count: 0,
      listData: {
        pageSize: 10,
        pageIndex: 1,
        name: null,
        filter: null,
        wkt: null,
      },
      getClickTable: null,
      attacgSelection: [],
      conditionVisible: false,
      dialogMapVisible: false,
      showMapVisible: false,
      upAttach: {
        tabName: null,
        eventid: null,
      },
      filterText: "",
    };
  },
  created() {
    // this.getSPData(10, 1, "");
    // this.getSPCount("");
    this.showPermsBtn();
    this.getTreeDataAll();
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    },
  },
  methods: {
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    getSpaceMapVisibale() {
      this.dialogMapVisible = true;
      this.showMapVisible = true;
      this.$store.state.mapMenuBoolean = true;
      this.$store.state.mapMenuBoxFlag = "1";
      this.$store.state.mapPopBoolean = false;
      this.$store.state.mapPopBoxFlag = null;
      this.$store.state.download = true;
    },
    handleMapClose() {
      this.$confirm("确认关闭?")
        .then((_) => {
          this.closeMapDown();
        })
        .catch((_) => { });
    },
    closeMapDown() {
      this.dialogMapVisible = false;
      this.showMapVisible = false;
      this.$store.state.mapMenuBoolean = false;
      this.$store.state.mapMenuBoxFlag = null;
      this.$store.state.download = false;
      this.$store.state.mapPopBoolean = false;
      this.$store.state.mapPopBoxFlag = null;
    },
    async setAttachDel() {
      var std = [];
      for (var i in this.attacgSelection) {
        std.push(this.attacgSelection[i].id);
      }
      const res = await dataQuery_deletes({ ids: std.toString() });
      if (res.code != 200) {
        this.$message.error("文件删除失败");
      }
      this.getAttacthFlieList();
    },
    setAttachInsert() {
      var token = getToken();
      var fs = document.getElementById("insertFile");
      if (fs.files.length == 0) {
        this.$message({
          message: "请选择要上传的文件!",
          type: "warning",
        });
        return;
      }
      const formData = new FormData();
      for (var i = 0, c = fs.files.length; i < c; i++) {
        formData.append("file", fs.files[i]); // fs.files[i].name,file
      }
      $.ajax(
        BASE_URL +
        "/dataQuery/uploadFiles?token=" +
        token +
        "&tabName= " +
        this.upAttach.tabName +
        "&eventid=" +
        this.upAttach.eventid,
        {
          type: "post",
          data: formData,
          async: true,
          cache: false,
          processData: false,
          contentType: false,
          success: (rs) => {
            this.$message({
              message: "附件添加成功",
              type: "success",
            });
            document.getElementById("insertFile").value = "";
            this.formInline = {
              file: "",
            };
            this.getAttacthFlieList();
          },
          error: (e) => {
            document.getElementById("insertFile").value = "";
            this.$message.error("附件添加失败");
          },
        }
      );
    },
    async getAttacthFlieList() {
      var obj = this.upAttach;
      const res = await dataQuery_selectFiles(obj);
      if (res.code != 200) {
        this.$message.error("列表调用失败");
        return;
      }
      this.tableAttach = res.result;
    },
    getAttachTable(index, row) {
      if (row.eventid != null) {
        this.upAttach.eventid = row.eventid;
      } else {
        this.upAttach.eventid = "";
      }
      this.getAttacthFlieList();
      this.dialogFormVisible = true;
    },
    //附件=>文件选择
    getInsertFile() {
      $("#insertFile").click();
    },
    insertFile() {
      var val = document.getElementById("insertFile").files;
      if (!val || !val.length) return;
      this.formInline.file = val[0].name;
    },
    //获取目录树数据
    async getTreeDataAll() {
      const data = await dataQuery_selectTabs();
      if (data.code != 200) {
        this.$message.error("列表调用失败");
      }
      var option = data.result;
      for (var i in option) {
        var val_Data = option[i];
        val_Data.id = "1" + i;
        // val_Data.label = val_Data.tabDesc + "(" + val_Data.tab + ")"
        val_Data.label = val_Data.tabDesc;
        option[i].id = parseInt(option[i].id);
        for (var j in this.tree) {
          if (this.tree[j].ns == option[i].ns) {
            this.tree[j].children.push(val_Data);
          }
        }
        // if (option[i].ns == 'bd') {
        //   this.tree[0].children.push(val_Data);
        // } else {
        //   this.tree[1].children.push(val_Data);
        // }
      }
      this.handleNodeClick(this.tree[0].children[0]);
    },
    //授权管理
    showPermsBtn() {
      let currentPerms = this.$store.state.currentPerms;
      let permsEntity = this.$store.state.permsEntity;
      permsEntity
        .filter((item) => item.perms == currentPerms)
        .map((item) => (this.btnStatus[item.tag.substr(1)] = true));
        .map((item) => {
          this.btnStatus[item.tag.substr(1)] = true;
        });
    },
    //树点击事件
    handleNodeClick(data) {
      this.closeDetial();
      this.changePag = false;
      this.tableData = [];
      this.currentPage = 1;
      switch (data.label) {
        case "空间入库数据":
          this.tableType = null;
          // this.$nextTick(() => {
          //   this.changePag = true;
          // });
          break;
        case "场站点":
          this.tableType = "场站点";
          this.getSPData(10, 1, "");
          this.getSPCount("");
          // this.$nextTick(() => {
          //   this.changePag = true;
          // });
          break;
        case "管道中心线":
          this.tableType = "管道中心线";
          this.getSSData(10, 1, "");
          this.getSSCount("");
          // this.$nextTick(() => {
          //   this.changePag = true;
          // });
          break;
        case "标桩":
          this.tableType = "标桩";
          this.getMData(10, 1, "");
          this.getMCount("");
          break;
      }
      this.$nextTick(() => {
        this.changePag = true;
      //判断点击是否为子节点
      if (data.children != null) return;
      this.listData.name = data.entity; //要查询表格类型;
      this.getClickTable = data;
      this.listData.pageIndex = 1;
      this.listData.pageSize = 10;
      this.count = 0;
      this.upAttach.tabName = data.ns + "." + data.tab;
      this.filedsLayer = this.getCollapseDomFiled(); //获取每个表字段名称及阈值
      //获取table信息
      this.getCollapseTable(this.filedsLayer);
    },
    //获取表格信息
    async getCollapseTable(res) {
      res.then((val) => {
        this.attributeData = val;
      });
      if (this.ruleForm.fileName != "") {
        this.listData.filter = this.ruleForm.fileName;
      } else {
        this.listData.filter = null;
      }
      const data = await dataQuery_selectByPage(this.listData);
      if (data.code != 200) {
        this.$message.error("调用列表失败,请联系工作人员!");
        return;
      }
      var res_val = this.attributeData;
      this.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.tableData = data.result;
      this.$refs.filterTable.doLayout();
    },
    //获取每个表字段名称及阈值
    async getCollapseDomFiled() {
      //查询字段信息;
      const fileds = await dataQuery_selectFields({
        name: this.listData.name,
      });
      if (fileds.code != 200) {
        this.$message.error("调用列表失败,请联系工作人员!");
        return;
      }
      //查询阈值信息;
      const domains = await dataQuery_selectDomains({
        name: this.listData.name,
      });
      if (domains.code != 200) {
        this.$message.error("调用列表失败,请联系工作人员!");
        return;
      }
      var data1 = fileds.result;
      var data2 = domains.result;
      var std = [];
      for (var i in data1) {
        if (data1[i].type != 'geometry' && data1[i].type) {
          debugger
          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]);
        }
      }
      this.startFiledAndcondition();
      return std;
    },
    startFiledAndcondition() {
      this.conditionVisible = false;
      this.conditionChange(this.filedsOption[0]);
      this.formSql.value = "";
      this.formSql.date = new Date();
    },
    handleconditionClose() {
      this.$confirm("确认关闭?")
        .then((_) => {
          this.startFiledAndcondition();
        })
        .catch((_) => { });
    },
    fieldChange(value) {
      var obj = {};
      obj = this.filedsOption.find(function (item) {
        return item.field === value;
      });
      this.conditionChange(obj);
    },
    conditionChange(res) {
      this.formSql.field = res.field;
      this.formSql.type = res.type;
      if (res.type == "date" || res.type == "datetime") {
        this.fromSqlflag = true;
      } else {
        this.fromSqlflag = false;
      }
      var std = [];
      this.condOption = [];
      if (res.type == "text" || res.type == "blob") {
        std = conditions[0];
      } else if (res.type == "date" || res.type == "datetime") {
        std = conditions[2];
      } else {
        std = conditions[1];
      }
      for (var i in std) {
        this.condOption.push({
          label: std[i],
          value: std[i],
        });
      }
      this.formSql.condition = this.condOption[0].value;
    },
    appendQueryFilter() {
      if (this.formSql.type == "date" || this.formSql.type == "datetime") {
        if (this.formSql.date == null) {
          this.$message.error("请输入要查询的信息!");
          return;
        }
      } else {
        if (this.formSql.value == "") {
          this.$message.error("请输入要查询的信息!");
          return;
        }
      }
      if (this.ruleForm.fileName != "") {
        this.ruleForm.fileName += " and ";
      }
      var val;
      if (this.formSql.type == "long" || this.formSql.type == "integer") {
        val = parseInt(this.formSql.value);
      } else if (this.formSql.type == "double") {
        if (this.formSql.value.indexOf(".") != -1) {
          val = this.formSql.value;
        } else {
          val = parseFloat(this.formSql.value).toFixed(1);
        }
      } else if (
        this.formSql.type == "date" ||
        this.formSql.type == "datetime"
      ) {
        var time = new Date(this.formSql.date);
        var m = time.getMonth() + 1;
        var d = time.getDate();
        var y = time.getFullYear();
        val = "'" + y + "-" + this.add0(m) + "-" + this.add0(d) + "'";
      } else {
        val = "'" + this.formSql.value + "'";
      }
      this.ruleForm.fileName +=
        this.formSql.field + " " + this.formSql.condition + " " + val;
      this.startFiledAndcondition();
    },
    //值域字段匹配
    getDomainNaFild(res, result) {
      for (var i in result) {
        if (result[i].domName == res) {
          return result[i].codeDesc;
        }
      }
      return null;
    },
    // 请求场站点内容
    getSPData(size, num, name) {
      querySitePoint(size, num, name).then((res) => {
@@ -458,48 +908,31 @@
    },
    // 关键字查询
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.searchName = this.ruleForm.name.trim();
          switch (this.tableType) {
            case "场站点":
              this.getSPData(10, 1, this.searchName);
              this.getSPCount(this.searchName);
              break;
            case "管道中心线":
              this.getSSData(10, 1, this.searchName);
              this.getSSCount(this.searchName);
              break;
            case "标桩":
              this.getMData(10, 1, this.searchName);
              this.getMCount(this.searchName);
              break;
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    submitForm() {
      this.listData.pageIndex = 1;
      this.listData.pageSize = 10;
      //获取table信息
      this.getCollapseTable(this.filedsLayer);
    },
    //分页点击事件
    handleSizeChange(val) {
      this.listData.pageSize = val;
      this.listData.pageIndex = 1;
      //获取table信息
      this.getCollapseTable(this.filedsLayer);
    },
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      //获取table信息
      this.getCollapseTable(this.filedsLayer);
    },
    // 重置查询
    resetForm(formName) {
      this.searchName = "";
      this.$refs[formName].resetFields();
      switch (this.tableType) {
        case "场站点":
          this.getSPData(10, 1, "");
          this.getSPCount("");
          break;
        case "管道中心线":
          this.getSSData(10, 1, "");
          this.getSSCount("");
          break;
        case "标桩":
          this.getMData(10, 1, "");
          this.getMCount("");
          break;
      }
    resetForm() {
      this.ruleForm.fileName = "";
      this.listData.pageIndex = 1;
      this.listData.pageSize = 10;
      //获取table信息
      this.getCollapseTable(this.filedsLayer);
    },
    // 发布按钮
@@ -527,9 +960,18 @@
    },
    // 查看界面
    showDetail(index, row) {
      // console.log(index, row);
      console.log(index, row);
      console.log(this.attributeData);
      this.showinfoBox = true;
      this.itemdetail = row;
      var std = [];
      for (var i in this.attributeData) {
        std.push({
          label: this.attributeData[i].alias,
          value: row[this.attributeData[i].field],
        });
      }
      this.itemdetail = std;
    },
    // 关闭查看
    closeDetial() {
@@ -621,11 +1063,14 @@
          //   this.getMetaCount("");
          // });
        })
        .catch(() => {});
        .catch(() => { });
    },
    // 获取多选选中的对象
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleAttatchChange(val) {
      this.attacgSelection = val;
    },
    // 删除多条
    DelFormData() {
@@ -686,170 +1131,54 @@
          //   });
          // });
        })
        .catch(() => {});
    },
    // 条数修改
    handleSizeChange(val) {
      this.pageSize = val;
      switch (this.tableType) {
        case "空间入库数据":
          break;
        case "场站点":
          this.getSPData(this.pageSize, 1, "");
          this.getSPCount("");
          break;
        case "管道中心线":
          this.getSSData(this.pageSize, 1, "");
          this.getSSCount("");
          break;
        case "标桩":
          this.getMData(this.pageSize, 1, "");
          this.getMCount("");
          break;
      }
    },
    // 页数修改
    handleCurrentChange(val) {
      this.pageNum = val;
      switch (this.tableType) {
        case "空间入库数据":
          break;
        case "场站点":
          this.getSPData(this.pageSize, this.pageNum, "");
          this.getSPCount("");
          break;
        case "管道中心线":
          this.getSSData(this.pageSize, this.pageNum, "");
          this.getSSCount("");
          break;
        case "标桩":
          this.getMData(this.pageSize, this.pageNum, "");
          this.getMCount("");
          break;
      }
        .catch(() => { });
    },
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.authorityManagement_box {
  background: rgb(240, 242, 245);
  border-radius: 10px;
  height: 100%;
.Spatialbox {
  height: 98%;
  width: 98%;
  padding: 1%;
  .spatialContent {
    width: 100%;
    height: calc(100% - 75px);
    padding-top: 10px;
    display: flex;
    justify-content: space-around;
    .spatial_leftTree {
      width: calc(23% - 0px);
      height: 100%;
      padding: 10px;
      border-radius: 5px;
      box-sizing: border-box;
      overflow-y: auto;
    }
    .contentshuju {
      width: 75%;
      height: 100%;
      border-radius: 5px;
      padding: 0px;
      box-sizing: border-box;
      border: 1px solid #dcdfe6;
    }
  }
}
.table_box2 {
  border-radius: 5px;
  padding: 10px;
  box-sizing: border-box;
  .searchComp {
    margin: 10px auto;
    background: #fff;
    border-radius: 5px;
    border: 1px solid rgb(202, 201, 204);
    .el-form-item {
      margin: 5px;
    }
    .el-input {
      width: 467px;
    }
  }
  .bottom {
    width: 100%;
    height: 85%;
    display: flex;
    .leftTree {
      width: 344px;
      background: #f4f8ff;
      border-radius: 10px;
      overflow: auto;
    }
    .rightTable {
      height: 100%;
      width: 77.8%;
      .table_box {
        width: 100%;
        height: 93%;
        margin: 0 auto;
        background: #fff;
        .el-table {
          height: 100%;
        }
        .el-table /deep/ .el-table__header-wrapper tr th {
          background-color: rgb(255, 255, 255) !important;
          color: rgb(0, 0, 0);
        }
        // 修改每行样式:
        .el-table /deep/ .el-table__row {
          background-color: rgba(255, 255, 255) !important;
          color: rgb(0, 0, 0);
        }
        .el-table /deep/ .el-table__body tr.current-row > td {
          background-color: rgb(211, 211, 211) !important;
        }
        .el-table /deep/ .el-table__body tr:hover > td {
          background-color: rgb(211, 211, 211) !important;
        }
        // 修改表格每行边框的样式:
        .el-table /deep/ td,
        .el-table /deep/ th.is-leaf {
          border-bottom: 1px solid #eee;
          border-right: 1px solid #eee;
        }
        .el-table /deep/ .el-table__cell {
          padding: 0;
        }
        // 设置表格每行的高度:
        .el-table /deep/ .el-table__header tr,
        .el-table /deep/ .el-table__header th {
          height: 40px;
        }
        .el-table__body tr,
        .el-table__body td {
          height: 40px;
          padding: 0px;
        }
        // 设置表格边框颜色:
}
        .el-table--border::after,
        .el-table--group::after {
          width: 0;
        }
        .el-table::before {
          height: 0;
        }
      }
    }
  }
  .infoBox {
    width: 500px;
    border: 1px solid #eee;
    position: absolute;
    z-index: 100;
    top: 15%;
    right: 25%;
    background-color: #fff;
    .el-card {
      background-color: transparent;
      span {
        font-size: 16px;
        font-weight: 600;
      }
    }
    .contentBox {
      margin: 0 aotu 10px;
      p {
        // background-color: #bfa;
        // margin-bottom: 10px;
        font-size: 14px;
      }
    }
  }
  .dotClass {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
    margin-top: 15px;
    margin-left: 10px; //这个用于圆点居中
.contentshujutou {
  padding: 8px;
  // margin-top: 10px;
  border-radius: 5px;
  .el-form-item {
    margin: 5px;
  }
}
</style>