diff --git a/src/api/infra/fileConfig/index.ts b/src/api/infra/fileConfig/index.ts index 2151141c..9a4f625c 100644 --- a/src/api/infra/fileConfig/index.ts +++ b/src/api/infra/fileConfig/index.ts @@ -16,7 +16,7 @@ export interface FileClientConfig { export interface FileConfigVO { id: number name: string - storage: number + storage: any master: boolean visible: boolean config: FileClientConfig diff --git a/src/config/axios/request.ts b/src/config/axios/request.ts new file mode 100644 index 00000000..d65842c2 --- /dev/null +++ b/src/config/axios/request.ts @@ -0,0 +1,50 @@ +import { service } from './service' + +import { config } from './config' + +const { default_headers } = config + +const request = (option: any) => { + const { url, method, params, data, headersType, responseType } = option + return service({ + url: url, + method, + params, + data, + responseType: responseType, + headers: { + 'Content-Type': headersType || default_headers + } + }) +} +export default { + get: async (option: any) => { + const res = await request({ method: 'GET', ...option }) + return res as unknown as T + }, + post: async (option: any) => { + const res = await request({ method: 'POST', ...option }) + return res as unknown as T + }, + delete: async (option: any) => { + const res = await request({ method: 'DELETE', ...option }) + return res as unknown as T + }, + put: async (option: any) => { + const res = await request({ method: 'PUT', ...option }) + return res as unknown as T + }, + patch: async (option: any) => { + const res = await request({ method: 'PATCH', ...option }) + return res as unknown as T + }, + download: async (option: any) => { + const res = await request({ method: 'GET', responseType: 'blob', ...option }) + return res as unknown as Promise + }, + upload: async (option: any) => { + option.headersType = 'multipart/form-data' + const res = await request({ method: 'POST', ...option }) + return res as unknown as Promise + } +} diff --git a/src/views/bpm/form/formEditor.vue b/src/views/bpm/form/formEditor.vue index 1070739e..989ea56e 100644 --- a/src/views/bpm/form/formEditor.vue +++ b/src/views/bpm/form/formEditor.vue @@ -12,9 +12,11 @@
-
-            {{ formValue }}
-          
+
+ + {{ formValue }} + +
diff --git a/src/views/bpm/model/index.vue b/src/views/bpm/model/index.vue index 01a97d3f..25136e13 100644 --- a/src/views/bpm/model/index.vue +++ b/src/views/bpm/model/index.vue @@ -146,8 +146,8 @@ style="width: 100%" > @@ -434,9 +434,9 @@ const handleUpdate = async (rowId: number) => { // 设置数据 saveForm.value = await ModelApi.getModelApi(rowId) if (saveForm.value.category == null) { - saveForm.value.category = 1 + saveForm.value.category = '1' } else { - saveForm.value.category = Number(saveForm.value.category) + saveForm.value.category = saveForm.value.category } } diff --git a/src/views/infra/config/config.data.ts b/src/views/infra/config/config.data.ts new file mode 100644 index 00000000..41acfa15 --- /dev/null +++ b/src/views/infra/config/config.data.ts @@ -0,0 +1,90 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +const { t } = useI18n() // 国际化 + +// 表单校验 +export const rules = reactive({ + category: [required], + name: [required], + key: [required], + value: [required] +}) + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + action: true, + columns: [ + { + title: '参数分类', + field: 'category' + }, + { + title: '参数名称', + field: 'name', + isSearch: true + }, + { + title: '参数键名', + field: 'key', + isSearch: true + }, + { + title: '参数键值', + field: 'value' + }, + { + title: '系统内置', + field: 'type', + dictType: DICT_TYPE.INFRA_CONFIG_TYPE, + dictClass: 'number', + isSearch: true + }, + { + title: '是否可见', + field: 'visible', + table: { + slots: { + default: 'visible_default' + } + }, + form: { + component: 'RadioButton', + componentProps: { + options: [ + { label: '是', value: true }, + { label: '否', value: false } + ] + } + } + }, + { + title: t('form.remark'), + field: 'remark', + isTable: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + rows: 4 + }, + colProps: { + span: 24 + } + } + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false, + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } + } + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/config/form.vue b/src/views/infra/config/form.vue deleted file mode 100644 index 30e2f4d9..00000000 --- a/src/views/infra/config/form.vue +++ /dev/null @@ -1,131 +0,0 @@ - - diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index e75b09da..b2bc8a8b 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -1,203 +1,185 @@ diff --git a/src/views/infra/fileConfig/index.vue b/src/views/infra/fileConfig/index.vue index 9d796a65..bd9a978a 100644 --- a/src/views/infra/fileConfig/index.vue +++ b/src/views/infra/fileConfig/index.vue @@ -183,7 +183,7 @@ const detailData = ref() // 详情 Ref const form = ref({ id: 0, name: '', - storage: 0, + storage: null, master: false, visible: false, config: { @@ -216,7 +216,7 @@ const handleCreate = (formEl: FormInstance | undefined) => { form.value = { id: 0, name: '', - storage: 0, + storage: null, master: false, visible: false, config: { diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue index cda8b68d..b9bfb815 100644 --- a/src/views/infra/fileList/index.vue +++ b/src/views/infra/fileList/index.vue @@ -59,6 +59,7 @@ :on-exceed="handleExceed" :on-success="handleFileSuccess" :on-error="excelUploadError" + :before-remove="beforeRemove" :auto-upload="false" accept=".jpg, .png, .gif" > @@ -82,7 +83,7 @@