luzhenxing 1 hete
szülő
commit
fa6e365122

+ 21 - 3
src/views/whatsapp/whatsapp/whatsapp.data.ts

@@ -89,15 +89,33 @@ export const columns: BasicColumn[] = [
 export const searchFormSchema: FormSchema[] = [
   {
     ifShow: isSuper,
-    field: 'organizationName',
+    field: 'organizationId',
     label: t('whatsapp_channel.whatsappChannel.organizationName'),
-    component: 'Input',
+    component: 'ApiSelect',
+    componentProps: () => ({
+      api: (params) => getDepartmentList(params).then(response => {
+        return response.data.data.map((label) => ({
+          label: label.name,
+          value: label.id
+        }));
+      }),
+      params: { page: 1, pageSize: 1000, type: 1 },
+    }),
     colProps: { span: 8 },
   },
   {
     field: 'waName',
     label: t('whatsapp_channel.whatsappChannel.waName'),
-    component: 'Input',
+    component: 'ApiSelect',
+    componentProps: () => ({
+      api: (params) => getWhatsappChannelList(params).then(response => {
+        return response.data.data.map((label) => ({
+          label: label.waName,
+          value: label.waName
+        }));
+      }),
+      params: { page: 1, pageSize: 1000, type: 1 },
+    }),
     colProps: { span: 8 },
   },
   {

+ 29 - 4
src/views/whatsapp/whatsapp_channel/whatsappChannel.data.ts

@@ -5,6 +5,7 @@ import { updateWhatsappChannel } from '@/api/whatsapp_channel/whatsappChannel';
 import { Switch } from 'ant-design-vue';
 import { h } from 'vue';
 import { getDepartmentList } from '/@/api/sys/department';
+import { getWhatsappChannelList } from '@/api/whatsapp_channel/whatsappChannel';
 
 import { useUserStore } from '@/store/modules/user';
 const { t } = useI18n();
@@ -50,15 +51,33 @@ export const columns: BasicColumn[] = [
 export const searchFormSchema: FormSchema[] = [
   {
     ifShow: isSuper,
-    field: 'organizationName',
+    field: 'organizationId',
     label: t('whatsapp_channel.whatsappChannel.organizationName'),
-    component: 'Input',
+    component: 'ApiSelect',
+    componentProps: () => ({
+      api: (params) => getDepartmentList(params).then(response => {
+        return response.data.data.map((label) => ({
+          label: label.name,
+          value: label.id
+        }));
+      }),
+      params: { page: 1, pageSize: 1000, type: 1 },
+    }),
     colProps: { span: 8 },
   },
   {
     field: 'waName',
     label: t('whatsapp_channel.whatsappChannel.waName'),
-    component: 'Input',
+    component: 'ApiSelect',
+    componentProps: () => ({
+      api: (params) => getWhatsappChannelList(params).then(response => {
+        return response.data.data.map((label) => ({
+          label: label.waName,
+          value: label.waName
+        }));
+      }),
+      params: { page: 1, pageSize: 1000, type: 1 },
+    }),
     colProps: { span: 8 },
   },
   {
@@ -70,7 +89,13 @@ export const searchFormSchema: FormSchema[] = [
   {
     field: 'wabaId',
     label: t('whatsapp_channel.whatsappChannel.wabaId'),
-    component: 'Input',
+    component: 'InputNumber',
+    componentProps: {
+      style: {
+        width: '100%'
+      },
+      controls: false,
+    },
     colProps: { span: 8 },
   },
   {