From d3642faa7f79bc1e8992e528ad102587a2c44499 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 16 四月 2024 15:27:42 +0800
Subject: [PATCH] 新增行的时候点击范围修改
---
src/views/systemSetting/silkStandardSetting/index.vue | 56 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/src/views/systemSetting/silkStandardSetting/index.vue b/src/views/systemSetting/silkStandardSetting/index.vue
index 5fa150d..83a6048 100644
--- a/src/views/systemSetting/silkStandardSetting/index.vue
+++ b/src/views/systemSetting/silkStandardSetting/index.vue
@@ -55,7 +55,7 @@
prop: "checkItem",
projectName: true,
isCallMethod: true,
- getCallMethod: this.getCheckItemName
+ getCallMethod: this.getCheckItemName,
},
{ label: "寮�濮嬬氦搴�", prop: "startFineness", inputFloat: true },
{ label: "缁撴潫绾ゅ害", prop: "endFineness", inputFloat: true },
@@ -91,7 +91,21 @@
if (res.code === 200) {
if (res.data.length > 0) {
this.tableData = []
- this.tableColumn = this.defaultColumn
+ this.tableColumn = [
+ {
+ label: "妫�鏌ラ」鐩悕绉�",
+ prop: "checkItem",
+ projectName: true,
+ isCallMethod: true,
+ getCallMethod: this.getCheckItemName,
+ },
+ { label: "寮�濮嬬氦搴�", prop: "startFineness", inputFloat: true },
+ { label: "缁撴潫绾ゅ害", prop: "endFineness", inputFloat: true },
+ { label: "閲庣氦", prop: "rankA", inputFloat: true },
+ { label: "澶ч噹", prop: "rankB", inputFloat: true },
+ { label: "鐗归噹", prop: "rankC", inputFloat: true }
+ ]
+ // this.tableColumn=this.defaultColumn
this.columnDataProcess(res.data[0].dynamicsRanks)
this.rankObj = {}
this.allDataProcess(res.data)
@@ -126,11 +140,16 @@
inputFloat: true
}
})
+ let currentIndex=0
+ this.tableColumn.map((item, index) => {
+ if (item.prop == 'rankA') {
+ currentIndex = index
+ }
+ })
this.columnNum = list.length + 1
for (let j = 0; j < list.length; j++) {
- this.tableColumn.splice(2, 0, list[j])
+ this.tableColumn.splice(currentIndex, 0, list[j])
}
- console.log(this.tableColumn)
this.silkTableList.tableColumn = this.tableColumn
},
setTableForm() {
@@ -138,14 +157,15 @@
tableData: this.tableData,
isReturn: false,
tableColumn: [
- { label: "妫�鏌ラ」鐩悕绉�", prop: "projectName", projectName: true },
- { label: "寮�濮嬬氦搴�", prop: "start", inputFloat: true },
- { label: "缁撴潫绾ゅ害", prop: "end", inputFloat: true },
- { label: "閲庣氦", prop: "price1", inputFloat: true },
- { label: "澶ч噹", prop: "price2", inputFloat: true },
- { label: "鐗归噹", prop: "price3", inputFloat: true }
+ { label: "妫�鏌ラ」鐩悕绉�", prop: "checkItem", projectName: true },
+ { label: "寮�濮嬬氦搴�", prop: "startFineness", inputFloat: true },
+ { label: "缁撴潫绾ゅ害", prop: "endFineness", inputFloat: true },
+ { label: "閲庣氦", prop: "rankA", inputFloat: true },
+ { label: "澶ч噹", prop: "rankB", inputFloat: true },
+ { label: "鐗归噹", prop: "rankC", inputFloat: true }
]
}
+ this.tableColumn=this.silkTableList.tableColumn
},
// 鎼滅储
onFilterSearch(searchText) {
@@ -162,6 +182,7 @@
price2: 0,
price3: 0
})
+ this.silkTableList.tableData=this.tableData
}else{
this.$message.error('璇峰厛瑙i攣鍐嶆柊澧烇紒')
}
@@ -251,7 +272,13 @@
// 娣诲姞鍒�
addColumnClick() {
let propStr = "prop" + this.columnNum
- this.tableColumn.splice(2, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true })
+ let currentIndex=0
+ this.tableColumn.map((item, index) => {
+ if (item.prop == 'rankA') {
+ currentIndex = index
+ }
+ })
+ this.tableColumn.splice(currentIndex, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true })
this.$set(this.dataObj, propStr, 0)
this.$set(this.rankObj, propStr, 0)
this.columnInputList.push({ rankProp: propStr, rankName: "", rankValue: 0 })
@@ -275,6 +302,13 @@
currentIndex = index
}
})
+ let columnInputIndex=0
+ this.columnInputList.forEach((item,index) => {
+ if (item.rankProp == prop) {
+ columnInputIndex = index
+ }
+ })
+ this.columnInputList.splice(columnInputIndex,1)
this.tableColumn.splice(currentIndex, 1)
this.silkTableList.tableColumn = this.tableColumn
this.$delete(this.dataObj, prop)
--
Gitblit v1.8.0