作者 shenhailong

查询列表添加失效状态

修改密码添加 旧密码验证
添加 统一认证前端页面
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 <head> 4 <head>
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 <title>机场口岸通关物流辅助管理系统</title> 6 <title>机场口岸通关物流辅助管理系统</title>
  7 +<!-- <title>货运统计分析</title>-->
7 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> 8 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
8 </head> 9 </head>
9 10
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 }, 11 },
12 "dependencies": { 12 "dependencies": {
13 "@xkeshi/vue-barcode": "^1.0.0", 13 "@xkeshi/vue-barcode": "^1.0.0",
14 - "axios": "^0.19.0", 14 + "axios": "^0.21.1",
15 "common": "^0.2.5", 15 "common": "^0.2.5",
16 "echarts": "^3.3.2", 16 "echarts": "^3.3.2",
17 "element-ui": "^2.13.0", 17 "element-ui": "^2.13.0",
  1 +import http from '../http.js'
  2 +let baseUrl = '/analysis-agent/agent'
  3 +
  4 +
  5 +export const getAnalysisList = params => { return http.get(`${baseUrl}/analysis`,params) };
  6 +export const getNmmsAnalysisList = params => { return http.get(`/analysis-nmms/nmmsAnalysis/analysis`,params) };
  7 +
  1 +import http from './http.js'
  2 +import axios from "axios";
  3 +
  4 +let baseUrl = 'cgonms-arrival'
  5 +//进港业务数据统计分析
  6 +
  7 +export const getArrivalDataAnalysis = params =>{return http.get(`${baseUrl}/cgoNms/getInfo`, params);};
  8 +
  9 +export const createArrivalExcel = params => { return http.post(`${baseUrl}/arrival/excel`, params)};
  10 +
  11 +export const downArrivalExcel = params => { return axios.get(`${baseUrl}/arrival/downExcel`, params ) };
  1 +import http from './http.js'
  2 +import axios from "axios";
  3 +
  4 +let baseUrl = 'cgonms-provide'
  5 +
  6 +
  7 +export const getExitDataAnalysis = params =>{return http.get(`${baseUrl}/cgoNms/getInfo`, params);};
  8 +
  9 +export const createExcel = params => { return http.post(`${baseUrl}/exit/excel`,params)};
  10 +
  11 +
  12 +
  13 +export const downExcel = params => { return axios.get(`${baseUrl}/exit/downExcel`, { params: params }); };
@@ -46,15 +46,29 @@ export default { @@ -46,15 +46,29 @@ export default {
46 login: data =>{ 46 login: data =>{
47 return axios({ 47 return axios({
48 method: 'POST', // 请求协议 48 method: 'POST', // 请求协议
49 - // url: 'cloud-user-center/login', // 请求的地址  
50 - url: 'cloud-kako-user-center/login', // 请求的地址 49 + url: 'cloud-user-center/login', // 请求的地址
  50 + // url: 'cloud-kako-user-center/login', // 请求的地址
51 data: qs.stringify(data), // post 请求的数据 51 data: qs.stringify(data), // post 请求的数据
52 timeout: 30000, // 超时时间, 单位毫秒 52 timeout: 30000, // 超时时间, 单位毫秒
53 headers: { 53 headers: {
54 'Content-Type': 'application/x-www-form-urlencoded' 54 'Content-Type': 'application/x-www-form-urlencoded'
55 } 55 }
56 }) 56 })
  57 + },
  58 +
  59 + ssoLogin: data =>{
  60 + return axios({
  61 + method: 'POST', // 请求协议
  62 + // url: 'cloud-user-center/login', // 请求的地址
  63 + url: 'cloud-kako-user-center/ssoLogin', // 请求的地址
  64 + data: qs.stringify(data), // post 请求的数据
  65 + timeout: 30000, // 超时时间, 单位毫秒
  66 + headers: {
  67 + 'Content-Type': 'application/x-www-form-urlencoded'
57 } 68 }
  69 + })
  70 + },
  71 +
58 } 72 }
59 73
60 // { 74 // {
  1 +export function UrlSearch(){
  2 + let name,value,str=location.href,num=str.indexOf("?"); //取得整个地址栏
  3 + str=str.substr(num+1); //取得所有参数 stringvar.substr(start [, length ]
  4 + let arr=str.split("&"); //各个参数放到数组里
  5 + console.log(arr)
  6 + for(let i=0;i < arr.length;i++){
  7 + num=arr[i].indexOf("=");
  8 + if(num>0){
  9 + name=arr[i].substring(0,num);
  10 + value=arr[i].substr(num+1);
  11 + this[name]=value;
  12 + }
  13 + }
  14 +}
@@ -10,7 +10,7 @@ export const removeUser = params => { return http.del(`${baseUrl}/del`,params)}; @@ -10,7 +10,7 @@ export const removeUser = params => { return http.del(`${baseUrl}/del`,params)};
10 10
11 export const batchRemoveUser = params => { return http.del(`${baseUrl}/batchremove`, { params: params }); }; 11 export const batchRemoveUser = params => { return http.del(`${baseUrl}/batchremove`, { params: params }); };
12 12
13 -export const editPass = params => { return http.put(`${baseUrl}/password`,params)}; 13 +export const editPass = params => { return http.put(`/sso-kako-user-center/user/password`,params)};
14 14
15 export const editUser = params => { return http.put(`${baseUrl}/edit`,params)}; 15 export const editUser = params => { return http.put(`${baseUrl}/edit`,params)};
16 16
@@ -22,3 +22,7 @@ export const resetToken = params => { return http.put(`${baseUrl}/resetToken`,pa @@ -22,3 +22,7 @@ export const resetToken = params => { return http.put(`${baseUrl}/resetToken`,pa
22 22
23 export const getRandCode = params => { return http.post('/cloud-kako-user-center/anonymous/randCode', params); }; 23 export const getRandCode = params => { return http.post('/cloud-kako-user-center/anonymous/randCode', params); };
24 24
  25 +// export const testLogin = params => { return http.get(`http://10.5.11.88:6633/resource/login`, params); };
  26 +export const testLogin = params => { return http.get(`/sso-kako-user-center/anonymous/ssoLogin`, params); };
  27 +// export const testLogin = params => { return http.get(`http://10.50.3.73:8880/anonymous/ssoLogin`, params); };
  28 +
@@ -23,9 +23,10 @@ var axois_init = { @@ -23,9 +23,10 @@ var axois_init = {
23 // 直接丢sessionStorage 23 // 直接丢sessionStorage
24 if (!sessionStorage.getItem("token")) { 24 if (!sessionStorage.getItem("token")) {
25 // 若是接口访问的时候没有发现有鉴权的基础信息,直接返回登录页 25 // 若是接口访问的时候没有发现有鉴权的基础信息,直接返回登录页
26 - router.push({  
27 - path: "/login"  
28 - }); 26 + // router.push({
  27 + // // path: "/login"
  28 + // path: "/main"
  29 + // });
29 } 30 }
30 31
31 // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面 32 // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面
@@ -85,21 +86,21 @@ var axois_init = { @@ -85,21 +86,21 @@ var axois_init = {
85 }, 86 },
86 init_router: (router,axios) => { 87 init_router: (router,axios) => {
87 router.beforeEach((to, from, next) => { 88 router.beforeEach((to, from, next) => {
88 - //NProgress.start();  
89 - if (to.path == '/login') {  
90 - sessionStorage.removeItem('user');  
91 - sessionStorage.removeItem('menu');  
92 - sessionStorage.removeItem('token');  
93 - }else{  
94 - let user = JSON.parse(sessionStorage.getItem('user'));  
95 - if(sessionStorage.getItem('token')){  
96 - axios.defaults.headers.common['Authorization'] = sessionStorage.getItem('token');  
97 - }  
98 -  
99 - if (!jsutil.checkNull(user) && to.path != '/login' && !sessionStorage.getItem('menu') && !sessionStorage.getItem('token')) {  
100 - next({ path: '/login' })  
101 - }  
102 - } 89 + // NProgress.start();
  90 + // if (to.path == '/login') {
  91 + // sessionStorage.removeItem('user');
  92 + // sessionStorage.removeItem('menu');
  93 + // sessionStorage.removeItem('token');
  94 + // }else{
  95 + // let user = JSON.parse(sessionStorage.getItem('user'));
  96 + // if(sessionStorage.getItem('token')){
  97 + // axios.defaults.headers.common['Authorization'] = sessionStorage.getItem('token');
  98 + // }
  99 + //
  100 + // if (!jsutil.checkNull(user) && to.path != '/login' && !sessionStorage.getItem('menu') && !sessionStorage.getItem('token')) {
  101 + // next({ path: '/login' })
  102 + // }
  103 + // }
103 next() 104 next()
104 }); 105 });
105 } 106 }
1 import Login from './views/Login.vue' 1 import Login from './views/Login.vue'
  2 +import ssoLogin from './views/SsoLogin.vue'
2 import NotFound from './views/404.vue' 3 import NotFound from './views/404.vue'
3 import Home from './views/Home.vue' 4 import Home from './views/Home.vue'
4 import Main from './views/dashboard/index' 5 import Main from './views/dashboard/index'
@@ -17,6 +18,11 @@ import Yard from './views/station_manage/Yard.vue' @@ -17,6 +18,11 @@ import Yard from './views/station_manage/Yard.vue'
17 import Bayonet from './views/station_manage/Bayonet.vue' 18 import Bayonet from './views/station_manage/Bayonet.vue'
18 import Warehouse from './views/station_manage/Warehouse.vue' 19 import Warehouse from './views/station_manage/Warehouse.vue'
19 import Verecord from './views/road_verecord/verecord' 20 import Verecord from './views/road_verecord/verecord'
  21 +//统计分析
  22 +import AgentExcelExport from './views/excel/exportExcel-agent'
  23 +import NMMSExcelExport from './views/excel/exportExcel-NMMS'
  24 +import ExitAnalysis from './views/dataAnalysis/ExitAnalysis'
  25 +import ArrivalAnalysis from './views/dataAnalysis/ArrivalAnalysis'
20 26
21 27
22 28
@@ -28,6 +34,12 @@ let routes = [ @@ -28,6 +34,12 @@ let routes = [
28 hidden: true 34 hidden: true
29 }, 35 },
30 { 36 {
  37 + path: '/ssologin',
  38 + component: ssoLogin,
  39 + name: '登录',
  40 + hidden: true
  41 + },
  42 + {
31 path: '/404', 43 path: '/404',
32 component: NotFound, 44 component: NotFound,
33 name: '错误', 45 name: '错误',
@@ -90,20 +102,40 @@ let routes = [ @@ -90,20 +102,40 @@ let routes = [
90 }, 102 },
91 103
92 104
93 - {  
94 - path: '/',  
95 - component: Home,  
96 - name: 'Charts',  
97 - iconCls: 'fa fa-bar-chart',  
98 - children: [  
99 - {path: '/echarts', component: echarts, name: 'echarts'}  
100 - ]  
101 - }, 105 + // {
  106 + // path: '/',
  107 + // component: Home,
  108 + // name: 'Charts',
  109 + // iconCls: 'fa fa-bar-chart',
  110 + // children: [
  111 + // {path: '/echarts', component: echarts, name: 'echarts'}
  112 + // ]
  113 + // },
102 { 114 {
103 path: '*', 115 path: '*',
104 hidden: true, 116 hidden: true,
105 redirect: {path: '/404'} 117 redirect: {path: '/404'}
106 - } 118 + },
  119 + // {
  120 + // path: '/cgonms-provide',
  121 + // component: Home,
  122 + // name: '业务统计',
  123 + // iconCls: 'fa fa-id-card-o',
  124 + // children: [
  125 + // {path: '/exitAnalysis', component: ExitAnalysis, name: '出港业务统计'},
  126 + // {path: '/arrivalAnalysis', component: ArrivalAnalysis, name: '进港业务统计'},
  127 + // ]
  128 + // },
  129 + // {
  130 + // path: '/analysis',
  131 + // component: Home,
  132 + // name: '统计分析',
  133 + // iconCls: 'fa fa-id-card-o',
  134 + // children: [
  135 + // {path: '/agentexport', component: AgentExcelExport, name: '出港统计'},
  136 + // {path: '/nmmsexport', component: NMMSExcelExport, name: '进港统计'},
  137 + // ]
  138 + // },
107 ]; 139 ];
108 let initRouters = routes.concat(); 140 let initRouters = routes.concat();
109 let setUserMenus = function (list) { 141 let setUserMenus = function (list) {
  1 +const ArrivalWebsocket = {
  2 + wsuri: '',
  3 + serverPort: '9011',
  4 + sid: '',
  5 + /**
  6 + * 前后端消息定制的协议为JSON字符窜格式
  7 + * 下面是经过json转换收到的消息,重新赋值的
  8 + * 格式样例为:msgJson:{
  9 + * message:socketMessage,
  10 + * status: socketStatus,
  11 + * data: socketDataList
  12 + * .....
  13 + * }
  14 + */
  15 + socketMessage: '',
  16 + socketStatus: '',
  17 + socketDataList: '',
  18 + msgJson: '',
  19 + websocket: undefined,
  20 +
  21 + // eslint-disable-next-line no-console
  22 + onmessage: function (event) {console.log(event.data)},
  23 + // eslint-disable-next-line no-console
  24 + onclose: function (event) {console.log("websocket链接已关闭")},
  25 + // eslint-disable-next-line no-console
  26 + onopen: function (event) {console.log("websocket链接已链接")},
  27 + // eslint-disable-next-line no-console
  28 + onerror: function (event) {console.log("websocket链接失败,请检查URL")},
  29 + // eslint-disable-next-line no-console
  30 + send: function(message){console.log("已发送消息")},
  31 +
  32 + getWebIP: function () {
  33 + var curIP = window.location.hostname;
  34 + return curIP;
  35 + },
  36 + init: function () {
  37 + this.sid= sessionStorage.getItem('token');
  38 + this.wsuri = "ws://" + '192.168.1.17'+ ":" + this.serverPort + "/websocket/" + this.sid;
  39 + if(this.sid!== ''){
  40 + this.websocket = new WebSocket(this.wsuri);
  41 + this.websocket.onmessage = this.onmessage;
  42 + this.websocket.onclose = this.onclose;
  43 + this.websocket.onopen = this.onopen;
  44 + this.websocket.onerror = this.onerror;
  45 + this.websocket.send = this.send;
  46 +
  47 + }
  48 + }
  49 +}
  50 +
  51 +export default ArrivalWebsocket;
  1 +const VueWebsocket = {
  2 + wsuri: '',
  3 + serverPort: '9001',
  4 + sid: '',
  5 + /**
  6 + * 前后端消息定制的协议为JSON字符窜格式
  7 + * 下面是经过json转换收到的消息,重新赋值的
  8 + * 格式样例为:msgJson:{
  9 + * message:socketMessage,
  10 + * status: socketStatus,
  11 + * data: socketDataList
  12 + * .....
  13 + * }
  14 + */
  15 + socketMessage: '',
  16 + socketStatus: '',
  17 + socketDataList: '',
  18 + msgJson: '',
  19 + websocket: undefined,
  20 +
  21 + // eslint-disable-next-line no-console
  22 + onmessage: function (event) {console.log(event.data)},
  23 + // eslint-disable-next-line no-console
  24 + onclose: function (event) {console.log("websocket链接已关闭")},
  25 + // eslint-disable-next-line no-console
  26 + onopen: function (event) {console.log("websocket链接已链接")},
  27 + // eslint-disable-next-line no-console
  28 + onerror: function (event) {console.log("websocket链接失败,请检查URL")},
  29 + // eslint-disable-next-line no-console
  30 + send: function(message){console.log("已发送消息")},
  31 +
  32 + getWebIP: function () {
  33 + var curIP = window.location.hostname;
  34 + return curIP;
  35 + },
  36 + init: function () {
  37 + this.sid= sessionStorage.getItem('token');
  38 + this.wsuri = "ws://" + '192.168.1.17'+ ":" + this.serverPort + "/websocket/" + this.sid;
  39 + if(this.sid!== ''){
  40 + this.websocket = new WebSocket(this.wsuri);
  41 + this.websocket.onmessage = this.onmessage;
  42 + this.websocket.onclose = this.onclose;
  43 + this.websocket.onopen = this.onopen;
  44 + this.websocket.onerror = this.onerror;
  45 + this.websocket.send = this.send;
  46 +
  47 + }
  48 + }
  49 +}
  50 +
  51 +export default VueWebsocket;
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 <el-col :span="24" class="header"> 3 <el-col :span="24" class="header">
4 <el-col :span="10" class="logo" :class="collapsed?'logo-collapse-width':'logo-width'"> 4 <el-col :span="10" class="logo" :class="collapsed?'logo-collapse-width':'logo-width'">
5 机场口岸通关物流辅助管理系统 5 机场口岸通关物流辅助管理系统
  6 +<!-- 货运统计分析-->
6 </el-col> 7 </el-col>
7 <el-col :span="10"> 8 <el-col :span="10">
8 <div class="tools" @click.prevent="collapse"> 9 <div class="tools" @click.prevent="collapse">
@@ -27,6 +28,9 @@ @@ -27,6 +28,9 @@
27 <el-form-item label="用户名" prop="name"> 28 <el-form-item label="用户名" prop="name">
28 <span>{{sysUserName}}</span> 29 <span>{{sysUserName}}</span>
29 </el-form-item> 30 </el-form-item>
  31 + <el-form-item label="旧密码" prop="oldPassword">
  32 + <el-input type="password" v-model="resetForm.oldPassword" autocomplete="off" placeholder="8-20位字符在数字、小写、大写字母以及特殊字符中四选三"></el-input>
  33 + </el-form-item>
30 <el-form-item label="新密码" prop="newpwd"> 34 <el-form-item label="新密码" prop="newpwd">
31 <el-input type="password" v-model="resetForm.newpwd" autocomplete="off" placeholder="8-20位字符在数字、小写、大写字母以及特殊字符中四选三"></el-input> 35 <el-input type="password" v-model="resetForm.newpwd" autocomplete="off" placeholder="8-20位字符在数字、小写、大写字母以及特殊字符中四选三"></el-input>
32 </el-form-item> 36 </el-form-item>
@@ -166,6 +170,7 @@ @@ -166,6 +170,7 @@
166 resetForm: { 170 resetForm: {
167 newpwd: '', 171 newpwd: '',
168 renewpwd: '', 172 renewpwd: '',
  173 + oldPassword: ''
169 }, 174 },
170 resetFormRules: { 175 resetFormRules: {
171 newpwd: [ 176 newpwd: [
@@ -173,11 +178,16 @@ @@ -173,11 +178,16 @@
173 ], 178 ],
174 renewpwd: [ 179 renewpwd: [
175 { required: true, validator: validatePass2, trigger: 'blur' } 180 { required: true, validator: validatePass2, trigger: 'blur' }
  181 + ],
  182 + oldPassword: [
  183 + { required: true, message:'旧密码不能为空', trigger: 'blur' }
176 ] 184 ]
177 }, 185 },
178 editForm: { 186 editForm: {
179 id: '', 187 id: '',
180 password: '', 188 password: '',
  189 + oldPassword: '',
  190 + // userSyncId: JSON.parse(sessionStorage.getItem('user')).userSyncId
181 }, 191 },
182 } 192 }
183 }, 193 },
@@ -217,6 +227,7 @@ @@ -217,6 +227,7 @@
217 if (valid) { 227 if (valid) {
218 this.editForm.id=this.sysUserId; 228 this.editForm.id=this.sysUserId;
219 this.editForm.password=this.resetForm.renewpwd; 229 this.editForm.password=this.resetForm.renewpwd;
  230 + this.editForm.oldPassword=this.resetForm.oldPassword;
220 editPass(this.editForm).then(res=>{ 231 editPass(this.editForm).then(res=>{
221 let response=res.data; 232 let response=res.data;
222 if(response.code=='200'){ 233 if(response.code=='200'){
@@ -18,13 +18,9 @@ @@ -18,13 +18,9 @@
18 @click="getVerifyCode" 18 @click="getVerifyCode"
19 > 19 >
20 </el-form-item> 20 </el-form-item>
21 -<!-- <el-form-item prop="checkPass">-->  
22 -<!-- <el-input type="password" v-model="ruleForm2.checkPass" placeholder="密码" @keyup.enter.native="handleSubmit2"></el-input>-->  
23 -<!-- </el-form-item>-->  
24 <el-checkbox v-model="checked" checked class="remeberme">记住密码</el-checkbox> 21 <el-checkbox v-model="checked" checked class="remeberme">记住密码</el-checkbox>
25 <el-form-item style="width:100%;"> 22 <el-form-item style="width:100%;">
26 <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit2" :loading="logining" :plain="true">登录</el-button> 23 <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit2" :loading="logining" :plain="true">登录</el-button>
27 - <!--<el-button @click.native.prevent="handleReset2">重置</el-button>-->  
28 </el-form-item> 24 </el-form-item>
29 </el-form> 25 </el-form>
30 <div class="homepage-hero-module"> 26 <div class="homepage-hero-module">
@@ -142,6 +138,7 @@ @@ -142,6 +138,7 @@
142 let token = authentication.token; 138 let token = authentication.token;
143 let loginUserMenus = res.data.loginUserMenus; 139 let loginUserMenus = res.data.loginUserMenus;
144 if (status !== 200) { 140 if (status !== 200) {
  141 + this.getVerifyCode();
145 let msg = "登录错误"; 142 let msg = "登录错误";
146 this.$message({ 143 this.$message({
147 message: msg, 144 message: msg,
@@ -174,12 +171,13 @@ @@ -174,12 +171,13 @@
174 type: "error" 171 type: "error"
175 }); 172 });
176 this.logining = false; 173 this.logining = false;
  174 + this.getVerifyCode();
177 }); 175 });
178 } else { 176 } else {
179 return false; 177 return false;
180 } 178 }
181 }); 179 });
182 - } 180 + },
183 }, 181 },
184 mounted:function () { 182 mounted:function () {
185 window.onresize = () => { 183 window.onresize = () => {
@@ -209,6 +207,7 @@ @@ -209,6 +207,7 @@
209 } 207 }
210 }, 208 },
211 window.onresize(); 209 window.onresize();
  210 + // this.ticket();
212 // this.randCode(); 211 // this.randCode();
213 }, 212 },
214 created(){ 213 created(){
  1 +<template>
  2 +<!-- <div>-->
  3 +<!-- <el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-position="left" label-width="0px" class="demo-ruleForm login-container" id="loginForm">-->
  4 +<!-- <h3 class="title">系统登录</h3>-->
  5 +<!-- <el-form-item prop="account">-->
  6 +<!-- <el-input type="text" v-model="ruleForm2.account" autofocus placeholder="账号"></el-input>-->
  7 +<!-- </el-form-item>-->
  8 +<!-- <el-form-item prop="checkPass">-->
  9 +<!-- <el-input type="password" v-model="ruleForm2.checkPass" placeholder="密码"></el-input>-->
  10 +<!-- </el-form-item>-->
  11 +<!-- <el-form-item prop="verify">-->
  12 +<!-- <el-input type="text" v-model="ruleForm2.verify" placeholder="请输入下方图片显示的验证码" @keyup.enter.native="handleSubmit2"></el-input>-->
  13 +<!-- </el-form-item>-->
  14 +<!-- <el-form-item>-->
  15 +<!-- <img-->
  16 +<!-- style="width: 125px; height: 60px"-->
  17 +<!-- :src="verifyImg"-->
  18 +<!-- @click="getVerifyCode"-->
  19 +<!-- >-->
  20 +<!-- </el-form-item>-->
  21 +<!-- <el-checkbox v-model="checked" checked class="remeberme">记住密码</el-checkbox>-->
  22 +<!-- <el-form-item style="width:100%;">-->
  23 +<!-- <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit2" :loading="logining" :plain="true">登录</el-button>-->
  24 +<!-- &lt;!&ndash;<el-button @click.native.prevent="handleReset2">重置</el-button>&ndash;&gt;-->
  25 +<!-- </el-form-item>-->
  26 +<!-- </el-form>-->
  27 +<!-- <div class="homepage-hero-module">-->
  28 +<!-- <div class="video-container">-->
  29 +<!-- <div :style="fixStyle" class="filter"></div>-->
  30 +<!-- <video :style="fixStyle" autoplay loop class="fillWidth" v-on:canplay="canplay">-->
  31 +<!-- <source src="/static/login/New-jumbo.mp4" type="video/mp4"/>-->
  32 +<!-- 浏览器不支持 video 标签,建议升级浏览器。-->
  33 +<!-- &lt;!&ndash;<source src="/static/login/New-jumbo.webm" type="video/webm"/>&ndash;&gt;-->
  34 +<!-- &lt;!&ndash;浏览器不支持 video 标签,建议升级浏览器。&ndash;&gt;-->
  35 +<!-- </video>-->
  36 +<!-- <div class="poster hidden" v-if="!vedioCanPlay">-->
  37 +<!-- <img :style="fixStyle" src="https://s2.best-wallpaper.net/wallpaper/2560x1600/1511/Airplane-passenger-airliner-flight-sea-lights-airport-evening_2560x1600.jpg" alt="">-->
  38 +<!-- </div>-->
  39 +<!-- </div>-->
  40 +<!-- </div>-->
  41 +<!-- </div>-->
  42 +</template>
  43 +
  44 +<script>
  45 + import axios from 'axios'
  46 + import http from '../api/http';
  47 + import {getRandCode, testLogin} from '../api/user';
  48 + export default {
  49 + data() {
  50 + return {
  51 + verifyImg: "",
  52 + vedioCanPlay: true,
  53 + fixStyle: '',
  54 + logining: false,
  55 + ruleForm2: {
  56 + account: '',
  57 + checkPass: '',
  58 + verify: '',
  59 + verifyToken: ''
  60 + },
  61 + rules2: {
  62 + account: [
  63 + { required: true, message: '请输入账号', trigger: 'blur' },
  64 + //{ validator: validaePass }
  65 + ],
  66 + checkPass: [
  67 + { required: true, message: '请输入密码', trigger: 'blur' },
  68 + //{ validator: validaePass2 }
  69 + ],
  70 + checkVerify: [
  71 + { required: true, message: '请输入验证码', trigger: 'blur' }
  72 + ]
  73 + },
  74 + checked: true,
  75 + userMenus: []
  76 + };
  77 + },
  78 + methods: {
  79 + canplay() {
  80 + this.vedioCanPlay = true
  81 + },
  82 + handleReset2() {
  83 + this.$refs.ruleForm2.resetFields();
  84 + },
  85 + handleMenuList : function (router,menu) {
  86 + var _this = this;
  87 + var routerName = "";
  88 + var routerTemp = router.concat();
  89 +
  90 + routerTemp.forEach(function (v_router,v_index,v_arr) {
  91 + routerName = v_router.name;
  92 +
  93 + //查找返回的目录列表是否包含路由名称,有就返回匹配到的元素,没有就移除
  94 + let result = menu.find(item => {
  95 + return item.name === routerName;
  96 + });
  97 +
  98 + //匹配到继续判断是否子元素,有子元素继续递归
  99 + if (result) {
  100 + if (v_router.children && v_router.children.length>0) {
  101 + _this.handleMenuList(v_router.children, result.children);
  102 + }
  103 + }else {
  104 + //没有则可以移除
  105 + let deletRouter = router.findIndex(itm => itm.name === routerName );
  106 + router.splice(deletRouter,1);
  107 + }
  108 + });
  109 + console.log("longined router:");
  110 + console.log(routerName);
  111 + console.log(_this.$router.options.routes);
  112 +// 本地存储用户目录 ,防刷新目录丢失用
  113 + sessionStorage.setItem('menu', JSON.stringify(_this.$router.options.routes));
  114 + },
  115 +
  116 + getVerifyCode: function(){
  117 + getRandCode().then((res) =>{
  118 + let status = res.status;
  119 + this.ruleForm2.verifyToken = res.data.jwtToken;
  120 + this.verifyImg = res.data.data.verifyImg;
  121 + }).catch({
  122 +
  123 + });
  124 + },
  125 + // 获取地址栏参数
  126 + getUrlKey: function (name) {
  127 + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
  128 + },
  129 + // 获取票据
  130 + ticket: function () {
  131 + let ticket = this.getUrlKey("ticket");
  132 + if (ticket!=undefined){
  133 + let loginParams = {
  134 + ticket : ticket
  135 + }
  136 + testLogin(loginParams).then(res => {
  137 + //NProgress.done();
  138 + let status = res.status;
  139 + let authentication = res.data.authentication;
  140 + let token = authentication.token;
  141 + let loginUserMenus = res.data.loginUserMenus;
  142 + if (status !== 200) {
  143 + let msg = "该账户不存在本系统";
  144 + this.$message({
  145 + message: msg,
  146 + type: "error"
  147 + });
  148 + } else if (token) {
  149 + sessionStorage.setItem('user', JSON.stringify(authentication));
  150 + sessionStorage.setItem('token','Bearer '+ token);
  151 + //设置token,设置axios 基本配置,但是刷新后 这个登录保存的就没了
  152 + axios.defaults.headers.common['Authorization'] = 'Bearer '+token;
  153 + //处理用户menu
  154 + this.userMenus = loginUserMenus.list;
  155 + console.log("userMenus:");
  156 + console.log(this.userMenus);
  157 + console.log(loginUserMenus.list);
  158 + let sysMenus = this.$router.options.routes;
  159 +
  160 + console.log("sysMenus:");
  161 + console.log(sysMenus);
  162 +
  163 + this.handleMenuList(this.$router.options.routes,this.userMenus);
  164 +
  165 + console.log("user:");
  166 + console.log(this.$router.options.routes);
  167 + this.$router.push({path: '/main'});
  168 + }
  169 + }).catch(error => {
  170 + this.$message({
  171 + message: error.toString(),
  172 + type: "error"
  173 + });
  174 + this.logining = false;
  175 + });
  176 + }else {
  177 + console.log("票据为空 请求路由")
  178 + window.location.href = 'http://10.5.14.103:27080/sso/login?service=http://10.50.7.70:9909/%23/ssologin'
  179 + // window.location.href = 'http://10.5.14.103:27080/sso/login?service=http://10.50.3.73:8880/%23/SsoLogin'
  180 + }
  181 + }
  182 + },
  183 + mounted:function () {
  184 + window.onresize = () => {
  185 + const windowWidth = document.body.clientWidth
  186 + const windowHeight = document.body.clientHeight
  187 + const windowAspectRatio = windowHeight / windowWidth
  188 + let videoWidth
  189 + let videoHeight
  190 + if (windowAspectRatio < 0.5625) {
  191 + videoWidth = windowWidth
  192 + videoHeight = videoWidth * 0.5625
  193 + this.fixStyle = {
  194 + height: windowWidth * 0.5625 + 'px',
  195 + width: windowWidth + 'px',
  196 + 'margin-bottom': (windowHeight - videoHeight) / 2 + 'px',
  197 + 'margin-left': 'initial'
  198 + }
  199 + } else {
  200 + videoHeight = windowHeight
  201 + videoWidth = videoHeight / 0.5625
  202 + this.fixStyle = {
  203 + height: windowHeight + 'px',
  204 + width: windowHeight / 0.5625 + 'px',
  205 + 'margin-left': (windowWidth - videoWidth) / 2 + 'px',
  206 + 'margin-bottom': 'initial'
  207 + }
  208 + }
  209 + },
  210 + window.onresize();
  211 + this.ticket();
  212 + },
  213 + created(){
  214 + }
  215 + }
  216 +
  217 +</script>
  218 +
  219 +<!--<style lang="scss" scoped>-->
  220 +<!-- #loginForm{-->
  221 +<!-- filter:alpha(Opacity=90);-->
  222 +<!-- -moz-opacity:0.9;-->
  223 +<!-- opacity: 0.9;-->
  224 +<!-- }-->
  225 +<!-- .homepage-hero-module,-->
  226 +<!-- .video-container {-->
  227 +<!-- height: 100vh;-->
  228 +<!-- /*overflow: hidden;*/-->
  229 +<!-- position: absolute;-->
  230 +<!-- top:0px;-->
  231 +<!-- left: 0;-->
  232 +<!-- z-index: -1;-->
  233 +<!-- }-->
  234 +
  235 +<!-- .video-container .poster img,-->
  236 +<!-- .video-container video {-->
  237 +<!-- z-index: 0;-->
  238 +<!-- position: absolute;-->
  239 +<!-- }-->
  240 +
  241 +<!-- .video-container .filter {-->
  242 +<!-- z-index: 1;-->
  243 +<!-- position: absolute;-->
  244 +<!-- background: rgba(0, 0, 0, 0.4);-->
  245 +<!-- }-->
  246 +<!-- .login-container {-->
  247 +<!-- /*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/-->
  248 +<!-- -webkit-border-radius: 5px;-->
  249 +<!-- border-radius: 5px;-->
  250 +<!-- -moz-border-radius: 5px;-->
  251 +<!-- background-clip: padding-box;-->
  252 +<!-- margin: 180px auto;-->
  253 +<!-- width: 350px;-->
  254 +<!-- padding: 35px 35px 15px 35px;-->
  255 +<!-- background: #fff;-->
  256 +<!-- border: 1px solid #eaeaea;-->
  257 +<!-- box-shadow: 0 0 25px #cac6c6;-->
  258 +<!-- .title {-->
  259 +<!-- margin: 0px auto 40px auto;-->
  260 +<!-- text-align: center;-->
  261 +<!-- color: #505458;-->
  262 +<!-- }-->
  263 +<!-- .remember {-->
  264 +<!-- margin: 0px 0px 35px 0px;-->
  265 +<!-- }-->
  266 +<!-- }-->
  267 +<!--</style>-->
  1 +<template>
  2 + <el-container>
  3 + <el-main>
  4 + <el-card style="background-color: #F5F7FA">
  5 + <!-- 搜素区域 -->
  6 + <div>
  7 + <el-row :gutter="24">
  8 + <el-col :span="5">
  9 + <el-input v-model="queryInfo.flightNo" prefix-icon="el-icon-search"
  10 + placeholder="请输入航班号" clearable style="width:220px">
  11 + </el-input>
  12 + </el-col>
  13 + <el-col :span="5">
  14 + <el-date-picker v-model="queryInfo.flightDate" type="date" value-format="yyyy-MM-dd"
  15 + placeholder="请选择航班日期"
  16 + style="width: 220px">
  17 + </el-date-picker>
  18 + </el-col>
  19 + <el-col :span="10">
  20 + <el-button type="primary" @click="getExitInfoList" style="width: 160px;"
  21 + icon="el-icon-search">
  22 + 数据统计查询
  23 + </el-button>
  24 + <el-button :loading="downloadLoading" type="success" icon="el-icon-s-home"
  25 + style="width: 160px;"
  26 + :disabled="socketResponse.socketStatus!=='200'"
  27 + @click="downLoadExcel">导出 Excel
  28 + </el-button>
  29 + </el-col>
  30 + </el-row>
  31 + <!-- 显示区域 -->
  32 + <el-row :gutter="24" style="margin-top: 30px">
  33 + <el-col :span="11" style="margin-top: 10px">
  34 + <!-- <el-progress :text-inside="true" :stroke-width="15" :percentage="proportion"-->
  35 + <!-- :color="customColors"-->
  36 + <!-- style="width: 455px"></el-progress>-->
  37 + <el-input v-model="message" type="textarea"
  38 + :autosize="{ minRows: 6, maxRows: 10}"
  39 + style="width: 455px;height: 400px"
  40 + placeholder="获取数据进度" readonly>
  41 + </el-input>
  42 + </el-col>
  43 + <el-col :span="4" style="margin-left: 40px;margin-top: 20px">
  44 + <el-progress type="circle" :percentage="proportion"
  45 + :stroke-width="12"
  46 + :color="customColors"
  47 + :width="proportion>6?200:126">
  48 + </el-progress>
  49 + </el-col>
  50 + </el-row>
  51 + </div>
  52 + </el-card>
  53 + </el-main>
  54 + </el-container>
  55 +</template>
  56 +
  57 +<script>
  58 +
  59 + import {getArrivalDataAnalysis, createArrivalExcel, downArrivalExcel} from "../../api/arrival_data_analysis";
  60 + import ArrivalWebsocket from '@/utils/arrival_web_socket';
  61 +
  62 + export default {
  63 + name: "ExitAnalysis",
  64 + data() {
  65 + return {
  66 + /**
  67 + * 出港业务统计列表
  68 + */
  69 + exitInfoList: [],
  70 + resultStatus: '0',
  71 + message: '',
  72 +
  73 +
  74 + /**
  75 + * 返回结果
  76 + */
  77 + socketResponse: {
  78 + socketMessage: '',
  79 + socketStatus: '',
  80 + socketDataList: [],
  81 + socketCurrentNum: 1,
  82 + socketTotalNum: 1,
  83 + },
  84 + /**
  85 + * 查询列表
  86 + */
  87 + queryInfo: {
  88 + //航班号
  89 + flightNo: 'CV4481',
  90 + //航班日期
  91 + flightDate: '2019-06-11',
  92 + },
  93 +
  94 + /* 列表加载 */
  95 + listLoading: false,
  96 + downloadLoading: false,
  97 +
  98 + /**
  99 + * 百分比例
  100 + */
  101 + proportion: 0,
  102 +
  103 + /**
  104 + * 百分比例,颜色
  105 + */
  106 + customColors: [
  107 + {color: '#6f7ad3', percentage: 20},
  108 + {color: '#f56c6c', percentage: 40},
  109 + {color: '#e6a23c', percentage: 60},
  110 + {color: '#5cb87a', percentage: 80},
  111 + {color: '#1989fa', percentage: 100},
  112 + ],
  113 + /**
  114 + * 下载路径的参数
  115 + */
  116 + fileName: "test.xls",
  117 + ipAddress: "",
  118 + url: "",
  119 + }
  120 + },
  121 + methods: {
  122 + /**
  123 + * 获取出港信息列表
  124 + */
  125 + getExitInfoList() {
  126 + let _this = this;
  127 + if (_this.queryInfo.flightNo === '') {
  128 + if (_this.queryInfo.flightDate === '' || _this.queryInfo.flightDate === null) {
  129 + return _this.$message.warning('航班号与航班日期,不能同时为空');
  130 + }
  131 + }
  132 + _this.$message.success('开始获取统计数据');
  133 + getArrivalDataAnalysis(_this.queryInfo).catch(error => {
  134 + // _this.$message.info("即将结束!请您稍候");
  135 + });
  136 + },
  137 +
  138 + /**
  139 + * 下载excel
  140 + */
  141 + downLoadExcel() {
  142 + downArrivalExcel().then((response) => {
  143 + this.downloadLoading = true;
  144 + let res = response.data;
  145 + if (res.code !== '200') {
  146 + return this.$message.error('下载失败');
  147 + this.downloadLoading = false;
  148 + }
  149 + // console.log(res.msg)
  150 + //获取地址
  151 + this.ipAddress = res.msg;
  152 + this.url = this.ipAddress + this.fileName;
  153 + console.log(this.url)
  154 + // console.log(this.ipAddress)
  155 + this.down();
  156 + this.downloadLoading = false;
  157 + }).catch(error => {
  158 + this.downloadLoading = false;
  159 + console.log(error.toString())
  160 + this.$message.error(error.toString());
  161 + });
  162 +
  163 + },
  164 +
  165 + down() {
  166 + // 创建a标签
  167 + const link = document.createElement('a');
  168 + // download属性
  169 + link.setAttribute('download', 'excel.xls');
  170 + // href链接
  171 + link.setAttribute('href', this.url);
  172 +
  173 + document.body.appendChild(link);
  174 + // 自执行点击事件
  175 + link.click()
  176 + },
  177 +
  178 + /**
  179 + * 生成excel
  180 + */
  181 + generateExcel() {
  182 + createArrivalExcel(this.socketResponse.socketDataList).then((response) => {
  183 + let res = response.data;
  184 + if (res.code !== '200') {
  185 + return this.$message.error('生成excel失败');
  186 + }
  187 + this.fileName = res.msg;
  188 + console.log(this.fileName)
  189 + this.$message.success("Excel准备就绪")
  190 + }).catch(error => {
  191 + this.$message.error(error.toString());
  192 + });
  193 + },
  194 +
  195 + socket_onmessage: function (e) {
  196 + console.log("从websocket接收到新的消息-->>" + e.data);
  197 + //this.message = this.message + e.data + "\n";
  198 + let msgJson = JSON.parse(e.data);
  199 + this.message = this.message + this.dataFormat(new Date()) + " -> " + msgJson.message + "\n";
  200 + this.socketResponse = JSON.parse(e.data);
  201 + this.socketResponse.socketMessage = msgJson.message;
  202 + this.socketResponse.socketCurrentNum = msgJson.currentNum;
  203 + this.socketResponse.socketTotalNum = msgJson.totalNum;
  204 + console.log(this.socketMessage);
  205 + this.socketResponse.socketStatus = msgJson.status;
  206 + this.socketResponse.socketDataList = msgJson.data;
  207 + console.log(msgJson);
  208 + if (this.socketResponse.socketTotalNum !== null && this.socketResponse.socketTotalNum !== 0) {
  209 + this.proportion = this.toPercent(this.socketResponse.socketCurrentNum / this.socketResponse.socketTotalNum);
  210 + }
  211 + if (this.socketResponse.socketCurrentNum === this.socketResponse.socketTotalNum &&
  212 + this.socketResponse.socketTotalNum !== 0 && this.socketResponse.socketCurrentNum !== 0) {
  213 + this.generateExcel();
  214 + }
  215 + },
  216 +
  217 + socket_onopen: function (e) {
  218 + console.log("websocket->>链接已链接");
  219 + },
  220 +
  221 + /**
  222 + * 重写日期函数格式化日期
  223 + */
  224 + dataFormat(time) {
  225 + return `${time.getFullYear()}-${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' + (time.getMonth() + 1)}-${time.getDate() >= 10 ? time.getDate() : '0' + time.getDate()} ${time.getHours() >= 10 ? time.getHours() : '0' + time.getHours()}:${time.getMinutes() >= 10 ? time.getMinutes() : '0' + time.getMinutes()}:${time.getSeconds() >= 10 ? time.getSeconds() : '0' + time.getSeconds()}`;
  226 + },
  227 +
  228 + /**
  229 + * 将小数转换成百分比
  230 + * @param point
  231 + * @returns {string|number}
  232 + */
  233 + toPercent(point) {
  234 + if (point == 0) {
  235 + return 0;
  236 + }
  237 + let str = Number(point * 100).toFixed();
  238 + // str+="%";
  239 + return parseInt(str);
  240 + }
  241 + },
  242 + created() {
  243 + ArrivalWebsocket.onopen = this.socket_onopen;
  244 + ArrivalWebsocket.onmessage = this.socket_onmessage;
  245 + ArrivalWebsocket.init();
  246 + },
  247 + destroyed() {
  248 + },
  249 + watch: {},
  250 + }
  251 +</script>
  252 +
  253 +<style scoped>
  254 +
  255 +</style>
  1 +<template>
  2 + <el-container>
  3 + <el-main>
  4 + <el-card style="background-color: #F5F7FA">
  5 + <!-- 搜素区域 -->
  6 + <div>
  7 + <el-row :gutter="24">
  8 + <el-col :span="5">
  9 + <el-input v-model="queryInfo.flightNo" prefix-icon="el-icon-search"
  10 + placeholder="请输入航班号" clearable style="width:220px">
  11 + </el-input>
  12 + </el-col>
  13 + <el-col :span="5">
  14 + <el-date-picker v-model="queryInfo.flightDate" type="date" value-format="yyyy-MM-dd"
  15 + placeholder="请选择航班日期"
  16 + style="width: 220px">
  17 + </el-date-picker>
  18 + </el-col>
  19 + <el-col :span="10">
  20 + <el-button type="primary" @click="getExitInfoList" style="width: 160px;"
  21 + icon="el-icon-search">
  22 + 数据统计查询
  23 + </el-button>
  24 + <el-button :loading="downloadLoading" type="success" icon="el-icon-s-home"
  25 + style="width: 160px;"
  26 + :disabled="socketResponse.socketStatus!=='200'"
  27 + @click="downLoadExcel">导出 Excel
  28 + </el-button>
  29 + </el-col>
  30 + </el-row>
  31 + <!-- 显示区域 -->
  32 + <el-row :gutter="24" style="margin-top: 30px">
  33 + <el-col :span="11" style="margin-top: 10px">
  34 + <!-- <el-progress :text-inside="true" :stroke-width="15" :percentage="proportion"-->
  35 + <!-- :color="customColors"-->
  36 + <!-- style="width: 455px"></el-progress>-->
  37 + <el-input v-model="message" type="textarea"
  38 + :autosize="{ minRows: 6, maxRows: 10}"
  39 + style="width: 455px;height: 400px"
  40 + placeholder="获取数据进度" readonly>
  41 + </el-input>
  42 + </el-col>
  43 + <el-col :span="4" style="margin-left: 40px;margin-top: 20px">
  44 + <el-progress type="circle" :percentage="proportion"
  45 + :stroke-width="12"
  46 + :color="customColors"
  47 + :width="proportion>6?200:126"></el-progress>
  48 + </el-col>
  49 + </el-row>
  50 + </div>
  51 + </el-card>
  52 + </el-main>
  53 + </el-container>
  54 +</template>
  55 +
  56 +<script>
  57 +
  58 + import {downExcel, createExcel, getExitDataAnalysis} from "../../api/exit_data_analysis";
  59 + import VueWebsocket from '@/utils/websocket';
  60 +
  61 + export default {
  62 + name: "ExitAnalysis",
  63 + data() {
  64 + return {
  65 + /**
  66 + * 出港业务统计列表
  67 + */
  68 + exitInfoList: [],
  69 + resultStatus: '0',
  70 + message: '',
  71 +
  72 +
  73 + /**
  74 + * 返回结果
  75 + */
  76 + socketResponse: {
  77 + socketMessage: '',
  78 + socketStatus: '',
  79 + socketDataList: [],
  80 + socketCurrentNum: 1,
  81 + socketTotalNum: 1,
  82 + },
  83 + /**
  84 + * 查询列表
  85 + */
  86 + queryInfo: {
  87 + //航班号
  88 + flightNo: '',
  89 + //航班日期
  90 + flightDate: '',
  91 + },
  92 +
  93 + /* 列表加载 */
  94 + listLoading: false,
  95 + downloadLoading: false,
  96 +
  97 + /**
  98 + * 百分比例
  99 + */
  100 + proportion: 0,
  101 +
  102 + /**
  103 + * 百分比例,颜色
  104 + */
  105 + customColors: [
  106 + {color: '#6f7ad3', percentage: 20},
  107 + {color: '#f56c6c', percentage: 40},
  108 + {color: '#e6a23c', percentage: 60},
  109 + {color: '#5cb87a', percentage: 80},
  110 + {color: '#1989fa', percentage: 100},
  111 + ],
  112 + /**
  113 + * 下载路径的参数
  114 + */
  115 + fileName: "test.xls",
  116 + ipAddress: "",
  117 + url: "",
  118 + }
  119 + },
  120 + methods: {
  121 + /**
  122 + * 获取出港信息列表
  123 + */
  124 + getExitInfoList() {
  125 + let _this = this;
  126 + if (_this.queryInfo.flightNo === '') {
  127 + if (_this.queryInfo.flightDate === '' || _this.queryInfo.flightDate === null) {
  128 + return _this.$message.warning('航班号与航班日期,不能同时为空');
  129 + }
  130 + }
  131 + _this.$message.success('开始获取统计数据');
  132 + getExitDataAnalysis(_this.queryInfo).catch(error => {
  133 + // _this.$message.info("即将结束!请您稍候");
  134 + });
  135 + },
  136 +
  137 + /**
  138 + * 下载excel
  139 + */
  140 + downLoadExcel() {
  141 + downExcel().then((response) => {
  142 + this.downloadLoading = true;
  143 + let res = response.data;
  144 + if (res.code !== '200') {
  145 + return this.$message.error('下载失败');
  146 + this.downloadLoading = false;
  147 + }
  148 + // console.log(res.msg)
  149 + //获取地址
  150 + this.ipAddress = res.msg;
  151 + this.url = this.ipAddress + this.fileName;
  152 + console.log(this.url)
  153 + // console.log(this.ipAddress)
  154 + this.down();
  155 + this.downloadLoading = false;
  156 + }).catch(error => {
  157 + this.downloadLoading = false;
  158 + console.log(error.toString())
  159 + this.$message.error(error.toString());
  160 + });
  161 +
  162 + },
  163 +
  164 + down() {
  165 + // 创建a标签
  166 + const link = document.createElement('a');
  167 + // download属性
  168 + link.setAttribute('download', 'excel.xls');
  169 + // href链接
  170 + link.setAttribute('href', this.url);
  171 +
  172 + document.body.appendChild(link);
  173 + // 自执行点击事件
  174 + link.click()
  175 + },
  176 +
  177 + /**
  178 + * 生成excel
  179 + */
  180 + generateExcel() {
  181 + createExcel(this.socketResponse.socketDataList).then((response) => {
  182 + let res = response.data;
  183 + if (res.code !== '200') {
  184 + return this.$message.error('生成excel失败');
  185 + }
  186 + this.fileName = res.msg;
  187 + console.log(this.fileName)
  188 + this.$message.success("Excel准备就绪")
  189 + }).catch(error => {
  190 + this.$message.error(error.toString());
  191 + });
  192 + },
  193 +
  194 + socket_onmessage: function (e) {
  195 + console.log("从websocket接收到新的消息-->>" + e.data);
  196 + //this.message = this.message + e.data + "\n";
  197 + let msgJson = JSON.parse(e.data);
  198 + this.message = this.message + this.dataFormat(new Date()) + " -> " + msgJson.message + "\n";
  199 + this.socketResponse = JSON.parse(e.data);
  200 + this.socketResponse.socketMessage = msgJson.message;
  201 + this.socketResponse.socketCurrentNum = msgJson.currentNum;
  202 + this.socketResponse.socketTotalNum = msgJson.totalNum;
  203 + console.log(this.socketMessage);
  204 + this.socketResponse.socketStatus = msgJson.status;
  205 + this.socketResponse.socketDataList = msgJson.data;
  206 + console.log(msgJson);
  207 + if (this.socketResponse.socketTotalNum !== null && this.socketResponse.socketTotalNum !== 0) {
  208 + this.proportion = this.toPercent(this.socketResponse.socketCurrentNum / this.socketResponse.socketTotalNum);
  209 + }
  210 + if (this.socketResponse.socketCurrentNum === this.socketResponse.socketTotalNum &&
  211 + this.socketResponse.socketTotalNum !== 0 && this.socketResponse.socketCurrentNum !== 0) {
  212 + this.generateExcel();
  213 + }
  214 + },
  215 +
  216 + socket_onopen: function (e) {
  217 + console.log("websocket->>链接已链接");
  218 + },
  219 +
  220 + /**
  221 + * 重写日期函数格式化日期
  222 + */
  223 + dataFormat(time) {
  224 + return `${time.getFullYear()}-${time.getMonth() + 1 >= 10 ? (time.getMonth() + 1) : '0' + (time.getMonth() + 1)}-${time.getDate() >= 10 ? time.getDate() : '0' + time.getDate()} ${time.getHours() >= 10 ? time.getHours() : '0' + time.getHours()}:${time.getMinutes() >= 10 ? time.getMinutes() : '0' + time.getMinutes()}:${time.getSeconds() >= 10 ? time.getSeconds() : '0' + time.getSeconds()}`;
  225 + },
  226 +
  227 + /**
  228 + * 将小数转换成百分比
  229 + * @param point
  230 + * @returns {string|number}
  231 + */
  232 + toPercent(point) {
  233 + if (point == 0) {
  234 + return 0;
  235 + }
  236 + let str = Number(point * 100).toFixed();
  237 + // str+="%";
  238 + return parseInt(str);
  239 + }
  240 + },
  241 + created() {
  242 + VueWebsocket.onopen = this.socket_onopen;
  243 + VueWebsocket.onmessage = this.socket_onmessage;
  244 + VueWebsocket.init();
  245 + },
  246 + destroyed() {
  247 + },
  248 + watch: {},
  249 + }
  250 +</script>
  251 +
  252 +<style scoped>
  253 +
  254 +</style>
  1 +<template>
  2 + <div style="display:inline-block;">
  3 + <label class="radio-label">导出是否自动适配列宽: </label>
  4 + <el-radio-group v-model="autoWidth">
  5 + <el-radio :label="true" border>True</el-radio>
  6 + <el-radio :label="false" border>False</el-radio>
  7 + </el-radio-group>
  8 + </div>
  9 +</template>
  10 +
  11 +<script>
  12 +export default {
  13 + props: {
  14 + value: {
  15 + type: Boolean,
  16 + default: true
  17 + }
  18 + },
  19 + computed: {
  20 + autoWidth: {
  21 + get() {
  22 + return this.value
  23 + },
  24 + set(val) {
  25 + this.$emit('input', val)
  26 + }
  27 + }
  28 + }
  29 +}
  30 +</script>
  1 +<template>
  2 + <div style="display:inline-block;">
  3 + <label class="radio-label">导出类型: </label>
  4 + <el-select v-model="bookType" style="width:120px;" >
  5 + <el-option
  6 + v-for="item in options"
  7 + :key="item"
  8 + :label="item"
  9 + :value="item"/>
  10 + </el-select>
  11 + </div>
  12 +</template>
  13 +
  14 +<script>
  15 +export default {
  16 + props: {
  17 + value: {
  18 + type: String,
  19 + default: 'xlsx'
  20 + }
  21 + },
  22 + data() {
  23 + return {
  24 + options: ['xlsx', 'csv', 'txt']
  25 + }
  26 + },
  27 + computed: {
  28 + bookType: {
  29 + get() {
  30 + return this.value
  31 + },
  32 + set(val) {
  33 + this.$emit('input', val)
  34 + }
  35 + }
  36 + }
  37 +}
  38 +</script>
  1 +<template>
  2 + <div style="display:inline-block;">
  3 + <!-- $t is vue-i18n global function to translate lang -->
  4 + <label class="radio-label" style="padding-left:0;">导出文件名: </label>
  5 + <el-input placeholder="非必填,默认导出文件名为excel-list.xlsx" v-model="filename" style="width:340px;" prefix-icon="el-icon-document"/>
  6 + </div>
  7 +</template>
  8 +
  9 +<script>
  10 +export default {
  11 + props: {
  12 + value: {
  13 + type: String,
  14 + default: ''
  15 + }
  16 + },
  17 + computed: {
  18 + filename: {
  19 + get() {
  20 + return this.value
  21 + },
  22 + set(val) {
  23 + this.$emit('input', val)
  24 + }
  25 + }
  26 + }
  27 +}
  28 +</script>
  1 +<template>
  2 + <!-- $t is vue-i18n global function to translate lang -->
  3 + <div class="app-container">
  4 + <!--工具条-->
  5 + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  6 + <el-form :inline="true" :model="searchText">
  7 + <el-form-item>
  8 + <el-date-picker v-model="searchText.startdate" value-format="yyyy-MM-dd" type="date"
  9 + placeholder="开始航班日期"
  10 + ></el-date-picker>
  11 + </el-form-item>
  12 + <el-form-item>
  13 + <el-date-picker v-model="searchText.enddate" value-format="yyyy-MM-dd" type="date"
  14 + placeholder="结束航班日期"
  15 + ></el-date-picker>
  16 + </el-form-item>
  17 + <el-form-item>
  18 + <el-input v-model="searchText.flightno" placeholder="航班号" ></el-input>
  19 + </el-form-item>
  20 + <el-form-item>
  21 + <el-button :loading="listLoading" style="margin:0 0 20px 20px;" type="primary" icon="document" @click="fetchData">查询</el-button>
  22 + </el-form-item>
  23 + <el-tag
  24 + :key="note.message"
  25 + :type="note.type">
  26 + {{note.message}}
  27 + </el-tag>
  28 + </el-form>
  29 + </el-col>
  30 + <div>
  31 + <FilenameOption v-model="filename" />
  32 + <AutoWidthOption v-model="autoWidth" />
  33 + <BookTypeOption v-model="bookType" />
  34 + <el-button :loading="downloadLoading" style="margin:0 0 20px 20px;" type="primary" icon="document" @click="handleDownload">导出 Excel</el-button>
  35 + </div>
  36 +
  37 + <el-table v-loading="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row>
  38 + <el-table-column align="center" label="Id" width="95">
  39 + <template slot-scope="scope">
  40 + {{ scope.$index }}
  41 + </template>
  42 + </el-table-column>
  43 + <el-table-column label="运单号">
  44 + <template slot-scope="scope">
  45 + {{ scope.row.waybillnomaster }}
  46 + </template>
  47 + </el-table-column>
  48 + <el-table-column label="航班号" width="115" align="center">
  49 + <template slot-scope="scope">
  50 + {{ scope.row.flightno }}
  51 + </template>
  52 + </el-table-column>
  53 + <el-table-column align="center" label="航班日期" width="220" :formatter="dateFormat">
  54 + <template slot-scope="scope">
  55 + <i class="el-icon-time"/>
  56 + <span>{{ scope.row.flightDate | parseTime('{y}-{m}-{d}')}}</span>
  57 + </template>
  58 + </el-table-column>
  59 + <el-table-column label="航段" width="110" align="center">
  60 + <template slot-scope="scope">
  61 + <el-tag>{{ scope.row.segment }}</el-tag>
  62 + </template>
  63 + </el-table-column>
  64 + </el-table>
  65 + </div>
  66 +</template>
  67 +
  68 +<script>
  69 +import { getNmmsAnalysisList } from '@/api/agent-excel'
  70 +import { parseTime } from '@/utils'
  71 +
  72 +// options components
  73 +import FilenameOption from './components/FilenameOption'
  74 +import AutoWidthOption from './components/AutoWidthOption'
  75 +import BookTypeOption from './components/BookTypeOption'
  76 +import Export2Excel from '@/vendor/Export2Excel'
  77 +export default {
  78 + name: 'ExportExcelNMMS',
  79 + components: { FilenameOption, AutoWidthOption, BookTypeOption },
  80 + data() {
  81 + return {
  82 + list: [],
  83 + fetchList: [],
  84 + listLoading: false,
  85 + downloadLoading: false,
  86 + filename: '',
  87 + autoWidth: true,
  88 + bookType: 'xlsx',
  89 + searchText: {
  90 + startdate: undefined,
  91 + enddate: undefined,
  92 + flightno: undefined
  93 + },
  94 + note: {
  95 + type: 'info',
  96 + message: ''
  97 + }
  98 +
  99 + }
  100 + },
  101 + created() {
  102 + // this.fetchData()
  103 + },
  104 + filters: {
  105 + parseTime: parseTime
  106 + },
  107 + methods: {
  108 + dateFormat:function(row,column){
  109 + var t=new Date(row.updateTime);//row 表示一行数据, updateTime 表示要格式化的字段名称
  110 + return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate();
  111 + },
  112 + fetchData() {
  113 + this.listLoading = true
  114 + getNmmsAnalysisList(this.searchText).then(response => {
  115 + this.list = response.data.data
  116 + this.listLoading = false
  117 + this.$message({
  118 + message: '数据查询成功,可以下载excel',
  119 + type: 'success'
  120 + });
  121 + this.note.message = '数据查询成功,可以下载excel;共'+this.list.length+'条数据';
  122 + this.note.type = 'success';
  123 + })
  124 + },
  125 + handleDownload() {
  126 + this.downloadLoading = true
  127 + import('@/vendor/Export2Excel').then(excel => {
  128 + const tHeader = [
  129 + '航班号',
  130 + '航班日期',
  131 + '航段',
  132 + '主运单号',
  133 + '分单号',
  134 + '运单件数',
  135 + '运单重量',
  136 + '舱单件数',
  137 + '舱单重量',
  138 + '品名',
  139 + '航班起始站',
  140 + '航班起始站中文',
  141 + '航班目的站',
  142 + '航班目的站中文',
  143 + '运单起始站',
  144 + '运单起始站中文',
  145 + '运单目的站',
  146 + '运单目的站中文',
  147 + '发货人国家',
  148 + '发货人国家中文',
  149 + '发货人区域'
  150 + ]
  151 + const filterVal = [
  152 + 'flightno',
  153 + 'flightDate',
  154 + 'segment',
  155 + 'waybillnomaster',
  156 + 'waybillnosecondary',
  157 + 'totalpiece',
  158 + 'totalweight',
  159 + 'manifesttotalpiece',
  160 + 'manifesttotalweight',
  161 + 'productname',
  162 + 'originatingstation',
  163 + 'originatingstationcn',
  164 + 'destinationstation',
  165 + 'destinationstationcn',
  166 + 'originatingstationBill',
  167 + 'originatingstationbillcn',
  168 + 'destinationstationBill',
  169 + 'destinationstationbillcn',
  170 + 'shipperCountrycode',
  171 + 'countrydescchn',
  172 + 'areadescchn'
  173 + ]
  174 + const list = this.list
  175 + const data = this.formatJson(filterVal, list)
  176 + excel.export_json_to_excel({
  177 + header: tHeader,
  178 + data,
  179 + filename: this.filename,
  180 + autoWidth: this.autoWidth,
  181 + bookType: this.bookType
  182 + })
  183 + this.downloadLoading = false
  184 + })
  185 + },
  186 + formatJson(filterVal, jsonData) {
  187 + return jsonData.map(v => filterVal.map(j => {
  188 + if (j === 'timeamp') {
  189 + return parseTime(v[j])
  190 + } else {
  191 + return v[j]
  192 + }
  193 + }))
  194 + }
  195 + }
  196 +}
  197 +</script>
  198 +
  199 +<style>
  200 +.radio-label {
  201 + font-size: 14px;
  202 + color: #606266;
  203 + line-height: 40px;
  204 + padding: 0 12px 0 30px;
  205 +}
  206 +</style>
  207 +
  1 +<template>
  2 + <!-- $t is vue-i18n global function to translate lang -->
  3 + <div class="app-container">
  4 + <!--工具条-->
  5 + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  6 + <el-form :inline="true" :model="searchText">
  7 + <el-form-item>
  8 + <el-date-picker v-model="searchText.startdate" value-format="yyyy-MM-dd" type="date"
  9 + placeholder="开始航班日期"
  10 + ></el-date-picker>
  11 + </el-form-item>
  12 + <el-form-item>
  13 + <el-date-picker v-model="searchText.enddate" value-format="yyyy-MM-dd" type="date"
  14 + placeholder="结束航班日期"
  15 + ></el-date-picker>
  16 + </el-form-item>
  17 + <FilenameOption v-model="filename" />
  18 + <el-button :loading="downloadLoading" style="margin:0 0 20px 20px;" type="primary" icon="document" @click="exportExcel">导出 Excel</el-button>
  19 + </el-form>
  20 + </el-col>
  21 + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  22 + <span>导出进度:{{downloadSize}}</span>
  23 + </el-col>
  24 + </div>
  25 +</template>
  26 +
  27 +<script>
  28 +// import { getAnalysisList } from '@/api/agent-excel'
  29 +import { parseTime } from '@/utils'
  30 +
  31 +// options components
  32 +import FilenameOption from './components/FilenameOption'
  33 +export default {
  34 + name: 'ExportExcel',
  35 + components: { FilenameOption },
  36 + data() {
  37 + return {
  38 + list: [],
  39 + fetchList: [],
  40 + listLoading: false,
  41 + downloadLoading: false,
  42 + filename: '',
  43 + autoWidth: true,
  44 + bookType: 'xlsx',
  45 + searchText: {
  46 + startdate: undefined,
  47 + enddate: undefined
  48 + },
  49 + note: {
  50 + type: 'info',
  51 + message: ''
  52 + },
  53 + downloadSize: 0
  54 +
  55 + }
  56 + },
  57 + created() {
  58 + // this.fetchData()
  59 + },
  60 + filters: {
  61 + parseTime: parseTime
  62 + },
  63 + methods: {
  64 + dateFormat:function(row,column){
  65 + var t=new Date(row.updateTime);//row 表示一行数据, updateTime 表示要格式化的字段名称
  66 + return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate();
  67 + },
  68 + exportExcel(){
  69 + let _this = this
  70 + this.$loading({
  71 + fullscreen: true,
  72 + text: '正在导出',
  73 + spinner: 'el-icon-loading',
  74 + background: 'rgba(0, 0, 0, 0.6)'
  75 + })
  76 + this.$axios({
  77 + method:"get",
  78 + url: "/analysis-agent/agent/analysis",
  79 + responseType: 'blob',
  80 + headers: {
  81 + 'Content-Type': 'application/x-www-form-urlencoded'
  82 + },
  83 + params:this.searchText,
  84 + onDownloadProgress: function (progressEvent) {
  85 + _this.downloadSize = progressEvent.loaded
  86 + console.log(progressEvent.loaded)
  87 + }
  88 + }).then(
  89 + res=>{
  90 + let data = res.data;
  91 + let url = window.URL.createObjectURL(new Blob([data]));
  92 + let link = document.createElement('a');
  93 + link.style.display = 'none';
  94 + link.href = url;
  95 + this.filename = this.filename == '' ? 'export' : this.filename
  96 + link.setAttribute('download', this.filename+'.xls');
  97 + document.body.appendChild(link);
  98 + link.click()
  99 + this.$loading().close()
  100 + },err =>{
  101 + this.$loading().close()
  102 + });
  103 +
  104 + }
  105 + }
  106 +}
  107 +</script>
  108 +
  109 +<style>
  110 +.radio-label {
  111 + font-size: 14px;
  112 + color: #606266;
  113 + line-height: 40px;
  114 + padding: 0 12px 0 30px;
  115 +}
  116 +</style>
  117 +
