feat:【antd】【crm】团队成员的代码实现

This commit is contained in:
YunaiV
2025-09-30 22:23:54 +08:00
parent 5eec2050a9
commit cdc0cbc431
7 changed files with 20 additions and 15 deletions

View File

@@ -34,6 +34,7 @@ function getUserTypeColor(userType: number) {
</script>
<template>
<div>
<!-- TODO @xingyu有没可能美化下 -->
<Timeline>
<Timeline.Item
v-for="log in logList"

View File

@@ -30,7 +30,6 @@ const [FormModal, formModalApi] = useVbenModal({
destroyOnClose: true,
});
/** 已选择的商机 */
const checkedRows = ref<CrmBusinessApi.Business[]>([]);
function setCheckedRows({ records }: { records: CrmBusinessApi.Business[] }) {
checkedRows.value = records;

View File

@@ -46,7 +46,6 @@ const [DetailListModal, detailListModalApi] = useVbenModal({
destroyOnClose: true,
});
/** 已选择的商机 */
const checkedRows = ref<CrmBusinessApi.Business[]>([]);
function setCheckedRows({ records }: { records: CrmBusinessApi.Business[] }) {
checkedRows.value = records;

View File

@@ -1,2 +1,2 @@
export { default as PermissionList } from './modules/permission-list.vue';
export { default as PermissionList } from './modules/list.vue';
export { default as TransferForm } from './modules/transfer-form.vue';

View File

@@ -19,7 +19,7 @@ import {
import { $t } from '#/locales';
import { useGridColumns } from './data';
import Form from './permission-form.vue';
import Form from './form.vue';
const props = defineProps<{
bizId: number; //
@@ -38,13 +38,14 @@ const [FormModal, formModalApi] = useVbenModal({
destroyOnClose: true,
});
//
const validateOwnerUser = ref(false);
const validateWrite = ref(false);
const isPool = ref(false);
const userStore = useUserStore();
const validateOwnerUser = ref(false); //
const validateWrite = ref(false); //
const isPool = ref(false); //
/** 刷新表格 */
function onRefresh() {
function handleRefresh() {
gridApi.query();
}
@@ -62,6 +63,7 @@ function setCheckedRows({
checkedRows.value = records;
}
/** 新建团队成员 */
function handleCreate() {
formModalApi
.setData({
@@ -71,6 +73,7 @@ function handleCreate() {
.open();
}
/** 编辑团队成员 */
function handleEdit() {
if (checkedRows.value.length === 0) {
message.error('请先选择团队成员后操作!');
@@ -90,6 +93,7 @@ function handleEdit() {
.open();
}
/** 删除团队成员 */
function handleDelete() {
if (checkedRows.value.length === 0) {
message.error('请先选择团队成员后操作!');
@@ -106,7 +110,7 @@ function handleDelete() {
if (res) {
//
message.success($t('ui.actionMessage.operationSuccess'));
onRefresh();
handleRefresh();
resolve(true);
} else {
reject(new Error('移出失败'));
@@ -118,8 +122,7 @@ function handleDelete() {
});
}
const userStore = useUserStore();
/** 退出团队 */
async function handleQuit() {
const permission = gridApi.grid
.getData()
@@ -208,6 +211,7 @@ watch(
}
});
} else {
//
isPool.value = true;
}
},
@@ -219,7 +223,7 @@ watch(
<template>
<div>
<FormModal @success="onRefresh" />
<FormModal @success="handleRefresh" />
<Grid>
<template #toolbar-tools>
<TableAction
@@ -237,6 +241,7 @@ watch(
icon: ACTION_ICON.EDIT,
ifShow: validateOwnerUser,
onClick: handleEdit,
disabled: checkedRows.length === 0,
},
{
label: $t('common.delete'),
@@ -245,6 +250,7 @@ watch(
icon: ACTION_ICON.DELETE,
ifShow: validateOwnerUser,
onClick: handleDelete,
disabled: checkedRows.length === 0,
},
{
label: '退出团队',

View File

@@ -99,7 +99,7 @@ const [Modal, modalApi] = useVbenModal({
},
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formApi.resetForm();
await formApi.resetForm();
return;
}
// 加载数据
@@ -108,7 +108,7 @@ const [Modal, modalApi] = useVbenModal({
return;
}
bizType.value = data.bizType;
formApi.setFieldValue('id', data.bizType);
await formApi.setFieldValue('id', data.bizType);
},
});
</script>