✨ immediate-enabled关闭时隐藏项目/合同推送合规入口
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,43 @@ import request from '@/axios';
|
|||||||
|
|
||||||
const baseUrl = '/blade-transport/hcs';
|
const baseUrl = '/blade-transport/hcs';
|
||||||
|
|
||||||
|
/** 进程内缓存,避免列表页重复请求推送开关 */
|
||||||
|
let immediateEnabledCache = null;
|
||||||
|
let immediateEnabledPromise = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 HCS 即时推送开关(thirdParty.hcs.push.immediate-enabled)。
|
||||||
|
* 关闭时项目管理/合同管理隐藏「推送合规」「批量推送合规」。
|
||||||
|
*/
|
||||||
|
export const getPushConfig = () =>
|
||||||
|
request({
|
||||||
|
url: `${baseUrl}/push-config`,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
|
||||||
|
export const loadHcsImmediateEnabled = () => {
|
||||||
|
if (immediateEnabledCache !== null) {
|
||||||
|
return Promise.resolve(immediateEnabledCache);
|
||||||
|
}
|
||||||
|
if (immediateEnabledPromise) {
|
||||||
|
return immediateEnabledPromise;
|
||||||
|
}
|
||||||
|
immediateEnabledPromise = getPushConfig()
|
||||||
|
.then(res => {
|
||||||
|
const data = res?.data?.data ?? res?.data ?? {};
|
||||||
|
immediateEnabledCache = data.immediateEnabled === true || data.immediateEnabled === 'true';
|
||||||
|
return immediateEnabledCache;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
immediateEnabledCache = false;
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
immediateEnabledPromise = null;
|
||||||
|
});
|
||||||
|
return immediateEnabledPromise;
|
||||||
|
};
|
||||||
|
|
||||||
// 合规推送涉及 HCS 远程多次调用(风险校验+附件转传+起草),可达 20s+,覆盖全局 10s 超时
|
// 合规推送涉及 HCS 远程多次调用(风险校验+附件转传+起草),可达 20s+,覆盖全局 10s 超时
|
||||||
export const repush = (bizType, id) =>
|
export const repush = (bizType, id) =>
|
||||||
request({
|
request({
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
批量导出
|
批量导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="hcsImmediateEnabled"
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
:loading="hcsRepushingId === 'batch'"
|
:loading="hcsRepushingId === 'batch'"
|
||||||
@@ -112,7 +113,11 @@
|
|||||||
>
|
>
|
||||||
{{ operation.label }}
|
{{ operation.label }}
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-link v-if="canHcsRepush(row)" type="warning" @click="handleHcsRepush(row)">
|
<el-link
|
||||||
|
v-if="hcsImmediateEnabled && canHcsRepush(row)"
|
||||||
|
type="warning"
|
||||||
|
@click="handleHcsRepush(row)"
|
||||||
|
>
|
||||||
{{ hcsRepushingId === row.id ? '推送中…' : '推送合规' }}
|
{{ hcsRepushingId === row.id ? '推送中…' : '推送合规' }}
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-link v-if="canDelete(row)" type="danger" @click="removeRow(row)">删除</el-link>
|
<el-link v-if="canDelete(row)" type="danger" @click="removeRow(row)">删除</el-link>
|
||||||
@@ -1090,7 +1095,12 @@ import 'nprogress/nprogress.css';
|
|||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
import * as api from '@/api/business/contract-manage';
|
import * as api from '@/api/business/contract-manage';
|
||||||
import { createFromContract } from '@/api/business/contract-change';
|
import { createFromContract } from '@/api/business/contract-change';
|
||||||
import { repush as hcsRepush, repushBatch as hcsRepushBatch, getRisk } from '@/api/business/hcs';
|
import {
|
||||||
|
getRisk,
|
||||||
|
loadHcsImmediateEnabled,
|
||||||
|
repush as hcsRepush,
|
||||||
|
repushBatch as hcsRepushBatch,
|
||||||
|
} from '@/api/business/hcs';
|
||||||
import { Position } from '@element-plus/icons-vue';
|
import { Position } from '@element-plus/icons-vue';
|
||||||
import { getMkPublicDetail } from '@/api/mk-process';
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||||
@@ -1427,8 +1437,9 @@ export default {
|
|||||||
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
||||||
detailLoading: false,
|
detailLoading: false,
|
||||||
detailRow: {},
|
detailRow: {},
|
||||||
// 合规(HCS)推送/对账状态
|
// 合规(HCS)推送/对账状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
|
||||||
hcsRepushingId: null,
|
hcsRepushingId: null,
|
||||||
|
hcsImmediateEnabled: false,
|
||||||
detailContractFileRows: [],
|
detailContractFileRows: [],
|
||||||
detailAttachmentRows: [],
|
detailAttachmentRows: [],
|
||||||
detailBillingPlanRows: [],
|
detailBillingPlanRows: [],
|
||||||
@@ -1699,6 +1710,13 @@ export default {
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.mkEnabled = false;
|
this.mkEnabled = false;
|
||||||
});
|
});
|
||||||
|
loadHcsImmediateEnabled()
|
||||||
|
.then(enabled => {
|
||||||
|
this.hcsImmediateEnabled = !!enabled;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.hcsImmediateEnabled = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (this.isFormPage) this.initFormPage();
|
if (this.isFormPage) this.initFormPage();
|
||||||
if (this.isDetailPage) this.initDetailPage();
|
if (this.isDetailPage) this.initDetailPage();
|
||||||
@@ -1761,6 +1779,7 @@ export default {
|
|||||||
},
|
},
|
||||||
canHcsRepush(row) {
|
canHcsRepush(row) {
|
||||||
return (
|
return (
|
||||||
|
this.hcsImmediateEnabled &&
|
||||||
['approved', 'change_approved'].includes(row.approvalStatus) &&
|
['approved', 'change_approved'].includes(row.approvalStatus) &&
|
||||||
row.hcsSyncStatus !== 'synced'
|
row.hcsSyncStatus !== 'synced'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
v-if="!readonlyScope"
|
v-if="!readonlyScope && hcsImmediateEnabled"
|
||||||
:loading="hcsRepushingId === 'batch'"
|
:loading="hcsRepushingId === 'batch'"
|
||||||
@click="handleHcsBatchRepush"
|
@click="handleHcsBatchRepush"
|
||||||
>
|
>
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
{{ operation.label }}
|
{{ operation.label }}
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-link
|
<el-link
|
||||||
v-if="canHcsRepush(row)"
|
v-if="hcsImmediateEnabled && canHcsRepush(row)"
|
||||||
type="warning"
|
type="warning"
|
||||||
@click="handleHcsRepush(row)"
|
@click="handleHcsRepush(row)"
|
||||||
>
|
>
|
||||||
@@ -984,7 +984,11 @@
|
|||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
import { defineAsyncComponent } from 'vue';
|
import { defineAsyncComponent } from 'vue';
|
||||||
import * as api from '@/api/business/project-apply';
|
import * as api from '@/api/business/project-apply';
|
||||||
import { repush as hcsRepush, repushBatch as hcsRepushBatch } from '@/api/business/hcs';
|
import {
|
||||||
|
loadHcsImmediateEnabled,
|
||||||
|
repush as hcsRepush,
|
||||||
|
repushBatch as hcsRepushBatch,
|
||||||
|
} from '@/api/business/hcs';
|
||||||
import { Position } from '@element-plus/icons-vue';
|
import { Position } from '@element-plus/icons-vue';
|
||||||
import { getMkPublicDetail } from '@/api/mk-process';
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import {
|
import {
|
||||||
@@ -1196,8 +1200,9 @@ export default {
|
|||||||
{ label: '高风险', value: 'high', statKey: 'high' },
|
{ label: '高风险', value: 'high', statKey: 'high' },
|
||||||
{ label: '中风险', value: 'medium', statKey: 'medium' },
|
{ label: '中风险', value: 'medium', statKey: 'medium' },
|
||||||
],
|
],
|
||||||
// 合规(HCS)推送状态
|
// 合规(HCS)推送状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
|
||||||
hcsRepushingId: null,
|
hcsRepushingId: null,
|
||||||
|
hcsImmediateEnabled: false,
|
||||||
page: {
|
page: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageSizes: [10, 20, 50, 100],
|
pageSizes: [10, 20, 50, 100],
|
||||||
@@ -1556,6 +1561,13 @@ export default {
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.mkEnabled = false;
|
this.mkEnabled = false;
|
||||||
});
|
});
|
||||||
|
loadHcsImmediateEnabled()
|
||||||
|
.then(enabled => {
|
||||||
|
this.hcsImmediateEnabled = !!enabled;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.hcsImmediateEnabled = false;
|
||||||
|
});
|
||||||
this.loadDeptOptions();
|
this.loadDeptOptions();
|
||||||
this.loadCargoTypeOptions();
|
this.loadCargoTypeOptions();
|
||||||
this.loadTransportTypeOptions();
|
this.loadTransportTypeOptions();
|
||||||
@@ -1790,6 +1802,7 @@ export default {
|
|||||||
},
|
},
|
||||||
canHcsRepush(row) {
|
canHcsRepush(row) {
|
||||||
return (
|
return (
|
||||||
|
this.hcsImmediateEnabled &&
|
||||||
!this.readonlyScope &&
|
!this.readonlyScope &&
|
||||||
['approved', 'change_approved'].includes(row.approvalStatus) &&
|
['approved', 'change_approved'].includes(row.approvalStatus) &&
|
||||||
row.hcsSyncStatus !== 'synced'
|
row.hcsSyncStatus !== 'synced'
|
||||||
|
|||||||
Reference in New Issue
Block a user