| | |
| | | <a href="javascript:;">编辑</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a href="javascript:;">归档</a> |
| | | <a @click="editStatus(item)">归档</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a href="javascript:;">删除</a> |
| | | <a @click="deleteItem(item)">删除</a> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { DashOutlined, UserOutlined, ExportOutlined } from '@ant-design/icons-vue' |
| | | import { defineProps } from 'vue' |
| | | import { DashOutlined, UserOutlined, ExportOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue' |
| | | import { defineEmits, defineProps, createVNode } from 'vue' |
| | | import { status, projectCard } from './data' |
| | | import { del, edit } from '/@/api/project-page' |
| | | import { Modal, message } from 'ant-design-vue' |
| | | |
| | | const emit = defineEmits(['refreshList']) |
| | | const props = defineProps({ |
| | | cardList: { |
| | | type: Array as () => projectCard[], |
| | | required: true, |
| | | }, |
| | | }) |
| | | |
| | | // 删除方法 |
| | | const deleteItem = (item:projectCard) => { |
| | | Modal.confirm({ |
| | | title: () => '确认删除?', |
| | | icon: () => createVNode(ExclamationCircleOutlined), |
| | | content: () => '删除后项目内容将不可恢复,您确定要删除该项目吗?', |
| | | okText: () => '确定', |
| | | okType: 'danger', |
| | | cancelText: () => '取消', |
| | | onOk () { |
| | | del(item.id).then(res => { |
| | | if (res.code === 5000) { |
| | | message.success('删除成功') |
| | | emit('refreshList') |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | const editStatus = (item:projectCard) => { |
| | | Modal.confirm({ |
| | | title: () => '确认归档?', |
| | | icon: () => createVNode(ExclamationCircleOutlined), |
| | | content: () => '项目完成后可归档,归档后 Pilot 将无法加入该项目,您确定要归档该项目吗?', |
| | | okText: () => '确定', |
| | | okType: 'danger', |
| | | cancelText: () => '取消', |
| | | onOk () { |
| | | const obj = { id: item.id, projectStatus: 2 } |
| | | edit(obj).then(res => { |
| | | if (res.code === 5000) { |
| | | message.success('归档成功') |
| | | emit('refreshList') |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |