修改参数收集增加数据
This commit is contained in:
@@ -1552,7 +1552,6 @@
|
||||
selectedRowKeysValue.push(res)
|
||||
}
|
||||
})
|
||||
console.log(selectedRowKeysValue)
|
||||
// for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
||||
// let postDateobj = {}
|
||||
// let itemIn = Object.keys(selectedRowKeysValue[i])
|
||||
@@ -1598,12 +1597,12 @@
|
||||
}
|
||||
}
|
||||
// return
|
||||
if (configDataList && configDataList.length > 0){
|
||||
if (configDataList && configDataList.length > 0) {
|
||||
configDataList.forEach(res => {
|
||||
Object.keys(res).forEach(val => {
|
||||
if (res[val] && res[val].paramsConfigData) {
|
||||
let paramsConfigData = res[val].paramsConfigData
|
||||
Object.keys(paramsConfigData).forEach((ol,index) => {
|
||||
Object.keys(paramsConfigData).forEach((ol, index) => {
|
||||
paramsConfigData[ol][0].orderNum = index
|
||||
paramsConfigData[ol].forEach(item => {
|
||||
if (item.type == 'pull_more') {
|
||||
@@ -1614,9 +1613,7 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
console.log(configDataList)
|
||||
let query = {
|
||||
// ...configDataList,
|
||||
configDataList: configDataList,
|
||||
@@ -1651,34 +1648,92 @@
|
||||
let _this = this
|
||||
let postDate = []
|
||||
let selectedRowKeysValue = JSON.parse(JSON.stringify(this.selectedRowKeysValue))
|
||||
// for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
||||
// let postDateobj = {}
|
||||
// let itemIn = Object.keys(selectedRowKeysValue[i])
|
||||
// for (let j = 0; j < itemIn.length; j++) {
|
||||
// if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) {
|
||||
// if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
|
||||
// postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
|
||||
// for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
|
||||
// if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') {
|
||||
// selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
|
||||
// }
|
||||
// if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
|
||||
// selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
|
||||
// }
|
||||
// if (!selectedRowKeysValue[i][itemIn[j]].list[k].dataValue && selectedRowKeysValue[i][itemIn[j]].list[k].isMust == '1'
|
||||
// && selectedRowKeysValue[i][itemIn[j]].list[k].isLock == '0') {
|
||||
// this.$message.warning(selectedRowKeysValue[i].nioNumber + ',' + this.$t('requiredParametersEmpty'))
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// postDateobj.id = selectedRowKeysValue[i].id
|
||||
// postDate.push(postDateobj)
|
||||
// }
|
||||
let configDataList = []
|
||||
for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
||||
let postDateobj = {}
|
||||
let itemIn = Object.keys(selectedRowKeysValue[i])
|
||||
for (let j = 0; j < itemIn.length; j++) {
|
||||
if (itemIn[j] !== 'sdt' && selectedRowKeysValue[i][itemIn[j]].list) {
|
||||
if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
|
||||
postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
|
||||
for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
|
||||
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') {
|
||||
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
|
||||
}
|
||||
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
|
||||
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
|
||||
}
|
||||
if (!selectedRowKeysValue[i][itemIn[j]].list[k].dataValue && selectedRowKeysValue[i][itemIn[j]].list[k].isMust == '1'
|
||||
&& selectedRowKeysValue[i][itemIn[j]].list[k].isLock == '0') {
|
||||
this.$message.warning(selectedRowKeysValue[i].nioNumber + ',' + this.$t('requiredParametersEmpty'))
|
||||
return
|
||||
configDataList.push({
|
||||
id: selectedRowKeysValue[i].id
|
||||
})
|
||||
if (selectedRowKeysValue[i].configIds && selectedRowKeysValue[i].configIds.length > 0) {
|
||||
for (let j = 0; j < selectedRowKeysValue[i].configIds.length; j++) {
|
||||
let keyIndex = Object.keys(selectedRowKeysValue[i])
|
||||
for (let k = 0; k < keyIndex.length; k++) {
|
||||
if (keyIndex[k] == selectedRowKeysValue[i].configIds[j]) {
|
||||
let keyName = keyIndex[k]
|
||||
configDataList[i][keyName] = selectedRowKeysValue[i][keyName]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// return
|
||||
if (configDataList && configDataList.length > 0) {
|
||||
for (let i = 0; i < configDataList.length; i++) {
|
||||
let res = Object.keys(configDataList[i])
|
||||
for (let j = 0; j < res.length; j++) {
|
||||
let key = res[j]
|
||||
if (configDataList[i][key] && configDataList[i][key].paramsConfigData) {
|
||||
let paramsConfigData = configDataList[i][key].paramsConfigData
|
||||
let paramsConfigDataQuery = Object.keys(paramsConfigData)
|
||||
for (let k = 0; k < paramsConfigDataQuery.length; k++) {
|
||||
let keyName = paramsConfigDataQuery[k]
|
||||
paramsConfigData[keyName][0].orderNum = k
|
||||
let keyNameOne = paramsConfigData[keyName]
|
||||
for (let l = 0; l < keyNameOne.length; l++) {
|
||||
if (keyNameOne[l].type == 'pull_more') {
|
||||
keyNameOne[l].dataValue = keyNameOne[l].dataValue.join(',')
|
||||
}
|
||||
if (!keyNameOne[l].dataValue && keyNameOne[l].isMust == '1' && keyNameOne[l].isLock == '0') {
|
||||
this.$message.warning(selectedRowKeysValue[i].nioNumber + ',' + this.$t('requiredParametersEmpty'))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
postDateobj.id = selectedRowKeysValue[i].id
|
||||
postDate.push(postDateobj)
|
||||
// configDataList.forEach(res => {
|
||||
// Object.keys(res).forEach(val => {
|
||||
// if (res[val] && res[val].paramsConfigData) {
|
||||
// let paramsConfigData = res[val].paramsConfigData
|
||||
// Object.keys(paramsConfigData).forEach((ol, index) => {
|
||||
// paramsConfigData[ol][0].orderNum = index
|
||||
// paramsConfigData[ol].forEach(item => {
|
||||
// if (item.type == 'pull_more') {
|
||||
// item.dataValue = item.dataValue.join(',')
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
}
|
||||
|
||||
let configDataList = { configDataList: postDate }
|
||||
// let configDataList = { configDataList: postDate }
|
||||
if (this.selectedRowKeys.length == 0) {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
} else {
|
||||
@@ -1686,7 +1741,11 @@
|
||||
this.$confirm({
|
||||
content: _this.$t('Areyousureparameteritems'),
|
||||
onOk() {
|
||||
postAction(_this.url.add, configDataList).then((res) => {
|
||||
let query = {
|
||||
configDataList: configDataList,
|
||||
paramsManifestId: this.paramsManifest.id
|
||||
}
|
||||
postAction(_this.url.add, query).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.GetgetTableList()
|
||||
|
||||
Reference in New Issue
Block a user