From 806058eed782bb972ef6b7401d8b394b0694aa01 Mon Sep 17 00:00:00 2001 From: lq Date: Fri, 19 Dec 2025 11:16:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E8=8D=AF=E5=BA=97?= =?UTF-8?q?=E5=88=86=E5=8C=BA=E5=85=A5=E5=8F=A3=E3=80=81=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=B5=84=E8=B4=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/home-zones/api/index.ts | 60 ++++ .../system/home-zones/components/modal.vue | 94 +++++++ .../home-zones/components/sort-modal.vue | 263 ++++++++++++++++++ .../views/system/home-zones/config/form.ts | 108 +++++++ .../views/system/home-zones/config/search.ts | 47 ++++ .../views/system/home-zones/config/table.ts | 105 +++++++ .../src/views/system/home-zones/index.vue | 148 ++++++++++ .../views/system/platform-info/api/index.ts | 18 ++ .../platform-info/api/qualifications.ts | 49 ++++ .../system/platform-info/components/modal.vue | 88 ++++++ .../components/qualifications-modal.vue | 95 +++++++ .../views/system/platform-info/config/form.ts | 129 +++++++++ .../config/qualifications-form.ts | 106 +++++++ .../config/qualifications-search.ts | 30 ++ .../config/qualifications-table.ts | 113 ++++++++ .../src/views/system/platform-info/index.vue | 227 +++++++++++++++ .../platform-qualifications/api/index.ts | 49 ++++ .../components/modal.vue | 91 ++++++ .../platform-qualifications/config/form.ts | 97 +++++++ .../platform-qualifications/config/search.ts | 55 ++++ .../platform-qualifications/config/table.ts | 92 ++++++ .../system/platform-qualifications/index.vue | 131 +++++++++ 菜单配置_平台资质和平台信息管理.sql | 32 +++ 23 files changed, 2227 insertions(+) create mode 100644 apps/web-antd/src/views/system/home-zones/api/index.ts create mode 100644 apps/web-antd/src/views/system/home-zones/components/modal.vue create mode 100644 apps/web-antd/src/views/system/home-zones/components/sort-modal.vue create mode 100644 apps/web-antd/src/views/system/home-zones/config/form.ts create mode 100644 apps/web-antd/src/views/system/home-zones/config/search.ts create mode 100644 apps/web-antd/src/views/system/home-zones/config/table.ts create mode 100644 apps/web-antd/src/views/system/home-zones/index.vue create mode 100644 apps/web-antd/src/views/system/platform-info/api/index.ts create mode 100644 apps/web-antd/src/views/system/platform-info/api/qualifications.ts create mode 100644 apps/web-antd/src/views/system/platform-info/components/modal.vue create mode 100644 apps/web-antd/src/views/system/platform-info/components/qualifications-modal.vue create mode 100644 apps/web-antd/src/views/system/platform-info/config/form.ts create mode 100644 apps/web-antd/src/views/system/platform-info/config/qualifications-form.ts create mode 100644 apps/web-antd/src/views/system/platform-info/config/qualifications-search.ts create mode 100644 apps/web-antd/src/views/system/platform-info/config/qualifications-table.ts create mode 100644 apps/web-antd/src/views/system/platform-info/index.vue create mode 100644 apps/web-antd/src/views/system/platform-qualifications/api/index.ts create mode 100644 apps/web-antd/src/views/system/platform-qualifications/components/modal.vue create mode 100644 apps/web-antd/src/views/system/platform-qualifications/config/form.ts create mode 100644 apps/web-antd/src/views/system/platform-qualifications/config/search.ts create mode 100644 apps/web-antd/src/views/system/platform-qualifications/config/table.ts create mode 100644 apps/web-antd/src/views/system/platform-qualifications/index.vue create mode 100644 菜单配置_平台资质和平台信息管理.sql diff --git a/apps/web-antd/src/views/system/home-zones/api/index.ts b/apps/web-antd/src/views/system/home-zones/api/index.ts new file mode 100644 index 00000000..a5e8ddaa --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/api/index.ts @@ -0,0 +1,60 @@ +import { requestClient } from '#/api/request'; + +const prefix = 'home-zone/'; + +/** + * 分页查询专区列表 + * @param data + */ +export async function getHomeZonesList(data: any) { + return requestClient.get(`${prefix}list`, { params: data }); +} + +/** + * 获取专区下拉列表 + * @param data + */ +export async function getHomeZonesOption(data?: any) { + return requestClient.get(`${prefix}option`, { params: data }); +} + +/** + * 获取专区详情 + * @param id + */ +export async function getHomeZonesInfo(id: number) { + return requestClient.get(`${prefix}detail`, { params: { id } }); +} + +/** + * 新增专区 + * @param data + */ +export async function createHomeZones(data: Record) { + return requestClient.post(`${prefix}create`, data); +} + +/** + * 编辑专区 + * @param data + */ +export async function updateHomeZones(data: Record) { + return requestClient.post(`${prefix}update`, data); +} + +/** + * 删除专区 + * @param data + */ +export async function deleteHomeZones(data: Record) { + return requestClient.post(`${prefix}delete`, data); +} + +/** + * 更新专区排序 + * @param data + */ +export async function updateHomeZonesSortOrder(data: { ids: (string | number)[] }) { + return requestClient.post(`${prefix}update-sort-order`, data); +} + diff --git a/apps/web-antd/src/views/system/home-zones/components/modal.vue b/apps/web-antd/src/views/system/home-zones/components/modal.vue new file mode 100644 index 00000000..cce89d23 --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/components/modal.vue @@ -0,0 +1,94 @@ + + + diff --git a/apps/web-antd/src/views/system/home-zones/components/sort-modal.vue b/apps/web-antd/src/views/system/home-zones/components/sort-modal.vue new file mode 100644 index 00000000..1bd41dc5 --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/components/sort-modal.vue @@ -0,0 +1,263 @@ + + + diff --git a/apps/web-antd/src/views/system/home-zones/config/form.ts b/apps/web-antd/src/views/system/home-zones/config/form.ts new file mode 100644 index 00000000..fff60e74 --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/config/form.ts @@ -0,0 +1,108 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const modalFormProps: VbenFormProps = { + wrapperClass: 'grid-cols-12', + commonConfig: { + formItemClass: 'col-span-12', + componentProps: { + class: 'w-full', + }, + }, + layout: 'horizontal', + schema: [ + { + component: 'VbenInput', + fieldName: 'id', + label: 'ID', + formItemClass: 'col-span-6', + defaultValue: '', + dependencies: { + show: false, + triggerFields: ['id'], + }, + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入专区标题,如"OTC专区"', + }, + fieldName: 'title', + label: '标题', + rules: 'required', + defaultValue: '', + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '请选择专区类型', + options: [ + { label: 'OTC专区', value: 'otc' }, + { label: '处方药专区', value: 'prescription' }, + { label: '保健食品专区', value: 'health_food' }, + { label: '产品服务包专区', value: 'service_package' }, + ], + }, + fieldName: 'type', + label: '类型', + rules: 'required', + defaultValue: undefined, + }, + { + component: 'Avatar', + fieldName: 'icon', + label: '图标', + defaultValue: '', + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入专区描述(可选)', + type: 'textarea', + rows: 3, + showCount: true, + maxlength: 200, + }, + fieldName: 'description', + label: '描述', + defaultValue: '', + }, + { + component: 'InputNumber', + componentProps: { + placeholder: '请输入排序顺序', + min: 0, + max: 9999, + }, + fieldName: 'sort_order', + label: '排序', + formItemClass: 'col-span-6', + defaultValue: 0, + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '请选择状态', + options: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], + }, + fieldName: 'status', + label: '状态', + formItemClass: 'col-span-6', + defaultValue: 1, + }, + { + component: 'VbenInputNumber', + componentProps: { + placeholder: '门店ID(留空表示平台通用)', + min: 0, + }, + fieldName: 'store_id', + label: '门店ID', + formItemClass: 'col-span-6', + defaultValue: 0, + }, + ], + showDefaultActions: false, +}; diff --git a/apps/web-antd/src/views/system/home-zones/config/search.ts b/apps/web-antd/src/views/system/home-zones/config/search.ts new file mode 100644 index 00000000..c2478c0b --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/config/search.ts @@ -0,0 +1,47 @@ +import type { VbenFormProps } from '@vben/common-ui'; + +export const formOptions: VbenFormProps = { + layout: 'inline', + showResetButton: true, + showSubmitButton: true, + schemas: [ + { + fieldName: 'title', + component: 'Input', + label: '标题', + componentProps: { + placeholder: '请输入标题关键字', + allowClear: true, + }, + }, + { + fieldName: 'type', + component: 'Select', + label: '类型', + componentProps: { + placeholder: '请选择类型', + allowClear: true, + options: [ + { label: 'OTC专区', value: 'otc' }, + { label: '处方药专区', value: 'prescription' }, + { label: '保健食品专区', value: 'health_food' }, + { label: '产品服务包专区', value: 'service_package' }, + ], + }, + }, + { + fieldName: 'status', + component: 'Select', + label: '状态', + componentProps: { + placeholder: '请选择状态', + allowClear: true, + options: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], + }, + }, + ], +}; + diff --git a/apps/web-antd/src/views/system/home-zones/config/table.ts b/apps/web-antd/src/views/system/home-zones/config/table.ts new file mode 100644 index 00000000..7e6d3051 --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/config/table.ts @@ -0,0 +1,105 @@ +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getHomeZonesList } from '../api'; + +interface RowType { + id: number; + title: string; + type: string; + icon: string; + description: string; + sort_order: number; + status: number; + status_txt: string; + store_id: number | null; + created_at: string; + updated_at: string; +} + +export const gridOptions: VxeGridProps = { + checkboxConfig: { + highlight: true, + labelField: '', + }, + columnConfig: { + useKey: true, + }, + rowConfig: { + useKey: true, + isHover: true, + isCurrent: true, + }, + columns: [ + { type: 'checkbox', width: 60 }, + { field: 'id', align: 'left', title: 'ID', width: 80 }, + { field: 'title', align: 'left', title: '标题', minWidth: 160 }, + { + field: 'type', + align: 'left', + title: '类型', + width: 140, + formatter: ({ cellValue }) => { + const map: Record = { + otc: 'OTC专区', + prescription: '处方药专区', + health_food: '保健食品专区', + service_package: '产品服务包专区', + }; + return map[cellValue] || cellValue || '-'; + }, + }, + { + field: 'icon', + align: 'left', + title: '图标', + width: 160, + slots: { default: 'icon' }, + }, + { + field: 'description', + align: 'left', + title: '描述', + minWidth: 200, + showOverflow: 'tooltip', + }, + { field: 'sort_order', align: 'left', title: '排序', width: 100 }, + { + field: 'status_txt', + align: 'left', + title: '状态', + width: 100, + }, + { field: 'created_at', title: '创建时间', width: 180 }, + { type: 'html', title: '操作', slots: { default: 'action' }, width: 160 }, + ], + keepSource: true, + pagerConfig: {}, + proxyConfig: { + ajax: { + // 请求后端接口方法 + query: async ({ page }, formValues) => { + return await getHomeZonesList({ + page: page.currentPage, + pageSize: page.pageSize, + ...formValues, + }); + }, + }, + }, + border: false, + toolbarConfig: { + search: true, + refresh: true, + print: false, + export: false, + zoom: true, + slots: { + buttons: 'toolbar-buttons', + }, + custom: { + icon: 'vxe-icon-menu', + }, + }, + showOverflow: false, +}; + diff --git a/apps/web-antd/src/views/system/home-zones/index.vue b/apps/web-antd/src/views/system/home-zones/index.vue new file mode 100644 index 00000000..382efba2 --- /dev/null +++ b/apps/web-antd/src/views/system/home-zones/index.vue @@ -0,0 +1,148 @@ + + + + diff --git a/apps/web-antd/src/views/system/platform-info/api/index.ts b/apps/web-antd/src/views/system/platform-info/api/index.ts new file mode 100644 index 00000000..ae4a2f63 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/api/index.ts @@ -0,0 +1,18 @@ +import { requestClient } from '#/api/request'; + +const prefix = 'platform-info/'; +/** + * 获取平台信息详情 + * @param data + */ +export async function getPlatformInfoDetail(data: any) { + return requestClient.get(`${prefix}detail`, { params: data }); +} + +/** + * 更新平台信息 + * @param data + */ +export async function updatePlatformInfo(data: Record) { + return requestClient.post(`${prefix}update`, data); +} diff --git a/apps/web-antd/src/views/system/platform-info/api/qualifications.ts b/apps/web-antd/src/views/system/platform-info/api/qualifications.ts new file mode 100644 index 00000000..36544a9c --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/api/qualifications.ts @@ -0,0 +1,49 @@ +import { requestClient } from '#/api/request'; + +const prefix = 'platform-qualifications/'; +/** + * 分页查询资质列表 + * @param data + */ +export async function getPlatformQualificationsList(data: any) { + return requestClient.get(`${prefix}list`, { params: data }); +} +/** + * 获取资质下拉列表 + * @param data + */ +export async function getPlatformQualificationsOption(data: any) { + return requestClient.get(`${prefix}option`, { params: data }); +} + +/** + * 获取资质详情 + * @param id + */ +export async function getPlatformQualificationsInfo(id: number) { + return requestClient.get(`${prefix}detail`, { params: { id } }); +} + +/** + * 新增资质 + * @param data + */ +export async function createPlatformQualifications(data: Record) { + return requestClient.post(`${prefix}create`, data); +} + +/** + * 编辑资质 + * @param data + */ +export async function updatePlatformQualifications(data: Record) { + return requestClient.post(`${prefix}update`, data); +} + +/** + * 删除资质 + * @param data + */ +export async function deletePlatformQualifications(data: Record) { + return requestClient.post(`${prefix}delete`, data); +} diff --git a/apps/web-antd/src/views/system/platform-info/components/modal.vue b/apps/web-antd/src/views/system/platform-info/components/modal.vue new file mode 100644 index 00000000..46d824f9 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/components/modal.vue @@ -0,0 +1,88 @@ + + diff --git a/apps/web-antd/src/views/system/platform-info/components/qualifications-modal.vue b/apps/web-antd/src/views/system/platform-info/components/qualifications-modal.vue new file mode 100644 index 00000000..48f4a0d8 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/components/qualifications-modal.vue @@ -0,0 +1,95 @@ + + diff --git a/apps/web-antd/src/views/system/platform-info/config/form.ts b/apps/web-antd/src/views/system/platform-info/config/form.ts new file mode 100644 index 00000000..4264d503 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/config/form.ts @@ -0,0 +1,129 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const modalFormProps: VbenFormProps = { + wrapperClass: 'grid-cols-12', // 24栅格, + commonConfig: { + formItemClass: 'col-span-12', + // 所有表单项 + componentProps: { + class: 'w-full', + }, + }, + // handleSubmit: onSubmit, + layout: 'horizontal', + schema: [ + { + component: 'VbenInput', + fieldName: 'id', + label: 'ID', + formItemClass: 'col-span-6', + defaultValue: '', + dependencies: { + show: false, + triggerFields: ['id'], + }, + }, + { + component: 'VbenInput', + fieldName: 'platform_id', + label: '平台ID', + formItemClass: 'col-span-6', + defaultValue: 1, + dependencies: { + show: false, + triggerFields: ['platform_id'], + }, + }, + { + component: 'Divider', + fieldName: '', + label: '联系方式', + formItemClass: 'col-span-12', + hideLabel: true, + renderComponentContent: () => { + return { + default: () => { + return '联系方式'; + }, + }; + }, + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入联系电话', + }, + fieldName: 'contact_phone', + label: '联系电话', + formItemClass: 'col-span-6', + defaultValue: '', + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入联系邮箱', + }, + fieldName: 'contact_email', + label: '联系邮箱', + formItemClass: 'col-span-6', + defaultValue: '', + }, + { + component: 'Textarea', + componentProps: { + placeholder: '请输入联系地址', + rows: 2, + }, + fieldName: 'contact_address', + label: '联系地址', + formItemClass: 'col-span-12', + defaultValue: '', + }, + { + component: 'Divider', + fieldName: '', + label: '投诉举报方式', + formItemClass: 'col-span-12', + hideLabel: true, + renderComponentContent: () => { + return { + default: () => { + return '投诉举报方式'; + }, + }; + }, + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入投诉电话', + }, + fieldName: 'complaint_phone', + label: '投诉电话', + formItemClass: 'col-span-6', + defaultValue: '', + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入投诉邮箱', + }, + fieldName: 'complaint_email', + label: '投诉邮箱', + formItemClass: 'col-span-6', + defaultValue: '', + }, + { + component: 'Textarea', + componentProps: { + placeholder: '请输入投诉地址', + rows: 2, + }, + fieldName: 'complaint_address', + label: '投诉地址', + formItemClass: 'col-span-12', + defaultValue: '', + }, + ], + showDefaultActions: false, +}; diff --git a/apps/web-antd/src/views/system/platform-info/config/qualifications-form.ts b/apps/web-antd/src/views/system/platform-info/config/qualifications-form.ts new file mode 100644 index 00000000..ef64abc8 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/config/qualifications-form.ts @@ -0,0 +1,106 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const modalFormProps: VbenFormProps = { + wrapperClass: 'grid-cols-12', // 24栅格, + commonConfig: { + formItemClass: 'col-span-12', + // 所有表单项 + componentProps: { + class: 'w-full', + }, + }, + // handleSubmit: onSubmit, + layout: 'horizontal', + schema: [ + { + component: 'VbenInput', + fieldName: 'id', + label: 'ID', + formItemClass: 'col-span-6', + defaultValue: '', + dependencies: { + show: false, + triggerFields: ['id'], + }, + }, + { + component: 'Avatar', + fieldName: 'drug_license_image', + label: '药品经营许可证', + formItemClass: 'col-span-4', + }, + { + component: 'Avatar', + fieldName: 'business_license_image', + label: '营业执照', + formItemClass: 'col-span-4', + }, + { + component: 'Avatar', + fieldName: 'medical_device_license_image', + label: '医疗器械经营许可证', + formItemClass: 'col-span-4', + }, + { + component: 'Avatar', + fieldName: 'food_license_image', + label: '食品经营许可证', + formItemClass: 'col-span-4', + }, + { + component: 'Avatar', + fieldName: 'pharmacist_certificate_image', + label: '药师资格证', + formItemClass: 'col-span-4', + }, + { + component: 'InputNumber', + componentProps: { + placeholder: '请输入排序顺序', + min: 0, + }, + // dependencies: { + // show: false, + // triggerFields: ['id'], + // }, + fieldName: 'sort_order', + label: '排序顺序', + formItemClass: 'col-span-6', + defaultValue: 0, + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '请选择状态', + options: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], + }, + dependencies: { + show: false, + triggerFields: ['id'], + }, + fieldName: 'status', + label: '状态', + formItemClass: 'col-span-6', + defaultValue: 1, + }, + { + component: 'VbenInputNumber', + componentProps: { + placeholder: '门店ID(留空表示平台通用)', + min: 0, + }, + dependencies: { + show: false, + triggerFields: ['id'], + }, + fieldName: 'store_id', + label: '门店ID', + formItemClass: 'col-span-6', + defaultValue: 0, + }, + ], + showDefaultActions: false, +}; diff --git a/apps/web-antd/src/views/system/platform-info/config/qualifications-search.ts b/apps/web-antd/src/views/system/platform-info/config/qualifications-search.ts new file mode 100644 index 00000000..2230b6ca --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/config/qualifications-search.ts @@ -0,0 +1,30 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const formOptions: VbenFormProps = { + // 默认展开 + collapsed: false, + schema: [ + { + component: 'VbenSelect', + componentProps: { + placeholder: '选择状态', + options: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], + }, + defaultValue: '', + fieldName: 'status', + label: '状态', + }, + ], + // 控制表单是否显示折叠按钮 + showCollapseButton: true, + submitButtonOptions: { + content: '查询', + }, + // 是否在字段值改变时提交表单 + submitOnChange: true, + // 按下回车时是否提交表单 + submitOnEnter: false, +}; diff --git a/apps/web-antd/src/views/system/platform-info/config/qualifications-table.ts b/apps/web-antd/src/views/system/platform-info/config/qualifications-table.ts new file mode 100644 index 00000000..0516295f --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/config/qualifications-table.ts @@ -0,0 +1,113 @@ +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getPlatformQualificationsList } from '../api/qualifications'; + +interface RowType { + id: string; + drug_license_image: string; + business_license_image: string; + medical_device_license_image: string; + food_license_image: string; + pharmacist_certificate_image: string; + store_id: number | null; + sort_order: number; + status: number; + status_txt: string; + created_at: string; + updated_at: string; +} + +export const gridOptions: VxeGridProps = { + checkboxConfig: { + highlight: true, + labelField: '', + }, + columnConfig: { + useKey: true, + }, + rowConfig: { + useKey: true, + }, + columns: [ + { type: 'checkbox', width: 60 }, + { field: 'id', align: 'left', title: 'ID', width: 100 }, + { + field: 'drug_license_image', + align: 'left', + title: '药品经营许可证', + slots: { default: 'drug_license_image' }, + width: 150, + }, + { + field: 'business_license_image', + align: 'left', + title: '营业执照', + slots: { default: 'business_license_image' }, + width: 150, + }, + { + field: 'medical_device_license_image', + align: 'left', + title: '医疗器械经营许可证', + slots: { default: 'medical_device_license_image' }, + width: 180, + }, + { + field: 'food_license_image', + align: 'left', + title: '食品经营许可证', + slots: { default: 'food_license_image' }, + width: 150, + }, + { + field: 'pharmacist_certificate_image', + align: 'left', + title: '药师资格证', + slots: { default: 'pharmacist_certificate_image' }, + width: 150, + }, + { field: 'store_id', align: 'left', title: '门店ID', width: 120 }, + { field: 'sort_order', align: 'left', title: '排序', width: 100 }, + { + field: 'status_txt', + align: 'left', + title: '状态', + width: 100, + }, + { field: 'created_at', title: '创建时间', width: 180 }, + { type: 'html', title: '操作', slots: { default: 'action' }, width: 150 }, + ], + keepSource: true, + pagerConfig: {}, + proxyConfig: { + ajax: { + // 请求后端接口方法 + query: async ({ page }, formValues) => { + return await getPlatformQualificationsList({ + page: page.currentPage, + pageSize: page.pageSize, + ...formValues, + }); + }, + }, + }, + border: false, + toolbarConfig: { + // 是否显示搜索表单控制按钮 + // @ts-ignore 正式环境时有完整的类型声明 + search: true, + refresh: true, // 刷新 + print: false, // 打印 + export: false, // 导出 + // custom: true, // 自定义列 + zoom: true, // 最大化最小化 + slots: { + buttons: 'toolbar-buttons', + }, + custom: { + // 自定义列-图标 + icon: 'vxe-icon-menu', + }, + }, + showOverflow: false, +}; diff --git a/apps/web-antd/src/views/system/platform-info/index.vue b/apps/web-antd/src/views/system/platform-info/index.vue new file mode 100644 index 00000000..b33e7ce9 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-info/index.vue @@ -0,0 +1,227 @@ + + + diff --git a/apps/web-antd/src/views/system/platform-qualifications/api/index.ts b/apps/web-antd/src/views/system/platform-qualifications/api/index.ts new file mode 100644 index 00000000..36544a9c --- /dev/null +++ b/apps/web-antd/src/views/system/platform-qualifications/api/index.ts @@ -0,0 +1,49 @@ +import { requestClient } from '#/api/request'; + +const prefix = 'platform-qualifications/'; +/** + * 分页查询资质列表 + * @param data + */ +export async function getPlatformQualificationsList(data: any) { + return requestClient.get(`${prefix}list`, { params: data }); +} +/** + * 获取资质下拉列表 + * @param data + */ +export async function getPlatformQualificationsOption(data: any) { + return requestClient.get(`${prefix}option`, { params: data }); +} + +/** + * 获取资质详情 + * @param id + */ +export async function getPlatformQualificationsInfo(id: number) { + return requestClient.get(`${prefix}detail`, { params: { id } }); +} + +/** + * 新增资质 + * @param data + */ +export async function createPlatformQualifications(data: Record) { + return requestClient.post(`${prefix}create`, data); +} + +/** + * 编辑资质 + * @param data + */ +export async function updatePlatformQualifications(data: Record) { + return requestClient.post(`${prefix}update`, data); +} + +/** + * 删除资质 + * @param data + */ +export async function deletePlatformQualifications(data: Record) { + return requestClient.post(`${prefix}delete`, data); +} diff --git a/apps/web-antd/src/views/system/platform-qualifications/components/modal.vue b/apps/web-antd/src/views/system/platform-qualifications/components/modal.vue new file mode 100644 index 00000000..5ad5d4cd --- /dev/null +++ b/apps/web-antd/src/views/system/platform-qualifications/components/modal.vue @@ -0,0 +1,91 @@ + + diff --git a/apps/web-antd/src/views/system/platform-qualifications/config/form.ts b/apps/web-antd/src/views/system/platform-qualifications/config/form.ts new file mode 100644 index 00000000..b8ed815f --- /dev/null +++ b/apps/web-antd/src/views/system/platform-qualifications/config/form.ts @@ -0,0 +1,97 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const modalFormProps: VbenFormProps = { + wrapperClass: 'grid-cols-12', // 24栅格, + commonConfig: { + formItemClass: 'col-span-12', + // 所有表单项 + componentProps: { + class: 'w-full', + }, + }, + // handleSubmit: onSubmit, + layout: 'horizontal', + schema: [ + { + component: 'VbenInput', + fieldName: 'id', + label: 'ID', + formItemClass: 'col-span-6', + defaultValue: '', + dependencies: { + show: false, + triggerFields: ['id'], + }, + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '请输入资质名称', + }, + fieldName: 'name', + label: '资质名称', + rules: 'required', + defaultValue: '', + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '请选择资质类型', + options: [ + { label: '药品经营许可证', value: 1 }, + { label: '营业执照', value: 2 }, + { label: '医疗器械经营许可证', value: 3 }, + { label: '食品经营许可证', value: 4 }, + { label: '药师资格证', value: 5 }, + ], + }, + fieldName: 'type', + label: '资质类型', + rules: 'required', + defaultValue: undefined, + }, + { + component: 'Avatar', + fieldName: 'image', + label: '资质图片', + defaultValue: '', + }, + { + component: 'InputNumber', + componentProps: { + placeholder: '请输入排序顺序', + min: 0, + }, + fieldName: 'sort_order', + label: '排序顺序', + formItemClass: 'col-span-6', + defaultValue: 0, + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '请选择状态', + options: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], + }, + fieldName: 'status', + label: '状态', + formItemClass: 'col-span-6', + defaultValue: 1, + }, + { + component: 'VbenInputNumber', + componentProps: { + placeholder: '门店ID(留空表示平台通用)', + min: 0, + }, + fieldName: 'store_id', + label: '门店ID', + formItemClass: 'col-span-6', + defaultValue: 0, + }, + ], + showDefaultActions: false, +}; diff --git a/apps/web-antd/src/views/system/platform-qualifications/config/search.ts b/apps/web-antd/src/views/system/platform-qualifications/config/search.ts new file mode 100644 index 00000000..00f12f00 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-qualifications/config/search.ts @@ -0,0 +1,55 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const formOptions: VbenFormProps = { + // 默认展开 + collapsed: false, + schema: [ + { + component: 'VbenInput', + componentProps: { + placeholder: '输入资质名称', + }, + defaultValue: '', + fieldName: 'name', + label: '资质名称', + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '选择资质类型', + options: [ + { label: '药品经营许可证', value: 1 }, + { label: '营业执照', value: 2 }, + { label: '医疗器械经营许可证', value: 3 }, + { label: '食品经营许可证', value: 4 }, + { label: '药师资格证', value: 5 }, + ], + }, + defaultValue: '', + fieldName: 'type', + label: '资质类型', + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '选择状态', + options: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], + }, + defaultValue: '', + fieldName: 'status', + label: '状态', + }, + ], + // 控制表单是否显示折叠按钮 + showCollapseButton: true, + submitButtonOptions: { + content: '查询', + }, + // 是否在字段值改变时提交表单 + submitOnChange: true, + // 按下回车时是否提交表单 + submitOnEnter: false, +}; diff --git a/apps/web-antd/src/views/system/platform-qualifications/config/table.ts b/apps/web-antd/src/views/system/platform-qualifications/config/table.ts new file mode 100644 index 00000000..37456b08 --- /dev/null +++ b/apps/web-antd/src/views/system/platform-qualifications/config/table.ts @@ -0,0 +1,92 @@ +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getPlatformQualificationsList } from '#/views/system/platform-qualifications/api'; + +interface RowType { + id: string; + name: string; + image: string; + type: number; + type_txt: string; + store_id: number | null; + sort_order: number; + status: number; + status_txt: string; + created_at: string; + updated_at: string; +} + +export const gridOptions: VxeGridProps = { + checkboxConfig: { + highlight: true, + labelField: '', + }, + columnConfig: { + useKey: true, + }, + rowConfig: { + useKey: true, + }, + columns: [ + { type: 'checkbox', width: 60 }, + { field: 'id', align: 'left', title: 'ID', width: 100 }, + { field: 'name', align: 'left', title: '资质名称' }, + { + field: 'type_txt', + align: 'left', + title: '资质类型', + width: 150, + }, + { + field: 'image', + align: 'left', + title: '资质图片', + slots: { default: 'image' }, + width: 130, + }, + { field: 'store_id', align: 'left', title: '门店ID', width: 120 }, + { field: 'sort_order', align: 'left', title: '排序', width: 100 }, + { + field: 'status_txt', + align: 'left', + title: '状态', + width: 100, + }, + { field: 'created_at', title: '创建时间', width: 180 }, + { type: 'html', title: '操作', slots: { default: 'action' }, width: 150 }, + ], + keepSource: true, + pagerConfig: {}, + proxyConfig: { + ajax: { + // 请求后端接口方法 + query: async ({ page }, formValues) => { + return await getPlatformQualificationsList({ + page: page.currentPage, + pageSize: page.pageSize, + ...formValues, + }); + }, + }, + }, + height: 'auto', + border: false, + toolbarConfig: { + // 是否显示搜索表单控制按钮 + // @ts-ignore 正式环境时有完整的类型声明 + search: true, + refresh: true, // 刷新 + print: false, // 打印 + export: false, // 导出 + // custom: true, // 自定义列 + zoom: true, // 最大化最小化 + slots: { + buttons: 'toolbar-buttons', + }, + custom: { + // 自定义列-图标 + icon: 'vxe-icon-menu', + }, + }, + showOverflow: false, +}; diff --git a/apps/web-antd/src/views/system/platform-qualifications/index.vue b/apps/web-antd/src/views/system/platform-qualifications/index.vue new file mode 100644 index 00000000..c82cab4a --- /dev/null +++ b/apps/web-antd/src/views/system/platform-qualifications/index.vue @@ -0,0 +1,131 @@ + + + diff --git a/菜单配置_平台资质和平台信息管理.sql b/菜单配置_平台资质和平台信息管理.sql new file mode 100644 index 00000000..043ec76b --- /dev/null +++ b/菜单配置_平台资质和平台信息管理.sql @@ -0,0 +1,32 @@ +-- 平台资质管理菜单配置 +-- 格式:菜单名称 | icon | 路由名称 | 路径 | 视图路径 | 其他字段... +INSERT INTO `xk_menu` (`name`, `icon`, `component`, `path`, `view_path`, `pid`, `type`, `status`, `sort_order`, `created_at`, `updated_at`) VALUES +('平台资质管理', 'ant-design:file-protect-filled', 'SystemPlatformQualifications', '/system/platform-qualifications', 'views/system/platform-qualifications/index', 1, 0, 1, 26, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); + +-- 平台信息管理菜单配置 +INSERT INTO `xk_menu` (`name`, `icon`, `component`, `path`, `view_path`, `pid`, `type`, `status`, `sort_order`, `created_at`, `updated_at`) VALUES +('平台信息管理', 'ant-design:info-circle-filled', 'SystemPlatformInfo', '/system/platform-info', 'views/system/platform-info/index', 1, 0, 1, 27, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); + +-- 说明: +-- 1. 平台资质管理使用图标:ant-design:file-protect-filled(文件保护图标,适合资质证明) +-- 2. 平台信息管理使用图标:ant-design:info-circle-filled(信息圆圈图标,适合平台信息) +-- 3. 路由名称对应前端路由配置中的 name 字段 +-- 4. 路径对应前端路由配置中的 path 字段 +-- 5. 视图路径对应组件文件路径(相对于 views 目录) +-- 6. pid: 1 表示属于系统管理菜单(基础管理)的子菜单 +-- 7. type: 0 表示菜单类型 +-- 8. status: 1 表示启用 +-- 9. sort_order: 26 和 27 表示排序顺序(在菜单管理之后) + +-- 如果使用其他图标,可以考虑: +-- 平台资质管理: +-- - ant-design:file-text-filled(文件图标) +-- - ant-design:certificate(证书图标) +-- - ant-design:audit-outlined(审核图标) +-- - ant-design:file-done-outlined(文件完成图标) +-- +-- 平台信息管理: +-- - ant-design:setting-filled(设置图标) +-- - ant-design:contacts-filled(联系人图标) +-- - ant-design:global-outlined(全球图标) +-- - ant-design:customer-service-filled(客服图标)