|
@@ -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,
|
|
|
},
|
|
|
];
|