管道基础大数据平台系统开发-【前端】-新系統界面
王旭
2023-05-11 0f03522d5a541c26875c1279ba5b18ef59e933fe
src/views/datamanage/versionManage.vue
@@ -11,12 +11,13 @@
      <el-form ref="ruleForm" :model="ruleForm" :inline="true">
        <div class="flex_box">
          <div style="margin-right: auto">
            <el-form-item>
            <el-form-item size="small">
              <el-select
                :popper-append-to-body="false"
                v-model="ruleForm.dirid"
                placeholder="请选择"
                placeholder="请选择存储目录"
                style="width: 200px"
                ref="treeSelect"
              >
                <el-option
                  :value="ruleForm.dirid"
@@ -46,11 +47,17 @@
            }"
            ></el-cascader> -->
            </el-form-item>
            <el-form-item>
            <el-form-item size="small">
              <el-input
                v-model="ruleForm.name"
                :placeholder="$t('common.pleaseInput')"
              />
                :placeholder="$t('shuJuGuanLi.lable5')"
                ><i
                  slot="suffix"
                  class="el-icon-search"
                  @click="onSubmit('ruleForm')"
                  style="padding-right: 8px"
                ></i
              ></el-input>
            </el-form-item>
          </div>
          <div>
@@ -63,13 +70,13 @@
                size="small"
                >{{ $t("common.append") }}</el-button
              >
              <el-button
              <!--              <el-button
                @click="onSubmit('ruleForm')"
                icon="el-icon-search"
                size="small"
                class="primary"
                >{{ $t("common.iquery") }}</el-button
              >
              >-->
              <el-button
                type="info"
                @click="resetForm('ruleForm')"
@@ -83,10 +90,12 @@
      </el-form>
    </div>
    <div class="dividing-line"></div>
    <div class="table_box" :style="styleVar">
      <el-table
        :data="tableData"
        style="width: 100%"
        border
        height="calc(100% - 57px)"
      >
        <el-table-column
@@ -157,12 +166,12 @@
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination_box">
      <div class="pagination_box" style="margin-top: 15px">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-sizes="[10, 50, 100, 200]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
