管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-01-16 3c0bcd367dbc9aff25202d1a8ec2eb143f3e8261
src/views/datamanage/versionManage.vue
@@ -1,19 +1,36 @@
<template>
  <div class="verSionBox">
    <My-bread
      :list="[
    <My-bread :list="[
        `${$t('dataManage.dataManage')}`,
        `${$t('dataManage.versionManage')}`,
      ]"
    ></My-bread>
      ]"></My-bread>
    <el-divider />
    <div class="verSionContent">
      <div class="verSion_leftTree">
      <!-- <div class="verSion_leftTree">
        <ver-dir-tree></ver-dir-tree>
      </div>
      </div> -->
      <div class="verSion_rightContent">
        <el-form ref="ruleForm" :model="ruleForm" :inline="true">
          <el-form-item :label="$t('dataManage.vmobj.keyword')" prop="name">
        <el-form
          ref="ruleForm"
          :model="ruleForm"
          :inline="true"
        >
          <el-form-item>
            <el-cascader
              v-model="ruleForm.dirid"
              :show-all-levels="false"
              :options="companyOption"
              @change="handleChange"
              :props="{
              label: 'name',
              value: 'id',
              children: 'children',
              checkStrictly: true,
              emitPath: false,
            }"
            ></el-cascader>
          </el-form-item>
          <el-form-item>
            <el-input
              v-model="ruleForm.name"
              :placeholder="$t('common.pleaseInput')"
@@ -25,35 +42,40 @@
              icon="el-icon-search"
              size="small"
              class="primary"
              >{{ $t('common.iquery') }}</el-button
            >
            >{{ $t('common.iquery') }}</el-button>
            <el-button
              type="success"
              v-if="btnStatus.insert"
              @click="(InsertFormdialog = true), getSelectdirTab()"
              icon="el-icon-plus"
              size="small"
              >{{ $t('common.append') }}</el-button
            >
            >{{ $t('common.append') }}</el-button>
            <el-button
              type="info"
              @click="resetForm('ruleForm')"
              icon="el-icon-delete"
              size="small"
              >{{ $t('common.empty') }}</el-button
            >
            >{{ $t('common.empty') }}</el-button>
          </el-form-item>
        </el-form>
        <el-divider class="eldivider" />
        <div style="height: 80%">
          <el-table :data="tableData" style="width: 100%" height="99%">
        <div style="height: 73%">
          <el-table
            :data="tableData"
            style="width: 100%"
            height="99%"
          >
            <el-table-column
              align="center"
              type="index"
              :label="$t('dataManage.vmobj.index')"
              width="70px"
            />
            <el-table-column align="center" prop="id" v-if="false" />
            <el-table-column
              align="center"
              prop="id"
              v-if="false"
            />
            <el-table-column
              align="center"
              prop="name"
@@ -71,7 +93,7 @@
            />
            <el-table-column
              align="center"
              prop="createUser"
              prop="createName"
              :label="$t('dataManage.vmobj.createonuser')"
            />
            <el-table-column
@@ -91,22 +113,26 @@
              :label="$t('dataManage.vmobj.updateontime')"
              :formatter="formatTime"
            />
            <el-table-column min-width="150" :label="$t('common.operate')">
            <el-table-column
              min-width="150"
              :label="$t('common.operate')"
            >
              <template slot-scope="scope">
                <el-button
                  v-if="btnStatus.update"
                  @click="handleEdit(scope.$index, scope.row)"
                  @click="
                    handleEdit(scope.$index, scope.row);
                    getSelectdirTab();
                  "
                  type="warning"
                  size="small"
                  >{{ $t('common.update') }}</el-button
                >
                >{{ $t('common.update') }}</el-button>
                <el-button
                  v-if="btnStatus.delete"
                  @click="handleDelete(scope.$index, scope.row)"
                  type="danger"
                  size="small"
                  >{{ $t('common.delete') }}</el-button
                >
                >{{ $t('common.delete') }}</el-button>
              </template>
            </el-table-column>
          </el-table>
@@ -137,7 +163,10 @@
          :label="$t('dataManage.vmobj.name')"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.name" autocomplete="off"></el-input>
          <el-input
            v-model="upform.name"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.vmobj.catalogue')"
@@ -146,7 +175,7 @@
          <el-cascader
            style="width: 300px"
            v-model="upform.dirid"
            :options="catalogOption"
            :options="editcatalogOption"
            @change="upCatalogChange"
            :props="cascader"
          ></el-cascader>