@@ -38,6 +38,18 @@ @@ -38,6 +38,18 @@
38 </el-select> 38 </el-select>
39 </el-form-item> 39 </el-form-item>
40 </el-col> 40 </el-col>
  41 + <el-col :span="5">
  42 + <el-form-item label="失效状态" style="margin-left: 10px">
  43 + <el-select v-model="filters.isValid">
  44 + <el-option
  45 + v-for="item in isValidOptions"
  46 + :key="item.value"
  47 + :label="item.label"
  48 + :value="item.value">
  49 + </el-option>
  50 + </el-select>
  51 + </el-form-item>
  52 + </el-col>
41 <el-col :span="2"> 53 <el-col :span="2">
42 <el-form-item> 54 <el-form-item>
43 <el-button type="warning" style="width:150px" size="medium" icon="el-icon-plus" @click="getList(1)">查询</el-button> 55 <el-button type="warning" style="width:150px" size="medium" icon="el-icon-plus" @click="getList(1)">查询</el-button>
@@ -384,6 +396,18 @@ @@ -384,6 +396,18 @@
384 filtersForm: { 396 filtersForm: {
385 waybill: '' 397 waybill: ''
386 }, 398 },
  399 + isValidOptions:[
  400 + {
  401 + value: '0',
  402 + label: '未失效'
  403 + }, {
  404 + value: '1',
  405 + label: '失效'
  406 + }, {
  407 + value: '',
  408 + label: '全部'
  409 + }
  410 + ],
