Commit bff946e9 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents f46ff2d4 84281cfc
...@@ -507,6 +507,10 @@ export default { ...@@ -507,6 +507,10 @@ export default {
if (res2.success) { if (res2.success) {
if (res2.result.res) { if (res2.result.res) {
this.$Message.success("排产计算成功"); this.$Message.success("排产计算成功");
//智能排产操作start
//只能排产操作end
this.circleModal = false; this.circleModal = false;
this.$router.push({ this.$router.push({
path: "/ai/results" path: "/ai/results"
......
...@@ -50,14 +50,13 @@ ...@@ -50,14 +50,13 @@
<a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a> <a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a>
</Badge> </Badge>
<Badge :count="this.$store.state.countRun" overflow-count="99" type="info" v-if="showRun"> <Badge :count="this.$store.state.countRun" overflow-count="99" type="info" v-if="showRun">
<a @click="goStream">流水排产&nbsp;&nbsp;&nbsp;</a> <a @click="goStream">流水排产&nbsp;&nbsp;&nbsp;</a>
</Badge> </Badge>
</template> </template>
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons"></template>
</template>
</DataGrid> </DataGrid>
<FooterToolbar extra v-if="footerBar"> <FooterToolbar extra v-if="footerBar">
<Row> <Row>
...@@ -87,6 +86,7 @@ ...@@ -87,6 +86,7 @@
<Modal v-model="scheduleModal" title="移入排产" width="800"> <Modal v-model="scheduleModal" title="移入排产" width="800">
<p>&nbsp;</p> <p>&nbsp;</p>
<h4>请选择排产模型:</h4> <h4>请选择排产模型:</h4>
<!--
<Dictionary <Dictionary
code="aps.plan.scheduleType" code="aps.plan.scheduleType"
v-model="scheduleType" v-model="scheduleType"
...@@ -95,6 +95,21 @@ ...@@ -95,6 +95,21 @@
type="radio" type="radio"
@on-change="onchangeScheduleType" @on-change="onchangeScheduleType"
></Dictionary> ></Dictionary>
-->
<RadioGroup v-model="scheduleType" class="radioList" @on-change="onchangeScheduleType">
<Radio :label="1" border :disabled="this.$store.state.countAi>0">
<span >Aps排产</span>
</Radio>
<Radio :label="4" border :disabled="this.$store.state.countAps>0">
<span >智能排产</span>
</Radio>
<Radio :label="2" border>
<span >整机排产</span>
</Radio>
<Radio :label="3" border>
<span >流水排产</span>
</Radio>
</RadioGroup>
<p class="pl30 pt10" v-show="scheduleType!=null"> <p class="pl30 pt10" v-show="scheduleType!=null">
确定将订单 确定将订单
<span class="fwBold">{{resultsOrderList}}</span> 移入 <span class="fwBold">{{resultsOrderList}}</span> 移入
...@@ -128,7 +143,7 @@ export default { ...@@ -128,7 +143,7 @@ export default {
Detail, Detail,
Search, Search,
Dispatch, Dispatch,
orderSupport orderSupport,
}, },
data() { data() {
return { return {
...@@ -136,8 +151,8 @@ export default { ...@@ -136,8 +151,8 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,projectNumber", op: "mesCode,projectNumber",
value: null value: null,
} },
}, },
addModal: false, addModal: false,
editModal: false, editModal: false,
...@@ -149,17 +164,17 @@ export default { ...@@ -149,17 +164,17 @@ export default {
curId: 0, curId: 0,
columns: [ columns: [
{ {
key:"selection", key: "selection",
title:'#', title: "#",
type: "selection", type: "selection",
width: 70, width: 70,
align: "center" align: "center",
}, },
{ {
title: this.l("mesCode"), title: this.l("mesCode"),
key: "mesCode", key: "mesCode",
width: 240, width: 240,
align: "left" align: "left",
}, },
{ {
key: "productName", key: "productName",
...@@ -168,42 +183,42 @@ export default { ...@@ -168,42 +183,42 @@ export default {
easy: true, easy: true,
width: 160, width: 160,
high: true, high: true,
tooltip: true tooltip: true,
}, },
{ {
key: "status", key: "status",
title: this.l("status"), title: this.l("status"),
align: "center", align: "center",
high: true, high: true,
code: "plan.order.status" code: "plan.order.status",
}, },
{ {
key: "mainRoutingSetStatus", key: "mainRoutingSetStatus",
title: this.l("mainRoutingSetStatus"), title: this.l("mainRoutingSetStatus"),
align: "center", align: "center",
high: true, high: true,
code: "aps.plan.mainRoutingStatus" code: "aps.plan.mainRoutingStatus",
}, },
{ {
key: "isSupportingFinish", key: "isSupportingFinish",
title: this.l("isSupportingFinish"), title: this.l("isSupportingFinish"),
align: "center", align: "center",
high: true, high: true,
code: "aps.plan.supportingStatus" code: "aps.plan.supportingStatus",
}, },
{ {
key: "projectNumber", key: "projectNumber",
title: this.l("projectNumber"), title: this.l("projectNumber"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "batchNumber", key: "batchNumber",
title: this.l("batchNumber"), title: this.l("batchNumber"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "urgencyLevel", key: "urgencyLevel",
...@@ -211,7 +226,7 @@ export default { ...@@ -211,7 +226,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
code: "plan.order.urgencyLevel" code: "plan.order.urgencyLevel",
}, },
{ {
...@@ -221,7 +236,7 @@ export default { ...@@ -221,7 +236,7 @@ export default {
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true,
code: "plan.order.taskType" code: "plan.order.taskType",
}, },
{ {
...@@ -229,7 +244,7 @@ export default { ...@@ -229,7 +244,7 @@ export default {
title: this.l("drawnNumber"), title: this.l("drawnNumber"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "stage", key: "stage",
...@@ -237,20 +252,20 @@ export default { ...@@ -237,20 +252,20 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
code: "plan.order.stage" code: "plan.order.stage",
}, },
{ {
key: "materialName", key: "materialName",
title: this.l("materialName"), title: this.l("materialName"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "quantity", key: "quantity",
title: this.l("quantity"), title: this.l("quantity"),
align: "right", align: "right",
high: true high: true,
}, },
{ {
key: "routingMethod", key: "routingMethod",
...@@ -258,14 +273,14 @@ export default { ...@@ -258,14 +273,14 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
code: "plan.order.routingMethod" code: "plan.order.routingMethod",
}, },
{ {
key: "materialWeight", key: "materialWeight",
title: this.l("materialWeight"), title: this.l("materialWeight"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
...@@ -274,7 +289,7 @@ export default { ...@@ -274,7 +289,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
...@@ -283,28 +298,28 @@ export default { ...@@ -283,28 +298,28 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "mes_xingchi_plan.mes_order.is_preschedule", code: "mes_xingchi_plan.mes_order.is_preschedule",
hide: true hide: true,
}, },
{ {
key: "spareQty", key: "spareQty",
title: this.l("spareQty"), title: this.l("spareQty"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "demandStart", key: "demandStart",
title: this.l("demandStart"), title: this.l("demandStart"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "demandFinish", key: "demandFinish",
title: this.l("demandFinish"), title: this.l("demandFinish"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "partNamePro", key: "partNamePro",
...@@ -312,7 +327,7 @@ export default { ...@@ -312,7 +327,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -329,18 +344,18 @@ export default { ...@@ -329,18 +344,18 @@ export default {
title: title:
params.row.mainRoutingSetStatus == 0 params.row.mainRoutingSetStatus == 0
? "工艺派发" ? "工艺派发"
: "移入排产" : "移入排产",
}, },
style: { style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "" color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
}, },
on: { on: {
click: () => click: () =>
params.row.mainRoutingSetStatus == 0 || params.row.mainRoutingSetStatus == 0 ||
params.row.mainRoutingSetStatus == 1 params.row.mainRoutingSetStatus == 1
? this.goMethod(params.row) ? this.goMethod(params.row)
: null : null,
} },
}, },
params.row.mainRoutingSetStatus == 0 params.row.mainRoutingSetStatus == 0
? "工艺派发" ? "工艺派发"
...@@ -357,27 +372,27 @@ export default { ...@@ -357,27 +372,27 @@ export default {
params.row.isSupportingFinish == 2 || params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 params.row.isSupportingFinish == 3
? "配套派发" ? "配套派发"
: "" : "",
}, },
style: { style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "" color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
}, },
on: { on: {
click: () => click: () =>
params.row.isSupportingFinish == 2 || params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 params.row.isSupportingFinish == 3
? this.supportDis(params.row) ? this.supportDis(params.row)
: null : null,
} },
}, },
params.row.isSupportingFinish == 2 || params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 params.row.isSupportingFinish == 3
? "配套派发" ? "配套派发"
: "" : ""
) ),
]); ]);
} },
} },
], ],
selectCount: 0, selectCount: 0,
selectList: [], selectList: [],
...@@ -396,7 +411,7 @@ export default { ...@@ -396,7 +411,7 @@ export default {
showAps: false, showAps: false,
showAi: false, showAi: false,
showAll: false, showAll: false,
showRun: false showRun: false,
}; };
}, },
mounted() { mounted() {
...@@ -423,7 +438,7 @@ export default { ...@@ -423,7 +438,7 @@ export default {
let statueArry = []; let statueArry = [];
let tempmesCodeList = []; let tempmesCodeList = [];
this.resultsStatusArr = []; this.resultsStatusArr = [];
value.forEach(data => { value.forEach((data) => {
var that = this; var that = this;
statueArry.push(data.id); statueArry.push(data.id);
this.resultsStatusArr.push(data.mainRoutingSetStatus); this.resultsStatusArr.push(data.mainRoutingSetStatus);
...@@ -517,10 +532,10 @@ export default { ...@@ -517,10 +532,10 @@ export default {
} else { } else {
let params = { let params = {
ids: this.listBatchIds, ids: this.listBatchIds,
poolType: this.scheduleType poolType: this.scheduleType,
}; };
Api.moveinbatch(params) Api.moveinbatch(params)
.then(r => { .then((r) => {
if (r.success && r.result == true) { if (r.success && r.result == true) {
this.$Message.success("移入排产成功"); this.$Message.success("移入排产成功");
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
...@@ -533,7 +548,7 @@ export default { ...@@ -533,7 +548,7 @@ export default {
} }
} }
}) })
.catch(err => { .catch((err) => {
this.$Message.error("移入排产失败"); this.$Message.error("移入排产失败");
}); });
this.canselFooter(); this.canselFooter();
...@@ -542,11 +557,11 @@ export default { ...@@ -542,11 +557,11 @@ export default {
}, },
//跳转到aps排产池(有判断) //跳转到aps排产池(有判断)
goAps() { goAps() {
Api.moveintoaps().then(res => { Api.moveintoaps().then((res) => {
if (res.success) { if (res.success) {
if (res.result.res) { if (res.result.res) {
this.$router.push({ this.$router.push({
name: "aps-aps" name: "aps-aps",
// params: { customerId: id } // params: { customerId: id }
}); });
} else { } else {
...@@ -555,13 +570,14 @@ export default { ...@@ -555,13 +570,14 @@ export default {
} }
}); });
}, },
//跳转到智能排产池(有判断) //跳转到智能排产池(有判断)
goAi() { goAi() {
Api.moveintoai().then(res => { Api.moveintoai().then((res) => {
if (res.success) { if (res.success) {
if (res.result.res) {//test if (res.result.res) {
//test
this.$router.push({ this.$router.push({
name: "aps-ai" name: "aps-ai",
// params: { customerId: id } // params: { customerId: id }
}); });
} else { } else {
...@@ -572,17 +588,16 @@ export default { ...@@ -572,17 +588,16 @@ export default {
}, },
goCemplate() { goCemplate() {
this.$router.push({ this.$router.push({
name: "aps-complete" name: "aps-complete",
}); });
}, },
goStream() { goStream() {
this.$router.push({ this.$router.push({
name: "aps-stream" name: "aps-stream",
}); });
}, },
add(){ add() {
this.addModal=true; this.addModal = true;
}, },
addOk() { addOk() {
this.$refs.grid.load(); this.$refs.grid.load();
...@@ -614,7 +629,7 @@ export default { ...@@ -614,7 +629,7 @@ export default {
this.curId = id; this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then(r => { Api.delete({ id: this.curId }).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.deletelModal = false; this.deletelModal = false;
...@@ -656,7 +671,7 @@ export default { ...@@ -656,7 +671,7 @@ export default {
}, },
//移入排产前选择排产模型 //移入排产前选择排产模型
onchangeScheduleType(val) { onchangeScheduleType(val) {
switch (val) { switch (Number(val)) {
case 4: case 4:
this.scheduleTypeName = "智能排产"; this.scheduleTypeName = "智能排产";
break; break;
...@@ -691,9 +706,9 @@ export default { ...@@ -691,9 +706,9 @@ export default {
loadInitCount() { loadInitCount() {
let currentUserId = this.$store.state.userInfo.userId; let currentUserId = this.$store.state.userInfo.userId;
let para = { id: currentUserId }; let para = { id: currentUserId };
Api.listbyuser(para).then(datas => { Api.listbyuser(para).then((datas) => {
if (datas.success && datas.result && datas.result.length > 0) { if (datas.success && datas.result && datas.result.length > 0) {
datas.result.forEach(dateScheduleId => { datas.result.forEach((dateScheduleId) => {
switch (dateScheduleId.apsScheduleId) { switch (dateScheduleId.apsScheduleId) {
case 1: case 1:
this.showAps = true; this.showAps = true;
...@@ -705,9 +720,8 @@ export default { ...@@ -705,9 +720,8 @@ export default {
this.showRun = true; this.showRun = true;
break; break;
default: default:
this.showAi = true; this.showAi = true;
} }
}); });
} }
}); });
...@@ -717,18 +731,18 @@ export default { ...@@ -717,18 +731,18 @@ export default {
this.$store.commit("setCountAll", 0); this.$store.commit("setCountAll", 0);
this.$store.commit("setCountRun", 0); this.$store.commit("setCountRun", 0);
Api.getpoolordercount() Api.getpoolordercount()
.then(res => { .then((res) => {
if (res.success && res.result.length > 1) { if (res.success && res.result.length > 1) {
res.result.forEach(data => { res.result.forEach((data) => {
this.changeCountOut(data.poolType, data.count); this.changeCountOut(data.poolType, data.count);
}); });
} }
}) })
.catch(err => { .catch((err) => {
this.$Message.error("获取排产模型数量失败"); this.$Message.error("获取排产模型数量失败");
}); });
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
const citys = [{
"name": "北京",
"lng": 116.28,
"lat": 39.54,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "上海",
"lng": 121.29,
"lat": 31.14,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "天津",
"lng": 117.11,
"lat": 39.09,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "重庆",
"lng": 106.32,
"lat": 29.32,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "哈尔滨",
"lng": 126.41,
"lat": 45.45,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "长春",
"lng": 125.19,
"lat": 43.52,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "沈阳",
"lng": 123.24,
"lat": 41.5,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "呼和浩特",
"lng": 111.48,
"lat": 40.49,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "石家庄",
"lng": 114.28,
"lat": 38.02,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "太原",
"lng": 112.34,
"lat": 37.52,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "济南",
"lng": 117,
"lat": 36.38,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "郑州",
"lng": 113.42,
"lat": 34.48,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "西安",
"lng": 108.54,
"lat": 34.16,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "兰州",
"lng": 103.49,
"lat": 36.03,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "银川",
"lng": 106.16,
"lat": 38.2,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "西宁",
"lng": 101.45,
"lat": 36.38,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "乌鲁木齐",
"lng": 87.36,
"lat": 43.48,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "合肥",
"lng": 117.18,
"lat": 31.51,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "南京",
"lng": 118.5,
"lat": 32.02,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "杭州",
"lng": 120.09,
"lat": 30.14,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "长沙",
"lng": 113,
"lat": 28.11,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "南昌",
"lng": 115.52,
"lat": 28.41,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "武汉",
"lng": 114.21,
"lat": 30.37,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "成都",
"lng": 104.05,
"lat": 30.39,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "贵阳",
"lng": 106.42,
"lat": 26.35,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "福州",
"lng": 119.18,
"lat": 26.05,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "台北",
"lng": 121.31,
"lat": 25.03,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "广州",
"lng": 113.15,
"lat": 23.08,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "海口",
"lng": 110.2,
"lat": 20.02,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "南宁",
"lng": 108.2,
"lat": 22.48,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "昆明",
"lng": 102.41,
"lat": 25,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "拉萨",
"lng": 91.1,
"lat": 29.4,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}, {
"name": "香港",
"lng": 114.1,
"lat": 22.18,
"list": [{
"car": "CRH380A",
"count": 29
}, {
"car": "CRH381A",
"count": 9
}, {
"car": "CRH382A",
"count": 13
}, {
"car": "CRH384A",
"count": 19
}, {
"car": "CRH388A",
"count": 24
}]
}];
export default citys;
...@@ -108,39 +108,7 @@ import BmNavigation from "vue-baidu-map/components/controls/Navigation"; ...@@ -108,39 +108,7 @@ import BmNavigation from "vue-baidu-map/components/controls/Navigation";
import BmMarkerClusterer from "vue-baidu-map/components/extra/MarkerClusterer"; import BmMarkerClusterer from "vue-baidu-map/components/extra/MarkerClusterer";
import BmMarker from "vue-baidu-map/components/overlays/Marker"; import BmMarker from "vue-baidu-map/components/overlays/Marker";
import BmInfoWindow from "vue-baidu-map/components/overlays/InfoWindow"; import BmInfoWindow from "vue-baidu-map/components/overlays/InfoWindow";
const citys = `北京,116.28,39.54 import citys from "./city"
上海,121.29,31.14
天津,117.11,39.09
重庆,106.32,29.32
哈尔滨,126.41,45.45
长春,125.19,43.52
沈阳,123.24,41.50
呼和浩特,111.48,40.49
石家庄,114.28,38.02
太原,112.34,37.52
济南,117.,36.38
郑州,113.42,34.48
西安,108.54,34.16
兰州,103.49,36.03
银川,106.16,38.20
西宁,101.45,36.38
乌鲁木齐,87.36,43.48
合肥,117.18,31.51
南京,118.50,32.02
杭州,120.09,30.14
长沙,113.,28.11
南昌,115.52,28.41
武汉,114.21,30.37
成都,104.05,30.39
贵阳,106.42,26.35
福州,119.18,26.05
台北,121.31,25.03
广州,113.15,23.08
海口,110.20,20.02
南宁,108.20,22.48
昆明,102.41,25.0
拉萨,91.10,29.40
香港,114.10,22.18`;
export default { export default {
components: { components: {
BaiduMap, BaiduMap,
...@@ -279,26 +247,13 @@ export default { ...@@ -279,26 +247,13 @@ export default {
this.eye = !this.eye; this.eye = !this.eye;
let ps = []; let ps = [];
if (this.eye) { if (this.eye) {
var arr = citys.split("\n");
arr.map(u => {
let v = u.split(",");
let p = {
name: v[0],
lng: parseFloat(v[1]),
lat: parseFloat(v[2]),
list: [
{ car: "CRH380A", count: 29 },
{ car: "CRH381A", count: 9 },
{ car: "CRH382A", count: 13 },
{ car: "CRH384A", count: 19 },
{ car: "CRH388A", count: 24 }
]
};
ps.push(p); ps=citys;
});
} }
this.markers = ps; this.markers = ps;
console.warn(JSON.stringify(ps))
}, },
infoWindowOpen(e) { infoWindowOpen(e) {
this.infoWindow.show = true; this.infoWindow.show = true;
......
<template>
<div class="bm-lid">
<div class="ad">
<div class="count">
<label>配属数量(列)</label>
<span>629</span>
</div>
<div class="count">
<label>停车股道</label>
<span>250</span>
</div>
<div class="count">
<label>停产库位</label>
<span>560</span>
</div>
<div class="count">
<label>维修股道</label>
<span>38</span>
</div>
<div class="count">
<label>维修库位</label>
<span>76</span>
</div>
</div>
<div class="legend"></div>
<div class="lab">
<p>图例</p>
<div class="item">
<div class="block" v-width="60"></div>
<div class="info fg">为京泸京广服务的动车所</div>
</div>
<div class="item">
<div class="block dot" v-width="60"></div>
<div class="info fg">目前不为京泸京广服务的动车所</div>
</div>
<div class="item">
<div class="block line" v-width="60"></div>
<div class="info fg">规划中或在建动车所</div>
</div>
</div>
<baidu-map
class="map"
ak="NMVkIGzyFBL6g3ekXIZqIYMCnvz74YOc"
:center="center"
:zoom="zoom"
:maxZoom="7"
@ready="handler"
:mapStyle="my"
@click="hi"
>
<!--比例尺控件-->
<bm-scale anchor="BMAP_ANCHOR_TOP_RIGHT"></bm-scale>
<!--缩放控件-->
<bm-navigation anchor="BMAP_ANCHOR_BOTTOM_RIGHT"></bm-navigation>
<!--聚合动态添加的点坐标-->
<bm-marker-clusterer :averageCenter="true">
<bm-marker
v-for="marker of markers"
:key="marker.code"
:position="{lng: marker.lng, lat: marker.lat}"
@click="lookDetail(marker)"
color="green"
></bm-marker>
</bm-marker-clusterer>
<bm-marker :position="marker" :dragging="true" @click="lookDetail(marker)"></bm-marker>
<bm-map-type
:map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
anchor="BMAP_ANCHOR_TOP_LEFT"
></bm-map-type>
<bm-info-window
:position="{lng: infoWindow.info.lng, lat: infoWindow.info.lat}"
:title="infoWindow.info.name"
:show="infoWindow.show"
@close="infoWindowClose"
@open="infoWindowOpen"
>
<div class="pop">
<h3>
{{infoWindow.info.name}}车管所
<a @click="infoWindowClose" class="fr mr5">
<Icon type="md-close" size="24" />
</a>
</h3>
<div class="content">
<ul>
<li v-for="li in infoWindow.info.list" :key="li.car">
{{li.car}}:
<span>{{li.count}}</span>
</li>
</ul>
</div>
</div>
</bm-info-window>
</baidu-map>
</div>
</template>
<script>
import BaiduMap from "vue-baidu-map/components/map/Map.vue";
// import BMapLib from 'BMapLib';
import BmScale from "vue-baidu-map/components/controls/Scale";
import BmNavigation from "vue-baidu-map/components/controls/Navigation";
import BmMarkerClusterer from "vue-baidu-map/components/extra/MarkerClusterer";
import BmMarker from "vue-baidu-map/components/overlays/Marker";
import BmInfoWindow from "vue-baidu-map/components/overlays/InfoWindow";
import citys from '../city';
export default {
components: {
BaiduMap,
BmScale,
BmNavigation,
BmMarkerClusterer,
BmMarker,
BmInfoWindow
},
data() {
return {
center: { lng: 0, lat: 0 },
marker: {
name: "北京",
lng: 116.28,
lat: 39.54,
list: [
{ car: "CRH380A", count: 29 },
{ car: "CRH381A", count: 9 },
{ car: "CRH382A", count: 13 },
{ car: "CRH384A", count: 19 },
{ car: "CRH388A", count: 24 }
]
},
zoom: 1,
eye: false,
map: null,
infoBox: null,
my: {
styleJson: [
{
featureType: "land",
elementType: "geometry",
stylers: {
color: "#033361ff"
}
},
{
featureType: "tertiaryway",
elementType: "geometry",
stylers: {
visibility: "off"
}
},
{
featureType: "arterial",
elementType: "geometry",
stylers: {
visibility: "off"
}
},
{
featureType: "cityhighway",
elementType: "geometry",
stylers: {
visibility: "off"
}
},
{
featureType: "water",
elementType: "geometry",
stylers: {
color: "#4a90e2ff"
}
},
{
featureType: "districtlabel",
elementType: "labels",
stylers: {
visibility: "on"
}
},
{
featureType: "districtlabel",
elementType: "labels.icon",
stylers: {
visibility: "on"
}
},
{
featureType: "districtlabel",
elementType: "labels.text.stroke",
stylers: {
weight: 0,
color: "#ffffff00"
}
},
{
featureType: "districtlabel",
elementType: "labels.text.fill",
stylers: {
color: "#4a90e2ff",
weight: 10
}
},
{
featureType: "road",
elementType: "geometry",
stylers: {
visibility: "off"
}
}
]
},
map: null,
markers: [],
infoWindow: {
lng: 0,
lat: 0,
show: false,
info: {
name: "北京",
lng: 116.28,
lat: 39.54,
list: [
{ car: "CRH380A", count: 29 },
{ car: "CRH381A", count: 9 },
{ car: "CRH382A", count: 13 },
{ car: "CRH384A", count: 19 },
{ car: "CRH388A", count: 24 }
]
}
}
};
},
methods: {
handler({ BMap, map }) {
console.log(BMap, map);
this.center = "兰州";
this.zoom = 6;
map.disableDoubleClickZoom();
this.map = map;
window.map = map;
},
show() {
this.eye = !this.eye;
let ps = [];
if (this.eye) {
ps=citys;
}
this.markers = ps;
},
infoWindowOpen(e) {
this.infoWindow.show = true;
},
infoWindowClose(e) {
this.infoWindow.show = false;
},
hi(e) {
// alert(1)
console.warn("EEE", e);
},
lookDetail(data, target) {
// console.log('data',data)
this.infoWindow.show = true;
this.infoWindow.info = data;
}
}
};
</script>
<style lang="less">
@bgcolor: rgba(0, 38, 77, 0.8);
.bm-lid {
position: fixed;
width: 100%;
top: 100px;
left: 0;
right: 0;
height: calc(100vh - 100px);
.ad {
position: absolute;
width: 100%;
top: 40px;
text-align: center;
z-index: 3;
height: 60px;
color: white;
.count {
background: url("../../../assets/images/demo/bg.png");
width: 205px;
height: 55px;
display: inline-flex;
margin: 0 40px;
line-height: 55px;
label {
display: inline-block;
width: 120px;
font-size: 16px;
font-weight: bold;
text-align: right;
}
span {
display: inline-block;
width: 85px;
font-size: 32px;
font-weight: bold;
}
}
}
.legend {
position: absolute;
width: 200px;
height: 240px;
background: url("../../../assets/images/demo/legend.png") no-repeat center
rgba(0, 38, 77, 0.8);
bottom: 20px;
left: 10px;
z-index: 2;
border: 1px solid rgba(0, 38, 77, 1);
}
.eye {
position: absolute;
width: 50px;
height: 50px;
line-height: 50px;
padding-top: 5px;
text-align: center;
right: 20px;
top: 20px;
background: #00264d;
border-radius: 8px;
z-index: 10;
a {
color: #ddd;
}
a:hover {
color: white;
}
}
.lab {
position: absolute;
z-index: 5;
width: 260px;
bottom: 20px;
background: @bgcolor;
border: 1px solid black;
right: 100px;
color: white;
padding: 10px 10px 0 10px;
>p{
font-size: 14px;
font-weight: bold;
line-height: 40px;
}
.item {
.block {
height: 40px;
width: 60px;
border: 1px solid #ddd;
float: left;
margin-right: 10px;
}
.dot{
border: 1px dotted #ddd;
}
.line{
border: 1px dashed #ddd;
}
.info {
padding-left: 20px;
flex-grow: 1;
}
height: 60px;
}
}
.map {
width: 100%;
height: 100%;
.BMap_cpyCtrl,
.anchorBL {
display: none;
}
.infoBoxContent {
background: red;
}
.BMap_pop {
.BMap_center {
// background: @bgcolor;
border-width: 0;
background: transparent;
}
.BMap_bottom {
// background: @bgcolor;
display: none;
}
.BMap_top {
display: none;
}
.BMap_bubble_title {
display: none;
}
img {
display: none;
}
div:nth-child(8),
div:nth-child(5) {
display: none;
}
> div:nth-child(1) {
display: none;
div {
display: none;
}
}
> div:nth-child(2) {
display: none;
}
> div:nth-child(3) {
display: none;
}
div:nth-child(7) {
display: none;
}
.pop {
color: white;
// padding: 0 0 20px 0;
// border: 1px solid #000;
border-radius: 8px;
background: #1e4b78;
h3 {
line-height: 50px;
background: #266099;
border-radius: 8px 8px 0 0;
padding-left: 20px;
a {
color: black;
}
a:hover {
color: white;
}
}
.content {
padding: 5px 15px;
li {
line-height: 30px;
font-size: 12px;
span {
float: right;
}
}
}
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="bm-lid">
<div class="ad">
<div class="count">
<label>配属数量(列)</label>
<span>629</span>
</div>
<div class="count">
<label>停车股道</label>
<span>250</span>
</div>
<div class="count">
<label>停产库位</label>
<span>560</span>
</div>
<div class="count">
<label>维修股道</label>
<span>38</span>
</div>
<div class="count">
<label>维修库位</label>
<span>76</span>
</div>
</div>
<div class="legend"></div>
<div class="lab">
<p>图例</p>
<div class="item">
<div class="block" v-width="60"></div>
<div class="info fg">为京泸京广服务的动车所</div>
</div>
<div class="item">
<div class="block dot" v-width="60"></div>
<div class="info fg">目前不为京泸京广服务的动车所</div>
</div>
<div class="item">
<div class="block line" v-width="60"></div>
<div class="info fg">规划中或在建动车所</div>
</div>
</div>
<baidu-map
class="map"
ak="NMVkIGzyFBL6g3ekXIZqIYMCnvz74YOc"
:center="center"
:zoom="zoom"
:maxZoom="7"
@ready="handler"
:mapStyle="my"
@click="hi"
>
<!--比例尺控件-->
<bm-scale anchor="BMAP_ANCHOR_TOP_RIGHT"></bm-scale>
<!--缩放控件-->
<bm-navigation anchor="BMAP_ANCHOR_BOTTOM_RIGHT"></bm-navigation>
<!--聚合动态添加的点坐标-->
<bm-marker-clusterer :averageCenter="true">
<bm-marker
v-for="marker of markers"
:key="marker.code"
:position="{lng: marker.lng, lat: marker.lat}"
@click="lookDetail(marker)"
color="green"
></bm-marker>
</bm-marker-clusterer>
<bm-marker :position="marker" :dragging="true" @click="lookDetail(marker)"></bm-marker>
<bm-map-type
:map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
anchor="BMAP_ANCHOR_TOP_LEFT"
></bm-map-type>
<bm-info-window
:position="{lng: infoWindow.info.lng, lat: infoWindow.info.lat}"
:title="infoWindow.info.name"
:show="infoWindow.show"
@close="infoWindowClose"
@open="infoWindowOpen"
>
<div class="pop">
<h3>
{{infoWindow.info.name}}车管所
<a @click="infoWindowClose" class="fr mr5">
<Icon type="md-close" size="24" />
</a>
</h3>
<div class="content">
<ul>
<li v-for="li in infoWindow.info.list" :key="li.car">
{{li.car}}:
<span>{{li.count}}</span>
</li>
</ul>
</div>
</div>
</bm-info-window>
</baidu-map>
</div>
</template>
<script>
import BaiduMap from "vue-baidu-map/components/map/Map.vue";
// import BMapLib from 'BMapLib';
import BmScale from "vue-baidu-map/components/controls/Scale";
import BmNavigation from "vue-baidu-map/components/controls/Navigation";
import BmMarkerClusterer from "vue-baidu-map/components/extra/MarkerClusterer";
import BmMarker from "vue-baidu-map/components/overlays/Marker";
import BmInfoWindow from "vue-baidu-map/components/overlays/InfoWindow";
import citys from '../city';
export default {
components: {
BaiduMap,
BmScale,
BmNavigation,
BmMarkerClusterer,
BmMarker,
BmInfoWindow
},
data() {
return {
center: { lng: 0, lat: 0 },
marker: {
name: "北京",
lng: 116.28,
lat: 39.54,
list: [
{ car: "CRH380A", count: 29 },
{ car: "CRH381A", count: 9 },
{ car: "CRH382A", count: 13 },
{ car: "CRH384A", count: 19 },
{ car: "CRH388A", count: 24 }
]
},
zoom: 1,
eye: false,
map: null,
infoBox: null,
my: {
styleJson: [
{
featureType: "land",
elementType: "geometry",
stylers: {
color: "#033361ff"
}
},
{
featureType: "tertiaryway",
elementType: "geometry",
stylers: {
visibility: "off"
}
},
{
featureType: "arterial",
elementType: "geometry",
stylers: {
visibility: "off"
}
},
{
featureType: "cityhighway",
elementType: "geometry",
stylers: {
visibility: "off"
}
},
{
featureType: "water",
elementType: "geometry",
stylers: {
color: "#4a90e2ff"
}
},
{
featureType: "districtlabel",
elementType: "labels",
stylers: {
visibility: "on"
}
},
{
featureType: "districtlabel",
elementType: "labels.icon",
stylers: {
visibility: "on"
}
},
{
featureType: "districtlabel",
elementType: "labels.text.stroke",
stylers: {
weight: 0,
color: "#ffffff00"
}
},
{
featureType: "districtlabel",
elementType: "labels.text.fill",
stylers: {
color: "#4a90e2ff",
weight: 10
}
},
{
featureType: "road",
elementType: "geometry",
stylers: {
visibility: "off"
}
}
]
},
map: null,
markers: [],
infoWindow: {
lng: 0,
lat: 0,
show: false,
info: {
name: "北京",
lng: 116.28,
lat: 39.54,
list: [
{ car: "CRH380A", count: 29 },
{ car: "CRH381A", count: 9 },
{ car: "CRH382A", count: 13 },
{ car: "CRH384A", count: 19 },
{ car: "CRH388A", count: 24 }
]
}
}
};
},
methods: {
handler({ BMap, map }) {
console.log(BMap, map);
this.center = "兰州";
this.zoom = 6;
map.disableDoubleClickZoom();
this.map = map;
window.map = map;
},
show() {
this.eye = !this.eye;
let ps = [];
if (this.eye) {
ps=citys;
}
this.markers = ps;
},
infoWindowOpen(e) {
this.infoWindow.show = true;
},
infoWindowClose(e) {
this.infoWindow.show = false;
},
hi(e) {
// alert(1)
console.warn("EEE", e);
},
lookDetail(data, target) {
// console.log('data',data)
this.infoWindow.show = true;
this.infoWindow.info = data;
}
}
};
</script>
<style lang="less">
@bgcolor: rgba(0, 38, 77, 0.8);
.bm-lid {
position: fixed;
width: 100%;
top: 100px;
left: 0;
right: 0;
height: calc(100vh - 100px);
.ad {
position: absolute;
width: 100%;
top: 40px;
text-align: center;
z-index: 3;
height: 60px;
color: white;
.count {
background: url("../../../assets/images/demo/bg.png");
width: 205px;
height: 55px;
display: inline-flex;
margin: 0 40px;
line-height: 55px;
label {
display: inline-block;
width: 120px;
font-size: 16px;
font-weight: bold;
text-align: right;
}
span {
display: inline-block;
width: 85px;
font-size: 32px;
font-weight: bold;
}
}
}
.legend {
position: absolute;
width: 200px;
height: 240px;
background: url("../../../assets/images/demo/legend.png") no-repeat center
rgba(0, 38, 77, 0.8);
bottom: 20px;
left: 10px;
z-index: 2;
border: 1px solid rgba(0, 38, 77, 1);
}
.eye {
position: absolute;
width: 50px;
height: 50px;
line-height: 50px;
padding-top: 5px;
text-align: center;
right: 20px;
top: 20px;
background: #00264d;
border-radius: 8px;
z-index: 10;
a {
color: #ddd;
}
a:hover {
color: white;
}
}
.lab {
position: absolute;
z-index: 5;
width: 260px;
bottom: 20px;
background: @bgcolor;
border: 1px solid black;
right: 100px;
color: white;
padding: 10px 10px 0 10px;
>p{
font-size: 14px;
font-weight: bold;
line-height: 40px;
}
.item {
.block {
height: 40px;
width: 60px;
border: 1px solid #ddd;
float: left;
margin-right: 10px;
}
.dot{
border: 1px dotted #ddd;
}
.line{
border: 1px dashed #ddd;
}
.info {
padding-left: 20px;
flex-grow: 1;
}
height: 60px;
}
}
.map {
width: 100%;
height: 100%;
.BMap_cpyCtrl,
.anchorBL {
display: none;
}
.infoBoxContent {
background: red;
}
.BMap_pop {
.BMap_center {
// background: @bgcolor;
border-width: 0;
background: transparent;
}
.BMap_bottom {
// background: @bgcolor;
display: none;
}
.BMap_top {
display: none;
}
.BMap_bubble_title {
display: none;
}
img {
display: none;
}
div:nth-child(8),
div:nth-child(5) {
display: none;
}
> div:nth-child(1) {
display: none;
div {
display: none;
}
}
> div:nth-child(2) {
display: none;
}
> div:nth-child(3) {
display: none;
}
div:nth-child(7) {
display: none;
}
.pop {
color: white;
// padding: 0 0 20px 0;
// border: 1px solid #000;
border-radius: 8px;
background: #1e4b78;
h3 {
line-height: 50px;
background: #266099;
border-radius: 8px 8px 0 0;
padding-left: 20px;
a {
color: black;
}
a:hover {
color: white;
}
}
.content {
padding: 5px 15px;
li {
line-height: 30px;
font-size: 12px;
span {
float: right;
}
}
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<a class="row_more fr" @click="toivew">更多</a> <a class="row_more fr" @click="toivew">更多</a>
</p> </p>
<div class="row_card_body"> <div class="row_card_body">
<Table border :columns="columns1" :data="data1" height="220"></Table> <Table border :columns="columns1" :data="data1" height="250"></Table>
</div> </div>
</Card> </Card>
<Modal v-model="viewModal" width="800" title="详情"> <Modal v-model="viewModal" width="800" title="详情">
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
format="yyyy/MM/dd" format="yyyy/MM/dd"
type="daterange" type="daterange"
placement="bottom-end" placement="bottom-end"
placeholder="Select date" placeholder="选择日期"
style="width: 200px" style="width: 200px"
></DatePicker> ></DatePicker>
<Button type="primary">查询</Button> <Button type="primary">查询</Button>
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
} }
} }
.msg { .msg {
height: 215px; height: 245px;
overflow-y: auto; overflow-y: auto;
margin-top: 10px; margin-top: 10px;
.row-text { .row-text {
......
<template> <template>
<div class="home_box"> <div class="home">
<Card> <div class="card-user">
<div class="flex"> <div class="img-header">
<div class="user"> <img src="@/assets/images/home/user.png" />
<img src="@/assets/images/home/user.png" /> </div>
<div class="user-text"> <div class="user-text">
<p>你好:张飞,欢迎登录MES系统!</p> <p>你好:张飞,欢迎登录MES系统!</p>
<p> <p>
<span>xx公司/xx车间xx班组</span> &nbsp &nbsp <span>xx公司/xx车间xx班组</span> &nbsp &nbsp
<span>工艺技术员</span> <span>工艺技术员</span>
</p> </p>
</div> </div>
</div> <div class="incon-carousel">
<div class="fg flex"> <div class="bg-b">
<div class="left"> <Icon type="ios-arrow-back" />
<Icon type="ios-arrow-back" size="32" /> </div>
</div> <div class="bg">
<div class="fg"></div> <Icon type="ios-cube" />
<div class="right"> <p>电子对账单</p>
<Icon type="ios-arrow-forward" size="32" /> </div>
</div> <div class="bg">
<Icon type="md-mail" />
<p>站内邮件</p>
</div>
<div class="bg">
<Icon type="md-map" />
<p>站内邮件</p>
</div>
<div class="bg">
<Icon type="ios-cube" />
<p>电子对账单</p>
</div>
<div class="bg">
<Icon type="ios-cube" />
<p>电子对账单</p>
</div>
<div class="bg">
<Icon type="md-mail" />
<p>站内邮件</p>
</div>
<div class="bg">
<Icon type="md-mail" />
<p>站内邮件</p>
</div>
<div class="bg-l">
<Icon type="ios-arrow-forward" />
</div>
</div>
</div>
<div class="card-list">
<div class="bg-b">
<Icon type="ios-arrow-back" />
</div>
<Card
v-for="(item,index) in listTask"
:key="index"
:class="item.name=='物料复验' ? 'img_bg02':(item.name=='产品合格证' ? 'img_bg03':(item.name=='生产执行' ? 'img_bg04' : 'img_bg01'))"
@click.native="goPage(item)"
>
<div class="leftIco">
<img class="img_icon" :src="imgUrl + item.image" alt />
</div> </div>
<div class="text-p">
<p>{{item.totalUrl}}</p>
<p>{{item.name}}</p>
</div>
</Card>
<div class="bg-l">
<Icon type="ios-arrow-forward" />
</div> </div>
</Card> </div>
<Row class="table" :gutter="16">
<Col :span="15">
<Approval ref="approval" />
</Col>
<Col :span="9">
<UnreadMessage />
</Col>
</Row>
<div class="table">
<StaChart/>
</div>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api";
import Approval from "./component/approval";
import UnreadMessage from "./component/unreadMessage";
import StaChart from "./component/staChart";
export default { export default {
name: "", components: {
Approval,
UnreadMessage,
StaChart
},
data() { data() {
return {}; return {
listTask: [],
imgUrl: iconImg,
};
},
created() {
this.get();
},
methods: {
get() {
let list = [];
let url = `${systemUrl}/backlog/get`;
this.$api.get(url).then(r => {
list = r.result;
list.forEach(data => {
// console.log(data.totalUrl)
let ulrt = `http://${address}:` + data.totalUrl;
data.totalUrl = 0;
this.$api.get(ulrt).then(r => {
return (data.totalUrl = r.result);
});
});
console.log(list);
this.listTask = list;
});
},
goPage(u) {
// alert(u.menuUrl)
this.$router.push(u.menuUrl);
}
} }
}; };
</script> </script>
<style lang="less" scoped>
<style lang="less"> .ivu-layout-content {
.home_box { background-color: none !important;
background: rgba(245, 246, 250, 1); }
margin: -5px -10px -50px -10px; .home {
height: 100%; padding: 10px 0;
padding: 5px 10px; .card-user {
.flex{ padding: 25px 15px;
height: 90px; height: 120px;
.user{ background: rgba(255, 255, 255, 1);
width: 600px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.16);
img{ border-radius: 8px;
float: left; .img-header {
} margin-top: -8px;
float: left;
}
.user-text {
float: left;
p {
margin: 10px;
}
}
.incon-carousel {
float: right;
// margin-top: 8px;
width: 800px;
.bg-b {
float: left;
margin-top: 10px;
font-size: 30px;
color: #dcdfe6;
}
.bg-l {
float: right;
margin-top: 10px;
font-size: 30px;
color: #dcdfe6;
} }
.fg { .bg {
.left,.right{ text-align: center;
width: 50px; width: 100px;
line-height: 90px; float: left;
text-align: center; .ivu-icon {
color: #A7B8CC; font-size: 35px;
} color: #2680eb;
}
p {
margin-top: 8px;
}
} }
}
}
.card-list {
display: flex;
display: -webkit-flex;
margin-top: 15px;
justify-content: space-around;
.bg-b {
margin-top: 40px;
font-size: 30px;
color: #dcdfe6;
width: 35px;
}
.bg-l {
margin-top: 40px;
font-size: 30px;
color: #dcdfe6;
width: 35px;
}
.img_bg01 {
background-color: #ff9100;
width: 290px;
height: 130px;
cursor: pointer;
background: linear-gradient(to left, #0673df, #26c2e9);
}
.img_bg02 {
width: 290px;
height: 130px;
cursor: pointer;
background: linear-gradient(to left, #5140e9, #8a92fc);
}
.img_bg03 {
cursor: pointer;
width: 290px;
height: 130px;
background: linear-gradient(to left, #04b573, #69fc8a);
}
.img_bg04 {
cursor: pointer;
width: 290px;
height: 130px;
background: linear-gradient(to left, #6514cf, #a972fe);
}
.img_icon {
width: 40px;
height: 40px;
margin: 45% 0 0 20%;
}
.text-p {
text-align: center;
color: #fff;
padding: 2% 0 0 40%;
p:first-child {
font-size: 30px;
font-weight: bold;
margin-bottom: 5px;
}
p:nth-child(2) {
font-size: 18px;
}
}
}
.url-img {
width: 100%;
height: 370px;
background: url("../../assets/images/home/echars.png") no-repeat;
background-size: 100% 100%;
}
.table {
margin-top: 15px;
} }
} }
</style> </style>
\ No newline at end of file
<template>
<div class="home_box">
<Card>
<div class="flex">
<div class="user">
<img src="@/assets/images/home/user.png" />
<div class="user-text">
<p>你好:张飞,欢迎登录MES系统!</p>
<p>
<span>xx公司/xx车间xx班组</span> &nbsp &nbsp
<span>工艺技术员</span>
</p>
</div>
</div>
<div class="fg flex">
<div class="left">
<Icon type="ios-arrow-back" size="32" />
</div>
<div class="fg"></div>
<div class="right">
<Icon type="ios-arrow-forward" size="32" />
</div>
</div>
</div>
</Card>
</div>
</template>
<script>
export default {
name: "",
data() {
return {};
}
};
</script>
<style lang="less">
.home_box {
background: rgba(245, 246, 250, 1);
margin: -5px -10px -50px -10px;
height: 100%;
padding: 5px 10px;
.flex{
height: 90px;
.user{
width: 600px;
img{
float: left;
}
}
.fg {
.left,.right{
width: 50px;
line-height: 90px;
text-align: center;
color: #A7B8CC;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="home">
<div class="card-user">
<div class="img-header">
<img src="@/assets/images/home/user.png" />
</div>
<div class="user-text">
<p>你好:张飞,欢迎登录MES系统!</p>
<p>
<span>xx公司/xx车间xx班组</span> &nbsp &nbsp
<span>工艺技术员</span>
</p>
</div>
<div class="incon-carousel">
<div class="bg-b">
<Icon type="ios-arrow-back" />
</div>
<div class="bg">
<Icon type="ios-cube" />
<p>电子对账单</p>
</div>
<div class="bg">
<Icon type="md-mail" />
<p>站内邮件</p>
</div>
<div class="bg">
<Icon type="md-map" />
<p>站内邮件</p>
</div>
<div class="bg">
<Icon type="ios-cube" />
<p>电子对账单</p>
</div>
<div class="bg">
<Icon type="ios-cube" />
<p>电子对账单</p>
</div>
<div class="bg">
<Icon type="md-mail" />
<p>站内邮件</p>
</div>
<div class="bg">
<Icon type="md-mail" />
<p>站内邮件</p>
</div>
<div class="bg-l">
<Icon type="ios-arrow-forward" />
</div>
</div>
</div>
<div class="card-list">
<div class="bg-b">
<Icon type="ios-arrow-back" />
</div>
<Card
v-for="(item,index) in listTask"
:key="index"
:class="item.name=='物料复验' ? 'img_bg02':(item.name=='产品合格证' ? 'img_bg03':(item.name=='生产执行' ? 'img_bg04' : 'img_bg01'))"
@click.native="goPage(item)"
>
<div class="leftIco">
<img class="img_icon" :src="imgUrl + item.image" alt />
</div>
<div class="text-p">
<p>{{item.totalUrl}}</p>
<p>{{item.name}}</p>
</div>
</Card>
<div class="bg-l">
<Icon type="ios-arrow-forward" />
</div>
</div>
<Row class="table" :gutter="16">
<Col :span="15">
<Approval ref="approval" />
</Col>
<Col :span="9">
<UnreadMessage />
</Col>
</Row>
<div class="table">
<StaChart/>
</div>
</div>
</template>
<script>
import Api from "./api";
import Approval from "./component/approval";
import UnreadMessage from "./component/unreadMessage";
import StaChart from "./component/staChart";
export default {
components: {
Approval,
UnreadMessage,
StaChart
},
data() {
return {
listTask: [],
imgUrl: iconImg,
};
},
created() {
this.get();
},
methods: {
get() {
let list = [];
let url = `${systemUrl}/backlog/get`;
this.$api.get(url).then(r => {
list = r.result;
list.forEach(data => {
// console.log(data.totalUrl)
let ulrt = `http://${address}:` + data.totalUrl;
data.totalUrl = 0;
this.$api.get(ulrt).then(r => {
return (data.totalUrl = r.result);
});
});
console.log(list);
this.listTask = list;
});
},
goPage(u) {
// alert(u.menuUrl)
this.$router.push(u.menuUrl);
}
}
};
</script>
<style lang="less" scoped>
.ivu-layout-content {
background-color: none !important;
}
.home {
padding: 10px 0;
.card-user {
padding: 25px 15px;
height: 120px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.16);
border-radius: 8px;
.img-header {
margin-top: -8px;
float: left;
}
.user-text {
float: left;
p {
margin: 10px;
}
}
.incon-carousel {
float: right;
// margin-top: 8px;
width: 800px;
.bg-b {
float: left;
margin-top: 10px;
font-size: 30px;
color: #dcdfe6;
}
.bg-l {
float: right;
margin-top: 10px;
font-size: 30px;
color: #dcdfe6;
}
.bg {
text-align: center;
width: 100px;
float: left;
.ivu-icon {
font-size: 35px;
color: #2680eb;
}
p {
margin-top: 8px;
}
}
}
}
.card-list {
display: flex;
display: -webkit-flex;
margin-top: 15px;
justify-content: space-around;
.bg-b {
margin-top: 40px;
font-size: 30px;
color: #dcdfe6;
width: 35px;
}
.bg-l {
margin-top: 40px;
font-size: 30px;
color: #dcdfe6;
width: 35px;
}
.img_bg01 {
background-color: #ff9100;
width: 290px;
height: 130px;
cursor: pointer;
background: linear-gradient(to left, #0673df, #26c2e9);
}
.img_bg02 {
width: 290px;
height: 130px;
cursor: pointer;
background: linear-gradient(to left, #5140e9, #8a92fc);
}
.img_bg03 {
cursor: pointer;
width: 290px;
height: 130px;
background: linear-gradient(to left, #04b573, #69fc8a);
}
.img_bg04 {
cursor: pointer;
width: 290px;
height: 130px;
background: linear-gradient(to left, #6514cf, #a972fe);
}
.img_icon {
width: 40px;
height: 40px;
margin: 45% 0 0 20%;
}
.text-p {
text-align: center;
color: #fff;
padding: 2% 0 0 40%;
p:first-child {
font-size: 30px;
font-weight: bold;
margin-bottom: 5px;
}
p:nth-child(2) {
font-size: 18px;
}
}
}
.url-img {
width: 100%;
height: 370px;
background: url("../../assets/images/home/echars.png") no-repeat;
background-size: 100% 100%;
}
.table {
margin-top: 15px;
}
}
</style>
\ No newline at end of file
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