程志平 3 years ago
parent
commit
281f489f44

File diff suppressed because it is too large
+ 20542 - 24
package-lock.json


+ 1 - 0
package.json

@@ -18,6 +18,7 @@
     "axios": "^0.21.1",
     "echarts": "^5.1.2",
     "element-ui": "^2.15.5",
+    "js-file-download": "^0.4.12",
     "vue": "^2.5.2",
     "vue-router": "^3.0.1"
   },

+ 3 - 3
src/components/dev_mgr/DevMgr.vue

@@ -8,8 +8,8 @@
 						:show-file-list="false">
 						<el-button type="primary" size="small">表格导入</el-button>
 					</el-upload>
-					<el-link type="primary"
-						href="https://jtishfw.ncjti.edu.cn/jxch-smartmp/shuidian/HotWaters/download/模板.xls">
+					<el-link type="primary" target="_blank"
+						href="https://chtech.ncjti.edu.cn/shuidian/HotWaters/download/模板.xls">
 						模板下载</el-link>
 				</span>
 			</el-col>
@@ -411,7 +411,7 @@
 						console.log(res.data.downurl);
 						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON.stringify(res
 								.data) != '{}') {
-							window.open('https://jtishfw.ncjti.edu.cn/jxch-smartmp' + res.data.downurl)
+							window.open('https://chtech.ncjti.edu.cn/shuidian' + res.data.downurl)
 						} else {
 							_this.$message.error('【未获得】表格!');
 						}

+ 2 - 2
src/components/index/Index.vue

@@ -69,12 +69,12 @@
 								<span slot="title">账号管理</span>
 							</el-menu-item>
 						</router-link>
-						<router-link to="ad">
+						<!-- <router-link to="ad">
 							<el-menu-item index="/index/ad">
 								<i class="el-icon-ad"></i>
 								<span slot="title">广告管理</span>
 							</el-menu-item>
-						</router-link>
+						</router-link> -->
 					</el-menu>
 				</el-col>
 			</el-row>

+ 7 - 4
src/components/login/Login.vue

