From 8eb1062d99a7f4071dff0a44ec0099329ca902f8 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 26 七月 2024 17:58:37 +0800
Subject: [PATCH] 修改温升热循环bug
---
src/components/do/b6-device-management/b6-data-acquisition-config.vue | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 201 insertions(+), 26 deletions(-)
diff --git a/src/components/do/b6-device-management/b6-data-acquisition-config.vue b/src/components/do/b6-device-management/b6-data-acquisition-config.vue
index 7ffe061..cf5af10 100644
--- a/src/components/do/b6-device-management/b6-data-acquisition-config.vue
+++ b/src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -13,18 +13,19 @@
</div>
<div class="table">
<el-table :data="tableList.slice((page.current - 1) * page.size, page.current * page.size)"
- border tooltip-effect="dark" style="width: 100%;" height="100%">
+ border tooltip-effect="dark" style="width: 100%;" height="100%" :span-method="spanMethod">
<el-table-column type="index" label="搴忓彿" align="center" width="65"></el-table-column>
<el-table-column prop="deviceName" align="center" min-width="100" label="璁惧鍚嶇О"></el-table-column>
<el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑"></el-table-column>
<el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip label="閲囬泦鍦板潃"></el-table-column>
<el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip label="瀛樺偍鍦板潃"></el-table-column>
- <el-table-column prop="ip" align="center" label="IP鍦板潃"></el-table-column>
+ <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100"></el-table-column>
+ <el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip min-width="150"></el-table-column>
<el-table-column prop="inspectionItem" align="center" label="妫�楠岄」" min-width="100"></el-table-column>
- <el-table-column prop="inspectionItemSubClass" align="center" label="妫�楠岄」瀛愰」" min-width="100"></el-table-column>
- <el-table-column prop="referx" align="center" label="鍙傜収X"></el-table-column>
+ <el-table-column prop="inspectionItemSubclass" align="center" label="妫�楠岄」瀛愰」" min-width="100"></el-table-column>
+ <el-table-column prop="referx" align="center" label="鍙傜収X" min-width="100"></el-table-column>
<el-table-column prop="x" align="center" label="X"></el-table-column>
- <el-table-column prop="refery" align="center" label="鍙傜収Y"></el-table-column>
+ <el-table-column prop="refery" align="center" label="鍙傜収Y" min-width="100"></el-table-column>
<el-table-column prop="y" align="center" label="Y"></el-table-column>
<el-table-column prop="formula" align="center" label="鍏紡"></el-table-column>
<el-table-column prop="section" label="鎿嶄綔" width="120">
@@ -81,9 +82,10 @@
<el-button @click="addDomain" size="small" type="primary" style="position: absolute; bottom: -65px;left: 62px" v-if="index === domains.length-1">鏂板鍩熷悕</el-button>
</el-form-item>
</div>
- <div class="fomItem1">
- <el-form-item class="fomItemInput" label="鍏紡:">
- <el-input v-model="configForm.formula" @change="evalResult"></el-input>
+ <div class="fomItem2">
+ <el-form-item class="fomItemInput1" label="鍏紡:">
+ <!-- <formula :returnFormula="evalResult"/> -->
+ <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}"ze placeholder="璇疯緭鍏ュ唴瀹�" v-model="configForm.formula" @change="evalResult"> </el-input>
</el-form-item>
</div>
</el-form>
@@ -121,6 +123,16 @@
</el-option>
</el-select>
</div>
+ <div v-if="configForm.fileType == '.mdb'" class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">濮旀墭瀛楁锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="configForm.mdbEntrustCode"></el-input>
+ </div>
+ <div v-if="configForm.fileType == '.mdb'" class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">鏍峰搧瀛楁锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="configForm.mdbSampleCode"></el-input>
+ </div>
<span slot="footer" class="dialog-footer">
<el-row>
<el-button @click="dialogVisible4=false">鍙� 娑�</el-button>
@@ -132,10 +144,13 @@
</template>
<script>
+import formula from '../../tool/formula.vue'
export default {
name: "dataAcquisitionConfig",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {},
+ components: {
+ formula
+ },
props: {
deviceId: {
type: Number,
@@ -176,11 +191,116 @@
{label: 'excel', value: '.xlsx'},
{label: 'txt', value: '.txt'},
{label: 'png', value: '.png'},
- ]
+ ],
+ spanList: [],
+ specialSpanList: [],
+ spanConfig: {
+ special: {
+ main: "inspectionItemSubclass",
+ rows:[
+ {
+ name:'deviceName',
+ index:1
+ },
+ {
+ name:'fileType',
+ index:2
+ },
+ {
+ name:'collectUrl',
+ index:3
+ },
+ {
+ name:'storageUrl',
+ index:4
+ },
+ {
+ name:'ip',
+ index:5
+ },
+ {
+ name:'inspectionItem',
+ index:6
+ },
+ {
+ name:'inspectionItemSubclass',
+ index:7
+ },
+ {
+ name:'formula',
+ index:13
+ },
+ {
+ name:'inspectionItemSubclass',
+ index:14
+ }
+ ]
+ }
+ },
+ deleteList: []
}
},
// 鏂规硶闆嗗悎
methods: {
+ rowspan(spanArr, position, spanName) {
+ this.tableList.forEach((item, index) => {
+ if (index === 0) {
+ spanArr.push(1);
+ position = 0;
+ } else {
+ if (
+ this.tableList[index][spanName] ===
+ this.tableList[index - 1][spanName]
+ ) {
+ spanArr[position] += 1;
+ spanArr.push(0);
+ } else {
+ spanArr.push(1);
+ position = index;
+ }
+ }
+ });
+ },
+ spanMethod({
+ row,
+ column,
+ rowIndex,
+ columnIndex
+ }) {
+ // 涓�鑸殑鍚堝苟琛�
+ if (this.spanConfig != undefined && this.spanConfig.rows && this.spanConfig.rows.length > 0) {
+ let i = null;
+ let obj = this.spanConfig.rows.find((item, index) => {
+ i = index;
+ return item.index == columnIndex
+ })
+ if (obj) {
+ const _row = this.spanList[i].arr[rowIndex];
+ const _col = _row > 0 ? 1 : 0;
+ return {
+ rowspan: _row,
+ colspan: _col,
+ };
+ }
+ }
+ // 鐗规畩鐨勫悎骞惰
+ if (this.spanConfig != undefined && this.spanConfig.special && this.spanConfig.special.main &&
+ this.spanConfig.special.rows && this.spanConfig.special.rows.length > 0) {
+ let i = null;
+ let obj = this.spanConfig.special.rows.find((item, index) => {
+ i = index;
+ return item.index == columnIndex
+ })
+ if (obj) {
+ const _row = this.specialSpanList[i].arr[rowIndex];
+ const _col = _row > 0 ? 1 : 0;
+ return {
+ rowspan: _row,
+ colspan: _col,
+ };
+ }
+ }
+ },
fileConfiguration() {
this.dialogVisible4 = true
if(this.tableList[0]) {
@@ -191,15 +311,45 @@
}
},
init() {
- this.tableList = []
+ // this.tableList = []
this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId + "&isDevice=" + false).then(res => {
this.tableList = res.data
+ this.tableList.forEach(i => {
+ i.sample = i.sample.replaceAll('"', '').replaceAll("],", '锛�').replaceAll("[", '').replaceAll('"', '').replaceAll(']', '')
+ })
if(this.tableList[0]) {
this.$set(this.configForm, 'fileType', this.tableList[0].fileType)
this.$set(this.configForm, 'collectUrl', this.tableList[0].collectUrl)
this.$set(this.configForm, 'storageUrl', this.tableList[0].storageUrl)
this.$set(this.configForm, 'ip', this.tableList[0].ip)
+ this.$set(this.configForm, 'mdbEntrustCode', this.tableList[0].mdbEntrustCode)
+ this.$set(this.configForm, 'mdbSampleCode', this.tableList[0].mdbSampleCode)
}
+ // 涓�鑸殑鍚堝苟琛�
+ if (this.spanConfig != undefined && this.spanConfig.rows && this.spanConfig.rows.length >
+ 0) {
+ this.spanList = [];
+ this.spanConfig.rows.forEach((item, index) => {
+ this.spanList.push({
+ arr: [],
+ position: 0
+ })
+ this.rowspan(this.spanList[index].arr, this.spanList[index].position, item.name);
+ })
+ }
+ // 鐗规畩鐨勫悎骞惰
+ if (this.spanConfig != undefined && this.spanConfig.special && this.spanConfig.special
+ .main && this.spanConfig.special.rows && this.spanConfig.special.rows.length > 0) {
+ this.specialSpanList = []
+ this.spanConfig.special.rows.forEach((item, index) => {
+ this.specialSpanList.push({
+ arr: [],
+ position: 0
+ })
+ this.rowspan(this.specialSpanList[index].arr, this.specialSpanList[index].position, this
+ .spanConfig.special.main);
+ })
+ }
})
},
submitForm4() {
@@ -209,17 +359,21 @@
collectUrl: this.configForm.collectUrl,
storageUrl: this.configForm.storageUrl,
ip: this.configForm.ip,
- isDevice: true
+ isDevice: true,
+ mdbEntrustCode: this.configForm.mdbEntrustCode,
+ mdbSampleCode: this.configForm.mdbSampleCode
})
this.upLoad4 = true
this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration + "?deviceId=" + this.deviceId, obj, {headers: {
'Content-Type': 'application/json'
}}).then(res => {
- this.tableList = res.data
- this.dialogVisible4 = false
- this.upLoad4 = false
- this.init()
- this.$message.success('鎿嶄綔鎴愬姛')
+ if(res.code == 200) {
+ this.tableList = res.data
+ this.dialogVisible4 = false
+ this.init()
+ this.$message.success('鎿嶄綔鎴愬姛')
+ }
+ this.upLoad4 = false
}).catch(err => {
this.upLoad4 = false
})
@@ -227,10 +381,15 @@
dataConfig (row) {
this.configForm = {
deviceId: row.deviceId,
- insProductItem: row.inspectionItemSubClass.trim()
+ inspectionItem: row.inspectionItem.trim(),
+ inspectionItemSubclass: row.inspectionItemSubclass,
+ structureItemParameterId: row.structureItemParameterId
}
this.dialogVisible3 = true
- this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId + "&insProductItem=" + row.inspectionItemSubClass.trim() + "&isDevice=" + true).then(res => {
+ this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId +
+ "&inspectionItem=" + row.inspectionItem.trim() +
+ "&isDevice=" + true +
+ "&inspectionItemSubclass=" + row.inspectionItemSubclass.trim()).then(res => {
const data = res.data
if(data[0]) {
this.domains.splice(0, 1)
@@ -265,7 +424,9 @@
}
i.formula = this.configForm.formula
i.deviceId = this.deviceId
- i.insProductItem = this.configForm.insProductItem
+ i.inspectionItem = this.configForm.inspectionItem
+ i.inspectionItemSubclass = this.configForm.inspectionItemSubclass
+ i.structureItemParameterId = this.configForm.structureItemParameterId
})
this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration + "?deviceId=" + this.deviceId, {dataConfigList: this.domains, isDevice: false},{headers: {
'Content-Type': 'application/json'
@@ -280,6 +441,13 @@
id: ''
}
]
+ if(this.deleteList.length > 0) {
+ this.$axios.delete(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?ids=" + this.deleteList.join()).then(res => {
+ if(res.code == 200) {
+ this.init()
+ }
+ })
+ }
this.init()
this.$message.success('娣诲姞鎴愬姛')
})
@@ -293,11 +461,8 @@
const index = this.domains.indexOf(item)
if (index !== -1 && this.domains.length > 1) {
if(item.id){
- this.$axios.delete(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?id=" + item.id).then(res => {
- if(res.code == 200) {
- this.domains.splice(index, 1)
- }
- })
+ this.deleteList.push(item.id)
+ this.domains.splice(index, 1)
} else {
this.domains.splice(index, 1)
}
@@ -315,7 +480,8 @@
id: ''
});
},
- evalResult () {
+ evalResult (val) {
+ this.configForm.formula = val
// 鏍规嵁鍏紡璁$畻鍑虹粨鏋�
},
sizeChange(val) {
@@ -325,6 +491,7 @@
this.page.current = val
},
closeForm () {
+ this.deleteList = []
this.domains = [{
referx: '',
refery: '',
@@ -377,10 +544,18 @@
display: flex;
height: 74px;
}
+.fomItem2 {
+ display: flex;
+ width: 100%;
+}
.fomItemInput {
width: 180px;
margin-right: 6px;
}
+.fomItemInput1 {
+ width: 100%;
+ margin-right: 6px;
+}
>>>.el-form-item__label {
padding-bottom: 0 !important;
}
--
Gitblit v1.9.3