Compare commits

...

2 Commits

Author SHA1 Message Date
jacky 7e7140dd01 修改dashboard院士管理的入口错误 2024-08-11 16:19:12 +08:00
jacky 6af861ac09 增加国外院士管理 2024-07-18 11:49:01 +08:00
2 changed files with 20 additions and 8 deletions

View File

@ -125,6 +125,16 @@ watch(
} }
) )
const formatKind = (kind) => {
if (kind == 1) {
return "院士"
} else if (kind == 2) {
return "研究员"
} else if (kind == 3) {
return "国外院士"
}
}
// //
const handleResetSearch = () => { const handleResetSearch = () => {
initSearchInfo() initSearchInfo()
@ -187,7 +197,7 @@ const handleMultiDelete = () => {
} }
// //
const handleRowDelete = (ID) => { const handleRowDelete = (ID) => {
ElMessageBox.confirm('此操作将删除' + (route.params.kind == '1' ? '院士' : '研究员') + ', 是否继续?', '请确认', { ElMessageBox.confirm('此操作将删除' + formatKind(route.params.kind) + ', 是否继续?', '请确认', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
@ -210,12 +220,12 @@ const elEditRef = ref(null)
const editTitle = ref('') const editTitle = ref('')
// //
const handleAdd = () => { const handleAdd = () => {
editTitle.value = '添加' + (route.params.kind == '1' ? '院士' : '研究员') editTitle.value = '添加' + formatKind(route.params.kind)
elEditRef.value.openPage({ id: 0, kind: parseInt(route.params.kind) }) elEditRef.value.openPage({ id: 0, kind: parseInt(route.params.kind) })
} }
// //
const handleRowEdit = async (ID) => { const handleRowEdit = async (ID) => {
editTitle.value = '修改' + (route.params.kind == '1' ? '院士' : '研究员') + '-ID:' + ID editTitle.value = '修改' + formatKind(route.params.kind) + '-ID:' + ID
elEditRef.value.openPage({ ID: ID, kind: parseInt(route.params.kind) }) elEditRef.value.openPage({ ID: ID, kind: parseInt(route.params.kind) })
} }
// //
@ -225,7 +235,7 @@ const handlerFormSave = () => {
const selectArticleTitle = ref('') const selectArticleTitle = ref('')
const handleSelProject = (row) => { const handleSelProject = (row) => {
selectArticleTitle.value = '关联' + (route.params.kind == '1' ? '院士' : '研究员') + '项目' + '-ID:' + row.ID selectArticleTitle.value = '关联' + formatKind(route.params.kind) + '项目' + '-ID:' + row.ID
let articleIds = [] let articleIds = []
if (row.projects != '') { if (row.projects != '') {
articleIds = JSON.parse(row.projects) articleIds = JSON.parse(row.projects)
@ -234,7 +244,7 @@ const handleSelProject = (row) => {
elSelectArticleRef.value.openPage(params, articleIds) elSelectArticleRef.value.openPage(params, articleIds)
} }
const handleSelLecture = (row) => { const handleSelLecture = (row) => {
selectArticleTitle.value = '关联' + (route.params.kind == '1' ? '院士' : '研究员') + '讲座' + '-ID:' + row.ID selectArticleTitle.value = '关联' + formatKind(route.params.kind) + '讲座' + '-ID:' + row.ID
let articleIds = [] let articleIds = []
if (row.lectures != '') { if (row.lectures != '') {
articleIds = JSON.parse(row.lectures) articleIds = JSON.parse(row.lectures)

View File

@ -13,7 +13,7 @@
<div class="gva-card-title">快捷入口</div> <div class="gva-card-title">快捷入口</div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col v-for="(card, key) in toolCards" :key="key" :span="4" :xs="8" class="quick-entrance-items" <el-col v-for="(card, key) in toolCards" :key="key" :span="4" :xs="8" class="quick-entrance-items"
@click="toTarget(card.name)"> @click="toTarget(card.name, card.params)">
<div class="quick-entrance-item"> <div class="quick-entrance-item">
<div class="quick-entrance-item-icon" :style="{ backgroundColor: card.bg }"> <div class="quick-entrance-item-icon" :style="{ backgroundColor: card.bg }">
<el-icon> <el-icon>
@ -59,6 +59,7 @@ const toolCards = ref([
label: '院士管理', label: '院士管理',
icon: 'star', icon: 'star',
name: 'academician', name: 'academician',
params: { kind: 1 },
color: '#ffd666', color: '#ffd666',
bg: 'rgba(255, 214, 102,.3)' bg: 'rgba(255, 214, 102,.3)'
}, },
@ -87,8 +88,9 @@ const toolCards = ref([
const router = useRouter() const router = useRouter()
const toTarget = (name) => { const toTarget = (name, params) => {
router.push({ name }) if (name)
router.push({ name, params })
} }
</script> </script>