فهرست منبع

性能验证参数校验、线性回归相关调整

cfort 1 سال پیش
والد
کامیت
bb790130d4

+ 18 - 7
src/views/business/performance/components/chart.vue

@@ -54,9 +54,12 @@ export default {
             default: () => []
         }
     },
-    data () {
-        return {
-
+    watch: {
+        chartData: {
+            handler (val) {
+                this.initChart()
+            },
+            deep: true
         }
     },
     mounted () {
@@ -64,7 +67,7 @@ export default {
     },
     methods: {
         initChart () {
-            console.log(LROption, SPOption)
+            // console.log(LROption, SPOption)
             this.chartData.forEach(item => {
                 const chart = echarts.init(document.getElementById(item.id))
                 console.log(item.option)
@@ -86,9 +89,17 @@ export default {
                 // color: #606266;
                 // font-size: 14px;
                 // line-height: 1.5;
-                .chart-item {
-                    height: 300px;
-                    width: 100%;
+                .form-row {
+                    display: flex;
+                    justify-content: center;
+                    flex-wrap: wrap;
+                    .chart-item {
+                        height: 300px;
+                        width: 100%;
+                    }
+                    .note {
+                        text-align: center;
+                    }
                 }
             }
         }

+ 2 - 2
src/views/business/performance/components/experimental-data.vue

@@ -22,7 +22,6 @@
             </div>
             <div class="content">
                 <template v-if="expData && $utils.isNotEmpty(expData.dataDTO)">
-                    <div class="note" v-html="expData.dataDTO.note" />
                     <el-table
                         :data="expData.dataDTO.list"
                         border
@@ -57,6 +56,7 @@
                             </el-table-column>
                         </el-table-column>
                     </el-table>
+                    <div class="note" v-html="expData.dataDTO.note" />
                 </template>
                 <el-empty v-else description="暂无数据,请导出模板填写后导入" />
             </div>
@@ -224,7 +224,7 @@ export default {
                 padding: 10px;
                 position: relative;
                 .note {
-                    margin-bottom: 10px;
+                    margin-top: 10px;
                 }
             }
         }

+ 15 - 10
src/views/business/performance/components/param-info.vue

@@ -346,10 +346,10 @@
                             />
                         </el-form-item>
                     </el-col>
-                    <el-col v-if="isShow('range')" :span="12">
-                        <el-form-item prop="shiYanCanShu.range" :show-message="false">
+                    <el-col v-if="isShow('rangeValue')" :span="12">
+                        <el-form-item prop="shiYanCanShu.rangeValue" :show-message="false">
                             <template slot="label">
-                                <span>{{ getAttrs('range', 'label', false) }}</span>
+                                <span>{{ getAttrs('rangeValue', 'label', false) }}</span>
                                 <el-tooltip
                                     class="item"
                                     effect="dark"
@@ -360,12 +360,12 @@
                                 </el-tooltip>
                             </template>
                             <el-input-number
-                                v-model="pageInfo.range"
+                                v-model="pageInfo.rangeValue"
                                 type="number"
-                                :min="getAttrs('range', 'min')"
-                                :max="getAttrs('range', 'max')"
+                                :min="getAttrs('rangeValue', 'min')"
+                                :max="getAttrs('rangeValue', 'max')"
                                 :step="0.01"
-                                :precision="getAttrs('range', 'precision')"
+                                :precision="getAttrs('rangeValue', 'precision')"
                                 :disabled="readonly"
                                 placeholder="请输入"
                             />
@@ -433,7 +433,7 @@ export default {
             temp.allowableSDl = []
             temp.targetValue = []
             temp.claimValue = []
-            temp.rangeValue = temp.range ? [100 - parseFloat(temp.range) * 100, 100 + parseFloat(temp.range) * 100] : []
+            temp.range = temp.rangeValue ? [100 - parseFloat(temp.rangeValue) * 100, 100 + parseFloat(temp.rangeValue) * 100] : []
         }
         this.pageInfo = temp || { model: [], targetValue: [], specimensName: [] }
     },
@@ -453,6 +453,10 @@ export default {
                 this.pageInfo.specimensName = s.concat(Array.from({ length: v - s.length }, (_, index) => `水平${index + s.length + 1}`))
             } else {
                 this.pageInfo.specimensName.splice(v)
+                this.pageInfo.allowableSDr.splice(v)
+                this.pageInfo.allowableSDl.splice(v)
+                this.pageInfo.targetValue.splice(v)
+                this.pageInfo.claimValue.splice(v)
             }
         },
         handleCvsChange () {
@@ -490,6 +494,7 @@ export default {
                             .el-form-item__content {
                                 display: flex;
                                 justify-content: flex-start;
+                                flex-wrap: wrap;
                                 > .el-input {
                                     max-width: 120px;
                                     margin-right: 10px;
@@ -500,11 +505,11 @@ export default {
                             }
                         }
                         .inline-input {
-                            width: 100px;
+                            width: 120px;
                             vertical-align: bottom;
                         }
                         .inline-number {
-                            width: 140px;
+                            width: 120px;
                             margin-right: 10px;
                             &:last-of-type {
                                 margin-right: 0;

+ 1 - 1
src/views/business/performance/constants/index.js

@@ -95,7 +95,7 @@ export const formRules = {
         message: '请输入',
         trigger: 'change'
     }],
-    'shiYanCanShu.range': [{
+    'shiYanCanShu.rangeValue': [{
         required: false,
         message: '请输入',
         trigger: 'change'

+ 22 - 13
src/views/business/performance/experimental.vue

@@ -151,7 +151,8 @@ export default {
                 // { key: 'submit', icon: 'ibps-icon-send', label: '提交', type: 'primary', hidden: this.readonly },
                 // { key: 'generate', icon: 'ibps-icon-cube', label: '生成报告', type: 'success', hidden: this.readonly },
                 { key: 'cancel', icon: 'el-icon-close', label: '关闭', type: 'danger' }
-            ]
+            ],
+            validateList: ['targetValue', 'allowableSDr', 'allowableSDl', 'claimValue']
         }
     },
     watch: {
@@ -246,8 +247,27 @@ export default {
         handleGenerate () {
             this.$message.info('waiting...')
         },
+        judgeArrayData (data) {
+            if (!data || !data.length) {
+                return true
+            }
+            return data.length === data.filter(i => this.$utils.isNotEmpty(i)).length
+        },
         submitForm (key, showMsg, callback) {
             const { shiYanCanShu, shiYanShuJu, jiSuanJieGuo, ...rest } = this.form || {}
+            const { rangeValue } = shiYanCanShu || {}
+            shiYanCanShu.range = rangeValue ? [100 - parseFloat(rangeValue) * 100, 100 + parseFloat(rangeValue) * 100] : []
+            // 校验数组数据
+            for (let i = 0; i <= this.validateList.length; i++) {
+                const item = this.validateList[i]
+                if (this.judgeArrayData(shiYanCanShu[item])) {
+                    continue
+                }
+                const t = this.configData.params.find(p => p.key === item)
+                const msg = t ? `${t.label}填写不完整,请补充后再提交` : '性能验证实验参数部分信息填写不完整,请补充后再提交'
+                return this.$message.warning(msg)
+            }
+            // 组装提交数据
             const submitData = {
                 ...rest,
                 shiYanCanShu: this.$utils.isNotEmpty(shiYanCanShu) ? JSON.stringify(shiYanCanShu) : null,
@@ -394,18 +414,7 @@ export default {
                         youXiaoQi: '2025-05-01'
                     }
                 ],
-                shiYanCanShu: {
-                    specimensNum: 2,
-                    repeatNum: 3,
-                    days: 5,
-                    isConvert: false,
-                    standard: '基于允许总误差TEa',
-                    tea: 10,
-                    batchCVS: 0.25,
-                    batchCVSValue: 2.50,
-                    dailyCVS: 0.33,
-                    dailyCVSValue: 3.33
-                },
+                shiYanCanShu: {},
                 shiYanShuJu: [],
                 shiYanJieLun: '测试达标',
                 shenHeRen: '1166673437578493952',

+ 2 - 2
src/views/business/performance/record.vue

@@ -80,8 +80,8 @@ export default {
                 },
                 // 表格字段配置
                 columns: [
-                    { prop: 'xingNengZhiBia', label: '性能指标', tags: [], minWidth: 110 },
-                    { prop: 'fangAnLeiXing', label: '方案类型', tags: [], width: 125 },
+                    { prop: 'xingNengZhiBia', label: '性能指标', tags: [], width: 120 },
+                    { prop: 'fangAnLeiXing', label: '方案类型', tags: [], minWidth: 125 },
                     { prop: 'shiYanXiangMu', label: '实验项目', width: 120 },
                     { prop: 'shiYanFangFa', label: '实验方法', width: 120 },
                     { prop: 'yangBenLeiXing', label: '样本类型', width: 100 },

+ 3 - 3
src/views/business/performance/report/precision.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="info-container">
-        <div class="experimental-result info-item">
+        <div v-if="reportData && reportData.length" class="experimental-result info-item">
             <div class="title">
                 <i class="ibps-icon-star" />
                 <span>计算结果</span>
@@ -138,12 +138,12 @@ export default {
         initData (index) {
             const { sheetDTO } = this.info || {}
             const { reportDataDTO, chartDataDTO } = sheetDTO[index] || {}
-            const reportData = Object.keys(reportDataDTO).map(k => ({
+            const reportData = reportDataDTO ? Object.keys(reportDataDTO).map(k => ({
                 title: k,
                 header: reportDataDTO[k].header || this.getTableHeader(reportDataDTO[k].list),
                 hideHeader: this.$utils.isEmpty(reportDataDTO[k].header),
                 list: reportDataDTO[k].list
-            })).sort((a, b) => a.title.localeCompare(b.title))
+            })).sort((a, b) => a.title.localeCompare(b.title)) : []
             const chartData = chartDataDTO ? Object.keys(chartDataDTO).map(k => ({
                 title: k,
                 id: chartDataDTO[k].name,