@@ -155,14 +184,28 @@
          :label="$t('dataManage.vmobj.describe')"
          :label-width="formLabelWidth"
        >
          <el-input v-model="upform.descr" autocomplete="off"></el-input>
          <el-input
            v-model="upform.descr"
            autocomplete="off"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" type="info" class="dialog-footer">
        <el-button @click="editFromDataClose">{{
      <div
        slot="footer"
        type="info"
        class="dialog-footer"
      >
        <el-button
          size="small"
          @click="editFromDataClose"
        >{{
          $t('common.close')
        }}</el-button>
        <el-button @click="editFromData" class="primary">{{
        <el-button
          size="small"
          @click="editFromData"
          class="primary"
        >{{
          $t('common.confirm')
        }}</el-button>
      </div>
@@ -208,11 +251,22 @@
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="insertFromDataClose" type="info">{{
      <div
        slot="footer"
        class="dialog-footer"
      >
        <el-button
          @click="insertFromDataClose"
          type="info"
          size="small"
        >{{
          $t('common.close')
        }}</el-button>
        <el-button @click="insertFromData" class="primary">{{
        <el-button
          @click="insertFromData"
          class="primary"
          size="small"
        >{{
          $t('common.confirm')
        }}</el-button>
      </div>
@@ -320,6 +374,7 @@
  data() {
    return {
      catalogOption: [],
      editcatalogOption: [],
      showCata: false,
      formLabelWidth: '100px',
      dialogFormVisible: false,
@@ -330,6 +385,7 @@
      ruleForm: {},
      insertform: {},
      tableData: [],
      companyOption: [],
      count: 0,
      rowFlag: null,
      listData: {
@@ -356,6 +412,7 @@
    };
  },
  created() {
    this.getQueryDirTree();
    this.getRoleTabelData();
    this.showPermsBtn();
  },
@@ -374,16 +431,46 @@
      this.upform.dirid == val;
    },
    //目录列表获取
    async getQueryDirTree() {
      const res = await selectdirTab();
      if (res.code != 200) {
        this.$message.error('目录列表获取失败');
        return;
      }
      this.companyOption = this.treeData(res.result);
      this.ruleForm.dirid = this.companyOption[0].id
    },
    handleChange(val) {
      this.ruleForm.dirid = val;
      this.onSubmit();
    },
    //目录列表获取
    async getSelectdirTab() {
      const res = await selectdirTab();
      if (res.code != 200) {
        this.$message.error('目录列表获取失败');
        return;
      }
      this.insertform.name = this.getYMD();
      this.insertform.path = 1;
      this.insertform.dirid = 1;
      this.upform.dirid == 1;
      this.catalogOption = this.treeData(res.result);
      this.editcatalogOption = this.treeData(res.result);
    },
    getYMD() {
      let myDate = new Date();
      let myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
      let myMonth = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
      let myToday = myDate.getDate(); //获取当前日(1-31)
      myMonth = myMonth > 9 ? myMonth : '0' + myMonth;
      myToday = myToday > 9 ? myToday : '0' + myToday;
      let nowDate = 'V' + myYear + myMonth + myToday;
      return nowDate;
    },
    //树列表生成
    treeData(source) {
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
@@ -403,6 +490,7 @@
    },
    resetForm() {
      this.ruleForm = {};
      this.ruleForm.dirid = this.companyOption[0].id
      this.$store.state.verCateNode = {};
      this.$bus.$emit('clearTressLabel', true);
      this.getRoleTabelData();
@@ -418,7 +506,7 @@
      }
      this.listData.name = this.ruleForm.name;
      this.listData.depName = this.$store.state.verCateNode.name;
      this.listData.dirid = this.ruleForm.dirid;
      const data = await select_Ver_ByPageAndCount(this.listData);
@@ -537,7 +625,7 @@
  watch: {
    pathId: {
      immediate: true,
      handler(val) {},
      handler(val) { },
    },
  },
};
@@ -545,10 +633,9 @@
<style lang="less" scoped>
//@import url(); 引入公共css类
.verSionBox {
  height: 81%;
  width: 97%;
  position: absolute;
  box-sizing: border-box;
  height: 98%;
  width: 98%;
  padding: 1%;
  .verSionContent {
    width: 100%;
    height: 92%;
@@ -556,7 +643,7 @@
    justify-content: space-between;
    .verSion_leftTree {
      width: 15%;
      height: 95%;
      height: 91%;
      border: 1px solid white;
      border-radius: 5px;
      padding: 1%;
@@ -564,8 +651,8 @@
      overflow-y: auto;
    }
    .verSion_rightContent {
      width: 80%;
      height: 95%;
      width: 98%;
      height: 91%;
      border: 1px solid white;
      border-radius: 5px;
      padding: 1%;