wente
2024-03-14 de1b6284b3cb6349575938782ee34d2ad0349735
表决数量
3个文件已修改
278 ■■■■■ 已修改文件
web/src/views/modules/taskReliability/ConfigNode/index.vue 221 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/ModelRbd.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/RBD-edit-img.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/ConfigNode/index.vue
@@ -3,15 +3,11 @@
  <el-card style="height: 100%">
    <el-tabs v-model="activeName" id="tabPane">
      <el-tab-pane label="属性"  name="first">
        <el-row :gutter="5" v-show="shape!=='custom-circle1'"  align="middle" style="margin-top:20px">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">节点名称</el-col>
          <el-col :span=16 >
        <el-form :model="globalGridAttr">
          <el-form-item v-show="shape!=='custom-circle1'" label="节点名称" prop="nodeText" label-width="80px">
            <el-input  v-model="globalGridAttr.nodeText" style="width:100%" @change="onTextChange"></el-input>
          </el-col>
        </el-row>
        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">连接关系</el-col>
          <el-col :span=16>
          </el-form-item>
          <el-form-item v-show="nodeType=='node'" label="连接关系" prop="nodeTypeExt" label-width="80px">
            <el-select style="width: 100%" v-model="globalGridAttr.nodeTypeExt" @change="onNodeTypeExtChange">
              <el-option
                v-for="item in options"
@@ -20,14 +16,66 @@
                :value="item.value">
              </el-option>
            </el-select>
          </el-col>
        </el-row>
        <el-row :gutter="5" v-show="nodeType=='node' && showNumberInput" align="middle" style="margin-top:20px;">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">数量</el-col>
          <el-col :span=16>
            <el-input type="number" v-model="globalGridAttr.numberInputValue" @change="onNumberInputValue"  placeholder="请输入数字"></el-input>
          </el-col>
        </el-row>
          </el-form-item>
          <el-form-item v-show="nodeType=='vote' || (nodeType=='node' && showNumberInput)" label="表决数量" prop="voteNum" label-width="80px">
            <el-input type="number" v-model="globalGridAttr.voteNum" @change="onNumberInputValue"  placeholder="请输入数字"></el-input>
          </el-form-item>
          <el-form-item v-show="nodeType=='node'" label="可靠性分布类型" prop="reliabDistribType" label-width="125px">
            <zt-dict style="width: 100%" v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" dict="ReliabDistribType" placeholder="可靠性分布类型" clearable/>
          </el-form-item>
          <el-form-item v-show="nodeType=='node'" label="MTBCF" prop="taskMtbcf" label-width="80px">
            <el-input  v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input>
          </el-form-item>
          <el-form-item v-show="nodeType=='node'" label="参数2" prop="taskMtbcfOther" label-width="80px">
            <el-input  v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input>
          </el-form-item>
          <el-form-item v-show="nodeType=='node'" label="是否可维修" prop="isRepair" label-width="100px">
            <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">
              <el-option
                  v-for="item in isRepair"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <div v-show="nodeType=='node' && showRepairInput">
            <el-form-item label="可维修性分布类型" prop="repairDistribType" label-width="140px">
              <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" @input="onRepairDistribTypeChange" placeholder="维修性分布类型" clearable/>
            </el-form-item>
            <el-form-item label="MTTCR" prop="repairMttcr" label-width="80px">
              <el-input  v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input>
            </el-form-item>
            <el-form-item label="参数2" prop="repairMttcrOther" label-width="80px">
              <el-input  v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input>
            </el-form-item>
          </div>
        </el-form>
<!--        <el-row :gutter="5" v-show="shape!=='custom-circle1'"  align="middle" style="margin-top:20px">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">节点名称</el-col>-->
<!--          <el-col :span=16 >-->
<!--            <el-input  v-model="globalGridAttr.nodeText" style="width:100%" @change="onTextChange"></el-input>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">连接关系</el-col>-->
<!--          <el-col :span=16>-->
<!--            <el-select style="width: 100%" v-model="globalGridAttr.nodeTypeExt" @change="onNodeTypeExtChange">-->
<!--              <el-option-->
<!--                v-for="item in options"-->
<!--                :key="item.value"-->
<!--                :label="item.label"-->
<!--                :value="item.value">-->
<!--              </el-option>-->
<!--            </el-select>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <el-row :gutter="5" v-show="nodeType=='node' && showNumberInput" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">表决数量</el-col>-->
<!--          <el-col :span=16>-->
<!--            <el-input type="number" v-model="globalGridAttr.voteNum" @change="onNumberInputValue"  placeholder="请输入数字"></el-input>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">状态</el-col>-->
<!--          <el-col :span=16>-->
@@ -41,57 +89,57 @@
<!--            </el-select>-->
<!--          </el-col>-->
<!--        </el-row>-->
        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">可靠性分布类型</el-col>
          <el-col :span=16>
            <zt-dict v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" dict="ReliabDistribType" placeholder="可靠性分布类型" clearable/>
          </el-col>
        </el-row>
        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">MTBCF</el-col>
          <el-col :span=16>
            <el-input  type="number" v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input>
          </el-col>
        </el-row>
        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">参数2</el-col>
          <el-col :span=16>
            <el-input  v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input>
          </el-col>
        </el-row>
        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
          <el-col :span=8 style="font-size: 16px;line-height: 32px">是否可维修</el-col>
          <el-col :span=16>
            <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">
              <el-option
                  v-for="item in isRepair"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
          </el-col>
        </el-row>
        <div v-show="nodeType=='node' && showRepairInput">
          <el-row :gutter="5"  align="middle" style="margin-top:20px;">
            <el-col :span=8 style="font-size: 16px;line-height: 32px">可维修性分布类型</el-col>
            <el-col :span=16>
              <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" @input="onRepairDistribTypeChange" placeholder="维修性分布类型" clearable/>
            </el-col>
          </el-row>
          <el-row :gutter="5"  align="middle" style="margin-top:20px;">
            <el-col :span=8 style="font-size: 16px;line-height: 32px">MTTCR</el-col>
            <el-col :span=16>
              <el-input  type="number" v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input>
            </el-col>
          </el-row>
          <el-row :gutter="5"  align="middle" style="margin-top:20px;">
            <el-col :span=8 style="font-size: 16px;line-height: 32px">参数2</el-col>
            <el-col :span=16>
              <el-input  v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input>
            </el-col>
          </el-row>
        </div>
