|
@@ -25,6 +25,7 @@
|
|
|
<competition v-if="type == 'Competition'"></competition>
|
|
|
<investment v-if="type == 'Investment'"></investment>
|
|
|
<association v-if="type == 'Association'"></association>
|
|
|
+ <school v-if="type == 'School'"></school>
|
|
|
<state v-if="type == 'State'"></state>
|
|
|
<unit v-if="type == 'Unit'"></unit>
|
|
|
</el-col>
|
|
@@ -45,6 +46,7 @@ import { cloneDeep, get } from 'lodash-es'
|
|
|
// 组件
|
|
|
import user from './parts/user.vue'
|
|
|
import association from './parts/association.vue'
|
|
|
+import school from './parts/school.vue'
|
|
|
import company from './parts/company.vue'
|
|
|
import competition from './parts/competition.vue'
|
|
|
import expert from './parts/expert.vue'
|
|
@@ -68,6 +70,8 @@ import { ExpertStore } from '@/store/api/user/expert'
|
|
|
const expertStore = ExpertStore()
|
|
|
import { AssociationStore } from '@/store/api/user/association'
|
|
|
const associationStore = AssociationStore()
|
|
|
+import { SchoolStore } from '@/store/api/user/school'
|
|
|
+const schoolStore = SchoolStore()
|
|
|
import { CompanyStore } from '@/store/api/user/company'
|
|
|
const companyStore = CompanyStore()
|
|
|
import { CompetitionStore } from '@/store/api/user/competition'
|
|
@@ -98,11 +102,11 @@ onMounted(async () => {
|
|
|
const fields = [
|
|
|
{ label: t('pages.user.openid'), model: 'openid' },
|
|
|
{ label: t('pages.user.account'), model: 'account', filter: true },
|
|
|
- { label: t('pages.user.industry'), model: 'industry', filter: true, type: 'select' },
|
|
|
+ { label: t('pages.user.industry'), model: 'industry', filter: true, type: 'select', format: (i) => getDict(i, 'industry') },
|
|
|
{ label: t('pages.user.nick_name'), model: 'nick_name', filter: true },
|
|
|
{ label: t('pages.user.phone'), model: 'phone', filter: true },
|
|
|
{ label: t('pages.user.role'), model: 'role', custom: true },
|
|
|
- { label: t('pages.user.status'), model: 'status', format: (i) => getDict(i) }
|
|
|
+ { label: t('pages.user.status'), model: 'status', format: (i) => getDict(i, 'status') }
|
|
|
]
|
|
|
const opera = [
|
|
|
{ label: t('common.view'), method: 'view' },
|
|
@@ -206,9 +210,16 @@ const getRole = (data) => {
|
|
|
const res = roleList.value.find((f) => f.code === data)
|
|
|
return get(res, 'name')
|
|
|
}
|
|
|
-const getDict = (data) => {
|
|
|
- const res = statusList.value.find((f) => f.value == data)
|
|
|
- return get(res, 'label')
|
|
|
+const getDict = (data, model) => {
|
|
|
+ if (data) {
|
|
|
+ let res
|
|
|
+ if (model == 'status') res = statusList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'industry') {
|
|
|
+ if (Array.isArray(data)) res = { label: data.join(',') }
|
|
|
+ else res = { label: data }
|
|
|
+ }
|
|
|
+ return get(res, 'label')
|
|
|
+ }
|
|
|
}
|
|
|
// 查看
|
|
|
const toView = async (data) => {
|
|
@@ -232,6 +243,8 @@ const toChang = async (name) => {
|
|
|
result = await unitStore.query({ user: user_id.value })
|
|
|
} else if (name == 'Association') {
|
|
|
result = await associationStore.query({ user: user_id.value })
|
|
|
+ } else if (name == 'School') {
|
|
|
+ result = await schoolStore.query({ user: user_id.value })
|
|
|
} else if (name == 'Competition') {
|
|
|
result = await competitionStore.query({ user: user_id.value })
|
|
|
} else if (name == 'Incubator') {
|
|
@@ -252,6 +265,7 @@ const onSubmit = async () => {
|
|
|
else if (type.value == 'Company') res = await companyStore.update(data)
|
|
|
else if (type.value == 'Unit') res = await unitStore.update(data)
|
|
|
else if (type.value == 'Association') res = await associationStore.update(data)
|
|
|
+ else if (type.value == 'School') res = await schoolStore.update(data)
|
|
|
else if (type.value == 'Competition') res = await competitionStore.update(data)
|
|
|
else if (type.value == 'Incubator') res = await incubatorStore.update(data)
|
|
|
else if (type.value == 'Investment') res = await investmentStore.update(data)
|
|
@@ -311,6 +325,7 @@ provide('getRole', getRole)
|
|
|
.tags {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
grid-gap: 0.5rem;
|
|
|
gap: 0.5rem;
|
|
|
}
|