refactor: 统一确认弹窗调用并优化开发代理配置
parent
177cf37c1f
commit
0ec301cfb3
|
|
@ -38,24 +38,21 @@ async function handleUpdatePublicStatusChange(
|
||||||
row: AiImageApi.Image,
|
row: AiImageApi.Image,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
const text = newStatus ? '公开' : '私有';
|
const text = newStatus ? '公开' : '私有';
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要将该图片切换为【${text}】吗?`,
|
content: `确认要将该图片切换为【${text}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新图片状态
|
return false;
|
||||||
await updateImage({
|
}
|
||||||
id: row.id,
|
// 更新图片状态
|
||||||
publicStatus: newStatus,
|
await updateImage({
|
||||||
});
|
id: row.id,
|
||||||
// 提示并返回成功
|
publicStatus: newStatus,
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -76,24 +76,21 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: AiKnowledgeDocumentApi.KnowledgeDocument,
|
row: AiKnowledgeDocumentApi.KnowledgeDocument,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${row.name}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
content: `你要将${row.name}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新文档状态
|
return false;
|
||||||
await updateKnowledgeDocumentStatus({
|
}
|
||||||
id: row.id,
|
// 更新文档状态
|
||||||
status: newStatus,
|
await updateKnowledgeDocumentStatus({
|
||||||
});
|
id: row.id,
|
||||||
// 提示并返回成功
|
status: newStatus,
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -64,21 +64,18 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: AiKnowledgeSegmentApi.KnowledgeSegment,
|
row: AiKnowledgeSegmentApi.KnowledgeSegment,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将片段 ${row.id} 的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
content: `你要将片段 ${row.id} 的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新片段状态
|
return false;
|
||||||
await updateKnowledgeSegmentStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新片段状态
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
await updateKnowledgeSegmentStatus(row.id!, newStatus);
|
||||||
resolve(true);
|
// 提示并返回成功
|
||||||
})
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -38,24 +38,21 @@ async function handleUpdatePublicStatusChange(
|
||||||
row: AiMusicApi.Music,
|
row: AiMusicApi.Music,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
const text = newStatus ? '公开' : '私有';
|
const text = newStatus ? '公开' : '私有';
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要将该音乐切换为【${text}】吗?`,
|
content: `确认要将该音乐切换为【${text}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新音乐状态
|
return false;
|
||||||
await updateMusic({
|
}
|
||||||
id: row.id,
|
// 更新音乐状态
|
||||||
publicStatus: newStatus,
|
await updateMusic({
|
||||||
});
|
id: row.id,
|
||||||
// 提示并返回成功
|
publicStatus: newStatus,
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -74,28 +74,24 @@ async function handleDeleteContactBusinessList() {
|
||||||
message.error('请先选择商机后操作!');
|
message.error('请先选择商机后操作!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`,
|
content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
const res = await deleteContactBusinessList({
|
return false;
|
||||||
contactId: props.bizId,
|
}
|
||||||
businessIds: checkedRows.value.map((item) => item.id),
|
const res = await deleteContactBusinessList({
|
||||||
});
|
contactId: props.bizId,
|
||||||
if (res) {
|
businessIds: checkedRows.value.map((item) => item.id),
|
||||||
// 提示并返回成功
|
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
|
||||||
handleRefresh();
|
|
||||||
resolve(true);
|
|
||||||
} else {
|
|
||||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
if (!res) {
|
||||||
|
throw new Error($t('ui.actionMessage.operationFailed'));
|
||||||
|
}
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
handleRefresh();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查看商机详情 */
|
/** 查看商机详情 */
|
||||||
|
|
|
||||||
|
|
@ -71,28 +71,24 @@ async function handleDeleteContactBusinessList() {
|
||||||
message.error('请先选择联系人后操作!');
|
message.error('请先选择联系人后操作!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`,
|
content: `确定要将${checkedRows.value.map((item) => item.name).join(',')}解除关联吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
const res = await deleteBusinessContactList({
|
return false;
|
||||||
businessId: props.bizId,
|
}
|
||||||
contactIds: checkedRows.value.map((item) => item.id),
|
const res = await deleteBusinessContactList({
|
||||||
});
|
businessId: props.bizId,
|
||||||
if (res) {
|
contactIds: checkedRows.value.map((item) => item.id),
|
||||||
// 提示并返回成功
|
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
|
||||||
handleRefresh();
|
|
||||||
resolve(true);
|
|
||||||
} else {
|
|
||||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
if (!res) {
|
||||||
|
throw new Error($t('ui.actionMessage.operationFailed'));
|
||||||
|
}
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
handleRefresh();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 创建商机联系人关联 */
|
/** 创建商机联系人关联 */
|
||||||
|
|
|
||||||
|
|
@ -94,32 +94,28 @@ function handleEdit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除团队成员 */
|
/** 删除团队成员 */
|
||||||
function handleDelete() {
|
async function handleDelete() {
|
||||||
if (checkedRows.value.length === 0) {
|
if (checkedRows.value.length === 0) {
|
||||||
message.error('请先选择团队成员后操作!');
|
message.error('请先选择团队成员后操作!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${checkedRows.value.map((item) => item.nickname).join(',')}移出团队吗?`,
|
content: `你要将${checkedRows.value.map((item) => item.nickname).join(',')}移出团队吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
const res = await deletePermissionBatch(
|
return false;
|
||||||
checkedRows.value.map((item) => item.id!),
|
}
|
||||||
);
|
const res = await deletePermissionBatch(
|
||||||
if (res) {
|
checkedRows.value.map((item) => item.id!),
|
||||||
// 提示并返回成功
|
);
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
if (!res) {
|
||||||
handleRefresh();
|
throw new Error('移出失败');
|
||||||
resolve(true);
|
}
|
||||||
} else {
|
// 提示并返回成功
|
||||||
reject(new Error('移出失败'));
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
}
|
handleRefresh();
|
||||||
})
|
return true;
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 退出团队 */
|
/** 退出团队 */
|
||||||
|
|
|
||||||
|
|
@ -65,23 +65,20 @@ async function handleDefaultStatusChange(
|
||||||
newStatus: boolean,
|
newStatus: boolean,
|
||||||
row: ErpAccountApi.Account,
|
row: ErpAccountApi.Account,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
const text = newStatus ? '设置' : '取消';
|
||||||
const text = newStatus ? '设置' : '取消';
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要${text}"${row.name}"默认吗?`,
|
content: `确认要${text}"${row.name}"默认吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新默认状态
|
return false;
|
||||||
await updateAccountDefaultStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新默认状态
|
||||||
message.success(`${text}默认成功`);
|
await updateAccountDefaultStatus(row.id!, newStatus);
|
||||||
handleRefresh();
|
// 提示并返回成功
|
||||||
resolve(true);
|
message.success(`${text}默认成功`);
|
||||||
})
|
handleRefresh();
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -63,23 +63,20 @@ async function handleDefaultStatusChange(
|
||||||
newStatus: boolean,
|
newStatus: boolean,
|
||||||
row: ErpWarehouseApi.Warehouse,
|
row: ErpWarehouseApi.Warehouse,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
const text = newStatus ? '设置' : '取消';
|
||||||
const text = newStatus ? '设置' : '取消';
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要${text}"${row.name}"默认吗?`,
|
content: `确认要${text}"${row.name}"默认吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新默认状态
|
return false;
|
||||||
await updateWarehouseDefaultStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新默认状态
|
||||||
message.success(`${text}默认成功`);
|
await updateWarehouseDefaultStatus(row.id!, newStatus);
|
||||||
handleRefresh();
|
// 提示并返回成功
|
||||||
resolve(true);
|
message.success(`${text}默认成功`);
|
||||||
})
|
handleRefresh();
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
const [FormModal, formModalApi] = useVbenModal({
|
||||||
|
|
|
||||||
|
|
@ -63,25 +63,22 @@ async function handleStatusChange(
|
||||||
newStatus: boolean,
|
newStatus: boolean,
|
||||||
row: MallCommentApi.Comment,
|
row: MallCommentApi.Comment,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
const text = newStatus ? '展示' : '隐藏';
|
||||||
const text = newStatus ? '展示' : '隐藏';
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要${text}该评论吗?`,
|
content: `确认要${text}该评论吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新状态
|
return false;
|
||||||
await updateCommentVisible({
|
}
|
||||||
id: row.id!,
|
// 更新状态
|
||||||
visible: newStatus,
|
await updateCommentVisible({
|
||||||
});
|
id: row.id!,
|
||||||
// 提示并返回成功
|
visible: newStatus,
|
||||||
message.success(`${text}成功`);
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success(`${text}成功`);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -60,21 +60,18 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: MallCouponTemplateApi.CouponTemplate,
|
row: MallCouponTemplateApi.CouponTemplate,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${row.name}的状态切换为【${newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'}】吗?`,
|
content: `你要将${row.name}的状态切换为【${newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用'}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新优惠券模板状态
|
return false;
|
||||||
await updateCouponTemplateStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新优惠券模板状态
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
await updateCouponTemplateStatus(row.id!, newStatus);
|
||||||
resolve(true);
|
// 提示并返回成功
|
||||||
})
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -59,23 +59,20 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: MallSeckillConfigApi.SeckillConfig,
|
row: MallSeckillConfigApi.SeckillConfig,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
// 二次确认
|
||||||
// 二次确认
|
const text = row.status === 0 ? '启用' : '停用';
|
||||||
const text = row.status === 0 ? '启用' : '停用';
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要${text + row.name}吗?`,
|
content: `确认要${text + row.name}吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新状态
|
return false;
|
||||||
await updateSeckillConfigStatus(row.id, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新状态
|
||||||
message.success(`${text}成功`);
|
await updateSeckillConfigStatus(row.id, newStatus);
|
||||||
resolve(true);
|
// 提示并返回成功
|
||||||
})
|
message.success(`${text}成功`);
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -87,26 +87,23 @@ async function handleBrokerageEnabledChange(
|
||||||
newEnabled: boolean,
|
newEnabled: boolean,
|
||||||
row: MallBrokerageUserApi.BrokerageUser,
|
row: MallBrokerageUserApi.BrokerageUser,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
const text = newEnabled ? '开通' : '关闭';
|
||||||
const text = newEnabled ? '开通' : '关闭';
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${row.nickname}的推广资格切换为【${text}】吗?`,
|
content: `你要将${row.nickname}的推广资格切换为【${text}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新推广资格
|
return false;
|
||||||
await updateBrokerageEnabled({
|
}
|
||||||
id: row.id!,
|
// 更新推广资格
|
||||||
enabled: newEnabled,
|
await updateBrokerageEnabled({
|
||||||
});
|
id: row.id!,
|
||||||
// 提示并返回成功
|
enabled: newEnabled,
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
|
||||||
handleRefresh();
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
handleRefresh();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -65,25 +65,22 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: PayAppApi.App,
|
row: PayAppApi.App,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
const text = newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用';
|
||||||
const text = newStatus === CommonStatusEnum.ENABLE ? '启用' : '停用';
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `确认要${text + row.name}应用吗?`,
|
content: `确认要${text + row.name}应用吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新状态
|
return false;
|
||||||
await updateAppStatus({
|
}
|
||||||
id: row.id!,
|
// 更新状态
|
||||||
status: newStatus,
|
await updateAppStatus({
|
||||||
});
|
id: row.id!,
|
||||||
// 提示并返回成功
|
status: newStatus,
|
||||||
message.success(`${text}成功`);
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
// 提示并返回成功
|
||||||
|
message.success(`${text}成功`);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成渠道配置按钮 */
|
/** 生成渠道配置按钮 */
|
||||||
|
|
|
||||||
|
|
@ -138,21 +138,18 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: SystemUserApi.User,
|
row: SystemUserApi.User,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新用户状态
|
return false;
|
||||||
await updateUserStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新用户状态
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
await updateUserStatus(row.id!, newStatus);
|
||||||
resolve(true);
|
// 提示并返回成功
|
||||||
})
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -138,21 +138,18 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: SystemUserApi.User,
|
row: SystemUserApi.User,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新用户状态
|
return false;
|
||||||
await updateUserStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新用户状态
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
await updateUserStatus(row.id!, newStatus);
|
||||||
resolve(true);
|
// 提示并返回成功
|
||||||
})
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
|
|
@ -139,21 +139,18 @@ async function handleStatusChange(
|
||||||
newStatus: number,
|
newStatus: number,
|
||||||
row: SystemUserApi.User,
|
row: SystemUserApi.User,
|
||||||
): Promise<boolean | undefined> {
|
): Promise<boolean | undefined> {
|
||||||
return new Promise((resolve, reject) => {
|
try {
|
||||||
confirm({
|
await confirm({
|
||||||
content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
content: `你要将${row.username}的状态切换为【${getDictLabel(DICT_TYPE.COMMON_STATUS, newStatus)}】吗?`,
|
||||||
})
|
});
|
||||||
.then(async () => {
|
} catch {
|
||||||
// 更新用户状态
|
return false;
|
||||||
await updateUserStatus(row.id!, newStatus);
|
}
|
||||||
// 提示并返回成功
|
// 更新用户状态
|
||||||
message.success($t('ui.actionMessage.operationSuccess'));
|
await updateUserStatus(row.id!, newStatus);
|
||||||
resolve(true);
|
// 提示并返回成功
|
||||||
})
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
.catch(() => {
|
return true;
|
||||||
reject(new Error('取消操作'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue