From 14f660981c502a71fd61c74667204ac293b1165a Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期五, 18 四月 2025 17:26:17 +0800 Subject: [PATCH] 拉力机数采修改 --- src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue | 24 +- src/workers/DataWorker.worker.js | 233 +++++++++++++++---------- src/views/business/inspectionTask/inspection.vue | 2 src/views/business/inspectionTask/components/NetworkAnalyzerDataAcquisition.vue | 273 +++++++++++++++++++++++++++++- 4 files changed, 415 insertions(+), 117 deletions(-) diff --git a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue index e149b1b..ffc8f3f 100644 --- a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue +++ b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue @@ -17,12 +17,14 @@ :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鍦板潃" min-width="100"></el-table-column> + <el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑" + v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column> + <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip label="閲囬泦鍦板潃" + v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column> + <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip label="瀛樺偍鍦板潃" + v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column> + <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100" + v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column> <el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip min-width="150"></el-table-column> <el-table-column prop="inspectionItemClass" align="center" label="妫�楠岄」鍒嗙被" min-width="120"></el-table-column> @@ -349,6 +351,7 @@ channelList: [], dialogVisible5: false, upLoad5: false, + currentInfo: {} }; }, // 鏂规硶闆嗗悎 @@ -609,6 +612,7 @@ inspectionItemClass: row.inspectionItemClass, }; if (this.deviceName && this.deviceName.includes('缃戠粶鍒嗘瀽')) { + this.currentInfo = row this.dialogVisible5 = true; this.$set(this.configForm, 'importedParts', row.importedParts ? row.importedParts : '') this.$set(this.configForm, 'importedChannel', row.importedChannel ? row.importedChannel : '') @@ -765,11 +769,13 @@ this.$refs.configForm.resetFields(); }, submitForm5() { + this.currentInfo.importedParts = this.configForm.importedParts + this.currentInfo.importedChannel = this.configForm.importedChannel + this.currentInfo.deviceId = this.deviceId saveDataAcquisitionConfiguration({ deviceId: this.deviceId, - isDevice: true, - importedParts: this.configForm.importedParts, - importedChannel: this.configForm.importedChannel, + isDevice: false, + dataConfigList: [{ ...this.currentInfo }], }).then(res => { this.dialogVisible5 = false; this.init(); diff --git a/src/views/business/inspectionTask/components/NetworkAnalyzerDataAcquisition.vue b/src/views/business/inspectionTask/components/NetworkAnalyzerDataAcquisition.vue index c1b881f..40bc9ec 100644 --- a/src/views/business/inspectionTask/components/NetworkAnalyzerDataAcquisition.vue +++ b/src/views/business/inspectionTask/components/NetworkAnalyzerDataAcquisition.vue @@ -1,7 +1,26 @@ <template> <div class="btns"> <el-button type="primary" size="small" @click="getMetadata()">杩涘彛缃戝垎浠暟閲�</el-button> - <el-button type="primary" size="small">鍥戒骇缃戝垎浠暟閲�</el-button> + <el-button type="primary" size="small" @click="getMetadata0">鍥戒骇缃戝垎浠暟閲�</el-button> + <el-dialog title="鍥戒骇缃戝垎" :visible.sync="dialogVisible" width="30%"> + <el-form ref="form" :model="form" label-width="50px" :rules="rules"> + <el-form-item label="IP"> + <el-input v-model="form.serverIp" disabled></el-input> + </el-form-item> + <el-form-item label="绔彛"> + <el-input v-model="form.serverPort" disabled></el-input> + </el-form-item> + <el-form-item label="閫氶亾" prop="memoryDir"> + <el-select v-model="form.memoryDir" placeholder="璇烽�夋嫨娲诲姩鍖哄煙"> + <el-option :label="item" :value="item" v-for="(item, index) in channel" :key="index"></el-option> + </el-select> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="dialogVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="saveForm">纭� 瀹�</el-button> + </span> + </el-dialog> </div> </template> @@ -14,7 +33,15 @@ data() { return { itemConfig: [], - itemListNew: [] + itemListNew: [], + dialogVisible: false, + form: {}, + channel: [], + rules: { + memoryDir: [ + { required: true, message: '璇烽�夋嫨閫氶亾', trigger: 'change' } + ], + } } }, mounted() { @@ -22,10 +49,8 @@ }, methods: { - async getMetadata() { - console.log(this.param, this.itemList) + init() { this.itemListNew = this.HaveJson(this.itemList) - let equip = null; for (let n in this.param) { let obj = this.equipOptions.find(m => m.value == this.param[n].equipValue[0].v.v) @@ -33,6 +58,10 @@ equip = obj } } + return equip + }, + async getMetadata() { + let equip = this.init() if (equip) { await this.getItemConfig(equip) this.itemListNew.forEach(item => { @@ -45,6 +74,18 @@ } }) this.gatherNetworkAnalyzerSampleItem() + } + }, + getMetadata0() { + let equip = this.init() + if (equip) { + this.form = { + serverIp: equip.ip, + serverPort: equip.port, + memoryDir: null + } + this.channel = equip.channel ? equip.channel.split(',') : [] + this.dialogVisible = true } }, async getItemConfig(param) { @@ -137,7 +178,7 @@ ) { dataItem = { Column1: item.inspectionItem, - Column2: item.itemReference,// TODO: 鐩镐綅宸�-鍛ㄦ湡鏁� + // Column2: item.itemReference,// TODO: 鐩镐綅宸�-鍛ㄦ湡鏁� TD: item.aisle == null ? '0' : item.aisle, BW: item.position == null ? '0' : item.position } @@ -151,12 +192,13 @@ flag = false flagMsg = flagMsg + item.inspectionItem + ',閮ㄤ綅鍊间负绌猴紱' } - if ( - item.itemReference == null || - item.itemReference.indexOf('鏁�') < 0 - ) { - phaseDifferenceFlag = false - } + // TODO: + // if ( + // item.itemReference == null || + // item.itemReference.indexOf('鏁�') < 0 + // ) { + // phaseDifferenceFlag = false + // } } else if (item.inspectionItem.indexOf('鐗规�ч樆鎶�') > -1 && item.inspectionItemType == 1 ) { dataItem = { @@ -193,6 +235,7 @@ if (flag) { const dataArrStr = JSON.stringify(dataArr) requireData = preStr + dataArrStr + ednStr + console.log(3333, requireData) this.gatherLoadingShow = true $.ajax({ type: 'post', @@ -266,6 +309,212 @@ this.$message.error('鐢电紗闀垮害鍜岄�佹闀垮害杞崲绯绘暟涓嶈兘涓虹┖') } }, + saveForm() { + this.$refs.form.validate((valid) => { + if (valid) { + // alert('submit!'); + this.GuochanNetworkAnalyzer() + } else { + console.log('error submit!!'); + return false; + } + }); + }, + // 鍥戒骇缃戝垎浠� + GuochanNetworkAnalyzer(type) { + const { findFromCL } = this + const temperture = findFromCL('娓╁害') + const num = findFromCL('鐢电紗闀垮害') * findFromCL('閫佹闀垮害杞崲绯绘暟') + const length = num ? this.roundFun(num, 6) : undefined + const capacity = findFromCL('鐢靛锛堟祴璇曞�硷級') + const Xiangweicha = this.itemListNew.find(m => m.inspectionItem.indexOf('鐩镐綅宸�') > -1) + let cycle + if ( + Xiangweicha && + Xiangweicha.itemReference && + Xiangweicha.itemReference.match(/鍛ㄦ湡鏁�(\d+)/) + ) { + cycle = Xiangweicha.itemReference.match(/鍛ㄦ湡鏁�(\d+)/)[1] + } + const index1 = this.itemListNew.findIndex(m => m.inspectionItem.indexOf('鐗规�ч樆鎶�') > -1) + + // 鍥戒骇 + // 娓╁害 + // 鐢电紗闀垮害鍜岄�佹闀垮害杞崲绯绘暟 + // 鐢靛锛堟祴璇曞�硷級-- 鐢靛鏍囧噯涓嶈兘涓虹┖ + // 鐩镐綅宸� 瀛樺湪 + // 鐗规�ч樆鎶� 瀛樺湪 + // 鐩镐綅宸殑鍛ㄦ湡 + // 杞х汗 + // 鐗规�ч樆鎶� 瀛樺湪 + // 楂樻俯 + // 娓╁害 + // 鐢电紗闀垮害鍜岄�佹闀垮害杞崲绯绘暟 + // 鐗规�ч樆鎶� 瀛樺湪 + // 浜俊 + // 娓╁害 + // 鐢电紗闀垮害鍜岄�佹闀垮害杞崲绯绘暟 + // 鐗规�ч樆鎶� 瀛樺湪 + + if (index1 < 0) { + this.$message.error('鏃犲钩鍧囩壒鎬ч樆鎶�') + return + } + if (type === '鍥戒骇') { + if (!capacity) { + this.$message.error('鐢靛鏍囧噯涓嶈兘涓虹┖') + return + } + if (!Xiangweicha) { + this.$message.error('鏃犵浉浣嶅樊') + return + } + if (!cycle) { + this.$message.error('鏃犵浉浣嶅樊鍛ㄦ湡鏁�') + return + } + } + if (type === '鍥戒骇' || type === '楂樻俯' || type === '浜俊') { + if (!temperture) { + this.$message.error('娓╁害涓嶈兘涓虹┖') + return + } + if (!length) { + this.$message.error('鐢电紗闀垮害鍜岄�佹闀垮害杞崲绯绘暟涓嶈兘涓虹┖') + return + } + } + + const loading = this.$loading({ + lock: true, + text: '鏁版嵁閲囬泦涓�', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + const params = { + ...this.form, + temperture, + length, + cycle, + capacity + } + getTCPValuesNew(params) + .then((res) => { + if (res.data.code === 0) { + // 娴嬭瘯鍊糰cqItemValue -- decimalVal + // 璁$畻鍊糲alItemValue -- measureValue + // 閫氶亾aisle -- channel 绐楀彛 + // 閮ㄤ綅position -- trace 鍚屼竴绐楀彛涓嬬殑涓嶅悓杞ㄨ抗绾� + // 鍊糹temValue -- + const data = res.data.data.filter((e) => e.ifLegal) + data.forEach((e) => { + if (e.decimalVal) { + e.decimalVal = Math.abs(e.decimalVal) + } + if (e.measureValue) { + e.measureValue = Math.abs(e.measureValue) + } + }) + + this.dataList['閲囬泦椤�'].forEach((e) => { + if (e.itemName.indexOf('琛板噺') > -1) { + const d = data.find((d) => { + const match = d.label.match(/decay_(\d+)m/) + return ( + match && + (match[1] + 'MHz琛板噺' === e.itemName || + match[1] + 'MHZ琛板噺' === e.itemName || + +match[1] / 1000 + 'GHz琛板噺' === e.itemName || + +match[1] / 1000 + 'GHZ琛板噺' === e.itemName) && + d.channel === +e.aisle + ) + }) + if (d) { + e.acqItemValue = this.roundFun(d.decimalVal, 3) + e.calItemValue = this.roundFun(d.measureValue, 3) + // e.itemValue = Math.min(e.acqItemValue, e.calItemValue) + e.itemValue = e.calItemValue + } + } else if (e.itemName.indexOf('椹绘尝姣�') > -1) { + const trace1 = data.find((d) => { + const match = d.label.match(/swr_(\d+)m/) + return match && d.channel === +e.aisle && d.trace === 1 + }) + const trace2 = data.find((d) => { + const match = d.label.match(/swr_(\d+)m/) + if (type === '杞х汗' && d.trace === 5) { + d.trace = 2 + // 杞х汗缃戝垎浠厤缃笉姝g‘锛屾墜鍔ㄤ慨姝� + } + return match && d.channel === +e.aisle && d.trace === 2 + }) + let [value1, value2, match1, match2] = [null, null, null, null] + if (trace1) { + value1 = this.roundFun(trace1.decimalVal, 3) + match1 = this.roundFun(trace1.label.match(/swr_(\d+)m/)[1], 3) + e.acqItemValue = `${value1}|${match1}` + } + if (trace2) { + value2 = this.roundFun(trace2.decimalVal, 3) + match2 = this.roundFun(trace2.label.match(/swr_(\d+)m/)[1], 3) + e.calItemValue = `${value2}|${match2}` + } + if (trace1 || trace2) { + e.itemValue = Math.max(value1, value2) + } + } else if (e.itemName.indexOf('鐩镐綅宸�') > -1) { + const d = data.find((d) => { + return d.channel === +e.aisle && d.label === 'pha_mean' + }) + if (d) { + e.acqItemValue = this.roundFun(d.decimalVal, 3) + } + } else if (e.itemName.indexOf('鐗规�ч樆鎶�') > -1) { + const trace1 = data.find((d) => { + return ( + d.channel === +e.aisle && + d.trace === 1 && + d.label === 'impedance_mean' + ) + }) + const trace2 = data.find((d) => { + return ( + d.channel === +e.aisle && + d.trace === 2 && + d.label === 'impedance_mean' + ) + }) + let [value1, value2] = [null, null] + if (trace1) { + value1 = this.roundFun(trace1.decimalVal, 3) + e.calItemValue = this.roundFun(trace1.calculateValue, 3) + e.itemValue = e.calItemValue + } + if (trace2) { + value2 = this.roundFun(trace2.decimalVal, 3) + e.calItemValue = this.roundFun(trace2.calculateValue, 3) + e.itemValue = e.calItemValue + } + if (trace1 || trace2) { + e.acqItemValue = `${value1}${value1 && value2 ? '|' : '' + }${value2}` + } + } + }) + } + }) + .finally(() => { + loading.close() + }) + }, + findFromCL(type) { + const obj = this.itemListNew.find(m => m.inspectionItem == type) + if (obj) { + return this.param[obj.id].resValue.v.v + } else { + return '' + } + }, roundFun(value, n) { if (value === null) { return null diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue index 7c1b889..d029a56 100644 --- a/src/views/business/inspectionTask/inspection.vue +++ b/src/views/business/inspectionTask/inspection.vue @@ -289,7 +289,7 @@ state == 1 "><span :style="`font-family:${n.v.ff} !important;`">{{ toFixed(n.v.v, n.v.ct) - }}</span></template> + }}</span></template> <template v-else-if=" n.v.ps != undefined && n.v.ps.value === '鏈�缁堝��' && diff --git a/src/workers/DataWorker.worker.js b/src/workers/DataWorker.worker.js index b2e99c1..1b24712 100644 --- a/src/workers/DataWorker.worker.js +++ b/src/workers/DataWorker.worker.js @@ -7,147 +7,190 @@ let list = null; // 浼犻�掑埌涓荤嚎绋嬬殑鏁版嵁 let result = { - method:'', - value:null -} + method: "", + value: null, +}; // 浼樺寲鏁伴噰杈冨鏁版嵁鏃�--璁板綍鏁伴噰椤圭洰鐨処d鏁扮粍锛岀洰鐨勬槸鍙栨渶鍚庝竴涓暟閲囬」鐩紝浼犲埌涓荤嚎绋嬭繘琛屾壒閲忕殑鏁版嵁閲囬泦淇濆瓨 -let arrSpecial = [] +let arrSpecial = []; // 鎺ユ敹涓荤嚎绋嬩紶閫掕繃鏉ョ殑鏁版嵁 -self.onmessage = function(event) { +self.onmessage = function (event) { const data = JSON.parse(event.data); dataAcquisitionInfo = data.dataAcquisitionInfo; list = data.list; // console.log(111,dataAcquisitionInfo) - arrSpecial = [] + arrSpecial = []; // 澶勭悊鏁版嵁 - handleData() -} + handleData(); +}; -function handleData(){ +function handleData() { // 閬嶅巻鏁版嵁鍒楄〃 - list.forEach((item,index)=>{ + list.forEach((item, index) => { let num = 0; - let str = '' - item.forEach(m=>{ - if(m.v.ps&&(m.v.ps.value=='妫�楠屽瓙椤�'||m.v.ps.value=='妫�楠岄」'||m.v.ps.value=='妫�楠岄」鍒嗙被')){ - if(m.v.ps&&m.v.ps.value=='妫�楠岄」鍒嗙被'){ - if(num==0){ - num++ - str = m.v.v+',' + let str = ""; + item.forEach((m) => { + if ( + m.v.ps && + (m.v.ps.value == "妫�楠屽瓙椤�" || + m.v.ps.value == "妫�楠岄」" || + m.v.ps.value == "妫�楠岄」鍒嗙被") + ) { + if (m.v.ps && m.v.ps.value == "妫�楠岄」鍒嗙被") { + if (num == 0) { + num++; + str = m.v.v + ","; } } - if(m.v.ps&&m.v.ps.value=='妫�楠岄」'){ - if(num==1){ - str = str+m.v.v + ',' - num++ + if (m.v.ps && m.v.ps.value == "妫�楠岄」") { + if (num == 1) { + str = str + m.v.v + ","; + num++; } else { - str = m.v.v+',' - num++ + str = m.v.v + ","; + num++; } } - if(m.v.ps&&m.v.ps.value=='妫�楠屽瓙椤�'){ - str = str+m.v.v + if (m.v.ps && m.v.ps.value == "妫�楠屽瓙椤�") { + str = str + m.v.v; } // 涓婇潰鍦ㄨ褰曟楠岄」+妫�楠屽瓙椤圭殑鍚嶇О锛屽鏋滄暟閲囧寘鍚楠岄」+妫�楠屽瓙椤圭殑鏁版嵁锛屽垯鎵ц - if(dataAcquisitionInfo[str]){ - let num = 0;//璇ユ楠岄」瀵瑰簲妫�楠屽�肩殑涓暟锛岀敤鐢ㄥ垽鏂渶澶氭湁澶氬皯涓楠屽�硷紝濡傛灉澶氭閲囬泦瓒呰繃浜嗚涓暟锛屽垯璧嬪�肩粰鏈�鍚庝竴涓楠屽�� - list[index].forEach(n=>{ - if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){ - num++ + if (dataAcquisitionInfo[str]) { + let num = 0; //璇ユ楠岄」瀵瑰簲妫�楠屽�肩殑涓暟锛岀敤鐢ㄥ垽鏂渶澶氭湁澶氬皯涓楠屽�硷紝濡傛灉澶氭閲囬泦瓒呰繃浜嗚涓暟锛屽垯璧嬪�肩粰鏈�鍚庝竴涓楠屽�� + list[index].forEach((n) => { + if ( + n.v.ps && + n.v.ps.value && + typeof n.v.ps.value == "string" && + n.v.ps.value.includes("妫�楠屽��") + ) { + num++; } - }) - list[index].forEach((n,i)=>{ - if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){ - let arr = n.v.ps.value.split('鍊�') - if(Array.isArray(dataAcquisitionInfo[str].value)){ + }); + list[index].forEach((n, i) => { + if ( + n.v.ps && + n.v.ps.value && + typeof n.v.ps.value == "string" && + n.v.ps.value.includes("妫�楠屽��") + ) { + let arr = n.v.ps.value.split("鍊�"); + if (Array.isArray(dataAcquisitionInfo[str].value)) { // 濡傛灉鏁版嵁婧愪负鏁扮粍锛屽垯鎵ц - for (let i = 0; i < dataAcquisitionInfo[str].value.length; i++) { - if(i+1==arr[1]){ + for ( + let i = 0; + i < dataAcquisitionInfo[str].value.length; + i++ + ) { + if (i + 1 == arr[1]) { // 璧嬪�兼暟閲囦紭鍖栨楠岄」鍒楄〃 - arrSpecial.push(n.i) - setTimeout(()=>{ - let num0 = 0 - if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){ + arrSpecial.push(n.i); + setTimeout(() => { + let num0 = 0; + if ( + n.v.ct && + n.v.ct.fa && + typeof n.v.ct.fa == "string" && + n.v.ct.fa.includes(".") + ) { // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟 - let str0 = n.v.ct.fa.split('.')[1] - num0 = str0.length - n.v.v = dataAcquisitionInfo[str].value[i]?Number(dataAcquisitionInfo[str].value[i]).toFixed(num0):dataAcquisitionInfo[str].value[i] - }else{ - // 鐩存帴璧嬪�� + let str0 = n.v.ct.fa.split(".")[1]; + num0 = str0.length; n.v.v = dataAcquisitionInfo[str].value[i] + ? Number(dataAcquisitionInfo[str].value[i]).toFixed( + num0 + ) + : dataAcquisitionInfo[str].value[i]; + } else { + // 鐩存帴璧嬪�� + console.log(44444, dataAcquisitionInfo, str); + n.v.v = dataAcquisitionInfo[str].value[i]; } // 浼犻�掔粰涓荤嚎绋� result = { - method:'changeInput', - value:{ - list:list, - n:n - } - } - self.postMessage(JSON.stringify(result)) - },2000) + method: "changeInput", + value: { + list: list, + n: n, + }, + }; + self.postMessage(JSON.stringify(result)); + }, 2000); } } - }else{ + } else { // 濡傛灉鏁版嵁婧愪负瀛楃鎴栨暟瀛楋紝鍒欐墽琛� - if(arr[1] ==dataAcquisitionInfo[str].frequency){ + if (arr[1] == dataAcquisitionInfo[str].frequency) { // 濡傛灉鏁伴噰娆℃暟绛変簬妫�楠屽�煎簭鍙凤紝鍒欒祴鍊肩粰褰撳墠妫�楠屽�� - arrSpecial.push(n.i) - setTimeout(()=>{ - let num0 = 0 - if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){ + arrSpecial.push(n.i); + setTimeout(() => { + let num0 = 0; + if ( + n.v.ct && + n.v.ct.fa && + typeof n.v.ct.fa == "string" && + n.v.ct.fa.includes(".") + ) { // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟 - let str0 = n.v.ct.fa.split('.')[1] - num0 = str0.length - n.v.v = dataAcquisitionInfo[str].value?Number(dataAcquisitionInfo[str].value).toFixed(num0):dataAcquisitionInfo[str].value - }else{ - // 鐩存帴璧嬪�� + let str0 = n.v.ct.fa.split(".")[1]; + num0 = str0.length; n.v.v = dataAcquisitionInfo[str].value + ? Number(dataAcquisitionInfo[str].value).toFixed(num0) + : dataAcquisitionInfo[str].value; + } else { + // 鐩存帴璧嬪�� + n.v.v = dataAcquisitionInfo[str].value; } // 浼犻�掔粰涓荤嚎绋� result = { - method:'changeInput', - value:{ - list:list, - n:n - } - } - self.postMessage(JSON.stringify(result)) - },2000) - }else if(Number(dataAcquisitionInfo[str].frequency)>num){ + method: "changeInput", + value: { + list: list, + n: n, + }, + }; + self.postMessage(JSON.stringify(result)); + }, 2000); + } else if (Number(dataAcquisitionInfo[str].frequency) > num) { // 濡傛灉鏁伴噰娆℃暟澶т簬妫�楠屽�煎簭鍙凤紝鍒欒祴鍊肩粰鏈�鍚庝竴涓楠屽�� - if(n.v.ps.value.includes(num)){ - arrSpecial.push(n.i) - setTimeout(()=>{ - let num0 = 0 - if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){ + if (n.v.ps.value.includes(num)) { + arrSpecial.push(n.i); + setTimeout(() => { + let num0 = 0; + if ( + n.v.ct && + n.v.ct.fa && + typeof n.v.ct.fa == "string" && + n.v.ct.fa.includes(".") + ) { // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟 - let str0 = n.v.ct.fa.split('.')[1] - num0 = str0.length - n.v.v = dataAcquisitionInfo[str].value?Number(dataAcquisitionInfo[str].value).toFixed(num0):dataAcquisitionInfo[str].value - }else{ - // 鐩存帴璧嬪�� + let str0 = n.v.ct.fa.split(".")[1]; + num0 = str0.length; n.v.v = dataAcquisitionInfo[str].value + ? Number(dataAcquisitionInfo[str].value).toFixed(num0) + : dataAcquisitionInfo[str].value; + } else { + // 鐩存帴璧嬪�� + n.v.v = dataAcquisitionInfo[str].value; } // 浼犻�掔粰涓荤嚎绋� result = { - method:'changeInput', - value:{ - list:list, - n:n - } - } - self.postMessage(JSON.stringify(result)) - },2000) + method: "changeInput", + value: { + list: list, + n: n, + }, + }; + self.postMessage(JSON.stringify(result)); + }, 2000); } } } } - }) + }); } } - }) - }) + }); + }); // if(arrSpecial[arrSpecial.length-1]){ // //浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d锛岀敤浜庡悗缁鐞� // setTimeout(()=>{ -- Gitblit v1.9.3