yangys
2025-08-30 498df4ec49c9469d535c494039586ff30c3b23a6
src/views/wel/shemi.vue
@@ -58,10 +58,10 @@
            icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="替换" title="替换"></el-button>
          <el-button :size="size" text
            v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
            icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="锁定" title="锁定"></el-button>
            icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="锁定" title="锁定"></el-button>
          <el-button :size="size" text
            v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
            icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="解锁" title="解锁"></el-button>
            icon="el-icon-unlock" type="primary" @click="startUnlock(row)" placeholder="解锁" title="解锁"></el-button>
        </template>
      </avue-crud>
    </div>
@@ -109,24 +109,16 @@
      </template> -->
        <template #name="{ row }">
          <span>{{ row.name }}</span>
          <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="修改" @click="showEdit(row)" title="修改"></el-button>
        <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="删除" title="删除"></el-button>
        <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="新增子级" title="新增子级"></el-button>
        <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="文件上传" title="文件上传"></el-button> -->
          <!-- 涉密网才有 -->
          <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="升版" title="升版"></el-button> -->
          <!-- 工控网才有 -->
          <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="下发" title="下发"></el-button> -->
          <!-- 替换  v-if="permission.auto_dispatch"-->
          <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
            icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="替换" title="替换"></el-button>
          <el-button :size="size" text
            v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
            icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="锁定" title="锁定"></el-button>
            icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="锁定" title="锁定"></el-button>
          <el-button :size="size" text
            v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
            icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="解锁" title="解锁"></el-button>
            icon="el-icon-unlock" type="primary" @click="startUnlock(row)" placeholder="解锁" title="解锁"></el-button>
        </template>
      </avue-crud>
    </div>
@@ -145,6 +137,12 @@
        </template>
      </avue-form>
    </el-dialog>
    <!-- 锁定对话框 -->
    <el-dialog title="程序锁定" append-to-body v-model="lockBox">
      <avue-form :option="lockOption" v-model="lockForm" @submit="lockSubmit" @reset-change="lockCancel" />
    </el-dialog>
    <avue-tabs :option="tabsOption" @change="tabsHandleChange" style="margin-top: 30px;" v-if="isShowTabs"></avue-tabs>
    <avue-form v-if="tabsType == 'tab1'" :option="tabsFormOption" v-model="tabsForm"></avue-form>
    <!--<span v-else-if="tabsType == 'tab2'">版本信息</span>-->
@@ -439,6 +437,32 @@
      },
      modalBox: false,
      modalTitle: "",
      lockOption: {
        submitText: "锁定",
        emptyText: "取消",
        menuPosition: "right",
        column: [
          {
            label: '程序包名',
            prop: 'name',
            disabled:true,
            labelWidth: "120",
          },
          {
            label: '锁定原因',
            prop: 'remark',
            type: "textarea",
            labelWidth: "120",
            span: 24,
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          }
        ]
      },
      lockForm: {},
      lockBox: false,
      id: "",
      parentId: 1,
      loading: true,
@@ -509,22 +533,7 @@
                return '';
              }
            }
          },/*
          {
            label: '版次',
            prop: 'processEdition',
            formatter: (val, value, label) => {
                if(val.nodeType == '60'){
                    return value;
                }else{
                    return '';
                }
            }
          },
          {
            label: '描述',
            prop: 'abc'
          },*/
          {
            label: '类型',
            prop: 'nodeTypeName'
@@ -567,11 +576,7 @@
                }
              }
            },
          },/*
          {
            label: '测试程序',
            prop: 'abc'
          },*/
          },
          {
            label: '创建人',
            prop: 'createUserName',
@@ -765,22 +770,55 @@
        this.drawingNoList = [];
      }
    },
    locked(row, isLockP) {
      //row.isLocked == isLock
      var isLock = row.isLocked == 1;
      console.log('isLock', isLock)
      this.$confirm(`是否${isLock ? '解锁' : '锁定'}`, {
    showLockDlg(row){
      this.lockForm = row;
     //this.lockForm.name = row.name;
     // this.lockForm.id = row.id;
      this.lockForm.remark = '';
      this.lockBox = true;
    },
    lockCancel() {
      this.lockBox = false;
      this.lockForm = {};
    },
    lockSubmit() {
      //锁定提交
      this.$confirm('是否锁定', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        axios({
          url: isLock ? '/blade-mdm/flow/lock/start-unlock' : '/blade-mdm/program/node/lock',
          url: '/blade-mdm/program/node/lock',
          method: 'post',
          params: { id: row.id, nodeId: row.id }
          params: this.lockForm
        }).then(res => {
          if (res.data.code == 200) {
            this.$message({ type: 'success', message: '操作成功!' });
            this.addLocalTreeNode(this.lockForm.parentId);
            this.lockBox = false;
          } else {
            this.$message({ type: 'success', message: res.data.msg });
          }
        });
      }).catch(action => {
        console.log('cancel')
      });
    },
    startUnlock(row) {
      //启动解锁流程
      this.$confirm(`是否解锁`, {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        axios({
          url: '/blade-mdm/flow/lock/start-unlock',
          method: 'post',
          params: {nodeId: row.id }
        }).then(res => {
          if (res.data.code == 200) {
            this.$message({ type: 'success', message: '解锁流程已启动!' });
            this.addLocalTreeNode(row.parentId);
          } else {
            this.$message({ type: 'success', message: res.data.msg });
@@ -842,6 +880,18 @@
    },
    todoSelectionChange(applist) {
      this.applist = applist;
    },
    showReplaceDlg(row) {  //替换对话框
      if (row.nodeType == 60) { //程序包
        return;
      }
      //111
      this.modalTitle = "新增子节点";
      this.selectedColumn.parentId = row.id;
      this.modalForm = this.selectedColumn;
      this.modalBox = true;
    },
    replacement(row) {  //替换
      this.id = row.id;
@@ -925,6 +975,7 @@
      this.isSearch = !this.isSearch
      this.searchTreeData.status = this.searchTreeData.programStatus.join();
      this.treeData = []
      this.defaultExpandedKeys = []
      axios({
        url: '/blade-mdm/program/node/search-list2',
        method: 'get',
@@ -956,7 +1007,7 @@
          if (this.treeData.length == 0) {
            return;
          }
        }, 1000);
        }, 100);
      });