|
|
@ -64,6 +64,21 @@ |
|
|
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column> |
|
|
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column> |
|
|
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column> |
|
|
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column> |
|
|
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column> |
|
|
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column> |
|
|
|
|
|
<el-table-column prop="desc" label="页面描述" :show-overflow-tooltip="true"></el-table-column> |
|
|
|
|
|
<el-table-column prop="linkParams" label="跳转参数" :show-overflow-tooltip="true" :tooltip-formatter="({ row }) => row.linkParams.map(tag=>tag.paramCnName).join(', ')"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<template v-if="scope.row.linkParams && scope.row.linkParams.length>0"> |
|
|
|
|
|
<el-tag |
|
|
|
|
|
v-for="tag in JSON.parse(scope.row.linkParams)" |
|
|
|
|
|
:key="tag.paramEnName" |
|
|
|
|
|
class="tag-item" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
> |
|
|
|
|
|
{{ tag.paramCnName }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column prop="status" label="状态" width="80"> |
|
|
<el-table-column prop="status" label="状态" width="80"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
|
|
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
|
|
@ -276,6 +291,36 @@ |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" v-if="form.menuType == 'C'"> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-input type="textarea" v-model="form.desc" placeholder="请输入页面描述" /> |
|
|
|
|
|
<template #label> |
|
|
|
|
|
<span> |
|
|
|
|
|
<el-tooltip content='页面描述' placement="top"> |
|
|
|
|
|
<el-icon><question-filled /></el-icon> |
|
|
|
|
|
</el-tooltip> |
|
|
|
|
|
页面描述 |
|
|
|
|
|
</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" v-if="form.menuType == 'C'"> |
|
|
|
|
|
<el-form-item label="跳转参数"> |
|
|
|
|
|
<el-tag |
|
|
|
|
|
style="margin: 5px " |
|
|
|
|
|
v-for="(tag,index) in form.linkParams" |
|
|
|
|
|
closable |
|
|
|
|
|
:key="tag.paramEnName" |
|
|
|
|
|
class="tag-item" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
@click="openLinkParamsDialog(tag, index)" |
|
|
|
|
|
@close="handleClose(tag,index)" |
|
|
|
|
|
> |
|
|
|
|
|
{{ tag.paramCnName }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
<el-button icon="Plus" type="primary" text @click="openLinkParamsDialog"></el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
@ -285,6 +330,28 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
<el-dialog title="跳转参数配置" v-model="linkParamsDialog" width="480px" append-to-body> |
|
|
|
|
|
<el-form :model="linkParam" label-width="100px"> |
|
|
|
|
|
<el-form-item label="英文名称" prop="paramEnName"> |
|
|
|
|
|
<el-input v-model="linkParam.paramEnName" placeholder="请输入英文名称" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="中文名称" prop="paramCnName"> |
|
|
|
|
|
<el-input v-model="linkParam.paramCnName" placeholder="请输入中文名称" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="取值类型" prop="paramType"> |
|
|
|
|
|
<el-input v-model="linkParam.paramType" placeholder="请输入取值类型" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="参数描述" prop="type"> |
|
|
|
|
|
<el-input type="textarea" v-model="linkParam.desc" placeholder="请输入参数描述" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<template #footer> |
|
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="saveLinkParam">确 定</el-button> |
|
|
|
|
|
<el-button @click="linkParamsDialog = false">取 消</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -305,9 +372,11 @@ const menuOptions = ref([]); |
|
|
const isExpandAll = ref(false); |
|
|
const isExpandAll = ref(false); |
|
|
const refreshTable = ref(true); |
|
|
const refreshTable = ref(true); |
|
|
const iconSelectRef = ref(null); |
|
|
const iconSelectRef = ref(null); |
|
|
|
|
|
const linkParamsDialog = ref(null); |
|
|
|
|
|
|
|
|
const data = reactive({ |
|
|
const data = reactive({ |
|
|
form: {}, |
|
|
form: {}, |
|
|
|
|
|
linkParam:{}, |
|
|
queryParams: { |
|
|
queryParams: { |
|
|
menuName: undefined, |
|
|
menuName: undefined, |
|
|
visible: undefined |
|
|
visible: undefined |
|
|
@ -319,8 +388,47 @@ const data = reactive({ |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data); |
|
|
const { queryParams, form, rules, linkParam } = toRefs(data); |
|
|
|
|
|
|
|
|
|
|
|
function openLinkParamsDialog(tag,index){ |
|
|
|
|
|
|
|
|
|
|
|
linkParam.value = { |
|
|
|
|
|
tagIndex : -1, |
|
|
|
|
|
paramEnName: '', |
|
|
|
|
|
paramCnName:'', |
|
|
|
|
|
paramType: '', |
|
|
|
|
|
desc:'' |
|
|
|
|
|
} |
|
|
|
|
|
if (tag){ |
|
|
|
|
|
linkParam.value = { |
|
|
|
|
|
tagIndex : index, |
|
|
|
|
|
paramEnName: tag.paramEnName, |
|
|
|
|
|
paramCnName: tag.paramCnName, |
|
|
|
|
|
paramType: tag.paramType, |
|
|
|
|
|
desc: tag.desc |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
linkParamsDialog.value = true |
|
|
|
|
|
} |
|
|
|
|
|
function saveLinkParam(){ |
|
|
|
|
|
let obj = { |
|
|
|
|
|
paramEnName: linkParam.value.paramEnName, |
|
|
|
|
|
paramCnName:linkParam.value.paramCnName, |
|
|
|
|
|
paramType: linkParam.value.paramType, |
|
|
|
|
|
desc: linkParam.value.desc} |
|
|
|
|
|
if (linkParam.value.tagIndex === -1){ |
|
|
|
|
|
if (!form.value.linkParams){ |
|
|
|
|
|
form.value.linkParams = [] |
|
|
|
|
|
} |
|
|
|
|
|
form.value.linkParams.push(obj) |
|
|
|
|
|
}else{ |
|
|
|
|
|
form.value.linkParams[linkParam.value.tagIndex] = obj |
|
|
|
|
|
} |
|
|
|
|
|
linkParamsDialog.value = false |
|
|
|
|
|
} |
|
|
|
|
|
function handleClose(tag,index){ |
|
|
|
|
|
form.value.linkParams.splice(index,1) |
|
|
|
|
|
} |
|
|
/** 查询菜单列表 */ |
|
|
/** 查询菜单列表 */ |
|
|
function getList() { |
|
|
function getList() { |
|
|
loading.value = true; |
|
|
loading.value = true; |
|
|
@ -356,7 +464,9 @@ function reset() { |
|
|
isFrame: 1, |
|
|
isFrame: 1, |
|
|
isCache: 0, |
|
|
isCache: 0, |
|
|
visible: "0", |
|
|
visible: "0", |
|
|
status: "0" |
|
|
status: "0", |
|
|
|
|
|
desc:'', |
|
|
|
|
|
linkParams: undefined |
|
|
}; |
|
|
}; |
|
|
proxy.resetForm("menuRef"); |
|
|
proxy.resetForm("menuRef"); |
|
|
} |
|
|
} |
|
|
@ -402,7 +512,11 @@ async function handleUpdate(row) { |
|
|
reset(); |
|
|
reset(); |
|
|
await getTreeselect(); |
|
|
await getTreeselect(); |
|
|
getMenu(row.menuId).then(response => { |
|
|
getMenu(row.menuId).then(response => { |
|
|
form.value = response.data; |
|
|
let obj = response.data; |
|
|
|
|
|
if (obj.linkParams && obj.linkParams.length > 0){ |
|
|
|
|
|
obj.linkParams = JSON.parse(obj.linkParams) |
|
|
|
|
|
} |
|
|
|
|
|
form.value = obj |
|
|
open.value = true; |
|
|
open.value = true; |
|
|
title.value = "修改菜单"; |
|
|
title.value = "修改菜单"; |
|
|
}); |
|
|
}); |
|
|
@ -411,14 +525,16 @@ async function handleUpdate(row) { |
|
|
function submitForm() { |
|
|
function submitForm() { |
|
|
proxy.$refs["menuRef"].validate(valid => { |
|
|
proxy.$refs["menuRef"].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
|
|
|
let obj = JSON.parse(JSON.stringify(form.value)) |
|
|
|
|
|
obj.linkParams = JSON.stringify(obj.linkParams) |
|
|
if (form.value.menuId != undefined) { |
|
|
if (form.value.menuId != undefined) { |
|
|
updateMenu(form.value).then(response => { |
|
|
updateMenu(obj).then(response => { |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
open.value = false; |
|
|
open.value = false; |
|
|
getList(); |
|
|
getList(); |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
addMenu(form.value).then(response => { |
|
|
addMenu(obj).then(response => { |
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
open.value = false; |
|
|
open.value = false; |
|
|
getList(); |
|
|
getList(); |
|
|
|