From 790d5f4ed220eb76f28682b057799a57c62c9c94 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 30 五月 2025 08:45:31 +0800 Subject: [PATCH] 1.流量*水温表格生成,可输入 --- H5/Js/IPQC_SJ/Add.js | 105 ++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 85 insertions(+), 20 deletions(-) diff --git a/H5/Js/IPQC_SJ/Add.js b/H5/Js/IPQC_SJ/Add.js index e87d5e3..6a37342 100644 --- a/H5/Js/IPQC_SJ/Add.js +++ b/H5/Js/IPQC_SJ/Add.js @@ -2,29 +2,46 @@ el: '#app', data: function () { return { + tableTbData: [], // "鍒剁儹鎬ц兘"鐢熸垚鐨勮〃鏍兼暟鎹� + formTbData: { // 琛ㄥ崟鏁版嵁 + temperatureData: {} // 瀛樺偍鐨勫疄闄呮俯搴︺�佸疄闄呮祦閲忔暟鎹� + }, + headers: [], showZr: false, waterOptions: [ + { value: '100鈩�', text: '100鈩�' }, + { value: '99鈩�', text: '99鈩�' }, + { value: '90鈩�', text: '90鈩�' }, + { value: '85鈩�', text: '85鈩�' }, + { value: '80鈩�', text: '80鈩�' }, + { value: '75鈩�', text: '75鈩�' }, + { value: '65鈩�', text: '65鈩�' }, + { value: '60鈩�', text: '60鈩�' }, + { value: '55鈩�', text: '55鈩�' }, + { value: '45鈩�', text: '45鈩�' }, + { value: '42鈩�', text: '42鈩�' }, { value: '甯告俯姘�', text: '甯告俯姘�' }, - { value: '0', text: '0鈩�' }, - { value: '5', text: '5鈩�' }, - { value: '15', text: '15鈩�' }, - { value: '35', text: '35鈩�' }, - { value: '55', text: '55鈩�' }, - { value: '75', text: '75鈩�' }, - { value: '100', text: '100鈩�' } - ], + { value: '鍐版按', text: '鍐版按' }, + { value: '70鈩�', text: '70鈩�' }, + { value: '50鈩�', text: '50鈩�' }, + { value: '寰喎', text: '寰喎' } + ],//姘存俯閫夐」 flowOptions: [ - { value: '100', text: '100ml' }, - { value: '200', text: '200ml' }, - { value: '300', text: '300ml' }, - { value: '400', text: '400ml' }, - { value: '500', text: '500ml' }, - { value: '600', text: '600ml' }, - { value: '700', text: '700ml' }, - { value: '800', text: '800ml' }, - { value: '900', text: '900ml' }, - { value: '1000', text: '1000ml' } - ], + { value: '50ml', text: '50ml' }, + { value: '120ml', text: '120ml' }, + { value: '150ml', text: '150ml' }, + { value: '160ml', text: '160ml' }, + { value: '250ml', text: '250ml' }, + { value: '260ml', text: '260ml' }, + { value: '350ml', text: '350ml' }, + { value: '360ml', text: '360ml' }, + { value: '450ml', text: '450ml' }, + { value: '550ml', text: '550ml' }, + { value: '750ml', text: '750ml' }, + { value: '999ml', text: '999ml' }, + { value: '1min', text: '涓�鍒嗛挓娴侀噺' }, + { value: '3min', text: '涓夊垎閽熸祦閲�' } + ],//娴侀噺閫夐」 selectedWater: [],// 宸查�夋按娓╁�� selectedFlow: [], // 宸查�夋祦閲忓�� isLoading: false, @@ -515,5 +532,53 @@ that.init();//鍒锋柊妫�楠岄」鐩� }) }, + createTb() { + // 娓呯┖鏃ф暟鎹� + this.tableTbData = []; + this.formTbData.temperatureData = {}; + + // 鏍¢獙閫夋嫨 + if (this.selectedWater.length === 0 || this.selectedFlow.length === 0) { + this.$toast.fail('璇峰厛閫夋嫨姘存俯鍜屾祦閲�'); + return; + } + + // 鐢熸垚琛ㄥご + // 淇敼headers鐢熸垚閫昏緫 鈫� + const headers = [ + '璁惧畾娓╁害', + '瀹為檯娓╁害', + ...this.selectedFlow.sort().map(f => `娴侀噺${f}`) + ]; + this.headers = headers; + console.log(this.headers); + // 鐢熸垚琛屾暟鎹� + this.tableTbData = this.selectedWater.sort((a,b) => a - b).map(water => { + const row = { + temperature: water === '甯告俯姘�' ? water : water, + values: Object.fromEntries([ + ['temp', ''], // 鍥哄畾娓╁害瀛楁 + ...this.selectedFlow.map(flow => [flow, '']) + ]) + }; + + // 鍒濆鍖栬〃鍗曟暟鎹粨鏋� + this.$set(this.formTbData.temperatureData, water, {}); + // 娣诲姞鍥哄畾瀛楁鈥濆疄闄呮俯搴︹�滃垵濮嬪寲 + this.$set(this.formTbData.temperatureData[water], 'temp', ''); + this.selectedFlow.forEach(flow => { + this.$set(this.formTbData.temperatureData[water], flow, ''); + }); + + return row; + }); + + // 鑷姩婊氬姩鍒拌〃鏍煎尯鍩� + setTimeout(() => { + const tableEl = document.getElementById('temperature-table'); + if (tableEl) tableEl.scrollIntoView({ behavior: 'smooth' }); + }, 100); + console.log(this.formTbData); + }, } -}) \ No newline at end of file +}) -- Gitblit v1.9.3