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] =?UTF-8?q?1=E3=80=81=E5=B2=97=E4=BD=8D=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98=202=E3=80=81=E5=9F=BA=E7=A1=80=E8=AE=BE?= =?UTF-8?q?=E6=96=BD/=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86/=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=20=E5=A4=8D=E5=88=B6=E4=B8=8D?= =?UTF-8?q?=E4=BA=86bug=203=E3=80=81=E4=BD=BF=E7=94=A8useClipboard?= =?UTF-8?q?=E4=BD=86=E6=97=A0=E6=B3=95=E5=A4=8D=E5=88=B6=E9=97=AE=E9=A2=98?= =?UTF-8?q?,=E6=8D=A2=E6=88=90=E6=B5=8F=E8=A7=88=E5=99=A8=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=204=E3=80=81=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E9=94=AE?= =?UTF-8?q?=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',