wangting
2025-01-02 e358d69fc18870584dd2d9f531910b7838ea27d9
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -12,7 +12,7 @@
            </div>
            <avue-tree v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
           <span>
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
@@ -26,12 +26,12 @@
    <el-main>
      <basic-container>
        <div v-if="!tableStatus" style="display: flex;justify-content: left;margin-top: 15px">
          <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">增加</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">删除</el-button>
          <el-button icon="el-icon-document-add" plain size="small" type="primary" @click="copyClickHandler">克隆
          <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">增加</el-button>
          <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">删除</el-button>
          <el-button v-if="permissionList.cloneBtn" icon="el-icon-document-add" plain size="small" type="primary" @click="copyClickHandler">克隆
          </el-button>
          <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入</el-button>
          <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
          <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入</el-button>
          <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
          </el-button>
        </div>
        <avue-crud
@@ -58,15 +58,16 @@
            </div>
          </template>
          <template slot="menu" slot-scope="scope">
            <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">编辑
            <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">编辑
            </el-button>
            <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">删除
            <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">删除
            </el-button>
          </template>
        </avue-crud>
      </basic-container>
    </el-main>
    <form-dialog ref="formDialog" :TreeNodeRow="this.nodeRow" :editRow="editRow" :treeRadio="treeRadio"  @updataTable="getRightPortalVIDatas"></form-dialog>
    <form-dialog ref="formDialog" :TreeNodeRow="this.nodeRow" :editRow="editRow" :treeRadio="treeRadio"
                 @updataTable="getRightPortalVIDatas"></form-dialog>
    <table-dialog ref="tableDialog" :TreeNodeRow="this.nodeRow" :treeRadio="treeRadio"
                  @updataTable="getRightPortalVIDatas"></table-dialog>
    <!-- 导入 -->
@@ -90,7 +91,7 @@
            <avue-tree ref="cloneTree" v-loading="cloneTreeLoading" :data="cloneTreeData" :option="treeOption"
                       @node-click="cloneTreeNodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
           <span>
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
@@ -115,6 +116,7 @@
import {getBizTypes} from "@/api/modeling/businessType/api";
import {gridLink} from "@/api/modeling/linkType/api";
import func from "@/util/func";
import {mapGetters} from "vuex";
export default {
  name: "index",
@@ -187,6 +189,17 @@
    this.getTreeList();
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
        importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
        cloneBtn: this.vaildData(this.permission[this.$route.query.id].clone, false),
      };
    },
    tableStatus() {
      return func.isEmptyObject(this.nodeRow);
    }
@@ -311,7 +324,6 @@
    // 编辑按钮
    editBtnClick(row) {
      console.log('row', row);
      // 表格
      if (row.viType === 0) {
        const params = {
@@ -330,13 +342,14 @@
            // 更新表单
            this.$refs.tableDialog.form = {
              ...prmItem,
              itemFieldWidthList:prmItem.itemFieldWidthList.map(item => {
                return{
              itemFieldWidthList: prmItem.itemFieldWidthList.map(item => {
                return {
                  ...item,
                  $cellEdit: true,
                }
              }),
              viName: res.data.obj.viName,
              itemQtName: res.data.obj.prm.formQtName,
              editNodeId: row.id,
              itemOutFieldList: (prmItem.itemOutFieldList || []),
              itemSearchFieldList: (prmItem.itemSearchFieldList || []).map(item => ({id: item})),
@@ -375,9 +388,9 @@
            this.$refs.formDialog.formList = updatedData;
            this.$refs.formDialog.getTreeList();
            this.$refs.formDialog.topForm.viName = res.data.obj.viName;
            this.$refs.formDialog.topForm.itemQtName = res.data.obj.prm.formQtName;
            this.$refs.formDialog.topForm.columnNumber = this.getValueBasedOnInput(res.data.obj.prm.showCols);
            this.$refs.formDialog.topForm.showColumn = res.data.obj.prm.showCols;
            this.$refs.formDialog.visible = true;
          }
        })
@@ -462,7 +475,7 @@
          this.lastIndex = newIndex;
        },
        () => {
          this.selectList = [];
          this.selectList = [row];
        }
      );
    },
@@ -480,8 +493,6 @@
      exportExcel(params).then(res => {
        func.downloadFileByBlobHandler(res);
        this.$message.success('导出成功');
      }).catch(err => {
        this.$message.error(err);
      });
    },
@@ -519,7 +530,6 @@
    // 克隆树点击
    cloneTreeNodeClick(row) {
      console.log(row);
      this.cloneTreeNode = row;
    },
@@ -575,7 +585,6 @@
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(({value}) => {
        console.log(obj);
        const params = {
          clonePortalVIDTOList: [
            {