Commit 2e1ea47a by 无尘

fix: 优化发送数据

parent 02a6cb05
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,7 +2,7 @@
"name": "@gic-test/vue-gic-people",
"description": "vue-gic-people Plugin",
"author": "fairyly <498745097@qq.com>",
"version": "1.1.40",
"version": "1.1.42",
"license": "MIT",
"private": false,
"main": "dist/vue-gic-people.js",
......
......@@ -605,8 +605,8 @@
var that = this;
console.log(index,key,order)
console.log(that.conditionsList[index].children[key])
console.log(that.conditionsList[index].children[key].children[order])
console.log(that.conditionsList[index].children[key].children[order].levelModel)
// console.log(that.conditionsList[index].children[key].children[order])
// console.log(that.conditionsList[index].children[key].children[order].levelModel)
// 请求参数
var parentChainId = that.conditionsList[index].children[key].children[order].esScreeningWidgetChainId;
var widgetFieldKey = that.conditionsList[index].children[key].children[order].levelModel;
......@@ -984,7 +984,7 @@
toInputFrom(e) {
var that = this
console.log("输入值:",e.target.value,that.conditionsList[that.andIndex].children[that.orIndex])
var value = Number(e.target.value.replace(/[^\d]/g,'')) == NaN? '0': Number(e.target.value.replace(/[^\d]/g,''))
var value = !Number(e.target.value.replace(/[^\d]/g,''))? '0': Number(e.target.value.replace(/[^\d]/g,''))
console.log(value,Number(e.target.value.replace(/[^\d]/g,'')),String(value).substr(String(value).length-1,1))
// 判断输入
......@@ -1007,7 +1007,7 @@
toInputTo(e) {
var that = this
console.log("输入值:",e.target.value,that.conditionsList[that.andIndex].children[that.orIndex])
var value = Number(e.target.value.replace(/[^\d]/g,'')) == NaN? '0': Number(e.target.value.replace(/[^\d]/g,''))
var value = !Number(e.target.value.replace(/[^\d]/g,''))? '0': Number(e.target.value.replace(/[^\d]/g,''))
let t1 = that.conditionsList[that.andIndex].children[that.orIndex].children[2].levelModel[0];
let t2 = that.conditionsList[that.andIndex].children[that.orIndex].children[2].levelModel[1]
......@@ -1080,8 +1080,8 @@
that.componentIndex = order,
console.log("第 "+index+' 个并条件中第 '+key+' 个或条件中第 '+order+' 个组件',that.conditionsList[index].children[key].children[order])
console.log(that.conditionsList[index].children[key].children[order].levelModel)
console.log(Object.keys(that.conditionsList[index].children[key].children[order]))
console.log(Object.values(that.conditionsList[index].children[key].children[order]))
// console.log(Object.keys(that.conditionsList[index].children[key].children[order]))
// console.log(Object.values(that.conditionsList[index].children[key].children[order]))
},
// 选择搜索后的列表
......@@ -1095,7 +1095,7 @@
selectTree(e,index,key,ind){
var that = this
console.log(e,index,key,ind)
console.log(that.conditionsList[index].children[key].children[ind])
// console.log(that.conditionsList[index].children[key].children[ind])
var arr = {}
setTimeout(function(){
arr = JSON.parse(JSON.stringify(that.conditionsList[index].children[key].children[ind].levelModel))
......@@ -1112,13 +1112,13 @@
deSelectTree(e,index,key,ind){
var that = this
console.log(e,index,key,ind)
console.log(that.conditionsList[index].children[key].children[ind])
// console.log(that.conditionsList[index].children[key].children[ind])
var arr = {}
setTimeout(function(){
arr = JSON.parse(JSON.stringify(that.conditionsList[index].children[key].children[ind].levelModel))
console.log(JSON.stringify(arr),that.conditionsList[index].children[key].children[ind].levelModel)
// console.log(JSON.stringify(arr),that.conditionsList[index].children[key].children[ind].levelModel)
that.conditionsList[that.andIndex].children[that.orIndex].columnValue = arr.join(' ');//String(arr)
console.log(that.conditionsList[that.andIndex].children[that.orIndex].columnValue)
// console.log(that.conditionsList[that.andIndex].children[that.orIndex].columnValue)
},100)
},
......@@ -1130,10 +1130,10 @@
console.log("query:",query)
var selectValue = that.conditionsList[that.andIndex].children[that.orIndex].children[that.componentIndex].levelModel
console.log(selectValue)
// console.log(selectValue)
if (query !== '') {
var url = that.conditionsList[that.andIndex].children[that.orIndex].children[that.componentIndex-1].url
console.log("取到当前组前一个保存的",url)
// console.log("取到当前组前一个保存的",url)
that.getCurrentData(url,query)
// 获取搜索列表数据
// that.getStoreList(query,selectValue);
......@@ -1147,7 +1147,7 @@
// 获取门店列表
getStoreList(query,threeLevelValue) {
var that = this
console.log(threeLevelValue)
// console.log(threeLevelValue)
var para = {
searchParam: query,
selectedIds: threeLevelValue?String(threeLevelValue):'',
......@@ -1157,7 +1157,7 @@
that.axios.post(that.baseUrl+'/api-plug/query-store-by-code-name',qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
// console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
resData.result.forEach(function(ele,index){
......@@ -1193,7 +1193,7 @@
}
that.axios.post(that.baseUrl+url,qs.stringify(para))
.then((res) => {
console.log(res,res.data,res.data.errorCode)
// console.log(res,res.data,res.data.errorCode)
var resData = res.data
if (resData.errorCode == 0) {
resData.result.forEach(function(ele,index){
......@@ -1375,7 +1375,7 @@
// })
// })
// })
console.log("setData:",JSON.stringify(setData))
// console.log("setData:",JSON.stringify(setData))
// return;
var birthFlag = true;
setData.forEach(function(ele,index) {
......@@ -1386,7 +1386,7 @@
]
}
ele.children.forEach(function(el,index) {
ele.children.forEach(function(el,ind) {
var innerObj = {
type: 'data',
data: {
......@@ -1406,12 +1406,27 @@
}
}
// 去除 com005 中没有选择数据
el.children.forEach(function(child,key) {
let emptyArr = [];
if (child.templateCode == 'com005') {
// console.log(child.levelOptions)
child.levelOptions.forEach(function(obj,k){
if (child.levelModel.indexOf(obj.key) !== -1) {
emptyArr.push(obj)
}
})
child.levelOptions = emptyArr
}
})
obj.list.push(innerObj)
})
sendData.list.push(obj)
})
console.log("setData:>>>>>",JSON.stringify(setData))
console.log("sendData:>>>>>",JSON.stringify(sendData))
that.selectDataList = sendData
// that.calculateNum(sendData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment