'对接比赛奖项管理'

gst2base
JayChou 1 day ago
parent d2d299b15e
commit 1d1879ca1d
  1. 50
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/components/cardItem.vue
  2. 5
      jeecgboot-vue3-master/src/views/annualcompaward/AnnualCompAwardList.vue

@ -3,10 +3,14 @@
<div class="item"> <div class="item">
<div class="status-setting"> <div class="status-setting">
<div class="left" <div class="left"
><SvgIcon :name="data.state == 0 ? 'status0' : data.state == 1 ? 'status1' : data.state == 2 ? 'status2' : data.state == 3 ? 'status3' : ''" /><div :class="data.state == 0 ? 'color0' : data.state == 1 ? 'color1' : data.state == 2 ? 'color2' : data.state == 3 ? 'color3' : ''">{{ data.state_dictText }}</div></div ><SvgIcon
:name="data.state == 0 ? 'status0' : data.state == 1 ? 'status1' : data.state == 2 ? 'status2' : data.state == 3 ? 'status3' : ''"
/><div :class="data.state == 0 ? 'color0' : data.state == 1 ? 'color1' : data.state == 2 ? 'color2' : data.state == 3 ? 'color3' : ''">{{
data.state_dictText
}}</div></div
> >
<div class="right"> <div class="right">
<a-popover placement="bottomLeft" v-if="data.state == 0 || data.state == 3 "> <a-popover placement="bottomLeft" v-if="data.state == 0 || data.state == 3">
<template #content> <template #content>
<p class="setting-item" @click="edit">编辑</p> <p class="setting-item" @click="edit">编辑</p>
<p class="setting-item" @click="del">删除</p> <p class="setting-item" @click="del">删除</p>
@ -32,10 +36,10 @@
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
<div class="submt status-1" @click.stop="submit" v-if="data.state == 0 || data.state == 3 ">{{ data.state == 3 ? '重新提交' : '提交' }}</div> <div class="submt status-1" @click.stop="submit" v-if="data.state == 0 || data.state == 3">{{ data.state == 3 ? '重新提交' : '提交' }}</div>
<div class="submt status-2" @click.stop="enable" v-if="data.state == 2 && data.isopen == 0">启用</div> <div class="submt status-2" @click.stop="enable" v-if="data.state == 2 && data.isopen == 0">启用</div>
<div class="submt status-3" @click.stop="deactivate" v-if="data.state == 2 && data.isopen == 1">停用</div> <div class="submt status-3" @click.stop="deactivate" v-if="data.state == 2 && data.isopen == 1">停用</div>
<div class="submt status-1" v-if="data.state == 2" @click.stop="goTo(data.id)">比赛奖项管理</div> <div class="submt status-1" v-if="data.state == 2" @click.stop="goTo()">比赛奖项管理</div>
<div class="submt status-1" v-if="data.state == 2" @click.stop="bindProject(data.id)">配置年度比赛</div> <div class="submt status-1" v-if="data.state == 2" @click.stop="bindProject(data.id)">配置年度比赛</div>
<!-- <div <!-- <div
class="left" class="left"
@ -56,6 +60,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { watch, ref } from 'vue'; import { watch, ref } from 'vue';
import SvgIcon from '/@/components/Icon/src/SvgIcon.vue'; import SvgIcon from '/@/components/Icon/src/SvgIcon.vue';
import { bingProjectApi } from '../AnnualComp.api';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const router = useRouter(); const router = useRouter();
const props = defineProps({ const props = defineProps({
@ -64,7 +70,7 @@
required: true, required: true,
}, },
}); });
const emits = defineEmits(['editChange', 'delChange','infoChange','submitChange','enableChange','deactivateChange','bindProjectChange']); const emits = defineEmits(['editChange', 'delChange', 'infoChange', 'submitChange', 'enableChange', 'deactivateChange', 'bindProjectChange']);
const data = ref(props.data); const data = ref(props.data);
console.log(props, 'props'); console.log(props, 'props');
@ -76,8 +82,8 @@
emits('delChange', data); emits('delChange', data);
}; };
const info = () => { const info = () => {
emits('infoChange',data) emits('infoChange', data);
} };
watch( watch(
() => props.data, () => props.data,
(newVal) => { (newVal) => {
@ -85,21 +91,28 @@
} }
); );
const submit = () => { const submit = () => {
emits('submitChange',data) emits('submitChange', data);
} };
const enable = () => { const enable = () => {
emits('enableChange',data) emits('enableChange', data);
} };
const deactivate = () => { const deactivate = () => {
emits('deactivateChange',data) emits('deactivateChange', data);
} };
const goTo = (id) => { const goTo = async() => {
router.push('/compp/annualcompaward'); console.log(data);
}
const res = await bingProjectApi({ id: data.value.id });
console.log(res.records[0]);
const form = res.records ? res.records[0] : {};
router.push('/compp/annualcompaward?acpid=' + form.id);
};
//
// //
const bindProject = (id) => { const bindProject = (id) => {
emits('bindProjectChange',id) emits('bindProjectChange', id);
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -107,7 +120,6 @@
padding: 0 !important; padding: 0 !important;
} }
.setting-item { .setting-item {
text-align: center; text-align: center;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;

@ -54,6 +54,7 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AnnualCompAward.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AnnualCompAward.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
const route = useRoute()
const checkedKeys = ref<Array<string | number>>([]); const checkedKeys = ref<Array<string | number>>([]);
//model //model
@ -73,6 +74,9 @@
fieldMapToNumber: [], fieldMapToNumber: [],
fieldMapToTime: [], fieldMapToTime: [],
}, },
beforeFetch: (params) => {
return Object.assign(params, {acpid:route.query.acpid});
},
actionColumn: { actionColumn: {
width: 120, width: 120,
fixed: 'right', fixed: 'right',
@ -89,7 +93,6 @@
}); });
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext; const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
const route = useRoute()
/** /**
* 新增事件 * 新增事件
*/ */

Loading…
Cancel
Save