jinlin
2024-07-22 3a4536445096cdb80d586a67df3c00ab4a0faecb
修改
8个文件已修改
1个文件已添加
125 ■■■■■ 已修改文件
modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/public/产品结构树导入模板.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/baseReliability/ParamDataBasic.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ParamData.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ProductModelTree.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/ModelRbd.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/OperatCondit.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml
@@ -4,34 +4,29 @@
<mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.TyProductModelDao">
    <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel">
        select *
        from product_model_common
        where is_delete = 0
          AND (
            -- å¦‚果子查询返回结果为空,则检查a.pid是否为空
                    (SELECT src_id FROM product_model WHERE id = ${pid}  AND is_delete = 0) IS NULL
                    AND pid IS NULL
                OR
                -- å¦åˆ™ï¼Œæ£€æŸ¥a.pid是否在子查询结果中
                    pid IN (
                        SELECT src_id
        SELECT PMC.*
        FROM product_model_common PMC
                 JOIN (SELECT product_type, src_id
                        FROM product_model
                        WHERE id = ${pid}
                          AND is_delete = 0
                       WHERE id = ${pid} AND is_delete = 0) AS PM ON TRUE
        WHERE PMC.is_delete = 0
          AND (
                    PM.product_type = 3
                    AND (CASE WHEN pm.src_id IS NULL THEN node_type > 3 ELSE pid IN (src_id) END)
                OR (
                            PM.product_type != 3
                            AND (CASE WHEN pm.src_id IS NULL THEN pid IS NULL ELSE pid IN (src_id) END)
                    )
            )
        and ((node_type &gt; ${nodeType}) or ( id not in (select src_id from product_model where pid =
        ${pid} and is_delete=0)))
        ORDER BY
            node_type,sort
        ORDER BY PMC.node_type,
                 PMC.sort;
    </select>
    <select id="getProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel">
        select a.name, a.id
        from product_model_common a
        where a.is_delete = 0
          and a.node_type &lt;&gt; 1
        ORDER BY
            node_type,sort
        ORDER BY node_type, sort
    </select>
    <select id="getNo" resultType="java.lang.Integer">
        SELECT COUNT(*)
web/public/²úÆ·½á¹¹Ê÷µ¼ÈëÄ£°å.xlsx
Binary files differ
web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -112,29 +112,30 @@
        })
      },
      cellStyle({row, column, rowIndex, columnIndex}) {
        let warningColor = false;
        //   console.log(row, column, rowIndex, columnIndex);
        //console.log(row, "row");
        Object.keys(row).forEach((key, index) => {
          //遍历每行中每个数据的state
          if (key === "repairMttcr" || key === "basicMtbfRegulate") {
            //console.log(key, "row key");
            let val = row[key]
            const numM = Number(val).toFixed(5);
            if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) {
              //定位该数据的坐标
              if (columnIndex === 2) {
                warningColor = true;
              }
            }
          }
        });
        if (warningColor) {
          // red为想变成的单元格样式
        const numM1 = Number(row.repairMttcr).toFixed(5);
        const numM2 = Number(row.basicMtbfRegulate).toFixed(5);
        console.log(numM1,numM2,'234')
        if (numM1.substring(0, numM1.length - 1) === '0.0000' && row.repairMttcr > 0 && column.property ==="repairMttcr") {
          return 'color : red'
        } else if (numM2.substring(0, numM1.length - 1) === '0.0000' && row.basicMtbfRegulate > 0 && column.property ==="basicMtbfRegulate") {
          return 'color : red'
        }else {
          return ''
        }
        return "";
        // Object.keys(row).forEach((key, index) => {
        //   //遍历每行中每个数据的state
        //   if (key === "repairMttcr" || key === "basicMtbfRegulate") {
        //     //console.log(key, "row key");
        //     let val = row[key]
        //     const numM = Number(val).toFixed(5);
        //     if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) {
        //       //定位该数据的坐标
        //       if (columnIndex === 2) {
        //         warningColor = true;
        //       }
        //     }
        //   }
        // });
      },
    }
  }
web/src/views/modules/basicInfo/ParamData.vue
@@ -3,7 +3,7 @@
    <el-row :gutter="5">
      <el-col :span="4">
        <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
          <product-model-tree @on-selected="onProductSelected" showXdy="false" :isShow="false"/>
          <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="false" :isShow="false"/>
        </div>
      </el-col>
      <el-col :span="20">
@@ -63,7 +63,8 @@
                                   :hit="hit"/>
                    </template>
                  </el-table-column>
                  <el-table-column v-if="dataForm.productType==='2'" :key="3" prop="baseOperatRatio" label="基本可靠性运行比" align="right">
                  <el-table-column v-if="dataForm.productType==='2'" :key="3" prop="baseOperatRatio" label="基本可靠性运行比"
                                   align="right">
                    <template slot-scope="scope">
                      <el-input v-if="scope.row.isEdit" v-model="scope.row.baseOperatRatio"></el-input>
                      <span v-else v-text="scope.row.baseOperatRatio"></span>
