Commit 08ffe7d2 authored by 徐俊's avatar 徐俊

xujun

parent 8e66191e
...@@ -301,7 +301,10 @@ export default { ...@@ -301,7 +301,10 @@ export default {
}, },
getExpertListByExpertSpecIds (params) { getExpertListByExpertSpecIds (params) {
return fetch(`/v1/science-admin/com-expert-spec/getExpertListByExpertSpecIds`, params) return fetch(`/v1/science-admin/com-expert-spec/getExpertListByExpertSpecIds`, params)
} },
getExpertListByExpertSpecIdOrParentId (params) {
return fetch(`/v1/science-admin/com-expert-spec/getExpertListByExpertSpecIdOrParentId`, params)
},
}, },
expertBatch: { expertBatch: {
getListByPage (params) { getListByPage (params) {
...@@ -819,7 +822,10 @@ export default { ...@@ -819,7 +822,10 @@ export default {
}, },
getKnowledgeParameterTreeList() { getKnowledgeParameterTreeList() {
return fetch(`/v1/science-admin/system-parameter/getKnowledgeParameterTreeList`) return fetch(`/v1/science-admin/system-parameter/getKnowledgeParameterTreeList`)
} },
getSpecArray() {
return fetch(`/v1/science-admin/system-parameter/getSpecArray`)
},
}, },
parameterType: { parameterType: {
getListByPage (params) { getListByPage (params) {
......
...@@ -45,6 +45,7 @@ export default { ...@@ -45,6 +45,7 @@ export default {
expertSelectedRowKeys: [], expertSelectedRowKeys: [],
dataList: [], dataList: [],
personName: null, personName: null,
specArray: [],
} }
}, },
props: { props: {
...@@ -63,66 +64,69 @@ export default { ...@@ -63,66 +64,69 @@ export default {
}, },
created () { created () {
this.loadTreeSelect() this.loadTreeSelect()
this.loadSpecList()
let parentArray = [] let parentArray = []
let specArray = ["00000000-0000-0000-0000-000000000000"] let specArray = ["00000000-0000-0000-0000-000000000000"]
this.seachExpert(specArray, parentArray) this.seachExpert(specArray, parentArray)
}, },
methods: { methods: {
loadTreeSelect () { loadTreeSelect () {
this.$api.parameter.getTreeListByType({ typeId: 56 }).then(({ data = {} }) => { this.$api.parameter.getKnowledgeParameterTreeList().then(({ data = {} }) => {
if (data) { if (data) {
this.treeData = data this.treeData = data
this.defaultExpandedKeys = [this.treeData[0].key] this.defaultExpandedKeys = [this.treeData[0].key]
} }
}).catch(() => { this.loading = true }); }).catch(() => { this.loading = true });
}, },
loadExpertList () { loadSpecList () {
this.$api.parameter.getTreeListByType({ typeId: 56 }).then(({ data = {} }) => { this.$api.parameter.getSpecArray().then(({ data = {} }) => {
if (data) { if (data) {
this.treeData = data this.specArray = data
this.defaultExpandedKeys = [this.treeData[0].key] this.buildSpecKeyMap()
this.loading = false
} }
}).catch(() => { this.loading = true }); })
}, },
onClick (value, info) { buildSpecKeyMap() {
const content = info.selectedNodes[0].componentOptions.children this.specKeyMap = {}
let parentArray = null this.specArray.forEach(item => {
let specArray = null this.specKeyMap[item.key] = 3
if (content && content.length > 0) this.specKeyMap[item.pkey] = 2
parentArray = value this.specKeyMap[item.ppkey] = 1
})
},
FromSpecArrayFindKey(key) {
return this.specKeyMap[key] || 0
},
processExpertSearch(value) {
const level = this.FromSpecArrayFindKey(value)
console.log(level)
if (level == 1)
this.seachExpert(null, null, value)
else if (level == 2)
this.seachExpert(null, value, null)
else else
specArray = value this.seachExpert(value, null, null)
},
this.seachExpert(specArray, parentArray) onClick (value, info) {
this.processExpertSearch(value)
}, },
onCheck (value, info) { onCheck (value, info) {
const content = info.selectedNodes[0].componentOptions.children this.processExpertSearch(value)
let parentArray = null
let specArray = null
if (content && content.length > 0)
parentArray = value
else
specArray = value
this.seachExpert(specArray, parentArray)
}, },
onExpand (value) { onExpand (value) {
this.defaultExpandedKeys = value this.defaultExpandedKeys = value
}, },
changePersonName () { changePersonName () {
let parentArray = [] this.seachExpert(null, null, null)
let specArray = []
this.seachExpert(specArray, parentArray)
}, },
seachExpert (specArray, parentArray) { seachExpert (specId, pkey, ppkey) {
this.loading = true this.loading = true
let specIds = specArray === null ? null : specArray.join(",")
let parentIds = parentArray === null ? null : parentArray.join(",")
if (this.personName !== null && this.personName !== '') { if (this.personName !== null && this.personName !== '') {
specIds = null specId = null
parentIds = null pkey = null
ppkey = null
} }
this.$api.expertSpec.getExpertListByExpertSpecIds({ specIds: specIds, parentIds: parentIds, personName: this.personName }).then(({ data = {} }) => { this.$api.expertSpec.getExpertListByExpertSpecIdOrParentId({ specId: specId, pkey: pkey, ppkey: ppkey, personName: this.personName }).then(({ data = {} }) => {
if (data) { if (data) {
this.dataList = data this.dataList = data
this.expertFilter(this.expertSelectKeys, this.dataList) this.expertFilter(this.expertSelectKeys, this.dataList)
......
This diff is collapsed.
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