@@ -174,64 +183,64 @@
    <el-dialog
      :title="$t('dataManage.vmobj.editVersion')"
      :visible.sync="dialogFormVisible"
      top="2vh"
      :before-close="handleClose"
    >
        <div style="height: 500px; overflow: auto">
      <el-form :model="upform" label-position="top">
        <el-form-item
          :label="$t('dataManage.vmobj.name')"
          :label-width="formLabelWidth"
        >
          <el-input
            v-model="upform.name"
            autocomplete="off"
             style="width:85%"
          ></el-input>
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.catalogue')"
          :label-width="formLabelWidth"
        >
          <el-select
            :popper-append-to-body="false"
            v-model="upform.dirid"
            placeholder="请选择"
             style="width:85%"
      <div style="height: 500px; overflow: auto">
        <el-form :model="upform" label-position="top">
          <el-form-item
            :label="$t('dataManage.vmobj.name')"
            :label-width="formLabelWidth"
          >
            <el-option
              :value="upform.dirid"
              :label="upform.depName"
              style="height: auto"
            <el-input
              v-model="upform.name"
              autocomplete="off"
              style="width: 85%"
            ></el-input>
          </el-form-item>
          <el-form-item
            :label="$t('dataManage.vmobj.catalogue')"
            :label-width="formLabelWidth"
          >
            <el-select
              :popper-append-to-body="false"
              v-model="upform.dirid"
              :placeholder="$t('shuJuGuanLi.pselect.select')"
              style="width: 85%"
            >
              <el-tree
                ref="tree"
                :data="editcatalogOption"
                node-key="id"
                :props="props"
                @node-click="handlupCatalogChange"
              />
            </el-option>
          </el-select>
          <!-- <el-cascader
              <el-option
                :value="upform.dirid"
                :label="upform.depName"
                style="height: auto"
              >
                <el-tree
                  ref="tree"
                  :data="editcatalogOption"
                  node-key="id"
                  :props="props"
                  @node-click="handlupCatalogChange"
                />
              </el-option>
            </el-select>
            <!-- <el-cascader
            style="width: 300px"
            v-model="upform.dirid"
            :options="editcatalogOption"
            @change="upCatalogChange"
            :props="cascader"
          ></el-cascader> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.describe')"
          :label-width="formLabelWidth"
        >
          <el-input
            v-model="upform.descr"
            autocomplete="off"
             style="width:85%"
          ></el-input>
        </el-form-item>
      </el-form>
        </div>
          </el-form-item>
          <el-form-item
            :label="$t('dataManage.vmobj.describe')"
            :label-width="formLabelWidth"
          >
            <el-input
              v-model="upform.descr"
              autocomplete="off"
              style="width: 85%"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" type="info" class="dialog-footer">
        <el-button size="small" @click="editFromDataClose">{{
          $t("common.close")
@@ -245,65 +254,67 @@
    <el-dialog
      :title="$t('dataManage.vmobj.addVersion')"
      :visible.sync="InsertFormdialog"
       top="2vh"
      :before-close="handleCloseadd"
    >
    <div style="height: 500px; overflow: auto">
      <el-form :model="insertform" label-position="top">
        <el-form-item
          :label="$t('dataManage.vmobj.name')"
          :label-width="formLabelWidth"
        >
          <el-input
             style="width:85%"
            v-model="insertform.name"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.catalogue')"
          :label-width="formLabelWidth"
        >
          <el-select
            :popper-append-to-body="false"
            v-model="insertform.path"
            placeholder="请选择"
            style="width:85%"
      <div style="height: 500px; overflow: auto">
        <el-form :model="insertform" label-position="top">
          <el-form-item
            :label="$t('dataManage.vmobj.name')"
            :label-width="formLabelWidth"
          >
            <el-option
              :value="insertform.path"
              :label="insertform.dirName"
              style="height: auto"
            <el-input
              style="width: 85%"
              v-model="insertform.name"
              autocomplete="off"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueName1')"
            ></el-input>
          </el-form-item>
          <el-form-item
            :label="$t('dataManage.vmobj.catalogue')"
            :label-width="formLabelWidth"
          >
            <el-select
              :popper-append-to-body="false"
              v-model="insertform.dirName"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedirectory')"
              style="width: 85%"
            >
              <el-tree
                ref="tree"
                :data="editcatalogOption"
                node-key="id"
                :props="props"
                @node-click="catalogChangeAdd"
              />
            </el-option>
          </el-select>
          <!-- <el-cascader
              <el-option
                :value="insertform.path"
                :label="insertform.dirName"
                style="height: auto"
              >
                <el-tree
                  ref="tree"
                  :data="editcatalogOption"
                  node-key="id"
                  :props="props"
                  @node-click="catalogChangeAdd"
                />
              </el-option>
            </el-select>
            <!-- <el-cascader
            style="width: 300px"
            v-model="insertform.path"
            :options="catalogOption"
            @change="catalogChange"
            :props="cascader"
          ></el-cascader> -->
        </el-form-item>
          </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.describe')"
          :label-width="formLabelWidth"
        >
          <el-input
             style="width:85%"
            v-model="insertform.descr"
            autocomplete="off"
          ></el-input>
        </el-form-item>
      </el-form>
    </div>
          <el-form-item
            :label="$t('dataManage.vmobj.describe')"
            :label-width="formLabelWidth"
          >
            <el-input
              style="width: 85%"
              v-model="insertform.descr"
              autocomplete="off"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedescription')"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="insertFromDataClose" type="info" size="small">{{
          $t("common.close")
@@ -432,7 +443,9 @@
      itemdetail: {},
      upform: {},
      ruleForm: {},
      insertform: {},
      insertform: {
        name: "",
      },
      tableData: [],
      companyOption: [],
      count: 0,
@@ -470,7 +483,7 @@
    this.getQueryDirTree();
    this.getRoleTabelData();
    this.showPermsBtn();
    this.$set(this.ruleForm, "depName", "请选择");
    this.$set(this.ruleForm, "depName", "请选择存储目录");
  },
  computed: {
    pathId() {
@@ -496,7 +509,7 @@
      this.$nextTick(() => {
        const rect = this.$refs.container.getBoundingClientRect();
        this.tableHeight = `${rect.height + 97}px`;
        this.styleVar["height"] = `calc(100% - ${rect.height + 97}px)`;
        this.styleVar["height"] = `calc(100% - ${rect.height + 28}px)`;
      });
    },
    //目录切换
@@ -504,7 +517,9 @@
      this.insertform.dirid = value;
    },
    catalogChangeAdd(data, node, nodeData) {
      this.$set(this.insertform, "path", data.id);
      this.insertform.path = data.id;
      this.insertform.dirid = data.id;
      // this.$set(this.insertform, "path", data.id);
      this.$set(this.insertform, "dirName", data.name);
    },
    upCatalogChange(val) {
@@ -524,7 +539,7 @@
        return;
      }
      this.companyOption = this.treeData(res.result);
      this.ruleForm.dirid = this.companyOption[0].id;
      // this.ruleForm.dirid = this.companyOption[0].id;
    },
    handleChange(data, node, nodeData) {
      this.$set(this.ruleForm, "dirid", data.id);
@@ -546,9 +561,9 @@
        return;
      }
      this.insertform.name = this.getYMD();
      this.insertform.path = 1;
      this.insertform.dirid = 1;
      this.upform.dirid == 1;
      // this.insertform.path = 1;
      // this.insertform.dirid = 1;
      // this.upform.dirid == 1;
      this.catalogOption = this.treeData(res.result);
      this.editcatalogOption = this.treeData(res.result);
    },
