管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-18 cbbbc6bd2d854270b9342ce2ff2a3432aaca22cf
src/views/datamanage/metadataManage.vue
@@ -5,14 +5,65 @@
        `${$t('dataManage.metadataManage')}`,
      ]"></My-bread>
    <el-divider />
    <div class="inquire">
    <div class="inquire subpage_Div">
      <el-form
        ref="queryForm"
        :model="queryForm"
        :inline="true"
      >
        <el-form-item>
          <el-cascader
          <el-select
            :popper-append-to-body="false"
            v-model="queryForm.depName"
          >
            <el-option
              :value="queryForm.depcode"
              :label="queryForm.depName"
              style=" height:auto"
            >
              <el-tree
                ref="tree"
                :data="companyOption1"
                node-key="id"
                :props="cascader"
                @node-click="handleChange1"
              />
            </el-option>
          </el-select>
          <!-- <el-cascader
            v-model="queryForm.depid"
            :show-all-levels="false"
            :options="companyOption1"
            @change="handleChange1"
            :props="{
              label: 'name',
              value: 'id',
              children: 'children',
              checkStrictly: true,
              emitPath: false,
            }"
          ></el-cascader> -->
        </el-form-item>
        <el-form-item>
          <el-select
            :popper-append-to-body="false"
            v-model="queryForm.dirName"
          >
            <el-option
              :value="queryForm.dircode"
              :label="queryForm.dirName"
              style=" height:auto"
            >
              <el-tree
                ref="tree"
                :data="companyOption"
                node-key="id"
                :props="cascader"
                @node-click="handleChange"
              />
            </el-option>
          </el-select>
          <!-- <el-cascader
            v-model="queryForm.dirid"
            :show-all-levels="false"
            :options="companyOption"
@@ -24,30 +75,32 @@
              checkStrictly: true,
              emitPath: false,
            }"
          ></el-cascader>
          ></el-cascader> -->
        </el-form-item>
        <el-form-item>
          <el-cascader
            v-model="queryForm.dirid"
            :show-all-levels="false"
            :options="companyOption1"
            @change="handleChange1"
            :props="{
              label: 'name',
              value: 'id',
              children: 'children',
              checkStrictly: true,
              emitPath: false,
            }"
          ></el-cascader>
          <el-select
            :popper-append-to-body="false"
            v-model="queryForm.verid"
            placeholder="请选择"
            @change="verHandleChange($event)"
          >
            <el-option
              v-for="item in verOptions"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="name">
          <el-input
            v-model="queryForm.name"
            :placeholder="$t('common.pleaseInput')"
            style="width:200px"
          />
        </el-form-item>
        <el-form-item>
        <!-- <el-form-item style="float:right">
          <el-button
            @click="queryInfo()"
            icon="el-icon-search"
@@ -55,14 +108,14 @@
            size="small"
          >{{ $t('common.iquery') }}</el-button>
        </el-form-item>
        <el-form-item>
        <el-form-item style="float:right">
          <el-button
            @click="resetInfo('queryForm')"
            icon="el-icon-refresh"
            type="info"
            size="small"
          >{{ $t('common.reset') }}</el-button>
        </el-form-item>
        </el-form-item> -->
        <!-- <el-form-item v-if="btnStatus.insert">
          <el-button
@@ -73,7 +126,7 @@
            >{{ $t('common.append') }}</el-button
          >
        </el-form-item> -->
        <el-form-item v-if="btnStatus.delete">
        <!-- <el-form-item v-if="btnStatus.delete" style="float:right">
          <el-button
            type="danger"
            size="small"
@@ -81,7 +134,45 @@
            icon="el-icon-delete"
          >{{ $t('common.delete') }}</el-button>
        </el-form-item>
        <el-form-item v-if="btnStatus.download">
        <el-form-item v-if="btnStatus.download" style="float:right">
          <el-button
            @click="downFormData"
            icon="el-icon-download"
            type="success"
            size="small"
          >{{ $t('common.download') }}</el-button>
        </el-form-item> -->
        <el-form-item style="float:right">
          <el-button
            @click="resetInfo('queryForm')"
            icon="el-icon-refresh"
            type="info"
            size="small"
          >{{ $t('common.reset') }}</el-button>
        </el-form-item>
        <el-form-item style="float:right">
          <el-button
            @click="queryInfo()"
            icon="el-icon-search"
            class="primary"
            size="small"
          >{{ $t('common.iquery') }}</el-button>
        </el-form-item>
        <el-form-item
          v-if="btnStatus.delete"
          style="float:right"
        >
          <el-button
            type="danger"
            size="small"
            @click="deleteMetaInfo"
            icon="el-icon-delete"
          >{{ $t('common.delete') }}</el-button>
        </el-form-item>
        <el-form-item
          v-if="btnStatus.download"
          style="float:right"
        >
          <el-button
            @click="downFormData"
            icon="el-icon-download"
