Commit 78ad1afe by liu.jiani

202107131435

parent 89057fed
......@@ -12,15 +12,18 @@
"driver.js": "^0.9.8",
"echarts": "^4.9.0",
"element-ui": "^2.4.5",
"file-saver": "^2.0.5",
"html2canvas": "^1.1.0",
"js-cookie": "^2.2.1",
"qs": "^6.9.4",
"sass-resources-loader": "^2.1.1",
"vendors": "^2.0.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vue-wechat-title": "^2.0.7",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.0.0-beta.1"
"vuex-persistedstate": "^4.0.0-beta.1",
"xlsx": "^0.17.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
......@@ -37,6 +40,7 @@
"node-sass": "^4.12.0",
"prettier": "^1.19.1",
"sass-loader": "^8.0.2",
"script-loader": "^0.7.2",
"vue-cli-plugin-axios": "^0.0.4",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11"
......
......@@ -31,7 +31,7 @@ const routes = [
path: "/home",
name: "Home",
meta: {
title: "test",
title: "专题数据时空渲染",
auth: 5
},
component: () => import("@/views/Home.vue")
......
......@@ -41,7 +41,7 @@
<!-- 右侧用户登录退出部分 -->
<div class="header-login">
<ul>
<li @click="dataClick">时空数据</li>
<li @click="dataClick">时空分析</li>
<li @click="downloadEx">模板下载</li>
<li style="border:none">操作手册</li>
</ul>
......@@ -229,6 +229,7 @@ export default {
this.imageUrl = false;
},
uploadFile() {
this.$emit("changeCurTypeFunc", "upload");
const that = this;
if (this.fileList.length === 0) {
this.$emit("uploadFileFlagFunc", false);
......@@ -253,11 +254,11 @@ export default {
let laxxglDefaultFormThead = [
{
label: "X",
prop: "x"
prop: "xStr"
},
{
label: "Y",
prop: "y"
prop: "yStr"
},
{
label: "TITLE",
......@@ -265,7 +266,7 @@ export default {
},
{
label: "TIME",
prop: "time"
prop: "timeStr"
}
];
let tHeader = [];
......@@ -280,7 +281,7 @@ export default {
} = require("../vendor/Export2Excel");
const list = res.data;
const data = that.formatJson(filterVal, list);
export_json_to_excel(tHeader, data, '错误信息');
export_json_to_excel(tHeader, data, "错误信息");
});
} else {
that.fileList = [];
......@@ -296,26 +297,26 @@ export default {
});
}
},
formatJson(filterVal, jsonData) {
let arr = []
jsonData.map(v => {
let arr1 = []
filterVal.map(j => {
if (j.indexOf(',') != -1) {
let arr = j.split(',')
let data = ''
for (let i = 0; i <= arr.length - 1; i++) {
data += arr[i].split(':')[0] + ':' + v[arr[i].split(':')[1]]
}
arr1.push(data)
} else {
arr1.push(v[j])
}
})
arr.push(arr1)
})
return arr
},
formatJson(filterVal, jsonData) {
let arr = [];
jsonData.map(v => {
let arr1 = [];
filterVal.map(j => {
if (j.indexOf(",") != -1) {
let arr = j.split(",");
let data = "";
for (let i = 0; i <= arr.length - 1; i++) {
data += arr[i].split(":")[0] + ":" + v[arr[i].split(":")[1]];
}
arr1.push(data);
} else {
arr1.push(v[j]);
}
});
arr.push(arr1);
});
return arr;
},
downError() {
let form = new FormData();
form.append("excelFile", this.fileList[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment