Commit 7e03dad4 authored by 罗林杰's avatar 罗林杰

修改工作区

parent 4d9efe44
...@@ -33,18 +33,19 @@ ...@@ -33,18 +33,19 @@
}, },
}); });
//初始化弹框 //初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields(); resetFields();
isUpdate.value = !!data?.isUpdate;
}); });
const getTitle = computed(() => '新增用户'); const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户'));
async function handleSubmit() { async function handleSubmit() {
try { try {
const values = await validate(); const values = await validate();
setModalProps({ confirmLoading: true }); setModalProps({ confirmLoading: true });
if (unref(isUpdate)) { if (unref(isUpdate)) {
createMessage.success('新增成功'); createMessage.success('编辑成功');
closeModal(); closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } }); emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} else { } else {
......
...@@ -33,18 +33,19 @@ ...@@ -33,18 +33,19 @@
}, },
}); });
//初始化弹框 //初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields(); resetFields();
isUpdate.value = !!data?.isUpdate;
}); });
const getTitle = computed(() => '新增用户'); const getTitle = computed(() => (!unref(isUpdate) ? '新增工作组' : '编辑工作组'));
async function handleSubmit() { async function handleSubmit() {
try { try {
const values = await validate(); const values = await validate();
setModalProps({ confirmLoading: true }); setModalProps({ confirmLoading: true });
if (unref(isUpdate)) { if (unref(isUpdate)) {
createMessage.success('新增成功'); createMessage.success('编辑成功');
closeModal(); closeModal();
emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } }); emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
} else { } else {
......
...@@ -170,6 +170,8 @@ ...@@ -170,6 +170,8 @@
<GroupTree class="w-1/4 xl:w-1/5" @select="handleSelect" /> <GroupTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-2/4 xl:w-4/5" :searchInfo="searchInfo"> <BasicTable @register="registerTable" class="w-2/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleDelete">删除</a-button>
<a-button type="primary" @click="editGroup">编辑</a-button>
<a-button type="primary" @click="handleCreate">添加用户</a-button> <a-button type="primary" @click="handleCreate">添加用户</a-button>
<a-button type="primary" @click="handleApproval">审批配置</a-button> <a-button type="primary" @click="handleApproval">审批配置</a-button>
</template> </template>
...@@ -177,6 +179,10 @@ ...@@ -177,6 +179,10 @@
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{ {
color: 'error', color: 'error',
label: '删除', label: '删除',
...@@ -231,7 +237,7 @@ ...@@ -231,7 +237,7 @@
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>); const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
const tableData = ref([]); const tableData = ref([]);
const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo, getForm }] = useTable({
title: '工作组列表', title: '用户列表',
api: async () => { api: async () => {
const response = { const response = {
pageNu: '1', pageNu: '1',
...@@ -338,7 +344,6 @@ ...@@ -338,7 +344,6 @@
reload(); reload();
} }
} }
function handleView(record: Recordable) {}
/** 新增按钮*/ /** 新增按钮*/
function handleCreate() { function handleCreate() {
openModal(true, { openModal(true, {
...@@ -350,6 +355,11 @@ ...@@ -350,6 +355,11 @@
isUpdate: false, isUpdate: false,
}); });
} }
function editGroup() {
openAddGroupModal(true, {
isUpdate: false,
});
}
function handleApproval() { function handleApproval() {
openApprovalModal(true); openApprovalModal(true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment