|
@@ -17,10 +17,24 @@
|
|
|
</cButton>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="thr">
|
|
|
- <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel"> </cTable>
|
|
|
+ <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @status="toStatus" @edit="toEdit" @del="toDel"> </cTable>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <cDialog :dialog="dialog" @toClose="toClose">
|
|
|
+ <template v-slot:info>
|
|
|
+ <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
|
|
|
+ <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
|
|
|
+ <template #winner>
|
|
|
+ <el-option v-for="i in applicationList" :key="i.team_id" :label="i.team_name" :value="i.team_id"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #status>
|
|
|
+ <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ </cForm>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </cDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -60,14 +74,24 @@ let fields: Ref<any[]> = ref([
|
|
|
]);
|
|
|
// 操作
|
|
|
let opera: Ref<any[]> = ref([
|
|
|
- { label: '修改', method: 'edit' },
|
|
|
- { label: '删除', method: 'del', confirm: true, type: 'danger' }
|
|
|
+ { label: '赛程状态', method: 'status' },
|
|
|
+ { label: '修改', method: 'edit', display: (i) => i.status == '0' },
|
|
|
+ { label: '删除', method: 'del', confirm: true, type: 'danger', display: (i) => i.status == '0' }
|
|
|
]);
|
|
|
// 查询数据
|
|
|
let searchForm: Ref<any> = ref({});
|
|
|
// 字典表
|
|
|
const statusList: Ref<any> = ref([]);
|
|
|
const applicationList: Ref<any> = ref([]);
|
|
|
+// 弹框
|
|
|
+const dialog: Ref<any> = ref({ title: '赛程状态', show: false, type: '1' });
|
|
|
+const form: Ref<any> = ref({ file: [] });
|
|
|
+const formFields: Ref<any> = ref([
|
|
|
+ { label: '红方分数', model: 'red_score' },
|
|
|
+ { label: '蓝方分数', model: 'blue_score' },
|
|
|
+ { label: '胜者', model: 'winner', type: 'select' },
|
|
|
+ { label: '状态', model: 'status', type: 'select' }
|
|
|
+]);
|
|
|
// 请求
|
|
|
onMounted(async () => {
|
|
|
loading.value = true;
|
|
@@ -98,6 +122,14 @@ const getDict = (e, model) => {
|
|
|
else return '暂无';
|
|
|
}
|
|
|
};
|
|
|
+// 赛程状态
|
|
|
+const toStatus = async (data) => {
|
|
|
+ let res: IQueryResult = await courseAxios.fetch(data._id);
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ form.value = res.data;
|
|
|
+ dialog.value = { title: '赛程状态', show: true, type: '1' };
|
|
|
+ }
|
|
|
+};
|
|
|
// 添加
|
|
|
const toAdd = () => {
|
|
|
router.push({ path: '/match/course/detail', query: { match_id: id.value } });
|
|
@@ -124,6 +156,22 @@ const searchOther = async () => {
|
|
|
res = await applicationAxios.query({ match_id: id.value, status: '1' });
|
|
|
if (res.errcode == '0') applicationList.value = res.data;
|
|
|
};
|
|
|
+// 提交保存
|
|
|
+const toSave = async (data) => {
|
|
|
+ let res: IQueryResult = await courseAxios.update(data);
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ ElMessage({ message: '信息审核成功', type: 'success' });
|
|
|
+ toClose();
|
|
|
+ } else {
|
|
|
+ ElMessage({ message: `${res.errmsg}`, type: 'error' });
|
|
|
+ }
|
|
|
+};
|
|
|
+// 关闭弹框
|
|
|
+const toClose = () => {
|
|
|
+ form.value = {};
|
|
|
+ dialog.value = { show: false };
|
|
|
+ search({ skip, limit });
|
|
|
+};
|
|
|
// 返回上一页
|
|
|
const toBack = () => {
|
|
|
window.history.go(-1);
|