修复菜单树点击问题、修复应用设置图标没默认显示问题,。

This commit is contained in:
hyt 2024-04-08 16:32:44 +08:00
parent 232c436863
commit 31b8ae27a1
4 changed files with 82 additions and 15 deletions

View File

@ -20,7 +20,7 @@
<el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload" list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess" :show-file-list="false"> <el-upload class="avatar-uploader" ref="upload" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-progress="handleProgress" :before-upload="beforeUpload" list-type="picture" :limit="1" :disabled="lookFlag" :on-success="handleAvatarSuccess" :show-file-list="false">
<div class="line"> <div class="line">
<div class="left"> <div class="left">
<img v-if="imgUrl" :src="imgUrl" class="avatar"> <img v-if="imgUrl" :src="imgUrl" class="avatar" @error="handleImageError">
<!-- <el-image style="width: 64px; height: 64px" :src="iconBase64" fit="cover" alt="点击上传"> <!-- <el-image style="width: 64px; height: 64px" :src="iconBase64" fit="cover" alt="点击上传">
<template v-slot:error> <template v-slot:error>
<div style="line-height: 64px; font-size: 12px"> <div style="line-height: 64px; font-size: 12px">
@ -76,6 +76,9 @@ export default {
}; };
}, },
methods: { methods: {
handleImageError(row) {
this.imgUrl = require('./images/1.png')
},
// //
handleProgress(file, fileList) { handleProgress(file, fileList) {
this.loading = true this.loading = true
@ -306,9 +309,12 @@ export default {
border: 1px dashed #999999; border: 1px dashed #999999;
width: 64px; width: 64px;
height: 64px; height: 64px;
display: flex;
justify-content: center;
align-items: center;
> img { > img {
width: 100%; width: 100%;
height: 100%; // height: 100%;
} }
} }
.right { .right {

View File

@ -48,7 +48,7 @@
<img src="./images/5.png" alt="" /> <img src="./images/5.png" alt="" />
</template> --> </template> -->
<template> <template>
<img :src="row.imgUrl" alt="" /> <img :src="row.imgUrl" alt="" @error="handleImageError(row)"/>
</template> </template>
</div> </div>
<div class="nameInfo"> <div class="nameInfo">
@ -136,6 +136,9 @@ export default {
}; };
}, },
methods: { methods: {
handleImageError(row) {
row.imgUrl = require('./images/1.png')
},
// //
async appStatusChange(val, row) { async appStatusChange(val, row) {
const res = await getApiModuleApi({ const res = await getApiModuleApi({
@ -322,10 +325,13 @@ export default {
flex: 0.25; flex: 0.25;
width: 29px; width: 29px;
height: 29px; height: 29px;
display: flex;
justify-content: center;
align-items: center;
img { img {
width: 100%; width: 100%;
height: 100%; // height: 100%;
} }
} }

View File

@ -16,10 +16,10 @@
<img src="./images/4.png" alt="" style="width: 64px; height: 64px"/> <img src="./images/4.png" alt="" style="width: 64px; height: 64px"/>
</template> </template>
<template v-else-if="name==='ERP'"> <template v-else-if="name==='ERP'">
<img src="./images/5.png" alt="" style="width: 64px; height: 64px"/> <img src="./images/5.png" alt="" />
</template> --> </template> -->
<template> <template>
<img :src="imgUrl" alt="" style="width: 64px; height: 64px"/> <img :src="imgUrl" alt="" @error="handleImageError" style="width: 64px;"/>
</template> </template>
</div> </div>
<div class="appName">{{ name }}</div> <div class="appName">{{ name }}</div>
@ -62,6 +62,9 @@ export default {
}; };
}, },
methods: { methods: {
handleImageError(row) {
this.imgUrl = require('./images/1.png')
},
flashActive(val) { flashActive(val) {
this.menuActived = val this.menuActived = val
}, },
@ -137,6 +140,9 @@ export default {
> .img { > .img {
width: 64px; width: 64px;
height: 64px; height: 64px;
display: flex;
justify-content: center;
align-items: center;
} }
.appName { .appName {

View File

@ -180,7 +180,56 @@ export default {
}) })
}, },
handleSelectionChange(val, row) { handleSelectionChange(val, row) {
row.check = !row.check this.multipleSelection = val
let data = this.treeToArray([row])
this.childNode = !row.check
console.log(this.childNode,'this.childNode')
if (data.length > 1) {
console.log(data,'data')
data.forEach((el, index) => {
el.check = this.childNode
this.$refs.multipleTable.toggleRowSelection(el, this.childNode)
})
let ids = data[0].id
let arr = this.treeFindPath(
this.menuDatas,
(data) => data.id == ids,
'id'
)
arr = arr.splice(0, arr.length - 1)
let dataList = []
let allList = this.treeToArray(this.menuDatas)
allList.forEach((el, index) => {
if (arr.includes(el.id)) {
dataList.push(el)
}
})
dataList.forEach((el, index) => {
el.check = true
this.$refs.multipleTable.toggleRowSelection(el, true)
})
} else {
let ids = data[0].id
let arr = this.treeFindPath(
this.menuDatas,
(data) => data.id == ids,
'id'
)
console.log(arr,'arr')
// arr = arr.splice(0, arr.length - 1)
let dataList = []
let allList = this.treeToArray(this.menuDatas)
allList.forEach((el, index) => {
if (arr.includes(el.id)) {
dataList.push(el)
}
})
console.log(dataList,'dataList')
dataList.forEach((el, index) => {
el.check = this.childNode
this.$refs.multipleTable.toggleRowSelection(el, this.childNode )
})
}
}, },
// //
exhibitList(menu, homeList, id) { exhibitList(menu, homeList, id) {
@ -239,13 +288,13 @@ export default {
} }
this.homeListHandle(params.sysPopedomHomeEntities) this.homeListHandle(params.sysPopedomHomeEntities)
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities) this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
const res = await authApi("sysUserService","","saveJurisdiction","",params) const res = await authApi('sysUserService', '', 'saveJurisdiction', '', params)
if(res.status == '200'){ if (res.status == '200') {
this.handleDialogClose(); this.handleDialogClose()
this.$message({ this.$message({
message: "保存成功", message: '保存成功',
type: "success", type: 'success'
}); })
} }
}, },
// //
@ -265,7 +314,7 @@ export default {
}) })
} }
if (item.children.length) { if (item.children.length) {
this.menuListHandle(item.children, result,btnResult) this.menuListHandle(item.children, result, btnResult)
} }
if (item.buttonList.length) { if (item.buttonList.length) {
this.btnListHandle(item.buttonList, btnResult, item.id) this.btnListHandle(item.buttonList, btnResult, item.id)
@ -276,7 +325,7 @@ export default {
btnListHandle(list, btnResult, menuId) { btnListHandle(list, btnResult, menuId) {
list.forEach(item => { list.forEach(item => {
if (item.check) { if (item.check) {
console.log(btnResult,'btnResult') console.log(btnResult, 'btnResult')
btnResult.push({ btnResult.push({
menuId, menuId,
operate: item.id operate: item.id