import { computed, ref } from 'vue'; import { FormSchema } from '@/components/Form'; import { useDictStore } from '@/store/modules/dict'; import { policyTenantOptions } from '@/views/imPolicyShared'; const dict = useDictStore(); export const defaultPolicy = { allow_add_friend: true, direct_add_friend: false, max_friend_count: 5000, allow_qrcode_add_friend: true, allow_group_member_profile: true, hide_profile_when_friend_disabled: true, allow_private_message: true, allow_group_message: true, allow_create_group: true, allow_join_group: true, allow_upload_file: true, }; export const schemas = ref([ { field: 'tenantId', component: 'NSelect', label: '商户', componentProps: { options: computed(() => policyTenantOptions.value), clearable: false }, }, { field: 'keyword', component: 'NInput', label: '关键词', componentProps: { placeholder: '分组编码或名称', clearable: true }, }, { field: 'status', component: 'NSelect', label: '状态', componentProps: { options: dict.getOption('sys_normal_disable'), clearable: true, }, }, ]); export const columns = [ { title: '分组编码', key: 'groupCode', width: 150 }, { title: '分组名称', key: 'groupName', width: 160 }, { title: '优先级', key: 'priority', width: 90 }, { title: '成员数', key: 'memberCount', width: 90 }, { title: '状态', key: 'status', width: 90, render: (row) => dict.getLabel('sys_normal_disable', row.status), }, { title: '版本', key: 'version', width: 80 }, { title: '备注', key: 'remark', width: 220 }, { title: '更新时间', key: 'updatedAt', width: 180 }, ]; export function loadOptions() { dict.loadOptions(['sys_normal_disable', 'ImPolicyActionOptions', 'ImFriendEntryOptions']); }