@@ -210,7 +211,8 @@
                      </template>
                    </el-table-column>
                  </el-table-column>
                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="22" label="维修分布" align="center">
                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="22" label="维修分布"
                                   align="center">
                    <!--                <zt-table-column-dict prop="repairable" :keys="23" label="可维修" dict="is_or_not"/>-->
                    <el-table-column prop="repairable" label="可维修" :key="23" width="80" align="center">
                      <template v-slot="{ row }">
@@ -447,6 +449,12 @@
          this.$refs.tableObj.query()
        })
      },
      onDefault(defaultId) {
        this.dataForm.srcId = defaultId
        this.dataForm.productType = 2
        this.activeName = 'first'
        this.$refs.tableObj.query()
      },
      dataLoaded(data) {
        this.dataList = data
        for (let dataList of data) {
web/src/views/modules/basicInfo/ProductModelTree.vue
@@ -84,7 +84,6 @@
        if (this.basic) {
          if (this.productList && this.productList[0].children) {
            this.defaultId = this.productList[0].children[0].id
            console.log(this.defaultId, 'this.defaultID')
            this.$nextTick(() => {
              this.$refs.tree.setCurrentKey(this.defaultId); //一定要加这个选中了否则样式没有出来
            });
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -84,8 +84,10 @@
          productType: selected
        }
        let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params: params})
        if (res.data){
        this.dataForm.operatImgName = res.data.name
        this.dataForm.operatImg = res.data.id
        }
      },
      selectPicture() {
        this.$refs.pictureSelect.$refs.dialog.init(this.dataForm.productType)
web/src/views/modules/basicInfo/XhProductModel.vue
@@ -3,7 +3,8 @@
    <el-row :gutter="5">
      <el-col :span="5">
        <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
          <product-model-tree @on-selected="onProductSelected" showXdy="true" ref="ProductModelTree"/>
          <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="true"
                              ref="ProductModelTree"/>
        </div>
      </el-col>
      <el-col :span="19">
@@ -19,6 +20,8 @@
              <el-form-item>
                <zt-button v-if="productType && productType!=='10'" type="query" @click="table.query()"/>
                <zt-button v-if="productType && productType!=='10'" type="add" @click="add()"/>
                <zt-button v-if="productType==='1'" size="small" type="primary" @click="exportProduct()">导出模板
                </zt-button>
                <zt-button v-if="productType==='3'" type="primary" @click="addCell()">新增虚单元</zt-button>
                <zt-button v-if="productType && productType!=='10'" type="delete" @click="table.deleteHandle()"/>
              </el-form-item>
@@ -116,7 +119,16 @@
      },
      importData(row) {
        this.$refs.ProductImport.$refs.dialog.init(row)
      }
      },
      exportProduct() {
        window.location.href = './产品结构树导入模板.xlsx'
      },
      onDefault(defaultId) {
        this.dataForm.pid = defaultId
        this.dataForm.type = 2
        this.productType = 2
        this.$refs.tableObj.query()
      },
    }
  }
</script>
web/src/views/modules/taskReliability/ModelRbd.vue
@@ -3,7 +3,7 @@
    <el-row :gutter="5">
      <el-col :span="5">
        <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
          <product-model-tree @on-selected="onProductSelected" showXdy="true" :isShow="false"/>
          <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="true" :isShow="false"/>
        </div>
      </el-col>
      <el-col :span="19">
@@ -88,6 +88,10 @@
        console.log(data, 'onProductSelected(data)')
        this.$refs.tableObj.query()
      },
      onDefault(defaultId){
        this.dataForm.productId = defaultId
        this.$refs.tableObj.query()
      },
      drawRBD(row) {
        this.dialogVisible2 = true
        this.$nextTick(() => {
web/src/views/modules/taskReliability/OperatCondit.vue
@@ -66,7 +66,6 @@
      OperaConditModel,
      AddOrUpdate
    },
    methods: {
      add() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {productId: this.dataForm.productId})
@@ -79,6 +78,7 @@
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        console.log(this.productList, ' async getTaskProductList()')
        this.onProductSelected(this.productList[0])
      },
      selectOperatCondit(row) {
        if (this.$refs.model.isChange) {
@@ -93,12 +93,8 @@
        }
        this.$refs.model.init(param)
      },
      tableRowClassName(
        {
          row,
          rowIndex
        }) {
        if (row.id == this.currentId) {
      tableRowClassName({row, rowIndex}) {
        if (row.id === this.currentId) {
          return 'select-row';
        } else {
          return 'not-select-row';