@@ -99,7 +99,7 @@
 				}
 
 				_this.$refs[formName].validate((valid) => {
-					_this.$axios.get('/shuidian/HotWaters/waterlogin.action', {
+					_this.$axios.get('/shuidian/HotWaters/userlog.action', {
 							params: params
 						})
 						.then(res => {
@@ -112,11 +112,14 @@
 									return
 								}
 								_this.$message.success(res.data.msg);
-								sessionStorage.setItem('uname', username)
+								sessionStorage.setItem('uname', username);
+								// 请求头部携带token
+								_this.$axios.defaults.headers['token'] = res.data.access_token;
+								// console.log(_this.$axios.defaults);
 								if (typeof(res.data.name) == 'undefined') {
-									sessionStorage.setItem('unic', '未设置昵称')
+									sessionStorage.setItem('unic', '未设置昵称');
 								} else {
-									sessionStorage.setItem('unic', res.data.name)
+									sessionStorage.setItem('unic', res.data.name);
 								}
 								_this.$router.replace('/index'); //跳转到首页
 							} else {

+ 27 - 24
src/components/shangjiaduizhang/shangjiaduizhang.vue

@@ -55,8 +55,9 @@
 				</el-table>
 				<div style="margin-top: 20px" class="table-footer">
 					<div class="pages">
-						<el-pagination :hide-on-single-page="true" layout="prev, pager, next" :current-page.sync="table.currentPage"
-							:page-size="table.pageRows" :total="rows_total" @current-change="handleCurrentChange">
+						<el-pagination :hide-on-single-page="true" layout="prev, pager, next"
+							:current-page.sync="table.currentPage" :page-size="table.pageRows" :total="rows_total"
+							@current-change="handleCurrentChange">
 						</el-pagination>
 					</div>
 					<div class="export-table">
@@ -211,7 +212,7 @@
 
 					// this.$message.error('起止日期不能为同一天!');
 				}
-				
+
 				// 选择日期后,马上搜索
 				this.handleCurrentChange(1)
 				// 获取选择的日期
@@ -223,34 +224,30 @@
 			 * 导出表格
 			 */
 			handleDownloadTable() {
-				var _this = this
-				var params = {
-					data: {}
-				}
+				var _this = this;
+				let formData = new FormData();
 				if (_this.drom_options.label) {
-					params.data.build = _this.drom_options.label
+					formData.append("build", _this.drom_options.label);
 				}
 				if (_this.room_options.room_label) {
-					params.data.dom = _this.room_options.room_label
+					formData.append("dom", _this.room_options.room_label);
 				}
 				if (_this.select_riqi.select_day) {
-					params.data.begin_time = _this.select_riqi.select_day
-				}
-				if (JSON.stringify(params.data) == '{}') {
-					params = ''
+					formData.append("begin_time", _this.select_riqi.select_day);
 				}
-				this.$axios.post('/shuidian/HotWaters/watertoComExcel.action', params)
+				this.$axios.post('/shuidian/HotWaters/watertoComExcel.action', formData)
 					.then(res => {
-						// console.log(res.data.downurl);
-						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON.stringify(res
+						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON
+							.stringify(res
 								.data) != '{}') {
-							window.open('https://jtishfw.ncjti.edu.cn/jxch-smartmp' + res.data.downurl)
+							// console.log(res.data.downurl);
+							window.open('https://chtech.ncjti.edu.cn/shuidian' + res.data.downurl);
 						} else {
 							_this.$message.error('【未获得】表格!');
 						}
 					})
 					.catch(err => {
-						// console.log(err);
+						console.log(err);
 						_this.$message.error('【导出表格】请求异常: ' + err);
 					})
 			},
@@ -320,7 +317,8 @@
 				this.$axios.get('/shuidian/HotWaters/watergetdoms.action', params)
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data.doms) != 'undefined' && res.data.doms != '' && JSON.stringify(res.data) !=
+						if (typeof(res.data.doms) != 'undefined' && res.data.doms != '' && JSON.stringify(
+								res.data) !=
 							'{}') {
 							this.room_options.rooms = [{
 								value: 0,
@@ -423,7 +421,8 @@
 						// console.log(res.data);
 						this.tableData = []
 						_this.rows_total = 0
-						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
+						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(
+								res.data) !=
 							'{}') {
 							_this.tableData = res.data.rows
 							_this.rows_total = res.data.total
@@ -452,7 +451,8 @@
 				this.$axios.get('/shuidian/HotWaters/watergetBuilds.action')
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON.stringify(res
+						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON
+							.stringify(res
 								.data) != '{}') {
 							this.drom_options.builds = [{
 								value: 0,
@@ -492,7 +492,8 @@
 					})
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res.data) != '{}') {
+						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res
+								.data) != '{}') {
 							// _this.$message.success('数据加载成功!');
 							this.xiaofei.year_balance = parseFloat(res.data.money_year).toFixed(2)
 						} else {
@@ -512,7 +513,8 @@
 					})
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res.data) != '{}') {
+						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res
+								.data) != '{}') {
 							// _this.$message.success('数据加载成功!');
 							this.xiaofei.month_balance = parseFloat(res.data.money_month).toFixed(2)
 						} else {
@@ -532,7 +534,8 @@
 					})
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res.data) != '{}') {
+						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res
+								.data) != '{}') {
 							// _this.$message.success('数据加载成功!');
 							this.xiaofei.day_balance = parseFloat(res.data.money_day).toFixed(2)
 

+ 6 - 5
src/main.js

@@ -5,8 +5,9 @@ import App from './App'
 import router from './router'
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
-import Echarts from 'echarts'
-import Axios from "axios"
+// import Echarts from 'echarts';
+import * as Echarts from 'echarts';
+import Axios from "axios";
 // import Api from '../static/interface'
 // import Qs from "qs"
 
@@ -21,9 +22,9 @@ Vue.use(ElementUI);
 // Vue.prototype.$qs = Qs;
 // Vue.prototype.$api = Api;
 Vue.prototype.$axios = Axios;
-Vue.prototype.$echarts = Echarts
+Vue.prototype.$echarts = Echarts;
 
-Vue.config.productionTip = false
+Vue.config.productionTip = false;
 
 /* eslint-disable no-new */
 new Vue({
@@ -33,4 +34,4 @@ new Vue({
 		App
 	},
 	template: '<App/>'
-})
+});

+ 1 - 1
src/router/index.js

@@ -16,8 +16,8 @@ import AD from '@/components/ad/ad' // 广告管理
 Vue.use(Router)
 
 export default new Router({
-	base: '/shuidian/',
 	mode: 'history',
+	base: '/shuidian/',
 	routes: [{
 		path: '/',
 		name: 'Login',

+ 1 - 1
static/interface/index.js

@@ -1,5 +1,5 @@
 // 配置主机地址和端口号(可以有多个,需要测试那个环境字节打开那个base即可)
-let base = "https://jtishfw.ncjti.edu.cn/jxch-smartmp"
+// let base = "https://jtishfw.ncjti.edu.cn/jxch-smartmp"
 let base = "https://chtech.ncjti.edu.cn/shuidian"
 
 // 在线api接口路径,需要和项目后台确认