Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-science-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐俊
yn-science-front
Commits
6aa88787
Commit
6aa88787
authored
Dec 11, 2024
by
徐俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xujun
parent
7c675610
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
2 deletions
+121
-2
index.js
src/api/index.js
+6
-0
knowledgeSelect.vue
src/views/components/common/knowledgeSelect.vue
+108
-0
Index.vue
src/views/report/project/Index.vue
+7
-2
No files found.
src/api/index.js
View file @
6aa88787
...
@@ -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
:
{
...
...
src/views/components/common/knowledgeSelect.vue
0 → 100644
View file @
6aa88787
<
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
src/views/report/project/Index.vue
View file @
6aa88787
...
@@ -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
()
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment