fix:权限

This commit is contained in:
大黑 2025-12-26 19:09:11 +08:00
parent d230b62ef1
commit aef6d7d67f
16 changed files with 281853 additions and 258 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,146 @@
{
"entry": "index.js",
"copyAssets": ["public/custom/apaas-custom-mydemo"],
"router": {
"apaas-custom-modalContorl":{
"name": "apaas-custom-modalContorl",
"path": "apaas-custom-modalContorl",
"meta": {
"title": "模板管理"
}
},
"apaas-custom-selfEnginedata":{
"name": "apaas-custom-selfEnginedata",
"path": "apaas-custom-selfEnginedata",
"meta": {
"title": "玉柴发动机数据"
}
},
"apaas-custom-otherEnginedata":{
"name": "apaas-custom-otherEnginedata",
"path": "apaas-custom-otherEnginedata",
"meta": {
"title": "竞品发动机数据"
}
},
"apaas-custom-checkData":{
"name": "apaas-custom-checkData",
"path": "apaas-custom-checkData",
"meta": {
"title": "数据检查"
}
},
"apaas-custom-report":{
"name": "apaas-custom-report",
"path": "apaas-custom-report",
"meta": {
"title": "对标报告"
}
},
"apaas-custom-reportList":{
"name": "apaas-custom-reportList",
"path": "apaas-custom-reportList",
"meta": {
"title": "报告列表"
}
},
"apaas-custom-reportDetail":{
"name": "apaas-custom-reportDetail",
"path": "apaas-custom-reportDetail",
"meta": {
"title": "报告详情"
}
},
"apaas-custom-reportCheck":{
"name": "apaas-custom-reportCheck",
"path": "apaas-custom-reportCheck",
"meta": {
"title": "报告检查"
}
},
"apaas-custom-modelDetail":{
"name": "apaas-custom-modelDetail",
"path": "apaas-custom-modelDetail",
"meta": {
"title": "系统参数管理"
}
},
"apaas-custom-engineDetail":{
"name": "apaas-custom-engineDetail",
"path": "apaas-custom-engineDetail",
"meta": {
"title": "发动机参数详情"
}
},
"apaas-custom-approvalManagement":{
"name": "apaas-custom-approvalManagement",
"path": "apaas-custom-approvalManagement",
"meta": {
"title": "模板审批管理"
}
},
"apaas-custom-toDoList":{
"name": "apaas-custom-toDoList",
"path": "apaas-custom-toDoList",
"meta": {
"title": "数据待办"
}
},
"apaas-custom-myDone":{
"name": "apaas-custom-myDone",
"path": "apaas-custom-myDone",
"meta": {
"title": "我的已办"
}
},
"apaas-custom-mySend":{
"name": "apaas-custom-mySend",
"path": "apaas-custom-mySend",
"meta": {
"title": "我发起的"
}
},
"apaas-custom-selfEngineCheck":{
"name": "apaas-custom-selfEngineCheck",
"path": "apaas-custom-selfEngineCheck",
"meta": {
"title": "玉柴发动机审核"
}
},
"apaas-custom-otherEngineCheck":{
"name": "apaas-custom-otherEngineCheck",
"path": "apaas-custom-otherEngineCheck",
"meta": {
"title": "竞品发动机审核"
}
},
"apaas-custom-managerData":{
"name": "apaas-custom-managerData",
"path": "apaas-custom-managerData",
"meta": {
"title": "责任人管理"
}
},
"apaas-custom-fillerData":{
"name": "apaas-custom-fillerData",
"path": "apaas-custom-fillerData",
"meta": {
"title": "填写人管理"
}
},
"apaas-custom-permissionManagement":{
"name": "apaas-custom-permissionManagement",
"path": "apaas-custom-permissionManagement",
"meta": {
"title": "权限管理"
}
}
},
"customWidgetList": [
{
"code": "mydemo",
"text": "mydemo"
}
],
"outputName": "apaas-custom-mydemo"
}

View File

@ -0,0 +1,10 @@
<meta charset="utf-8">
<title>apaas-custom-mydemo demo</title>
<script src="./apaas-custom-mydemo.umd.js"></script>
<link rel="stylesheet" href="./apaas-custom-mydemo.css">
<script>
console.log(apaas-custom-mydemo)
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -121,6 +121,11 @@
style="background: #E6A23C; padding: 4px 8px; color: white; border-radius: 20px;" style="background: #E6A23C; padding: 4px 8px; color: white; border-radius: 20px;"
>审核中</span >审核中</span
> >
<span
v-else-if="row[colConfig.prop] === 'DRAFT'"
style="background: #909399; padding: 4px 8px; color: white; border-radius: 20px;"
>草稿</span
>
<span <span
v-else-if="row[colConfig.prop] === 'COMPLETE'" v-else-if="row[colConfig.prop] === 'COMPLETE'"
style="background: #67C23A; padding: 4px 8px; color: white; border-radius: 20px;" style="background: #67C23A; padding: 4px 8px; color: white; border-radius: 20px;"

View File

