| public/pages/admin/advertisementSummary/advertisementSummary.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| public/pages/property/assetImportLog/assetImportLog.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| public/pages/property/assetImportLogDetail/assetImportLogDetail.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| public/vcCore/vcFramework.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
public/pages/admin/advertisementSummary/advertisementSummary.html
@@ -1,4 +1,87 @@ <div class="white-bg padding-lg"> <style> /* 强制下拉菜单显示在下方 */ .ibox-content .form-group { position: relative !important; z-index: 1000 !important; } /* 确保下拉菜单在容器内正确显示 */ .ibox-content { overflow: visible !important; } /* 确保所有容器都允许下拉菜单溢出 */ .ibox { overflow: visible !important; } .white-bg { overflow: visible !important; } .row { overflow: visible !important; } .col-sm-3 { overflow: visible !important; } /* 针对所有下拉菜单的强制样式 */ .custom-select { position: relative !important; z-index: 1001 !important; } /* 针对所有下拉菜单选项容器的强制样式 */ .dropdown-menu { position: absolute !important; top: 100% !important; bottom: auto !important; left: 0 !important; right: 0 !important; z-index: 9999 !important; margin-top: 0 !important; transform: none !important; display: block !important; } /* 额外的强制样式,确保下拉菜单不会显示在上方 */ .dropdown-menu.show { top: 100% !important; bottom: auto !important; transform: none !important; } /* 针对Bootstrap 4的下拉菜单样式 */ .custom-select + .dropdown-menu { top: 100% !important; bottom: auto !important; } /* 确保下拉菜单不会被其他元素遮挡 */ .form-group { position: relative !important; z-index: 1000 !important; } /* 针对合同类型下拉菜单的特殊样式 */ #contractType { position: relative !important; z-index: 1001 !important; } /* 针对合同类型下拉菜单的选项容器 */ #contractType ~ .dropdown-menu { position: absolute !important; top: 100% !important; bottom: auto !important; left: 0 !important; right: 0 !important; z-index: 9999 !important; margin-top: 0 !important; transform: none !important; display: block !important; } /* 强制所有下拉菜单显示在下方 */ [id$="Type"] ~ .dropdown-menu { top: 100% !important; bottom: auto !important; } /* 确保下拉菜单在容器外显示 */ .ibox-content { position: static !important; } </style> <!-- 广告合同汇总表区域 --> <div class="margin-top"> <div class="ibox"> @@ -41,19 +124,20 @@ <div class="col-sm-3"> <div class="form-group"> <label for="contractType">合同类型</label> <select class="form-control" id="contractType" v-model="advertisementSummaryInfo.conditions.contractType"> <option value="">全部</option> <option v-for="(item, index) in advertisementSummaryInfo.contractTypes" :key="index" :value="item.contractTypeId"> {{item.typeName}} </option> </select> <select class="custom-select" id="contractType" v-model="advertisementSummaryInfo.conditions.contractType" style="position: relative; z-index: 1001;"> <option value="">全部</option> <option v-for="(item, index) in advertisementSummaryInfo.contractTypes" :key="index" :value="item.contractTypeId"> {{item.typeName}} </option> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label for="state">合同状态</label> <select class="form-control" id="state" <select class="custom-select" id="state" v-model="advertisementSummaryInfo.conditions.state"> <option value="">全部</option> <option value="10000">全部</option> public/pages/property/assetImportLog/assetImportLog.js
@@ -44,83 +44,61 @@ }; // 合同管理员账户查询导入日志时不应该传入communityId // 检查用户信息 var userInfo = vc.getData() || {}; // 尝试直接从vc.getData()获取userInfo if (userInfo && typeof userInfo === 'object' && !userInfo.username && !userInfo.phone && userInfo.userInfo) { userInfo = userInfo.userInfo; } console.log('获取到的userInfo:', userInfo); // 检查用户账号是否为合同管理员账号 var contractAdminAccounts = ['18916013413']; var userAccount = ''; // 检查当前URL哈希 var currentHash = window.location.hash; console.log('当前哈希:', currentHash); // 尝试从多个来源获取用户账号 // 1. 从vc.getData()获取 var data = vc.getData(); console.log('获取到的vc.getData():', data); // 检查是否为合同管理员或在合同相关页面 var shouldNotPassCommunityId = false; // 1. 检查是否为合同管理员 var isContractAdmin = false; // 尝试从vc.getData()获取 if (userInfo) { console.log('用户信息:', userInfo); // 检查用户信息中的各种可能的角色字段 if (userInfo.userType === 'contractAdmin' || userInfo.role === 'contractAdmin' || userInfo.position === 'contractAdmin' || userInfo.type === 'contractAdmin') { isContractAdmin = true; console.log('用户类型为合同管理员,不传入communityId'); } // 检查用户信息中是否包含合同管理员相关的标识 if (userInfo.permissions && userInfo.permissions.includes('contractAdmin')) { isContractAdmin = true; console.log('用户权限包含合同管理员,不传入communityId'); } } // 尝试从localStorage获取 try { let localUserInfo = JSON.parse(window.localStorage.getItem('userInfo')); if (localUserInfo) { console.log('localStorage中的用户信息:', localUserInfo); if (localUserInfo.userType === 'contractAdmin' || localUserInfo.role === 'contractAdmin' || localUserInfo.position === 'contractAdmin' || localUserInfo.type === 'contractAdmin') { isContractAdmin = true; console.log('localStorage中用户类型为合同管理员,不传入communityId'); } if (localUserInfo.permissions && localUserInfo.permissions.includes('contractAdmin')) { isContractAdmin = true; console.log('localStorage中用户权限包含合同管理员,不传入communityId'); if (data && typeof data === 'object') { // 检查data是否直接包含用户信息 if (data.username || data.phone) { userAccount = data.username || data.phone; console.log('从vc.getData()直接获取到用户账号:', userAccount); } else if (data.userId) { userAccount = data.userId.toString(); console.log('从vc.getData().userId获取到用户账号:', userAccount); } // 检查data是否包含userInfo属性 else if (data.userInfo && typeof data.userInfo === 'object') { if (data.userInfo.username || data.userInfo.phone) { userAccount = data.userInfo.username || data.userInfo.phone; console.log('从vc.getData().userInfo获取到用户账号:', userAccount); } else if (data.userInfo.userId) { userAccount = data.userInfo.userId.toString(); console.log('从vc.getData().userInfo.userId获取到用户账号:', userAccount); } } } catch (e) { console.error('解析localStorage中的userInfo失败:', e); } // 2. 检查是否在合同相关页面 var isInContractPage = false; if (currentHash.includes('/contract') || currentHash.includes('/合同') || currentHash.includes('advertisementSummary')) { isInContractPage = true; console.log('当前在合同相关页面,不传入communityId'); // 2. 尝试从localStorage获取 if (!userAccount) { try { let localUserInfo = JSON.parse(window.localStorage.getItem('userInfo')); if (localUserInfo) { console.log('localStorage中的用户信息:', localUserInfo); if (localUserInfo.username || localUserInfo.phone) { userAccount = localUserInfo.username || localUserInfo.phone; console.log('从localStorage获取到用户账号:', userAccount); } else if (localUserInfo.userId) { userAccount = localUserInfo.userId.toString(); console.log('从localStorage.userId获取到用户账号:', userAccount); } } } catch (e) { console.error('解析localStorage中的userInfo失败:', e); } } // 3. 检查是否从合同菜单进入 if (document.referrer && (document.referrer.includes('/contract') || document.referrer.includes('/合同'))) { isInContractPage = true; console.log('从合同菜单进入,不传入communityId'); } console.log('最终获取到的用户账号:', userAccount); var isContractAdminAccount = contractAdminAccounts.includes(userAccount); console.log('是否为合同管理员账号:', isContractAdminAccount); console.log('是否为合同管理员:', isContractAdmin); console.log('是否在合同相关页面:', isInContractPage); // 如果是合同管理员或在合同相关页面,不传入communityId if (isContractAdmin || isInContractPage) { shouldNotPassCommunityId = true; console.log('是合同管理员或在合同相关页面,不传入communityId'); } console.log('是否应该传入communityId:', !shouldNotPassCommunityId); // 只有非合同管理员且不在合同相关页面才需要传入communityId if (!shouldNotPassCommunityId) { // 只有非合同管理员才需要传入communityId if (!isContractAdminAccount) { var currentCommunity = vc.getCurrentCommunity(); console.log('获取到的currentCommunity:', currentCommunity); @@ -129,52 +107,8 @@ console.log('传入的communityId:', currentCommunity.communityId); } } else { // 确保不传入communityId if (param.params.communityId) { delete param.params.communityId; console.log('删除了communityId参数'); } } // 额外检查:确保合同管理员账户不会传入communityId // 合同管理员账号:18916013413/247309 var userAccount = ''; // 尝试从vc.getData()获取 if (userInfo && (userInfo.username || userInfo.phone)) { userAccount = userInfo.username || userInfo.phone; } else if (userInfo && userInfo.userId) { userAccount = userInfo.userId.toString(); } // 尝试从localStorage获取 if (!userAccount) { try { let localUserInfo = JSON.parse(window.localStorage.getItem('userInfo')); if (localUserInfo) { if (localUserInfo.username || localUserInfo.phone) { userAccount = localUserInfo.username || localUserInfo.phone; } else if (localUserInfo.userId) { userAccount = localUserInfo.userId.toString(); } } } catch (e) { console.error('解析localStorage中的userInfo失败:', e); } } console.log('用户账号:', userAccount); // 合同管理员账号列表 var contractAdminAccounts = ['18916013413']; if (contractAdminAccounts.includes(userAccount)) { // 合同管理员账号,强制不传入communityId console.log('合同管理员账号,强制不传入communityId'); // 强制删除communityId参数 if (param.params.communityId) { delete param.params.communityId; console.log('强制删除了communityId参数'); } // 确保param.params中没有communityId delete param.params.communityId; console.log('确保param.params中没有communityId'); public/pages/property/assetImportLogDetail/assetImportLogDetail.js
@@ -335,6 +335,44 @@ // 对于广告合同汇总表导入日志,使用专门的查询逻辑 if (vc.component && !vc.component._isDestroyed) { // 检查用户账号是否为合同管理员账号 var contractAdminAccounts = ['18916013413']; var userAccount = ''; // 尝试从多个来源获取用户账号 var data = vc.getData(); if (data && typeof data === 'object') { if (data.username || data.phone) { userAccount = data.username || data.phone; } else if (data.userId) { userAccount = data.userId.toString(); } else if (data.userInfo && typeof data.userInfo === 'object') { if (data.userInfo.username || data.userInfo.phone) { userAccount = data.userInfo.username || data.userInfo.phone; } else if (data.userInfo.userId) { userAccount = data.userInfo.userId.toString(); } } } // 尝试从localStorage获取 if (!userAccount) { try { let localUserInfo = JSON.parse(window.localStorage.getItem('userInfo')); if (localUserInfo) { if (localUserInfo.username || localUserInfo.phone) { userAccount = localUserInfo.username || localUserInfo.phone; } else if (localUserInfo.userId) { userAccount = localUserInfo.userId.toString(); } } } catch (e) { console.error('解析localStorage中的userInfo失败:', e); } } var isContractAdminAccount = contractAdminAccounts.includes(userAccount); if (vc.component.assetImportLogDetailInfo.logType === 'importContractV2') { // 广告合同汇总表导入日志查询 var param = { @@ -342,12 +380,18 @@ page: _page, row: _rows, logId: vc.component.assetImportLogDetailInfo.logId, // 合同管理员层级的账号所有 communityId 都该为空 communityId: '', state: vc.component.assetImportLogDetailInfo.state, importAdapt: 'importContractV2' // 使用importAdapt参数,与导入时保持一致 } }; // 只有非合同管理员才需要传入communityId if (!isContractAdminAccount) { var currentCommunity = vc.getCurrentCommunity(); if (currentCommunity && currentCommunity.communityId) { param.params.communityId = currentCommunity.communityId; } } // 调用查询函数 queryLogDetails(param, true); @@ -358,13 +402,19 @@ page: _page, row: _rows, logId: vc.component.assetImportLogDetailInfo.logId, // 合同管理员层级的账号所有 communityId 都该为空 communityId: '', state: vc.component.assetImportLogDetailInfo.state, logType: vc.component.assetImportLogDetailInfo.logType } }; // 只有非合同管理员才需要传入communityId if (!isContractAdminAccount) { var currentCommunity = vc.getCurrentCommunity(); if (currentCommunity && currentCommunity.communityId) { param.params.communityId = currentCommunity.communityId; } } // 调用查询函数 queryLogDetails(param, false); } public/vcCore/vcFramework.js
@@ -488,6 +488,7 @@ * 异步去服务端 拉去HTML 和 js */ loadComponent = async function (_componentName, _tree) { let originalComponentName = _componentName; if (vcFramework.isNotEmpty(_componentName) && _componentName.lastIndexOf('/') > 0) { _componentName = _componentName + '/' + _componentName.substring(_componentName.lastIndexOf('/') + 1, _componentName.length); } @@ -503,7 +504,7 @@ if (_tree.vcCreate.hasAttribute("domain")) { _domain = _tree.vcCreate.getAttribute("domain"); } if (_componentName.startsWith('/pages')) { //这里是为了处理 pages 页面 if (originalComponentName.startsWith('/pages')) { //这里是为了处理 pages 页面 filePath = _componentName; } else { //这里是为了处理组件 filePath = '/' + _domain + '/' + _componentName;