Zhenxing.Lu vor 16 Stunden
Ursprung
Commit
9d0902888e

+ 31 - 0
src/views/wechat/batch_msg/batchMsg.data.ts

@@ -77,6 +77,18 @@ export const columns: BasicColumn[] = [
       return formatToDateTime(record.createdAt);
     },
   },
+  {
+    title: '微信类型',
+    dataIndex: 'ctype',
+    width: 120,
+    customRender: ({ record }) => {
+      const typeMap = {
+        1: '个微',
+        3: '企微'
+      };
+      return typeMap[record.ctype] || '-';
+    }
+  },
 ];
 
 export const searchFormSchema: FormSchema[] = [
@@ -98,6 +110,25 @@ export const searchFormSchema: FormSchema[] = [
     component: 'Input',
     colProps: { span: 8 },
   },
+  {
+    field: 'ctype',
+    label: '微信类型',
+    component: 'Select',
+    defaultValue: 1,
+    componentProps: {
+      options: [
+        {
+          label: '个微',
+          value: 1,
+        },
+        {
+          label: '企微',
+          value: 3,
+        },
+      ],
+    },
+    colProps: { span: 8 },
+  },
 ];
 
 export const formSchema: FormSchema[] = [

+ 54 - 24
src/views/wechat/batch_msg/components/userPhasesDrawer.vue

@@ -34,6 +34,21 @@
                 show-count
               />
             </FormItem>
+            <FormItem
+              label="微信类型"
+              name="ctype"
+              :rules="[{ required: true, message: '请选择微信类型' }]"
+            >
+              <Select
+                :disabled="btnDisabled"
+                v-model:value="form.ctype"
+                placeholder="请选择微信类型"
+                @change="handleCtypeChange"
+              >
+                <SelectOption :value="1">个微</SelectOption>
+                <SelectOption :value="3">企微</SelectOption>
+              </Select>
+            </FormItem>
             <FormItem label="发送账号" name="wxid" :rules="[{ required: true, message: '请选择' }]">
               <Select
                 :disabled="btnDisabled"
@@ -209,6 +224,7 @@
   const form = reactive({
     taskName: '',
     wxid: '',
+    ctype: 1,
     conditionOperator: '1',
     startTimeStr: '',
     labels: [],
@@ -224,6 +240,7 @@
     taskName: '',
     conditionOperator: '1',
     wxid: '',
+    ctype: 1,
     startTimeStr: '',
     labels: [],
     groupLabels: [],
@@ -240,20 +257,12 @@
     loading.value = true;
     try {
       let res = await getLabelSelectList({ page: 1, pageSize: 1000, type: 1 });
-      // actionLabel.value = res.data.map((item) => ({
-      //   label: item.label,
-      //   value: item.label,
-      // }));
       actionLabel.value = res.data;
       let res1 = await getLabelSelectList({ page: 1, pageSize: 1000, type: 2 });
       actionLabelGroup.value = res1.data;
-      const result = await getWxList({ page: 1, pageSize: 50 });
-      if (result.code == 0) {
-        accountList.value = result.data.data.map((item) => ({
-          label: item.nickname,
-          value: item.wxid,
-        }));
-      }
+      
+      await loadAccountList(form.ctype);
+
       if (unref(msgId)) {
         await getBatchDetail(unref(msgId));
         btnDisabled.value = true;
@@ -265,7 +274,7 @@
     } catch (error) {
       console.error('初始化失败:', error);
     } finally {
-      loading.value = false; // 数据加载完成,关闭 loading
+      loading.value = false;
     }
   });
 
@@ -390,6 +399,7 @@
       let parsedDate = dayjs(data.data.startTimeStr, 'YYYY-MM-DD HH:mm');
       Object.assign(form, {
         taskName: data.data.taskName,
+        ctype: data.data.ctype || 1,
         wxid: data.data.fromwxid,
         conditionOperator: data.data.sendTime !== null ? '2' : '1',
         labels,
@@ -502,6 +512,26 @@
       Object.assign(initialTaskForm, { ...taskForm });
     }
   });
+
+  async function handleCtypeChange(value: number) {
+    form.wxid = '';
+    await loadAccountList(value);
+  }
+
+  async function loadAccountList(ctype: number) {
+    try {
+      const result = await getWxList({ page: 1, pageSize: 50, ctype });
+      if (result.code == 0) {
+        accountList.value = result.data.data?.map((item) => ({
+          label: item.nickname,
+          value: item.wxid,
+        })) || [];
+      }
+    } catch (error) {
+      console.error('加载账号列表失败:', error);
+      accountList.value = [];
+    }
+  }
 </script>
 <style scoped lang="less">
   .user-phase-drawer {
@@ -514,15 +544,15 @@
   }
 
   .steps-action {
-    margin-top: 20px;
     display: flex;
     justify-content: flex-end;
+    margin-top: 20px;
     gap: 10px;
   }
 
   .step-style {
-    margin: 0 auto;
     width: 60%;
+    margin: 0 auto;
   }
 
   .custom-step .ant-steps-item-title {
@@ -530,29 +560,29 @@
   }
 
   .loading-style {
-    width: 100%;
-    height: 100%;
-    z-index: 10;
+    display: flex;
     position: fixed !important;
+    z-index: 10;
     top: 0;
     left: 0;
-    background: rgba(255, 255, 255, 0.7);
-    display: flex;
     flex-direction: column;
-    justify-content: center;
     align-items: center;
+    justify-content: center;
+    width: 100%;
+    height: 100%;
+    background: rgb(255 255 255 / 70%);
   }
 
   .ant-spin-nested-loading > div > .ant-spin {
     max-height: 100% !important;
-    background: rgba(255, 255, 255, 0.7);
+    background: rgb(255 255 255 / 70%);
   }
 
   .warning-style {
-    color: #ff4949;
-    font-size: 12px;
-    margin-left: -240px;
     position: absolute;
     bottom: -20px;
+    margin-left: -240px;
+    color: #ff4949;
+    font-size: 12px;
   }
 </style>

+ 11 - 6
src/views/wechat/batch_msg/index.vue

@@ -60,6 +60,11 @@ const [registerTable, { reload }] = useTable({
   formConfig: {
     labelWidth: 120,
     schemas: searchFormSchema,
+    autoSubmitOnEnter: true,
+    submitOnReset: true,
+    defaultFormValues: {
+      ctype: 1,
+    },
   },
   useSearchForm: true,
   showTableSetting: true,
@@ -226,16 +231,16 @@ function getActions(record: Recordable) {
 </script>
 <style scoped lang="less">
 .spin-style {
-  width: 100%;
-  height: 100%;
-  z-index: 1;
+  display: flex;
   position: fixed;
+  z-index: 1;
   top: 0;
   left: 0;
-  background: rgba(255, 255, 255, 0.7);
-  display: flex;
   flex-direction: column;
-  justify-content: center;
   align-items: center;
+  justify-content: center;
+  width: 100%;
+  height: 100%;
+  background: rgb(255 255 255 / 70%);
 }
 </style>

+ 1 - 0
src/views/wechat/contact/contact.data.ts

@@ -172,6 +172,7 @@ export const searchFormSchema: FormSchema[] = [
     field: 'ctype',
     label: '微信类型',
     component: 'Select',
+    defaultValue: 1,
     componentProps: {
       options: [
         {

+ 1 - 0
src/views/wechat/wx/index.vue

@@ -417,6 +417,7 @@
         field: 'ctype',
         label: '微信类型',
         component: 'Select',
+        defaultValue: 1,
         componentProps: {
           options: [
             {

+ 20 - 1
src/views/wechat/wx/wx.data.ts

@@ -102,7 +102,7 @@ export const columns: BasicColumn[] = [
   },
 ]
 
- export const searchFormSchema: FormSchema[] = [
+export const searchFormSchema: FormSchema[] = [
   {
     field: 'serverId',
     label: '服务器名称',
@@ -137,6 +137,25 @@ export const columns: BasicColumn[] = [
     component: 'Input',
     colProps: { span: 8 },
   },
+  {
+    field: 'ctype',
+    label: '微信类型',
+    component: 'Select',
+    defaultValue: 1,
+    componentProps: {
+      options: [
+        {
+          label: '个微',
+          value: 1,
+        },
+        {
+          label: '企微',
+          value: 3,
+        },
+      ],
+    },
+    colProps: { span: 8 },
+  },
 ]
 
 export const formSchema: FormSchema[] = [