Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 【审计报表】审计风险报表异常 --bug=133310627 #462

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/backend/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,19 @@
# 全局配置
BK_SHARED_RES_URL = os.getenv("BKAPP_BK_SHARED_RES_URL", os.getenv("BKPAAS_SHARED_RES_URL", ""))

# CORS 允许的 header
CORS_ALLOW_HEADERS = [
"x-requested-with",
"content-type",
"accept,origin",
"authorization",
"x-csrftoken",
"user-agent",
"accept-encoding",
"time-zone",
*os.getenv("BKAPP_CORS_ALLOW_HEADERS", "").split(","),
]

"""
以下为框架代码 请勿修改
"""
Expand Down
49 changes: 25 additions & 24 deletions src/frontend/src/views/statement-manage/detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<script setup lang="ts">
import {
onMounted,
onUnmounted,
watch,
} from 'vue';
import {
Expand All @@ -43,6 +44,7 @@
const route = useRoute();
const { messageError } = useMessage();
const { emit } = useEventBus();
let app: any;

const loadScript = (src: string) => new Promise((resolve, reject) => {
const script = document.createElement('script');
Expand All @@ -62,41 +64,34 @@
}
};

const render = () => {
window.BkVisionSDK.init(
'#panel',
route.params.id,
{
apiPrefix: `${window.PROJECT_CONFIG.AJAX_URL_PREFIX}/bkvision/`,
chartToolMenu: [
{ type: 'tool', id: 'fullscreen', build_in: true },
{ type: 'tool', id: 'refresh', build_in: true },
{ type: 'menu', id: 'excel', build_in: true },
],
handleError,
},
);
const change = (uid: string) => {
app.update(uid);
};

const init = async () => {
try {
// 样式文件
const link = document.createElement('link');
link.href = 'https://staticfile.qq.com/bkvision/p7e76e4518060411cb65c6bc2eaea9c03/latest/main.css?v=1704275097';
link.rel = 'stylesheet';
document.body.append(link);
await loadScript('https://staticfile.qq.com/bkvision/p7e76e4518060411cb65c6bc2eaea9c03/latest/chunk-vendors.js?v=1704275097');
await loadScript('https://staticfile.qq.com/bkvision/p7e76e4518060411cb65c6bc2eaea9c03/latest/chunk-bk-magic-vue.js?v=1704275097');
await loadScript('https://staticfile.qq.com/bkvision/p7e76e4518060411cb65c6bc2eaea9c03/latest/main.js?v=1704275097');
render();
await loadScript('https://staticfile.qq.com/bkvision/pbb9b207ba200407982a9bd3d3f2895d4/latest/main.js');
app = await window.BkVisionSDK.init(
'#panel',
route.params.id,
{
apiPrefix: `${window.PROJECT_CONFIG.AJAX_URL_PREFIX}/bkvision/`,
chartToolMenu: [
{ type: 'tool', id: 'fullscreen', build_in: true },
{ type: 'tool', id: 'refresh', build_in: true },
{ type: 'menu', id: 'excel', build_in: true },
],
handleError,
},
);
} catch (error) {
console.error(error);
}
};

watch(() => route, () => {
if (route.params.id !== '' && route.name === 'statementManageDetail') {
render();
change(route.params.id as string);
}
}, {
deep: true,
Expand All @@ -105,4 +100,10 @@
onMounted(() => {
init();
});

onUnmounted(() => {
if (app) {
app.unmount();
}
});
</script>
Loading