@@ -582,7 +597,7 @@
    },
    resetForm() {
      this.ruleForm = {};
      this.ruleForm.dirid = this.companyOption[0].id;
      // this.ruleForm.dirid = this.companyOption[0].id;
      this.$store.state.verCateNode = {};
      this.$bus.$emit("clearTressLabel", true);
      this.getRoleTabelData();
@@ -631,8 +646,15 @@
      }
    },
    editFromDataClose() {
      this.dialogFormVisible = false;
      this.upform = {};
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.dialogFormVisible = false;
          this.upform = {};
          this.getRoleTabelData();
        })
        .catch((_) => {});
      // this.dialogFormVisible = false;
      // this.upform = {};
    },
    async editFromData() {
      if (this.upform.depName == null) {
@@ -659,8 +681,15 @@
      }
    },
    insertFromDataClose() {
      this.InsertFormdialog = false;
      this.insertform = {};
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.InsertFormdialog = false;
          this.insertform = {};
          this.getRoleTabelData();
        })
        .catch((_) => {});
      // this.InsertFormdialog = false;
      // this.insertform = {};
    },
    async insertFromData() {
      if (this.insertform.dirid == null) {
@@ -670,6 +699,7 @@
        });
        return;
      }
      const data = await insertVersion(this.insertform);
      if (data.code == 200) {
        this.InsertFormdialog = false;
@@ -707,6 +737,7 @@
              message: "删除成功!",
              type: "success",
            });
            this.listData.pageIndex = 1;
            this.getRoleTabelData();
          } else {
            this.$message({
@@ -726,11 +757,30 @@
      this.dialogFormVisible = true;
      this.upform = row;
    },
    handleClose() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.dialogFormVisible = false;
          this.getRoleTabelData();
        })
        .catch((_) => {});
    },
    handleCloseadd() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.InsertFormdialog = false;
          this.getRoleTabelData();
        })
        .catch((_) => {});
    },
  },
  watch: {
    pathId: {
      immediate: true,
      handler(val) {},
    },
    "ruleForm.dirid"() {
      this.$refs.treeSelect.visible = false;
    },
  },
};
@@ -740,7 +790,7 @@
.verSionBox {
  height: 98%;
  width: 98%;
  padding: 1%;
  padding: 0.5%;
  .verSionContent {
    width: 100%;
    height: 92%;
@@ -758,11 +808,11 @@
}
.inquire {
  padding: 8px;
  margin-top: 20px;
  //margin-top: 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  //margin-bottom: 20px;
  .el-form-item {
    margin: 5px;
  }