<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">可靠性分布类型</el-col>-->
<!--          <el-col :span=16>-->
<!--            <zt-dict v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" dict="ReliabDistribType" placeholder="可靠性分布类型" clearable/>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">MTBCF</el-col>-->
<!--          <el-col :span=16>-->
<!--            <el-input  v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">参数2</el-col>-->
<!--          <el-col :span=16>-->
<!--            <el-input  v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">是否可维修</el-col>-->
<!--          <el-col :span=16>-->
<!--            <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">-->
<!--              <el-option-->
<!--                  v-for="item in isRepair"-->
<!--                  :key="item.value"-->
<!--                  :label="item.label"-->
<!--                  :value="item.value">-->
<!--              </el-option>-->
<!--            </el-select>-->
<!--          </el-col>-->
<!--        </el-row>-->
<!--        <div v-show="nodeType=='node' && showRepairInput">-->
<!--          <el-row :gutter="5"  align="middle" style="margin-top:20px;">-->
<!--            <el-col :span=8 style="font-size: 16px;line-height: 32px">可维修性分布类型</el-col>-->
<!--            <el-col :span=16>-->
<!--              <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" @input="onRepairDistribTypeChange" placeholder="维修性分布类型" clearable/>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="5"  align="middle" style="margin-top:20px;">-->
<!--            <el-col :span=8 style="font-size: 16px;line-height: 32px">MTTCR</el-col>-->
<!--            <el-col :span=16>-->
<!--              <el-input  v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="5"  align="middle" style="margin-top:20px;">-->
<!--            <el-col :span=8 style="font-size: 16px;line-height: 32px">参数2</el-col>-->
<!--            <el-col :span=16>-->
<!--              <el-input  v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--        </div>-->
      </el-tab-pane>
      <el-tab-pane label="样式"  name="second">
        <el-row :gutter="5" align="middle" style="margin-top:20px">
