From 789a06f393f64394954492b3b9a884d6d4dd7eba Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Tue, 24 Sep 2024 09:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9C=8D=E5=8A=A1=E5=88=A0?= =?UTF-8?q?=E9=99=A4/=E8=AE=BE=E5=A4=87=E9=87=8D=E5=90=AF=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/fileService/index.vue | 65 ++++++++++++------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/src/views/govern/device/fileService/index.vue b/src/views/govern/device/fileService/index.vue index ba4e8af..1a79c5b 100644 --- a/src/views/govern/device/fileService/index.vue +++ b/src/views/govern/device/fileService/index.vue @@ -245,17 +245,27 @@ const handleRestartDevice = () => { inputType: 'text' }) .then(({ value }) => { - console.log(document.querySelector('.custom-message-box'), '77788888', value) - passwordConfirm(value).then((resp: any) => { - if (resp.code == 'A0000') { - reStartDevice({ nDid: nDid.value }).then((res: any) => { - if (res.code == 'A0000') { - deviceRestartLoading.value = false - ElMessage({ message: res.message, type: 'success', duration: 5000 }) + if (!value) { + ElMessage.warning('请输入密码') + loading.value = false + deviceRestartLoading.value = false + } else { + passwordConfirm(value) + .then((resp: any) => { + if (resp.code == 'A0000') { + reStartDevice({ nDid: nDid.value }).then((res: any) => { + if (res.code == 'A0000') { + deviceRestartLoading.value = false + ElMessage({ message: res.message, type: 'success', duration: 5000 }) + } + }) } }) - } - }) + .catch(e => { + loading.value = false + deviceRestartLoading.value = false + }) + } }) .catch(() => { deviceRestartLoading.value = false @@ -398,26 +408,32 @@ const handleDelDirOrFile = (row: any) => { inputType: 'text' }) .then(({ value }) => { - passwordConfirm(value).then((resp: any) => { - if (resp.code == 'A0000') { - delDeviceDir({ nDid: nDid.value, path: row.prjDataPath }).then((res: any) => { - if (res.code == 'A0000') { - reloadCurrentMenu(res.message) - loading.value = false - // ElMessage({ message: res.message, type: 'success', duration: 5000 }) + if (!value) { + ElMessage.warning('请输入密码') + loading.value = false + } else { + passwordConfirm(value) + .then((resp: any) => { + if (resp.code == 'A0000') { + delDeviceDir({ nDid: nDid.value, path: row.prjDataPath }).then((res: any) => { + if (res.code == 'A0000') { + reloadCurrentMenu(res.message) + loading.value = false + // ElMessage({ message: res.message, type: 'success', duration: 5000 }) + } + }) } }) - } - }) + .catch(e => { + loading.value = false + }) + } }) .catch(() => { loading.value = false - // deviceRestartLoading.value = false }) } -//取消删除 -const cancelEvent = () => {} -const changeType = ref('') +const changeType = ref('') //下载文件 const fileRef = ref() const handleDownLoad = async (row: any) => { @@ -428,7 +444,7 @@ const handleDownLoad = async (row: any) => { localStorage.setItem('changeType', changeType.value) } //上传文件 -const fileName = ref('') +const fileName = ref('') const handleUpload = (e: any, fileList: any, row: any) => { // loading.value=true fileName.value = e.name @@ -655,7 +671,6 @@ onBeforeUnmount(() => { padding: 20px 10px; box-sizing: border-box; } -.customInput{ - +.customInput { }