Commit 6aa88787 authored by 徐俊's avatar 徐俊

xujun

parent 7c675610
...@@ -807,6 +807,12 @@ export default { ...@@ -807,6 +807,12 @@ export default {
}, },
refreshSystemParameter () { refreshSystemParameter () {
return fetch('/v1/science-admin/system-parameter/refreshSystemParameter') return fetch('/v1/science-admin/system-parameter/refreshSystemParameter')
},
getParameterListBySystemCode(params) {
return fetch(`/v1/science-admin/system-parameter/getParameterListBySystemCode`, params)
},
getKnowledgeParameterTreeList() {
return fetch(`/v1/science-admin/system-parameter/getKnowledgeParameterTreeList`)
} }
}, },
parameterType: { parameterType: {
......
<template>
<div>
<a-select v-model="selected" showSearch placeholder="学科代码或学科名称" :default-active-first-option="false"
:show-arrow="false"
:filter-option="false" @search="onSearch" @change="handleChange" :style="{width: width + 'px'}">
<a-select-option v-for="item in selectArray" :key="item.key" :value="item.key">
{{ item.title }}
</a-select-option>
</a-select>
</div>
</template>
<!-- :filterOption="filterOption" -->
<script>
export default {
name: "knowledgeSelect",
props: {
value: {
type: undefined,
default () {
return null
}
},
width: {
type: Number,
default() {
return 180;
},
},
},
data() {
return {
selectArray: [],
selected: '',
defaultValue: {
title: "--请选择" + this.title + "--",
key: "",
description: "",
selected: true,
disabled: true,
}
};
},
created() {
this.se
this.loadValue()
},
methods: {
onSearch(value) {
if (value == '')
return
let pars = { SystemCodeOrName: value }
this.$api.parameter.getParameterListBySystemCode(pars).then(({ data = {} }) => {
this.selectArray = []
// 模拟从数据库查询数据
if (data && data.length > 0) {
this.selectArray = data
}
// else {
// this.selectArray.push({ title: value, key: "00000000-0000-0000-0000-000000000000" })
// }
})
},
// filterOption(input, option) {
// // 自定义过滤逻辑,如果没有匹配的选项就保留输入值
// return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
// },
handleChange(value) {
console.log(value)
this.$emit("input", value);
var newArr = this.selectArray.filter(x => x.key == value);
if (value && !!newArr && newArr.length > 0) {
var text = !!value ? newArr[0].title : ''
this.$emit('changeTitle', text)
}
this.$emit("change");
},
loadValue () {
if (this.isAll) {
this.selectArray.unshift(this.defaultValue)
}
if (!!!this.selected) {
if (!!this.value) {
this.selected = this.value + ''
} else {
if (this.selectArray.length > 0)
this.selected = this.selectArray[0].key
else
this.selected = ''
}
}
this.$emit("input", this.selected)
}
},
watch: {
value: {
handler (value) {
if (!!!value)
this.selected = ''
else
this.selected = value + ''
this.$emit("input", this.selected)
console.log(this.selected)
},
},
}
};
</script>
\ No newline at end of file
...@@ -86,6 +86,9 @@ ...@@ -86,6 +86,9 @@
<a-form-item> <a-form-item>
<a-input placeholder="项目编号" v-model="searchForm.projNo" :maxLength="100" style="width: 180px" /> <a-input placeholder="项目编号" v-model="searchForm.projNo" :maxLength="100" style="width: 180px" />
</a-form-item> </a-form-item>
<a-form-item>
<knowledge-select v-model="searchForm.knowledgeId"></knowledge-select>
</a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" icon="search" @click="search">搜索</a-button> <a-button type="primary" icon="search" @click="search">搜索</a-button>
<a-button icon="reload" style="margin-left: 10px" @click="reset" class="bt-normal">重置</a-button> <a-button icon="reload" style="margin-left: 10px" @click="reset" class="bt-normal">重置</a-button>
...@@ -151,12 +154,13 @@ import projectEdit from '@/views/report/project/components/projectEdit' ...@@ -151,12 +154,13 @@ import projectEdit from '@/views/report/project/components/projectEdit'
import projectEditKey from "@/views/report/project/components/keyProject/projectEdit" import projectEditKey from "@/views/report/project/components/keyProject/projectEdit"
import projectView from '@/views/report/project/components/projectView' import projectView from '@/views/report/project/components/projectView'
import previewFile from '@/views/components/common/previewFile' import previewFile from '@/views/components/common/previewFile'
import knowledgeSelect from '@/views/components/common/knowledgeSelect'
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'reportProject', name: 'reportProject',
components: { components: {
projectView, projectCreate, projectEdit,previewFile, projectEditKey projectView, projectCreate, projectEdit,previewFile, projectEditKey, knowledgeSelect
}, },
data () { data () {
return { return {
...@@ -185,7 +189,7 @@ export default { ...@@ -185,7 +189,7 @@ export default {
], ],
itemCount: [0, 0, 0, 0, 0], itemCount: [0, 0, 0, 0, 0],
// 表单 // 表单
searchForm: { projName: null, projNo: null, projState: 1, reportYear: null, projType: getType() }, searchForm: { projName: null, projNo: null, projState: 1, reportYear: null, projType: getType(), knowledgeId: null },
tableData: [], tableData: [],
columns: [ columns: [
{ title: "项目名称", scopedSlots: { customRender: 'projName' } }, { title: "项目名称", scopedSlots: { customRender: 'projName' } },
...@@ -286,6 +290,7 @@ export default { ...@@ -286,6 +290,7 @@ export default {
}).catch(() => { }) }).catch(() => { })
}, },
search () { search () {
console.log(this.searchForm)
this.pagination.pageIndex = 1 this.pagination.pageIndex = 1
this.getListByPage() this.getListByPage()
}, },
......
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