Commit 9d9aafa5 authored by renjintao's avatar renjintao

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

parents a3f9bc47 654eec09
......@@ -128,7 +128,8 @@ export default {
});
// setUserInfo
this.$store.commit("setUserInfo", info);
this.$router.replace(this.$route.query.redirect || "/");
this.$router.replace('/welcome')
// this.$router.replace(this.$route.query.redirect || "/");
} else {
this.$Message.error("用户信息22查询失败!");
}
......
......@@ -26,13 +26,17 @@ export default {
}
});
},
///projecttemplate/list
templates(params){
return Api.post(`${material}/projecttemplate/list`,params)
},
saveTemplate(params){
return Api.post('projecttemplate/create',params)
return Api.post(`${material}/projectplan/createtemplate`,params)
},
useTemplate(params){
return Api.post('projecttemplate/usetemplate',params)
return Api.post(`${material}/projectplan/usetemplate`,params)
},
deletes(params) {
return Api.post(`${material}/projectplan/batchdelete`, params);
return Api.post(`${material}/projectplan/usetemplate`, params);
}
}
<template>
<div>
<EditGrid :columns="columns" ref="grid" :items="list"
>
</EditGrid>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "list",
head: {
title: "",
author: "henq",
description: "project_template 10/29/2020 5:40:26 PM",
},
data() {
return {
curId: 0,
list:[],
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
},
{
key: "note",
title: this.l("note"),
align: "left",
high: true,
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
code: "project.task.Type",
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
type: "user",
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "remove",msg:"确定要导入模版吗?" },
on: { click: () => this.useTemplate(params.row.id) },
},
"导入"
),
// h(
// "op",
// {
// attrs: { oprate: "delete" },
// on: { click: () => this.remove(params.row.id) },
// },
// "删除"
// ),
]);
},
},
],
};
},
mounted() {
this.load();
},
props: {
v: Object,
eid: String,
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = "";
},
load() {
Api.templates({
}).then(r=>{
this.list=r.result;
})
},
useTemplate(id) {
Api.useTemplate({
id:id,
projectId:this.eid
}).then(r=>{
if(r.success){
this.$Message.success("导入成功");
this.$emit("on-load")
}
})
},
l(key) {
let vkey = "project_template" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
......@@ -397,6 +397,13 @@ export default {
that.title = "保存模版";
that.detail = () => import("./saveTemplate");
that.modal = true;
},
useTemplate(name){
that.curId = that.eid;
that.row = that.data;
that.title = "导入模版";
that.detail = () => import("./importTemplate");
that.modal = true;
}
}
m[name]&&m[name](name);
......
......@@ -47,19 +47,15 @@ export default {
eid: String,
},
mounted() {
if (this.eid ) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
Api.create(this.entity)
Api.saveTemplate(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
......
......@@ -107,8 +107,8 @@ export default {
high: true,
},
{
key: "attachment",
title: this.l("attachment"),
key: "note",
title: this.l("note"),
align: "left",
high: true,
},
......@@ -117,9 +117,29 @@ export default {
title: this.l("type"),
align: "left",
high: true,
code:"project.task.level"
// code: "mes.project_template.Type",
code: "project.task.level",
// code: "mes.project_template.Type",
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
type: "user",
},
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
title: "操作",
key: "action",
......@@ -210,22 +230,6 @@ export default {
this.modal = false;
},
l(key) {
/*
project_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'请注意',
template:'模板',
attachment:'附件',
type:'模版类型',
}
*/
let vkey = "project_template" + "." + key;
return this.$t(vkey) || key;
},
......
<template>
<div class="router-main flex fc-m fa-m">
<div class="bdImg pr" @click="pageClick">
<div
class="one pa cursor"
:class="{ oneHover: oneShow && isIndex == index }"
v-for="(item, index) in arrList"
:key="index"
v-bind:style="item.style"
@mouseenter="getPosition(item, index)"
></div>
<div class="pa menu" v-bind:style="menuPos" v-show="menu">
<ul class="bdTitleBox" @mouseleave="leavePosition">
<li
class="lh40 f14 tc testBtn cursor fw5"
v-for="(v, i) in list"
:key="i"
@click="clickLi(v)"
>
{{ v.name }}
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
import { isInteger } from "lodash";
export default {
layout: "empty",
data() {
return {
list: [],
arrList: [],
// arrList: [
// {
// name: "设计区",
// style: {
// top: "247px",
// left: "280px",
// height: "40px",
// width: "80px",
// // border: " 1px solid red",
// transform: " rotate(-13deg) skew(-74deg, 42deg)",
// },
// list: [
// { name: "物料编码" },
// { name: "物料分类" },
// { name: "物料管理" },
// ],
// },
// {
// name: "工艺区",
// style: {
// top: "319px",
// left: "405px",
// height: "40px",
// width: "80px",
// // border: " 1px solid red",
// transform: " rotate(-13deg) skew(-74deg, 42deg)",
// },
// list: [
// { name: "产品管理" },
// { name: "工艺规程" },
// { name: "工艺设置" },
// ],
// },
// {
// name: "市场处",
// style: {
// top: "570px",
// left: "293px",
// height: "40px",
// width: "80px",
// // border: " 1px solid red",
// transform: " rotate(-13deg) skew(-74deg, 42deg)",
// },
// list: [
// { name: "客户管理" },
// { name: "项目管理" },
// { name: "销售管理" },
// { name: "合同管理" },
// ],
// },
// // {
// // name: "管理区",
// // style: {
// // top: "677px",
// // left: "102px",
// // height: "40px",
// // width: "80px",
// // // border: " 1px solid red",
// // transform: " rotate(-13deg) skew(-74deg, 42deg)",
// // },
// // list: [
// // { name: "设备类型" },
// // { name: "设备管理" },
// // { name: "排产资源" },
// // ],
// // },
// {
// name: "综合生产处",
// style: {
// top: "467px",
// left: "440px",
// height: "33px",
// width: "75px",
// // border: " 1px solid red",
// transform: " rotate(197deg) skew(77deg,134deg)",
// },
// list: [
// { name: "订单管理" },
// { name: "订单监控" },
// { name: "订单报价" },
// ],
// },
// {
// name: "生产班组派工",
// style: {
// top: "513px",
// left: "757px",
// height: "33px",
// width: "75px",
// // border: " 1px solid red",
// transform: " rotate(197deg) skew(77deg,134deg)",
// },
// list: [{ name: "班组派工" }],
// },
// {
// name: "设备管理",
// style: {
// top: "638px",
// left: "947px",
// height: "33px",
// width: "75px",
// // border: " 1px solid red",
// transform: " rotate(197deg) skew(77deg,134deg)",
// },
// list: [
// { name: "设备类型" },
// { name: "设备管理" },
// { name: "排产资源" },
// ],
// },
// {
// name: "质检",
// style: {
// top: "186px",
// left: "1304px",
// height: "33px",
// width: "75px",
// // border: " 1px solid red",
// transform: " rotate(197deg) skew(77deg,134deg)",
// },
// list: [
// { name: "原材料复检" },
// { name: "质量检验" },
// { name: "数据包追溯" },
// { name: "产品合格证" },
// ],
// },
// {
// name: "原料仓库",
// style: {
// top: "216px",
// left: "646px",
// height: "79px",
// width: "175px",
// // border: " 1px solid red",
// transform: " rotate(-11deg) skew(-72deg, 41deg)",
// },
// list: [
// { name: "库房位置" },
// { name: "物料管理" },
// { name: "料单配套" },
// { name: "制造资源" },
// ],
// },
// {
// name: "车间计调",
// style: {
// top: "380px",
// left: "553px",
// height: "33px",
// width: "81px",
// // border: " 1px solid red",
// transform: " rotate(-12deg) skew(-72deg, 41deg)",
// },
// list: [
// { name: "计划管理" },
// { name: "排产结果" },
// ],
// },
// {
// name: "组件区",
// style: {
// top: "293px",
// left: "949px",
// height: "144px",
// width: "232px",
// // border: " 1px solid red",
// transform: " rotate(-11deg) skew(-71deg, 40deg)",
// },
// list: [{ name: "工单执行" }, { name: "转序交接" }],
// },
// ],
isIndex: -1,
oneShow: false,
menu: false,
menuPos: {
top: "0",
left: "0",
},
};
},
mounted() {
this.load();
},
methods: {
load() {
this.$api.get(`${systemUrl}/menu/getusermenu?id=mes_roter`).then((r) => {
if (r.result) {
let arr = r.result[0].children.map((l) => {
if (
!this.$u.isNull(l.description) &&
l.description.indexOf("{") > -1
) {
l.style = eval("(" + l.description + ")");
}
return l;
});
console.log("arr", arr);
this.arrList = arr;
}
});
},
pageClick() {
this.menu = false;
this.oneShow = false;
},
clickLi(v) {
if (v) {
this.$router.push(v.url);
}
this.menu = false;
},
getPosition(item, index) {
if (item) {
this.isIndex = index;
this.oneShow = true;
this.list = item.children;
this.menu = true;
var { left, top } = item.style;
this.menuPos = { left, top };
}
},
leavePosition() {
this.oneShow = false;
this.menu = false;
},
},
};
</script>
<style lang="less" scoped>
.router-main {
height: 100%;
.oneHover {
border: 2px dotted #0868da;
}
.bdImg {
height: 822px;
width: 1700px;
background: url("../../assets/images/home/router/routerMain.png") no-repeat;
}
.menu {
width: 100px;
z-index: 999;
transform: translateX(-100px);
border-radius: 4px;
}
.bdTitleBox {
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.5);
li {
color: #232323;
height: 32px;
line-height: 32px;
width: 100px;
}
li:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
li:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
}
}
.testBtn {
background: rgba(255, 255, 255, 0.8);
}
.testBtn:hover {
background: rgba(38, 128, 235, 0.4);
}
</style>
\ No newline at end of file
......@@ -14,16 +14,15 @@ export default {
},
meta,
component: BasicLayout,
children: [
{
path: 'console',
name: `${pre}console`,
meta: {
...meta,
title: '主控台',
closable: false
},
component: () => import('@/pages/dashboard/console')
}
]
};
children: [{
path: 'console',
name: `${pre}console`,
meta: {
...meta,
title: '主控台',
closable: false
},
component: () =>
import ('@/pages/dashboard/console')
}]
};
\ No newline at end of file
......@@ -5,16 +5,14 @@ import BasicLayout from '@/layouts/basic-layout';
* 在主框架内显示22222222222222
*/
const frameIn = [
{
const frameIn = [{
path: '/',
// redirect: {
// name: ''
// // name: 'dashboard-console'
// },
component: BasicLayout,
children: [
{
children: [{
path: 'index',
name: 'index',
meta: {
......@@ -32,7 +30,8 @@ const frameIn = [
title: '前端日志',
auth: true
},
component: () => import('@/pages/system/log')
component: () =>
import ('@/pages/system/log')
},
{
path: '/hello',
......@@ -41,7 +40,8 @@ const frameIn = [
title: 'hello',
auth: true
},
component: () => import('@/pages/system/log')
component: () =>
import ('@/pages/system/log')
},
// 刷新页面 必须保留
{
......@@ -49,7 +49,7 @@ const frameIn = [
name: 'refresh',
hidden: true,
component: {
beforeRouteEnter (to, from, next) {
beforeRouteEnter(to, from, next) {
next(instance => instance.$router.replace(from.fullPath));
},
render: h => h()
......@@ -61,7 +61,7 @@ const frameIn = [
name: 'redirect',
hidden: true,
component: {
beforeRouteEnter (to, from, next) {
beforeRouteEnter(to, from, next) {
next(instance => instance.$router.replace(JSON.parse(from.params.route)));
},
render: h => h()
......@@ -84,7 +84,8 @@ const frameOut = [
meta: {
title: '$t:page.login.title'
},
component: () => import('@/pages/account/login')
component: () =>
import ('@/pages/account/login')
},
// 注册
{
......@@ -93,7 +94,8 @@ const frameOut = [
meta: {
title: '$t:page.register.title'
},
component: () => import('@/pages/account/register')
component: () =>
import ('@/pages/account/register')
},
// 注册结果
{
......@@ -103,7 +105,8 @@ const frameOut = [
auth: true,
title: '注册结果'
},
component: () => import('@/pages/account/register/result')
component: () =>
import ('@/pages/account/register/result')
}
];
......@@ -111,14 +114,14 @@ const frameOut = [
* 错误页面
*/
const errorPage = [
{
const errorPage = [{
path: '/403',
name: '403',
meta: {
title: '403'
},
component: () => import('@/pages/system/error/403')
component: () =>
import ('@/pages/system/error/403')
},
{
path: '/500',
......@@ -126,7 +129,8 @@ const errorPage = [
meta: {
title: '500'
},
component: () => import('@/pages/system/error/500')
component: () =>
import ('@/pages/system/error/500')
},
{
path: '*',
......@@ -134,7 +138,8 @@ const errorPage = [
meta: {
title: '404'
},
component: () => import('@/pages/system/error/404')
component: () =>
import ('@/pages/system/error/404')
}
];
......@@ -146,4 +151,4 @@ export default [
...frameIn,
...frameOut,
...errorPage
];
];
\ 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