feat: There is no way the, TO optimize the query

This commit is contained in:
super_liu
2021-10-22 16:01:43 +08:00
parent b91e57419b
commit b0f07ed40e
3 changed files with 200 additions and 185 deletions
@@ -2757,69 +2757,74 @@ export default {
window.open(routeUrl.href, '_blank')
},
// 编辑标准属性
selectStandardPro(item, state) {
this.id = item.id
this.collectId = item.collectId
this.addOrUPdateFlag = 2
this.modalshowtitle = '编辑国内标准'
this.modalshowflag = true
this.resolveFormFieldList(item.isRelateAccess)
this.$nextTick(() => {
Promise.all([this.queryDisplayLocation()]).then((values) => {
const [displayLocation] = values
const formFieldList = this.formFieldList
this.sarStandardsInfoEO = JSON.parse(JSON.stringify(item))
if (this.sarStandardsInfoEO.standSystem) {
this.defaultCheckedKeys = [this.sarStandardsInfoEO.standSystem];
}
this.sarStandardsInfoEO.standSort = item.standSort
if (this.sarStandardsInfoEO.putTime != null && this.sarStandardsInfoEO.putTime !== '') {
this.sarStandardsInfoEO.putTime = this.sarStandardsInfoEO.putTime.replace(new RegExp(/-/gm), '/')
this.sarStandardsInfoEO.putTime = new Date(this.sarStandardsInfoEO.putTime)
}
Object.keys(item.attrInfoMap || {}).forEach((key) => {
if (item.attrInfoMap[key]) {
this.$set(this.sarStandardsInfoEO, key, item.attrInfoMap[key] === '[]' ? '' : item.attrInfoMap[key])
}
})
const dynamicFormField = this.sarStandardsInfoEO
this.sarStandardsInfoEO.EOPSSRQ = this.$moment(this.sarStandardsInfoEO.EOPSSRQ).isValid() ? this.$moment(this.sarStandardsInfoEO.EOPSSRQ) : this.sarStandardsInfoEO.EOPSSRQ
this.sarStandardsInfoEO['id'] = item.id
this.standState = JSON.parse(JSON.stringify(this.sarStandardsInfoEO.standState))
formFieldList.forEach((field) => {
displayLocation.forEach((location) => {
let value = this.sarStandardsInfoEO[field.attrField]
let valueName = ''
if (value && field.attrType === 'DATE_PICKER') {
value = this.$moment(value).format('YYYY-MM-DD')
}
if (field.attrField === 'CYCVPPSBM') {
this.defaultCheckedKeys1 = [value]
}
if (field.attrField === 'KCCVPPSBM') {
this.defaultCheckedKeys2 = [value]
}
if (field.attrField === 'DYBXH') {
this.defaultCheckedKeys3 = [value]
}
field['value'] = value
// 追加用户名称和部门名称和SVPPS名称
// if (field.selVal === 'ROLELIST' || field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.attrField === 'SVPPS' || field.attrField === 'XMPGJS') {
// let attrFieldName = field.attrField + 'Name'
// valueName = dynamicFormField[attrFieldName]
// }
// field['valueName'] = valueName
if (field.showRegionId === location.value) {
if (!location.child) {
location['child'] = []
}
location['child'].push(field)
}
})
})
this.dynamicFormField = displayLocation
this.loading = false
})
selectStandardPro(row, state) {
this.id = row.id
this.$http.get('sarStandardsInfo/sar-standards-info/getStandInfoUpdateById', {id: row.id}, {
_this: this
}, res => {
const item = res.data || {}
this.collectId = item.collectId
this.addOrUPdateFlag = 2
this.modalshowtitle = '编辑国内标准'
this.modalshowflag = true
this.resolveFormFieldList(item.isRelateAccess)
this.$nextTick(() => {
Promise.all([this.queryDisplayLocation()]).then((values) => {
const [displayLocation] = values
const formFieldList = this.formFieldList
this.sarStandardsInfoEO = JSON.parse(JSON.stringify(item))
if (this.sarStandardsInfoEO.standSystem) {
this.defaultCheckedKeys = [this.sarStandardsInfoEO.standSystem];
}
this.sarStandardsInfoEO.standSort = item.standSort
if (this.sarStandardsInfoEO.putTime != null && this.sarStandardsInfoEO.putTime !== '') {
this.sarStandardsInfoEO.putTime = this.sarStandardsInfoEO.putTime.replace(new RegExp(/-/gm), '/')
this.sarStandardsInfoEO.putTime = new Date(this.sarStandardsInfoEO.putTime)
}
Object.keys(item.attrInfoMap || {}).forEach((key) => {
if (item.attrInfoMap[key]) {
this.$set(this.sarStandardsInfoEO, key, item.attrInfoMap[key] === '[]' ? '' : item.attrInfoMap[key])
}
})
const dynamicFormField = this.sarStandardsInfoEO
this.sarStandardsInfoEO.EOPSSRQ = this.$moment(this.sarStandardsInfoEO.EOPSSRQ).isValid() ? this.$moment(this.sarStandardsInfoEO.EOPSSRQ) : this.sarStandardsInfoEO.EOPSSRQ
this.sarStandardsInfoEO['id'] = item.id
this.standState = JSON.parse(JSON.stringify(this.sarStandardsInfoEO.standState))
formFieldList.forEach((field) => {
displayLocation.forEach((location) => {
let value = this.sarStandardsInfoEO[field.attrField]
let valueName = ''
if (value && field.attrType === 'DATE_PICKER') {
value = this.$moment(value).format('YYYY-MM-DD')
}
if (field.attrField === 'CYCVPPSBM') {
this.defaultCheckedKeys1 = [value]
}
if (field.attrField === 'KCCVPPSBM') {
this.defaultCheckedKeys2 = [value]
}
if (field.attrField === 'DYBXH') {
this.defaultCheckedKeys3 = [value]
}
field['value'] = value
// 追加用户名称和部门名称和SVPPS名称
// if (field.selVal === 'ROLELIST' || field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.attrField === 'SVPPS' || field.attrField === 'XMPGJS') {
// let attrFieldName = field.attrField + 'Name'
// valueName = dynamicFormField[attrFieldName]
// }
// field['valueName'] = valueName
if (field.showRegionId === location.value) {
if (!location.child) {
location['child'] = []
}
location['child'].push(field)
}
})
})
this.dynamicFormField = displayLocation
this.loading = false
})
})
})
},
// 修改过程中,将resId 修改成 attid