合并分支 'fix_bug_first_stage' 到 'master'
Fix bug first stage 查看合并请求 laws-nio/laws-weilai!57
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass','isDelete'],
|
||||
props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass', 'isDelete'],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
@@ -74,6 +74,7 @@
|
||||
searchModel: '',
|
||||
defaultExpandedKeys: [],
|
||||
defaultCheckedKeys: [],
|
||||
defaultCheckedKeysName: [],
|
||||
content: []
|
||||
}
|
||||
},
|
||||
@@ -90,10 +91,10 @@
|
||||
this.queryDepartUserTreeList()
|
||||
this.visible = true
|
||||
},
|
||||
standardDelete(){
|
||||
standardDelete() {
|
||||
this.$emit('input', null)
|
||||
this.$forceUpdate()
|
||||
this.$emit('deleteData',this.query.db_field_name)
|
||||
this.$emit('deleteData', this.query.db_field_name)
|
||||
},
|
||||
// onSelect(selectedKeys, info) {
|
||||
// console.log(selectedKeys)
|
||||
@@ -101,9 +102,17 @@
|
||||
// },
|
||||
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log(checkedKeys)
|
||||
this.userIds = checkedKeys.checked
|
||||
this.userName = []
|
||||
if (this.userIds.length > 0) {
|
||||
for (let i = 0; i < this.userIds.length; i++) {
|
||||
for (let j = 0; j < this.defaultCheckedKeysName.length; j++) {
|
||||
if (this.userIds[i] == this.defaultCheckedKeysName[j].id) {
|
||||
this.userName.push(this.defaultCheckedKeysName[j].name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (info.checkedNodes && info.checkedNodes.length > 0) {
|
||||
info.checkedNodes.forEach(res => {
|
||||
if (res.data.props.dataRef.key) {
|
||||
@@ -136,6 +145,16 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
if (this.userName.length > 0){
|
||||
for (let i = 0; i < this.userName.length; i++) {
|
||||
for (let j = i + 1; j < this.userName.length; j++) {
|
||||
if (this.userName[i] == this.userName[j]) {
|
||||
this.userName.splice(j, 1)
|
||||
j--
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
@@ -151,8 +170,9 @@
|
||||
}
|
||||
let userIds = JSON.parse(JSON.stringify(this.userIds))
|
||||
let userName = JSON.parse(JSON.stringify(this.userName))
|
||||
console.log(userName)
|
||||
this.$emit('input', userName.join(','))
|
||||
this.$emit('change', this.query.db_field_name, userIds.join(','),this.query.subscript)
|
||||
this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript)
|
||||
this.visible = false
|
||||
this.treeVisible = false
|
||||
// } else {
|
||||
@@ -179,8 +199,8 @@
|
||||
},
|
||||
getUserAndDepart() {
|
||||
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
|
||||
if (res){
|
||||
this.gData = res.filter(ele => ele.flag === 'DEPART');
|
||||
if (res) {
|
||||
this.gData = res.filter(ele => ele.flag === 'DEPART')
|
||||
} else {
|
||||
this.gData = []
|
||||
}
|
||||
@@ -234,6 +254,15 @@
|
||||
}
|
||||
}
|
||||
this.defaultCheckedKeys = this.userIds
|
||||
this.defaultCheckedKeysName = []
|
||||
if (this.defaultCheckedKeys.length > 0) {
|
||||
for (let i = 0; i < this.defaultCheckedKeys.length; i++) {
|
||||
this.defaultCheckedKeysName.push({
|
||||
id: this.defaultCheckedKeys[i],
|
||||
name: this.userName[i]
|
||||
})
|
||||
}
|
||||
}
|
||||
this.treeVisible = true
|
||||
} else {
|
||||
this.gData = []
|
||||
|
||||
@@ -191,17 +191,18 @@
|
||||
let index1 = fileName.lastIndexOf('.')
|
||||
let index2 = fileName.length
|
||||
let fileSuffix = fileName.substring(index1, index2)
|
||||
if (fileSuffix === '.pdf') {
|
||||
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
|
||||
} else if (fileSuffix === '.docx') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else {
|
||||
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
|
||||
}
|
||||
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
|
||||
// if (fileSuffix === '.pdf') {
|
||||
// window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
|
||||
// } else if (fileSuffix === '.docx') {
|
||||
// let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
// window.open(url, '_blank')
|
||||
// } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') {
|
||||
// let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
// window.open(url, '_blank')
|
||||
// } else {
|
||||
// downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user