邓洁 : 修复bug

This commit is contained in:
dengj
2023-12-29 17:36:36 +08:00
parent 8289274d52
commit 051d0bcd6c
3 changed files with 56 additions and 55 deletions

View File

@@ -5,9 +5,9 @@
<div class="back-icon"></div>
<span>返回</span>
</div>
<div class="site-name">
{{ siteName }}
</div>
<!-- <div class="site-name">-->
<!-- {{ siteName }}-->
<!-- </div>-->
<div class="tunnel-title"></div>
<div class="all-del-btn">
<div class="all-btn" style=" margin-right: 40px;" v-if="!showAddIcon" @click="handleAdd">
@@ -259,13 +259,13 @@ const pageInfo = reactive({
});
const total = ref(10);
onMounted(() => {
getSiteDetail(siteId).then((res) => {
siteName.value = res.data.siteName
});
// getSiteDetail(siteId).then((res) => {
// siteName.value = res.data.siteName
// });
})
const handleGoSiteOrIndex = () => {
if (type === 's') {
router.push('/site/'+userId)
router.push('/site/' + userId)
} else if (type === 'i') {
router.push('/')
}
@@ -279,16 +279,18 @@ const getList = () => {
total.value = res.data.total
tunnelList.value = res.data.rows
showFirst.value = total.value / pageInfo.pageSize >= 1;
} else {
ElMessage.warning(res.msg)
}
})
}
getList()
const firstPage=()=>{
const firstPage = () => {
pageInfo.pageNum = 1
getList()
}
const lastPage=()=>{
pageInfo.pageNum = total.value/pageInfo.pageSize
const lastPage = () => {
pageInfo.pageNum = total.value / pageInfo.pageSize
getList()
}
//点击页码进行分页功能
@@ -312,7 +314,7 @@ const handleSubmit = (instance) => {
ElMessage.success('新增成功')
getList()
isVisited.value = false
}else {
} else {
ElMessage.warning(res.msg)
}
})
@@ -324,17 +326,17 @@ const handleSubmit = (instance) => {
const handleGoToEditTunnel = (tunnelId) => {
isEdit.value = true
if (type === 's') {
router.push('/edit/' + tunnelId + '/s/'+userId)
router.push('/edit/' + tunnelId + '/s/' + userId)
} else if (type === 'i') {
router.push('/edit/' + tunnelId + '/i/'+userId)
router.push('/edit/' + tunnelId + '/i/' + userId)
}
}
const handleChooseAll = () => {
tunnelList.value.map(item => {
item.checked = !item.checked
if(item.checked&&!item.isDefault){
if (item.checked && !item.isDefault) {
tunnelIds.value.push(item.tunnelId)
}else if(!item.checked&&!item.isDefault){
} else if (!item.checked && !item.isDefault) {
tunnelIds.value.map((newItem, index) => {
if (newItem === item.tunnelId) {
tunnelIds.value.splice(index, 1)
@@ -345,9 +347,9 @@ const handleChooseAll = () => {
}
const handleEditDevice = (tunnelId) => {
if (type === 's') {
router.push('/device/' + tunnelId + '/s/'+userId)
router.push('/device/' + tunnelId + '/s/' + userId)
} else if (type === 'i') {
router.push('/device/' + tunnelId + '/i/'+userId)
router.push('/device/' + tunnelId + '/i/' + userId)
}
}
const restFrom = () => {
@@ -388,23 +390,23 @@ const handleMoreDelete = () => {
if (tunnelIds.value.length === 0) {
ElMessage.warning('请先选择隧道进行删除')
} else {
ElMessageBox.confirm(`是否确定删除该隧道`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'delBox'
}).then(() => {
deleteTunnel(tunnelIds.value).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
getList()
tunnelIds.value = []
tunnelNameList.value = []
} else {
ElMessage.error(res.msg)
}
})
ElMessageBox.confirm(`是否确定删除该隧道`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'delBox'
}).then(() => {
deleteTunnel(tunnelIds.value).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
getList()
tunnelIds.value = []
tunnelNameList.value = []
} else {
ElMessage.error(res.msg)
}
})
})
}
}
@@ -628,10 +630,10 @@ const handleMoreDelete = () => {
> span:last-child {
padding:1px 8px;
padding: 1px 8px;
font-size: 32px;
border: 2px solid #05FEFF;
border-radius:10px;
border-radius: 10px;
position: relative;
}
}