lxl
2022-10-27 f6ebd1820968db8521bed86d25b183efe7eb877b
src/views/datamanage/versionManage.vue
@@ -20,19 +20,20 @@
            @click="onSubmit('ruleForm')"
            icon="el-icon-search"
            size="small"
            >{{ $t('common.iquery') }}</el-button
            >{{ $t("common.iquery") }}</el-button
          >
          <el-button
            v-if="btnStatus.insert"
            @click="InsertFormdialog = true"
            icon="el-icon-plus"
            size="small"
            >{{ $t('common.append') }}</el-button
            >{{ $t("common.append") }}</el-button
          >
          <el-button
            @click="resetForm('ruleForm')"
            icon="el-icon-delete"
            size="small"
            >{{ $t('common.empty') }}</el-button
            >{{ $t("common.empty") }}</el-button
          >
        </el-form-item>
      </el-form>
@@ -92,16 +93,18 @@
            <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)"
                  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>
@@ -170,7 +173,7 @@
            disabled
          ></el-input>
          <el-button style="margin-left: 20px" @click="showVerTree(2)">{{
            $t('common.choose')
            $t("common.choose")
          }}</el-button>
        </el-form-item>
        <el-form-item
@@ -182,10 +185,10 @@
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="editFromDataClose">{{
          $t('common.close')
          $t("common.close")
        }}</el-button>
        <el-button @click="editFromData" type="primary">{{
          $t('common.confirm')
          $t("common.confirm")
        }}</el-button>
      </div>
    </el-dialog>
@@ -210,7 +213,7 @@
            disabled
          ></el-input>
          <el-button style="margin-left: 20px" @click="showVerTree(3)">{{
            $t('common.choose')
            $t("common.choose")
          }}</el-button>
        </el-form-item>
@@ -223,10 +226,10 @@
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="insertFromDataClose">{{
          $t('common.close')
          $t("common.close")
        }}</el-button>
        <el-button @click="insertFromData" type="primary">{{
          $t('common.confirm')
          $t("common.confirm")
        }}</el-button>
      </div>
    </el-dialog>
@@ -236,10 +239,10 @@
      </div>
      <div class="btnBox">
        <el-button type="primary" size="small" @click="selectCataName">{{
          $t('common.confirm')
          $t("common.confirm")
        }}</el-button>
        <el-button type="primary" size="small" @click="showCata = false">{{
          $t('common.close')
          $t("common.close")
        }}</el-button>
      </div>
    </div>
@@ -252,18 +255,18 @@
  insertVersion,
  deleteVersion,
  updateVersion,
} from '../../api/api';
import verDirTree from './verDirTree.vue';
import MyBread from '../../components/MyBread.vue';
import verDirTrees from './verDirTrees.vue';
import moment from 'moment';
} from "../../api/api";
import verDirTree from "./verDirTree.vue";
import MyBread from "../../components/MyBread.vue";
import verDirTrees from "./verDirTrees.vue";
import moment from "moment";
export default {
  name: 'versionManage',
  name: "versionManage",
  components: { MyBread, verDirTree, verDirTrees },
  data() {
    return {
      showCata: false,
      formLabelWidth: '100px',
      formLabelWidth: "100px",
      dialogFormVisible: false,
      InsertFormdialog: false,
      showinfoBox: false,
@@ -280,10 +283,19 @@
        pageIndex: 1,
        pageSize: 10,
      },
      btnStatus: {
        select: false,
        delete: false,
        upload: false,
        download: false,
        insert: false,
        update: false,
      },
    };
  },
  created() {
    this.getRoleTabelData();
    this.showPermsBtn();
  },
  computed: {
    pathId() {
@@ -291,17 +303,24 @@
    },
  },
  methods: {
    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));
    },
    resetForm() {
      this.ruleForm = {};
      this.$store.state.verCateNode = {};
      this.$bus.$emit('clearTressLabel', true);
      this.$bus.$emit("clearTressLabel", true);
      this.getRoleTabelData();
    },
    onSubmit() {
      this.getRoleTabelData();
    },
    async getRoleTabelData() {
      if (this.listData.tab == '') {
      if (this.listData.tab == "") {
        delete this.listData.tab;
      }
@@ -310,7 +329,7 @@
      const data = await select_Ver_ByPageAndCount(this.listData);
      if (data.code != 200) {
        this.$message.error('列表调用失败');
        this.$message.error("列表调用失败");
      }
      this.tableData = data.result;
      this.count = data.count;
@@ -344,8 +363,8 @@
    async editFromData() {
      if (this.upform.depName == null) {
        this.$message({
          message: '请选择角色所属单位',
          type: 'warning',
          message: "请选择角色所属单位",
          type: "warning",
        });
        return;
      }
@@ -354,14 +373,14 @@
        this.dialogFormVisible = false;
        this.upform = {};
        this.$message({
          message: '修改成功!',
          type: 'success',
          message: "修改成功!",
          type: "success",
        });
        this.getRoleTabelData();
      } else {
        this.$message({
          message: '修改失败!',
          type: 'warning',
          message: "修改失败!",
          type: "warning",
        });
      }
    },
@@ -372,8 +391,8 @@
    async insertFromData() {
      if (this.insertform.dirid == null) {
        this.$message({
          message: '请选择角色所属单位',
          type: 'warning',
          message: "请选择角色所属单位",
          type: "warning",
        });
        return;
      }
@@ -382,37 +401,37 @@
        this.InsertFormdialog = false;
        this.insertform = {};
        this.$message({
          message: '添加成功!',
          type: 'success',
          message: "添加成功!",
          type: "success",
        });
        this.getRoleTabelData();
      } else {
        this.$message({
          message: '添加失败!',
          type: 'warning',
          message: "添加失败!",
          type: "warning",
        });
      }
    },
    formatTime(row, column) {
      let date = row[column.property];
      if (date === undefined || date === null) {
        return '';
        return "";
      }
      return moment(parseInt(date)).format('YYYY-MM-DD HH:mm:ss');
      return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss");
    },
    async handleDelete(index, row) {
      const data = await deleteVersion(row.id);
      if (data.code == 200) {
        this.InsertFormdialog = false;
        this.$message({
          message: '删除成功!',
          type: 'success',
          message: "删除成功!",
          type: "success",
        });
        this.getRoleTabelData();
      } else {
        this.$message({
          message: '删除失败!',
          type: 'warning',
          message: "删除失败!",
          type: "warning",
        });
      }
    },