|
@@ -30,13 +30,14 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="250">
|
|
|
<template #default="{ row }">
|
|
|
- <el-link v-if="row.form == '4'" :underline="false" type="primary" size="mini" @click="toPreliminary(row)" style="margin-right: 10px">查看初赛信息</el-link>
|
|
|
- <el-link v-if="row.status == '-2'" :underline="false" type="warning" size="mini" @click="toExam(row)" style="margin-right: 10px">提交审核</el-link>
|
|
|
- <el-link v-if="row.match_status == '2' && row.form != '3'" :underline="false" type="primary" size="mini" @click="toScore(row)" style="margin-right: 10px">分数</el-link>
|
|
|
- <el-link :underline="false" type="warning" size="mini" @click="toSign(row)" style="margin-right: 10px">报名</el-link>
|
|
|
- <el-link :underline="false" type="primary" size="mini" @click="toEdit(row)" style="margin-right: 10px">修改</el-link>
|
|
|
- <el-link v-if="row.status != '1'" :underline="false" type="danger" size="mini" style="margin-right: 10px" @click="toDelete(row)"> 删除 </el-link>
|
|
|
- <el-link :underline="false" type="primary" size="mini" @click="toMatch(row)">赛事状态修改</el-link>
|
|
|
+ <el-link v-if="row.form == '4'" :underline="false" type="primary" @click="toPreliminary(row)" style="margin-right: 10px">初赛报名名单</el-link>
|
|
|
+ <el-link v-if="row.status == '-2'" :underline="false" type="warning" @click="toExam(row)" style="margin-right: 10px">提交审核</el-link>
|
|
|
+ <el-link v-if="row.match_status == '2' && row.form != '4' && row.form != '3'" :underline="false" type="primary" @click="toScore(row)" style="margin-right: 10px"> 分数 </el-link>
|
|
|
+ <el-link v-if="row.form != '4'" :underline="false" type="warning" @click="toSign(row)" style="margin-right: 10px">报名</el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="toEdit(row)" style="margin-right: 10px">修改</el-link>
|
|
|
+ <el-link v-if="row.status != '1'" :underline="false" type="danger" style="margin-right: 10px" @click="toDelete(row)"> 删除 </el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="toMatch(row)" style="margin-right: 10px">赛事状态修改</el-link>
|
|
|
+ <el-link v-if="row.form == '4'" :underline="false" type="primary" @click="toExtOne(row)">赛事设置</el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -49,46 +50,79 @@
|
|
|
<el-dialog v-model="dialog.show" :title="dialog.title" :destroy-on-close="false" @close="toClose">
|
|
|
<el-row>
|
|
|
<el-col :span="24" v-if="dialog.type == '1'">
|
|
|
- <el-tabs v-model="activeName" type="card">
|
|
|
- <el-tab-pane label="基本信息" name="first">
|
|
|
- <custom-form v-model="form" :fields="oneformFields" :rules="rules" @save="toSave" @draftSave="toDraftSave">
|
|
|
- <template #video>
|
|
|
- <custom-upload model="video" :list="form.video" :limit="1" url="/files/web/cxyy_match/upload" @change="onUpload"></custom-upload>
|
|
|
- </template>
|
|
|
- <template #file>
|
|
|
+ <el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
|
|
+ <el-tabs v-model="activeName" type="card">
|
|
|
+ <el-tab-pane label="基本信息" name="first">
|
|
|
+ <el-form-item label="封面" prop="file">
|
|
|
<custom-upload model="file" :list="form.file" :limit="1" listType="picture-card" url="/files/web/cxyy_match/upload" @change="onUpload"></custom-upload>
|
|
|
- </template>
|
|
|
- <template #is_use>
|
|
|
- <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
- </template>
|
|
|
- <template #is_show>
|
|
|
- <el-radio v-for="i in isUseList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
- </template>
|
|
|
- <template #industry>
|
|
|
- <el-option v-for="i in industryList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
- </template>
|
|
|
- <template #scale>
|
|
|
- <el-radio v-for="i in scaleList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
- </template>
|
|
|
- <template #match_type>
|
|
|
- <el-radio v-for="i in matchTypeList" :key="i.id" :label="i.value">{{ i.label }}</el-radio>
|
|
|
- </template>
|
|
|
- <template #type>
|
|
|
- <el-option v-for="i in typeList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
- </template>
|
|
|
- <template #form>
|
|
|
- <el-option v-for="i in formList" :key="i.id" :label="i.label" :value="i.value"></el-option>
|
|
|
- </template>
|
|
|
- <template #tags>
|
|
|
- <el-select v-model="form.tags" multiple filterable allow-create default-first-option :reserve-keyword="false" placeholder="请选择标签" style="width: 100%">
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="赛事名称" prop="name">
|
|
|
+ <el-input size="large" v-model="form.name" placeholder="请输入赛事名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="类别" prop="form">
|
|
|
+ <el-select v-model="form.form" placeholder="请选择类别" size="large" style="width: 100%">
|
|
|
+ <el-option v-for="item in formList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="标签" prop="tags">
|
|
|
+ <el-select size="large" v-model="form.tags" multiple filterable allow-create default-first-option :reserve-keyword="false" placeholder="请选择标签" style="width: 100%">
|
|
|
<el-option v-for="item in tagsList" :key="item.id" :label="item.title" :value="item.title" />
|
|
|
</el-select>
|
|
|
- </template>
|
|
|
- </custom-form>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="拓展信息" name="second">
|
|
|
- <custom-form v-model="form" :fields="twoformFields" :rules="{}" @save="toSave" @draftSave="toDraftSave">
|
|
|
- <template #rules>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="类型" prop="type">
|
|
|
+ <el-select v-model="form.type" placeholder="请选择类型" size="large" style="width: 100%">
|
|
|
+ <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="赛事规模" prop="scale">
|
|
|
+ <el-radio-group v-model="form.scale">
|
|
|
+ <el-radio v-for="item in scaleList" :key="item.value" :value="item.value" size="large">{{ item.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="赛事类型" prop="match_type">
|
|
|
+ <el-radio-group v-model="form.match_type">
|
|
|
+ <el-radio v-for="item in matchTypeList" :key="item.value" :value="item.value" size="large">{{ item.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="路由" prop="href" v-if="form.match_type == '1'">
|
|
|
+ <el-input size="large" v-model="form.href" placeholder="请输入路由" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="组织单位" prop="work">
|
|
|
+ <el-input size="large" v-model="form.work" placeholder="请输入组织单位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="行业" prop="industry">
|
|
|
+ <el-select v-model="form.type" placeholder="请选择行业" size="large" style="width: 100%">
|
|
|
+ <el-option v-for="item in industryList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="奖金(万元)" prop="money">
|
|
|
+ <el-input size="large" v-model="form.money" placeholder="请输入奖金(万元)" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="有效期" prop="time">
|
|
|
+ <el-date-picker v-model="form.time" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"> </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否启用" prop="is_use">
|
|
|
+ <el-radio-group v-model="form.is_use">
|
|
|
+ <el-radio v-for="item in isUseList" :key="item.value" :value="item.value" size="large">{{ item.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否公开路演人信息" prop="is_show" v-if="form.form == '3'">
|
|
|
+ <el-radio-group v-model="form.is_show">
|
|
|
+ <el-radio v-for="item in isUseList" :key="item.value" :value="item.value" size="large">{{ item.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="视频" prop="vide">
|
|
|
+ <custom-upload model="video" :list="form.video" :limit="1" url="/files/web/cxyy_match/upload" @change="onUpload"></custom-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地址" prop="address">
|
|
|
+ <el-input size="large" v-model="form.address" type="textarea" placeholder="请输入地址" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input size="large" v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="拓展信息" name="second">
|
|
|
+ <el-form-item label="" prop="file">
|
|
|
<div class="rules">
|
|
|
<custom-form v-model="form.rules" :fields="rulesFields" :useSave="false">
|
|
|
<template #rules1>
|
|
@@ -129,15 +163,13 @@
|
|
|
</template>
|
|
|
</custom-form>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- <template #brief>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="简介" prop="brief">
|
|
|
<WangEditor v-model="form.brief" />
|
|
|
- </template>
|
|
|
- </custom-form>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="流程信息" name="third">
|
|
|
- <custom-form v-model="form" :fields="thrformFields" :rules="{}" @save="toSave" @draftSave="toDraftSave">
|
|
|
- <template #process>
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="流程信息" name="third">
|
|
|
+ <el-form-item label="" prop="process">
|
|
|
<el-col :span="24" class="tables">
|
|
|
<el-col :span="24" class="tables_1">
|
|
|
<el-button type="primary" @click="addProcess()">添加</el-button>
|
|
@@ -170,29 +202,55 @@
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- </template>
|
|
|
- </custom-form>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="报名信息设置" name="fourth" v-if="form.form == '4'">
|
|
|
- <el-col :span="24" class="add">
|
|
|
- <el-button type="primary" @click="addInvest()">添加</el-button>
|
|
|
- </el-col>
|
|
|
- <el-table :data="investigateList" border>
|
|
|
- <el-table-column type="index" label="序号" width="80" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="problem" label="问题" align="center"> </el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="200">
|
|
|
- <template #default="scope">
|
|
|
- <el-button size="mini" type="primary" @click="updateInvest(scope.row)">修改</el-button>
|
|
|
- <el-button size="mini" type="danger" @click="delInvest(scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="button">
|
|
|
- <el-button type="warning" @click="InvestSave('-2')">保存草稿</el-button>
|
|
|
- <el-button type="primary" @click="InvestSave('0')">保存并提交审核</el-button>
|
|
|
- </div>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="报名信息设置" name="fourth" v-if="form.form == '4'">
|
|
|
+ <el-form-item label="" prop="ext_info">
|
|
|
+ <el-col :span="24" class="add">
|
|
|
+ <el-button type="primary" @click="addInvest()">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-table :data="investigateList" border>
|
|
|
+ <el-table-column type="index" label="序号" width="80" align="center"> </el-table-column>
|
|
|
+ <el-table-column prop="problem" label="字段名称" align="center"> </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="200">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" @click="updateInvest(scope.row)">修改</el-button>
|
|
|
+ <el-button size="mini" type="danger" @click="delInvest(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="分数纬度设置" name="fifth" v-if="form.form == '4'">
|
|
|
+ <el-form-item label="" prop="ext_finals">
|
|
|
+ <el-col :span="24" class="tables">
|
|
|
+ <el-col :span="24" class="tables_1">
|
|
|
+ <el-button type="primary" @click="addFinals()">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-table :data="finalsList" 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 label="操作" align="center" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="danger" @click="delFinals(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-col :span="24" class="button">
|
|
|
+ <el-button type="warning" size="large" @click="toDraftSave(formRef)">保存草稿</el-button>
|
|
|
+ <el-button type="primary" size="large" @click="toSave(formRef)">保存并提交审核</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="dialog.type == '2'">
|
|
|
<sign :matchForm="form"></sign>
|
|
@@ -210,15 +268,27 @@
|
|
|
<el-col :span="24" v-if="dialog.type == '5'">
|
|
|
<preliminary :matchForm="form"></preliminary>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24" v-if="dialog.type == '6'">
|
|
|
+ <extOne :matchForm="form" :type="1" @toClose="toClose"></extOne>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="dialog.type == '7'">
|
|
|
+ <extOne :matchForm="form" :type="2" @toClose="toClose"></extOne>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="dialog.type == '8'">
|
|
|
+ <extOne :matchForm="form" :type="3" @toClose="toClose"></extOne>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="dialog.type == '9'">
|
|
|
+ <extOne :matchForm="form" :type="4" @toClose="toClose"></extOne>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-dialog>
|
|
|
- <el-dialog v-model="dialogVisible" title="调查问卷填写" width="800" :destroy-on-close="false" @close="toInvestClose">
|
|
|
+ <el-dialog v-model="dialogVisible" title="报名信息填写" width="800" :destroy-on-close="false" @close="toInvestClose">
|
|
|
<custom-form v-model="investigateForm" :fields="fourformFields" :rules="fourRules" @save="toInvestigateSave" submitText="保存" :DraftSave="false">
|
|
|
<template #type>
|
|
|
<el-option v-for="i in proTypeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
<template #answer>
|
|
|
- <div class="answer" v-if="investigateForm.type == '0' || investigateForm.type == '1' || investigateForm.type == '2' || investigateForm.type == '6'">
|
|
|
+ <div class="answer" v-if="investigateForm.type == '0' || investigateForm.type == '1' || investigateForm.type == '2' || investigateForm.type == '7'">
|
|
|
<el-col :span="24" class="add">
|
|
|
<el-button type="primary" @click="addAnswer()">添加</el-button>
|
|
|
</el-col>
|
|
@@ -236,8 +306,8 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <div class="answer" v-if="investigateForm.type == '7'">
|
|
|
- <custom-upload model="file" :list="answerFile" :limit="1" url="/files/web/cxyy_match/upload" @change="onaUpload"></custom-upload>
|
|
|
+ <div class="answer" v-if="investigateForm.type == '8'">
|
|
|
+ <custom-upload model="file" :list="answerFile" accept="*" :limit="10" url="/files/web/cxyy_match/upload" @change="onaUpload"></custom-upload>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #is_must>
|
|
@@ -254,6 +324,7 @@ import moment from 'moment'
|
|
|
import sign from './parts/sign.vue'
|
|
|
import score from './parts/score.vue'
|
|
|
import preliminary from './parts/preliminaryMatch.vue'
|
|
|
+import extOne from './parts/extOne.vue'
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import { cloneDeep, get } from 'lodash-es'
|
|
|
const $checkRes = inject('$checkRes')
|
|
@@ -292,35 +363,13 @@ const scaleList = ref([])
|
|
|
|
|
|
// 流程列表
|
|
|
const processList = ref([])
|
|
|
-
|
|
|
-const form = ref({ time: [], rules: {} })
|
|
|
+// 表单
|
|
|
+const formRef = ref()
|
|
|
+const form = ref({ video: [], time: [], rules: {} })
|
|
|
const dialog = ref({ type: '1', show: false, title: '发布赛事' })
|
|
|
const activeName = ref('first')
|
|
|
-const oneformFields = ref([
|
|
|
- { label: '封面', model: 'file', custom: true },
|
|
|
- { label: '赛事名称', model: 'name' },
|
|
|
- { label: '类别', model: 'form', type: 'select' },
|
|
|
- { label: '标签', model: 'tags', custom: true },
|
|
|
- { label: '类型', model: 'type', type: 'select' },
|
|
|
- { label: '赛事规模', model: 'scale', type: 'radio' },
|
|
|
- { label: '赛事类型', model: 'match_type', type: 'radio' },
|
|
|
- { label: '路由', model: 'href', display: () => form.value.match_type == '1' },
|
|
|
- { label: '组织单位', model: 'work' },
|
|
|
- { label: '行业', model: 'industry', type: 'select' },
|
|
|
- { label: '奖金(万元)', model: 'money' },
|
|
|
- { label: '有效期', model: 'time', type: 'datetimerange' },
|
|
|
- { label: '是否启用', model: 'is_use', type: 'radio' },
|
|
|
- { label: '是否公开路演人信息', model: 'is_show', type: 'radio' },
|
|
|
- { label: '视频', model: 'video', custom: true },
|
|
|
- { label: '地址', model: 'address', type: 'textarea' },
|
|
|
- { label: '备注', model: 'remark', type: 'textarea', display: () => form.value.form == '3' }
|
|
|
-])
|
|
|
-const twoformFields = ref([
|
|
|
- { model: 'rules', custom: true },
|
|
|
- { label: '简介', model: 'brief', custom: true }
|
|
|
-])
|
|
|
-const thrformFields = ref([{ label: '赛事流程', model: 'process', custom: true }])
|
|
|
-
|
|
|
+// 分数纬度列表
|
|
|
+const finalsList = ref([])
|
|
|
const matchFields = ref([{ label: '赛事状态', model: 'match_status', type: 'select' }])
|
|
|
const matchRules = reactive({ match_status: [{ required: true, message: '请选择赛事状态', trigger: 'blur' }] })
|
|
|
const rules = reactive({
|
|
@@ -349,30 +398,31 @@ const rulesFields = ref([
|
|
|
const investigateList = ref([])
|
|
|
const investigateForm = ref({})
|
|
|
const fourformFields = ref([
|
|
|
- { label: '问题', model: 'problem' },
|
|
|
+ { label: '字段名称', model: 'problem' },
|
|
|
{ label: '类型', model: 'type', type: 'select' },
|
|
|
{
|
|
|
label: '答案',
|
|
|
model: 'answer',
|
|
|
custom: true,
|
|
|
- display: () => investigateForm.value.type == '0' || investigateForm.value.type == '1' || investigateForm.value.type == '2' || investigateForm.value.type == '6' || investigateForm.value.type == '7'
|
|
|
+ display: () => investigateForm.value.type == '0' || investigateForm.value.type == '1' || investigateForm.value.type == '2' || investigateForm.value.type == '7' || investigateForm.value.type == '8'
|
|
|
},
|
|
|
- { label: '是否必填', model: 'is_must', type: 'radio' },
|
|
|
+ { label: '是否必填', model: 'is_must', type: 'radio', display: () => investigateForm.value.type != '7' },
|
|
|
{ label: '备注', model: 'remark', type: 'textarea' }
|
|
|
])
|
|
|
const fourRules = reactive({
|
|
|
- problem: [{ required: true, message: '请输入问题', trigger: 'blur' }]
|
|
|
+ problem: [{ required: true, message: '请输入字段名称', trigger: 'blur' }]
|
|
|
})
|
|
|
const dialogVisible = ref(false)
|
|
|
const proTypeList = ref([
|
|
|
{ value: '0', label: '单选' },
|
|
|
{ value: '1', label: '多选' },
|
|
|
{ value: '2', label: '下拉' },
|
|
|
- { value: '3', label: '单行文本' },
|
|
|
- { value: '4', label: '多行文本' },
|
|
|
- { value: '5', label: '图片/文件' },
|
|
|
- { value: '6', label: '数组' },
|
|
|
- { value: '7', label: '附件模板' }
|
|
|
+ { value: '3', label: '数值类型' },
|
|
|
+ { value: '4', label: '单行文本' },
|
|
|
+ { value: '5', label: '多行文本' },
|
|
|
+ { value: '6', label: '图片/文件' },
|
|
|
+ { value: '7', label: '数组' },
|
|
|
+ { value: '8', label: '附件模板' }
|
|
|
])
|
|
|
// 答案
|
|
|
const answerList = ref([])
|
|
@@ -453,6 +503,7 @@ const toEdit = async (data) => {
|
|
|
res.data.time = [data.start_time, data.end_time]
|
|
|
form.value = res.data
|
|
|
if (res.data.ext_info && res.data.ext_info.length > 0) investigateList.value = res.data.ext_info
|
|
|
+ if (res.data.ext_finals && res.data.ext_finals.length > 0) finalsList.value = res.data.ext_finals
|
|
|
await searchProcess()
|
|
|
dialog.value = { type: '1', show: true, title: '修改赛事' }
|
|
|
}
|
|
@@ -477,6 +528,11 @@ const toPreliminary = (data) => {
|
|
|
form.value = data
|
|
|
dialog.value = { type: '5', show: true, title: '初赛信息' }
|
|
|
}
|
|
|
+// 赛事设置
|
|
|
+const toExtOne = (data) => {
|
|
|
+ form.value = data
|
|
|
+ window.open(`/cxyyMatch/home/?id=${data.id || data._id}`)
|
|
|
+}
|
|
|
// 删除
|
|
|
const toDelete = (data) => {
|
|
|
ElMessageBox.confirm(`您确认删除${data.name}该数据?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
|
|
@@ -488,41 +544,77 @@ const toDelete = (data) => {
|
|
|
})
|
|
|
.catch(() => {})
|
|
|
}
|
|
|
-const toSave = async () => {
|
|
|
- const data = cloneDeep(form.value)
|
|
|
- const other = { status: '0', user: user.value.id }
|
|
|
- if (data.time && data.time.length > 1) {
|
|
|
- data.start_time = data.time[0]
|
|
|
- data.end_time = data.time[1]
|
|
|
- }
|
|
|
- delete data.time
|
|
|
- let res
|
|
|
- if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
|
- else res = await store.create({ ...data, ...other })
|
|
|
- if ($checkRes(res, true)) {
|
|
|
- if (res.data && res.data.id) match_id.value = res.data.id
|
|
|
- await toProcessSave()
|
|
|
- await search({ skip, limit })
|
|
|
- toClose()
|
|
|
- }
|
|
|
-}
|
|
|
-const toDraftSave = async () => {
|
|
|
- const data = cloneDeep(form.value)
|
|
|
- const other = { status: '-2', user: user.value.id }
|
|
|
- if (data.time && data.time.length > 1) {
|
|
|
- data.start_time = data.time[0]
|
|
|
- data.end_time = data.time[1]
|
|
|
- }
|
|
|
- delete data.time
|
|
|
- let res
|
|
|
- if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
|
- else res = await store.create({ ...data, ...other })
|
|
|
- if ($checkRes(res, true)) {
|
|
|
- if (res.data && res.data.id) match_id.value = res.data.id
|
|
|
- await toProcessSave()
|
|
|
- await search({ skip, limit })
|
|
|
- toClose()
|
|
|
- }
|
|
|
+const toSave = async (formEl) => {
|
|
|
+ if (!formEl) return
|
|
|
+ await formEl.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const data = cloneDeep(form.value)
|
|
|
+ const other = { status: '0', user: user.value.id }
|
|
|
+ if (data.time && data.time.length > 1) {
|
|
|
+ data.start_time = data.time[0]
|
|
|
+ data.end_time = data.time[1]
|
|
|
+ }
|
|
|
+ delete data.time
|
|
|
+ if (investigateList.value && investigateList.value.length > 0) data.ext_info = investigateList.value
|
|
|
+ if (finalsList.value && finalsList.value.length > 0) data.ext_finals = finalsList.value
|
|
|
+ let res
|
|
|
+ if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
|
+ else res = await store.create({ ...data, ...other })
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ ElMessageBox.alert('赛事发布成功,请在中查看赛事发布信息', '赛事发布', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: async () => {
|
|
|
+ if (res.data && res.data.id) match_id.value = res.data.id
|
|
|
+ await toProcessSave()
|
|
|
+ form.value = { time: [], rules: {} }
|
|
|
+ processList.value = []
|
|
|
+ activeName.value = 'first'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: '有相关必填项没有填写',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const toDraftSave = async (formEl) => {
|
|
|
+ if (!formEl) return
|
|
|
+ await formEl.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const data = cloneDeep(form.value)
|
|
|
+ const other = { status: '-2', user: user.value.id }
|
|
|
+ if (data.time && data.time.length > 1) {
|
|
|
+ data.start_time = data.time[0]
|
|
|
+ data.end_time = data.time[1]
|
|
|
+ }
|
|
|
+ delete data.time
|
|
|
+ if (investigateList.value && investigateList.value.length > 0) data.ext_info = investigateList.value
|
|
|
+ if (finalsList.value && finalsList.value.length > 0) data.ext_finals = finalsList.value
|
|
|
+ let res
|
|
|
+ if (get(data, 'id')) res = await store.update({ ...data, ...other })
|
|
|
+ else res = await store.create({ ...data, ...other })
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ ElMessageBox.alert('赛事发布成功,请在历史发布中选择赛事管理查看发布赛事信息', '赛事发布', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: async () => {
|
|
|
+ if (res.data && res.data.id) match_id.value = res.data.id
|
|
|
+ await toProcessSave()
|
|
|
+ form.value = { time: [], rules: {} }
|
|
|
+ processList.value = []
|
|
|
+ activeName.value = 'first'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: '有相关必填项没有填写',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
// 审核保存
|
|
|
const toExam = async (row) => {
|
|
@@ -531,27 +623,28 @@ const toExam = async (row) => {
|
|
|
const data = cloneDeep(row)
|
|
|
let res = await store.update({ id: data.id, status: '0', user: user.value.id })
|
|
|
if ($checkRes(res, true)) {
|
|
|
- search({ skip, limit })
|
|
|
toClose()
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {})
|
|
|
}
|
|
|
|
|
|
-// 修改赛事的
|
|
|
+// 修改赛事状态
|
|
|
const toMatchSave = async (row) => {
|
|
|
const data = cloneDeep(row)
|
|
|
let res = await store.update({ id: data.id, match_status: data.match_status })
|
|
|
if ($checkRes(res, true)) {
|
|
|
- search({ skip, limit })
|
|
|
toClose()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-const toClose = () => {
|
|
|
+const toClose = async () => {
|
|
|
form.value = { time: [], rules: {} }
|
|
|
dialog.value = { show: false }
|
|
|
+ investigateList.value = []
|
|
|
+ finalsList.value = []
|
|
|
+ processList.value = []
|
|
|
activeName.value = 'first'
|
|
|
+ await search({ skip, limit })
|
|
|
}
|
|
|
// 上传图片
|
|
|
const onUpload = (e) => {
|
|
@@ -602,7 +695,10 @@ const addInvest = () => {
|
|
|
// 调查问卷修改
|
|
|
const updateInvest = (e) => {
|
|
|
dialogVisible.value = true
|
|
|
- if (e.answer && e.answer.length > 0) answerList.value = e.answer
|
|
|
+ if (e.answer && e.answer.length > 0) {
|
|
|
+ if (e.type == '8') answerFile.value = e.answer
|
|
|
+ else answerList.value = e.answer
|
|
|
+ }
|
|
|
investigateForm.value = e
|
|
|
}
|
|
|
// 删除调查问卷
|
|
@@ -639,18 +735,16 @@ const delAnswer = async (e) => {
|
|
|
let list = answerList.value.filter((i) => i.sid != e.sid)
|
|
|
answerList.value = list
|
|
|
}
|
|
|
-// 保存并提交审核
|
|
|
-const InvestSave = async (status) => {
|
|
|
- const data = cloneDeep(form.value)
|
|
|
- const other = { status, user: user.value.id }
|
|
|
- let res
|
|
|
- if (get(data, 'id')) res = await store.update({ id: data.id, ext_info: investigateList.value, ...other, ...data })
|
|
|
- else res = await store.create({ ext_info: investigateList.value, ...other, ...data })
|
|
|
- if (res.errcode == 0) {
|
|
|
- ElMessage({ message: `发布成功可以上历史发布查看`, type: 'success' })
|
|
|
- search({ skip, limit })
|
|
|
- toClose()
|
|
|
- }
|
|
|
+// 维度添加
|
|
|
+const addFinals = () => {
|
|
|
+ let list = finalsList.value || []
|
|
|
+ list.push({ sid: moment().valueOf(), name: '' })
|
|
|
+ finalsList.value = list
|
|
|
+}
|
|
|
+// 维度删除
|
|
|
+const delFinals = async (e) => {
|
|
|
+ let list = finalsList.value.filter((i) => i.sid != e.sid)
|
|
|
+ finalsList.value = list
|
|
|
}
|
|
|
// 上传图片
|
|
|
const onaUpload = (e) => {
|