@@ -92,36 +183,25 @@
      </el-form>
    </div>
    <div class="bottom">
      <!-- <div class="leftTree">
           <el-tree
          ref="tree"
          :props="defaultProps"
          node-key="id"
          :data="optionCount"
          :default-expanded-keys="[1]"
         :current-node-key="1"
          :expand-on-click-node="false"
          :default-expand-all="false"
          draggable
          @node-click="handleNodeClick"
        >
          </span>
        </el-tree>
      </div> -->
      <div class="rightTable">
      <div class="rightTable subpage_Div">
        <div class="table_box">
          <el-table
            :data="tableData"
            style="width: 100%"
            @selection-change="handleSelectionChange"
            height="99%"
            height="95%"
          >
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column
              :label="$t('dataManage.dictionaryManageObj.number')"
              type="index"
              width="50"
            >
            </el-table-column>
            <el-table-column
              prop="name"
              :label="$t('dataManage.vmobj.name')"
@@ -142,8 +222,12 @@
            <el-table-column
              prop="dirName"
              :label="$t('dataManage.vmobj.dirName')"
              width="200"
            />
            <el-table-column
              prop="verName"
              :label="$t('dataManage.vmobj.versionNumber')"
            />
            <el-table-column :label="$t('dataManage.dataUpObj.tableName')">
              <template slot-scope="scope">
                <a @click="detail(scope.row)">{{
@@ -152,14 +236,14 @@
              </template>
            </el-table-column>
            <el-table-column
              prop="gather"
              :label="$t('dataManage.vmobj.gather')"
            <!-- <el-table-column
              prop="tab"
              :label="$t('dataManage.vmobj.tab')"
              :formatter="formatData"
            />
            /> -->
            <el-table-column
              prop="describe"
              :label="$t('dataManage.vmobj.describe')"
              prop="rows"
              :label="$t('dataManage.vmobj.row')"
            />
            <el-table-column
              prop="uname"
@@ -175,22 +259,20 @@
              :label="$t('common.operate')"
            >
              <template slot-scope="scope">
                <el-link
                  style="color: white"
                  @click="showDetail(scope.row)"
                >{{
                <el-link @click="showDetail(scope.row)">{{
                  $t('common.details')
                }}</el-link>
                <el-link
                  v-if="btnStatus.update"
                  @click="editInfo(scope.row)"
                  style="margin-left: 10px; color: white"
                  style="margin-left: 10px; "
                >{{ $t('common.edit') }}</el-link>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div
          style="margin-top: 10px"
          style="margin-top: 0px"
          class="pagination_box"
        >
          <el-pagination
@@ -207,10 +289,10 @@
      </div>
    </div>
    <div
      class="infoBox"
      class="infoBox box_div"
      v-show="showinfoBox"
    >
      <el-card class="box-card">
        <div
          slot="header"
          class="clearfix"
@@ -223,7 +305,11 @@
            <i class="el-icon-close"></i>
          </div>
        </div>
        <div class="contentBox">
          <el-divider></el-divider>
        <div
          class="contentBox"
          style="padding:1%"
        >
          <p>{{ $t('dataManage.vmobj.name') }}:{{ itemdetail.name }}</p>
          <el-divider></el-divider>
          <p>{{ $t('dataManage.vmobj.format') }}:{{ itemdetail.type }}</p>
@@ -233,13 +319,21 @@
          <p>{{ $t('dataManage.vmobj.depName') }}:{{ itemdetail.depName }}</p>
          <el-divider></el-divider>
          <p>
            {{ $t('dataManage.vmobj.gather') }}:{{
              setInfoBoxTime(itemdetail.gather)
            {{ $t('dataManage.vmobj.dirName') }}:{{
              itemdetail.dirName
            }}
          </p>
          <el-divider></el-divider>
          <p>
            {{ $t('dataManage.vmobj.describe') }}:{{ itemdetail.describe }}
            {{ $t('dataManage.vmobj.versionNumber') }}:{{ itemdetail.verName }}
          </p>
          <el-divider></el-divider>
          <p>
            {{ $t('dataManage.vmobj.tab') }}:{{ itemdetail.tab }}
          </p>
          <el-divider></el-divider>
          <p>
            {{ $t('dataManage.vmobj.row') }}:{{ itemdetail.row }}
          </p>
          <el-divider></el-divider>
          <p>
@@ -264,10 +358,10 @@
            }}
          </p>
        </div>
      </el-card>
    </div>
    <el-dialog
      width="510px"
      width="80vh"
      top="5vh"
      :title="
        behavior == '新增用户'
@@ -312,25 +406,61 @@
          :label="$t('dataManage.vmobj.depName')"
          :label-width="formLabelWidth"
        >
          <!-- <el-input v-model="editForm.depName" autocomplete="off"></el-input> -->
          <el-cascader
          <el-select
            style="width:100%"
            :popper-append-to-body="false"
            v-model="editForm.depName"
          >
            <el-option
              :value="editForm.depid"
              :label="editForm.depName"
              style=" height:auto"
            >
              <el-tree
                ref="tree"
                :data="companyOption1"
                node-key="id"
                :props="cascader"
                @node-click="handleChange2"
              />
            </el-option>
          </el-select>
          <!-- <el-cascader
            v-model="editForm.depid"
            :options="companyOption"
            :props="cascader"
            style="width:350px"
          ></el-cascader>
          ></el-cascader> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.dirName')"
          :label-width="formLabelWidth"
        >
          <!-- <el-input v-model="editForm.depName" autocomplete="off"></el-input> -->
          <el-cascader
          <el-select
            style="width:100%"
            :popper-append-to-body="false"
            v-model="editForm.dirName"
          >
            <el-option
              :value="editForm.dirid"
              :label="editForm.dirName"
              style=" height:auto"
            >
              <el-tree
                ref="tree"
                :data="dirComPanyOption"
                node-key="id"
                :props="cascader"
                @node-click="handleChange3"
              />
            </el-option>
          </el-select>
          <!-- <el-cascader
            v-model="editForm.dirid"
            :options="dirComPanyOption"
            :props="cascader"
            style="width:350px"
          ></el-cascader>
          ></el-cascader> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.describe')"
@@ -354,13 +484,13 @@
        class="dialog-footer"
      >
        <el-button
          size="medium"
          size="small"
          @click="cancelEdit()"
        >{{
          $t('common.reset')
        }}</el-button>
        <el-button
          size="medium"
          size="small"
          type="primary"
          @click="sendEdit('editForm')"
          v-loading.fullscreen.lock="fullscreenLoading"
@@ -372,13 +502,13 @@
        class="dialog-footer"
      >
        <el-button
          size="medium"
          size="small"
          @click="cancelAdd('editForm')"
        >{{
          $t('common.reset')
        }}</el-button>
        <el-button
          size="medium"
          size="small"
          type="primary"
          @click="sendAdd('editForm')"
          v-loading.fullscreen.lock="fullscreenLoading"
@@ -421,7 +551,7 @@
            @size-change="handleLoaderSizeChange"
            @current-change="handleLoaderCurrentChange"
            :current-page="listLoader.pageIndex"
            :page-sizes="[10, 20, 30, 40]"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="listLoader.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="count1"
@@ -432,7 +562,7 @@
    </el-dialog>
    <div
      class="downloadBox"
      class="downloadBox box_div  subpage_Div"
      v-if="showCodeBox"
    >
      <h4 style="padding: 20px">{{$t('common.passworld')}}</h4>
@@ -501,7 +631,8 @@
  sign_getPublicKey,
  meta_selectDownloadFile,
  meta_selectFields,
  meta_selectByPageForUpload
  meta_selectByPageForUpload,
  meta_selectVerByDirid
} from '../../api/api';
import MyBread from '../../components/MyBread.vue';
@@ -530,6 +661,7 @@
      }
    };
    return {
      verOptions: [],
      defaultProps: {
        children: 'children',
        label: 'name',
@@ -551,7 +683,8 @@
      queryForm: {
        name: '',
        dirid: '',
        depid: ''
        depid: '',
        verid: ''
      },
      behavior: '',
      initialForm: '',
@@ -606,11 +739,12 @@
  },
  created() {
    this.getSelectDictTab();
    // this.getSelectDictTab();
    this.showPermsBtn();
    this.getQueryDepTree();
    this.getQueryDirTree();
    this.signGetPublicKey();
  },
  methods: {
@@ -645,7 +779,7 @@
        this.$message.error('字段列表调用失败');
        return
      }
      debugger
      var option = data1.result;
      for (var i in option) {
        option[i].dirid = option[i].dirName;
@@ -689,8 +823,12 @@
        return;
      }
      this.companyOption1 = this.treeData(res.result);
      this.queryForm.dirid = this.companyOption1[0].id
      this.queryForm.depcode = this.companyOption1[0].code
      this.queryForm.depName = this.companyOption1[0].name
      this.getQueryDirTree();
    },
    async getQueryDirTree() {
      const res = await selectdirTab();
      if (res.code != 200) {
@@ -698,19 +836,56 @@
        return;
      }
      this.companyOption = this.treeData(res.result);
      this.queryForm.dirid = this.companyOption[0].id
      this.queryForm.dirid = this.companyOption[0].id;
      this.queryForm.dircode = this.companyOption[0].code
      this.queryForm.dirName = this.companyOption[0].name
      this.getQueryVerList();
    },
    handleChange(value) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.dirid = value;
    async getQueryVerList() {
      const data = await meta_selectVerByDirid({ dirid: this.queryForm.dirid })
      if (data.code != 200) {
        this.$message.error('版本列表获取失败');
        return;
      }
      this.verOptions = data.result;
      this.queryForm.verid = data.result[0].id;
      this.getMetaData();
    },
    handleChange1(value) {
    verHandleChange(val) {
      this.queryForm.verid = val;
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.depid = value;
      this.getMetaData();
    },
    handleChange(data, node, nodeData) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.dircode = data.code;
      this.queryForm.dirid = data.id;
      this.queryForm.dirName = data.name
      this.getQueryVerList()
    },
    handleChange1(data, node, nodeData) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.depcode = data.code;
      this.queryForm.depName = data.name
      this.getMetaData();
    },
    handleChange2(data, node, nodeData) {
      this.editForm.depid = data.id;
      this.editForm.depcode = data.code;
      this.editForm.depName = data.name
    },
    handleChange3(data, node, nodeData) {
      this.editForm.dirid = data.id;
      this.editForm.dircode = data.code;
      this.editForm.dirName = data.name
    },
    //格式化列表
    formatData(row, column) {
@@ -778,8 +953,8 @@
      }
      this.optionCount = this.treeData(res.result);
      this.dirComPanyOption = this.treeData(res.result);
      this.listData.dirid = this.optionCount[0].id;
      this.getMetaData();
      this.listData.depcode = this.optionCount[0].code;
    },
    handleNodeClick(data) {
      this.listData.pageSize = 10;
@@ -832,8 +1007,12 @@
    // },
    // 请求数据内容
    getMetaData() {
      this.listData.depid = this.queryForm.depid;
      this.listData.dirid = this.listData.dirid
      this.listData.depcode = this.queryForm.depcode;
      this.listData.dircode = this.queryForm.dircode;
      this.listData.verid = this.queryForm.verid;
      // this.listData.dirid = 57
      select_meta_ByPageAndCount(this.listData).then((res) => {
        this.tableData = res.result;
@@ -854,7 +1033,12 @@
      this.listData.pageIndex = 1;
      this.listData.name = null;
      this.queryForm.dirid = this.companyOption[0].id;
      this.queryForm.depid = this.companyOption1[0].id
      this.queryForm.depid = this.companyOption1[0].id;
      this.queryForm.dircode = this.companyOption[0].code;
      this.queryForm.depcode = this.companyOption1[0].code;
      this.queryForm.dirName = this.companyOption[0].name;
      this.queryForm.depName = this.companyOption1[0].name;
      this.getQueryVerList();
      this.getMetaData();
    },
    //新增按钮
@@ -870,7 +1054,7 @@
    sendAdd(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          console.log(this.editForm);
          this.fullscreenLoading = true;
          insertMeta(this.editForm)
            .then((res) => {
@@ -958,6 +1142,7 @@
      this.behavior = '修改信息';
      this.editForm = JSON.parse(JSON.stringify(row));
      this.dialogFormVisible = true;
      this.getSelectDictTab();
    },
    handleClose(done) {
      this.$confirm('确认关闭?')
@@ -1074,16 +1259,15 @@
<style lang="less" scoped>
//@import url(); 引入公共css类
.authorityManagement_box {
  height: 81%;
  width: 97%;
  position: absolute;
  box-sizing: border-box;
  height: 98%;
  width: 98%;
  padding: 1%;
  .inquire {
    position: relative;
    overflow: auto;
    padding-bottom: 8px;
    border: 1px solid white;
    border-radius: 5px;
    padding: 1%;
    .el-form-item {
@@ -1096,31 +1280,10 @@
    height: 74%;
    display: flex;
    justify-content: space-between;
    .leftTree {
      width: 15%;
      height: 100%;
      border: 1px solid white;
      border-radius: 5px;
      padding: 1%;
      max-height: 670px;
      overflow-y: auto;
      li {
        color: white;
        border-bottom: 1px solid white;
        line-height: 30px;
        text-align: center;
      }
      li:hover {
        background: rgba(255, 255, 255, 0.3);
      }
      .active {
        color: #409eff;
      }
    }
    .rightTable {
      width: 98%;
      height: 100%;
      border: 1px solid white;
      height: 92%;
      border-radius: 5px;
      padding: 1%;
@@ -1129,34 +1292,6 @@
        height: 93%;
        margin: 0 auto;
        overflow: auto;
      }
    }
  }
  .infoBox {
    width: 500px;
    position: absolute;
    z-index: 100;
    top: 10%;
    right: 25%;
    background: #303030;
    color: #fff;
    .el-card {
      background-color: transparent;
      color: #fff;
      span {
        color: #fff;
        font-size: 16px;
        font-weight: 600;
      }
    }
    .contentBox {
      margin: 0 aotu 10px;
      height: 500px;
      overflow: auto;
      p {
        // background-color: #bfa;
        // margin-bottom: 10px;
        font-size: 14px;
      }
    }
  }
@@ -1173,142 +1308,10 @@
    top: 20%;
    left: 40%;
    padding: 20px;
    background: #303030;
    width: 30%;
    border: 1px solid gray;
    border-radius: 10px;
    color: white;
  }
  /*修改table 表体的背景颜色和文字颜色*/
  /deep/ .el-table {
    background-color: transparent;
    th,
    td {
      background-color: transparent;
    }
    .el-table__expanded-cell {
      background-color: transparent !important;
    }
    // 表头背景色
    th.el-table__cell {
      background-color: #303030;
      color: #fff;
    }
    tr > td {
      background-color: #303030;
      color: #fff;
    }
    // hover效果
    tr:hover > td {
      background-color: rgba(255, 255, 255, 0.3) !important;
    }
    tbody tr:hover {
      background-color: rgba(255, 255, 255, 0.3) !important;
      // text-align: center;
    }
    // 滚动条宽高
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      /*滚动条宽度*/
      height: 5px;
      /*滚动条高度*/
    }
    /*定义滚动条轨道 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-track {
      box-shadow: 0px 1px 3px #216fe6 inset;
      /*滚动条的背景区域的内阴影*/
      border-radius: 10px;
    }
    /*定义滑块 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      box-shadow: 0px 1px 3px #216fe6 inset;
      border-radius: 6px;
      background-color: #216fe6;
    }
  }
  /deep/.el-form-item__label {
    color: white;
  }
  // 设置输入框的背景色、字体颜色、边框属性设置;
  /deep/.el-input__inner {
    background-color: transparent !important ;
    color: #fff;
    border: 1px solid;
  }
  /deep/ .el-dialog {
    background: #303030;
  }
  /deep/.el-range-editor.is-active,
  .el-range-editor.is-active:hover,
  .el-select .el-input.is-focus .el-input__inner {
    border: 1px solid;
  }
  /deep/.el-dialog__title {
    color: white;
  }
  /deep/ .el-select .el-input__inner {
    border-color: #fff !important;
  }
  .pagination_box {
    margin-top: 20px;
    /deep/.el-input__inner {
      background-color: transparent !important;
      border: 1px solid;
      color: white;
    }
    /deep/.el-pagination__total {
      color: white;
    }
    /deep/.el-pagination__jump {
      color: white;
    }
    /deep/.el-pager li.active {
      color: #409eff;
    }
    /deep/.el-pager li {
      color: white;
      background: transparent;
    }
    /deep/.el-pager li {
      color: white;
    }
    /deep/.btn-prev {
      background: transparent;
    }
    /deep/.btn-next {
      background: transparent;
    }
    /deep/.btn-next i {
      color: white;
    }
    /deep/.btn-prev i {
      color: white;
    }
  }
  .primary {
    background: #409eff;
    border: #409eff;
    color: white;
  }
}
 /deep/ .el-select .el-input__inner {
    border-color: #fff !important;
  }
  /deep/.el-input__inner {
  background-color: transparent !important ;
  color: #fff;
  border: 1px solid white !important;
}
</style>