Просмотр исходного кода

工艺节点tableSelect数据源

sh4wmoo 3 лет назад
Родитель
Сommit
a2483a05c7

+ 184 - 114
src/components/business/process/node-modal/node-modal.vue

@@ -2,18 +2,18 @@
 <template>
   <div>
     <DkModal
-     title="工艺节点"
-     width="1600"
-     v-model="process.nodeModal.display"
-     :mask-closable="false"
-     :mask="false"
-     :closable="false"
-     draggable
-     sticky
-     @modalOk="modalOk"
-     @modalCancel="modalCancel">
-      {{nodeData}}<br/>
-      {{allNodes}}<br/>
+      title="工艺节点"
+      width="1600"
+      v-model="process.nodeModal.display"
+      :mask-closable="false"
+      :mask="false"
+      :closable="false"
+      draggable
+      sticky
+      @modalOk="modalOk"
+      @modalCancel="modalCancel">
+      {{ nodeData }}<br/>
+      {{ allNodes }}<br/>
       <DkForm ref="formInline" :col-count="4" :label-max-words="6">
         <!--    节点名称    -->
         <DkFormItem prop="nodeName" :required="true">
@@ -21,33 +21,39 @@
         </DkFormItem>
         <!--    节点种类    -->
         <DkFormItem prop="nodeKind" :required="true">
-          <SelectPop ref="nodeKind" v-model="nodeData.nodeKind"  label-key="kindName" value-key="kindCode" :multiple="false" disabled
-                     :options="dataKindList.filter(it=>it.kindType==='工艺节点')" />
+          <SelectPop ref="nodeKind" v-model="nodeData.nodeKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false" disabled
+                     :options="dataKindList.filter(it=>it.kindType==='工艺节点')"/>
         </DkFormItem>
         <!--    流程类型    -->
         <DkFormItem prop="flowKind" :required="true">
-          <SelectPop ref="flowKind" v-model="nodeData.flowKind"  label-key="kindName" value-key="kindCode" :multiple="false"
-                     :options="dataKindList.filter(it=>it.kindType==='节点流程')" />
+          <SelectPop ref="flowKind" v-model="nodeData.flowKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false"
+                     :options="dataKindList.filter(it=>it.kindType==='节点流程')"/>
         </DkFormItem>
         <!--    工号类型    -->
         <DkFormItem prop="userKind" :required="true">
-          <SelectPop ref="userKind" v-model="nodeData.userKind" label-key="kindName" value-key="kindCode" :multiple="false"
-                     :options="dataKindList.filter(it=>it.kindType==='节点工号')" />
+          <SelectPop ref="userKind" v-model="nodeData.userKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false"
+                     :options="dataKindList.filter(it=>it.kindType==='节点工号')"/>
         </DkFormItem>
         <!--    计件模式    -->
         <DkFormItem prop="pieceKind" :required="true">
-          <SelectPop ref="pieceKind" v-model="nodeData.pieceKind" label-key="kindName" value-key="kindCode" :multiple="false"
-                     :options="dataKindList.filter(it=>it.kindType==='节点计件')" />
+          <SelectPop ref="pieceKind" v-model="nodeData.pieceKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false"
+                     :options="dataKindList.filter(it=>it.kindType==='节点计件')"/>
         </DkFormItem>
         <!--    操作模式    -->
         <DkFormItem prop="opnKind" :required="true">
-          <SelectPop ref="opnKind" v-model="nodeData.opnKind" label-key="kindName" value-key="kindCode" :multiple="false"
-                     :options="dataKindList.filter(it=>it.kindType==='节点操作')" />
+          <SelectPop ref="opnKind" v-model="nodeData.opnKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false"
+                     :options="dataKindList.filter(it=>it.kindType==='节点操作')"/>
         </DkFormItem>
         <!--    工序标签    -->
         <DkFormItem prop="nodeSysTags">
-          <SelectPop ref="nodeSysTags" v-model="nodeData.nodeSysTags" label-key="kindName" value-key="kindCode" :multiple="true"
-                     :options="dataKindList.filter(it=>it.kindType==='节点标签')" />
+          <SelectPop ref="nodeSysTags" v-model="nodeData.nodeSysTags" label-key="kindName" value-key="kindCode"
+                     :multiple="true"
+                     :options="dataKindList.filter(it=>it.kindType==='节点标签')"/>
         </DkFormItem>
         <!--    撤销标识    -->
         <DkFormItem prop="flgUndo" :required="true">
@@ -62,22 +68,25 @@
         </DkFormItem>
         <!--    默认分级    -->
         <DkFormItem prop="defGradeId">
-          <SelectPop ref="defGradeId" v-model="nodeData.defGradeId" label-key="gradeName" value-key="gradeId" :multiple="false" :options="productGradeList" />
+          <SelectPop ref="defGradeId" v-model="nodeData.defGradeId" label-key="gradeName" value-key="gradeId"
+                     :multiple="false" :options="productGradeList"/>
         </DkFormItem>
         <!--    成型标签    -->
         <DkFormItem prop="moldingSysTags">
-          <SelectPop ref="moldingSysTags" v-model="nodeData.moldingSysTags" label-key="kindName" value-key="kindCode" :multiple="true"
-                     :options="dataKindList.filter(it=>it.kindType==='成线标签')" />
+          <SelectPop ref="moldingSysTags" v-model="nodeData.moldingSysTags" label-key="kindName" value-key="kindCode"
+                     :multiple="true"
+                     :options="dataKindList.filter(it=>it.kindType==='成线标签')"/>
         </DkFormItem>
         <!--    可判分级    -->
         <DkFormItem prop="judgeGradeIds">
-          <SelectPop ref="judgeGradeIds" v-model="nodeData.judgeGradeIds" label-key="gradeName" value-key="gradeId" :multiple="true" :options="productGradeList" />
+          <SelectPop ref="judgeGradeIds" v-model="nodeData.judgeGradeIds" label-key="gradeName" value-key="gradeId"
+                     :multiple="true" :options="productGradeList"/>
         </DkFormItem>
         <!--    独立检验    -->
         <DkFormItem prop="flgAloneJudge" :required="true">
           <div class="switch">
             <template>
-              <i-switch ref="flgAloneJudge" v-model="nodeData.flgAloneJudge" >
+              <i-switch ref="flgAloneJudge" v-model="nodeData.flgAloneJudge">
                 <Icon type="md-checkmark" slot="open"></Icon>
                 <Icon type="md-close" slot="close"></Icon>
               </i-switch>
@@ -86,32 +95,36 @@
         </DkFormItem>
         <!--    返回分级    -->
         <DkFormItem prop="backGradeIds">
