管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-08 e4c5bd13edea4cf6a1b0f4e825902344b5cb599e
src/views/datamanage/metadataManage.vue
@@ -13,6 +13,21 @@
      >
        <el-form-item>
          <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-cascader
            v-model="queryForm.dirid"
            :show-all-levels="false"
            :options="companyOption"
@@ -27,19 +42,19 @@
          ></el-cascader>
        </el-form-item>
        <el-form-item>
          <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-select
            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
@@ -506,7 +521,8 @@
  sign_getPublicKey,
  meta_selectDownloadFile,
  meta_selectFields,
  meta_selectByPageForUpload
  meta_selectByPageForUpload,
  meta_selectVerByDirid
} from '../../api/api';
import MyBread from '../../components/MyBread.vue';
@@ -535,6 +551,7 @@
      }
    };
    return {
      verOptions: [],
      defaultProps: {
        children: 'children',
        label: 'name',
@@ -556,7 +573,8 @@
      queryForm: {
        name: '',
        dirid: '',
        depid: ''
        depid: '',
        verid: ''
      },
      behavior: '',
      initialForm: '',
@@ -696,9 +714,11 @@
      }
      this.companyOption1 = this.treeData(res.result);
      this.queryForm.depid = this.companyOption1[0].id
      this.getQueryDirTree();
    },
    async getQueryDirTree() {
      const res = await selectdirTab();
      if (res.code != 200) {
@@ -707,13 +727,30 @@
      }
      this.companyOption = this.treeData(res.result);
      this.queryForm.dirid = this.companyOption[0].id
      this.getQueryVerList();
    },
    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();
    },
    verHandleChange(val) {
      this.queryForm.verid = val;
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.getMetaData();
    },
    handleChange(value) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.dirid = value;
      this.getMetaData();
      this.getQueryVerList()
    },
    handleChange1(value) {
      this.listData.pageSize = 10;
@@ -843,6 +880,8 @@
    getMetaData() {
      this.listData.depid = this.queryForm.depid;
      this.listData.dirid = this.queryForm.dirid;
      this.listData.verid = this.queryForm.verid;
      // this.listData.dirid = 57
      select_meta_ByPageAndCount(this.listData).then((res) => {
@@ -865,7 +904,8 @@
      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.getQueryVerList();
      this.getMetaData();
    },
    //新增按钮