|
@@ -16,6 +16,9 @@
|
|
|
<template #cooperate>
|
|
|
<el-option v-for="i in cooperateList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
+ <template #industry>
|
|
|
+ <el-option v-for="i in sectorList" :key="i.id" :label="i.title" :value="i.title"></el-option>
|
|
|
+ </template>
|
|
|
</custom-search-bar>
|
|
|
<custom-button-bar :fields="buttonFields" @add="toAdd"></custom-button-bar>
|
|
|
<custom-table :data="data" :fields="fields" @query="search" :total="total" :opera="opera" @exam="toExam" @edit="toEdit" @delete="toDelete">
|
|
@@ -33,6 +36,9 @@
|
|
|
<el-option v-for="item in tagsList" :key="item.id" :label="item.title" :value="item.title" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
+ <template #industry>
|
|
|
+ <el-option v-for="i in sectorList" :key="i.id" :label="i.title" :value="i.title"></el-option>
|
|
|
+ </template>
|
|
|
<template #is_use>
|
|
|
<el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
</template>
|
|
@@ -78,20 +84,19 @@ const { t } = useI18n()
|
|
|
import { ProjectStore } from '@/store/api/platform/project'
|
|
|
import { DictDataStore } from '@/store/api/system/dictData'
|
|
|
import { TagsStore } from '@/store/api/system/tags'
|
|
|
+import { SectorStore } from '@/store/api/system/sector'
|
|
|
const store = ProjectStore()
|
|
|
const dictDataStore = DictDataStore()
|
|
|
const tagsStore = TagsStore()
|
|
|
+const sectorStore = SectorStore()
|
|
|
const data = ref([])
|
|
|
const searchForm = ref({})
|
|
|
const fields = [
|
|
|
{ label: t('pages.project.name'), model: 'name', isSearch: true },
|
|
|
+ { label: t('pages.project.industry'), model: 'industry', isSearch: true, type: 'select' },
|
|
|
{ label: t('pages.project.tags'), model: 'tags', isSearch: true, format: (i) => getDict(i, 'tags') },
|
|
|
- { label: t('pages.project.type'), model: 'type', isSearch: true, type: 'select', format: (i) => getDict(i, 'type') },
|
|
|
- { label: t('pages.project.field'), model: 'field', isSearch: true, type: 'select', format: (i) => getDict(i, 'field') },
|
|
|
- { label: t('pages.project.maturity'), model: 'maturity', isSearch: true, type: 'select', format: (i) => getDict(i, 'maturity') },
|
|
|
- { label: t('pages.project.skill'), model: 'skill', isSearch: true, type: 'select', format: (i) => getDict(i, 'skill') },
|
|
|
- { label: t('pages.project.cooperate'), model: 'cooperate', isSearch: true, type: 'select', format: (i) => getDict(i, 'cooperate') },
|
|
|
- { label: t('pages.project.time'), model: 'time' },
|
|
|
+ { label: t('pages.project.main'), model: 'main', isSearch: true },
|
|
|
+ { label: t('pages.project.progress'), model: 'progress', isSearch: true },
|
|
|
{ label: t('pages.project.is_use'), model: 'is_use', custom: true, format: (i) => getDict(i, 'is_use') },
|
|
|
{ label: t('pages.project.status'), model: 'status', format: (i) => getDict(i, 'status') }
|
|
|
]
|
|
@@ -114,10 +119,12 @@ const skillList = ref([])
|
|
|
const cityList = ref([])
|
|
|
const cooperateList = ref([])
|
|
|
const tagsList = ref([])
|
|
|
+const sectorList = ref([])
|
|
|
// 加载中
|
|
|
const loading = ref(false)
|
|
|
const formFields = ref([
|
|
|
{ label: t('pages.project.name'), model: 'name' },
|
|
|
+ { label: t('pages.project.industry'), model: 'industry', type: 'select' },
|
|
|
{ label: t('pages.project.tags'), model: 'tags', custom: true },
|
|
|
{ label: t('pages.project.type'), model: 'type', type: 'select' },
|
|
|
{ label: t('pages.project.maturity'), model: 'maturity', type: 'select' },
|
|
@@ -130,7 +137,6 @@ const formFields = ref([
|
|
|
{ label: t('pages.project.progress'), model: 'progress' },
|
|
|
{ label: t('pages.project.track_unit'), model: 'track_unit' },
|
|
|
{ label: t('pages.project.source'), model: 'source' },
|
|
|
- { label: t('pages.project.industry'), model: 'industry' },
|
|
|
{ label: t('pages.project.is_use'), model: 'is_use', type: 'radio' },
|
|
|
{ label: t('pages.project.brief'), model: 'brief', type: 'textarea' }
|
|
|
])
|
|
@@ -178,8 +184,13 @@ const searchOther = async () => {
|
|
|
// 标签
|
|
|
result = await tagsStore.query({ is_use: '0' })
|
|
|
if ($checkRes(result)) tagsList.value = result.data
|
|
|
+ // 行业
|
|
|
+ result = await sectorStore.query({ is_use: '0' })
|
|
|
+ if ($checkRes(result)) sectorList.value = result.data
|
|
|
}
|
|
|
-const search = async (query = { skip: 0, limit }) => {
|
|
|
+const search = async (query = { skip, limit }) => {
|
|
|
+ skip = query.skip
|
|
|
+ limit = query.limit
|
|
|
const info = { skip: query.skip, limit: query.limit, ...searchForm.value }
|
|
|
const res = await store.query(info)
|
|
|
if (res.errcode == '0') {
|
|
@@ -215,7 +226,7 @@ const toEdit = (data) => {
|
|
|
const toDelete = async (data) => {
|
|
|
const res = await store.del(data.id)
|
|
|
if ($checkRes(res, true)) {
|
|
|
- search({ skip: 0, limit })
|
|
|
+ search({ skip, limit })
|
|
|
}
|
|
|
}
|
|
|
const toSave = async () => {
|
|
@@ -225,7 +236,7 @@ const toSave = async () => {
|
|
|
if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
|
else res = await store.create({ ...data, ...other })
|
|
|
if ($checkRes(res, true)) {
|
|
|
- search({ skip: 0, limit })
|
|
|
+ search({ skip, limit })
|
|
|
toClose()
|
|
|
}
|
|
|
}
|
|
@@ -239,7 +250,7 @@ const toExamSave = async () => {
|
|
|
const data = cloneDeep(examForm.value)
|
|
|
let res = await store.update(data)
|
|
|
if ($checkRes(res, true)) {
|
|
|
- search({ skip: 0, limit })
|
|
|
+ search({ skip, limit })
|
|
|
toClose()
|
|
|
}
|
|
|
}
|
|
@@ -249,7 +260,7 @@ const toUse = async (data, is_use) => {
|
|
|
.then(async () => {
|
|
|
let res = await store.update({ id: get(data, 'id'), is_use })
|
|
|
if ($checkRes(res, true)) {
|
|
|
- search({ skip: 0, limit })
|
|
|
+ search({ skip, limit })
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {})
|