-          <SelectPop ref="backGradeIds" v-model="nodeData.backGradeIds" label-key="gradeName" value-key="gradeId" :multiple="true" :options="productGradeList" />
+          <SelectPop ref="backGradeIds" v-model="nodeData.backGradeIds" label-key="gradeName" value-key="gradeId"
+                     :multiple="true" :options="productGradeList"/>
         </DkFormItem>
         <!--    返回完成工序    -->
         <DkFormItem prop="backNodeId">
           <SelectPop ref="backNodeId" v-model="nodeData.backNodeId" label-key="name" value-key="id" :multiple="false"
-                         :options="allNodes" />
+                     :options="allNodes"/>
         </DkFormItem>
         <!--    可回收分级    -->
         <DkFormItem prop="recycledGradeIds">
-          <SelectPop ref="recycledGradeIds" v-model="nodeData.recycledGradeIds" label-key="gradeName" value-key="gradeId" :multiple="true" :options="productGradeList" />
+          <SelectPop ref="recycledGradeIds" v-model="nodeData.recycledGradeIds" label-key="gradeName"
+                     value-key="gradeId" :multiple="true" :options="productGradeList"/>
         </DkFormItem>
         <!--    回收后处理方式    -->
         <DkFormItem prop="recycledKind" :auto-label-width="true">
-          <SelectPop ref="recycledKind" v-model="nodeData.recycledKind" label-key="kindName" value-key="kindCode" :multiple="false"
-                     :options="dataKindList.filter(it=>it.kindType==='回收到达')" />
+          <SelectPop ref="recycledKind" v-model="nodeData.recycledKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false"
+                     :options="dataKindList.filter(it=>it.kindType==='回收到达')"/>
         </DkFormItem>
         <!--    组装方式    -->
-        <DkFormItem prop="packKind" >
-          <SelectPop ref="packKind" v-model="nodeData.packKind" label-key="kindName" value-key="kindCode" :multiple="false"
-                     :options="dataKindList.filter(it=>it.kindType==='产品组装')" />
+        <DkFormItem prop="packKind">
+          <SelectPop ref="packKind" v-model="nodeData.packKind" label-key="kindName" value-key="kindCode"
+                     :multiple="false"
+                     :options="dataKindList.filter(it=>it.kindType==='产品组装')"/>
         </DkFormItem>
         <!--    验证标签    -->
         <DkFormItem prop="flgCheckLabel" :required="true">
           <template>
             <div class="switch">
-              <i-switch ref="flgCheckLabel" v-model="nodeData.flgCheckLabel" >
+              <i-switch ref="flgCheckLabel" v-model="nodeData.flgCheckLabel">
                 <Icon type="md-checkmark" slot="open"></Icon>
                 <Icon type="md-close" slot="close"></Icon>
               </i-switch>
@@ -120,8 +133,9 @@
         </DkFormItem>
         <!--    标签类型    -->
         <DkFormItem prop="pdtLabelKinds">
-          <SelectPop ref="pdtLabelKinds" v-model="nodeData.pdtLabelKinds" label-key="kindName" value-key="kindCode" :multiple="true"
-                     :options="dataKindList.filter(it=>it.kindType==='验证标签')" />
+          <SelectPop ref="pdtLabelKinds" v-model="nodeData.pdtLabelKinds" label-key="kindName" value-key="kindCode"
+                     :multiple="true"
+                     :options="dataKindList.filter(it=>it.kindType==='验证标签')"/>
         </DkFormItem>
         <!--    显示顺序    -->
         <DkFormItem prop="displayNo" :required="true" :data-type="this.$config.dataType.number">
@@ -147,8 +161,8 @@
         <!--    工序在制品    -->
         <EditTable ref="pdtTable" :data="nodeData.pdtList"
                    :columns="pdtColumns"
-                   enabledRepeatId="pdtId"
-                   controlId="pdtId"
+                   enabledRepeatId="modelId"
+                   controlId="pdtModelId"
                    :height="200"
                    :showSeqBtnFlag="false"
                    :enabledRepeat="false"
@@ -156,8 +170,8 @@
         <!--    工序可用载具    -->
         <EditTable ref="carTable" :data="nodeData.carList"
                    :columns="carColumns"
-                   enabledRepeatId="carId"
-                   controlId="carId"
+                   enabledRepeatId="modelId"
+                   controlId="carModelId"
                    :height="200"
                    :showSeqBtnFlag="false"
                    :enabledRepeat="false"
@@ -168,7 +182,7 @@
         <EditTable ref="defectTable" :data="nodeData.defectList"
                    :columns="defectColumns"
                    enabledRepeatId="defectId"
-                   controlId="defectId"
+                   controlId="pdtDefectId"
                    :height="200"
                    :showSeqBtnFlag="false"
                    :enabledRepeat="false"
@@ -177,7 +191,7 @@
         <EditTable ref="jobDefectTable" :data="nodeData.jobDefectList"
                    :columns="jobDefectColumns"
                    enabledRepeatId="defectId"
-                   controlId="defectId"
+                   controlId="pdtDefectId"
                    :height="200"
                    :showSeqBtnFlag="false"
                    :enabledRepeat="false"
@@ -197,20 +211,21 @@
 </template>
 
 <script>
-import {mapState, mapMutations} from 'vuex'
+import { mapState, mapMutations } from 'vuex'
 import Process from '@/view/process/process-flow/config/ProcessConfig'
