prod
lily.zhang 3 years ago
parent 3989ff9f31
commit a4b6335583

@ -16,6 +16,7 @@
"echarts": "^5.2.1",
"less": "^4.1.2",
"less-loader": "^5.0.0",
"moment": "^2.29.1",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"qs": "^6.10.1",

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-20 16:17:39
* @LastEditTime: 2021-10-22 15:45:32
* @LastEditTime: 2021-10-23 17:18:24
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/api/home/index.js
@ -159,4 +159,4 @@ export function getListHome(params) {
'content-type': 'application/x-www-form-urlencoded'
}
})
}
}

@ -0,0 +1,18 @@
/*
* @Author: your name
* @Date: 2021-10-23 17:19:09
* @LastEditTime: 2021-10-23 17:26:38
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/api/mySelf/index.js
*/
import httpService from "@/request"
// 获取当前的数据
export function getMyFileInfoExcel(params) {
let obj = Object.assign({action: 'getFileInfoExcel', sType: 'User'}, params)
return httpService({
url: `/api/v6.ashx`,
method: 'get',
params: obj
})
}

@ -1,13 +1,13 @@
<!--
* @Author: your name
* @Date: 2021-10-11 10:42:36
* @LastEditTime: 2021-10-11 13:22:03
* @LastEditTime: 2021-10-23 15:06:25
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/components/v-modal/index.vue
-->
<template>
<div class="v-m-ouuter" v-show="show">
<div class="v-m-ouuter" v-if="show">
<div class="v-m-inner" :style="eleStyle">
<v-label-div :title="title">
<span class="iconfont icon-guanbi v-m-close" @click="handlerClose"></span>

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-10-08 19:06:37
* @LastEditTime: 2021-10-15 17:15:10
* @LastEditTime: 2021-10-23 11:25:50
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/components/v-tab-group/index.vue
@ -16,11 +16,22 @@
export default {
name: "v-tab-group",
props: {
value: {
type: Number,
default: 0
},
btns: {
type: Array,
default: () => []
},
},
},
watch: {
value: {
handler(val) {
this.activeInex = val
},
immediate: true
}
},
data() {
return {
@ -30,6 +41,7 @@ export default {
methods: {
handlerClick(n) {
this.activeInex = n;
this.$emit('update:value', this.activeInex)
this.$emit('change', this.activeInex);
}
}

@ -41,7 +41,7 @@
<span class="s2">{{ sClock }}</span>
<span class="s2">{{ week }}</span>
<img class="m1" src="../../assets/images/Index/ic_ry.png" width="24px" height="24px" />
<span class="s3">张三</span>
<span class="s3">{{getUser.UserName}}</span>
<a-dropdown placement="bottomRight">
<a class="ant-dropdown-link">
<a-icon type="down" />
@ -63,6 +63,7 @@
import {getOneTime} from "@/api/comm"
export default {
name: "iHeader",
inject: ['reload'],
data() {
return {
sTimeType: 1,
@ -95,6 +96,7 @@ export default {
if(this.sTimeType != this.selVal) {
this.setCommTime({sStartTime: "",sEndTime: ""});
}
this.reload();
},
//
getDatetime() {
@ -146,9 +148,12 @@ export default {
let obj = {sType: commTime.sType}
getOneTime(obj).then(res => {
this.selDatas = res.data;
this.sTimeType = this.selDatas[0].key;
this.selVal = this.selDatas[this.selDatas.length - 1].key;
this.setCommTime({sTimeType: this.sTimeType})
if(!this.getCommTime.sTimeType) {
this.sTimeType = this.selDatas[0].key;
this.setCommTime({sTimeType: this.sTimeType})
} else {
this.sTimeType = this.getCommTime.sTimeType;
}
})
},
//

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-10-13 14:25:26
* @LastEditTime: 2021-10-16 16:00:06
* @LastEditTime: 2021-10-23 12:57:20
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/lycomponents/iLayout/index.vue
@ -11,7 +11,7 @@
<iHeader></iHeader>
<div class="layout-body">
<vue-scroll>
<router-view></router-view>
<router-view v-if="isRouterAlive"></router-view>
</vue-scroll>
</div>
</div>
@ -20,6 +20,24 @@
<script>
export default {
name: "iLayout",
provide() {
return {
reload: this.reload
}
},
data() {
return {
isRouterAlive: true
}
},
methods: {
reload() {
this.isRouterAlive = false;
this.$nextTick(() => {
this.isRouterAlive = true;
})
}
}
};
</script>
<style lang="less" scoped>

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-13 09:28:02
* @LastEditTime: 2021-10-22 15:57:18
* @LastEditTime: 2021-10-23 09:35:20
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/request/index.js
@ -35,7 +35,6 @@ httpService.interceptors.request.use(config => {
const rqParams = filterRequestData(config.params);
const rqData = filterRequestData(config.data);
// post 'Content-Type' === 'application/x-www-form-urlencoded'
console.log(config.headers)
config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
if(config.method === 'post') {
config.data = qs.stringify(rqData);

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-12 13:37:50
* @LastEditTime: 2021-10-20 17:23:01
* @LastEditTime: 2021-10-23 13:56:09
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/store/state.js
@ -9,7 +9,7 @@
let commTime = {
sStartTime: "",
sEndTime: "",
sTimeType: 20
sTimeType: ''
}
const state = {
$zoom: 1,

@ -1,99 +1,128 @@
<!--
* @Author: xw
* @Date: 2021-10-09 11:28:39
* @LastEditTime: 2021-10-22 16:27:01
* @LastEditTime: 2021-10-23 12:58:13
* @LastEditors: Please set LastEditors
* @Description: 晴雨表
* @FilePath: /data-show/src/views/Index/barometer/index.vue
-->
<template>
<div class="bm-outter" v-loading="load">
<v-label-div title="晴雨表" @click="handlerClick">
<div>
<v-tab-group :btns="['正负调性', '负面等级']" @change="handlerChange"></v-tab-group>
</div>
</v-label-div>
<div class="bm-bd">
<v-echarts :opt="opt"></v-echarts>
</div>
</div>
<div class="bm-outter" v-loading="load">
<v-label-div title="晴雨表">
<div>
<v-tab-group :btns="['正负调性', '负面等级']" @change="handlerChange"></v-tab-group>
</div>
</v-label-div>
<div class="bm-bd">
<v-echarts :opt="opt" @getData="clickEchars"></v-echarts>
</div>
</div>
</template>
<script>
import createOpt from "./opt"
import {getAffections0528, getCrisisTime} from "@/api/home"
import createOpt from "./opt";
import { getAffections0528, getCrisisTime } from "@/api/home";
import moment from "moment";
export default {
name: "barometer",
data() {
return {
load: false,
opt: {}
}
},
created() {
this.getData1()
},
methods: {
//
handlerChange(n) {
if(n === 0) {
this.getData1()
} else {
this.getData2()
}
name: "barometer",
data() {
return {
load: false,
opt: {},
};
},
//
getData1() {
this.load = true;
getAffections0528(this.getCommTime).then(res => {
let data = res.data;
let dx = [];
let ds = [];
data.forEach(ele => {
let Time = ele.Time;
let Data = ele.Data;
dx.push(Time);
ds.push(Data);
});
this.opt = createOpt(dx, ds)
this.load = false;
})
created() {
this.getData1();
},
//
getData2() {
this.load = true;
getCrisisTime(this.getCommTime).then(res => {
let data = res.data;
let dx = [];
let ds = [];
data.forEach(ele => {
let Time = ele.Time;
let Data = ele.Data;
dx.push(Time);
ds.push(Data);
});
this.opt = createOpt(dx, ds)
this.load = false;
})
methods: {
//
handlerChange(n) {
if (n === 0) {
this.getData1();
} else {
this.getData2();
}
},
//
getData1() {
this.load = true;
getAffections0528(this.getCommTime).then((res) => {
let data = res.data;
let dx = [];
let ds = [];
data.forEach((ele) => {
let Time = ele.Time;
let Data = ele.Data;
dx.push(Time);
ds.push(Data);
});
this.opt = createOpt(dx, ds);
this.load = false;
});
},
//
getData2() {
this.load = true;
getCrisisTime(this.getCommTime).then((res) => {
let data = res.data;
let dx = [];
let ds = [];
data.forEach((ele) => {
let Time = ele.Time;
let Data = ele.Data;
dx.push(Time);
ds.push(Data);
});
this.opt = createOpt(dx, ds);
this.load = false;
});
},
// echars
clickEchars(data) {
let series = [];
let startTime = "";
let endTime = "";
data.forEach((ele) => {
let seriesName = ele.seriesName;
endTime = ele.name;
series.push(seriesName);
});
if (this.getCommTime.sTimeType == 34) {
// let endTime = moment(time).add(24, "hours").format("YYYY-MM-DD HH:mm:ss");
startTime = moment(endTime)
.subtract(24, "hours")
.format("YYYY-MM-DD HH:mm:ss");
} else if (this.getCommTime.sTimeType == 23) {
startTime = moment(endTime)
.subtract(3, "days")
.format("YYYY-MM-DD HH:mm:ss");
} else if (this.getCommTime.sTimeType == 3) {
startTime = moment(endTime)
.subtract(7, "days")
.format("YYYY-MM-DD HH:mm:ss");
} else {
startTime = moment(endTime)
.subtract(30, "days")
.format("YYYY-MM-DD HH:mm:ss");
}
this.$router.push({
path: "/industryDataExport",
query: { startTime, endTime, series },
});
},
},
//
handlerClick() {
this.$router.push({path: '/industryDataExport'})
},
}
};
</script>
<style lang="less" scoped>
.bm-outter {
width: 460px;
height: 312px;
border: 2px solid #0f2a4d;
margin-top: 16px;
.bm-bd {
width: 100%;
height: calc(100% - 48px);
}
width: 460px;
height: 312px;
border: 2px solid #0f2a4d;
margin-top: 16px;
.bm-bd {
width: 100%;
height: calc(100% - 48px);
}
}
</style>

@ -1,7 +1,7 @@
<!--
* @Author: xw
* @Date: 2021-10-09 14:25:05
* @LastEditTime: 2021-10-22 12:09:41
* @LastEditTime: 2021-10-23 14:43:23
* @LastEditors: Please set LastEditors
* @Description: 大数据统计gif
* @FilePath: /data-show/src/views/Index/dynamicNumber/index.vue
@ -11,55 +11,55 @@
<div class="d1">
<span class="s1">APP</span>
<span class="s2">
<countTo :startVal='0' :endVal='form.app' :duration='3000'></countTo>
<countTo :startVal='form.app-100 >= 0 ? form.app-100 : 0' :endVal='form.app' :duration='3000'></countTo>
</span>
</div>
<div class="d1" :style="{top: '340px', left: '0px'}">
<span class="s1">其他</span>
<span class="s2">
<countTo :startVal='0' :endVal='form.other' :duration='3000'></countTo>
<countTo :startVal='form.other-100 >= 0 ? form.other-100 : 0' :endVal='form.other' :duration='3000'></countTo>
</span>
</div>
<div class="d1" :style="{top: '91px', left: '426px'}">
<span class="s1">微信</span>
<span class="s2">
<countTo :startVal='0' :endVal='form.wecat' :duration='3000'></countTo>
<countTo :startVal='form.wecat-100 >= 0 ? form.wecat-100 : 0' :endVal='form.wecat' :duration='3000'></countTo>
</span>
</div>
<div class="d2" :style="{top: '240px', left: '656px'}">
<span class="s1">
<countTo :startVal='0' :endVal='form.forum' :duration='3000'></countTo>
<countTo :startVal='form.forum-100 >= 0 ? form.forum-100 : 0' :endVal='form.forum' :duration='3000'></countTo>
</span>
<span class="s2">论坛</span>
<span class="s2">论坛</span>
</div>
<div class="d2" :style="{top: '340px', left: '656px'}">
<span class="s1">
<countTo :startVal='0' :endVal='form.weipo' :duration='3000'></countTo>
<countTo :startVal='form.weipo-100 >= 0 ? form.weipo-100 : 0' :endVal='form.weipo' :duration='3000'></countTo>
</span>
<span class="s2">微博</span>
<span class="s2">微博</span>
</div>
<div class="d2" :style="{top: '490px', left: '246px'}">
<span class="s1">
<countTo :startVal='0' :endVal='form.news' :duration='3000'></countTo>
<countTo :startVal='form.news-100 >= 0 ? form.news-100 : 0' :endVal='form.news' :duration='3000'></countTo>
</span>
<span class="s2">新闻</span>
<span class="s2">新闻</span>
</div>
<div class="d3" @click="handlerAllData">
<span class="s1">系统入库 数据总量</span>
<span class="s2">
<countTo :startVal='0' :endVal='form.total' :duration='3000'></countTo>
<countTo :startVal='form.total-100 >= 0 ? form.total-100 : 0' :endVal='form.total' :duration='3000'></countTo>
</span>
</div>
</div>
</template>
<script>
import countTo from 'vue-count-to';
import {getHomeCount0528} from "@/api/home"
import countTo from "vue-count-to";
import { getHomeCount0528 } from "@/api/home";
export default {
name: "dynamic-number",
components: {
countTo
countTo,
},
data() {
return {
@ -72,47 +72,78 @@ export default {
other: 0,
short: 0,
forum: 0,
wecat: 0
}
}
wecat: 0,
},
begin: true,
intval: null,
};
},
created() {
this.getData()
this.load = true;
this.getData(1).then(() => {
this.load = false;
this.startDyfun(6000);
});
},
destroyed() {
if(this.intval) {
clearTimeout(this.intval)
}
},
methods: {
//
getData() {
this.load = true;
getHomeCount0528(this.getCommTime).then(res => {
let data = res.data;
this.form.total = data.count;
let sourcetypeCount = data.sourcetypeCount;
if(Array.isArray(sourcetypeCount)) {
sourcetypeCount.forEach(ele => {
if(ele.key == '新闻') {
this.form.news = ele.value;
} else if(ele.key == 'APP') {
this.form.app = ele.value;
} else if(ele.key == '论坛') {
this.form.forum = ele.value;
} else if (ele.key == '微信') {
this.form.wecat = ele.value;
} else if(ele.key == '微博') {
this.form.weipo = ele.value;
} else {
this.form.other = ele.value;
}
})
}
this.load = false;
})
getData(n) {
return new Promise((resolve, reject) => {
let obj = Object.assign({}, this.getCommTime, { iStatus: n });
getHomeCount0528(obj).then((res) => {
let data = res.data;
this.form.total = data.count;
let sourcetypeCount = data.sourcetypeCount;
if (Array.isArray(sourcetypeCount)) {
sourcetypeCount.forEach((ele) => {
if (ele.key == "新闻") {
this.form.news = ele.value;
} else if (ele.key == "APP") {
this.form.app = ele.value;
} else if (ele.key == "论坛") {
this.form.forum = ele.value;
} else if (ele.key == "微信") {
this.form.wecat = ele.value;
} else if (ele.key == "微博") {
this.form.weipo = ele.value;
} else {
this.form.other = ele.value;
}
});
}
resolve(res)
}).catch(() => {
reject(false)
});
});
},
//
handlerAllData() {
this.$emit('allData')
}
}
}
this.$emit("allData");
},
//
startDyfun(time) {
this.intval = self.setTimeout(() => {
if (this.begin) {
this.begin = false;
this.getData(2)
.then(() => {
this.begin = true;
this.startDyfun(time);
})
.catch(() => {
this.begin = false;
});
}
}, time);
},
},
};
</script>
<style lang="less" scoped>
@ -120,7 +151,7 @@ export default {
position: relative;
width: 100%;
height: 100%;
background-image: url('../../../assets/images/Index/d3.gif');
background-image: url("../../../assets/images/Index/d3.gif");
background-repeat: no-repeat;
background-size: cover;
.d1 {
@ -128,7 +159,7 @@ export default {
display: flex;
width: 280px;
height: 60px;
background-image: url('../../../assets/images/Index/img_jbtter.png');
background-image: url("../../../assets/images/Index/img_jbtter.png");
background-repeat: no-repeat;
background-size: cover;
justify-content: flex-start;
@ -145,7 +176,7 @@ export default {
display: block;
font-size: 28px;
font-family: Bebas;
color: #FFFFFF;
color: #ffffff;
margin-left: 24px;
}
}
@ -154,7 +185,7 @@ export default {
display: flex;
width: 280px;
height: 60px;
background-image: url('../../../assets/images/Index/img_jbtter.png');
background-image: url("../../../assets/images/Index/img_jbtter.png");
background-repeat: no-repeat;
background-size: cover;
justify-content: flex-end;
@ -172,14 +203,14 @@ export default {
display: block;
font-size: 28px;
font-family: Bebas;
color: #FFFFFF;
color: #ffffff;
}
}
.d3 {
position: absolute;
width: 320px;
height: 82px;
background-image: url('../../../assets/images/Index/img_jbtt.png');
background-image: url("../../../assets/images/Index/img_jbtt.png");
background-repeat: no-repeat;
background-size: cover;
left: 308px;
@ -199,10 +230,9 @@ export default {
display: block;
font-size: 32px;
font-family: Bebas;
color: #FFFFFF;
color: #ffffff;
margin-left: 23px;
}
}
}
</style>

@ -1,7 +1,7 @@
<!--
* @Author: xw
* @Date: 2021-10-08 09:17:42
* @LastEditTime: 2021-10-21 19:27:18
* @LastEditTime: 2021-10-23 15:07:04
* @LastEditors: Please set LastEditors
* @Description: 行业洞察
* @FilePath: /data-show/src/views/Index/index.vue
@ -66,7 +66,7 @@ export default {
return {
modalObj: {
title: "全网数据实时动态",
visible: true,
visible: false,
},
config: {
headerBGC: "#0F2A4D",
@ -83,7 +83,8 @@ export default {
this.getTableList();
},
mounted() {
this.modalObj.visible = false;
},
methods: {
handlerAllData() {

@ -1,7 +1,7 @@
<!--
* @Author: xw
* @Date: 2021-10-09 11:56:50
* @LastEditTime: 2021-10-22 12:16:10
* @LastEditTime: 2021-10-23 09:40:42
* @LastEditors: Please set LastEditors
* @Description: 尾翼洞察
* @FilePath: /data-show/src/views/Index/tailInsight/index.vue
@ -53,6 +53,7 @@ export default {
let data = res.data;
this.pdata = data;
this.load = false;
})
},
//

@ -1,7 +1,7 @@
<!--
* @Author: xw
* @Date: 2021-10-11 14:11:04
* @LastEditTime: 2021-10-22 16:15:09
* @LastEditTime: 2021-10-23 16:59:10
* @LastEditors: Please set LastEditors
* @Description: 行业数据导出
* @FilePath: /data-show/src/views/IndustryDataExport/index.vue
@ -16,8 +16,8 @@
<div class="ide-d1">
<div class="ide-d1-dd1">
<span class="s1">时间</span>
<v-tab-group :style="{ background: 'transparent' }" :btns="btnTimes" @change="handlerTime"></v-tab-group>
<a-range-picker style="margin-left: 12px" :size="$vuiSize" valueFormat="YYYY-MM-DD" v-if="form.sTimeType === selVal" @change="handlerChangeTime">
<v-tab-group v-model="gValue" :style="{ background: 'transparent' }" :btns="btnTimes" @change="handlerTime"></v-tab-group>
<a-range-picker v-model="selTime" style="margin-left: 12px" :size="$vuiSize" valueFormat="YYYY-MM-DD" v-if="form.sTimeType === selVal" @change="handlerChangeTime">
<a-icon slot="suffixIcon" type="calendar" />
</a-range-picker>
</div>
@ -26,12 +26,8 @@
<a-checkbox-group v-model="quDao" :disabled="noClick" :options="plainOptions" @change="(val) => onChange(val, 'quDao')" />
</div>
<div class="ide-d1-dd1" style="margin-top: 24px">
<span class="s1">情感</span>
<a-checkbox-group v-model="qingGan" :options="plainOptions1" @change="(val) => onChange(val, 'qingGan')" />
</div>
<div class="ide-d1-dd1" style="margin-top: 24px">
<span class="s1">负面等级</span>
<a-checkbox-group v-model="crisis" :options="plainOptions2" @change="onChange" />
<span class="s1">调性</span>
<a-checkbox-group v-model="qingGan" :options="plainOptions3" @change="(val) => onChange(val, 'qingGan')" />
</div>
</div>
<div class="ide-d2">
@ -74,7 +70,9 @@ export default {
qingGan: [],
crisis: [],
value3: [],
gValue: 0,
selVal: 4,
selTime: [],
form: {
sStartTime: "",
sEndTime: "",
@ -83,6 +81,8 @@ export default {
sTimeType: "",
iPageIndex: 1,
iPageSize: 20,
token: "",
sQuDao: "",
},
modalObj: {
title: "导出选项",
@ -135,33 +135,72 @@ export default {
this.getCrisis(),
this.getTime(),
]).then(() => {
this.getTable();
let series = this.$route.query.series || [];
this.form.token = this.$route.query.token || "";
this.plainOptions3 = this.doQingGanAndCrisis();
this.qingGan = series;
this.doFormQS(series);
this.form.sTimeType = 4;
this.form.sStartTime = this.$route.query.startTime || "";
this.form.sEndTime = this.$route.query.endTime || "";
if (this.form.sStartTime && this.form.sEndTime) {
this.selTime = [this.form.sStartTime, this.form.sEndTime];
}
this.gValue = 4;
this.getList();
this.getTable();
});
},
methods: {
onChange(val, type) {
switch (type) {
case "quDao":
this.noClick = true;
this.getTable().then(() => {
this.noClick = false;
});
break;
case "qingGan":
this.noClick = true;
this.form.sQingGan = this.qingGan.toString();
this.getTable().then(() => {
this.noClick = false;
});
break;
default:
break;
this.noClick = true;
if (type === "quDao") {
this.form.sQuDao = this.quDao.toString();
} else if (type === "qingGan") {
this.doFormQS(this.qingGan);
}
Promise.all([this.getList(), this.getTable()]).then(() => {
this.noClick = false;
});
},
//
handlerExport() {
this.modalObj.visible = true;
},
//
doFormQS(val = []) {
let qingGan = [];
let crisis = [];
val.forEach((ele) => {
let n1 = this.plainOptions1.findIndex((e) => {
return e.label === ele;
});
let n2 = this.plainOptions2.findIndex((e) => {
return e.label === ele;
});
if (n1 != -1) {
qingGan.push(this.plainOptions1[n1].value);
}
if (n2 != -1) {
crisis.push(this.plainOptions2[n2].value);
}
});
this.form.sQingGan = qingGan.toString();
this.form.sCrisis = crisis.toString();
},
//
doQingGanAndCrisis() {
let arr = [];
let tes = [...this.plainOptions1, ...this.plainOptions2];
tes.forEach((ele) => {
let obj = {
label: ele.label,
value: ele.label,
};
arr.push(obj);
});
return arr;
},
//
handlerBack() {
this.$router.go(-1);
@ -180,6 +219,7 @@ export default {
this.form.sEndTime = val[1];
this.getData();
},
//
handlerPage(p) {
let iPageIndex = p.current;
this.form.iPageIndex = iPageIndex;
@ -188,29 +228,45 @@ export default {
},
//
getTable() {
this.tableLoading = true;
this.getData(0).then((res) => {
let data = res.data;
this.totalNum = res.totalNum;
this.pagination.total = res.totalNum;
let arr = [];
data.forEach((ele) => {
let _source = ele._source;
arr.push(_source);
});
this.tbData = arr;
this.tableLoading = false;
return new Promise((resolve, reject) => {
this.tableLoading = true;
this.getData(0)
.then((res) => {
let data = res.data;
this.totalNum = res.totalNum;
this.pagination.total = res.totalNum;
let arr = [];
data.forEach((ele) => {
let _source = ele._source;
arr.push(_source);
});
this.tbData = arr;
this.tableLoading = false;
resolve(res);
})
.catch(() => {
reject(false);
});
});
},
//
getList() {
this.getData(1).then((res) => {
let data = res.data1;
let arr = [...this.plainOptions];
for(let i =0;i<data.length;i++) {
arr[i].label = this.plainOptions[i].label +'('+ data[i]+')';
}
this.plainOptions = arr;
return new Promise((resolve, reject) => {
this.getData(1)
.then((res) => {
let data = res.data1;
let arr = [...this.plainOptions];
for (let i = 0; i < data.length; i++) {
let label = arr[i].label || "";
let str = label.replace(/\(.*?\)/g, "");
arr[i].label = str + "(" + data[i] + ")";
}
this.plainOptions = arr;
resolve(res);
})
.catch(() => {
reject(false);
});
});
},
//

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-10-19 14:14:52
* @LastEditTime: 2021-10-20 16:13:29
* @LastEditTime: 2021-10-23 15:17:11
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Login/loginForm/index.vue
@ -127,6 +127,7 @@ export default {
} else {
this.setAccount({});
}
this.$router.push({path: '/'})
})
} else {
console.log("error submit!!");

@ -1,268 +1,263 @@
<!--
* @Author: xw
* @Date: 2021-10-09 16:57:27
* @LastEditTime: 2021-10-13 14:49:27
* @LastEditTime: 2021-10-23 17:25:22
* @LastEditors: Please set LastEditors
* @Description: 个人中心
* @FilePath: /data-show/src/views/Myself/index.vue
-->
<template>
<div class="d-container">
<div class="ms-outter">
<div class="ms-d1">
<v-label-div title="个人中心">
<v-btn @click="handlerBack"></v-btn>
</v-label-div>
<div class="ms-d1-inner">
<div class="d1" style="margin-left: 36px">
<img class="m1" src="../../assets/images/Index/ic_zhm.png" />
<div class="dd1">
<div class="ss1">
<span>张三</span>
<a-button
type="primary"
style="margin-left: 16px"
@click="handlerPwd"
>
修改密码
</a-button>
</div>
<span class="ss2">账户名</span>
<div class="d-container">
<div class="ms-outter">
<div class="ms-d1">
<v-label-div title="个人中心">
<v-btn @click="handlerBack"></v-btn>
</v-label-div>
<div class="ms-d1-inner">
<div class="d1" style="margin-left: 36px">
<img class="m1" src="../../assets/images/Index/ic_zhm.png" />
<div class="dd1">
<div class="ss1">
<span>{{getUser.UserName}}</span>
<a-button type="primary" style="margin-left: 16px" @click="handlerPwd">
修改密码
</a-button>
</div>
<span class="ss2">账户名</span>
</div>
</div>
<div class="d1" style="width: 350px">
<img class="m1" src="../../assets/images/Index/ic_sjh.png" />
<div class="dd1">
<div class="ss1"><span>13643446943</span></div>
<span class="ss2">关联手机号</span>
</div>
</div>
<div class="d1" style="margin-right: 36px; width: 470px">
<img class="m1" src="../../assets/images/Index/ic_sj.png" />
<div class="dd1">
<div class="ss1"><span>2021-08-28 12:00:00</span></div>
<span class="ss2">上次登录时间</span>
</div>
</div>
</div>
</div>
</div>
<div class="d1" style="width: 350px">
<img class="m1" src="../../assets/images/Index/ic_sjh.png" />
<div class="dd1">
<div class="ss1"><span>13643446943</span></div>
<span class="ss2">关联手机号</span>
<div class="ms-d2">
<v-label-div title="数据导出管理"></v-label-div>
<div class="ms-d2-inner">
<v-table :columns="columns" :data="tbData" row-key="id">
<span slot="action">
<a>下载</a>
</span>
</v-table>
</div>
</div>
</div>
<div class="d1" style="margin-right: 36px; width: 470px">
<img class="m1" src="../../assets/images/Index/ic_sj.png" />
<div class="dd1">
<div class="ss1"><span>2021-08-28 12:00:00</span></div>
<span class="ss2">上次登录时间</span>
</div>
</div>
</div>
</div>
<div class="ms-d2">
<v-label-div title="数据导出管理"></v-label-div>
<div class="ms-d2-inner">
<v-table :columns="columns" :data="tbData">
<span slot="action">
<a>下载</a>
</span>
</v-table>
</div>
</div>
<!--对话框-->
<v-modal :eleStyle="{ width: '800px', height: '520px' }" :visible.sync="modalObj.visible" :title="modalObj.title">
<div slot="body">
<div class="ms-step">
<a-steps :current="modalObj.current" labelPlacement="vertical">
<a-step title="验证身份" />
<a-step title="修改登入密码" />
<a-step title="修改成功" />
</a-steps>
</div>
<div class="ms-form">
<phoneForm ref="phoneForm" @nextStep="handlerNext" v-if="nextType === 1"></phoneForm>
<modifyForm v-if="nextType === 2" ref="modifyForm" :forgetForm="accout" @success="handlerSuc"></modifyForm>
<div class="stepEst" v-if="nextType === 3">
<span>222</span>
<span style="font-size: 20px;color:#fff">密码修改成功请重新登录</span>
</div>
</div>
</div>
<div slot="footer">
<div class="ms-footer" align="center">
<div class="f-btn" @click="next">{{nextStr}}</div>
</div>
</div>
</v-modal>
</div>
<!--对话框-->
<v-modal
:eleStyle="{ width: '800px', height: '520px' }"
:visible.sync="modalObj.visible"
:title="modalObj.title"
>
<div slot="body">
<div class="ms-step">
<a-steps :current="modalObj.current" labelPlacement="vertical">
<a-step title="验证身份" />
<a-step title="修改登入密码" />
<a-step title="修改成功" />
</a-steps>
</div>
<div class="ms-form">
<a-form :form="form">
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="手机号码"
>
<a-input
v-decorator="[
'phone',
{
rules: [{ required: true, message: '手机号码不能为空' }],
},
]"
placeholder="请输入手机号"
/>
</a-form-item>
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="验证码"
>
<a-input
v-decorator="[
'code',
{
rules: [{ required: true, message: '验证码不能为空' }],
},
]"
placeholder="请输入验证码"
>
<a-button slot="addonAfter" type="primary">
获取验证码
</a-button>
</a-input>
</a-form-item>
</a-form>
</div>
</div>
<div slot="footer">
<div class="ms-footer" align="center">
<div class="f-btn">下一步</div>
</div>
</div>
</v-modal>
</div>
</template>
<script>
import phoneForm from "./phoneForm";
import modifyForm from "./modifyForm";
import {getMyFileInfoExcel} from "@/api/mySelf"
export default {
name: "Myself",
data() {
return {
modalObj: {
visible: false,
current: 0,
title: "修改密码",
},
formItemLayout: {
labelCol: { span: 6 },
wrapperCol: { span: 18 },
},
columns: [
{
title: "文件名称",
key: "name",
dataIndex: "name",
},
{
title: "生成状态",
dataIndex: "age",
key: "age",
},
{
title: "导出时间",
dataIndex: "address",
key: "address",
name: "Myself",
components: {
phoneForm,
modifyForm,
},
data() {
return {
modalObj: {
visible: false,
current: 0,
title: "修改密码",
},
accout: {
sPhone: "",
iCode: "",
token: ""
},
nextStr: "下一步",
nextType: 1,
form: {
iPageIndex: 1,
iPageSize: 20
},
columns: [
{
title: "文件名称",
key: "name",
dataIndex: "name",
},
{
title: "生成状态",
dataIndex: "age",
key: "age",
},
{
title: "导出时间",
dataIndex: "address",
key: "address",
},
{
title: "操作",
key: "action",
width: 100,
scopedSlots: { customRender: "action" },
},
],
tbData: [
],
};
},
created() {
this.getTable()
},
methods: {
handlerPwd() {
this.modalObj.visible = true;
},
{
title: "操作",
key: "action",
width: 100,
scopedSlots: { customRender: "action" },
handlerBack() {
this.$router.go(-1);
},
],
tbData: [
{
key: "1",
name: "John Brown",
age: 32,
address: "New York No. 1 Lake Park",
tags: ["nice", "developer"],
//
next() {
if (this.nextType === 1) {
this.$refs.phoneForm.onNext();
} else if (this.nextType === 2) {
this.$refs.modifyForm.onSuccess();
} else {
this.$router.push('/login')
}
},
{
key: "2",
name: "Jim Green",
age: 42,
address: "London No. 1 Lake Park",
tags: ["loser"],
//
handlerNext(form) {
this.accout = Object.assign(this.accout, form);
this.nextStr = "确认";
this.nextType = 2;
this.modalObj.current = 1;
},
{
key: "3",
name: "Joe Black",
age: 32,
address: "Sidney No. 1 Lake Park",
tags: ["cool", "teacher"],
//
handlerSuc() {
this.nextStr = "重新登录";
this.nextType = 3;
this.modalObj.current = 2;
},
],
form: this.$form.createForm(this, { name: "coordinated" }),
};
},
methods: {
handlerPwd() {
this.modalObj.visible = true;
//
getTable() {
this.form.token = this.getToken;
getMyFileInfoExcel(this.form).then(res => {
console.log(res)
})
}
},
handlerBack() {
this.$router.go(-1);
}
},
};
</script>
<style lang="less" scoped>
.ms-outter {
padding: 0px 16px;
padding: 0px 16px;
}
.ms-d1 {
width: 100%;
height: 222px;
border: 2px solid #0f2a4d;
.ms-d1-inner {
width: 100%;
height: calc(100% - 48px);
display: flex;
justify-content: space-between;
.d1 {
height: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
.m1 {
width: 80px;
height: 80px;
}
.dd1 {
margin-left: 20px;
.ss1 {
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 36px;
color: #fff;
}
.ss2 {
font-size: 20px;
color: #acb0b4;
height: 222px;
border: 2px solid #0f2a4d;
.ms-d1-inner {
width: 100%;
height: calc(100% - 48px);
display: flex;
justify-content: space-between;
.d1 {
height: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
.m1 {
width: 80px;
height: 80px;
}
.dd1 {
margin-left: 20px;
.ss1 {
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 36px;
color: #fff;
}
.ss2 {
font-size: 20px;
color: #acb0b4;
}
}
}
}
}
}
}
.ms-d2 {
padding: 0px 16px;
height: 730px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.ms-d2-inner {
padding: 16px;
}
padding: 0px 16px;
height: 730px;
margin-top: 16px;
border: 2px solid #0f2a4d;
.ms-d2-inner {
padding: 16px;
}
}
.ms-form {
position: relative;
width: 400px;
margin: 0 auto;
margin-top: 30px;
position: relative;
width: 400px;
margin: 0 auto;
margin-top: 30px;
}
.ms-step {
padding: 40px;
padding: 40px;
}
.f-btn {
width: 400px;
height: 80px;
background: linear-gradient(180deg, #00487d 0%, #0c2342 100%);
border: 3px solid;
color: #63aecc;
line-height: 80px;
font-weight: bold;
font-size: 28px;
text-align: center;
cursor: pointer;
width: 400px;
height: 60px;
background-image: url("../../assets/images/login/img_dlan_nor.png");
background-repeat: no-repeat;
background-size: 100% 100%;
color: #63aecc;
line-height: 60px;
font-weight: bold;
font-size: 20px;
text-align: center;
cursor: pointer;
}
.stepEst {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
/deep/ .ant-table-body {
height: 600px;
height: 600px;
}
</style>

@ -0,0 +1,100 @@
<!--
* @Author: your name
* @Date: 2021-10-23 15:58:58
* @LastEditTime: 2021-10-23 17:13:21
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Myself/modifyForm/index.vue
-->
<template>
<a-form-model layout="horizontal" :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol" ref="resetForm">
<a-form-model-item label="设置密码" prop="pwd1">
<a-input type="password" v-model="form.pwd1" placeholder="请输入新密码" autocomplete="off"/>
</a-form-model-item>
<a-form-model-item label="再次输入" prop="pwd2">
<a-input type="password" v-model="form.pwd2" placeholder="请再次输入新密码" autocomplete="off"/>
</a-form-model-item>
</a-form-model>
</template>
<script>
import {updPhonePwd} from "@/api/login"
export default {
name: "modifyForm",
props: {
forgetForm: {
type: Object,
default: () => {
return {}
}
}
},
data() {
const validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
let reg =
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,}$/;
if (!reg.test(value)) {
callback(new Error("密码由大小写字母、数字和特殊字符组成"));
} else if (value.length < 8 || value.length > 16) {
callback(new Error("密码8~16位"));
} else {
callback();
}
}
};
const validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
let reg =
/^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,}$/;
if (!reg.test(value)) {
callback(new Error("密码由大小写字母、数字和特殊字符组成"));
} else if (value.length < 8 || value.length > 16) {
callback(new Error("密码8~16位"));
} else if (value != this.form.pwd1) {
callback(new Error("两次密码不一致"));
} else {
callback();
}
}
};
return {
form: {
pwd1: "",
pwd2: "",
},
labelCol: { span: 4 },
wrapperCol: { span: 20 },
rules: {
pwd1: [{ validator: validatePass, trigger: "change" }],
pwd2: [{ validator: validatePass2, trigger: "change" }],
},
}
},
methods: {
//
onSuccess() {
this.$refs.resetForm.validate((valid) => {
if (valid) {
let obj = {...this.forgetForm};
obj.sPwd = this.form.pwd2;
updPhonePwd(obj).then(() => {
this.$emit('success')
})
} else {
console.log("error submit!!");
return false;
}
});
}
}
}
</script>
<style lang="less" scoped>
</style>

@ -0,0 +1,115 @@
<!--
* @Author: your name
* @Date: 2021-10-23 15:34:18
* @LastEditTime: 2021-10-23 17:13:16
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/views/Myself/phoneForm/index.vue
-->
<template>
<a-form-model layout="horizontal" :model="form" :rules="rules" ref="phoneForm" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-model-item label="手机号码" prop="sPhone">
<a-input v-model="form.sPhone" placeholder="手机号码" autocomplete="off" />
</a-form-model-item>
<a-form-model-item label="验证码" prop="iCode">
<a-input v-model="form.iCode" placeholder="验证码" autocomplete="off">
<span class="fp-s1" slot="suffix" v-if="showCode" @click="getCode"></span>
<span class="fp-s1" slot="suffix" v-else>{{count}}</span>
</a-input>
</a-form-model-item>
</a-form-model>
</template>
<script>
import { getVERCode, checkVERCode } from "@/api/login";
export default {
name: "phoneForm",
data() {
const validatePhone = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入手机号"));
} else {
let reg = /^1\d{10}$/;
if (!reg.test(value)) {
callback(new Error("请输入正确的手机号"));
} else {
callback();
}
}
};
const validateCode = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入验证码"));
} else {
callback();
}
};
return {
timer: null,
count: 0,
showCode: true,
labelCol: { span: 4 },
wrapperCol: { span: 20 },
form: {
sPhone: "",
iCode: "",
},
rules: {
sPhone: [{ validator: validatePhone, trigger: "change" }],
iCode: [{ validator: validateCode, trigger: "change" }],
},
};
},
methods: {
//
getCode() {
this.$refs.phoneForm.validateField("sPhone", (errMsg) => {
if (!errMsg) {
getVERCode({ sPhone: this.form.sPhone }).then(() => {
this.countdown();
});
} else {
console.log("验证失败");
}
});
},
//
countdown() {
const TIME_COUNT = 60;
if (!this.timer) {
this.count = TIME_COUNT;
this.showCode = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
} else {
this.showCode = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
},
//
onNext() {
this.$refs.phoneForm.validate((valid) => {
if (valid) {
checkVERCode(this.form).then(() => {
this.$emit("nextStep", this.form);
});
} else {
console.log("error submit!!");
return false;
}
});
},
},
};
</script>
<style lang="less" scoped>
.fp-s1 {
cursor: pointer;
color: #698198;
}
</style>

@ -5792,7 +5792,7 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"
moment@^2.21.0:
moment@^2.21.0, moment@^2.29.1:
version "2.29.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==

Loading…
Cancel
Save