A股数据优化

dev
yujialong 3 years ago
parent 9fa6635b39
commit d4fdb02a15
  1. 45
      src/views/data/Framework.vue
  2. 41
      src/views/data/Product.vue

@ -138,6 +138,8 @@ export default {
previewHead: [],
previewData: [],
submited: false,
names: [],
showNames: []
};
},
watch: {
@ -331,11 +333,12 @@ export default {
}
})
if(isConcat){
n.typeTreePage++
n.children = n.children.concat(list)
}else{
n.children = list
n.tableLen = res.list.total
}
n.typeTreePage++
}).catch(res => {})
},
batchImport(){
@ -420,18 +423,43 @@ export default {
},
closeImport(){
this.$refs.typeTree.setCheckedKeys([])
this.names = []
this.showNames = []
},
confirmImport(){
if(this.submited) return false
getNames(){
let list = this.$refs.typeTree.getCheckedNodes()
let names = []
let showNames = []
return new Promise((resolve,reject) => {
let getLen = 0
list.map(n => {
if(n.name && !n.disabled){
names.push(n.name)
showNames.push(n.showName)
if(n.tableLen && n.tableLen > n.children.length) getLen++
})
list.map((n,i) => {
if(n.tableLen && n.tableLen > n.children.length){
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&pageNum=1&pageSize=10000`).then(res => {
let tableList = res.list.records
getLen--
tableList.map(n => {
if(!this.defaultTypeChecked.includes(String(n.id))){
this.names.push(n.name)
this.showNames.push(n.showName)
}
})
if(!getLen) resolve()
}).catch(res => {})
}else if(n.name && !n.disabled && !this.names.includes(n.name)){
this.names.push(n.name)
this.showNames.push(n.showName)
if(!getLen) resolve()
}
})
})
},
confirmImport(){
if(this.submited) return false
if(!this.$refs.typeTree.getCheckedNodes().length) return this.$message.warning('请选择数据')
this.getNames().then(() => {
let names = Array.from(new Set(this.names))
let showNames = Array.from(new Set(this.showNames))
if(!names.length) return this.$message.warning('请选择数据')
this.submited = true
@ -454,6 +482,7 @@ export default {
}).catch(res => {
this.submited = false
})
})
},
}
};

@ -194,6 +194,7 @@ export default {
typeUnit: 20,
typeScrollTop: 0,
typeTimer: null,
tableId: [],
configVisible: false,
configChecked: [],
@ -266,11 +267,12 @@ export default {
n.id = String(n.id)
})
if(isConcat){
n.typePage++
n.children = n.children.concat(list)
}else{
n.children = list
n.tableLen = res.pageList.total
}
n.typePage++
}).catch(res => {})
},
getType(){
@ -458,18 +460,42 @@ export default {
this.productName = ''
this.market = ''
this.isDetail = false
this.typeIndex = 1000
this.typeIndex = 100000
this.typeList = []
this.tableId = []
},
getIds(){
let list = this.$refs.type.getCheckedNodes()
return new Promise((resolve,reject) => {
let getLen = 0
list.map(n => {
if(n.tableLen && n.tableLen > n.children.length) getLen++
})
list.map((n,i) => {
if(n.tableLen && n.tableLen > n.children.length){
this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => {
let tableList = res.pageList.records
tableList.map(n => {
this.tableId.push(String(n.id))
})
getLen--
if(!getLen) resolve()
}).catch(res => {})
}else if(n.name && !this.tableId.includes(n.id)){
this.tableId.push(n.id)
if(!getLen) resolve()
}
})
})
},
confirm(){
if(!this.productName) return this.$message.warning('请输入数据产品名称')
if(!this.market) return this.$message.warning('请输入市场价格')
if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字')
let list = this.$refs.type.getCheckedNodes()
let tableId = []
list.map(n => {
if(n.name) tableId.push(n.id)
})
if(!this.$refs.type.getCheckedNodes().length) return this.$message.warning('请选择数据')
this.getIds().then(() => {
let tableId = Array.from(new Set(this.tableId))
if(!tableId.length) return this.$message.warning('请选择数据')
let data = {
id: this.id,
@ -497,6 +523,7 @@ export default {
this.getData()
}).catch(res => {})
}
})
},
configData(){

Loading…
Cancel
Save