diff --git a/.env.production b/.env.production index 2486b9c..8dfb175 100644 --- a/.env.production +++ b/.env.production @@ -13,7 +13,7 @@ VITE_BUILD_COMPRESS = 'gzip' VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false #后台接口父地址(必填) -VITE_GLOB_API_URL=/jeecgboot +VITE_GLOB_API_URL=/nursing-unit #后台接口全路径地址(必填) VITE_GLOB_DOMAIN_URL=http://nursing-unit-system:8080/nursing-unit diff --git a/src/views/dictType/DictType.api.ts b/src/views/dictType/DictType.api.ts new file mode 100644 index 0000000..49a9833 --- /dev/null +++ b/src/views/dictType/DictType.api.ts @@ -0,0 +1,72 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/dictType/dictType/list', + save='/dictType/dictType/add', + edit='/dictType/dictType/edit', + deleteOne = '/dictType/dictType/delete', + deleteBatch = '/dictType/dictType/deleteBatch', + importExcel = '/dictType/dictType/importExcel', + exportXls = '/dictType/dictType/exportXls', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }, { isTransformResponse: false }); +} diff --git a/src/views/dictType/DictType.data.ts b/src/views/dictType/DictType.data.ts new file mode 100644 index 0000000..4bc24d2 --- /dev/null +++ b/src/views/dictType/DictType.data.ts @@ -0,0 +1,43 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '字典名称', + align: "center", + dataIndex: 'dictName' + }, + { + title: '字典编码', + align: "center", + dataIndex: 'dictCode' + }, + { + title: '描述', + align: "center", + dataIndex: 'description' + }, + { + title: '创建时间', + align: "center", + sorter: true, + dataIndex: 'createTime' + }, + { + title: '更新时间', + align: "center", + dataIndex: 'updateTime' + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + dictName: {title: '字典名称',order: 0,view: 'text', type: 'string',}, + dictCode: {title: '字典编码',order: 1,view: 'text', type: 'string',}, + description: {title: '描述',order: 2,view: 'textarea', type: 'string',}, + createTime: {title: '创建时间',order: 3,view: 'datetime', type: 'string',}, + updateTime: {title: '更新时间',order: 4,view: 'datetime', type: 'string',}, +}; diff --git a/src/views/dictType/DictTypeList.vue b/src/views/dictType/DictTypeList.vue new file mode 100644 index 0000000..3e2f63b --- /dev/null +++ b/src/views/dictType/DictTypeList.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/src/views/dictType/components/DictTypeForm.vue b/src/views/dictType/components/DictTypeForm.vue new file mode 100644 index 0000000..d3c961f --- /dev/null +++ b/src/views/dictType/components/DictTypeForm.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/src/views/dictType/components/DictTypeModal.vue b/src/views/dictType/components/DictTypeModal.vue new file mode 100644 index 0000000..5811212 --- /dev/null +++ b/src/views/dictType/components/DictTypeModal.vue @@ -0,0 +1,77 @@ + + + + + +