文件服务删除/设备重启输入密码错误处理

This commit is contained in:
zhujiyan
2024-09-24 09:22:10 +08:00
parent 66be230585
commit 789a06f393

View File

@@ -245,17 +245,27 @@ const handleRestartDevice = () => {
inputType: 'text' inputType: 'text'
}) })
.then(({ value }) => { .then(({ value }) => {
console.log(document.querySelector('.custom-message-box'), '77788888', value) if (!value) {
passwordConfirm(value).then((resp: any) => { ElMessage.warning('请输入密码')
if (resp.code == 'A0000') { loading.value = false
reStartDevice({ nDid: nDid.value }).then((res: any) => { deviceRestartLoading.value = false
if (res.code == 'A0000') { } else {
deviceRestartLoading.value = false passwordConfirm(value)
ElMessage({ message: res.message, type: 'success', duration: 5000 }) .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(() => { .catch(() => {
deviceRestartLoading.value = false deviceRestartLoading.value = false
@@ -398,26 +408,32 @@ const handleDelDirOrFile = (row: any) => {
inputType: 'text' inputType: 'text'
}) })
.then(({ value }) => { .then(({ value }) => {
passwordConfirm(value).then((resp: any) => { if (!value) {
if (resp.code == 'A0000') { ElMessage.warning('请输入密码')
delDeviceDir({ nDid: nDid.value, path: row.prjDataPath }).then((res: any) => { loading.value = false
if (res.code == 'A0000') { } else {
reloadCurrentMenu(res.message) passwordConfirm(value)
loading.value = false .then((resp: any) => {
// ElMessage({ message: res.message, type: 'success', duration: 5000 }) 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(() => { .catch(() => {
loading.value = false loading.value = false
// deviceRestartLoading.value = false
}) })
} }
//取消删除 const changeType = ref<any>('')
const cancelEvent = () => {}
const changeType = ref<string>('')
//下载文件 //下载文件
const fileRef = ref() const fileRef = ref()
const handleDownLoad = async (row: any) => { const handleDownLoad = async (row: any) => {
@@ -428,7 +444,7 @@ const handleDownLoad = async (row: any) => {
localStorage.setItem('changeType', changeType.value) localStorage.setItem('changeType', changeType.value)
} }
//上传文件 //上传文件
const fileName = ref<string>('') const fileName = ref<any>('')
const handleUpload = (e: any, fileList: any, row: any) => { const handleUpload = (e: any, fileList: any, row: any) => {
// loading.value=true // loading.value=true
fileName.value = e.name fileName.value = e.name
@@ -655,7 +671,6 @@ onBeforeUnmount(() => {
padding: 20px 10px; padding: 20px 10px;
box-sizing: border-box; box-sizing: border-box;
} }
.customInput{ .customInput {
} }
</style> </style>