From ab5ba1cb04581f55b82e6474452adeb239b9ba44 Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期三, 22 十一月 2023 16:27:08 +0800 Subject: [PATCH] 1.修改了请求网址的路径 2.修改了路由 --- src/api/exceptionApi.js | 3 +-- src/api/site/siteData.js | 13 +++++++++++++ src/api/index.js | 3 ++- src/main.js | 7 ++++--- src/api/site/siteInfo.js | 13 +++++++++++++ src/sfc/ScenarioType.vue | 4 ++-- src/router/index.js | 9 ++++++--- 7 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/api/exceptionApi.js b/src/api/exceptionApi.js index 4140a68..cf9b86d 100644 --- a/src/api/exceptionApi.js +++ b/src/api/exceptionApi.js @@ -92,7 +92,6 @@ */ queryExceptionType(){ return $http.get('/dust/exceptiontype') - } - , + }, } diff --git a/src/api/index.js b/src/api/index.js index 75b646c..e4deb55 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -20,7 +20,8 @@ baseURL: url_py, timeout: 10000 }); + //娣诲姞鎷︽埅鍣� setInterceptors($http,$http_py); -export { $http,$http_py}; +export { $http,$http_py,url}; diff --git a/src/api/site/siteData.js b/src/api/site/siteData.js new file mode 100644 index 0000000..44952e8 --- /dev/null +++ b/src/api/site/siteData.js @@ -0,0 +1,13 @@ + + +import {$http} from '@/api/index.js' +export default { + + /** + * 鏍规嵁璁惧缂栫爜鏌ヨ璇ョ珯鐐逛俊鎭� + */ + queryHistoryData(){ + return $http.get('/dust/history1',{ params: params }) + } + +} \ No newline at end of file diff --git a/src/api/site/siteInfo.js b/src/api/site/siteInfo.js index 1e21940..42b073f 100644 --- a/src/api/site/siteInfo.js +++ b/src/api/site/siteInfo.js @@ -2,6 +2,7 @@ import {$http} from '@/api/index.js' export default { + /** * 鏍规嵁璁惧缂栫爜鏌ヨ璇ョ珯鐐逛俊鎭� */ @@ -10,17 +11,29 @@ params.mnCode = mnCode return $http.get('/dust/siteInfo/info',{params:params}) }, + + /** * 鏌ヨ鎵�鏈夌殑杩愮淮鍟� */ queryDutyCompany() { return $http.get('/dust/siteInfo/dutyCompany') }, + + /** * 鏍规嵁鍦板潃鏌ヨ琛楅亾 */ queryStreet(street) { return $http.get('/dust/siteInfo/street',{params:{street:street}}) + }, + + + /** + * 鑾峰彇涓嶅悓鐨勫紓甯哥被鍨� + */ + queryScenarioTypeName(){ + return $http.get('/dust/scenario') } } \ No newline at end of file diff --git a/src/main.js b/src/main.js index f31b214..94d4bec 100644 --- a/src/main.js +++ b/src/main.js @@ -10,6 +10,8 @@ import 'element-plus/theme-chalk/src/index.scss' import { createPinia } from 'pinia' +import {url} from '@/api/index.js' + const app = createApp(App) const pinia = createPinia() @@ -27,14 +29,13 @@ }) - +// 閮ㄧ讲 +axios.defaults.baseURL = url // 鏈湴 // axios.defaults.baseURL = 'http://localhost:8081' -// 閮ㄧ讲 -axios.defaults.baseURL = 'http://114.215.109.124:8803' // axios.defaults.baseURL = 'http://192.168.1.8:8081' app.config.globalProperties.$http = axios diff --git a/src/router/index.js b/src/router/index.js index dd2b189..10980cb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -112,6 +112,8 @@ component: () => import('@/views/exception/components/SubSiteAudit.vue') }, + + // 寮傚父璇︽儏宓屽叆杩囨浮椤甸潰 { path: '/exceptionDetail/:siteName/:month/', @@ -120,12 +122,13 @@ component: () => import('@/views/risk_assessment/components/SiteDetail.vue') }, + // 寮傚父璇︽儏宓屽叆 { - path: '/SubFlightInspection', - name: 'SubFlightInspection', + path: '/CompFlightInspection', + name: 'CompFlightInspection', meta: { title: '寮傚父璇︽儏宓屽叆' }, - component: () => import('@/views/exception/components/SubFlightInspection.vue') + component: () => import('@/views/exception/components/CompFlightInspection.vue') }, ] }, diff --git a/src/sfc/ScenarioType.vue b/src/sfc/ScenarioType.vue index adc23c7..285a2bc 100644 --- a/src/sfc/ScenarioType.vue +++ b/src/sfc/ScenarioType.vue @@ -8,6 +8,7 @@ <ScenarioType @submitScenarioType="(val) => (scenarioType = val)"> </ScenarioType> --> <script> +import siteInfo from '@/api/site/siteInfo.js' export default { emits:['submitScenarioType'], data() { @@ -21,9 +22,8 @@ methods: { //鑾峰彇涓嶅悓鐨勫紓甯哥被鍨� getScenarioTypeName() { - this.$http.get('/dust/scenario').then(result => { + siteInfo.queryScenarioTypeName().then(result => { this.scenarioType = result.data.data - }); } //鏍规嵁寮傚父涓暟娓叉煋checkbox -- Gitblit v1.9.3