文件上传进度条
This commit is contained in:
@@ -213,3 +213,13 @@
|
|||||||
.el-drawer__header {
|
.el-drawer__header {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//tabs 添加icon样式
|
||||||
|
.custom-tabs-label{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
.el-icon {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,10 +62,20 @@
|
|||||||
<div class="list" v-if="dirList.length != 0 && !loading">
|
<div class="list" v-if="dirList.length != 0 && !loading">
|
||||||
<div class="list_item" v-for="(item, index) in dirList" :key="index">
|
<div class="list_item" v-for="(item, index) in dirList" :key="index">
|
||||||
<div class="item_download">
|
<div class="item_download">
|
||||||
|
<el-button
|
||||||
|
v-if="activePath && activePath != '/'"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="handleDelDirOrFile(item)"
|
||||||
|
circle
|
||||||
|
>
|
||||||
|
<el-icon><Delete /></el-icon>
|
||||||
|
</el-button>
|
||||||
<el-button v-if="item?.type == 'file'" size="small" @click="handleDownLoad(item)" circle>
|
<el-button v-if="item?.type == 'file'" size="small" @click="handleDownLoad(item)" circle>
|
||||||
<el-icon><Download /></el-icon>
|
<el-icon><Download /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-popconfirm
|
|
||||||
|
<!-- <el-popconfirm
|
||||||
width="220"
|
width="220"
|
||||||
confirm-button-text="确认"
|
confirm-button-text="确认"
|
||||||
cancel-button-text="取消"
|
cancel-button-text="取消"
|
||||||
@@ -78,7 +88,7 @@
|
|||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-popconfirm>
|
</el-popconfirm> -->
|
||||||
</div>
|
</div>
|
||||||
<img v-if="item?.type == 'dir'" @click="handleIntoDir(item)" src="@/assets/img/wenjianjia.svg" />
|
<img v-if="item?.type == 'dir'" @click="handleIntoDir(item)" src="@/assets/img/wenjianjia.svg" />
|
||||||
<img
|
<img
|
||||||
@@ -180,22 +190,7 @@ const nodeClick = (e: any) => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
nDid.value = e.ndid
|
nDid.value = e.ndid
|
||||||
dirList.value = []
|
dirList.value = []
|
||||||
activePath.value = ''
|
|
||||||
activePathList.value = []
|
activePathList.value = []
|
||||||
// getDeviceRootPath(nDid.value)
|
|
||||||
// .then((res: any) => {
|
|
||||||
// loading.value = false
|
|
||||||
// dirList.value = [res.data]
|
|
||||||
// activePath.value = res.data.prjDataPath
|
|
||||||
// activePathList.value.map((item: any, index: any) => {
|
|
||||||
// if (item.path.indexOf(res.data.prjDataPath) == -1) {
|
|
||||||
// activePathList.value.push({ path: activePath.value })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// .catch(e => {
|
|
||||||
// loading.value = false
|
|
||||||
// })
|
|
||||||
activePath.value = '/'
|
activePath.value = '/'
|
||||||
getFileServiceFileOrDir({ nDid: nDid.value, name: activePath.value, type: 'dir' })
|
getFileServiceFileOrDir({ nDid: nDid.value, name: activePath.value, type: 'dir' })
|
||||||
.then((resp: any) => {
|
.then((resp: any) => {
|
||||||
@@ -240,9 +235,13 @@ const deviceRestartLoading = ref<boolean>(false)
|
|||||||
const handleRestartDevice = () => {
|
const handleRestartDevice = () => {
|
||||||
deviceRestartLoading.value = true
|
deviceRestartLoading.value = true
|
||||||
ElMessageBox.prompt('二次校验密码确认', '装置重启', {
|
ElMessageBox.prompt('二次校验密码确认', '装置重启', {
|
||||||
|
// confirmButtonText: '确认',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// customClass: 'customInput',
|
||||||
|
// inputType: 'text'
|
||||||
|
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
customClass: 'customInput',
|
|
||||||
inputType: 'text'
|
inputType: 'text'
|
||||||
})
|
})
|
||||||
.then(({ value }) => {
|
.then(({ value }) => {
|
||||||
@@ -385,12 +384,36 @@ const submitDeviceDir = () => {
|
|||||||
//删除文件夹或文件
|
//删除文件夹或文件
|
||||||
const handleDelDirOrFile = (row: any) => {
|
const handleDelDirOrFile = (row: any) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
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') {
|
||||||
reloadCurrentMenu(res.message)
|
// reloadCurrentMenu(res.message)
|
||||||
// ElMessage({ message: res.message, type: 'success', duration: 5000 })
|
// // ElMessage({ message: res.message, type: 'success', duration: 5000 })
|
||||||
}
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
ElMessageBox.prompt('二次校验密码确认', '删除', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
customClass: 'customInput',
|
||||||
|
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 })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
// deviceRestartLoading.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
//取消删除
|
//取消删除
|
||||||
const cancelEvent = () => {}
|
const cancelEvent = () => {}
|
||||||
@@ -492,7 +515,7 @@ mqttRef.value.on('close', function () {
|
|||||||
console.log('mqtt客户端已断开连接.....')
|
console.log('mqtt客户端已断开连接.....')
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
status.value =0
|
status.value = 0
|
||||||
fileName.value = localStorage.getItem('fileName') ? localStorage.getItem('fileName') : ''
|
fileName.value = localStorage.getItem('fileName') ? localStorage.getItem('fileName') : ''
|
||||||
changeType.value = localStorage.getItem('changeType') ? localStorage.getItem('changeType') : ''
|
changeType.value = localStorage.getItem('changeType') ? localStorage.getItem('changeType') : ''
|
||||||
})
|
})
|
||||||
@@ -631,5 +654,8 @@ onBeforeUnmount(() => {
|
|||||||
.el-form {
|
.el-form {
|
||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.customInput{
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user