|
|
|
@ -3,10 +3,14 @@ |
|
|
|
|
<div class="item"> |
|
|
|
|
<div class="status-setting"> |
|
|
|
|
<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"> |
|
|
|
|
<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> |
|
|
|
|
<p class="setting-item" @click="edit">编辑</p> |
|
|
|
|
<p class="setting-item" @click="del">删除</p> |
|
|
|
@ -32,10 +36,10 @@ |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
<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-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="left" |
|
|
|
@ -56,6 +60,8 @@ |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { watch, ref } from 'vue'; |
|
|
|
|
import SvgIcon from '/@/components/Icon/src/SvgIcon.vue'; |
|
|
|
|
import { bingProjectApi } from '../AnnualComp.api'; |
|
|
|
|
|
|
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
|
const router = useRouter(); |
|
|
|
|
const props = defineProps({ |
|
|
|
@ -64,7 +70,7 @@ |
|
|
|
|
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); |
|
|
|
|
console.log(props, 'props'); |
|
|
|
|
|
|
|
|
@ -76,8 +82,8 @@ |
|
|
|
|
emits('delChange', data); |
|
|
|
|
}; |
|
|
|
|
const info = () => { |
|
|
|
|
emits('infoChange',data) |
|
|
|
|
} |
|
|
|
|
emits('infoChange', data); |
|
|
|
|
}; |
|
|
|
|
watch( |
|
|
|
|
() => props.data, |
|
|
|
|
(newVal) => { |
|
|
|
@ -85,21 +91,28 @@ |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
const submit = () => { |
|
|
|
|
emits('submitChange',data) |
|
|
|
|
} |
|
|
|
|
emits('submitChange', data); |
|
|
|
|
}; |
|
|
|
|
const enable = () => { |
|
|
|
|
emits('enableChange',data) |
|
|
|
|
} |
|
|
|
|
emits('enableChange', data); |
|
|
|
|
}; |
|
|
|
|
const deactivate = () => { |
|
|
|
|
emits('deactivateChange',data) |
|
|
|
|
} |
|
|
|
|
const goTo = (id) => { |
|
|
|
|
router.push('/compp/annualcompaward'); |
|
|
|
|
} |
|
|
|
|
emits('deactivateChange', data); |
|
|
|
|
}; |
|
|
|
|
const goTo = async() => { |
|
|
|
|
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) => { |
|
|
|
|
emits('bindProjectChange',id) |
|
|
|
|
} |
|
|
|
|
emits('bindProjectChange', id); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
@ -107,7 +120,6 @@ |
|
|
|
|
padding: 0 !important; |
|
|
|
|
} |
|
|
|
|
.setting-item { |
|
|
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
height: 30px; |
|
|
|
|
line-height: 30px; |
|
|
|
@ -115,7 +127,7 @@ |
|
|
|
|
margin: 0; |
|
|
|
|
} |
|
|
|
|
.setting-item:hover { |
|
|
|
|
color: #00c7be; |
|
|
|
|
color: #00c7be; |
|
|
|
|
} |
|
|
|
|
.item { |
|
|
|
|
width: 356px; |
|
|
|
|