387 disabled: true, 411 disabled: true,
388 commonLoading: false, 412 commonLoading: false,
389 editFormVisible: false, 413 editFormVisible: false,
@@ -393,6 +417,7 @@ @@ -393,6 +417,7 @@
393 agentname: '', 417 agentname: '',
394 endstation: '', 418 endstation: '',
395 aisle: '', 419 aisle: '',
  420 + isValid:'0'
396 }, 421 },
397 businesstypeListLoading: false, 422 businesstypeListLoading: false,
398 editForm: { 423 editForm: {
@@ -468,6 +493,10 @@ @@ -468,6 +493,10 @@
468 return "2号卡口-进" 493 return "2号卡口-进"
469 }else if (row.aisle=="4604333322"){ 494 }else if (row.aisle=="4604333322"){
470 return "2号卡口-出" 495 return "2号卡口-出"
  496 + }else if (row.aisle=="4600011001"){
  497 + return "卡口-进"
  498 + }else if (row.aisle=="4600010001"){
  499 + return "卡口-出"
471 } 500 }
472 501
473 }, 502 },
@@ -482,6 +511,8 @@ @@ -482,6 +511,8 @@
482 return "冷链货站" 511 return "冷链货站"
483 }else if (row.endstation == "4604499001"){ 512 }else if (row.endstation == "4604499001"){
484 return "三号货站" 513 return "三号货站"
  514 + }else if (row.endstation == "4600541001"){
  515 + return "顺丰货站"
485 } 516 }
486 }, 517 },
487 turnoverflagFormatter: function(row, column){ 518 turnoverflagFormatter: function(row, column){
@@ -858,7 +889,6 @@ @@ -858,7 +889,6 @@
858 }, 889 },
859 mounted() { 890 mounted() {
860 this.getYardList(); 891 this.getYardList();
861 - this.getList();  
862 }, 892 },
863 watch: { 893 watch: {
864 'editForm.masterList':{ 894 'editForm.masterList':{
@@ -484,7 +484,7 @@ @@ -484,7 +484,7 @@
484 }, 484 },
485 mounted() { 485 mounted() {
486 this.getYardList(); 486 this.getYardList();
487 - this.addForm.cocode = '普通货' 487 + this.addForm.cocode = '普通货'
488 }, 488 },
489 computed: { 489 computed: {
490 }, 490 },