|
@@ -99,6 +99,40 @@
|
|
<template #brief>
|
|
<template #brief>
|
|
<WangEditor v-model="form.brief" />
|
|
<WangEditor v-model="form.brief" />
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #process>
|
|
|
|
+ <el-col :span="24" class="tables">
|
|
|
|
+ <el-col :span="24" class="tables_1">
|
|
|
|
+ <el-button type="primary" @click="addProcess()">添加</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-table :data="processList" border>
|
|
|
|
+ <el-table-column type="index" label="序号" width="80" align="center"> </el-table-column>
|
|
|
|
+ <el-table-column prop="name" label="流程名称" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-input v-model="scope.row.name" placeholder="请输入流程名称" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="order_num" label="排序" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-input v-model="scope.row.order_num" type="number" placeholder="请输入排序" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="is_use" label="是否启用" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-select v-model="scope.row.is_use" placeholder="请选择是否启用">
|
|
|
|
+ <el-option v-for="item in isUseList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" align="center" width="100">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-button type="danger" @click="delProcess(scope.row)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </template>
|
|
</custom-form>
|
|
</custom-form>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" v-if="dialog.type == '2'">
|
|
<el-col :span="24" v-if="dialog.type == '2'">
|
|
@@ -109,7 +143,10 @@
|
|
</custom-form>
|
|
</custom-form>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" v-if="dialog.type === '3'">
|
|
<el-col :span="24" v-if="dialog.type === '3'">
|
|
- 报名
|
|
|
|
|
|
+ <sign :matchInfo="matchInfo"></sign>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" v-if="dialog.type === '4'">
|
|
|
|
+ <score :matchInfo="matchInfo"></score>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -117,14 +154,17 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import moment from 'moment'
|
|
// API 引用
|
|
// API 引用
|
|
import { cloneDeep, get } from 'lodash-es'
|
|
import { cloneDeep, get } from 'lodash-es'
|
|
const $checkRes = inject('$checkRes')
|
|
const $checkRes = inject('$checkRes')
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
-// 路由
|
|
|
|
-const router = useRouter()
|
|
|
|
|
|
+// 组件
|
|
|
|
+import sign from '../match/sign/index.vue'
|
|
|
|
+import score from '../match/score/index.vue'
|
|
// 接口
|
|
// 接口
|
|
import { MatchStore } from '@/store/api/platform/match'
|
|
import { MatchStore } from '@/store/api/platform/match'
|
|
|
|
+import { ProcessStore } from '@/store/api/platform/process'
|
|
import { DictDataStore } from '@/store/api/system/dictData'
|
|
import { DictDataStore } from '@/store/api/system/dictData'
|
|
import { TagsStore } from '@/store/api/system/tags'
|
|
import { TagsStore } from '@/store/api/system/tags'
|
|
import { SectorStore } from '@/store/api/system/sector'
|
|
import { SectorStore } from '@/store/api/system/sector'
|
|
@@ -132,6 +172,7 @@ const store = MatchStore()
|
|
const dictDataStore = DictDataStore()
|
|
const dictDataStore = DictDataStore()
|
|
const tagsStore = TagsStore()
|
|
const tagsStore = TagsStore()
|
|
const sectorStore = SectorStore()
|
|
const sectorStore = SectorStore()
|
|
|
|
+const processStore = ProcessStore()
|
|
const data = ref([])
|
|
const data = ref([])
|
|
const searchForm = ref({})
|
|
const searchForm = ref({})
|
|
const fields = [
|
|
const fields = [
|
|
@@ -146,7 +187,6 @@ const fields = [
|
|
]
|
|
]
|
|
const opera = [
|
|
const opera = [
|
|
{ label: t('common.score'), method: 'score', display: (i) => i.match_status == '2' },
|
|
{ label: t('common.score'), method: 'score', display: (i) => i.match_status == '2' },
|
|
- { label: t('common.process'), method: 'process', display: (i) => i.scale === '0' },
|
|
|
|
{ label: t('common.sign'), method: 'sign', type: 'warning' },
|
|
{ label: t('common.sign'), method: 'sign', type: 'warning' },
|
|
{
|
|
{
|
|
label: t('common.update'),
|
|
label: t('common.update'),
|
|
@@ -168,6 +208,7 @@ const buttonFields = [
|
|
let skip = 0
|
|
let skip = 0
|
|
let limit = inject('limit')
|
|
let limit = inject('limit')
|
|
const total = ref(0)
|
|
const total = ref(0)
|
|
|
|
+const matchInfo = ref({})
|
|
// 字典表
|
|
// 字典表
|
|
const isUseList = ref([])
|
|
const isUseList = ref([])
|
|
const statusList = ref([])
|
|
const statusList = ref([])
|
|
@@ -178,6 +219,8 @@ const tagsList = ref([])
|
|
const sectorList = ref([])
|
|
const sectorList = ref([])
|
|
const matchTypeList = ref([])
|
|
const matchTypeList = ref([])
|
|
const scaleList = ref([])
|
|
const scaleList = ref([])
|
|
|
|
+// 流程列表
|
|
|
|
+const processList = ref([])
|
|
// 多选列表
|
|
// 多选列表
|
|
const selectList = ref([])
|
|
const selectList = ref([])
|
|
// 加载中
|
|
// 加载中
|
|
@@ -201,6 +244,7 @@ const formFields = ref([
|
|
{ label: t('pages.match.rules'), model: 'rules', custom: true },
|
|
{ label: t('pages.match.rules'), model: 'rules', custom: true },
|
|
{ label: t('pages.match.brief'), model: 'brief', custom: true },
|
|
{ label: t('pages.match.brief'), model: 'brief', custom: true },
|
|
{ label: t('pages.match.video'), model: 'video', custom: true },
|
|
{ label: t('pages.match.video'), model: 'video', custom: true },
|
|
|
|
+ { label: t('pages.match.process'), model: 'process', custom: true },
|
|
{ label: t('pages.match.match_status'), model: 'match_status', type: 'select' }
|
|
{ label: t('pages.match.match_status'), model: 'match_status', type: 'select' }
|
|
])
|
|
])
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
@@ -277,6 +321,11 @@ const search = async (query = { skip, limit }) => {
|
|
total.value = res.total
|
|
total.value = res.total
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+const searchProcess = async () => {
|
|
|
|
+ const info = { match: form.value.id }
|
|
|
|
+ const res = await processStore.query(info)
|
|
|
|
+ if (res.errcode == '0') processList.value = res.data
|
|
|
|
+}
|
|
// 字典数据转换
|
|
// 字典数据转换
|
|
const getDict = (data, model) => {
|
|
const getDict = (data, model) => {
|
|
if (data) {
|
|
if (data) {
|
|
@@ -313,24 +362,23 @@ const toAdd = () => {
|
|
dialog.value = { type: '1', show: true, title: t('pages.match.addDialogTitle') }
|
|
dialog.value = { type: '1', show: true, title: t('pages.match.addDialogTitle') }
|
|
}
|
|
}
|
|
// 修改
|
|
// 修改
|
|
-const toEdit = (data) => {
|
|
|
|
|
|
+const toEdit = async (data) => {
|
|
data.time = [data.start_time, data.end_time]
|
|
data.time = [data.start_time, data.end_time]
|
|
if (!data.file) data.file = []
|
|
if (!data.file) data.file = []
|
|
if (!data.video) data.video = []
|
|
if (!data.video) data.video = []
|
|
form.value = data
|
|
form.value = data
|
|
|
|
+ await searchProcess()
|
|
dialog.value = { type: '1', show: true, title: t('pages.match.upDialogTitle') }
|
|
dialog.value = { type: '1', show: true, title: t('pages.match.upDialogTitle') }
|
|
}
|
|
}
|
|
// 报名管理
|
|
// 报名管理
|
|
const toSign = (data) => {
|
|
const toSign = (data) => {
|
|
- router.push({ path: '/match/sign', query: { id: data.id } })
|
|
|
|
-}
|
|
|
|
-// 流程管理
|
|
|
|
-const toProcess = (data) => {
|
|
|
|
- router.push({ path: '/match/process', query: { id: data.id } })
|
|
|
|
|
|
+ matchInfo.value = data
|
|
|
|
+ dialog.value = { type: '3', show: true, title: t('pages.match.signDialogTitle') }
|
|
}
|
|
}
|
|
// 分数管理
|
|
// 分数管理
|
|
const toScore = (data) => {
|
|
const toScore = (data) => {
|
|
- router.push({ path: '/match/score', query: { id: data.id } })
|
|
|
|
|
|
+ matchInfo.value = data
|
|
|
|
+ dialog.value = { type: '4', show: true, title: t('pages.match.scoreDialogTitle') }
|
|
}
|
|
}
|
|
// 删除
|
|
// 删除
|
|
const toDelete = async (data) => {
|
|
const toDelete = async (data) => {
|
|
@@ -350,6 +398,7 @@ const toSave = async () => {
|
|
if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
else res = await store.create({ ...data, ...other })
|
|
else res = await store.create({ ...data, ...other })
|
|
if ($checkRes(res, true)) {
|
|
if ($checkRes(res, true)) {
|
|
|
|
+ toProcessSave()
|
|
search({ skip, limit })
|
|
search({ skip, limit })
|
|
toClose()
|
|
toClose()
|
|
}
|
|
}
|
|
@@ -383,6 +432,32 @@ const toUse = async (data, is_use) => {
|
|
})
|
|
})
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
}
|
|
}
|
|
|
|
+// 流程添加
|
|
|
|
+const toProcessSave = async () => {
|
|
|
|
+ for (const val of processList.value) {
|
|
|
|
+ const data = cloneDeep(val)
|
|
|
|
+ delete data.sid
|
|
|
|
+ if (get(data, 'id')) await processStore.update(data)
|
|
|
|
+ else await processStore.create(data)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+// 流程添加
|
|
|
|
+const addProcess = () => {
|
|
|
|
+ let list = processList.value || []
|
|
|
|
+ list.push({ sid: moment().valueOf(), name: '', time: '', is_use: '', match: form.value.id })
|
|
|
|
+ processList.value = list
|
|
|
|
+}
|
|
|
|
+// 流程删除
|
|
|
|
+const delProcess = async (e) => {
|
|
|
|
+ if (e.sid) {
|
|
|
|
+ let list = processList.value.filter((i) => i.sid != e.sid)
|
|
|
|
+ processList.value = list
|
|
|
|
+ } else {
|
|
|
|
+ let list = processList.value.filter((i) => i.id != e.id)
|
|
|
|
+ processList.value = list
|
|
|
|
+ }
|
|
|
|
+ if (e.id) await processStore.del(e.id)
|
|
|
|
+}
|
|
// 重置
|
|
// 重置
|
|
const toReset = async () => {
|
|
const toReset = async () => {
|
|
searchForm.value = {}
|
|
searchForm.value = {}
|
|
@@ -411,4 +486,9 @@ const onUpload = (e) => {
|
|
margin-left: 0 !important;
|
|
margin-left: 0 !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.tables {
|
|
|
|
+ .tables_1 {
|
|
|
|
+ margin: 0 0 10px 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|