@ -18,7 +18,12 @@
> >
<el-form ref="editForm" :model="formData" :rules="formRules" label-width="100px"> <el-form ref="editForm" :model="formData" :rules="formRules" label-width="100px">
<el-form-item label="名称:" prop="name"> <el-form-item label="名称:" prop="name">
<el-input v-model="formData.templateName" placeholder="请输入名称" maxlength="100" /> <el-input
v-model="formData.templateName"
placeholder="请输入名称"
maxlength="100"
:disabled="!isNameEditable"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
@ -45,6 +50,7 @@ export default {
currentRow: null, currentRow: null,
userData: getAuthModule(), userData: getAuthModule(),
mode: 'add', // 'add' 'edit' mode: 'add', // 'add' 'edit'
currentStatus: '', //
formData: { formData: {
templateName: '', templateName: '',
template_status: '', template_status: '',
@ -63,12 +69,23 @@ export default {
computed: { computed: {
modalTitle() { modalTitle() {
return this.mode === 'add' ? '添加模板' : '修改' return this.mode === 'add' ? '添加模板' : '修改'
},
//
isNameEditable() {
//
if (this.mode === 'add') {
return true
}
//
const status = this.currentStatus || ''
return status !== '审核中' && status !== 'APPROVING' && status !== 'REVIEWING'
} }
}, },
methods: { methods: {
showModal(row, mode = 'edit') { showModal(row, mode = 'edit', status = '') {
this.mode = mode this.mode = mode
this.currentRow = row this.currentRow = row
this.currentStatus = status || (row && row.status) || ''
// //
if (mode === 'add') { if (mode === 'add') {
this.formData = { this.formData = {
@ -92,6 +109,7 @@ export default {
closeModal() { closeModal() {
this.visible = false this.visible = false
this.currentRow = null this.currentRow = null
this.currentStatus = ''
this.formData = { this.formData = {
templateName: '', templateName: '',
template_status: '' template_status: ''

View File

@ -34,13 +34,13 @@
</el-select> </el-select>
</div> </div>
<div class="search-actions"> <div class="search-actions">
<el-button type="primary" @click="handleDownloadImportTemplate"> <el-button v-if="hasTemplateManagementEditPermission()" type="primary" @click="handleDownloadImportTemplate">
下载导入模板 下载导入模板
</el-button> </el-button>
<el-button v-if="isAdmin()" class="import-btn" @click="handleImportTemplate()"> <el-button v-if="hasTemplateManagementEditPermission()" class="import-btn" @click="handleImportTemplate()">
导入参数模板 导入参数模板
</el-button> </el-button>
<el-button v-if="isAdmin()" type="primary" @click="handleAddTemplate()"> <el-button v-if="hasTemplateManagementEditPermission()" type="primary" @click="handleAddTemplate()">
添加参数模板 添加参数模板
</el-button> </el-button>
</div> </div>
@ -104,7 +104,7 @@
</a> </a>
<span class="link-separator"></span> <span class="link-separator"></span>
<a <a
v-if="row.status === 'DRAFT' && isAdmin()" v-if="hasTemplateManagementEditPermission()"
href="javascript:void(0)" href="javascript:void(0)"
class="el-link el-link--primary" class="el-link el-link--primary"
@click.stop="handleRowEdit(row)" @click.stop="handleRowEdit(row)"
@ -348,9 +348,42 @@ export default {
return false return false
} }
}, },
// 使 permissionPath
hasTemplateManagementEditPermission() {
// true
if (this.isAdmin()) {
return true
}
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// permissionPath "" parameterPer
// parameterPer 2 "" "2"
return permissionData.some((perm) => {
const permissionPath = perm.permissionPath || ''
const parameterPer = perm.parameterPer
return (
permissionPath === '参数模板管理' &&
(parameterPer === 2 ||
parameterPer === '2' ||
parameterPer === '编辑' ||
parameterPer === 2)
)
})
} catch (err) {
console.error('检查参数模板管理编辑权限失败:', err)
return false
}
},
// //
loadUserSelfRole() { loadUserSelfRole() {
localStorage.setItem('user_self_role', []) // localStorage.setItem('user_self_role', [])
const request = { const request = {
...api.GET_USER_SELF_ROLE, ...api.GET_USER_SELF_ROLE,
params: { params: {
@ -369,8 +402,8 @@ export default {
} }
// user_self_role menuPath "/" // user_self_role menuPath "/"
this.filterTemplateManagementPermissions()
} }
this.filterTemplateManagementPermissions()
}) })
.asyncErrorCatch((err) => { .asyncErrorCatch((err) => {
console.error('获取用户自身角色失败:', err) console.error('获取用户自身角色失败:', err)
@ -750,7 +783,7 @@ export default {
}) })
}, },
handleRowEdit(row) { handleRowEdit(row) {
this.$refs.editModal.showModal(row) this.$refs.editModal.showModal(row, 'edit', row.status)
}, },
currentChange(currentPage) { currentChange(currentPage) {
this.pagination.currentPage = currentPage this.pagination.currentPage = currentPage
@ -927,7 +960,11 @@ export default {
} else { } else {
const request = { const request = {
...api.EDIT_MODEL, ...api.EDIT_MODEL,
params: { ...formData, templateRowId: row.rowId } params: {
...formData,
templateRowId: row.rowId,
orderNum: row.orderNum || '' // orderNum
}
} }
this.$request(request) this.$request(request)
.asyncThen((resp) => { .asyncThen((resp) => {

View File

@ -45,7 +45,7 @@
<el-button v-if="shouldShowButtons" class="right-button" @click="handleImport"> <el-button v-if="shouldShowButtons" class="right-button" @click="handleImport">
导入 导入
</el-button> </el-button>
<el-button class="right-button" @click="handleDownloadTemplate"> <el-button v-if="hasTemplateManagementPermission()" class="right-button" @click="handleDownloadTemplate">
下载导入模板 下载导入模板
</el-button> </el-button>
<el-button <el-button
@ -651,12 +651,20 @@ export default {
return this.versionList || [] return this.versionList || []
}, },
shouldShowButtonsNew() { shouldShowButtonsNew() {
//
if (!this.hasTemplateManagementPermission()) {
return false
}
// GET_MODEL_DETAIL status // GET_MODEL_DETAIL status
const status = this.currentStatus || '' const status = this.currentStatus || ''
return status === 'DRAFT' && this.isLatestVersion return status === 'DRAFT' && this.isLatestVersion
}, },
// //
shouldShowButtons() { shouldShowButtons() {
//
if (!this.hasTemplateManagementPermission()) {
return false
}
// GET_MODEL_DETAIL status // GET_MODEL_DETAIL status
// DRAFT COMPLETE // DRAFT COMPLETE
const status = this.currentStatus || '' const status = this.currentStatus || ''
@ -1241,6 +1249,36 @@ export default {
return false return false
} }
}, },
// permissionPath: "/"
hasTemplateManagementPermission() {
//
if (this.isAdmin()) {
return true
}
const templateName = this.displayTemplateName
if (!templateName) {
return false
}
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// permissionPath "/"
const expectedPath = `参数模板管理/${templateName}`
return permissionData.some((perm) => {
const permissionPath = perm.permissionPath || ''
return permissionPath === expectedPath
})
} catch (err) {
console.error('检查参数模板管理权限失败:', err)
return false
}
},
// subsystempartsName // subsystempartsName
hasParameterEditPermission(subsystem, partsName) { hasParameterEditPermission(subsystem, partsName) {
// //

View File

@ -6,11 +6,11 @@
竞品发动机数据 竞品发动机数据
</div> </div>
<div class="operation"> <div class="operation">
<el-button type="primary" @click="handleDownloadTemplate">下载模板</el-button> <el-button v-if="hasEngineDataEditPermission()" type="primary" @click="handleDownloadTemplate">下载模板</el-button>
<el-button class="import-button" @click="handleImport"> <el-button v-if="hasEngineDataEditPermission()" class="import-button" @click="handleImport">
导入机型 导入机型
</el-button> </el-button>
<el-button type="primary" class="add-button" @click="handleAdd"> <el-button v-if="hasEngineDataEditPermission()" type="primary" class="add-button" @click="handleAdd">
添加机型 添加机型
</el-button> </el-button>
</div> </div>
@ -185,7 +185,6 @@
</div> </div>
</el-upload> </el-upload>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleImportDialogClose">取消</el-button> <el-button @click="handleImportDialogClose">取消</el-button>
<el-button type="primary" :loading="importing" @click="handleImportConfirm"> <el-button type="primary" :loading="importing" @click="handleImportConfirm">
开始导入 开始导入
@ -343,6 +342,56 @@ export default {
this.loadData() this.loadData()
}, },
methods: { methods: {
// isAdmin === 1
isAdmin() {
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// isAdmin === 1
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
} catch (err) {
console.error('检查管理员权限失败:', err)
return false
}
},
//
hasEngineDataEditPermission() {
//
if (this.isAdmin()) {
return true
}
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// permissionPath "" parameterPer
// parameterPer 2 "" "2"
return permissionData.some((perm) => {
const permissionPath = perm.permissionPath || ''
const parameterPer = perm.parameterPer
return (
permissionPath === '竞品发动机数据' &&
(parameterPer === 2 ||
parameterPer === '2' ||
parameterPer === '编辑')
)
})
} catch (err) {
console.error('检查竞品发动机数据编辑权限失败:', err)
return false
}
},
// //
loadUserSelfRole() { loadUserSelfRole() {
const request = { const request = {

View File

@ -107,18 +107,18 @@
<span v-if="data.type === 'subsystem'" class="type-tag subsystem-tag">子系统</span> <span v-if="data.type === 'subsystem'" class="type-tag subsystem-tag">子系统</span>
<span v-if="data.type === 'parameter'" class="type-tag parameter-tag">参数类型</span> --> <span v-if="data.type === 'parameter'" class="type-tag parameter-tag">参数类型</span> -->
</span> </span>
<span v-if="data.type === 'subsystem' || data.type === 'parameter'" class="permission-checkboxes"> <span v-if="data.type === 'menu' || data.type === 'subsystem' || data.type === 'parameter' || data.type === 'template'" class="permission-checkboxes">
<el-checkbox <el-checkbox
v-model="data.permissions.view" v-model="data.permissions.view"
size="small" size="small"
@change="data.type === 'subsystem' ? handleSubsystemPermissionChange(data, 'view') : handlePermissionChange(data, 'view')" @change="handleNodePermissionChange(data, 'view')"
> >
查看 查看
</el-checkbox> </el-checkbox>
<el-checkbox <el-checkbox
v-model="data.permissions.edit" v-model="data.permissions.edit"
size="small" size="small"
@change="data.type === 'subsystem' ? handleSubsystemPermissionChange(data, 'edit') : handlePermissionChange(data, 'edit')" @change="handleNodePermissionChange(data, 'edit')"
> >
编辑 编辑
</el-checkbox> </el-checkbox>
@ -358,7 +358,9 @@ export default {
// //
pendingPermissions: [], pendingPermissions: [],
// //
menuList: ['模板管理', '玉柴发动机数据', '竞品发动机数据'], menuList: ['参数模板管理', '玉柴发动机数据', '竞品发动机数据', '对标报告'],
//
templateList: [],
// //
personConfigDialogVisible: false, personConfigDialogVisible: false,
personConfigSubmitting: false, personConfigSubmitting: false,
@ -459,6 +461,7 @@ export default {
mounted() { mounted() {
this.loadPermissionData() this.loadPermissionData()
this.loadParamList() this.loadParamList()
this.loadTemplateList()
this.loadDepartmentList() this.loadDepartmentList()
this.getUserSelfRole() this.getUserSelfRole()
}, },
@ -573,7 +576,12 @@ export default {
label: menuName, label: menuName,
type: 'menu', type: 'menu',
children: null, // null children: null, // null
isLeaf: false // el-tree //
isLeaf: menuName === '对标报告',
permissions: {
view: false,
edit: false
}
} }
// //
@ -599,8 +607,19 @@ export default {
resolve(this.menuTreeData || []) resolve(this.menuTreeData || [])
return return
} }
// //
if (node.data.type === 'menu') { if (node.data.type === 'menu') {
//
if (node.data.label === '对标报告') {
resolve([])
return
}
//
if (node.data.label === '参数模板管理') {
this.loadTemplateListForLazy(node.data, resolve)
return
}
//
this.loadMenuSubsystemsForLazy(node.data, resolve) this.loadMenuSubsystemsForLazy(node.data, resolve)
return return
} }
@ -609,9 +628,82 @@ export default {
this.loadSubsystemParametersForLazy(node.data, resolve) this.loadSubsystemParametersForLazy(node.data, resolve)
return return
} }
// //
resolve([]) resolve([])
}, },
//
loadTemplateList() {
const request = {
...api.GET_MODEL_LIST,
params: {
pageNumber: 1,
pageSize: 999
},
disableSuccessMsg: true
}
this.$request(request, false)
.asyncThen((resp) => {
const list = resp.data.result || []
this.templateList = list.map((item) => ({
templateId: item.rowId || item.id || '',
templateName: item.templateName || ''
}))
console.log('加载模板列表成功,模板数量:', this.templateList.length)
})
.asyncErrorCatch((err) => {
console.error('加载模板列表失败:', err)
this.templateList = []
})
},
//
loadTemplateListForLazy(menuNode, resolve) {
if (!this.templateList || this.templateList.length === 0) {
//
this.loadTemplateList()
//
setTimeout(() => {
this.buildTemplateNodes(menuNode, resolve)
}, 500)
return
}
this.buildTemplateNodes(menuNode, resolve)
},
//
buildTemplateNodes(menuNode, resolve) {
const templateNodes = []
this.templateList.forEach((template, templateIdx) => {
if (!template.templateName) {
return
}
const templateId = `${menuNode.id}-template-${templateIdx}`
const templateNode = {
id: templateId,
label: template.templateName,
type: 'template',
menuName: menuNode.label,
templateId: template.templateId,
templateName: template.templateName,
permissions: {
view: false,
edit: false
},
isLeaf: true, //
children: null
}
templateNodes.push(templateNode)
//
this.nodeMap[templateId] = templateNode
//
this.applyPendingPermissionsToNode(templateNode)
})
// 使 $nextTick
this.$nextTick(() => {
templateNodes.forEach((node) => {
this.applyPendingPermissionsToNode(node)
})
})
resolve(templateNodes)
},
// //
loadMenuSubsystemsForLazy(menuNode, resolve) { loadMenuSubsystemsForLazy(menuNode, resolve) {
// subsystemPartsMap // subsystemPartsMap
@ -765,8 +857,20 @@ export default {
}) })
}) })
}, },
// //
handlePermissionChange(data, permissionType) { handleNodePermissionChange(data, permissionType) {
//
if (permissionType === 'edit' && data.permissions && data.permissions.edit === true) {
//
if (!data.permissions.view) {
this.$set(data.permissions, 'view', true)
}
//
if (data.id && this.nodeMap[data.id]) {
this.$set(this.nodeMap[data.id].permissions, 'view', true)
}
}
// //
if (data.id && this.nodeMap[data.id]) { if (data.id && this.nodeMap[data.id]) {
// 使 $set // 使 $set
@ -776,8 +880,22 @@ export default {
data.permissions[permissionType] data.permissions[permissionType]
) )
} }
//
this.updateSubsystemPermissionFromChildren(data) // /
if (data.type === 'menu') {
this.handleMenuPermissionChange(data, permissionType)
} else if (data.type === 'subsystem') {
// /
this.handleSubsystemPermissionChange(data, permissionType)
this.updateMenuPermissionFromChildren(data)
} else if (data.type === 'template') {
//
this.updateMenuPermissionFromChildren(data)
} else if (data.type === 'parameter') {
//
this.updateSubsystemPermissionFromChildren(data)
}
// //
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.form) { if (this.$refs.form) {
@ -785,6 +903,265 @@ export default {
} }
}) })
}, },
// /
handleMenuPermissionChange(menuNode, permissionType) {
const isChecked = menuNode.permissions[permissionType]
const menuName = menuNode.label || ''
//
if (permissionType === 'edit' && isChecked) {
this.$set(menuNode.permissions, 'view', true)
if (menuNode.id && this.nodeMap[menuNode.id]) {
this.$set(this.nodeMap[menuNode.id].permissions, 'view', true)
}
}
//
const setChildrenPermissions = (node) => {
if (node.children && Array.isArray(node.children)) {
node.children.forEach((childNode) => {
if (childNode.id && this.nodeMap[childNode.id]) {
const childNodeInMap = this.nodeMap[childNode.id]
//
if (!childNodeInMap.permissions) {
this.$set(childNodeInMap, 'permissions', { view: false, edit: false })
}
//
this.$set(childNodeInMap.permissions, permissionType, isChecked)
//
if (permissionType === 'edit' && isChecked) {
this.$set(childNodeInMap.permissions, 'view', true)
}
//
if (childNode.permissions) {
const newPermissions = {
...childNode.permissions,
[permissionType]: isChecked
}
//
if (permissionType === 'edit' && isChecked) {
newPermissions.view = true
}
this.$set(childNode, 'permissions', newPermissions)
}
//
setChildrenPermissions(childNode)
}
})
}
}
setChildrenPermissions(menuNode)
//
if (isChecked) {
// pendingPermissions
if (!this.pendingPermissions) {
this.pendingPermissions = []
}
const userId = getUserId()
const parameterPer = permissionType === 'view' ? 1 : 2
//
if (menuName === '参数模板管理') {
// /
this.templateList.forEach((template) => {
if (template.templateName) {
const permissionPath = `${menuName}/${template.templateName}`
//
const existingPerm = this.pendingPermissions.find(
(perm) => perm.permissionPath === permissionPath && perm.parameterPer === parameterPer
)
if (!existingPerm) {
this.pendingPermissions.push({
permissionPath: permissionPath,
parameterPer: parameterPer,
userId: userId
})
}
}
})
} else if (menuName === '玉柴发动机数据' || menuName === '竞品发动机数据') {
// //
Object.keys(this.subsystemPartsMap || {}).forEach((subsystemName) => {
const partsNames = this.subsystemPartsMap[subsystemName] || []
partsNames.forEach((partsName) => {
if (partsName) {
const permissionPath = `${menuName}/${subsystemName}/${partsName}`
//
const existingPerm = this.pendingPermissions.find(
(perm) => perm.permissionPath === permissionPath && perm.parameterPer === parameterPer
)
if (!existingPerm) {
this.pendingPermissions.push({
permissionPath: permissionPath,
parameterPer: parameterPer,
userId: userId
})
}
}
})
})
} else if (menuName === '对标报告') {
//
const menuPath = this.buildPermissionPath(menuNode)
if (menuPath) {
const existingPerm = this.pendingPermissions.find(
(perm) => perm.permissionPath === menuPath && perm.parameterPer === parameterPer
)
if (!existingPerm) {
this.pendingPermissions.push({
permissionPath: menuPath,
parameterPer: parameterPer,
userId: userId
})
}
}
}
//
if (permissionType === 'edit') {
const viewParameterPer = 1
if (menuName === '参数模板管理') {
this.templateList.forEach((template) => {
if (template.templateName) {
const permissionPath = `${menuName}/${template.templateName}`
const existingPerm = this.pendingPermissions.find(
(perm) => perm.permissionPath === permissionPath && perm.parameterPer === viewParameterPer
)
if (!existingPerm) {
this.pendingPermissions.push({
permissionPath: permissionPath,
parameterPer: viewParameterPer,
userId: userId
})
}
}
})
} else if (menuName === '玉柴发动机数据' || menuName === '竞品发动机数据') {
Object.keys(this.subsystemPartsMap || {}).forEach((subsystemName) => {
const partsNames = this.subsystemPartsMap[subsystemName] || []
partsNames.forEach((partsName) => {
if (partsName) {
const permissionPath = `${menuName}/${subsystemName}/${partsName}`
const existingPerm = this.pendingPermissions.find(
(perm) => perm.permissionPath === permissionPath && perm.parameterPer === viewParameterPer
)
if (!existingPerm) {
this.pendingPermissions.push({
permissionPath: permissionPath,
parameterPer: viewParameterPer,
userId: userId
})
}
}
})
})
} else if (menuName === '对标报告') {
const menuPath = this.buildPermissionPath(menuNode)
if (menuPath) {
const existingPerm = this.pendingPermissions.find(
(perm) => perm.permissionPath === menuPath && perm.parameterPer === viewParameterPer
)
if (!existingPerm) {
this.pendingPermissions.push({
permissionPath: menuPath,
parameterPer: viewParameterPer,
userId: userId
})
}
}
}
}
} else {
// pendingPermissions
if (this.pendingPermissions) {
const parameterPer = permissionType === 'view' ? 1 : 2
//
this.pendingPermissions = this.pendingPermissions.filter((perm) => {
//
if (perm.permissionPath && perm.permissionPath.startsWith(menuName + '/')) {
return perm.parameterPer !== parameterPer
}
//
if (menuName === '对标报告' && perm.permissionPath === menuName) {
return perm.parameterPer !== parameterPer
}
return true
})
//
if (permissionType === 'edit') {
const viewParameterPer = 1
this.pendingPermissions = this.pendingPermissions.filter((perm) => {
if (perm.permissionPath && perm.permissionPath.startsWith(menuName + '/')) {
return perm.parameterPer !== viewParameterPer
}
if (menuName === '对标报告' && perm.permissionPath === menuName) {
return perm.parameterPer !== viewParameterPer
}
return true
})
}
}
}
},
//
updateMenuPermissionFromChildren(node) {
let menuNode = null
// 使
if (node && node.type === 'menu') {
menuNode = node
} else if (node && node.menuName) {
//
menuNode = Object.values(this.nodeMap).find(
(n) => n.type === 'menu' && n.label === node.menuName
)
}
if (!menuNode) {
return
}
//
const allDescendants = []
const collectDescendants = (n) => {
if (n.children && Array.isArray(n.children)) {
n.children.forEach((child) => {
allDescendants.push(child)
collectDescendants(child)
})
}
}
collectDescendants(menuNode)
if (allDescendants.length === 0) {
//
return
}
//
const allViewChecked = allDescendants.every((child) => {
const childNode = this.nodeMap[child.id]
return childNode && childNode.permissions && childNode.permissions.view === true
})
const allEditChecked = allDescendants.every((child) => {
const childNode = this.nodeMap[child.id]
return childNode && childNode.permissions && childNode.permissions.edit === true
})
//
if (!menuNode.permissions) {
this.$set(menuNode, 'permissions', { view: false, edit: false })
}
this.$set(menuNode.permissions, 'view', allViewChecked)
this.$set(menuNode.permissions, 'edit', allEditChecked)
},
// -
handlePermissionChange(data, permissionType) {
this.handleNodePermissionChange(data, permissionType)
},
// / // /
handleSubsystemPermissionChange(data, permissionType) { handleSubsystemPermissionChange(data, permissionType) {
// //
@ -796,20 +1173,40 @@ export default {
data.permissions[permissionType] data.permissions[permissionType]
) )
} }
//
if (permissionType === 'edit' && data.permissions && data.permissions.edit === true) {
this.$set(data.permissions, 'view', true)
if (data.id && this.nodeMap[data.id]) {
this.$set(this.nodeMap[data.id].permissions, 'view', true)
}
}
// //
const children = data.children || [] const children = data.children || []
const isChecked = data.permissions[permissionType] const isChecked = data.permissions[permissionType]
// / // /
children.forEach((childNode) => { children.forEach((childNode) => {
if (childNode.id && this.nodeMap[childNode.id]) { if (childNode.id && this.nodeMap[childNode.id]) {
//
if (!this.nodeMap[childNode.id].permissions) {
this.$set(this.nodeMap[childNode.id], 'permissions', { view: false, edit: false })
}
// //
this.$set(this.nodeMap[childNode.id].permissions, permissionType, isChecked) this.$set(this.nodeMap[childNode.id].permissions, permissionType, isChecked)
//
if (permissionType === 'edit' && isChecked) {
this.$set(this.nodeMap[childNode.id].permissions, 'view', true)
}
// //
if (childNode.permissions) { if (childNode.permissions) {
this.$set(childNode, 'permissions', { const newPermissions = {
...childNode.permissions, ...childNode.permissions,
[permissionType]: isChecked [permissionType]: isChecked
}) }
//
if (permissionType === 'edit' && isChecked) {
newPermissions.view = true
}
this.$set(childNode, 'permissions', newPermissions)
} }
} }
}) })
@ -1372,19 +1769,27 @@ export default {
} }
} }
// userOrDeptId "ID:"
const processedUserOrDeptId = userOrDeptId.map((id) => {
if (typeof id === 'string' && id.startsWith('ID:')) {
return id.substring(3) // "ID:" 3
}
return id
})
console.log('人员配置数据:', { console.log('人员配置数据:', {
roleId: this.personConfigFormData.roleId, roleId: this.personConfigFormData.roleId,
roleName: this.personConfigFormData.roleName, roleName: this.personConfigFormData.roleName,
configType: this.personConfigFormData.configType, configType: this.personConfigFormData.configType,
isDept: isDept, isDept: isDept,
userOrDeptIds: userOrDeptId userOrDeptIds: processedUserOrDeptId
}) })
const request = { const request = {
...api.GET_ROLE_PERMISSION_BING, ...api.GET_ROLE_PERMISSION_BING,
params: { params: {
roleId: this.personConfigFormData.roleId, roleId: this.personConfigFormData.roleId,
userOrDeptIds: userOrDeptId, userOrDeptIds: processedUserOrDeptId,
isDept: isDept isDept: isDept
}, },
disableSuccessMsg: true disableSuccessMsg: true
@ -1456,8 +1861,11 @@ export default {
Object.keys(this.nodeMap).forEach((key) => { Object.keys(this.nodeMap).forEach((key) => {
const node = this.nodeMap[key] const node = this.nodeMap[key]
if (node && node.permissions) { if (node && node.permissions) {
node.permissions.view = false this.$set(node.permissions, 'view', false)
node.permissions.edit = false this.$set(node.permissions, 'edit', false)
} else if (node && (node.type === 'menu' || node.type === 'template' || node.type === 'parameter')) {
//
this.$set(node, 'permissions', { view: false, edit: false })
} }
}) })
}, },
@ -1472,8 +1880,8 @@ export default {
// //
setPermissionsFromData(permissions) { setPermissionsFromData(permissions) {
// permissions // permissions
// { id, subsystem, partsName, parameterPer } // { permissionPath, parameterPer, roleId, userId }
// parameterPer "" "" // parameterPer 12
const permArray = Array.isArray(permissions) ? permissions : [] const permArray = Array.isArray(permissions) ? permissions : []
// //
@ -1482,68 +1890,71 @@ export default {
// //
this.pendingPermissions = permArray this.pendingPermissions = permArray
// subsystem partsName // permissionPath
const permissionMap = new Map() // key: `${subsystem}-${partsName}`, value: { view: boolean, edit: boolean } const permissionMap = new Map() // key: permissionPath, value: { view: boolean, edit: boolean }
permArray.forEach((perm) => { permArray.forEach((perm) => {
const subsystem = perm.subsystem || '' const permissionPath = perm.permissionPath || ''
const partsName = perm.partsName || '' if (!permissionPath) {
const key = `${subsystem}-${partsName}` return
}
if (!permissionMap.has(key)) { if (!permissionMap.has(permissionPath)) {
permissionMap.set(key, { permissionMap.set(permissionPath, {
subsystem: subsystem, permissionPath: permissionPath,
partsName: partsName,
view: false, view: false,
edit: false edit: false
}) })
} }
const permData = permissionMap.get(key) const permData = permissionMap.get(permissionPath)
if (perm.parameterPer === '查看') { // parameterPer 12
if (perm.parameterPer === 1 || perm.parameterPer === '1' || perm.parameterPer === '查看') {
permData.view = true permData.view = true
} else if (perm.parameterPer === '编辑') { } else if (perm.parameterPer === 2 || perm.parameterPer === '2' || perm.parameterPer === '编辑') {
permData.edit = true permData.edit = true
} }
}) })
// subsystem partsName // permissionPath
permissionMap.forEach((permData, key) => { permissionMap.forEach((permData, permissionPath) => {
//
if (permData.edit && !permData.view) {
permData.view = true
}
Object.keys(this.nodeMap).forEach((nodeId) => { Object.keys(this.nodeMap).forEach((nodeId) => {
const node = this.nodeMap[nodeId] const node = this.nodeMap[nodeId]
if (node && node.type === 'parameter') { if (!node) {
// return
const subsystemMatch = }
permData.subsystem && node.subsystem && permData.subsystem === node.subsystem
// partsName
const partsNameMatch =
permData.partsName &&
(node.partsName || node.parameterName || node.label) &&
permData.partsName === (node.partsName || node.parameterName || node.label)
if (subsystemMatch && partsNameMatch) { // permissionPath
// 使 $set const nodePath = this.buildPermissionPath(node)
const newPermissions = { if (nodePath === permissionPath) {
view: permData.view || false, // 使 $set
edit: permData.edit || false const newPermissions = {
} view: permData.view || false,
this.$set(node, 'permissions', newPermissions) edit: permData.edit || false
console.log(
'设置已加载节点权限:',
node.id,
node.label,
{
subsystem: node.subsystem,
partsName: node.partsName || node.parameterName || node.label
},
newPermissions
)
} }
//
if (newPermissions.edit && !newPermissions.view) {
newPermissions.view = true
}
this.$set(node, 'permissions', newPermissions)
console.log(
'设置已加载节点权限:',
node.id,
node.label,
node.type,
permissionPath,
newPermissions
)
} }
}) })
}) })
// //
this.$nextTick(() => { this.$nextTick(() => {
//
Object.keys(this.nodeMap).forEach((nodeId) => { Object.keys(this.nodeMap).forEach((nodeId) => {
const node = this.nodeMap[nodeId] const node = this.nodeMap[nodeId]
if (node && node.type === 'subsystem' && node.children && node.children.length > 0) { if (node && node.type === 'subsystem' && node.children && node.children.length > 0) {
@ -1564,6 +1975,13 @@ export default {
} }
} }
}) })
//
Object.keys(this.nodeMap).forEach((nodeId) => {
const node = this.nodeMap[nodeId]
if (node && node.type === 'menu') {
this.updateMenuPermissionFromChildren(node)
}
})
}) })
console.log( console.log(
@ -1575,123 +1993,172 @@ export default {
}, },
// //
applyPendingPermissionsToNode(node) { applyPendingPermissionsToNode(node) {
if ( if (!node || !this.pendingPermissions || this.pendingPermissions.length === 0) {
!node ||
node.type !== 'parameter' ||
!this.pendingPermissions ||
this.pendingPermissions.length === 0
) {
return return
} }
// subsystem partsName //
const matchingPerms = this.pendingPermissions.filter((perm) => { const nodePath = this.buildPermissionPath(node)
// if (!nodePath) {
const subsystemMatch = perm.subsystem && node.subsystem && perm.subsystem === node.subsystem return
// partsName }
const partsNameMatch =
perm.partsName &&
(node.partsName || node.parameterName || node.label) &&
perm.partsName === (node.partsName || node.parameterName || node.label)
return subsystemMatch && partsNameMatch // permissionPath
const matchingPerms = this.pendingPermissions.filter((perm) => {
const permissionPath = perm.permissionPath || ''
return permissionPath === nodePath
}) })
if (matchingPerms.length > 0) { //
// if (matchingPerms.length === 0) {
if (!node.permissions) { return
this.$set(node, 'permissions', { view: false, edit: false })
}
// parameterPer "" ""
let hasView = false
let hasEdit = false
matchingPerms.forEach((perm) => {
if (perm.parameterPer === '查看') {
hasView = true
} else if (perm.parameterPer === '编辑') {
hasEdit = true
}
})
// 使 $set
const newPermissions = {
view: hasView,
edit: hasEdit
}
// nodeMap
if (this.nodeMap[node.id]) {
this.$set(this.nodeMap[node.id], 'permissions', newPermissions)
}
//
this.$set(node, 'permissions', newPermissions)
console.log(
'应用权限到节点:',
node.id,
node.label,
{
menuName: node.menuName,
subsystem: node.subsystem,
parameterName: node.parameterName || node.label
},
newPermissions,
'匹配的权限:',
matchingPerms
)
//
this.$nextTick(() => {
this.updateSubsystemPermissionFromChildren(node)
})
} }
//
if (!node.permissions) {
this.$set(node, 'permissions', { view: false, edit: false })
}
// parameterPer 12
let hasView = false
let hasEdit = false
matchingPerms.forEach((perm) => {
if (perm.parameterPer === 1 || perm.parameterPer === '1' || perm.parameterPer === '查看') {
hasView = true
} else if (perm.parameterPer === 2 || perm.parameterPer === '2' || perm.parameterPer === '编辑') {
hasEdit = true
}
})
//
if (hasEdit && !hasView) {
hasView = true
}
// 使 $set
const newPermissions = {
view: hasView,
edit: hasEdit
}
// nodeMap
if (this.nodeMap[node.id]) {
this.$set(this.nodeMap[node.id], 'permissions', newPermissions)
}
//
this.$set(node, 'permissions', newPermissions)
console.log(
'应用权限到节点:',
node.id,
node.label,
node.type,
nodePath,
newPermissions,
'匹配的权限:',
matchingPerms
)
//
this.$nextTick(() => {
if (node.type === 'parameter') {
this.updateSubsystemPermissionFromChildren(node)
} else if (node.type === 'subsystem') {
this.updateMenuPermissionFromChildren(node)
}
})
},
// permissionPath
buildPermissionPath(node) {
if (!node) {
return ''
}
//
if (node.type === 'menu') {
return node.label || ''
}
// /
if (node.type === 'subsystem') {
const menuName = node.menuName || ''
const subsystemName = node.subsystem || node.label || ''
return `${menuName}/${subsystemName}`
}
// //
if (node.type === 'parameter') {
const menuName = node.menuName || ''
const subsystemName = node.subsystem || ''
const parameterName = node.partsName || node.parameterName || node.label || ''
return `${menuName}/${subsystemName}/${parameterName}`
}
// /
if (node.type === 'template') {
const menuName = node.menuName || ''
const templateName = node.templateName || node.label || ''
return `${menuName}/${templateName}`
}
return ''
}, },
// //
collectPermissions() { collectPermissions() {
const permissions = [] const permissions = []
const roleId = this.formData.rowId || '' const roleId = this.formData.rowId || '' // roleId
const userId = getUserId() const userId = getUserId()
// nodeMap // nodeMap
Object.keys(this.nodeMap).forEach((nodeId) => { Object.keys(this.nodeMap).forEach((nodeId) => {
const node = this.nodeMap[nodeId] const node = this.nodeMap[nodeId]
if (node && node.type === 'parameter') { if (!node) {
// return
const nodePermissions = node.permissions || { view: false, edit: false } }
// partsName
const subsystem = node.subsystem || ''
const partsName = node.partsName || node.parameterName || node.label || ''
// parameterPer = 1 //
if (nodePermissions.view) { const nodePermissions = node.permissions || { view: false, edit: false }
permissions.push({
roleId: roleId, // view edit true
subsystem: subsystem, if (!nodePermissions.view && !nodePermissions.edit) {
partsName: partsName, return
parameterPer: 1, // 1 }
userId: userId
}) //
const permissionPath = this.buildPermissionPath(node)
if (!permissionPath) {
return
}
//
if (nodePermissions.view) {
const perm = {
permissionPath: permissionPath,
parameterPer: 1, // 1
userId: userId
} }
// parameterPer = 2 // roleId
if (nodePermissions.edit) { if (roleId) {
permissions.push({ perm.roleId = roleId
roleId: roleId,
subsystem: subsystem,
partsName: partsName,
parameterPer: 2, // 2
userId: userId
})
} }
permissions.push(perm)
}
//
if (nodePermissions.edit) {
const perm = {
permissionPath: permissionPath,
parameterPer: 2, // 2
userId: userId
}
// roleId
if (roleId) {
perm.roleId = roleId
}
permissions.push(perm)
} }
}) })
console.log(
'收集到的权限:', console.log('收集到的权限:', permissions)
permissions,
'nodeMap中的参数节点数量:',
Object.keys(this.nodeMap).filter(
(id) => this.nodeMap[id] && this.nodeMap[id].type === 'parameter'
).length
)
return permissions return permissions
}, },
// //

View File

@ -6,11 +6,11 @@
玉柴发动机数据 玉柴发动机数据
</div> </div>
<div class="operation"> <div class="operation">
<el-button type="primary" @click="handleDownloadTemplate">下载模板</el-button> <el-button v-if="hasEngineDataEditPermission()" type="primary" @click="handleDownloadTemplate">下载模板</el-button>
<el-button class="import-button" @click="handleImport"> <el-button v-if="hasEngineDataEditPermission()" class="import-button" @click="handleImport">
导入机型 导入机型
</el-button> </el-button>
<el-button type="primary" class="add-button" @click="handleAdd"> <el-button v-if="hasEngineDataEditPermission()" type="primary" class="add-button" @click="handleAdd">
添加机型 添加机型
</el-button> </el-button>
</div> </div>
@ -109,7 +109,7 @@
查看 查看
</a> </a>
<a <a
v-if="row.distributeStatus != '已分发'" v-if="row.distributeStatus != '已分发' && hasEngineDataEditPermission()"
href="javascript:void(0)" href="javascript:void(0)"
class="el-link el-link--primary" class="el-link el-link--primary"
style="margin-left: 5px;" style="margin-left: 5px;"
@ -343,6 +343,56 @@ export default {
this.loadData() this.loadData()
}, },
methods: { methods: {
// isAdmin === 1
isAdmin() {
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// isAdmin === 1
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
} catch (err) {
console.error('检查管理员权限失败:', err)
return false
}
},
//
hasEngineDataEditPermission() {
//
if (this.isAdmin()) {
return true
}
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// permissionPath "" parameterPer
// parameterPer 2 "" "2"
return permissionData.some((perm) => {
const permissionPath = perm.permissionPath || ''
const parameterPer = perm.parameterPer
return (
permissionPath === '玉柴发动机数据' &&
(parameterPer === 2 ||
parameterPer === '2' ||
parameterPer === '编辑')
)
})
} catch (err) {
console.error('检查玉柴发动机数据编辑权限失败:', err)
return false
}
},
// //
loadUserSelfRole() { loadUserSelfRole() {
const request = { const request = {

View File

@ -1,6 +1,10 @@
<template> <template>
<div class="apaas-custom-page-todo custom-page"> <div class="apaas-custom-page-todo custom-page">
<template v-if="!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail"> <template
v-if="
!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail
"
>
<div class="page-header"> <div class="page-header">
<div class="title"> <div class="title">
我的待办 我的待办
@ -35,13 +39,27 @@
@current-page-change="currentChange" @current-page-change="currentChange"
@select-data-change="selectDataChange" @select-data-change="selectDataChange"
> >
<template v-for="(colConfig, index) in tableConfig.colConfigs" v-slot:[colConfig.customSlot]="{ row, rowIndex }"> <template
v-for="(colConfig, index) in tableConfig.colConfigs"
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
>
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex"> <div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
<a href="javascript:void(0)" class="el-link el-link--primary" @click.stop="handleRowView(row)">查看</a> <a
</div> href="javascript:void(0)"
<span style="width: 6px; display: inline-block"></span> class="el-link el-link--primary"
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex"> @click.stop="handleRowView(row)"
<a href="javascript:void(0)" class="el-link el-link--primary" @click.stop="handleRowBack(row)">退回</a> >查看</a
>
<span
v-if="row.dataType === '数据维护'"
style="width: 6px; display: inline-block"
></span>
<a
href="javascript:void(0)"
class="el-link el-link--primary"
@click.stop="handleRowBack(row)"
>退回</a
>
</div> </div>
</template> </template>
@ -145,10 +163,29 @@ export default {
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' }, { prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' },
// { prop: 'statusCode', label: '', showOverflowTooltip: true, minWidth: '120' }, // { prop: 'statusCode', label: '', showOverflowTooltip: true, minWidth: '120' },
// { prop: 'modelName', label: '', showOverflowTooltip: true, minWidth: '120' }, // { prop: 'modelName', label: '', showOverflowTooltip: true, minWidth: '120' },
{ prop: 'currentProcessor', label: '当前处理人', showOverflowTooltip: true, minWidth: '120' }, {
prop: 'currentProcessor',
label: '当前处理人',
showOverflowTooltip: true,
minWidth: '120'
},
{ prop: 'createdBy', label: '创建人', showOverflowTooltip: true, minWidth: '120' }, { prop: 'createdBy', label: '创建人', showOverflowTooltip: true, minWidth: '120' },
{ prop: 'creationDate', label: '创建时间', showOverflowTooltip: true, minWidth: '160', align: 'center', formatter: this.formatDateTime }, {
{ prop: 'options', label: '操作', customSlot: 'options', align: 'center', width: '100', fixed: 'right' } prop: 'creationDate',
label: '创建时间',
showOverflowTooltip: true,
minWidth: '160',
align: 'center',
formatter: this.formatDateTime
},
{
prop: 'options',
label: '操作',
customSlot: 'options',
align: 'center',
width: '100',
fixed: 'right'
}
], ],
seqType: '', seqType: '',
seqConfig: {}, seqConfig: {},
@ -168,6 +205,38 @@ export default {
rowClickEvent(row) { rowClickEvent(row) {
console.warn(row) console.warn(row)
}, },
//退
handleRowBack(row) {
this.$confirm('确定退回吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const request = {
...api.HANDLE_FILLER_BACK,
params: {
userId: getUserId(),
steps: '填写人退回',
todoTaskId: row.id,
modelID: row.modelId
},
disableSuccessMsg: true
}
this.$request(request)
.asyncThen((resp) => {
this.$message.success('退回成功')
this.loadData()
})
.asyncErrorCatch((err) => {
console.error('退回失败:', err)
this.$message.error('退回失败')
})
})
.catch(() => {
this.$message.info('已取消')
})
},
handleRowView(row) { handleRowView(row) {
// //
const dataType = row.dataType || '' const dataType = row.dataType || ''
@ -345,82 +414,82 @@ export default {
<style lang="scss"> <style lang="scss">
.custom-page { .custom-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: auto !important; overflow-y: auto !important;
display: flex;
flex-direction: column;
.page-header {
display: flex; display: flex;
flex-direction: column; align-items: center;
height: 56px;
position: relative;
width: 100%;
min-height: 56px;
background: #fff;
border-bottom: 1px solid #ebeef5;
flex-shrink: 0;
.page-header { .title {
display: flex; color: #303133;
align-items: center; font-weight: 700;
height: 56px; margin-left: 20px;
position: relative; flex: 1;
width: 100%; font-size: 12px;
min-height: 56px;
background: #fff;
border-bottom: 1px solid #ebeef5;
flex-shrink: 0;
.title {
color: #303133;
font-weight: 700;
margin-left: 20px;
flex: 1;
font-size: 12px;
}
.operation {
display: flex;
min-width: 330px;
justify-content: flex-end !important;
margin-right: 20px;
}
} }
.page-data-list { .operation {
display: flex; display: flex;
flex: 1; min-width: 330px;
min-height: 0; justify-content: flex-end !important;
padding: 20px; margin-right: 20px;
.x-empty-page {
top: 0;
}
}
.engine-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.engine-check-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.approval-progress-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.report-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
} }
} }
.page-data-list {
display: flex;
flex: 1;
min-height: 0;
padding: 20px;
.x-empty-page {
top: 0;
}
}
.engine-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.engine-check-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.approval-progress-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.report-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
}
</style> </style>