From 5bc785b0f7bd7d44c64fd6716c4e35a70b03eb1e Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Wed, 29 Mar 2023 16:53:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?1=E3=80=81=E5=B2=97=E4=BD=8D=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E9=97=AE=E9=A2=98=202=E3=80=81=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E8=AE=BE=E6=96=BD/=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86/?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E4=B8=8D=E4=BA=86bug=203=E3=80=81=E4=BD=BF=E7=94=A8useClipboar?= =?UTF-8?q?d=E4=BD=86=E6=97=A0=E6=B3=95=E5=A4=8D=E5=88=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98,=E6=8D=A2=E6=88=90=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=204=E3=80=81=E9=85=8D=E7=BD=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=94=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bpm/form/formEditor.vue | 27 ++++++++++++------- src/views/infra/build/index.vue | 27 ++++++++++++------- .../infra/codegen/components/Preview.vue | 4 +-- src/views/infra/config/index.vue | 10 ------- src/views/infra/fileList/index.vue | 6 +++-- src/views/system/user/user.data.ts | 12 ++++----- 6 files changed, 48 insertions(+), 38 deletions(-) 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/index.vue b/src/views/infra/config/index.vue index b2bc8a8b4..b87765e8d 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -127,14 +127,6 @@ const handleCreate = async () => { }, 2 ) - unref(formRef)?.addSchema( - { - field: 'value', - label: '参数键值', - component: 'Input' - }, - 3 - ) } } @@ -144,8 +136,6 @@ const handleUpdate = async (rowId: number) => { // 设置数据 const res = await ConfigApi.getConfigApi(rowId) unref(formRef)?.delSchema('key') - unref(formRef)?.delSchema('value') - unref(formRef)?.setValues(res) } diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue index b9bfb8150..c32b39cf3 100644 --- a/src/views/infra/fileList/index.vue +++ b/src/views/infra/fileList/index.vue @@ -148,10 +148,12 @@ const beforeRemove: UploadProps['beforeRemove'] = () => { // 文件数超出提示 const handleExceed = (): void => { message.error('最多只能上传一个文件!') + uploadDisabled.value = false } // 上传错误提示 const excelUploadError = (): void => { message.error('导入数据失败,请您重新上传!') + uploadDisabled.value = false } // 详情操作 @@ -165,11 +167,11 @@ const handleDetail = (row: FileApi.FileVO) => { // ========== 复制相关 ========== const handleCopy = 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/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', -- Gitee From 5024f0aed638a7d8b8e242e4f95ee50572817551 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Wed, 29 Mar 2023 16:58:06 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/infra/fileList/index.vue | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue index c32b39cf3..86aa39140 100644 --- a/src/views/infra/fileList/index.vue +++ b/src/views/infra/fileList/index.vue @@ -166,14 +166,26 @@ const handleDetail = (row: FileApi.FileVO) => { // ========== 复制相关 ========== const handleCopy = async (text: string) => { - const { copy, copied, isSupported } = useClipboard({ source: text }) - if (!isSupported.value) { - message.error(t('common.copyError')) - } else { - await copy() - if (unref(copied.value)) { - message.success(t('common.copySuccess')) - } - } + let url = 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 { copy, copied, isSupported } = useClipboard({ source: text, read: true }) + // console.log(copy, 'copycopycopy') + // console.log(copied, 'copiedcopiedcopied') + // console.log(isSupported, 'isSupportedisSupportedisSupported') + // if (!isSupported.value) { + // message.error(t('common.copyError')) + // } else { + // await copy() + // if (unref(copied.value)) { + // message.success(t('common.copySuccess')) + // } + // } } -- Gitee From 776032db824a66184d4232723b562d4bdf8382bd Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Thu, 30 Mar 2023 18:07:56 +0800 Subject: [PATCH 3/6] =?UTF-8?q?1=E3=80=81=E4=B8=8A=E4=BC=A0=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=B9=8B=E5=90=8E=E6=97=A0=E6=B3=95=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=202=E3=80=81=E5=9F=BA=E7=A1=80=E8=AE=BE?= =?UTF-8?q?=E6=96=BD/=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=9C=80=E8=A6=81=E9=80=89=E6=8B=A9=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=8F=AF=E8=A7=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/infra/config/config.data.ts | 3 ++- src/views/infra/fileList/index.vue | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) 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/fileList/index.vue b/src/views/infra/fileList/index.vue index 86aa39140..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/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) -- Gitee From 865e09f2f21a0568aaeacbd67a5bbceadc812aa9 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Fri, 31 Mar 2023 16:04:20 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/infra/config/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index b87765e8d..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 }) @@ -134,7 +134,7 @@ 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)?.setValues(res) } @@ -142,7 +142,7 @@ const handleUpdate = async (rowId: number) => { // 详情操作 const handleDetail = async (rowId: number) => { setDialogTile('detail') - const res = await ConfigApi.getConfigApi(rowId) + const res = await ConfigApi.getConfig(rowId) detailData.value = res } @@ -157,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 -- Gitee From ec89d4c2c391010c44dfa114a3fcbc7a374febbf Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Fri, 31 Mar 2023 16:08:12 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E9=94=99=E5=88=86=E6=94=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/infra/job/JobLog.vue | 1 - src/views/infra/job/job.data.ts | 1 + src/views/infra/job/jobLog.data.ts | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/infra/job/JobLog.vue b/src/views/infra/job/JobLog.vue index 1bf9d7453..1771bbd74 100644 --- a/src/views/infra/job/JobLog.vue +++ b/src/views/infra/job/JobLog.vue @@ -49,7 +49,6 @@