Commit 4152bc68 authored by wangxiaoming's avatar wangxiaoming

merge

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