Commit 087f6e52 authored by renjintao's avatar renjintao

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

parents c188f9dd e3445ba4
...@@ -96,7 +96,8 @@ ...@@ -96,7 +96,8 @@
.ivu-page-item-active:hover { .ivu-page-item-active:hover {
background-color: @primary-color; background-color: @primary-color;
color: white; // background-color: #d7e8fb;
a {color: white!important;}
} }
.ivu-page-item-active>a { .ivu-page-item-active>a {
......
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
</ul> </ul>
</td> </td>
</tr> </tr>
<tr v-for="(item,i) in filterSider"> <tr v-for="(item,i) in filterSider" :key="i">
<td class="t_title"> <td class="t_title">
<b class="title">{{item.title}}</b> <b class="title">{{item.title}}</b>
</td> </td>
<td> <td>
<ul class="table_row_ul"> <ul class="table_row_ul">
<li v-for="(li) in item.children"> <li v-for="(li,i) in item.children" :key="i">
<a <a
@click="goPage(item,li)" @click="goPage(item,li)"
:class="{'active': li.id === isActive}" :class="{'active': li.id === isActive}"
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
</BreadcrumbItem> </BreadcrumbItem>
<BreadcrumbItem>{{homeMenu}}</BreadcrumbItem> <BreadcrumbItem>{{homeMenu}}</BreadcrumbItem>
<BreadcrumbItem :to="parthto" class="white">{{homeMenuItem}}</BreadcrumbItem> <BreadcrumbItem :to="parthto" class="white">{{homeMenuItem}}</BreadcrumbItem>
<Tooltip :content="content" placement="top-start" :class="showStar?'icon-show':'icom-hide'">
<Icon type="md-star" @click="shoucang" />
</Tooltip>
</Breadcrumb> </Breadcrumb>
<i-header-search v-if="showSearch && !headerMenu && !isMobile && !showBreadcrumb" /> <i-header-search v-if="showSearch && !headerMenu && !isMobile && !showBreadcrumb" />
<div class="header_right"> <div class="header_right">
...@@ -125,7 +128,7 @@ export default { ...@@ -125,7 +128,7 @@ export default {
iHeaderSetting, iHeaderSetting,
iHeaderNotice, iHeaderNotice,
iTabs, iTabs,
iHeaderBug iHeaderBug,
}, },
data() { data() {
return { return {
...@@ -136,10 +139,12 @@ export default { ...@@ -136,10 +139,12 @@ export default {
oldScrollTop: 0, oldScrollTop: 0,
isDelayHideSider: false, // hack,当从隐藏侧边栏的 header 切换到正常 header 时,防止 Logo 抖动 isDelayHideSider: false, // hack,当从隐藏侧边栏的 header 切换到正常 header 时,防止 Logo 抖动
loadRouter: true, loadRouter: true,
showStar: null,
content: "收藏",
menuId: null,
homeMenu: "", homeMenu: "",
homeMenuItem: "", homeMenuItem: "",
parthto: "" parthto: "",
}; };
}, },
computed: { computed: {
...@@ -166,7 +171,7 @@ export default { ...@@ -166,7 +171,7 @@ export default {
"showLog", "showLog",
"showI18n", "showI18n",
"showReload", "showReload",
"enableSetting" "enableSetting",
]), ]),
...mapState("admin/page", ["keepAlive"]), ...mapState("admin/page", ["keepAlive"]),
...mapGetters("admin/menu", ["hideSider", "filterSider"]), ...mapGetters("admin/menu", ["hideSider", "filterSider"]),
...@@ -193,8 +198,8 @@ export default { ...@@ -193,8 +198,8 @@ export default {
"i-layout-header-stick": this.isHeaderStick && !this.isMobile, "i-layout-header-stick": this.isHeaderStick && !this.isMobile,
"i-layout-header-with-menu": this.headerMenu, "i-layout-header-with-menu": this.headerMenu,
"i-layout-header-with-hide-sider": "i-layout-header-with-hide-sider":
this.hideSider || this.isDelayHideSider this.hideSider || this.isDelayHideSider,
} },
]; ];
}, },
headerStyle() { headerStyle() {
...@@ -206,20 +211,20 @@ export default { ...@@ -206,20 +211,20 @@ export default {
return this.isMobile || !this.headerFix return this.isMobile || !this.headerFix
? {} ? {}
: { : {
width: `calc(100% - ${menuWidth}px)` width: `calc(100% - ${menuWidth}px)`,
}; };
}, },
siderClasses() { siderClasses() {
return { return {
"i-layout-sider-fix": this.siderFix, "i-layout-sider-fix": this.siderFix,
"i-layout-sider-dark": this.siderTheme === "dark" "i-layout-sider-dark": this.siderTheme === "dark",
}; };
}, },
contentClasses() { contentClasses() {
return { return {
"i-layout-content-fix-with-header": this.headerFix, "i-layout-content-fix-with-header": this.headerFix,
"i-layout-content-with-tabs": this.tabs, "i-layout-content-with-tabs": this.tabs,
"i-layout-content-with-tabs-fix": this.tabs && this.tabsFix "i-layout-content-with-tabs-fix": this.tabs && this.tabsFix,
}; };
}, },
insideClasses() { insideClasses() {
...@@ -228,7 +233,7 @@ export default { ...@@ -228,7 +233,7 @@ export default {
"i-layout-inside-fix-with-sider-collapse": "i-layout-inside-fix-with-sider-collapse":
this.siderFix && this.menuCollapse, this.siderFix && this.menuCollapse,
"i-layout-inside-with-hide-sider": this.hideSider, "i-layout-inside-with-hide-sider": this.hideSider,
"i-layout-inside-mobile": this.isMobile "i-layout-inside-mobile": this.isMobile,
}; };
}, },
drawerClasses() { drawerClasses() {
...@@ -238,7 +243,7 @@ export default { ...@@ -238,7 +243,7 @@ export default {
}, },
menuSideWidth() { menuSideWidth() {
return this.menuCollapse ? 80 : Setting.menuSideWidth; return this.menuCollapse ? 80 : Setting.menuSideWidth;
} },
}, },
watch: { watch: {
hideSider() { hideSider() {
...@@ -248,13 +253,35 @@ export default { ...@@ -248,13 +253,35 @@ export default {
}, 0); }, 0);
}, },
$route(to, from) { $route(to, from) {
// alert(to.path)
if (to.name === from.name) { if (to.name === from.name) {
// 相同路由,不同参数,跳转时,重载页面 // 相同路由,不同参数,跳转时,重载页面
if (Setting.sameRouteForceUpdate) { if (Setting.sameRouteForceUpdate) {
this.handleReload(); this.handleReload();
} }
} }
console.warn("to-from", to, from, this.filterSider);
//获取收藏列表,判断的当前路由是否收藏
let star = false;
// console.warn("to-from======", this.$store.state.collect);
this.$store.state.collect.map((u) => {
if (u.url == to.path) {
star = true;
} else {
star = false;
}
});
this.showStar = star;
// alert(this.showStar);
//获取菜单path并与当前路由比对,获取当前菜单id
let dataTemp = this.$u.treeToList(this.filterSider);
dataTemp.forEach((data) => {
if (data.path == to.path) {
this.menuId = data.id;
} }
});
},
}, },
methods: { methods: {
...mapMutations("admin/layout", ["updateMenuCollapse"]), ...mapMutations("admin/layout", ["updateMenuCollapse"]),
...@@ -333,7 +360,30 @@ export default { ...@@ -333,7 +360,30 @@ export default {
this.homeMenu = ""; this.homeMenu = "";
this.homeMenuItem = ""; this.homeMenuItem = "";
this.isActive = 0; this.isActive = 0;
},
shoucang() {
if (this.showStar) {
let url = `${systemUrl}/favorite/delete`;
let menuId = [];
menuId.push(this.menuId);
this.$api.post(url, menuId).then((r) => {
if (r.success) {
this.showStar = false;
this.$Message.success("已取消收藏");
this.content = "收藏";
} }
});
} else {
let url = `${systemUrl}/favorite/create`;
this.$api.post(url, { menuId: this.menuId }).then((r) => {
if (r.result) {
this.showStar = true;
this.$Message.success("收藏成功");
this.content = "取消收藏";
}
});
}
},
}, },
mounted() { mounted() {
document.addEventListener("scroll", this.handleScroll, { passive: true }); document.addEventListener("scroll", this.handleScroll, { passive: true });
...@@ -343,7 +393,7 @@ export default { ...@@ -343,7 +393,7 @@ export default {
}, },
created() { created() {
if (this.isTablet && this.showSiderCollapse) this.updateMenuCollapse(true); if (this.isTablet && this.showSiderCollapse) this.updateMenuCollapse(true);
} },
}; };
</script> </script>
...@@ -507,5 +557,14 @@ export default { ...@@ -507,5 +557,14 @@ export default {
line-height: 50px; line-height: 50px;
} }
} }
.icon-show {
color: #2680eb;
font-size: 20px;
cursor: pointer;
}
.icom-hide {
cursor: pointer;
font-size: 20px;
}
} }
</style> </style>
\ No newline at end of file
...@@ -4,6 +4,9 @@ export default { ...@@ -4,6 +4,9 @@ export default {
paged(params) { paged(params) {
return Api.get(`${apsUrl}/scheduletotal/getall`, params); return Api.get(`${apsUrl}/scheduletotal/getall`, params);
}, },
getalldetails(params) {
return Api.get(`${apsUrl}/scheduletotal/getalldetails`, params);
},
getall(params) { getall(params) {
return Api.get(`${apsUrl}/schema/getall`, params); return Api.get(`${apsUrl}/schema/getall`, params);
}, },
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<ul class="right_ul"> <ul class="right_ul">
<li class="right_ul_title"> <li class="right_ul_title">
<span class="case">{{li.scheduleId}}</span> <span class="case">{{li.scheduleId}}</span>
<span class="case_time">2020-03-22 13:26:35</span> <span class="case_time">{{li.planDate}}&nbsp;</span>
</li> </li>
<li>{{li.deferNum}}&nbsp;</li> <li>{{li.deferNum}}&nbsp;</li>
<li>{{li.deferTime}}&nbsp;</li> <li>{{li.deferTime}}&nbsp;</li>
...@@ -101,8 +101,15 @@ export default { ...@@ -101,8 +101,15 @@ export default {
items(){ items(){
var items=[]; var items=[];
this.schemas.map(p=>{ this.schemas.map(p=>{
if(this.list.length>0){
var info=this.list.filter(u=>u.scheduleId==p.schedule_Id)[0]; var info=this.list.filter(u=>u.scheduleId==p.schedule_Id)[0];
items.push(info); items.push(info);
items.forEach(itr=>{
if(itr.scheduleId==p.schedule_Id){
itr.planDate = p.plan_Date
}
})
}else{ return }
}) })
return items; return items;
} }
......
<template> <template>
<div class="q-pa-sm"> <div class="q-pa-sm">
<div class="pr mt50" v-if="tasks.length==0" > <div class="pr mt50" v-if="tasks.length==0">
<Spin size="large" fix ></Spin> <Spin size="large" fix></Spin>
</div> </div>
<gantt-elastic <gantt-elastic
...@@ -58,7 +58,7 @@ let tasks = [ ...@@ -58,7 +58,7 @@ let tasks = [
start: getDate(-24 * 5), start: getDate(-24 * 5),
duration: 15 * 24 * 60 * 60 * 1000, duration: 15 * 24 * 60 * 60 * 1000,
percent: 85, percent: 85,
type: "project" type: "project",
//collapsed: true, //collapsed: true,
}, },
{ {
...@@ -75,9 +75,9 @@ let tasks = [ ...@@ -75,9 +75,9 @@ let tasks = [
style: { style: {
base: { base: {
fill: "#1EBC61", fill: "#1EBC61",
stroke: "#0EAC51" stroke: "#0EAC51",
} },
} },
}, },
{ {
id: 3, id: 3,
...@@ -88,7 +88,7 @@ let tasks = [ ...@@ -88,7 +88,7 @@ let tasks = [
start: getDate(-24 * 3), start: getDate(-24 * 3),
duration: 2 * 24 * 60 * 60 * 1000, duration: 2 * 24 * 60 * 60 * 1000,
percent: 100, percent: 100,
type: "task" type: "task",
}, },
{ {
id: 4, id: 4,
...@@ -99,7 +99,7 @@ let tasks = [ ...@@ -99,7 +99,7 @@ let tasks = [
duration: 2 * 24 * 60 * 60 * 1000, duration: 2 * 24 * 60 * 60 * 1000,
percent: 50, percent: 50,
type: "task", type: "task",
dependentOn: [3] dependentOn: [3],
}, },
{ {
id: 5, id: 5,
...@@ -114,9 +114,9 @@ let tasks = [ ...@@ -114,9 +114,9 @@ let tasks = [
style: { style: {
base: { base: {
fill: "#0287D0", fill: "#0287D0",
stroke: "#0077C0" stroke: "#0077C0",
} },
} },
}, },
{ {
id: 6, id: 6,
...@@ -132,9 +132,9 @@ let tasks = [ ...@@ -132,9 +132,9 @@ let tasks = [
style: { style: {
base: { base: {
fill: "#8E44AD", fill: "#8E44AD",
stroke: "#7E349D" stroke: "#7E349D",
} },
} },
}, },
{ {
id: 7, id: 7,
...@@ -147,7 +147,7 @@ let tasks = [ ...@@ -147,7 +147,7 @@ let tasks = [
duration: 4 * 60 * 60 * 1000, duration: 4 * 60 * 60 * 1000,
percent: 20, percent: 20,
type: "task", type: "task",
collapsed: true collapsed: true,
}, },
{ {
id: 8, id: 8,
...@@ -159,7 +159,7 @@ let tasks = [ ...@@ -159,7 +159,7 @@ let tasks = [
start: getDate(24 * 3), start: getDate(24 * 3),
duration: 1 * 24 * 60 * 60 * 1000, duration: 1 * 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task" type: "task",
}, },
{ {
id: 9, id: 9,
...@@ -175,9 +175,9 @@ let tasks = [ ...@@ -175,9 +175,9 @@ let tasks = [
style: { style: {
base: { base: {
fill: "#8E44AD", fill: "#8E44AD",
stroke: "#7E349D" stroke: "#7E349D",
} },
} },
}, },
{ {
id: 10, id: 10,
...@@ -187,7 +187,7 @@ let tasks = [ ...@@ -187,7 +187,7 @@ let tasks = [
start: getDate(24 * 5), start: getDate(24 * 5),
duration: 24 * 60 * 60 * 1000, duration: 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task" type: "task",
}, },
{ {
id: 11, id: 11,
...@@ -197,7 +197,7 @@ let tasks = [ ...@@ -197,7 +197,7 @@ let tasks = [
start: getDate(24 * 6), start: getDate(24 * 6),
duration: 24 * 60 * 60 * 1000, duration: 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task" type: "task",
}, },
{ {
id: 12, id: 12,
...@@ -208,7 +208,7 @@ let tasks = [ ...@@ -208,7 +208,7 @@ let tasks = [
duration: 24 * 60 * 60 * 1000, duration: 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task", type: "task",
parentId: 11 parentId: 11,
}, },
{ {
id: 13, id: 13,
...@@ -218,7 +218,7 @@ let tasks = [ ...@@ -218,7 +218,7 @@ let tasks = [
start: getDate(24 * 8), start: getDate(24 * 8),
duration: 24 * 60 * 60 * 1000, duration: 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task" type: "task",
}, },
{ {
id: 14, id: 14,
...@@ -228,7 +228,7 @@ let tasks = [ ...@@ -228,7 +228,7 @@ let tasks = [
start: getDate(24 * 9), start: getDate(24 * 9),
duration: 24 * 60 * 60 * 1000, duration: 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task" type: "task",
}, },
{ {
id: 15, id: 15,
...@@ -238,45 +238,45 @@ let tasks = [ ...@@ -238,45 +238,45 @@ let tasks = [
start: getDate(24 * 16), start: getDate(24 * 16),
duration: 24 * 60 * 60 * 1000, duration: 24 * 60 * 60 * 1000,
percent: 0, percent: 0,
type: "task" type: "task",
} },
]; ];
let options = { let options = {
taskMapping: { taskMapping: {
progress: "percent" progress: "percent",
}, },
maxRows: 100, maxRows: 100,
maxHeight: 500, maxHeight: 500,
title: { title: {
label: "Your project title as html (link or whatever...)", label: "Your project title as html (link or whatever...)",
html: false html: false,
}, },
row: { row: {
height: 24 height: 24,
}, },
calendar: { calendar: {
hour: { hour: {
display: true display: true,
} },
}, },
chart: { chart: {
progress: { progress: {
bar: false bar: false,
}, },
expander: { expander: {
display: true display: true,
} },
}, },
taskList: { taskList: {
expander: { expander: {
straight: false straight: false,
}, },
columns: [ columns: [
{ {
id: 1, id: 1,
label: "ID", label: "ID",
value: "id", value: "id",
width: 40 width: 40,
}, },
{ {
id: 2, id: 2,
...@@ -288,64 +288,64 @@ let options = { ...@@ -288,64 +288,64 @@ let options = {
events: { events: {
click({ data, column }) { click({ data, column }) {
this.$Message.info(data.name); this.$Message.info(data.name);
} },
} },
}, },
{ {
id: 3, id: 3,
label: "设备编号", label: "设备编号",
value: "EquipmentNo", value: "EquipmentNo",
width: 160, width: 160,
html: true html: true,
}, },
{ {
id: 4, id: 4,
label: "计划开始时间", label: "计划开始时间",
value: task => dayjs(task.start).format("YYYY-MM-DD"), value: (task) => dayjs(task.start).format("YYYY-MM-DD"),
width: 100 width: 100,
}, },
{ {
id: 5, id: 5,
label: "计划结束时间", label: "计划结束时间",
value: task => dayjs(task.endTime).format("YYYY-MM-DD"), value: (task) => dayjs(task.endTime).format("YYYY-MM-DD"),
width: 100 width: 100,
}, },
{ {
id: 6, id: 6,
label: "计划数量", label: "计划数量",
value: "plan_qty", value: "plan_qty",
width: 68 width: 68,
}, },
{ {
id: 7, id: 7,
label: "投入数量", label: "投入数量",
value: "put_into_qty", value: "put_into_qty",
width: 68 width: 68,
}, },
{ {
id: 8, id: 8,
label: "派工数量", label: "派工数量",
value: "dispatch_qty", value: "dispatch_qty",
width: 68 width: 100,
},
{
id: 9,
label: "%",
value: "progress",
width: 35,
style: {
"task-list-header-label": {
"text-align": "center",
width: "100%"
}, },
"task-list-item-value-container": { // {
"text-align": "center", // id: 9,
width: "100%" // label: "%",
} // value: "progress",
} // width: 35,
} // style: {
] // "task-list-header-label": {
// "text-align": "center",
// width: "100%",
// },
// "task-list-item-value-container": {
// "text-align": "center",
// width: "100%",
// },
// },
// },
],
}, },
locale: { locale: {
weekdays: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], weekdays: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
...@@ -361,8 +361,8 @@ let options = { ...@@ -361,8 +361,8 @@ let options = {
"九月", "九月",
"十月", "十月",
"十一月", "十一月",
"十二月" "十二月",
] ],
// name: "en", // name: "en",
// Now: "Now", // Now: "Now",
// "X-Scale": "Zoom-X", // "X-Scale": "Zoom-X",
...@@ -370,25 +370,25 @@ let options = { ...@@ -370,25 +370,25 @@ let options = {
// "Task list width": "Task list", // "Task list width": "Task list",
// "Before/After": "Expand", // "Before/After": "Expand",
// "Display task list": "Task list" // "Display task list": "Task list"
} },
}; };
export default { export default {
name: "Gantt", name: "Gantt",
components: { components: {
GanttElastic, GanttElastic,
GanttHeader GanttHeader,
}, },
props: { props: {
id: String id: String,
}, },
data() { data() {
return { return {
tasks:[], tasks: [],
options, options,
dynamicStyle: {}, dynamicStyle: {},
lastId: 16 lastId: 16,
}; };
}, },
created() { created() {
...@@ -399,62 +399,55 @@ export default { ...@@ -399,62 +399,55 @@ export default {
methods: { methods: {
gantData() { gantData() {
if (this.id) { if (this.id) {
Api.paged({ scheduleId: this.id }) Api.getalldetails({ scheduleId: this.id })
.then(r => { .then((r) => {
if (r.result) { if (r.result) {
var parentId = r.result[0].id; //父级id
var list = []; var list = [];
r.result.map((u) => {
var parentId = u.id; //父级id
var obj = { var obj = {
id: r.result[0].id, id: u.id,
// parentId: 0, // parentId: 0,
name: r.result[0].part_name, name: u.part_name,
start:GetTimeByTimeStr(r.result[0].plan_start) , start: GetTimeByTimeStr(u.plan_start),
// endTime: GetTimeByTimeStr(r.result[0].plan_finish), // endTime: GetTimeByTimeStr(r.result[0].plan_finish),
EquipmentNo: "/", EquipmentNo: "/",
duration: GetTimeByTimeStr(r.result[0].plan_finish)-GetTimeByTimeStr(r.result[0].plan_start), duration:
GetTimeByTimeStr(u.plan_finish) -
GetTimeByTimeStr(u.plan_start),
percent: 85, percent: 85,
plan_qty: r.result[0].plan_qty, plan_qty: u.plan_qty,
put_into_qty: "/", put_into_qty: "/",
dispatch_qty: "/", dispatch_qty: "/",
type: "project" type: "project",
}; };
list.push(obj); list.push(obj);
Api.getdetail({ if (u.children) {
part_task_pk: r.result[0].id, u.children.map((p,i) => {
scheduleId: this.id var start = GetTimeByTimeStr(p.plan_start);
}).then(r => { var jg = GetTimeByTimeStr(p.plan_finish) - start;
if (r.result) {
for (var i = 0; i < r.result.length; i++) {
var start=GetTimeByTimeStr(r.result[i].plan_start);
var jg= GetTimeByTimeStr(r.result[i].plan_finish)- start;
let temp = { let temp = {
id: r.result[i].op_task_pk, id: p.op_task_pk,
name: r.result[i].task_name, name:p.task_name,
EquipmentNo: r.result[i].equip_id, EquipmentNo:p.equip_id,
// parentId: i<5?parentId:368,
parentId: parentId, parentId: parentId,
// start: r.result[i].plan_start,
// endTime: r.result[i].plan_finish,
// endTime: "2020-7-30",
start: start, start: start,
duration: jg, duration: jg,
percent: i*9, percent: i * 9,
put_into_qty: r.result[i].put_into_qty, put_into_qty:p.put_into_qty,
dispatch_qty: r.result[i].dispatch_qty, dispatch_qty:p.dispatch_qty,
type:i%2?"task":'milestone', type: i % 2 ? "task" : "milestone",
// type: "milestone",
}; };
list.push(temp); list.push(temp);
} });
this.tasksUpdate(list);
console.warn(list)
} }
}); });
this.tasksUpdate(list);
} }
}) })
.catch(error => { .catch((error) => {
this.$Message.error("请求失败"); console.warn("err",error)
this.$Message.error("请求失败222");
}); });
} }
}, },
...@@ -468,7 +461,7 @@ export default { ...@@ -468,7 +461,7 @@ export default {
start: getDate(24 * 3), start: getDate(24 * 3),
duration: 1 * 24 * 60 * 60 * 1000, duration: 1 * 24 * 60 * 60 * 1000,
percent: 50, percent: 50,
type: "project" type: "project",
}); });
}, },
tasksUpdate(tasks) { tasksUpdate(tasks) {
...@@ -481,7 +474,7 @@ export default { ...@@ -481,7 +474,7 @@ export default {
}, },
styleUpdate(style) { styleUpdate(style) {
this.dynamicStyle = style; this.dynamicStyle = style;
} },
} },
}; };
</script> </script>
...@@ -22,7 +22,5 @@ export default { ...@@ -22,7 +22,5 @@ export default {
list(params) { list(params) {
return Api.post(`${systemUrl}/newmessage/list`, params); //获取列表信息 return Api.post(`${systemUrl}/newmessage/list`, params); //获取列表信息
}, },
favoriteList(params) {
return Api.post(`${systemUrl}/favorite/list`, params); //获取收藏列表信息
},
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="user-text"> <div class="user-text">
<p>你好:{{userData.userName}},欢迎登录MES系统!</p> <p>你好:{{userData.userName}},欢迎登录MES系统!</p>
<p> <p>
<span>{{userData.departmentTitle}}</span> &nbsp &nbsp <span class="mr20">{{userData.departmentTitle}}</span>
<span>{{userData.roleTitles}}</span> <span>{{userData.roleTitles}}</span>
</p> </p>
</div> </div>
...@@ -16,37 +16,9 @@ ...@@ -16,37 +16,9 @@
<div class="bg-b"> <div class="bg-b">
<Icon type="ios-arrow-back" /> <Icon type="ios-arrow-back" />
</div> </div>
<!-- <div class="bg" v-for="(item,index) in listFavorite" :key="index"> <div class="bg" v-for="(item,i) in collect" :key="i" @click="toPage(item)">
<Icon :type="item.icon" /> <Icon :type="item.icon||'md-mail'" />
<p>{{item.title}}</p> <p>{{item.title}}</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-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>
<div class="bg-l"> <div class="bg-l">
<Icon type="ios-arrow-forward" /> <Icon type="ios-arrow-forward" />
...@@ -93,7 +65,7 @@ import Api from "./api"; ...@@ -93,7 +65,7 @@ import Api from "./api";
import Approval from "./component/approval"; import Approval from "./component/approval";
import UnreadMessage from "./component/unreadMessage"; import UnreadMessage from "./component/unreadMessage";
import StaChart from "./component/staChart"; import StaChart from "./component/staChart";
import { mapState } from "vuex";
export default { export default {
components: { components: {
Approval, Approval,
...@@ -110,10 +82,17 @@ export default { ...@@ -110,10 +82,17 @@ export default {
imgPath: true, imgPath: true,
}; };
}, },
async fetch({ store, params }) {
await store.dispatch("collectList"); // 加载数据字典
},
created() { created() {
this.get(); this.get();
this.getUserInfoFn(); this.getUserInfoFn();
this.getList(); console.log(this.$store.state.collect);
// this.getList();
},
computed: {
...mapState({ collect: "collect" }),
}, },
methods: { methods: {
getUserInfoFn() { getUserInfoFn() {
...@@ -139,27 +118,24 @@ export default { ...@@ -139,27 +118,24 @@ export default {
this.$api.get(url).then((r) => { this.$api.get(url).then((r) => {
list = r.result; list = r.result;
list.forEach((data) => { list.forEach((data) => {
// console.log(data.totalUrl) console.log(data.totalUrl);
let ulrt = `http://${address}:` + data.totalUrl; let ulrt = `http://${address}:` + data.totalUrl;
data.totalUrl = 0; data.totalUrl = 0;
this.$api.get(ulrt).then((r) => { this.$api.get(ulrt).then((r) => {
return (data.totalUrl = r.result); return (data.totalUrl = r.result);
}); });
}); });
console.log(list);
this.listTask = list; this.listTask = list;
}); });
}, },
getList() {
let conditions = [];
Api.favoriteList({ conditions: conditions }).then((r) => {
this.listFavorite = r.result;
});
},
goPage(u) { goPage(u) {
// alert(u.menuUrl)
this.$router.push(u.menuUrl); this.$router.push(u.menuUrl);
}, },
toPage(u) {
this.$router.push(u.url);
},
}, },
}; };
</script> </script>
...@@ -207,11 +183,12 @@ export default { ...@@ -207,11 +183,12 @@ export default {
} }
.bg { .bg {
text-align: center; text-align: center;
width: 100px; width: 120px;
float: left; float: left;
.ivu-icon { .ivu-icon {
font-size: 35px; font-size: 35px;
color: #2680eb; color: #2680eb;
cursor: pointer;
} }
p { p {
margin-top: 8px; margin-top: 8px;
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
formItem: { formItem: {
equip_name: "", equip_name: "",
equip_id: "", equip_id: "",
isimportant: "", isimportant: 1,
capabilityValue: "" capabilityValue: ""
}, },
formItem1: { formItem1: {
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
this.formItem.equip_name = r.result.title; this.formItem.equip_name = r.result.title;
this.formItem.equip_id = r.result.code; this.formItem.equip_id = r.result.code;
this.formItem.capabilityValue = r.result.capabilityValue; this.formItem.capabilityValue = r.result.capabilityValue;
this.formItem.isimportant = r.result.isimportant + ""; this.formItem.isimportant = r.result.isimportant || "1";
this.formItem1.calendarwork_pk = r.result.calKey; this.formItem1.calendarwork_pk = r.result.calKey;
this.formItem2.calendarovertime_pk = r.result.holidayKey; this.formItem2.calendarovertime_pk = r.result.holidayKey;
this.formItem1.equip_pk = r.result.id; this.formItem1.equip_pk = r.result.id;
......
...@@ -14,12 +14,7 @@ export default { ...@@ -14,12 +14,7 @@ export default {
data() { data() {
return { return {
data1: [], data1: [],
// easySearch: {
// keys: { op: "unicode,name,code", value: null },
// },
columns: [ columns: [
// { type: "selection", width: 70, align: "center" },
{ {
title: "#", title: "#",
type: "index", type: "index",
......
...@@ -11,6 +11,7 @@ export const state = () => ({ ...@@ -11,6 +11,7 @@ export const state = () => ({
}, },
departments:{},//部门列表 departments:{},//部门列表
cart: [], cart: [],
collect:[],//用户收藏
count: 0, count: 0,
countAps: 0, //aps排产 countAps: 0, //aps排产
countAi: 0, //智能排产 countAi: 0, //智能排产
...@@ -66,6 +67,9 @@ export const mutations = { ...@@ -66,6 +67,9 @@ export const mutations = {
addUser(state, user) { addUser(state, user) {
state.userMap.push(user); state.userMap.push(user);
}, },
setCollect(state, collectData) {
state.collect = collectData;
},
setDictionary(state, dictionary) { setDictionary(state, dictionary) {
state.dictionary = dictionary; state.dictionary = dictionary;
}, },
...@@ -94,6 +98,16 @@ export const mutations = { ...@@ -94,6 +98,16 @@ export const mutations = {
} }
export const actions = { export const actions = {
async collectList({
commit
}) {
let {
result
} = await Api.post(`${systemUrl}/favorite/listbyuser`);
console.warn("result", result)
commit("setCollect", result);
},
async loadUser({ async loadUser({
commit commit
}, key) { }, key) {
......
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