diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35823b4..d22a0b1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2540,7 +2540,6 @@ packages: resolution: {integrity: sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==} cpu: [arm] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true @@ -2549,7 +2548,6 @@ packages: resolution: {integrity: sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==} cpu: [arm] os: [linux] - libc: [musl] requiresBuild: true dev: true optional: true @@ -2558,7 +2556,6 @@ packages: resolution: {integrity: sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==} cpu: [arm64] os: [linux] - libc: [glibc] requiresBuild: true dev: true optional: true @@ -2567,7 +2564,6 @@ packages: resolution: {integrity: sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==} cpu: [arm64] os: [linux] - libc: [musl] requiresBuild: true dev: true optional: true diff --git a/src/api/system/unit/Company.ts b/src/api/system/unit/Company.ts new file mode 100644 index 0000000..5ab9f7d --- /dev/null +++ b/src/api/system/unit/Company.ts @@ -0,0 +1,39 @@ +import { defHttp } from '@/utils/http/axios' + +export interface CompanyVO { + id?: number + name: string // 集团名称 + short: string // 集团简称 + status: number // 状态 + createTime: Date // 创建时间 +} + +export interface CompanyPageReqVO { + name?: string + status?: number +} + +// 查询集团列表 +export function getCompanyPage(params: CompanyPageReqVO) { + return defHttp.get({ url: '/system/Company/page', params }) +} + +// 查询集团详情 +export function getCompany(id: number) { + return defHttp.get({ url: `/system/Company/get?id=${id}` }) +} + +// 新增集团 +export function createCompany(data: CompanyVO) { + return defHttp.post({ url: '/system/Company/create', data }) +} + +// 修改集团 +export function updateCompany(params: CompanyVO) { + return defHttp.put({ url: '/system/Company/update', data: params }) +} + +// 删除集团 +export function deleteCompany(id: number) { + return defHttp.delete({ url: `/system/Company/delete?id=${id}` }) +} diff --git a/src/views/system/unit/Company/Company.ts b/src/views/system/unit/Company/Company.ts new file mode 100644 index 0000000..5815f54 --- /dev/null +++ b/src/views/system/unit/Company/Company.ts @@ -0,0 +1,79 @@ +import type { BasicColumn, FormSchema } from '@/components/Table' +import { useRender } from '@/components/Table' +import { DICT_TYPE, getDictOptions } from '@/utils/dict' + +export const columns: BasicColumn[] = [ + { + title: '集团名称', + dataIndex: 'name', + width: 260, + }, + { + title: '集团简称', + dataIndex: 'shortName', // 注意:后端是 shortName,不是 short! + width: 60, + }, + { + title: '状态', + dataIndex: 'status', + width: 180, + customRender: ({ text }) => { + return useRender.renderDict(text, DICT_TYPE.COMMON_STATUS) + }, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + }, + }, +] + +export const searchFormSchema: FormSchema[] = [ + { + label: '集团名称', + field: 'name', + component: 'Input', + colProps: { span: 8 }, + }, + { + label: '状态', + field: 'status', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS), + }, + colProps: { span: 8 }, + }, +] + +export const formSchema: FormSchema[] = [ + { + label: '编号', + field: 'id', + show: false, + component: 'Input', + }, + { + label: '集团名称', + field: 'name', + required: true, + component: 'Input', + }, + { + label: '集团简称', + field: 'shortName', // 注意:后端是 shortName,不是 short! + required: true, + component: 'Input', + }, + { + label: '集团状态', + field: 'status', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS), + }, + }, +] diff --git a/src/views/system/unit/Company/CompanyModal.vue b/src/views/system/unit/Company/CompanyModal.vue new file mode 100644 index 0000000..6cc6120 --- /dev/null +++ b/src/views/system/unit/Company/CompanyModal.vue @@ -0,0 +1,63 @@ + + + +./Company +@/api/system/unit/Company diff --git a/src/views/system/unit/Company/index.vue b/src/views/system/unit/Company/index.vue new file mode 100644 index 0000000..111a69e --- /dev/null +++ b/src/views/system/unit/Company/index.vue @@ -0,0 +1,89 @@ + + + +./Company +@/api/system/unit/Company