From ca4a79e74222ad9e21642ef5227b73123b4c631a Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Thu, 13 Jul 2023 18:14:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=AE=9E=E4=BE=8B=EF=BC=8C=E6=8A=8Aaxios=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E6=8C=82=E8=BD=BD=E5=88=B0vue=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/example/main.js | 3 ++- .../BigScreenDesign/ComponentDialog/index.vue | 2 +- .../OverallSetting/BgImgDialog.vue | 2 +- .../BigScreenDesign/OverallSetting/index.vue | 1 - .../BigScreenDesign/SourceDialog/index.vue | 4 +-- .../packages/BigScreenDesign/index.vue | 2 +- .../BigScreenList/CatalogEditForm.vue | 12 ++++----- .../packages/BigScreenList/EditForm.vue | 8 +++--- data-room-ui/packages/BigScreenList/index.vue | 6 ++--- .../packages/BigScreenMag/SideMenu.vue | 10 +++---- .../BigScreenManagement/addDialog.vue | 8 +++--- .../packages/BigScreenManagement/index.vue | 16 ++++++------ data-room-ui/packages/BigScreenRun/index.vue | 16 +----------- .../ComponentList/CatalogEditForm.vue | 10 +++---- .../packages/ComponentList/EditForm.vue | 14 +++++----- data-room-ui/packages/ComponentList/index.vue | 6 ++--- .../innerComponents/aMap/index.vue | 7 +++++ data-room-ui/packages/SourceList/EditForm.vue | 8 +++--- data-room-ui/packages/SourceList/index.vue | 10 +++---- data-room-ui/packages/SourceMag/SideMenu.vue | 10 +++---- data-room-ui/packages/TemplateList/index.vue | 4 +-- data-room-ui/packages/index.js | 10 +++---- data-room-ui/packages/js/api/bigScreenApi.js | 24 ++++++++--------- .../packages/js/utils/LabelConfigService.js | 25 +++++++++--------- .../packages/js/utils/dataSourceService.js | 25 +++++++++--------- .../packages/js/utils/datasetConfigService.js | 26 +++++++++---------- 26 files changed, 128 insertions(+), 141 deletions(-) diff --git a/data-room-ui/example/main.js b/data-room-ui/example/main.js index a50acf96..acc4c5b4 100644 --- a/data-room-ui/example/main.js +++ b/data-room-ui/example/main.js @@ -9,11 +9,11 @@ import store from './store' import router from './router' import 'element-ui/lib/theme-chalk/index.css' import '@/assets/styles/index.scss' +import * as $dataRoomAxios from 'data-room-ui/js/utils/http.js' import { registerConfig } from '@gcpaas/data-room-ui' import remoteComponents from '@/remoteComponents/exports.js' import customDatasetComponents from '@/customDatasetComponents/exports.js' Vue.use(ElementUI, { size: 'mini' }) - registerConfig( { routers: { @@ -62,6 +62,7 @@ registerConfig( promise.polyfill() // 自定义指令 Vue.use(ElementUI, { size: 'mini' }) +Vue.prototype.$dataRoomAxios = $dataRoomAxios Vue.config.productionTip = false /* eslint-disable no-new */ diff --git a/data-room-ui/packages/BigScreenDesign/ComponentDialog/index.vue b/data-room-ui/packages/BigScreenDesign/ComponentDialog/index.vue index ac6dae09..2793cb3e 100644 --- a/data-room-ui/packages/BigScreenDesign/ComponentDialog/index.vue +++ b/data-room-ui/packages/BigScreenDesign/ComponentDialog/index.vue @@ -423,7 +423,7 @@ export default { }, getDataList () { this.loading = true - get('/bigScreen/design/page', { + this.$dataRoomAxios.get('/bigScreen/design/page', { parentCode: this.code || null, current: this.current, size: this.size, diff --git a/data-room-ui/packages/BigScreenDesign/OverallSetting/BgImgDialog.vue b/data-room-ui/packages/BigScreenDesign/OverallSetting/BgImgDialog.vue index 03f063c5..95c3df5c 100644 --- a/data-room-ui/packages/BigScreenDesign/OverallSetting/BgImgDialog.vue +++ b/data-room-ui/packages/BigScreenDesign/OverallSetting/BgImgDialog.vue @@ -122,7 +122,7 @@ export default { }] : [] this.hideUploadImgBtn = this.fileList.length !== 0 - get('/bigScreen/design/bg/list').then(list => { + this.$dataRoomAxios.get('/bigScreen/design/bg/list').then(list => { this.bgImgList = list }) }, diff --git a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue index 9835ad48..2a92a9e3 100644 --- a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue +++ b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue @@ -365,7 +365,6 @@ export default { this.pageInfo.pageConfig.refreshConfig = [] } this.form = { ...this.pageInfo.pageConfig } - console.log('this.form', this.form) this.drawerVisible = true if (this.pageInfo.chartList.length === 0) { this.pageInfo.pageConfig.refreshConfig = [] diff --git a/data-room-ui/packages/BigScreenDesign/SourceDialog/index.vue b/data-room-ui/packages/BigScreenDesign/SourceDialog/index.vue index 609d9821..47bb9867 100644 --- a/data-room-ui/packages/BigScreenDesign/SourceDialog/index.vue +++ b/data-room-ui/packages/BigScreenDesign/SourceDialog/index.vue @@ -186,7 +186,7 @@ export default { }, getDataList () { this.loading = true - get('/bigScreen/file', { + this.$dataRoomAxios.get('/bigScreen/file', { module: this.code, current: this.current, size: this.size, @@ -203,7 +203,7 @@ export default { }, // 获取目录的列表 getCatalogList () { - get('/bigScreen/type/list/resourceCatalog') + this.$dataRoomAxios.get('/bigScreen/type/list/resourceCatalog') .then((data) => { this.options = data }) diff --git a/data-room-ui/packages/BigScreenDesign/index.vue b/data-room-ui/packages/BigScreenDesign/index.vue index 8647fa7c..63805766 100644 --- a/data-room-ui/packages/BigScreenDesign/index.vue +++ b/data-room-ui/packages/BigScreenDesign/index.vue @@ -275,7 +275,7 @@ export default { ]), // 判断页面权限 permission () { - get(`/bigScreen/permission/check/${this.pageCode}`).then(res => { + this.$dataRoomAxios.get(`/bigScreen/permission/check/${this.pageCode}`).then(res => { this.hasPermission = res if (res) { this.init() diff --git a/data-room-ui/packages/BigScreenList/CatalogEditForm.vue b/data-room-ui/packages/BigScreenList/CatalogEditForm.vue index 26d383df..3c7437df 100644 --- a/data-room-ui/packages/BigScreenList/CatalogEditForm.vue +++ b/data-room-ui/packages/BigScreenList/CatalogEditForm.vue @@ -134,8 +134,8 @@