Commit 050311f8 by liyuhang19990520

Merge branch 'dev_zwpt' of http://47.92.108.28/changchao/founder_vue into dev_zwpt

parents 0a6a0440 07ef6bb2
......@@ -287,9 +287,9 @@ export default {
},
data () {
return {
drawer: true, // 抽屉开关
drawer: false, // 抽屉开关
direction: 'rtl', // 抽屉类型
radio1: 3, // 指纹,掌纹,人像
radio1: 1, // 指纹,掌纹,人像
};
},
mounted () {
......
......@@ -473,7 +473,11 @@ export default {
checkedTargetsRight: [], // 选定逻辑库
targetsRight: targetOptions_aj, // 逻辑库列表
isIndeterminateRight: false, // 逻辑库全选状态
newArr: []
newArr: [],
logicList: [] // 目标逻辑库数组
};
},
created () {
......@@ -574,26 +578,29 @@ export default {
// 获取文件列表
onChange (file, fileList) {
// console.log(file.raw, 2222233333)
if (this.timer2) clearTimeout(this.timer2);
this.timer2 = setTimeout(() => {
this.paramsArr = fileList;
console.log(file)
let name = file.raw.webkitRelativePath.split('/')[0];
let obj = {};
obj.index = this.newArr.length + 1;
let childrenArr = fileList.filter((i) => i.raw.webkitRelativePath.indexOf(name) >= 0);
console.log(childrenArr)
obj.children = childrenArr.map((i, index) => {
i.index = (obj.index) + '-' + (index + 1);
i.neivx = index + 1;
return i
});
this.newArr.push(obj);
console.log(this.newArr, this.paramsArr)
}, 200)
// if (this.timer2) clearTimeout(this.timer2);
// this.timer2 = setTimeout(() => {
// this.paramsArr = fileList;
// console.log(file)
// let name = file.raw.webkitRelativePath.split('/')[0];
// let obj = {};
// obj.index = this.newArr.length + 1;
// let childrenArr = fileList.filter((i) => i.raw.webkitRelativePath.indexOf(name) >= 0);
// console.log(childrenArr)
// obj.children = childrenArr.map((i, index) => {
// i.index = (obj.index) + '-' + (index + 1);
// i.neivx = index + 1;
// return i
// });
// this.newArr.push(obj);
// console.log(this.newArr, this.paramsArr)
// }, 200)
// 重复文件过滤
......@@ -605,104 +612,175 @@ export default {
// 获取文件夹
var folder = fileList[0].raw.webkitRelativePath.split("/");
// console.log('fffff', folder[0])
// let that = this;
// let newlist = fileList;
// for (let i = 0; i < fileList.length; i++) {
// let file = fileList[i].raw
// // console.log(file.webkitRelativePath, 999)
// var reader = new FileReader();
// reader.readAsText(file);
// if (this.drlx == 3) {
// that.action = '/api/upload/person'
// reader.onload = function () {
// const reg = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/
// let barcode = this.result.match(reg)
// that.$set(newlist[i], 'barcode', barcode[1])
// }
// } else if (this.drlx == 6) {
// that.action = '/api/upload/case'
// reader.onload = function () {
console.log('fffff', folder[0])
let that = this;
let newlist = fileList;
for (let i = 0; i < fileList.length; i++) {
let file = fileList[i].raw
// console.log(file.webkitRelativePath, 999)
var reader = new FileReader();
reader.readAsText(file);
if (this.drlx == 3) {
that.action = '/api/upload/person'
reader.onload = function () {
const reg = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/
let barcode = this.result.match(reg)
that.$set(newlist[i], 'barcode', barcode[1])
}
} else if (this.drlx == 6) {
that.action = '/api/upload/case'
reader.onload = function () {
const reg = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/
let barcode = this.result.match(reg)
that.$set(newlist[i], 'barcode', barcode[1])
}
} else if (this.drlx == 9) {
reader.onload = function () {
let result = this.result;
const reg = /\<nyzw_zzhwbdffdm\>(.*?)\<\/nyzw_zzhwbdffdm\>/ // 正查,倒查
const regTT = /\<TTHitResultPackage\>(.*?)\<\/TTHitResultPackage\>/ // 查重
//正查,倒查
let regTypes = result.match(reg)
let regType = null;
if (regTypes != null) {
regType = regTypes[1]
console.log('regType', regType)
}
console.log('regType', regType)
//查重
let TT = result.match(regTT)
console.log('TT', TT)
if (regType != '' && regType != null && regType != undefined && regType == "1") { // TL 倒查
// that.action = '/api/upload/lthitresult'
that.action = '/api/upload/hitresult'
// that.$set(data, 'action', '/api/upload/lthitresult')
// console.log('地址', this.action)
const reg1 = /\<nyzw_ysxt_asjxgrybh\>(.*?)\<\/nyzw_ysxt_asjxgrybh\>/
const reg2 = /\<xczw_ysxt_asjbh\>(.*?)\<\/xczw_ysxt_asjbh\>/
let barcode1 = result.match(reg1)
let barcode2 = result.match(reg2)
console.log('倒查', barcode1, barcode2)
that.$set(newlist[i], 'type', regType)
that.$set(newlist[i], 'barcode1', barcode1[1])
that.$set(newlist[i], 'barcode2', barcode2[1])
} else if (regType != '' && regType != null && regType != undefined && regType == "2") { // LT 正查
// that.action = '/api/upload/lthitresult'
that.action = '/api/upload/hitresult'
// console.log('地址', this.action)
// that.$set(data, 'action', '/api/upload/lthitresult')
const reg1 = /\<nyzw_ysxt_asjxgrybh\>(.*?)\<\/nyzw_ysxt_asjxgrybh\>/
const reg2 = /\<xczw_ysxt_asjbh\>(.*?)\<\/xczw_ysxt_asjbh\>/
let barcode1 = result.match(reg1)
let barcode2 = result.match(reg2)
console.log('正查', barcode1, barcode2)
that.$set(newlist[i], 'type', regType)
that.$set(newlist[i], 'barcode1', barcode2[1])
that.$set(newlist[i], 'barcode2', barcode1[1])
} else if (regType == null) { // TT 查重
// that.action = '/api/upload/tthitresult'
that.action = '/api/upload/hitresult'
// that.$set(data, 'action', '/api/upload/tthitresult')
// console.log('地址', this.action)
const reg1 = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/
const reg2 = /\<bzjg_ysxt_asjxgrybh\>(.*?)\<\/bzjg_ysxt_asjxgrybh\>/
let barcode1 = result.match(reg1)
let barcode2 = result.match(reg2)
console.log('查重', barcode1, barcode2)
that.$set(newlist[i], 'type', '0')
that.$set(newlist[i], 'barcode1', barcode1[1])
that.$set(newlist[i], 'barcode2', barcode2[1])
}
// const reg = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/
// let barcode = this.result.match(reg)
// that.$set(newlist[i], 'barcode', barcode[1])
// }
// } else if (this.drlx == 9) {
// reader.onload = function () {
// let result = this.result;
// const reg = /\<nyzw_zzhwbdffdm\>(.*?)\<\/nyzw_zzhwbdffdm\>/ // 正查,倒查
// const regTT = /\<TTHitResultPackage\>(.*?)\<\/TTHitResultPackage\>/ // 查重
// //正查,倒查
// let regTypes = result.match(reg)
// let regType = null;
// if (regTypes != null) {
// regType = regTypes[1]
// console.log('regType', regType)
// }
// console.log('regType', regType)
// //查重
// let TT = result.match(regTT)
// console.log('TT', TT)
// if (regType != '' && regType != null && regType != undefined && regType == "1") { // TL 倒查
// // that.action = '/api/upload/lthitresult'
// that.action = '/api/upload/hitresult'
// // that.$set(data, 'action', '/api/upload/lthitresult')
// // console.log('地址', this.action)
// const reg1 = /\<nyzw_ysxt_asjxgrybh\>(.*?)\<\/nyzw_ysxt_asjxgrybh\>/
// const reg2 = /\<xczw_ysxt_asjbh\>(.*?)\<\/xczw_ysxt_asjbh\>/
// let barcode1 = result.match(reg1)
// let barcode2 = result.match(reg2)
// console.log('倒查', barcode1, barcode2)
// that.$set(newlist[i], 'type', regType)
// that.$set(newlist[i], 'barcode1', barcode1[1])
// that.$set(newlist[i], 'barcode2', barcode2[1])
// } else if (regType != '' && regType != null && regType != undefined && regType == "2") { // LT 正查
// // that.action = '/api/upload/lthitresult'
// that.action = '/api/upload/hitresult'
// // console.log('地址', this.action)
// // that.$set(data, 'action', '/api/upload/lthitresult')
// const reg1 = /\<nyzw_ysxt_asjxgrybh\>(.*?)\<\/nyzw_ysxt_asjxgrybh\>/
// const reg2 = /\<xczw_ysxt_asjbh\>(.*?)\<\/xczw_ysxt_asjbh\>/
// let barcode1 = result.match(reg1)
// let barcode2 = result.match(reg2)
// console.log('正查', barcode1, barcode2)
// that.$set(newlist[i], 'type', regType)
// that.$set(newlist[i], 'barcode1', barcode2[1])
// that.$set(newlist[i], 'barcode2', barcode1[1])
// } else if (regType == null) { // TT 查重
// // that.action = '/api/upload/tthitresult'
// that.action = '/api/upload/hitresult'
// // that.$set(data, 'action', '/api/upload/tthitresult')
// // console.log('地址', this.action)
// const reg1 = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/
// const reg2 = /\<bzjg_ysxt_asjxgrybh\>(.*?)\<\/bzjg_ysxt_asjxgrybh\>/
// let barcode1 = result.match(reg1)
// let barcode2 = result.match(reg2)
// console.log('查重', barcode1, barcode2)
// that.$set(newlist[i], 'type', '0')
// that.$set(newlist[i], 'barcode1', barcode1[1])
// that.$set(newlist[i], 'barcode2', barcode2[1])
// }
// // const reg = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/
// // let barcode = this.result.match(reg)
// // that.$set(newlist[i], 'barcode', barcode[1])
// }
// }
// }
// console.log('newlist', newlist)
// this.datas = newlist;
// console.log('datas', this.datas)
}
}
}
console.log('newlist', newlist)
this.datas = newlist;
console.log('datas', this.datas)
},
// 提交前钩子函数
beforeUpload () {
// //console.log('数据liebiao', this.$refs.upload.uploadFiles)
},
// 上传
// submitUpload () {
// console.log('逻辑库', this.checkedTargets)
// let logicList = []
// for (var i = 0; i < this.checkedTargets.length; i++) {
// }
// },
submitUpload () {
let that = this
if (this.nowSelectRightData.length == 0) {
this.$message.error('请选择要上传的文件')
} else {
if (this.drlx == 3 || this.drlx == 6) {
if (this.checkedTargets == 0) {
this.$message.error('请选择逻辑分库')
} else {
if (this.drlx == 3) {
for (var i = 0; i < this.checkedTargets.length; i++) {
if (this.checkedTargets[i] == '基本人员库') {
this.logicList.push('1')
} else if (this.checkedTargets[i] == '高危人员库') {
this.logicList.push('2')
} else if (this.checkedTargets[i] == '非法人员库') {
this.logicList.push('3')
} else if (this.checkedTargets[i] == '在逃人员库') {
this.logicList.push('4')
} else if (this.checkedTargets[i] == '布控人员库') {
this.logicList.push('5')
} else if (this.checkedTargets[i] == '前科人员库') {
this.logicList.push('6')
} else if (this.checkedTargets[i] == '协查人员库') {
this.logicList.push('7')
}
}
} else if (this.drlx == 6) { // ['本地案件库', '比中案件库', '已破案件库', '重大案件库', 'B类案件库', 'C类案件库', '', '协查案件库'];
for (var i = 0; i < this.checkedTargets.length; i++) {
if (this.checkedTargets[i] == '本地案件库') {
this.logicList.push('1')
} else if (this.checkedTargets[i] == '比中案件库') {
this.logicList.push('2')
} else if (this.checkedTargets[i] == '已破案件库') {
this.logicList.push('3')
} else if (this.checkedTargets[i] == '重大案件库') {
this.logicList.push('4')
} else if (this.checkedTargets[i] == 'B类案件库') {
this.logicList.push('5')
} else if (this.checkedTargets[i] == 'C类案件库') {
this.logicList.push('6')
} else if (this.checkedTargets[i] == '勘查案件库') {
this.logicList.push('7')
} else if (this.checkedTargets[i] == '协查案件库') {
this.logicList.push('8')
}
}
}
this.upload()
}
} else if (this.drlx == 9) {
if (this.targetsLeft.length == 0 || this.targetsRight.length == 0) {
this.$message.error('请选择逻辑分库')
} else {
this.upload()
}
}
}
},
// 上传文件函数
upload () {
let that = this
// 创建一个空的FormData对象:
const formData = new FormData()
// 可以使用FormData.append来添加键/值对到表单里面;
......@@ -710,7 +788,7 @@ export default {
formData.append('file', file.raw)
})
// 添加自定义参数,不传可删除
// formData.append('parentId', '49')
formData.append('logicList', this.logicList)
//console.log('formData', formData)
// //console.log('this.selectArr', this.selectArr)
......@@ -745,6 +823,7 @@ export default {
this.datas = []// 左边表格数据项
this.nowSelectData = [] // 左边选中列表数据
this.nowSelectRightData = [] // 右边选中列表数据
this.logicList = [] // 目标逻辑库
} else if (this.drlx == 9) {
......@@ -765,10 +844,10 @@ export default {
this.$message.error(res.data.message);
}
});
}
},
// 删除文件
handleRemove (file, fileList) {
//console.log(file, fileList);
......
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