luzhenxing 2 місяців тому
батько
коміт
51e9e4c910

+ 12 - 1
.vscode/settings.json

@@ -169,5 +169,16 @@
     ".eslintrc.cjs": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,.stylelintrc.*"
   },
   "terminal.integrated.scrollback": 10000,
-  "nuxt.isNuxtApp": false
+  "nuxt.isNuxtApp": false,
+  "terminal.integrated.defaultProfile.windows": "PowerShell",
+  "terminal.integrated.profiles.windows": {
+    "PowerShell": {
+      "path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
+      "icon": "terminal-powershell"
+    }
+  },
+  "terminal.integrated.fontFamily": "FiraCode Nerd Font",
+  "terminal.integrated.fontSize": 12,
+  "terminal.integrated.fontLigatures": true,
+  "powershell.powerShellPath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
 }

+ 13 - 13
src/locales/lang/zh-CN/wechat.ts

@@ -23,7 +23,7 @@ export default {
     addWx: '添加 Wx',
     editWx: '编辑 Wx',
     wxList: 'Wx 列表',
-    refreshWorkPhone: '同步工作手机'
+    refreshWorkPhone: '同步工作手机',
   },
   contact: {
     status: '状态',
@@ -136,11 +136,11 @@ export default {
     addToken: '添加 Token',
     editToken: '编辑 Token',
     tokenList: 'Token 列表',
-    agent:         'AI 角色',
+    agent: 'AI 角色',
     customAgentBase: '定制AI角色服务地址',
-    customAgentKey:  '定制AI角色服务密钥',
-    openaiBase:      '模型服务地址',
-    openaiKey:       '模型服务密钥',
+    customAgentKey: '定制AI角色服务密钥',
+    openaiBase: '模型服务地址',
+    openaiKey: '模型服务密钥',
     organizationName: '租户',
   },
   chatRecords: {
@@ -254,14 +254,14 @@ export default {
     dashboardList: 'Dashboard 列表',
   },
   labelTagging: {
-    status: 'Status',
-    organizationId: 'OrganizationId',
-    type: 'Type',
-    conditions: 'Conditions',
-    actionLabelAdd: 'ActionLabelAdd',
+    status: '状态',
+    organizationId: '租户id',
+    type: '类型',
+    conditions: '关键词',
+    actionLabelAdd: '标签',
     actionLabelDel: 'ActionLabelDel',
-    addLabelTagging: '添加 LabelTagging',
-    editLabelTagging: '编辑 LabelTagging',
-    labelTaggingList: 'LabelTagging 列表',
+    addLabelTagging: '添加 标签',
+    editLabelTagging: '编辑 标签',
+    labelTaggingList: '标签 列表',
   },
 };

+ 7 - 2
src/views/wechat/label_tagging/LabelTaggingDrawer.vue

@@ -45,14 +45,19 @@
   });
 
   const getTitle = computed(() =>
-    !unref(isUpdate) ? t('wechat.labelTagging.addLabelTagging') : t('wechat.labelTagging.editLabelTagging'),
+    !unref(isUpdate)
+      ? t('wechat.labelTagging.addLabelTagging')
+      : t('wechat.labelTagging.editLabelTagging'),
   );
 
   async function handleSubmit() {
     const values = await validate();
     setDrawerProps({ confirmLoading: true });
     values['id'] = unref(isUpdate) ? Number(values['id']) : 0;
-    let result = unref(isUpdate) ? await updateLabelTagging(values) : await createLabelTagging(values);
+    values['actionLabelAdd'] = [values['actionLabelAdd']];
+    let result = unref(isUpdate)
+      ? await updateLabelTagging(values)
+      : await createLabelTagging(values);
     if (result.code === 0) {
       closeDrawer();
       emit('success');

+ 2 - 2
src/views/wechat/label_tagging/index.vue

@@ -22,11 +22,11 @@
           <TableAction
             :actions="[
               {
-                icon: 'clarity:note-edit-line',
+                label: t('common.edit'),
                 onClick: handleEdit.bind(null, record),
               },
               {
-                icon: 'ant-design:delete-outlined',
+                label: t('common.delete'),
                 color: 'error',
                 popConfirm: {
                   title: t('common.deleteConfirm'),

+ 20 - 78
src/views/wechat/label_tagging/labelTagging.data.ts

@@ -1,24 +1,12 @@
 import { BasicColumn, FormSchema } from '@/components/Table';
 import { useI18n } from '@/hooks/web/useI18n';
 import { formatToDateTime } from '@/utils/dateUtil';
-import { updateLabelTagging } from '@/api/wechat/labelTagging';
-import { Switch } from 'ant-design-vue';
-import { h } from 'vue';
+import { getLabelList } from '/@/api/wechat/label';
 
 const { t } = useI18n();
 
 export const columns: BasicColumn[] = [
   {
-    title: t('wechat.labelTagging.organizationId'),
-    dataIndex: 'organizationId',
-    width: 100,
-  },
-  {
-    title: t('wechat.labelTagging.type'),
-    dataIndex: 'type',
-    width: 100,
-  },
-  {
     title: t('wechat.labelTagging.conditions'),
     dataIndex: 'conditions',
     width: 100,
@@ -29,38 +17,6 @@ export const columns: BasicColumn[] = [
     width: 100,
   },
   {
-    title: t('wechat.labelTagging.actionLabelDel'),
-    dataIndex: 'actionLabelDel',
-    width: 100,
-  },
-  {
-    title: t('common.status'),
-    dataIndex: 'status',
-    width: 50,
-    customRender: ({ record }) => {
-      if (!Reflect.has(record, 'pendingStatus')) {
-        record.pendingStatus = false;
-      }
-      return h(Switch, {
-        checked: record.status === 1,
-        checkedChildren: t('common.on'),
-        unCheckedChildren: t('common.off'),
-        loading: record.pendingStatus,
-        onChange(checked, _) {
-          record.pendingStatus = true;
-          const newStatus = checked ? 1 : 2;
-          updateLabelTagging({ id: record.id, status: newStatus })
-            .then(() => {
-              record.status = newStatus;
-            })
-            .finally(() => {
-              record.pendingStatus = false;
-            });
-        },
-      });
-    },
-  },
-  {
     title: t('common.createTime'),
     dataIndex: 'createdAt',
     width: 70,
@@ -70,8 +26,7 @@ export const columns: BasicColumn[] = [
   },
 ];
 
-export const searchFormSchema: FormSchema[] = [
-];
+export const searchFormSchema: FormSchema[] = [];
 
 export const formSchema: FormSchema[] = [
   {
@@ -81,45 +36,32 @@ export const formSchema: FormSchema[] = [
     show: false,
   },
   {
-    field: 'organizationId',
-    label: t('wechat.labelTagging.organizationId'),
-    component: 'InputNumber',
-    required: true,
-  },
-  {
-    field: 'type',
-    label: t('wechat.labelTagging.type'),
-    component: 'InputNumber',
-    required: true,
-  },
-  {
     field: 'conditions',
     label: t('wechat.labelTagging.conditions'),
-    component: 'Input',
+    component: 'InputTextArea',
+    componentProps: {
+      showCount: false,
+      autosize: {
+        minRows: 5,
+        maxRows: 10,
+      },
+    },
     required: true,
   },
   {
     field: 'actionLabelAdd',
     label: t('wechat.labelTagging.actionLabelAdd'),
-    component: 'Input',
-    required: true,
-  },
-  {
-    field: 'actionLabelDel',
-    label: t('wechat.labelTagging.actionLabelDel'),
-    component: 'Input',
-    required: true,
-  },
-  {
-    field: 'status',
-    label: t('wechat.labelTagging.status'),
-    component: 'RadioButtonGroup',
-    defaultValue: 1,
+    component: 'ApiSelect',
     componentProps: {
-      options: [
-        { label: t('common.on'), value: 1 },
-        { label: t('common.off'), value: 2 },
-      ],
+      api: getLabelList,
+      params: {
+        page: 1,
+        pageSize: 1000,
+      },
+      resultField: 'data.data',
+      labelField: 'name',
+      valueField: 'id',
     },
+    required: true,
   },
 ];