Commit 4152bc68 authored by wangxiaoming's avatar wangxiaoming

merge

parent ff491578
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"file-saver": "^2.0.2", "file-saver": "^2.0.2",
"gcoord": "^0.2.3", "gcoord": "^0.2.3",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"moment": "^2.24.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-baidu-map": "^0.21.20", "vue-baidu-map": "^0.21.20",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
...@@ -38,6 +37,7 @@ ...@@ -38,6 +37,7 @@
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"lodash": "^4.17.19", "lodash": "^4.17.19",
"moment": "^2.27.0",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
}, },
......
...@@ -13,6 +13,7 @@ Vue.use(ElementUI); ...@@ -13,6 +13,7 @@ Vue.use(ElementUI);
Vue.use(BaiduMap, { Vue.use(BaiduMap, {
ak: 'AZzMTSKLP4lVHphRauTBdINZUFnpWTcu', ak: 'AZzMTSKLP4lVHphRauTBdINZUFnpWTcu',
}); });
Object.defineProperty(Vue.prototype, '$moment', { value: moment })
Object.defineProperty(Vue.prototype, '$_', { value: _ }); Object.defineProperty(Vue.prototype, '$_', { value: _ });
Vue.config.productionTip = false; Vue.config.productionTip = false;
......
...@@ -68,15 +68,15 @@ ...@@ -68,15 +68,15 @@
<script> <script>
// @ is an alias to /src // @ is an alias to /src
// import HelloWorld from '@/components/HelloWorld.vue'; // import HelloWorld from '@/components/HelloWorld.vue';
import Cookies from "js-cookie"; import Cookies from 'js-cookie';
export default { export default {
name: "home", name: 'home',
data() { data() {
return { return {
myId: "", myId: '',
user: { user: {
name: "张三", name: '张三',
}, },
}; };
}, },
...@@ -84,34 +84,33 @@ export default { ...@@ -84,34 +84,33 @@ export default {
// HelloWorld, // HelloWorld,
}, },
created() { created() {
const myId = Cookies.get("id"); const myId = Cookies.get('id');
this.myId = myId; this.myId = myId;
const username = Cookies.get("username"); const username = Cookies.get('username');
// console.log(this.$route.params.username); // console.log(this.$route.params.username);
this.user.name = username; this.user.name = username;
}, },
mounted() { mounted() {
if (this.$route.path.replace("/", "") == "") { if (this.$route.path.replace('/', '') == '') {
this.goTo("/overview"); this.goTo('/overview');
} }
}, },
computed: { computed: {
onRoutes() { onRoutes() {
// this.$route.path // this.$route.path
// debugger // debugger
if (this.$route.path.replace("/", "") == "overview") { if (this.$route.path.replace('/', '') == 'overview') {
return "1-1"; return '1-1';
} else if (this.$route.path.replace("/", "") == "detail") { } if (this.$route.path.replace('/', '') == 'detail') {
return "1-2"; return '1-2';
} else if (this.$route.path.replace("/", "") == "task") { } if (this.$route.path.replace('/', '') == 'task') {
return "2"; return '2';
} else if (this.$route.path.replace("/", "") == "result") { } if (this.$route.path.replace('/', '') == 'result') {
return "3-1"; return '3-1';
} else if (this.$route.path.replace("/", "") == "resultDetail") { } if (this.$route.path.replace('/', '') == 'resultDetail') {
return "3-2"; return '3-2';
} else {
return "1-1";
} }
return '1-1';
}, },
}, },
methods: { methods: {
...@@ -124,9 +123,9 @@ export default { ...@@ -124,9 +123,9 @@ export default {
// 退出 // 退出
esc() { esc() {
// alert(1); // alert(1);
Cookies.remove("id"); Cookies.remove('id');
this.$router.push({ this.$router.push({
name: "login", name: 'login',
}); });
}, },
goTo(path) { goTo(path) {
......
...@@ -231,7 +231,8 @@ export default { ...@@ -231,7 +231,8 @@ export default {
pageSize: 20, pageSize: 20,
totalCount: 0, totalCount: 0,
}, },
currentPage: 1, // 初始页
pagesize: 10, // 每页的数据
tableData: [ tableData: [
], ],
...@@ -447,11 +448,15 @@ export default { ...@@ -447,11 +448,15 @@ export default {
endTime: this.filters.dateTime[1], endTime: this.filters.dateTime[1],
capitalType: this.filters.capitalType, capitalType: this.filters.capitalType,
status: this.filters.status > 0 ? this.filters.status : null, status: this.filters.status > 0 ? this.filters.status : null,
pageIndex: this.pageOption.pageIndex,
pageSize: this.pageOption.pageSize,
}).then((response) => { }).then((response) => {
this.searchLoading = false; this.searchLoading = false;
if (response.data.code === 200) { if (response.data.code === 200) {
if (response.data.data) { if (response.data.data) {
response.data.data.forEach((val) => { this.tableData = response.data.data.list;
this.pageOption.totalCount = response.data.data.total;
this.tableData.forEach((val) => {
val.status = val.status == 1 ? '正常' : (val.status == 2 ? '异常' : '新增'); val.status = val.status == 1 ? '正常' : (val.status == 2 ? '异常' : '新增');
val.imageTime = moment(parseInt(val.imageTime)).format('YYYY-MM-DD HH:mm:ss'); val.imageTime = moment(parseInt(val.imageTime)).format('YYYY-MM-DD HH:mm:ss');
this.capitalOptions.forEach((item) => { this.capitalOptions.forEach((item) => {
...@@ -460,13 +465,13 @@ export default { ...@@ -460,13 +465,13 @@ export default {
} }
}); });
}); });
this.tableData = response.data.data;
} else { } else {
this.tableData = []; this.tableData = [];
} }
} else { } else {
this.tableData = []; this.tableData = [];
} }
console.log(`llllllllllllllll${JSON.stringify(this.tableData)}`);
}) })
.catch((error) => { .catch((error) => {
this.searchLoading = false; this.searchLoading = false;
...@@ -491,12 +496,14 @@ export default { ...@@ -491,12 +496,14 @@ export default {
// 初始页currentPage、初始每页数据数pagesize和数据data // 初始页currentPage、初始每页数据数pagesize和数据data
handleSizeChange(size) { handleSizeChange(size) {
this.pagesize = size; this.pageOption.pageSize = size;
console.log(this.pagesize); // 每页下拉显示数据 console.log(this.pagesize); // 每页下拉显示数据
this.getImageGroups();
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage; this.pageOption.pageIndex = currentPage;
console.log(this.currentPage); // 点击第几页 console.log(this.currentPage); // 点击第几页
this.getImageGroups();
}, },
getAllCapitals() { getAllCapitals() {
axios.post(`${address}getAllCapitals`, { axios.post(`${address}getAllCapitals`, {
......
This diff is collapsed.
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