Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -46,8 +46,8 @@
            v-model="form"
            :data="data"
            :option="option"
            :page.sync="page"
            :table-loading="tableLoading"
            :before-open="beforeOpen"
            @row-del="rowDelHandler"
            @row-save="rowSaveHandler"
            @row-update="rowUpdateHandler"
@@ -74,6 +74,7 @@
        <div style="margin-top: 10px">
          <avue-crud
            ref="BottomCrud"
            v-model="bottomForm"
            :data="bottomData"
            :option="bottomOption"
            :table-loading="bottomTableLoading"
@@ -85,7 +86,18 @@
              <el-button icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">增加
              </el-button>
            </template>
            <template slot="menuForm" slot-scope="scope">
              <el-button type="primary"
                         size="small"
                         icon="el-icon-check"
                         v-if="scope.type === 'add'"
                         @click="handleSaveNext()">保存后继续添加</el-button>
              <el-button type="primary"
                         size="small"
                         icon="el-icon-circle-plus-outline"
                         v-if="scope.type === 'add'"
                         @click="$refs.BottomCrud.rowSave()">保存</el-button>
            </template>
          </avue-crud>
        </div>
      </basic-container>
@@ -138,6 +150,7 @@
      rightRoleData: [],
      form: {},
      bottomTableLoading: false,
      bottomForm:{},
      bottomData: [],
      bottomOption: {
        ...basicOption,
@@ -145,6 +158,8 @@
        calcHeight: -30,
        selection: false,
        refreshBtn: false,
        dialogWidth:'700',
        saveBtn:false,
        // height:'auto',
        column: [
          {
@@ -180,10 +195,15 @@
        addBtn: false,
        height: 350,
        highlightCurrentRow: true,
        menuWidth:160,
        span:24,
        labelWidth:100,
        dialogWidth:'700',
        column: [
          {
            label: '编号',
            prop: 'plCode',
            overHidden: true,
            search: true,
            rules: [
              {
@@ -196,6 +216,7 @@
          {
            label: '名称',
            prop: 'plName',
            overHidden: true,
            search: true,
            rules: [
              {
@@ -204,12 +225,6 @@
                trigger: 'blur'
              }
            ]
          },
          {
            label: '类路径',
            prop: 'plCSClass',
            search: true,
            overHidden: true,
          },
          {
            label: '分类',
@@ -231,15 +246,25 @@
            dicData: []
          },
          {
            label: '链接地址',
            label: 'C/S类路径',
            prop: 'plCSClass',
            search: true,
            searchLabelWidth:120,
            overHidden: true,
          },
          {
            label: 'B/S链接地址',
            prop: 'plBSUrl',
            search: true,
            searchLabelWidth:120,
            overHidden: true,
          },
          {
            label: '类型',
            prop: 'plTypeType',
            search: true,
            type: 'select',
            type: 'radio',
            width:100,
            dicData: [{
              label: '业务类型',
              value: 'business'
@@ -260,6 +285,7 @@
            prop: 'plDesc',
            search: true,
            overHidden: true,
            type: 'textarea'
          },
        ]
      },
@@ -273,7 +299,10 @@
          value: 'id',
          children: 'childs'
        },
        dialogWidth:'800',
        dialogMenuPosition: 'right',
        formOption: {
          dialogMenuPosition: 'right',
          column: [
            {
              label: '分类名称',
@@ -300,21 +329,24 @@
            {
              label: '创建者',
              prop: 'creator',
              readonly: true,
              disabled: true,
            },
            {
              label: '创建时间',
              prop: 'createTime',
              readonly: true,
              disabled: true,
            },
            {
              label: '父主类',
              prop: 'pidName',
              readonly: true,
              disabled: true,
              span:24
            },
            {
              label: '备注',
              prop: 'description'
              prop: 'description',
              type:'textarea',
              span:24
            },
          ],
        }
@@ -335,7 +367,9 @@
        const data = res.data.obj;
        this.treeData = [data];
        const selectTreeData = this.option.column.find(item => item.prop === 'plActionCls'); // 找到action添加分类树
        selectTreeData.dicData = [data];
        const dicData=[data];
        dicData[0].disabled=true;//根节点不能选
        selectTreeData.dicData = dicData;
      })
    },
@@ -356,9 +390,10 @@
    // 右侧表格信息
    getRightTableList(row) {
      console.log(row);
      this.tableLoading = true;
      const params = {
        plactioncls: row.id
        plactioncls: row.id ? row.id : ''
      }
      getActionTableData(params).then(res => {
        const data = res.data.data;
@@ -399,7 +434,7 @@
      }
      this.tableLoading = true;
      const apiParams = {
        plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id,
        plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id ? this.treeNodeRow.id : '',
        ...params
      }
@@ -420,6 +455,17 @@
      this.getRightTableList(this.treeNodeRow);
    },
    beforeOpen(done, type, loading) {
      if ([ 'edit'].includes(type)) {
        // 编辑逻辑
        this.$set(this.option.column[2],'disabled',false);
      } else {
        // 新增逻辑
        this.$set(this.option.column[2],'disabled',true);
      }
      done();
      console.log(this.option.column)
    },
    // action列表增加
    addClickHandler() {
      if (func.isEmptyObject(this.treeNodeRow)) {
@@ -464,29 +510,24 @@
      this.leftRoleData = [{
        name: '编号',
        oid: '编号'
      },
        {
          name: '类路径',
          oid: '类路径'
        },
        {
          name: '链接地址',
          oid: '链接地址'
        },
        {
          name: '类型',
          oid: '类型'
        },
        {
          name: '描述',
          oid: '描述'
        },]
      }, {
        name: '类路径',
        oid: '类路径'
      }, {
        name: '链接地址',
        oid: '链接地址'
      }, {
        name: '类型',
        oid: '类型'
      }, {
        name: '描述',
        oid: '描述'
      },]
      this.$refs.transfer.visible = true;
    },
    // 穿梭框保存 index为0是选择 1是全部
    exportSendHandler(row, index) {
      console.log(row, index);
      const params = {
        dataType: index,
        chooseDataOid: index === 0 ? this.selectList.map(item => item.plOId) : [],
@@ -544,6 +585,7 @@
    // 参数列表新增保存
    BottomRowSaveHandler(form, done, loading) {
      form.actionOid=this.currenRow.plOId;
      savePLActionParam(form).then(res => {
        if (res.data.code === 200) {
          this.$message.success('添加成功');
@@ -553,7 +595,24 @@
      })
      loading();
    },
    handleSaveNext(){
      this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.validate((valid) => {
        if (valid) {
          this.bottomForm.actionOid=this.currenRow.plOId;
          savePLActionParam(this.bottomForm).then(res => {
            if (res.data.code === 200) {
              this.$message.success('添加成功');
              this.bottomForm={};
              this.getBottomList();
              this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.resetFields()
            }
          })
        } else {
          return false;
        }
      });
    },
    // 参数列表修改保存
    BottomRowUpdateHandler(row, index, done, loading) {
      updatePLActionParam(row).then(res => {
@@ -593,7 +652,10 @@
        this.$message.error('请选择一条分类进行添加');
        return;
      }
      if (!this.treeNodeRow.id && this.treeNodeRow.name=='未分类') {
        this.$message.error('未分类下不能创建子分类');
        return;
      }
      const {createTime, creator, name, id, description} = this.treeNodeRow;
      this.$set(this.treeForm, 'createTime', func.formattedDate(createTime));
      this.$set(this.treeForm, 'creator', creator);
@@ -610,8 +672,8 @@
          this.$message.success('分类创建成功');
          this.getTreeList();
        }
        done();
      })
      done();
      loading();
    },
@@ -624,6 +686,10 @@
      if (this.treeNodeRow.id === 'root') {
        this.$message.error('根节点不能修改');
        return;
      }
      if (!this.treeNodeRow.id && this.treeNodeRow.name=='未分类') {
        this.$message.error('未分类不能修改');
        return;
      }
      const {name, serialno, creator, createTime, pid, description, id} = this.treeNodeRow;
@@ -645,7 +711,7 @@
      updateActionCls(data).then(res => {
        if (res.data.code === 200) {
          this.$message.success('修改成功');
          this.getBottomList();
          //this.getBottomList();
        }
        done();
      })
@@ -718,12 +784,8 @@
  .el-scrollbar__wrap {
    overflow: auto !important;
  }
  .avue-dialog .el-dialog__body .avue-form{
    margin: 0 auto;
  }
}
.smallBtn {
  width: 82px;
  text-align: center;
  padding-left: 4.5px;
}
</style>