yangys
2025-08-18 d5f64a57677aa427372bde6322bdec0fd5cc105d
src/views/wel/shemi.vue
@@ -22,7 +22,7 @@
          </el-col>
          <el-col :span="6">
            <el-select v-model="search.nodeType" placeholder="请输入节点类型" clearable>
              <el-option v-for="item in nodeTypeList" :key="item.dictValue" :label="item.dictValue" :value="item.dictKey"/>
              <el-option v-for="item in nodeTypeList" :key="item.dictValue" :label="item.dictValue" :value="item.dictKey"/>formApprove.
            </el-select>
          </el-col>
          <el-col :span="6">
@@ -46,7 +46,8 @@
        <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="下发" title="下发"></el-button> -->
        <!-- 替换 -->
        <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-icon><Switch /></el-icon> -->
        <el-button :size="size" text v-if="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>
        <el-button :size="size" text v-if="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>
      </template>
    </avue-crud>
    <!-- 新增节点 -->
@@ -65,9 +66,9 @@
    </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>
    <!--<span v-else-if="tabsType == 'tab2'">版本信息</span>-->
    <template v-else-if="tabsType == 'tab3'">
        <div v-html="convertToHtml(fileContent)"></div>
        <div v-html="convertToHtml(fileContent)" class="convertToHtml"></div>
    </template>
    <template v-else-if="tabsType == 'tab4'">
        <avue-crud :addBtn="false" :option="tabsFormOption4" :data="tabsForm4" ref="crud4" @selection-change="selectionChange">
@@ -91,10 +92,10 @@
  <el-drawer title="替换" append-to-body v-model="todolistModel" size="100%" class="code-box">
    <div class="approve-box">
        <div class="left">
            <TodolistLeft :row="row" @selection-change="todoSelectionChange" />
            <TodolistLeft :row="row" :replaceDataId="replaceDataId" :drawingNo="drawingNo" :processNo="processNo" :processEdition="processEdition" @selection-change="todoSelectionChange" />
        </div>
        <div class="right">
            <TodolistRightTop :row="row" />
            <TodolistRightTop :row="row" :name="name" />
            <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" />
        </div>
    </div>
@@ -113,6 +114,9 @@
  data() {
    let rejectText = '驳回';//+this.row.categoryName;
    return {
      drawingNo: '',
      processNo: '',
     processEdition: '',
      replaceDataId: "",
      formApprove: {
        title: '',
@@ -161,7 +165,6 @@
              rules: [
                  {
                  validator: (rule, value, callback) => {
                      console.log('-------',this.formApprove)
                      if (value === '' && this.formApprove.approve !== 'Y') {
                          callback(new Error('请输入备注'));
                      } else {
@@ -208,22 +211,22 @@
          icon: 'el-icon-info',
          label: '节点信息',
          prop: 'tab1',
        }, {
        }/*, {
          icon: 'el-icon-warning',
          label: '版本信息',
          prop: 'tab2',
        }]
        }*/]
      },
      tabsOption2: {
        column: [{
          icon: 'el-icon-info',
          label: '节点信息',
          prop: 'tab1',
        }, {
        },/* {
          icon: 'el-icon-warning',
          label: '版本信息',
          prop: 'tab2',
        }, {
        }, */{
          icon: 'el-icon-warning',
          label: '文件内容',
          prop: 'tab3'
@@ -260,25 +263,25 @@
            prop: 'createTime',
            disabled: true,
            placeholder: " "
          },
          },/*
          {
            label: '节点描述',
            prop: 'description',
            disabled: true,
            placeholder: " "
          },
          },*/
          {
            label: '修改时间',
            prop: 'updateTime',
            disabled: true,
            placeholder: " "
          },
          }/*,
          {
            label: '备注',
            prop: 'remark',
            disabled: true,
            placeholder: " "
          }
          }*/
        ]
      },
      tabsForm: {},
@@ -410,7 +413,7 @@
                    return '';
                }
            }
          },
          },/*
          {
            label: '版次',
            prop: 'processEdition',
@@ -425,16 +428,16 @@
          {
            label: '描述',
            prop: 'abc'
          },
          },*/
          {
            label: '类型',
            prop: 'nodeTypeName'
          },
          },/*
          {
            label: '设备',
            prop: 'machineCode'
          },
          */
          {
            label: '锁定状态',
            prop: 'isLocked',
@@ -457,25 +460,30 @@
                        //非程序节点
                        return '';
                    }else{
                        if(value==0||value==null){
                        if(value==0||value==-1){
                            return '未启动';
                        }else if(value == 1){
                            return '审批中';
                        }else if(value == 2){
                            return '已通过';
                        }else{
                            return '未定义';
                            return '';
                        }
                      }
                  },
          },
          },/*
          {
            label: '测试程序',
            prop: 'abc'
          },
          },*/
          {
            label: '创建人',
            prop: 'createUserName',
            width: '180'
          },
        {
            label: '创建时间',
            prop: 'createTime',
            width: '180'
          }
        ],
@@ -622,12 +630,34 @@
    
  },
  methods: {
    locked(row, isLock) {
      row.isLocked == isLock
      this.$confirm(`是否${isLock ? '解锁' : '锁定'}`, {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        axios({
          url: isLock ? '/blade-mdm/flow/lock/start-unlock' : '/blade-mdm/program/node/lock',
          method: 'post',
          params: {id: row.id,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});
          }
        });
      });
    },
    handleSubmit(form, done) {
      //发起程序替换流程
      var obj = {
        title: this.formApprove.title,
        nodeId: this.id,
        tempInstanceId: this.replaceDataId,
          comment: this.formApprove.comment,
        assignee: this.formApprove.assignee
      }
      axios({
@@ -635,14 +665,17 @@
        method: 'post',
        data: obj
      }).then(
      resp => {
        this.$message({
          type: 'success',
          message: '操作成功!',
        resp => {
          this.$message({
            type: 'success',
            message: '操作成功!',
          });
          done();
          this.todolistModel = false;
        }).catch(error =>{
          window.console.log('haha',error);
          done();
        });
        done();
        this.todolistModel = false;
      });
      // if(this.row.taskDefinitionKey === 'programmingTask') {
      //     // if(this.applist.length !== 1) {
      //     //     done();
@@ -687,11 +720,30 @@
      resp => {
        this.row = row;
        this.replaceDataId = resp.data.data.processInstanceId;
        this.processNo = resp.data.data.processNo;
        this.processEdition = resp.data.data.processEdition;
          this.drawingNo = resp.data.data.drawingNo;
        this.formApprove.title = resp.data.data.name + "替换";
        this.getHandler(); //获取处理人
        this.todolistModel = true;
      });
    },
    getHandler() {  //获取处理人
      axios({
        url: '/blade-mdm/flow/replace/default-assignees',
        method: 'get',
        params: {drawingNo: this.drawingNo}
      }).then(
      resp => {
        if(resp.data.code == 200) {
          this.formApprove.assignee = resp.data.data.checkerId;
        }else {
          this.$message.success(resp.msg);
        }
      });
    },
    convertToHtml(text) {
        return text.replace(/\r\n/g, '<br>');
        return text.replace(/\n/g, '<br>');
    },
    removeHasChildren(treeData) {  //查询时候使用,删掉hasChildren 
      return treeData.map(node => {
@@ -1153,6 +1205,10 @@
      flex: 1;
  }
}
.convertToHtml {
  background-color: #fffee1;
  padding: 6px 12px;
}
</style>
<style>
  .highlight-row {