浏览代码

refactor(message): 优化消息提示框的样式和内容

- 在多个组件中更新了 ElMessage.success 的调用方式,增加了 plain 和 icon 参数
- 调整了部分提示信息的文案,使其更加简洁明了
- 统一了创建成功提示框的样式,增加了 CirclePlus 图标
- 在产品监控操作中,根据不同操作状态显示相应的提示信息和图标
WanGxC 9 月之前
父节点
当前提交
801b704025

+ 1 - 1
src/views/product-manage/comment-detail/component/CreateDialog.vue

@@ -107,7 +107,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
 			};
 			const res = await useResponse(api.createComment, body, loading);
 			if (res.code === 2000) {
-				ElMessage.success('创建成功');
+        ElMessage.success({ message: '创建成功', plain: true, icon: 'CirclePlus' });
 				createOpen.value = false;
 				emit('refresh');
 			}

+ 1 - 1
src/views/product-manage/comment-detail/component/CreateLabelDialog.vue

@@ -47,7 +47,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
 			};
 			const res = await useResponse(api.createNegativeTags, body, loading);
 			if (res.code === 2000) {
-				ElMessage.success('创建成功');
+        ElMessage.success({ message: '创建成功', plain: true, icon: 'CirclePlus' });
 				createOpen.value = false;
 				emit('refresh');
 			}

+ 1 - 1
src/views/product-manage/competitor-monitor/component/CreateDialog.vue

@@ -67,7 +67,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
 			};
 			const res = await useResponse(api.createCompetitorMonitor, body, loading);
 			if (res.code === 2000) {
-				ElMessage.success('创建成功');
+        ElMessage.success({ message: '创建成功', plain: true, icon: 'CirclePlus' });
 				createOpen.value = false;
 				emit('refresh');
 			}

+ 2 - 2
src/views/product-manage/product-list/component/DataTable.vue

@@ -193,7 +193,7 @@ async function switchMonitor(row: any) {
   const res = await useResponse(api.postMonitor, { ids: [ row.id ], status: row.is_monitor ? 1 : 0 });
   if (res && res.code === 2000) {
     // 根据 row.is_monitor 的值显示不同的提示信息
-    const message = row.is_monitor ? '已开启!' : '已关闭!';
+    const message = row.is_monitor ? '已开启' : '已关闭';
     if (row.is_monitor) {
       ElMessage.success({ message, plain: true, icon: 'Open' });
     } else {
@@ -210,7 +210,7 @@ async function batchOpen() {
   const ids = Array.from(checkedList.value);
   const res = await useResponse(api.postMonitor, { ids, status: 1 }, btnLoading);
   if (res && res.code === 2000) {
-    ElMessage.success('操作成功!');
+    ElMessage.success({ message: '选中项已开启', plain: true, icon: 'Open' });
   }
   checkedList.value.clear();
   await fetchList();

+ 1 - 1
src/views/product-manage/product-monitor/component/CreateDialog.vue

@@ -72,7 +72,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
 			};
 			const res = await useResponse(api.createProductMonitor, body, loading);
 			if (res.code === 2000){
-				ElMessage.success('创建成功');
+        ElMessage.success({ message: '创建成功', plain: true, icon: 'CirclePlus' });
 				createOpen.value = false;
 				emit('refresh');
 			}

+ 1 - 1
src/views/sku-manage/product-category/component/AttributeManageCreate.vue

@@ -55,7 +55,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
       };
       const res = await useResponse(api.createProductAttr, body, loading);
       if (res.code === 2000) {
-        ElMessage.success('创建成功');
+        ElMessage.success({ message: '创建成功', plain: true, icon: 'CirclePlus' });
         createDialog.value.visible = false;
         emit('refresh');
       }