diff --git a/src/views/bpm/form/formEditor.vue b/src/views/bpm/form/formEditor.vue index 989ea56ed..418a75e85 100644 --- a/src/views/bpm/form/formEditor.vue +++ b/src/views/bpm/form/formEditor.vue @@ -133,15 +133,24 @@ const openModel = (title: string) => { } /** 复制 **/ const copy = async (text: string) => { - const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported) { - message.error(t('common.copyError')) - } else { - await copy() - if (unref(copied)) { - message.success(t('common.copySuccess')) - } - } + // const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) }) + // if (!isSupported.value) { + // message.error(t('common.copyError')) + // } else { + // await copy() + // if (unref(copied.value)) { + // message.success(t('common.copySuccess')) + // } + // } + let url = JSON.stringify(text) + let oInput = document.createElement('textarea') + oInput.value = url + document.body.appendChild(oInput) + oInput.select() // 选择对象; + // console.log(oInput.value) + document.execCommand('Copy') // 执行浏览器复制命令 + message.success(t('common.copySuccess')) + oInput.remove() } // ========== 初始化 ========== onMounted(() => { diff --git a/src/views/infra/build/index.vue b/src/views/infra/build/index.vue index 6f577e952..b3af638b4 100644 --- a/src/views/infra/build/index.vue +++ b/src/views/infra/build/index.vue @@ -77,15 +77,24 @@ const showTemplate = () => { /** 复制 **/ const copy = async (text: string) => { - const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported) { - message.error(t('common.copyError')) - } else { - await copy() - if (unref(copied)) { - message.success(t('common.copySuccess')) - } - } + // const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) }) + // if (!isSupported.value) { + // message.error(t('common.copyError')) + // } else { + // await copy() + // if (unref(copied.value)) { + // message.success(t('common.copySuccess')) + // } + // } + let url = JSON.stringify(text) + let oInput = document.createElement('textarea') + oInput.value = url + document.body.appendChild(oInput) + oInput.select() // 选择对象; + // console.log(oInput.value) + document.execCommand('Copy') // 执行浏览器复制命令 + message.success(t('common.copySuccess')) + oInput.remove() } const makeTemplate = () => { diff --git a/src/views/infra/codegen/components/Preview.vue b/src/views/infra/codegen/components/Preview.vue index 2d9482ff0..6a6246a8e 100644 --- a/src/views/infra/codegen/components/Preview.vue +++ b/src/views/infra/codegen/components/Preview.vue @@ -130,11 +130,11 @@ const handleFiles = (datas: CodegenPreviewVO[]) => { /** 复制 **/ const copy = async (text: string) => { const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported) { + if (!isSupported.value) { message.error(t('common.copyError')) } else { await copy() - if (unref(copied)) { + if (unref(copied.value)) { message.success(t('common.copySuccess')) } } diff --git a/src/views/infra/config/config.data.ts b/src/views/infra/config/config.data.ts index 41acfa153..635745a56 100644 --- a/src/views/infra/config/config.data.ts +++ b/src/views/infra/config/config.data.ts @@ -6,7 +6,8 @@ export const rules = reactive({ category: [required], name: [required], key: [required], - value: [required] + value: [required], + visible: [{ required: true, message: '请选择是否可见', trigger: 'change' }] }) // CrudSchema diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index b2bc8a8b4..ddf9eebae 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -93,8 +93,8 @@ const message = useMessage() // 消息弹窗 // 列表相关的变量 const [registerTable, { reload, deleteData, exportList }] = useXTable({ allSchemas: allSchemas, - getListApi: ConfigApi.getConfigPageApi, - deleteApi: ConfigApi.deleteConfigApi, + getListApi: ConfigApi.getConfigPage, + deleteApi: ConfigApi.deleteConfig, exportListApi: ConfigApi.exportConfigApi }) @@ -127,14 +127,6 @@ const handleCreate = async () => { }, 2 ) - unref(formRef)?.addSchema( - { - field: 'value', - label: '参数键值', - component: 'Input' - }, - 3 - ) } } @@ -142,17 +134,15 @@ const handleCreate = async () => { const handleUpdate = async (rowId: number) => { setDialogTile('update') // 设置数据 - const res = await ConfigApi.getConfigApi(rowId) + const res = await ConfigApi.getConfig(rowId) unref(formRef)?.delSchema('key') - unref(formRef)?.delSchema('value') - unref(formRef)?.setValues(res) } // 详情操作 const handleDetail = async (rowId: number) => { setDialogTile('detail') - const res = await ConfigApi.getConfigApi(rowId) + const res = await ConfigApi.getConfig(rowId) detailData.value = res } @@ -167,10 +157,10 @@ const submitForm = async () => { try { const data = unref(formRef)?.formModel as ConfigApi.ConfigVO if (actionType.value === 'create') { - await ConfigApi.createConfigApi(data) + await ConfigApi.createConfig(data) message.success(t('common.createSuccess')) } else { - await ConfigApi.updateConfigApi(data) + await ConfigApi.updateConfig(data) message.success(t('common.updateSuccess')) } dialogVisible.value = false diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue index b9bfb8150..2309d05ce 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" + :on-change="handleFileChange" :before-remove="beforeRemove" :auto-upload="false" accept=".jpg, .png, .gif" @@ -83,7 +84,7 @@ diff --git a/src/views/system/notice/form.vue b/src/views/system/notice/form.vue deleted file mode 100644 index b8a49586c..000000000 --- a/src/views/system/notice/form.vue +++ /dev/null @@ -1,131 +0,0 @@ - - diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 8add0eaba..aceadbbaa 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -1,159 +1,148 @@ - diff --git a/src/views/system/notice/notice.data.ts b/src/views/system/notice/notice.data.ts new file mode 100644 index 000000000..7a72a7239 --- /dev/null +++ b/src/views/system/notice/notice.data.ts @@ -0,0 +1,59 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +const { t } = useI18n() // 国际化 + +// 表单校验 +export const rules = reactive({ + title: [required], + type: [required] +}) + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'seq', + action: true, + columns: [ + { + title: '公告标题', + field: 'title', + isSearch: true + }, + { + title: '公告类型', + field: 'type', + dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE, + dictClass: 'number' + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number', + isSearch: true + }, + { + title: '公告内容', + field: 'content', + table: { + type: 'html' + }, + form: { + component: 'Editor', + colProps: { + span: 24 + }, + componentProps: { + valueHtml: '' + } + }, + isTable: false + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index 7f7384eb9..2ea4d2680 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -28,7 +28,7 @@ export const rules = reactive({ } ], status: [required], - postIds: [{ required: true, message: '请选择岗位', trigger: ['blur', 'change'] }], + postIds: [required], mobile: [ required, { @@ -86,11 +86,6 @@ const crudSchemas = reactive({ field: 'deptId', isTable: false }, - { - title: '岗位', - field: 'postIds', - isTable: false - }, { title: t('common.status'), field: 'status', @@ -103,6 +98,11 @@ const crudSchemas = reactive({ } } }, + { + title: '岗位', + field: 'postIds', + isTable: false + }, { title: '最后登录时间', field: 'loginDate',