|
@@ -1,9 +1,6 @@
|
|
|
import { BasicColumn, FormSchema } from '@/components/Table';
|
|
|
import { useI18n } from '@/hooks/web/useI18n';
|
|
|
-import { formatToDateTime } from '@/utils/dateUtil';
|
|
|
-import { updateContact } from '@/api/wechat/contact';
|
|
|
-import { Switch } from 'ant-design-vue';
|
|
|
-import { h } from 'vue';
|
|
|
+import {getLabelSelectList} from "@/api/wechat/label";
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
export const columns: BasicColumn[] = [
|
|
@@ -29,13 +26,32 @@ export const columns: BasicColumn[] = [
|
|
|
},
|
|
|
{
|
|
|
title: t('wechat.contact.lag'),
|
|
|
- dataIndex: 'lag',
|
|
|
- width: 80,
|
|
|
+ dataIndex: 'labelRelationships',
|
|
|
+ width: 200,
|
|
|
+ customRender: ({ text }) => {
|
|
|
+ return text.map(label => label.label).join(', ');
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
|
{
|
|
|
+ field: 'labelIDs',
|
|
|
+ label: t('wechat.contact.labels'),
|
|
|
+ component: 'ApiSelect',
|
|
|
+ componentProps: {
|
|
|
+ api: () => getLabelSelectList({ page: 1, pageSize: 100 }).then(response => {
|
|
|
+ return response.data.map((label) => {
|
|
|
+ return { label: label.label, value: label.value };
|
|
|
+ });
|
|
|
+ }),
|
|
|
+ mode: 'tags',
|
|
|
+ tokenSeparators: [','],
|
|
|
+ change: 'handleChange', // 这里你需要在你的组件中定义 handleChange 函数
|
|
|
+ },
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+ {
|
|
|
field: 'wxWxid',
|
|
|
label: t('wechat.contact.wxWxid'),
|
|
|
component: 'Input',
|
|
@@ -63,105 +79,123 @@ export const formSchema: FormSchema[] = [
|
|
|
show: false,
|
|
|
},
|
|
|
{
|
|
|
- field: 'wxWxid',
|
|
|
- label: t('wechat.contact.wxWxid'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
field: 'type',
|
|
|
label: t('wechat.contact.type'),
|
|
|
component: 'InputNumber',
|
|
|
+ show: false,
|
|
|
+ required: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'labelRelationships',
|
|
|
+ label: t('wechat.contact.labels'),
|
|
|
+ component: 'ApiSelect',
|
|
|
+ componentProps: (renderCallbackParams) => ({
|
|
|
+ api: (params) => getLabelSelectList(params).then(response => {
|
|
|
+ return response.data.map((label) => {
|
|
|
+ return { label: label.label, value: label.value };
|
|
|
+ });
|
|
|
+ }),
|
|
|
+ params: { page: 1, pageSize: 100, type: renderCallbackParams.formModel.type },
|
|
|
+ mode: 'tags',
|
|
|
+ tokenSeparators: [','],
|
|
|
+ change: 'handleChange', // 这里你需要在你的组件中定义 handleChange 函数
|
|
|
+ }),
|
|
|
required: true,
|
|
|
},
|
|
|
- {
|
|
|
- field: 'wxid',
|
|
|
- label: t('wechat.contact.wxid'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'account',
|
|
|
- label: t('wechat.contact.account'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'nickname',
|
|
|
- label: t('wechat.contact.nickname'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'markname',
|
|
|
- label: t('wechat.contact.markname'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'headimg',
|
|
|
- label: t('wechat.contact.headimg'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'sex',
|
|
|
- label: t('wechat.contact.sex'),
|
|
|
- component: 'InputNumber',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'starrole',
|
|
|
- label: t('wechat.contact.starrole'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'dontseeit',
|
|
|
- label: t('wechat.contact.dontseeit'),
|
|
|
- component: 'InputNumber',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'dontseeme',
|
|
|
- label: t('wechat.contact.dontseeme'),
|
|
|
- component: 'InputNumber',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'lag',
|
|
|
- label: t('wechat.contact.lag'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'gid',
|
|
|
- label: t('wechat.contact.gid'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'gname',
|
|
|
- label: t('wechat.contact.gname'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'v3',
|
|
|
- label: t('wechat.contact.v3'),
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'status',
|
|
|
- label: t('wechat.contact.status'),
|
|
|
- component: 'RadioButtonGroup',
|
|
|
- defaultValue: 1,
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: t('common.on'), value: 1 },
|
|
|
- { label: t('common.off'), value: 2 },
|
|
|
- ],
|
|
|
- },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // field: 'wxWxid',
|
|
|
+ // label: t('wechat.contact.wxWxid'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'wxid',
|
|
|
+ // label: t('wechat.contact.wxid'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'account',
|
|
|
+ // label: t('wechat.contact.account'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'nickname',
|
|
|
+ // label: t('wechat.contact.nickname'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'markname',
|
|
|
+ // label: t('wechat.contact.markname'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'headimg',
|
|
|
+ // label: t('wechat.contact.headimg'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'sex',
|
|
|
+ // label: t('wechat.contact.sex'),
|
|
|
+ // component: 'InputNumber',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'starrole',
|
|
|
+ // label: t('wechat.contact.starrole'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'dontseeit',
|
|
|
+ // label: t('wechat.contact.dontseeit'),
|
|
|
+ // component: 'InputNumber',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'dontseeme',
|
|
|
+ // label: t('wechat.contact.dontseeme'),
|
|
|
+ // component: 'InputNumber',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'lag',
|
|
|
+ // label: t('wechat.contact.lag'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'gid',
|
|
|
+ // label: t('wechat.contact.gid'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'gname',
|
|
|
+ // label: t('wechat.contact.gname'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'v3',
|
|
|
+ // label: t('wechat.contact.v3'),
|
|
|
+ // component: 'Input',
|
|
|
+ // required: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // field: 'status',
|
|
|
+ // label: t('wechat.contact.status'),
|
|
|
+ // component: 'RadioButtonGroup',
|
|
|
+ // defaultValue: 1,
|
|
|
+ // componentProps: {
|
|
|
+ // options: [
|
|
|
+ // { label: t('common.on'), value: 1 },
|
|
|
+ // { label: t('common.off'), value: 2 },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // },
|
|
|
];
|