+
 export default {
   name: 'NodeModal',
   props: {
-    dataKindList:{
-      type:Array,
-      default: ()=>[]
+    dataKindList: {
+      type: Array,
+      default: () => []
     },
-    productGradeList:{
-      type:Array,
-      default: ()=>[]
+    productGradeList: {
+      type: Array,
+      default: () => []
     },
-    flowId:{
+    flowId: {
       type: Number,
       default: undefined,
     },
@@ -221,26 +236,27 @@ export default {
   },
   computed: {
     ...mapState(['process']),
-    id(){
+    id() {
       return this.process.currentNodeId
     },
-    onShow(){//model是否显示
+    onShow() {//model是否显示
       return this.process.nodeModal.display
     }
   },
-  watch:{
+  watch: {
     //当前节点发生变化
-    id(n,o){
-      this.graph = Process.graph;
-      let cell = this.graph.getCellById(this.process.currentNodeId);
-      this.nodeData=cell.data
+    id(n, o) {
+      this.graph = Process.graph
+      let cell = this.graph.getCellById(this.process.currentNodeId)
+      this.nodeData = cell.data
+      this.nodeData.userList=[{"userId":48},{"userId":49,},{"userCode":"010","userName":"010","userId":50}]
     },
     //监听model显示,达到类似onShow的效果
-    onShow(n,o){
-      if(n){
+    onShow(n, o) {
+      if (n) {
         //过滤调节点组并将json解构成新结构数组
-        this.allNodes=this.graph.getNodes().filter(it=>it.shape=='custom-image').map((it)=>{
-          return {id:it.id,name:it.data.nodeName}
+        this.allNodes = this.graph.getNodes().filter(it => it.shape == 'custom-image').map((it) => {
+          return { id: it.id, name: it.data.nodeName }
         })
       }
 
@@ -249,57 +265,104 @@ export default {
   data() {
     let self = this
     return {
-      allNodes:[],
-      graph:null,
+      allNodes: [],
+      graph: null,
       nodeData: {},
-      userColumns:[
+      userColumns: [
         {
           field: 'userCode',
           type: 'tableSelect',
-          controlId:'userId',
+          controlId: 'userId',
           param: () => {
             return {}
           },
           sortBoolean: false,
           dataType: self.$config.tableSelectType.user,
           fieldUpdate: self.$updateColumns.processNodeChooseUser,
-          searchDetailFlag: false
-        , width: 100
+          searchDetailFlag: false,
+          width: 100,
         },
-        {field: 'userName', type: 'disabled', width: 100},
-        {field: 'userType', type: 'disabled', width: 100},
-        {field: 'remarks',  type: 'text', width: 100},
+        { field: 'userName', type: 'disabled', width: 100 },
+        { field: 'userKind', type: 'disabled', width: 100 },
+        { field: 'remarks', type: 'text', width: 100 },
       ],
-      pdtColumns:[
-        // {type: 'seq', width: 60},
-        {field: 'pdtCode', type: 'disabled', width: 100},
-        {field: 'pdtName', type: 'disabled', width: 100},
-        {field: 'pdtType', type: 'disabled', width: 100},
-        {field: 'pdtSpec', type: 'disabled', width: 100},
+      pdtColumns: [
+        {
+          field: 'modelCode',
+          type: 'tableSelect',
+          controlId: 'pdtModelId',
+          param: () => {
+            return {}
+          },
+          sortBoolean: false,
+          dataType: self.$config.tableSelectType.product,
+          fieldUpdate: self.$updateColumns.processNodeChooseProduct,
+          searchDetailFlag: false,
+          width: 100,
+        },
+        { field: 'modelName', type: 'disabled', width: 100 },
+        { field: 'categoryName', type: 'disabled', width: 100 },
+        { field: 'remarks', type: 'text', width: 100 },
       ],
-      carColumns:[
-        {field: 'carId', type: 'disabled', width: 150},
-        {field: 'carName', type: 'disabled', width: 150},
-        {field: 'remarks', type: 'disabled', width: 150},
+      carColumns: [
+        {
+          field: 'modelCode',
+          type: 'tableSelect',
+          controlId: 'carModelId',
+          param: () => {
+            return {}
+          },
+          sortBoolean: false,
+          dataType: self.$config.tableSelectType.carrier,
+          fieldUpdate: self.$updateColumns.processNodeChooseCarrier,
+          searchDetailFlag: false,
+          width: 100,
+        },
+        { field: 'modelName', type: 'disabled', width: 150 },
+        { field: 'remarks', type: 'text', width: 150 },
       ],
-      defectColumns:[
-        {field: 'defectCode', type: 'disabled', width: 100},
-        {field: 'defectName', type: 'disabled', width: 100},
-        {field: 'defectTypes', type: 'disabled', width: 100},
-        {field: 'remarks', type: 'disabled', width: 100},
+      defectColumns: [
+        {
+          field: 'defectCode',
+          type: 'tableSelect',
+          controlId: 'pdtDefectId',
+          param: () => {
+            return {}
+          },
+          sortBoolean: false,
+          dataType: self.$config.tableSelectType.defect,
+          fieldUpdate: self.$updateColumns.processNodeChooseDefect,
+          searchDetailFlag: false,
+          width: 100,
+        },
+        { field: 'defectName', type: 'disabled', width: 100 },
+        { field: 'defectTypesName', type: 'disabled', width: 100 },
+        { field: 'remarks', type: 'text', width: 150 },
       ],
-      jobDefectColumns:[
-        {field: 'jobId', type: 'disabled', width: 100},
-        {field: 'defectCode', type: 'disabled', width: 100},
-        {field: 'defectName', type: 'disabled', width: 100},
-        {field: 'remarks', type: 'disabled', width: 100},
+      jobDefectColumns: [
+        {
+          field: 'defectCode',
+          type: 'tableSelect',
+          controlId: 'pdtDefectId',
+          param: () => {
+            return {}
+          },
+          sortBoolean: false,
+          dataType: self.$config.tableSelectType.defect,
+          fieldUpdate: self.$updateColumns.processNodeChooseDefect,
+          searchDetailFlag: false,
+          width: 100,
+        },
+        { field: 'defectName', type: 'disabled', width: 100 },
+        { field: 'jobId', type: 'disabled', width: 100 },
+        { field: 'remarks', type: 'text', width: 100 },
       ],
-      routerColumns:[
-        {field: 'node1Id', type: 'disabled', width: 90},
-        {field: 'backNodeId', type: 'disabled', width: 90},
-        {field: 'productGrade', type: 'disabled', width: 90},
-        {field: 'moldingSysTags', type: 'disabled', width: 90},
-        {field: 'remarks', type: 'disabled', width: 90},
+      routerColumns: [
+        { field: 'node1Id', type: 'disabled', width: 90 },
+        { field: 'backNodeId', type: 'disabled', width: 90 },
+        { field: 'productGrade', type: 'disabled', width: 90 },
+        { field: 'moldingSysTags', type: 'disabled', width: 90 },
+        { field: 'remarks', type: 'text', width: 90 },
       ],
     }
   },
@@ -307,25 +370,24 @@ export default {
     // console.log('route',this.$route.params.id)
 
   },
-  mounted(){
+  mounted() {
 
   },
   methods: {
-    ...mapMutations(['setProcessNodeModalDisplay','setProcessEdgeModalDisplay']),
+    ...mapMutations(['setProcessNodeModalDisplay', 'setProcessEdgeModalDisplay']),
     /**
      * @desc   : 确定
      * @author : 张潇木
      * @date   : 2023/1/5 10:38
      */
-    modalOk(){
+    modalOk() {
       this.setProcessNodeModalDisplay(false)
-      let cell = this.graph.getCellById(this.process.currentNodeId);
-      this.nodeData.userList = this.$refs.userTable.getTableDataFilter()
-      cell.setData(this.nodeData,{overwrite:true})
+      let cell = this.graph.getCellById(this.process.currentNodeId)
+      cell.setData(this.nodeData, { overwrite: true })
       cell.setAttrs({
         label: { text: this.nodeData.nodeName },
         text: { text: this.nodeData.nodeName },
-      });
+      })
     },
 
     /**
@@ -333,7 +395,13 @@ export default {
      * @author : 张潇木
      * @date   : 2023/1/5 10:38
      */
-    modalCancel(){
+    modalCancel() {
+      console.log('userTable',JSON.stringify(this.$refs.userTable.getTableDataFilter()))
+      console.log('pdtTable',this.$refs.pdtTable.getTableDataFilter())
+      console.log('carTable',this.$refs.carTable.getTableDataFilter())
+      console.log('defectTable',this.$refs.defectTable.getTableDataFilter())
+      console.log('jobDefectTable',this.$refs.jobDefectTable.getTableDataFilter())
+
       this.setProcessNodeModalDisplay(false)
     },
 
@@ -353,7 +421,7 @@ export default {
      * @desc   : 删除用户
      * @author : 张潇木
      * @date   : 2023/2/10 17:19
-    //  */
+     //  */
     // delUser(){
     //   if (this.formData.userList[this.jobIndex] && this.formData.userList[this.jobIndex].staffList) {
     //     this.formData.userList[this.jobIndex].staffList.splice(
@@ -367,13 +435,15 @@ export default {
 </script>
 
 <style scoped>
-/deep/ .ivu-radio-wrapper{
-  font-size: 12px!important;
+/deep/ .ivu-radio-wrapper {
+  font-size: 12px !important;
 }
-.ivu-divider-horizontal{
-  margin: 12px 0!important;
+
+.ivu-divider-horizontal {
+  margin: 12px 0 !important;
 }
-.switch{
+
+.switch {
   height: 28px;
   display: flex;
   align-items: center;

+ 56 - 2
src/components/business/table-select/table-select.vue

@@ -1298,7 +1298,8 @@ export default {
           {field: 'promotionTypeName'},
           {field: 'promotionName'},
         )
-      }//用户
+      }
+      //用户
       else if (this.dataType === this.$config.tableSelectType.user) {
         this.service = this.$service.userService
         this.methodsName = 'selectByCond'
@@ -1322,7 +1323,8 @@ export default {
           {field: 'userCode', minWidth: '40'},
           {field: 'userName', minWidth: '40'},
         ]
-      }//员工
+      }
+      //员工
       else if (this.dataType === this.$config.tableSelectType.staff) {
         this.service = this.$service.commonService
         this.methodsName = 'getStaff'
@@ -1417,6 +1419,58 @@ export default {
           {field: 'placeName', minWidth: '100'},
         ]
       }
+      //载具
+      else if (this.dataType === this.$config.tableSelectType.carrier) {
+        this.service = this.$service.modelCarrierService
+        this.methodsName = 'selectByCond'
+        this.methodsNameDetail = 'selectByCond'
+        // 查询条件
+        this.searchContent = [
+          {
+            valueFormat: {code: 'modelCode'},
+          },
+          {
+            valueFormat: {code: 'modelName'},
+          },
+        ]
+        this.selectKey = 'modelId'
+        this.selectLabel = 'modelName'
+        this.columns = [
+          {field: 'modelCode', width: '120'},
+          {field: 'modelName', width: 'auto'},
+        ]
+        this.columnsDetail = [
+          {field: 'modelCode', width: '150'},
+          {field: 'modelName', width: '150'},
+          {field: 'remarks', width: 'auto'},
+        ]
+      }
+      //缺陷
+      else if (this.dataType === this.$config.tableSelectType.defect) {
+        this.service = this.$service.productDefectService
+        this.methodsName = 'selectByCond'
+        this.methodsNameDetail = 'selectByCond'
+        // 查询条件
+        this.searchContent = [
+          {
+            valueFormat: {code: 'defectCode'},
+          },
+          {
+            valueFormat: {code: 'defectName'},
+          },
+        ]
+        this.selectKey = 'defectId'
+        this.selectLabel = 'defectName'
+        this.columns = [
+          {field: 'defectCode', width: '120'},
+          {field: 'defectName', width: 'auto'},
+        ]
+        this.columnsDetail = [
+          {field: 'defectCode', width: '150'},
+          {field: 'defectName', width: '150'},
+          {field: 'remarks', width: 'auto'},
+        ]
+      }
     },
     /**
      * @desc   : 设置传入数据源的列

+ 2 - 0
src/config/index.js

@@ -579,6 +579,8 @@ export default {
     mould: 'mould',
     productPlace: 'productPlace',
     product: 'product',
+    carrier: 'carrier',
+    defect:'defect',
   },
   /**
    * @desc   : 选择类型

+ 37 - 1
src/libs/update-columns/index.js

@@ -162,7 +162,43 @@ export default {
   processNodeChooseUser:[
     {updateField: 'userId', valueFiled: 'userId'},
     {updateField: 'userCode', valueFiled: 'userCode'},
-    {updateField: 'userType', valueFiled: 'userTypeName'},
+    {updateField: 'userKind', valueFiled: 'userTypeName'},
     {updateField: 'userName', valueFiled: 'userName'},
   ],
+
+  /**
+   * @desc   : 工艺节点弹窗选择在制品
+   * @author : 张潇木
+   * @date   : 2023/2/13 16:52
+   */
+  processNodeChooseProduct:[
+    {updateField: 'pdtModelId', valueFiled: 'modelId'},
+    {updateField: 'modelCode', valueFiled: 'modelCode'},
+    {updateField: 'modelName', valueFiled: 'modelName'},
+    {updateField: 'categoryName', valueFiled: 'categoryName'},
+    {updateField: 'repPdtModelName', valueFiled: 'repPdtModelName'},
+  ],
+
+  /**
+   * @desc   : 工艺节点弹窗选择载具
+   * @author : 张潇木
+   * @date   : 2023/2/13 16:52
+   */
+  processNodeChooseCarrier:[
+    {updateField: 'carModelId', valueFiled: 'modelId'},
+    {updateField: 'modelCode', valueFiled: 'modelCode'},
+    {updateField: 'modelName', valueFiled: 'modelName'},
+  ],
+  /**
+   * @desc   : 工艺节点弹窗选择缺陷
+   * @author : 张潇木
+   * @date   : 2023/2/13 16:52
+   */
+  processNodeChooseDefect:[
+    {updateField: 'pdtDefectId', valueFiled: 'defectId'},
+    {updateField: 'defectCode', valueFiled: 'defectCode'},
+    {updateField: 'defectName', valueFiled: 'defectName'},
+    {updateField: 'defectTypesName', valueFiled: 'defectTypesName'},
+    {updateField: 'jobId', valueFiled: 'defJobId'},
+  ],
 }

+ 0 - 138
src/view/mst/product-view/config/NodeGroup.js

@@ -1,138 +0,0 @@
-/**
- * @desc   : 自定义节点群组
- * @author : 张潇木
- * @date   : 2023/1/6 16:38
- */
-import { Graph,Node } from '@antv/x6'
-
-export class NodeGroup extends Node {
-
-  // region 属性
-  collapsed = true //群组的状态,默认为收起
-  expandSize = undefined //群组展开时的大小
-  // endregion
-
-  // region 构造方法
-  postprocess() {
-    // 特殊处理,否则会出现群组内部节点位置改变时,群组自动收起的bug
-    // 如果存在子节点,那么不调用收起/展开方法
-    if(!this.children){
-      this.toggleCollapse(true)
-    }
-  }
-  // endregion
-
-  // region 获取当前节点展开状态
-  isCollapsed() {
-    console.log('isCollapsed')
-    return this.collapsed
-  }
-  // endregion
-
-  // region 收起/展开群组事件
-  toggleCollapse(collapsed) {
-    const target = collapsed == null ? !this.collapsed : collapsed
-    if (target) {
-      this.attr('buttonSign', { d: 'M 1 5 9 5 M 5 1 5 9' })
-      this.expandSize=this.getSize()
-      this.resize(100, 40)
-    } else {
-      this.attr('buttonSign', { d: 'M 2 5 8 5' })
-      if (this.expandSize) {
-        this.resize(this.expandSize.width, this.expandSize.height)
-      }else{
-        this.resize(240, 240)
-      }
-    }
-    this.collapsed = target
-  }
-  // endregion
-
-}
-
-// region 群组配置
-NodeGroup.config({
-  shape: 'rect',
-  markup: [
-    {
-      tagName: 'rect',
-      selector: 'body',
-    },
-    {
-      tagName: 'image',
-      selector: 'image',
-    },
-    {
-      tagName: 'text',
-      selector: 'text',
-    },
-    {
-      tagName: 'g',
-      selector: 'buttonGroup',
-      children: [
-        {
-          tagName: 'rect',
-          selector: 'button',
-          attrs: {
-            'pointer-events': 'visiblePainted',
-          },
-        },
-        {
-          tagName: 'path',
-          selector: 'buttonSign',
-          attrs: {
-            fill: 'none',
-            'pointer-events': 'none',
-          },
-        },
-      ],
-    },
-  ],
-  attrs: {
-    body: {
-      refWidth: '100%',
-      refHeight: '100%',
-      strokeWidth: 1,
-      fill: 'rgba(95,149,255,0.05)',
-      stroke: '#5F95FF',
-    },
-    image: {
-      'xlink:href': 'https://gw.alipayobjects.com/mdn/rms_0b51a4/afts/img/A*X4e0TrDsEiIAAAAAAAAAAAAAARQnAQ',
-      width: 16,
-      height: 16,
-      x: 8,
-      y: 12,
-    },
-    text: {
-      fontSize: 12,
-      fill: 'rgba(0,0,0,0.85)',
-      refX: 30,
-      refY: 15,
-    },
-    buttonGroup: {
-      refX: '100%',
-      refX2: -25,
-      refY: 13,
-    },
-    button: {
-      height: 14,
-      width: 16,
-      rx: 2,
-      ry: 2,
-      fill: '#f5f5f5',
-      stroke: '#ccc',
-      cursor: 'pointer',
-      event: 'node:collapse',
-    },
-    buttonSign: {
-      refX: 3,
-      refY: 2,
-      stroke: '#808080',
-    },
-  },
-})
-// endregion
-
-// region 注册群组节点
-Graph.registerNode('groupNode', NodeGroup)
-// endregion

+ 0 - 881
src/view/mst/product-view/config/ProcessConfig.js

@@ -1,881 +0,0 @@
-import { Graph, Shape,FunctionExt,BackgroundManager } from '@antv/x6'
-import { Stencil } from '@antv/x6-plugin-stencil'
-import { Transform } from '@antv/x6-plugin-transform'
-import { Selection } from '@antv/x6-plugin-selection'
-import { Snapline } from '@antv/x6-plugin-snapline'
-import { Keyboard } from '@antv/x6-plugin-keyboard'
-import { Clipboard } from '@antv/x6-plugin-clipboard'
-import { History } from '@antv/x6-plugin-history'
-import { Export } from "@antv/x6-plugin-export";
-import { getImg } from '../../../../libs/base/x6-utils'
-import {mapState, mapMutations} from 'vuex'
-import store from '@/store'
-import './NodeGroup'
-const insertCss = require('insert-css')
-const zt1 = require('../data/zt1.json')
-
-
-
-//region 插入动画样式
-insertCss(`
-        @keyframes ant-line {
-          to {
-              stroke-dashoffset: -1000
-          }
-        }
-      `)
-//endregion 不通过insertCss的方式,只写样式,动画无效
-
-/**
- * @desc   : 工艺流程图初始化配置
- * @author : 张潇木
- * @date   : 2023/1/3 11:46
- */
-export default class Process {
-
-  static graph = null //图形对象
-  static embedPadding = 30 // 触发群组动态调整大小的padding
-  ctrlPressed = false//ctrl键是是否按下
-
-  // region 初始化图形
-  static init(dom){
-
-    // region 画布配置
-    this.graph = new Graph( {
-      container: dom,//获取节点
-      background: {color: '#F2F7FA',},//画布背景色
-      autoResize:true,//自动设置宽高
-      panning: {//开启拖拽画布
-        enabled: true,
-        eventTypes: 'rightMouseDown',//触发画布平移的交互方式为“右键按下”
-      },
-      grid: {//设置网格
-        size: 10,
-        visible: true,
-        type: "doubleMesh",
-        args: [
-          {
-            color: "#eee", // 主网格线颜色
-            thickness: 1, // 主网格线宽度
-          },
-          {
-            color: "#ddd", // 次网格线颜色
-            thickness: 1, // 次网格线宽度
-            factor: 4, // 主次网格线间隔
-          },
-        ],
-      },
-      mousewheel: {//鼠标滚轮缩放画布
-        enabled: true,
-        zoomAtMousePosition: true,
-        modifiers: 'ctrl',
-        minScale: 0.5,
-        maxScale: 3,
-        factor: 1.1,//滚动缩放因子。默认为 1.2
-      },
-      connecting: {//连接
-        line: {
-          stroke: '#A2B1C3',
-          strokeWidth: 3,
-          strokeDasharray: 5,
-          style: {
-            animation: 'ant-line 30s infinite linear',
-          },
-        },
-        router: {
-          name: 'metro',
-        },
-        connector: {
-          name: 'jumpover',
-          args: {
-            radius: 8,
-            size:12,
-          },
-        },
-        anchor: 'center',
-        connectionPoint: 'anchor',
-        allowBlank: false,
-        snap: {
-          radius: 20,
-        },
-        //创建边
-        createEdge() {
-          return new Shape.Edge({
-            attrs: {
-              line: {
-                stroke: '#A2B1C3',
-                strokeWidth: 3,
-                strokeDasharray: 6,
-                style: {
-                  animation: 'ant-line 30s infinite linear',
-                },
-              },
-            },
-            zIndex: 0,
-            router: {
-              name: 'metro',
-            },
-            connector: {
-              name: 'jumpover',
-              args: {
-                radius: 8,
-                size:12,
-              },
-            },
-            data:{}
-          })
-        },
-        validateConnection({ targetMagnet }) {
-          return !!targetMagnet
-        },
-      },
-      highlighting: {//高亮
-        magnetAdsorbed: {//连线过程中,自动吸附到连接桩时被使用
-          name: 'stroke',
-          args: {
-            attrs: {
-              "stroke-width": 2,
-              fill: '#5F95FF',
-              stroke: 'white',
-            },
-          },
-        },
-      },
-      embedding: {//是否开启嵌套节点
-        enabled: true,
-        findParent({ node }) {
-          const bbox = node.getBBox()
-          return this.getNodes().filter((n) => {
-            // 如果拖拽的节点本身就是一个节点组,则不允许进入另一个节点组中
-            if(node.data&&node.data.parent){
-              return false
-            }
-            // 只有 data.parent 为 true 的节点才是父节点
-            const data = n.getData()
-            if (data && data.parent) {
-              const targetBBox = n.getBBox()
-              return bbox.isIntersectWithRect(targetBBox)
-            }
-            return false
-          })
-        },
-      },
-    })
-    // endregion
-
-
-    // region 注册插件
-    this.graph.use(new Transform({
-      resizing: true,
-      rotating: true,
-    }))
-      .use(new Selection({
-        enabled: true,
-        multiple: true,//是否启用点击多选,启用后按住 ctrl 或 command 键点击节点实现多选
-        rubberband: true,//是否启用多选节点功能
-        showNodeSelectionBox: true,//是否显示节点的选择框
-      }))
-      .use(new Snapline({
-        enabled: true,
-      }))
-      .use(new Keyboard({
-        enabled: true,
-      }))
-      .use(new Clipboard({
-        enabled: true,
-      }))
-      .use(new History({
-        enabled: true,
-      }))
-      .use(new Export({
-          enabled:true
-        }
-      ));
-    // endregion
-
-
-    // region 左侧工具栏配置
-    const stencil = new Stencil({
-      title: '产品视图',
-      target: this.graph,
-      stencilGraphWidth: 200,
-      stencilGraphHeight: 180,
-      collapsable: true,
-      groups: [
-        {
-          title: '节点组',
-          name: 'group',
-          graphHeight: 80,
-          layoutOptions: {
-            columns: 1,
-            marginX: 35,
-          },
-        },
-        {
-          title: '特殊模型',
-          name: 'c4',
-          graphHeight: 450,
-          layoutOptions: {
-            rowHeight: 70,
-          },
-        },
-      ],
-      layoutOptions: {
-        columns: 2,
-        columnWidth: 80,
-        rowHeight: 55,
-      },
-      placeholder:'搜索...',
-      notFoundText:'未搜索到结果',
-      //搜索方法
-      search: (cell, keyword, groupName, stencil) => {
-        if (keyword) {
-          return cell.attr("text/text").includes(keyword);
-        }
-        return true;
-      },
-      // getDropNode(node) {
-      //   console.log(node.prop())
-      // }
-    })
-    document.getElementById('stencil').appendChild(stencil.container)
-    // endregion
-
-    // region 注册快捷键与事件
-
-
-
-    // region 复制
-    this.graph.bindKey(['meta+c', 'ctrl+c'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        this.graph.copy(cells)
-      }
-      return false
-    })
-    // endregion
-
-    // region 剪切
-    this.graph.bindKey(['meta+x', 'ctrl+x'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        this.graph.cut(cells)
-      }
-      return false
-    })
-    // endregion
-
-    // region 粘贴
-    this.graph.bindKey(['meta+v', 'ctrl+v'], () => {
-      if (!this.graph.isClipboardEmpty()) {
-        const cells = this.graph.paste({ offset: 32 })
-        this.graph.cleanSelection()
-        this.graph.select(cells)
-      }
-      return false
-    })
-    // endregion
-
-    // region 撤销
-    this.graph.bindKey(['meta+z', 'ctrl+z'], () => {
-      if (this.graph.canUndo()) {
-        this.graph.undo()
-      }
-      return false
-    })
-    // endregion
-
-    // region 撤回撤销
-    this.graph.bindKey(['meta+shift+z', 'ctrl+shift+z'], () => {
-      if (this.graph.canRedo()) {
-        this.graph.redo()
-      }
-      return false
-    })
-    // endregion
-
-    // region 全选
-    this.graph.bindKey(['meta+alt+a', 'ctrl+alt+a'], () => {
-      const nodes = this.graph.getNodes()
-      if (nodes) {
-        this.graph.select(nodes)
-      }
-    })
-    // endregion
-
-    // region 删除
-    this.graph.bindKey(['backspace','del'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        this.graph.removeCells(cells)
-      }
-    })
-    // endregion
-
-    // region 调整大小
-    this.graph.bindKey(['ctrl+alt++', 'meta++'], () => {
-      const zoom = this.graph.zoom()
-      if (zoom < 1.5) {
-        this.graph.zoom(0.1)
-      }
-    })
-    this.graph.bindKey(['ctrl+alt+-', 'meta+-'], () => {
-      const zoom = this.graph.zoom()
-      if (zoom > 0.5) {
-        this.graph.zoom(-0.1)
-      }
-    })
-    // endregion
-
-    // region 向上移动
-    this.graph.bindKey(['up'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        cells.forEach(cell=>{
-          const y = cell.prop().position.y
-          const x = cell.prop().position.x
-          cell.prop("position", { x: x, y: y-5 });
-        })
-      }
-    })
-    // endregion
-
-    // region 向下移动
-    this.graph.bindKey(['down'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        cells.forEach(cell=>{
-          const y = cell.prop().position.y
-          const x = cell.prop().position.x
-          cell.prop("position", { x: x, y: y+5 });
-        })
-      }
-    })
-    // endregion
-
-    // region 向左移动
-    this.graph.bindKey(['left'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        cells.forEach(cell=>{
-          const y = cell.prop().position.y
-          const x = cell.prop().position.x
-          cell.prop("position", { x: x-5, y: y });
-        })
-      }
-    })
-    // endregion
-
-    // region 向右移动
-    this.graph.bindKey(['right'], () => {
-      const cells = this.graph.getSelectedCells()
-      if (cells.length) {
-        cells.forEach(cell=>{
-          const y = cell.prop().position.y
-          const x = cell.prop().position.x
-          cell.prop("position", { x: x+5, y: y });
-        })
-      }
-    })
-    // endregion
-
-    // region 鼠标移入移出 连接桩显示/隐藏
-    this.graph.on('node:mouseenter', FunctionExt.debounce(() => {
-      const ports =  dom.querySelectorAll('.x6-port-body')
-      this.showPorts(ports, true)
-    }), 500,)
-
-    this.graph.on('node:mouseleave', () => {
-      const ports =  dom.querySelectorAll('.x6-port-body')
-      this.showPorts(ports, false)
-    })
-    // endregion
-
-    // region 鼠标移入移出 动态添加连接线托拽工具
-    this.graph.on('edge:mouseenter', ({ cell }) => {
-      cell.addTools([
-        {
-          name: 'vertices',
-          args: {
-            // 移动路径点过程中的吸附半径。当路径点与邻近的路径点的某个坐标 (x, y) 距离在半径范围内时,将当前路径点的对应坐标 (x, y) 吸附到邻居路径的路径点。
-            snapRadius: 5,
-            // 在边上按下鼠标时,是否可以添加新的路径点。
-            addable: true,
-            // 是否可以通过双击移除路径点。
-            removable: true,
-            // 是否自动移除冗余的路径点。
-            removeRedundancies: true,
-            // 是否阻止工具上的鼠标事件冒泡到边视图上。阻止后鼠标与工具交互时将不会触发边的 mousedown、mousemove 和 mouseup 事件。
-            stopPropagation: false
-          }
-        }
-      ])
-    })
-    this.graph.on('edge:mouseleave', ({ cell }) => {
-      cell.removeTools()
-    })
-    //endregion
-
-    // region 右键连接线进入编辑模式
-    this.graph.on('edge:contextmenu', ({ cell, e }) => {
-      // console.log("右键连线-prop",cell.prop())
-      // console.log("右键连线-attr",cell.attr())
-      // console.log("右键连线-data",cell.data)
-      //设置值
-      store.commit('setCurrentEdgeId',cell.id)
-      //显示弹窗
-      store.commit('setProcessEdgeModalDisplay',true)
-    })
-    // endregion
-
-    // region 右键节点进入编辑模式
-    this.graph.on('node:contextmenu', ({ node, e }) => {
-      // console.log("右键节点",node)
-      // console.log("右键节点-id",node.id)
-      // console.log("右键节点-prop",node.prop())
-      // console.log("右键节点-attr",node.attr())
-      // console.log("右键节点-data",node.data)
-      //如果是节点组,不打开弹窗
-      if (node.data && node.data.parent) {
-        return;
-      }
-      //设置值
-      store.commit('setCurrentNodeId',node.id)
-      //显示弹窗
-      store.commit('setProcessNodeModalDisplay',true)
-    })
-    // endregion
-
-    // region 节点组展开/收起
-    this.graph.on('node:collapse', ({ node, e }) => {
-      e.stopPropagation()
-      node.toggleCollapse()
-      const collapsed = node.isCollapsed()
-      const cells = node.getDescendants()
-      cells.forEach(n => {
-        if (collapsed) {
-          n.hide()
-        } else {
-          n.show()
-        }
-      })
-    })
-    // endregion
-
-    // region 节点的父级发生改变
-    this.graph.on('node:change:parent', ({ node }) => {
-      // console.log('change:parent',node)
-    })
-    // endregion
-
-    // region 节点的子级发生改变
-    this.graph.on('node:change:children',({node,previous,current})=>{
-      if(previous&&current&&previous.length>current.length){
-        console.log('移出')
-        this.getSelectedCells().forEach(it=>{
-          node.unembed(it);
-        })
-      }
-    })
-    // endregion
-
-    // region 节点的移入事件(父级、嵌套关系发生改变)
-    this.graph.on('node:embedded',({node})=>{
-      // debugger
-      console.log("embedded",node.id,node.getParent())
-      //如果所选所有节点的parent都一致,直接return
-      let cells=this.getSelectedCells()
-      if(cells.some((e) => cells.filter((e1) => e1.getParent() !== e.getParent()).length >0 )){
-        console.log('存在不相同')
-        let parent=node.getParent()
-        let other =cells.filter((c) => c.id!==node.id)
-        other.forEach(it=>{
-          parent.embed(it);
-        })
-      }else{
-        console.log('都相同')
-        // return
-      }
-    })
-    // endregion
-
-    // region 根据群组内部节点位置动态调整群组宽高
-    this.graph.on('node:embedding', ({ e }) => {
-      this.ctrlPressed = e.metaKey || e.ctrlKey
-    })
-
-    this.graph.on('node:embedded', () => {
-      this.ctrlPressed = false
-    })
-
-    this.graph.on('node:change:size', ({ node, options }) => {
-      if (options.skipParentHandler) {
-        return
-      }
-
-      const children = node.getChildren()
-      if (children && children.length) {
-        node.prop('originSize', node.getSize())
-      }
-    })
-
-    this.graph.on('node:change:position', ({ node, options }) => {
-      if (options.skipParentHandler || this.ctrlPressed) {
-        return
-      }
-
-      const children = node.getChildren()
-      if (children && children.length) {
-        node.prop('originPosition', node.getPosition())
-      }
-
-      const parent = node.getParent()
-      if (parent && parent.isNode()) {
-        let originSize = parent.prop('originSize')
-        if (originSize == null) {
-          originSize = parent.getSize()
-          parent.prop('originSize', originSize)
-        }
-
-        let originPosition = parent.prop('originPosition')
-        if (originPosition == null) {
-          originPosition = parent.getPosition()
-          parent.prop('originPosition', originPosition)
-        }
-
-        let x = originPosition.x
-        let y = originPosition.y
-        let cornerX = originPosition.x + originSize.width
-        let cornerY = originPosition.y + originSize.height
-        let hasChange = false
-
-        const children = parent.getChildren()
-        if (children) {
-          children.forEach((child) => {
-            const bbox = child.getBBox().inflate(this.embedPadding)
-            const corner = bbox.getCorner()
-
-            if (bbox.x < x) {
-              x = bbox.x
-              hasChange = true
-            }
-
-            if (bbox.y < y) {
-              y = bbox.y
-              hasChange = true
-            }
-
-            if (corner.x > cornerX) {
-              cornerX = corner.x
-              hasChange = true
-            }
-
-            if (corner.y > cornerY) {
-              cornerY = corner.y
-              hasChange = true
-            }
-          })
-        }
-        // console.log('hasChange',hasChange)
-        if (hasChange) {
-          parent.prop(
-            {
-              position: { x, y },
-              size: { width: cornerX - x, height: cornerY - y },
-            },
-            { skipParentHandler: true },
-          )
-        }
-      }
-    })
-    // endregion
-
-    // region 监听添加节点事件
-    this.graph.on("node:added", ({ node }) => {
-      // 将添加的节点组置为最底层
-      if (node.data && node.data.parent) {
-        node.toBack()
-      }
-    });
-    // endregion
-
-    // endregion
-
-    // region 图形配置
-
-    // region 节点上下左右的四个连接桩
-    const ports = {
-      groups: {
-        top: {
-          position: 'top',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#5F95FF',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-        right: {
-          position: 'right',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#5F95FF',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-        bottom: {
-          position: 'bottom',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#5F95FF',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-        left: {
-          position: 'left',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#5F95FF',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-      },
-      items: [
-        {
-          group: 'top',
-        },
-        {
-          group: 'right',
-        },
-        {
-          group: 'bottom',
-        },
-        {
-          group: 'left',
-        },
-      ],
-    }
-    // endregion
-
-    // region 注册自定义节点
-    Graph.registerNode(
-      'custom-rect',
-      {
-        inherit: 'rect',
-        width: 66,
-        height: 36,
-        attrs: {
-          body: {
-            strokeWidth: 1,
-            stroke: '#5F95FF',
-            fill: '#EFF4FF',
-          },
-          text: {
-            fontSize: 12,
-            fill: '#262626',
-          },
-        },
-        ports: { ...ports },
-      },
-      true,
-    )
-
-    Graph.registerNode(
-      'custom-polygon',
-      {
-        inherit: 'polygon',
-        width: 66,
-        height: 36,
-        attrs: {
-          body: {
-            strokeWidth: 1,
-            stroke: '#5F95FF',
-            fill: '#EFF4FF',
-          },
-          text: {
-            fontSize: 12,
-            fill: '#262626',
-          },
-        },
-        ports: {
-          ...ports,
-          items: [
-            {
-              group: 'top',
-            },
-            {
-              group: 'bottom',
-            },
-          ],
-        },
-      },
-      true,
-    )
-
-    Graph.registerNode(
-      'custom-circle',
-      {
-        inherit: 'circle',
-        width: 45,
-        height: 45,
-        attrs: {
-          body: {
-            strokeWidth: 1,
-            stroke: '#5F95FF',
-            fill: '#EFF4FF',
-          },
-          text: {
-            fontSize: 12,
-            fill: '#262626',
-          },
-        },
-        ports: { ...ports },
-      },
-      true,
-    )
-
-    Graph.registerNode(
-      'custom-image',
-      {
-        inherit: 'rect',
-        width: 64,
-        height: 64,
-        markup: [
-          {
-            tagName: 'rect',
-            selector: 'body',
-          },
-          {
-            tagName: 'image',
-          },
-          {
-            tagName: 'text',
-            selector: 'label',
-          },
-        ],
-        attrs: {
-          body: {
-            stroke: '#87CEFA',
-            fill: '#1E90FF',
-          },
-          image: {
-            width: 32,
-            height: 32,
-            refX: 22,
-            refY: 22,
-          },
-          label: {
-            refX:6,
-            refY:6,
-            textAnchor: 'left',
-            textVerticalAnchor: 'top',
-            fontSize: 12,
-            fill: '#fff',
-          },
-        },
-        ports: { ...ports },
-      },
-      true,
-    )
-
-
-    // region 节点组
-    const g1 = this.graph.createNode({
-      shape: 'groupNode',
-      zIndex: 0,
-      attrs: {
-        text: {
-          text: '节点组',
-        },
-      },
-      data: {
-        parent: true,
-      },
-    })
-    stencil.load([g1], 'group')
-    // endregion
-
-    // endregion
-
-    //region 创建工艺节点图元素节点
-    const imageShapes = [
-      {
-        label: '交坯',
-        image:getImg('交坯.png'),
-      },
-    ]
-    const imageNodes = imageShapes.map((item) =>
-      //创建节点事件
-      this.graph.createNode({
-        shape: 'custom-image',
-        label: item.label,
-        attrs: {
-          image: {
-            'xlink:href': item.image,
-          },
-        },
-        data:{
-          nodeName:item.label,
-        }
-        // shape: 'image', //可选值:Rect Circle Ellipse Polygon Polyline Path Image HTML TextBlock BorderedImage EmbeddedImage InscribedImage Cylinder
-        // imageUrl: item.image,
-        // width: 52,
-        // height: 52,
-      }),
-    )
-    stencil.load(imageNodes, 'c4')
-    //endregion
-
-    // endregion
-
-
-
-    return this.graph
-  }
-  // endregion
-
-
-  // region 显示/隐藏连接桩事件
-  static showPorts(ports, show) {
-    for (let i = 0, len = ports.length; i < len; i = i + 1) {
-      ports[i].style.visibility = show ? 'visible' : 'hidden'
-    }
-  }
-  // endregion
-
-
-  // region 获取所有选中的节点
-  static getSelectedCells() {
-    return this.graph.getSelectedCells();
-  }
-  // endregion
-
-
-}

+ 0 - 1
src/view/mst/product-view/config/ProductView.js

@@ -8,7 +8,6 @@ import { Clipboard } from '@antv/x6-plugin-clipboard'
 import { History } from '@antv/x6-plugin-history'
 import { Export } from "@antv/x6-plugin-export";
 import store from '@/store'
-import './NodeGroup'
 const insertCss = require('insert-css')
 
 

+ 1 - 0
src/view/process/process-flow/process-setting.vue

@@ -43,6 +43,7 @@ import Process from '@/view/process/process-flow/config/ProcessConfig'
 import {formMixin} from '@/mixins/form'
 
 export default {
+  name: 'process-setting',
   mixins: [formMixin],
   components: { NodeModal,EdgeModal },
   props: {