| | |
| | | </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-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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import formula from '../../tool/formula.vue' |
| | | export default { |
| | | name: "dataAcquisitionConfig", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {}, |
| | | components: { |
| | | formula |
| | | }, |
| | | props: { |
| | | deviceId: { |
| | | type: Number, |
| | |
| | | {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:'inspectionItemSubClass', |
| | | index:12 |
| | | }, |
| | | { |
| | | name:'inspectionItemSubClass', |
| | | index:13 |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | 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]) { |
| | |
| | | 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) |
| | | } |
| | | // ä¸è¬çåå¹¶è¡ |
| | | 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); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | 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('æ·»å æå') |
| | | }) |
| | |
| | | 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.deleteList.push(item.id) |
| | | this.domains.splice(index, 1) |
| | | } |
| | | }) |
| | | } else { |
| | | this.domains.splice(index, 1) |
| | | } |
| | |
| | | id: '' |
| | | }); |
| | | }, |
| | | evalResult () { |
| | | evalResult (val) { |
| | | this.configForm.formula = val |
| | | // æ ¹æ®å
¬å¼è®¡ç®åºç»æ |
| | | }, |
| | | sizeChange(val) { |
| | |
| | | this.page.current = val |
| | | }, |
| | | closeForm () { |
| | | this.deleteList = [] |
| | | this.domains = [{ |
| | | referx: '', |
| | | refery: '', |
| | |
| | | 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; |
| | | } |