@@ -249,11 +297,11 @@
    },
    // 表决数量
    onNumberInputValue(e){
      this.globalGridAttr.voteSum = e
      let voteSum={
        voteSum:this.globalGridAttr.voteSum
      this.globalGridAttr.voteNum = e
      let voteNum={
        voteNum:this.globalGridAttr.voteNum
      }
      this.curCel.setData(voteSum)
      this.curCel.setData(voteNum)
      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
    },
    // 可靠性分布类型
@@ -267,21 +315,34 @@
    },
    // mtbf
    onTaskMtbcfChange(e){
      const numberRegex = /^-?\d+(\.\d+)?$/
      if(numberRegex.test(e)){
      this.globalGridAttr.taskMtbcf =e
      let taskMtbcf={
        taskMtbcf:this.globalGridAttr.taskMtbcf
      }
      this.curCel.setData(taskMtbcf)
      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
      }else {
        this.$message.error('输入格式有误,请输入实数')
      }
    },
    // 参数2
    onTaskMtbcfOtherChange(e){
      const numberRegex = /^-?\d+(\.\d+)?$/
      console.log(e,'eeeee')
      if(numberRegex.test(e)){
      this.globalGridAttr.taskMtbcfOther = e
      let taskMtbcfOther={
        taskMtbcfOther:this.globalGridAttr.taskMtbcfOther
      }
      this.curCel.setData(taskMtbcfOther)
      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
      }else {
        this.$message.error('输入格式有误,请输入实数')
      }
    },
    // 是否可维修
    onIsRepairChange(e){
@@ -304,21 +365,32 @@
    },
    // Mttcr
    onRepairMttcrChange(e){
      const numberRegex = /^-?\d+(\.\d+)?$/
      if(numberRegex.test(e)){
      this.globalGridAttr.repairMttcr = e
      let repairMttcr={
        repairMttcr:this.globalGridAttr.repairMttcr
      }
      this.curCel.setData(repairMttcr)
      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
      }else {
        this.$message.error('输入格式有误,请输入实数')
      }
    },
    // 可维修性分布类型 参数2
    onRepairMttcrOtherChange(e){
      const numberRegex = /^-?\d+(\.\d+)?$/
      if(numberRegex.test(e)) {
      this.globalGridAttr.repairMttcrOther = e
      let repairMttcrOther={
        repairMttcrOther:this.globalGridAttr.repairMttcrOther
      }
      this.curCel.setData(repairMttcrOther)
      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
      }else {
        this.$message.error('输入格式有误,请输入实数')
      }
    },
    onStatusImgChange(e){
      this.globalGridAttr.statusImg = e
@@ -361,6 +433,7 @@
        if (!cell || !cell.isNode()) {
          return
        }
        this.showNumberInput = false
        this.curCel = cell
        globalGridAttr.nodeStroke = cell.attr('body/stroke')
        globalGridAttr.nodeStrokeWidth = cell.attr('body/strokeWidth')
@@ -387,6 +460,12 @@
        globalGridAttr.taskMtbcf = cell.getData().taskMtbcf
        globalGridAttr.taskMtbcfOther = cell.getData().taskMtbcfOther
        globalGridAttr.isRepair = cell.getData().isRepair
        globalGridAttr.voteNum = cell.getData().voteNum
        console.log(cell.getData().voteNum,'cell.getData().voteNum')
        if(cell.getData().voteNum!==undefined ||  this.globalGridAttr.nodeTypeExt === 'vote' || this.nodeType==='vote'){
          this.showNumberInput = true
        }
        console.log(this.showNumberInput,'this.showNumberInput')
        this.showRepairInput = cell.getData().isRepair
        cell.removeTools()
        cell.addTools([
web/src/views/modules/taskReliability/ModelRbd.vue
@@ -19,7 +19,7 @@
                <zt-button type="delete" @click="table.deleteHandle()"/>
              </el-form-item>
            </el-form>
            <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
            <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}"
                      border @selection-change="table.selectionChangeHandle">
              <el-table-column type="selection" width="40" align="center"/>
              <el-table-column prop="modelName" label="模型名称"/>
@@ -31,7 +31,7 @@
              <zt-table-column-handle :table="table"
                                      delete-perm="taskReliability::delete" :has-view="false" width="180px">
                <template v-slot="{ row }">
                  <el-button  @click="drawRBD(row)">模型设计</el-button>
                  <zt-table-button  @click="drawRBD(row)">模型设计</zt-table-button>
                </template>
              </zt-table-column-handle>
            </el-table>
web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -184,7 +184,7 @@
        id: '',
        graph: null,
        globalGridAttr: {
          voteSum: '',
          voteNum: '',
          repairMttcr: '',
          repairMttcrOther: '',
          repairDistribType: '',
@@ -372,15 +372,13 @@
          grid: {
            visible: true,
          },
          onToolItemCreated({tool}) {
            const handle = tool
            const options = handle.options
            if (options && options.index % 2 === 1) {
              tool.setAttrs({fill: 'red'})
            }
          },
          autoResize: true,
          history: true,
            history: {
                enabled: true,
                ignoreAdd: true,
                ignoreRemove: true,
                ignoreChange: true,
            },
          // panning: {
          //   enabled: true,
          // },
@@ -450,6 +448,12 @@
                    }
                  }
                }],
                tools: {
                  name: 'vertices',
                  args: {
                    attrs: { fill: '#666' },
                  },
                },
                zIndex: 0,
              })
            },
@@ -532,7 +536,8 @@
            data: {
              dataId: '',
              nodeType: item.nodeType,
              nodeTypeExt: ''
              nodeTypeExt: '',
              voteNum:''
            },
            attrs: {
              text: {
@@ -564,7 +569,7 @@
            width: 60,
            height: 60,
            data: {
              isRepair: false,
              isRepair: item.isRepair,
              dataId: item.dataId,
              nodeType: item.nodeType,
              nodeTypeExt: item.nodeTypeExt,
@@ -576,9 +581,9 @@
              repairMttcrOther: item.repairMttcrOther,
              taskMtbcf: item.taskMtbcf,
              taskMtbcfOther: item.taskMtbcfOther,
              voteSum: '',
              imgHeight: item.imgHeight,
              imgWidth: item.imgWidth
              imgWidth: item.imgWidth,
              voteNum:'',
            },
            attrs: {
              text: {
@@ -799,28 +804,10 @@
          this.showPorts(ports, false)
        })
        this.graph.on('edge:mouseenter', ({cell, view}) => {
        this.graph.on('edge:mouseenter', ({cell}) => {
          // alert(123)
          cell.addTools([
            {
              name: 'source-arrowhead',
            },
            {
              name: 'target-arrowhead',
              args: {
                attrs: {
                  fill: 'red',
                },
              },
            },
          ])
          cell.addTools(
            [
              {
                name: 'segments',
                args: {snapRadius: 20, attrs: {fill: '#444'}}
              }
            ]
              ['vertices', 'segments']
          )
        })