Showing
6 changed files
with
35 additions
and
52 deletions
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | -import axios from 'axios'; | ||
| 3 | import settings from "@/settings" | 2 | import settings from "@/settings" |
| 4 | -import { getToken } from '@/utils/auth' | ||
| 5 | 3 | ||
| 6 | //模板下载 | 4 | //模板下载 |
| 7 | export function downLoadTemplate(template) { | 5 | export function downLoadTemplate(template) { |
| ... | @@ -21,17 +19,11 @@ export function importFlightDestination(file, date) { | ... | @@ -21,17 +19,11 @@ export function importFlightDestination(file, date) { |
| 21 | let formData = new FormData(); | 19 | let formData = new FormData(); |
| 22 | formData.append("file", file); | 20 | formData.append("file", file); |
| 23 | formData.append("beginDate", date); | 21 | formData.append("beginDate", date); |
| 24 | - return axios({ | 22 | + return request({ |
| 25 | method: 'post', | 23 | method: 'post', |
| 26 | url: settings.baseURL + '/flightDestination/importFlightDestination', | 24 | url: settings.baseURL + '/flightDestination/importFlightDestination', |
| 27 | - headers: { 'Authorization': 'Bearer ' + getToken() }, | ||
| 28 | data: formData | 25 | data: formData |
| 29 | }) | 26 | }) |
| 30 | - // return request({ | ||
| 31 | - // url: '/flightDestination/importFlightDestination', | ||
| 32 | - // method: 'post', | ||
| 33 | - // data: formData | ||
| 34 | - // }) | ||
| 35 | } | 27 | } |
| 36 | 28 | ||
| 37 | //URSA目的地批量导入 | 29 | //URSA目的地批量导入 |
| ... | @@ -43,17 +35,11 @@ export function importUrsaDestination(file, date) { | ... | @@ -43,17 +35,11 @@ export function importUrsaDestination(file, date) { |
| 43 | let formData = new FormData(); | 35 | let formData = new FormData(); |
| 44 | formData.append("file", file); | 36 | formData.append("file", file); |
| 45 | formData.append("beginDate", date); | 37 | formData.append("beginDate", date); |
| 46 | - return axios({ | 38 | + return request({ |
| 47 | method: 'post', | 39 | method: 'post', |
| 48 | url: settings.baseURL + '/ursaDestination/importUrsaDestination', | 40 | url: settings.baseURL + '/ursaDestination/importUrsaDestination', |
| 49 | - headers: { 'Authorization': 'Bearer ' + getToken() }, | ||
| 50 | data: formData | 41 | data: formData |
| 51 | }) | 42 | }) |
| 52 | - // return request({ | ||
| 53 | - // url: '/ursaDestination/importUrsaDestination', | ||
| 54 | - // method: 'post', | ||
| 55 | - // data: formData | ||
| 56 | - // }) | ||
| 57 | } | 43 | } |
| 58 | 44 | ||
| 59 | //航班目的地查询 | 45 | //航班目的地查询 | ... | ... |
| ... | @@ -25,10 +25,10 @@ router.beforeEach((to, from, next) => { | ... | @@ -25,10 +25,10 @@ router.beforeEach((to, from, next) => { |
| 25 | }) | 25 | }) |
| 26 | }).catch(err => { | 26 | }).catch(err => { |
| 27 | Message.error(err) | 27 | Message.error(err) |
| 28 | - store.dispatch('LogOut').then(() => { | 28 | + // store.dispatch('LogOut').then(() => { |
| 29 | - // next({ path: '/' }) | 29 | + // // next({ path: '/' }) |
| 30 | - window.location.href = settings.logoutURL;//wsso系统跳转 | 30 | + // window.location.href = settings.loginURL;//wsso系统跳转 |
| 31 | - }) | 31 | + // }) |
| 32 | }) | 32 | }) |
| 33 | } else { | 33 | } else { |
| 34 | next() | 34 | next() |
| ... | @@ -47,7 +47,7 @@ router.beforeEach((to, from, next) => { | ... | @@ -47,7 +47,7 @@ router.beforeEach((to, from, next) => { |
| 47 | // 在免登录白名单,直接进入 | 47 | // 在免登录白名单,直接进入 |
| 48 | next() | 48 | next() |
| 49 | } else { | 49 | } else { |
| 50 | - window.location.href = settings.logoutURL;//wsso系统跳转 | 50 | + window.location.href = settings.loginURL;//wsso系统跳转 |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | } | 53 | } | ... | ... |
| ... | @@ -11,7 +11,7 @@ const service = axios.create({ | ... | @@ -11,7 +11,7 @@ const service = axios.create({ |
| 11 | // axios中请求配置有baseURL选项,表示请求URL公共部分 | 11 | // axios中请求配置有baseURL选项,表示请求URL公共部分 |
| 12 | baseURL: settings.baseURL, | 12 | baseURL: settings.baseURL, |
| 13 | // 超时 | 13 | // 超时 |
| 14 | - timeout: 30000, | 14 | + timeout: 90000, |
| 15 | }) | 15 | }) |
| 16 | 16 | ||
| 17 | // request拦截器 | 17 | // request拦截器 |
| ... | @@ -59,8 +59,10 @@ service.interceptors.response.use(res => { | ... | @@ -59,8 +59,10 @@ service.interceptors.response.use(res => { |
| 59 | // 获取错误信息 | 59 | // 获取错误信息 |
| 60 | const msg = errorCode[code] || res.data.msg || errorCode['default'] | 60 | const msg = errorCode[code] || res.data.msg || errorCode['default'] |
| 61 | if (code === 301) { | 61 | if (code === 301) { |
| 62 | - MessageBox.confirm('登录状态已过期,需重新登录', '系统提示', { | 62 | + MessageBox.confirm('登录状态已过期,需重新登录!msg:' + msg, '系统提示', { |
| 63 | - confirmButtonText: '确定', | 63 | + closeOnClickModal: false, |
| 64 | + showCancelButton: false, | ||
| 65 | + confirmButtonText: '重新登录', | ||
| 64 | type: 'warning' | 66 | type: 'warning' |
| 65 | } | 67 | } |
| 66 | ).then(() => { | 68 | ).then(() => { | ... | ... |
| ... | @@ -24,8 +24,8 @@ | ... | @@ -24,8 +24,8 @@ |
| 24 | <el-row> | 24 | <el-row> |
| 25 | <el-col :span="6"> | 25 | <el-col :span="6"> |
| 26 | <el-form-item label="生效日期" prop="beginDate" :rules="rules"> | 26 | <el-form-item label="生效日期" prop="beginDate" :rules="rules"> |
| 27 | - <el-date-picker class="formItem" v-model="formData.beginDate" type="date" | 27 | + <el-date-picker class="formItem" v-model="formData.beginDate" type="date" placeholder="选择日期" |
| 28 | - placeholder="选择日期" value-format="yyyy-MM-dd" clearable> | 28 | + value-format="yyyy-MM-dd" clearable> |
| 29 | </el-date-picker> | 29 | </el-date-picker> |
| 30 | </el-form-item> | 30 | </el-form-item> |
| 31 | </el-col> | 31 | </el-col> |
| ... | @@ -155,17 +155,17 @@ export default { | ... | @@ -155,17 +155,17 @@ export default { |
| 155 | //上传excel | 155 | //上传excel |
| 156 | const file = option.file; | 156 | const file = option.file; |
| 157 | importFlightDestination(file, this.formData.beginDate).then((res) => { | 157 | importFlightDestination(file, this.formData.beginDate).then((res) => { |
| 158 | - if (res.data.code != 200) { | 158 | + if (res.code != 200) { |
| 159 | - if (res.data.code == 603) { | 159 | + if (res.code == 603) { |
| 160 | this.$alert(res.msg, "提示", { | 160 | this.$alert(res.msg, "提示", { |
| 161 | confirmButtonText: "确定", | 161 | confirmButtonText: "确定", |
| 162 | type: "warning", | 162 | type: "warning", |
| 163 | }); | 163 | }); |
| 164 | - } else if (res.data.code === 201) { | 164 | + } else if (res.code === 201) { |
| 165 | - this.msgWarning(res.data.msg); | 165 | + this.msgWarning(res.msg); |
| 166 | - this.errorData = res.data.data; | 166 | + this.errorData = res.data; |
| 167 | this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightToArea' } }) | 167 | this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightToArea' } }) |
| 168 | - } else if (res.data.code === 301) { | 168 | + } else if (res.code === 301) { |
| 169 | this.$confirm('登录状态已过期,需重新登录', '系统提示', { | 169 | this.$confirm('登录状态已过期,需重新登录', '系统提示', { |
| 170 | closeOnClickModal: false, | 170 | closeOnClickModal: false, |
| 171 | showCancelButton: false, | 171 | showCancelButton: false, |
| ... | @@ -177,7 +177,7 @@ export default { | ... | @@ -177,7 +177,7 @@ export default { |
| 177 | }) | 177 | }) |
| 178 | ) | 178 | ) |
| 179 | } else { | 179 | } else { |
| 180 | - this.msgWarning(res.data.msg); | 180 | + this.msgWarning(res.msg); |
| 181 | } | 181 | } |
| 182 | } else { | 182 | } else { |
| 183 | this.msgSuccess("导入成功"); | 183 | this.msgSuccess("导入成功"); | ... | ... |
| ... | @@ -30,10 +30,8 @@ | ... | @@ -30,10 +30,8 @@ |
| 30 | </el-col> | 30 | </el-col> |
| 31 | <el-col :span="5"> | 31 | <el-col :span="5"> |
| 32 | <el-form-item label="URSA"> | 32 | <el-form-item label="URSA"> |
| 33 | - <el-select v-model="formData.ursas" class="formItem" filterable multiple clearable | 33 | + <el-select v-model="formData.ursas" class="formItem" filterable multiple clearable placeholder="不限"> |
| 34 | - placeholder="不限"> | 34 | + <el-option v-for="item in selectOptionList.ursaList" :label="item" :value="item" :key="item"> |
| 35 | - <el-option v-for="item in selectOptionList.ursaList" :label="item" :value="item" | ||
| 36 | - :key="item"> | ||
| 37 | </el-option> | 35 | </el-option> |
| 38 | </el-select> | 36 | </el-select> |
| 39 | </el-form-item> | 37 | </el-form-item> |
| ... | @@ -56,7 +54,7 @@ | ... | @@ -56,7 +54,7 @@ |
| 56 | </div> | 54 | </div> |
| 57 | <div style="padding:10px"> | 55 | <div style="padding:10px"> |
| 58 | <el-form label-position="right" label-width="auto" size="small"> | 56 | <el-form label-position="right" label-width="auto" size="small"> |
| 59 | - <el-form-item label="坐标系切换"> | 57 | + <el-form-item label="类型"> |
| 60 | <el-radio-group v-model="formData.dimensionName" @change="typeChange"> | 58 | <el-radio-group v-model="formData.dimensionName" @change="typeChange"> |
| 61 | <el-radio label="region">区域</el-radio> | 59 | <el-radio label="region">区域</el-radio> |
| 62 | <el-radio label="area">地区</el-radio> | 60 | <el-radio label="area">地区</el-radio> |
| ... | @@ -66,10 +64,9 @@ | ... | @@ -66,10 +64,9 @@ |
| 66 | </el-form-item> | 64 | </el-form-item> |
| 67 | </el-form> | 65 | </el-form> |
| 68 | <div v-for="(item, index) in barChartData" :key="index"> | 66 | <div v-for="(item, index) in barChartData" :key="index"> |
| 69 | - <Chart :className="'chart' + index.toString()" :chartData="item" height="350px" | 67 | + <Chart :className="'chart' + index.toString()" :chartData="item" height="350px" style="margin-bottom:10px" |
| 70 | - style="margin-bottom:10px" :loading="loading" /> | 68 | + :loading="loading" /> |
| 71 | </div> | 69 | </div> |
| 72 | - | ||
| 73 | </div> | 70 | </div> |
| 74 | </div> | 71 | </div> |
| 75 | </template> | 72 | </template> |
| ... | @@ -224,6 +221,4 @@ export default { | ... | @@ -224,6 +221,4 @@ export default { |
| 224 | } | 221 | } |
| 225 | </script> | 222 | </script> |
| 226 | 223 | ||
| 227 | -<style> | ||
| 228 | - | ||
| 229 | -</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 224 | +<style></style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -162,17 +162,17 @@ export default { | ... | @@ -162,17 +162,17 @@ export default { |
| 162 | //上传excel | 162 | //上传excel |
| 163 | const file = option.file; | 163 | const file = option.file; |
| 164 | importUrsaDestination(file, this.formData.beginDate).then((res) => { | 164 | importUrsaDestination(file, this.formData.beginDate).then((res) => { |
| 165 | - if (res.data.code != 200) { | 165 | + if (res.code != 200) { |
| 166 | - if (res.data.code == 603) { | 166 | + if (res.code == 603) { |
| 167 | - this.$alert(res.data.msg, "提示", { | 167 | + this.$alert(res.msg, "提示", { |
| 168 | confirmButtonText: "确定", | 168 | confirmButtonText: "确定", |
| 169 | type: "warning", | 169 | type: "warning", |
| 170 | }); | 170 | }); |
| 171 | - } else if (res.data.code === 201) { | 171 | + } else if (res.code === 201) { |
| 172 | - this.msgWarning(res.data.msg); | 172 | + this.msgWarning(res.msg); |
| 173 | - this.errorData = res.data.data; | 173 | + this.errorData = res.data; |
| 174 | this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } }) | 174 | this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } }) |
| 175 | - } else if (res.data.code === 301) { | 175 | + } else if (res.code === 301) { |
| 176 | this.$confirm('登录状态已过期,需重新登录', '系统提示', { | 176 | this.$confirm('登录状态已过期,需重新登录', '系统提示', { |
| 177 | closeOnClickModal: false, | 177 | closeOnClickModal: false, |
| 178 | showCancelButton: false, | 178 | showCancelButton: false, |
| ... | @@ -184,7 +184,7 @@ export default { | ... | @@ -184,7 +184,7 @@ export default { |
| 184 | }) | 184 | }) |
| 185 | ) | 185 | ) |
| 186 | } else { | 186 | } else { |
| 187 | - this.msgWarning(res.data.msg); | 187 | + this.msgWarning(res.msg); |
| 188 | } | 188 | } |
| 189 | } else { | 189 | } else { |
| 190 | this.msgSuccess("导入成功"); | 190 | this.msgSuccess("导入成功"); | ... | ... |
-
Please register or login to post a comment