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

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

View File

@@ -245,8 +245,13 @@ 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('请输入密码')
loading.value = false
deviceRestartLoading.value = false
} else {
passwordConfirm(value)
.then((resp: any) => {
if (resp.code == 'A0000') { if (resp.code == 'A0000') {
reStartDevice({ nDid: nDid.value }).then((res: any) => { reStartDevice({ nDid: nDid.value }).then((res: any) => {
if (res.code == 'A0000') { if (res.code == 'A0000') {
@@ -256,6 +261,11 @@ const handleRestartDevice = () => {
}) })
} }
}) })
.catch(e => {
loading.value = false
deviceRestartLoading.value = false
})
}
}) })
.catch(() => { .catch(() => {
deviceRestartLoading.value = false deviceRestartLoading.value = false
@@ -398,7 +408,12 @@ const handleDelDirOrFile = (row: any) => {
inputType: 'text' inputType: 'text'
}) })
.then(({ value }) => { .then(({ value }) => {
passwordConfirm(value).then((resp: any) => { if (!value) {
ElMessage.warning('请输入密码')
loading.value = false
} else {
passwordConfirm(value)
.then((resp: any) => {
if (resp.code == 'A0000') { if (resp.code == 'A0000') {
delDeviceDir({ nDid: nDid.value, path: row.prjDataPath }).then((res: any) => { delDeviceDir({ nDid: nDid.value, path: row.prjDataPath }).then((res: any) => {
if (res.code == 'A0000') { if (res.code == 'A0000') {
@@ -409,15 +424,16 @@ const handleDelDirOrFile = (row: any) => {
}) })
} }
}) })
.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>