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

修改工作区

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