Commit fc57327f authored by wangxl's avatar wangxl
parents ab29540d 6248e99a
......@@ -301,7 +301,10 @@ export default {
},
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: {
getListByPage (params) {
......@@ -817,9 +820,15 @@ export default {
getParameterListBySystemCode(params) {
return fetch(`/v1/science-admin/system-parameter/getParameterListBySystemCode`, params)
},
getKnowledgeParameterTreeList() {
return fetch(`/v1/science-admin/system-parameter/getKnowledgeParameterTreeList`)
}
getKnowledgeInfoList1() {
return fetch(`/v1/science-admin/system-parameter/getKnowledgeInfoList1`)
},
getKnowledgeInfoList2() {
return fetch(`/v1/science-admin/system-parameter/getKnowledgeInfoList2`)
},
getSpecArray() {
return fetch(`/v1/science-admin/system-parameter/getSpecArray`)
},
},
parameterType: {
getListByPage (params) {
......
......@@ -45,6 +45,7 @@ export default {
expertSelectedRowKeys: [],
dataList: [],
personName: null,
specArray: [],
}
},
props: {
......@@ -63,66 +64,66 @@ export default {
},
created () {
this.loadTreeSelect()
let parentArray = []
let specArray = ["00000000-0000-0000-0000-000000000000"]
this.seachExpert(specArray, parentArray)
this.loadSpecList()
this.seachExpert("00000000-0000-0000-0000-000000000000", null, null)
},
methods: {
loadTreeSelect () {
this.$api.parameter.getTreeListByType({ typeId: 56 }).then(({ data = {} }) => {
this.$api.parameter.getKnowledgeInfoList1().then(({ data = {} }) => {
if (data) {
this.treeData = data
this.defaultExpandedKeys = [this.treeData[0].key]
}
}).catch(() => { this.loading = true });
},
loadExpertList () {
this.$api.parameter.getTreeListByType({ typeId: 56 }).then(({ data = {} }) => {
loadSpecList () {
this.$api.parameter.getSpecArray().then(({ data = {} }) => {
if (data) {
this.treeData = data
this.defaultExpandedKeys = [this.treeData[0].key]
this.loading = false
this.specArray = data
this.buildSpecKeyMap()
}
}).catch(() => { this.loading = true });
})
},
onClick (value, info) {
const content = info.selectedNodes[0].componentOptions.children
let parentArray = null
let specArray = null
if (content && content.length > 0)
parentArray = value
buildSpecKeyMap() {
this.specKeyMap = {}
this.specArray.forEach(item => {
this.specKeyMap[item.key] = 3
this.specKeyMap[item.pkey] = 2
this.specKeyMap[item.ppkey] = 1
})
},
FromSpecArrayFindKey(key) {
return this.specKeyMap[key] || 0
},
processExpertSearch(value) {
const level = this.FromSpecArrayFindKey(value)
if (level == 1)
this.seachExpert(null, null, value)
else if (level == 2)
this.seachExpert(null, value, null)
else
specArray = value
this.seachExpert(specArray, parentArray)
this.seachExpert(value, null, null)
},
onClick (value, info) {
this.processExpertSearch(value)
},
onCheck (value, info) {
const content = info.selectedNodes[0].componentOptions.children
let parentArray = null
let specArray = null
if (content && content.length > 0)
parentArray = value
else
specArray = value
this.seachExpert(specArray, parentArray)
this.processExpertSearch(value)
},
onExpand (value) {
this.defaultExpandedKeys = value
},
changePersonName () {
let parentArray = []
let specArray = []
this.seachExpert(specArray, parentArray)
this.seachExpert(null, null, null)
},
seachExpert (specArray, parentArray) {
seachExpert (specId, pkey, ppkey) {
this.loading = true
let specIds = specArray === null ? null : specArray.join(",")
let parentIds = parentArray === null ? null : parentArray.join(",")
if (this.personName !== null && this.personName !== '') {
specIds = null
parentIds = null
specId = 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) {
this.dataList = data
this.expertFilter(this.expertSelectKeys, this.dataList)
......
......@@ -2,13 +2,14 @@
<a-cascader v-model="selected" :style="{width:'80%'}" :options="options" :show-search="{ filter }" :display-render="displayRender" expand-trigger="hover" placeholder="请选择学科代码" @change="onChange" />
</template>
<script>
import { specList, getSpecArray } from "@/views/components/common/config"
//import { specList, getSpecArray } from "@/views/components/common/config"
export default {
name: "cascaderSelect",
data () {
return {
options: specList,
options: [],
selected: null,
specArray: [],
};
},
props: {
......@@ -20,13 +21,41 @@ export default {
},
},
created () {
if (!!this.value) {
this.selected = getSpecArray(this.value)
this.loadSpecList()
//this.selected = getSpecArray(this.value)
// this.$emit("change");
// this.$emit("input", this.selected)
}
},
methods: {
loadSpecList () {
this.$api.parameter.getKnowledgeInfoList2().then(({ data = {} }) => {
if (data) {
this.options = data
this.loadSpecArray()
this.loading = true
}
})
},
loadSpecArray () {
this.$api.parameter.getSpecArray().then(({ data = {} }) => {
if (data) {
this.specArray = data
if (!!this.value)
this.selected = this.getSpecInfo(this.value)
}
})
},
getSpecInfo(key) {
let newArray = this.specArray.filter(
function (el) {
return el.key == key
}
);
if (!!newArray && newArray.length > 0)
return [newArray[0].ppkey, newArray[0].pkey, newArray[0].key]
else
return null
},
onChange (value, selectedOptions) {
this.selected = value
if (!!this.selected && this.selected.length == 3) {
......
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