Commit 51bb739d authored by 周宏民's avatar 周宏民

fix: 项目案例权限通过 userID判断

parent 659dd87b
Pipeline #89220 waiting for manual action with stages
...@@ -137,14 +137,14 @@ const BottomItem = props => { ...@@ -137,14 +137,14 @@ const BottomItem = props => {
服务客户: 服务客户:
</div> </div>
<div className={styles.l_item_num_list}>{renderNum(infoData['服务客户'], '服务客户')}</div> <div className={styles.l_item_num_list}>{renderNum(infoData['服务客户'], '服务客户')}</div>
<div className={styles.l_item_num_unit} type="add" /> <div className={styles.l_item_num_unit}></div>
</div> </div>
<div className={styles.l_item}> <div className={styles.l_item}>
<div className={styles.l_item_title} type="覆盖省份"> <div className={styles.l_item_title} type="覆盖省份">
覆盖省份: 覆盖省份:
</div> </div>
<div className={styles.l_item_num_list}>{renderNum(infoData['覆盖省份'], '覆盖省份')}</div> <div className={styles.l_item_num_list}>{renderNum(infoData['覆盖省份'], '覆盖省份')}</div>
<div className={styles.l_item_num_unit} type="add" /> <div className={styles.l_item_num_unit}></div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -268,48 +268,59 @@ const Demonstration = props => { ...@@ -268,48 +268,59 @@ const Demonstration = props => {
}; };
const getProjectConfig = () => { const getProjectConfig = () => {
if (!props.global?.userInfo?.loginName) return; if (!props.global?.userInfo?.loginName) return;
appService const params = {
.getAccountPageList({ ignoreSite: true,
ignoreSite: true, accountName: '项目案例临时账号管理',
accountName: '项目案例临时账号管理', isAll: true,
isAll: true, queryWheres: [
queryWheres: [ {
{ field: '是否禁用',
field: '账号', type: '不等于',
type: '等于', value: '是',
value: props.global.userInfo.loginName, },
}, ],
{ };
field: '是否禁用', if (props.global.userInfo.OID) {
type: '不等于', params.queryWheres.push({
value: '是', field: '账号',
}, type: '等于',
], value: props.global.userInfo.OID.toString(),
}) });
.then(res => { }
const dataStr = res?.data?.jsonData || ''; appService.getAccountPageList(params).then(res => {
const data = dataStr ? JSON.parse(dataStr) : []; let data = res?.data?.list || [];
const obj = {}; data = data.map(d => {
data.forEach(d => { const obj = {
if (!d['项目平台名称']) return; ID: d.id,
if (!d['开始时间']) return false; };
if (!d['结束时间'] && moment().isAfter(d['开始时间'])) { if (Array.isArray(d.webRow)) {
const arr = d['项目平台名称'].split(','); d.webRow.forEach(w => {
arr.forEach(a => { obj[w.fieldName] = w.fieldValue;
obj[a] = true; });
}); }
return obj;
});
const obj = {};
data.forEach(d => {
if (!d['项目平台名称']) return;
if (!d['开始时间']) return false;
if (!d['结束时间'] && moment().isAfter(d['开始时间'])) {
const arr = d['项目平台名称'].split(',');
arr.forEach(a => {
obj[a] = true;
});
return; return;
} }
if (moment().isBetween(d['开始时间'], d['结束时间'])) { if (moment().isBetween(d['开始时间'], d['结束时间'])) {
const arr = d['项目平台名称'].split(','); const arr = d['项目平台名称'].split(',');
arr.forEach(a => { arr.forEach(a => {
obj[a] = true; obj[a] = true;
}); });
} }
});
setProjectConfig(obj);
}); });
setProjectConfig(obj);
});
}; };
const getData = () => { const getData = () => {
setLoading(true); setLoading(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment