Merge branch 'lb-style-refactor'
This commit is contained in:
commit
3352f0ac72
@ -38,8 +38,8 @@
|
|||||||
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
|
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
|
||||||
<script>
|
<script>
|
||||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
|
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
|
||||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
|
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
|
||||||
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
|
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
|
||||||
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
|
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
|
||||||
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv
|
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv
|
||||||
</script>
|
</script>
|
||||||
|
@ -9,6 +9,7 @@ import Vue from 'vue'
|
|||||||
import Router from 'vue-router'
|
import Router from 'vue-router'
|
||||||
import http from '@/utils/request'
|
import http from '@/utils/request'
|
||||||
import { isURL } from '@/utils/validate'
|
import { isURL } from '@/utils/validate'
|
||||||
|
import { isAuthentcated } from '../utils'
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
|
|
||||||
@ -82,8 +83,14 @@ router.beforeEach((to, from, next) => {
|
|||||||
// 添加动态(菜单)路由
|
// 添加动态(菜单)路由
|
||||||
// 已添加或者当前路由为页面路由, 可直接访问
|
// 已添加或者当前路由为页面路由, 可直接访问
|
||||||
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
|
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
|
||||||
|
// 如果是在已认证的情况下直接访问登录界面
|
||||||
|
if (to.name === 'login') {
|
||||||
|
return next('/')
|
||||||
|
}
|
||||||
return next()
|
return next()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isAuthentcated()) {
|
||||||
// 获取字典列表, 添加并全局变量保存
|
// 获取字典列表, 添加并全局变量保存
|
||||||
http.get('/sys/dict/type/all').then(({ data: res }) => {
|
http.get('/sys/dict/type/all').then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
@ -91,6 +98,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
}
|
}
|
||||||
window.SITE_CONFIG['dictList'] = res.data
|
window.SITE_CONFIG['dictList'] = res.data
|
||||||
}).catch(() => { })
|
}).catch(() => { })
|
||||||
|
|
||||||
// 获取菜单列表, 添加并全局变量保存
|
// 获取菜单列表, 添加并全局变量保存
|
||||||
http.get('/sys/menu/nav').then(({ data: res }) => {
|
http.get('/sys/menu/nav').then(({ data: res }) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
@ -103,6 +111,11 @@ router.beforeEach((to, from, next) => {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
next({ name: 'login' })
|
next({ name: 'login' })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
next({ name: 'login' })
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,3 +97,7 @@ export function treeDataTranslate (data, id = 'id', pid = 'pid') {
|
|||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isAuthentcated() {
|
||||||
|
return Cookies.get('token')
|
||||||
|
}
|
@ -9,6 +9,7 @@ export default function () {
|
|||||||
{ width: 90, prop: "code", label: "原料编码" },
|
{ width: 90, prop: "code", label: "原料编码" },
|
||||||
{ width: 240, prop: "description", label: "原料描述" },
|
{ width: 240, prop: "description", label: "原料描述" },
|
||||||
{ width: 90, prop: "name", label: "原料名称" },
|
{ width: 90, prop: "name", label: "原料名称" },
|
||||||
|
{ width: 120, prop: "maxSize", label: "原料最大尺寸", filter: val => val ?? '-' },
|
||||||
{ width: 90, prop: "typeDictValue", label: "类型", filter: dictFilter("material_category") }, // subcomponent: {/** TODO: create a new component for this option */} },
|
{ width: 90, prop: "typeDictValue", label: "类型", filter: dictFilter("material_category") }, // subcomponent: {/** TODO: create a new component for this option */} },
|
||||||
{ prop: "baseMaterialCode", label: "基础原料编码" },
|
{ prop: "baseMaterialCode", label: "基础原料编码" },
|
||||||
{ prop: "baseMaterialDescription", label: "基础原料描述" },
|
{ prop: "baseMaterialDescription", label: "基础原料描述" },
|
||||||
@ -147,6 +148,15 @@ export default function () {
|
|||||||
elparams: { placeholder: "原料类别" },
|
elparams: { placeholder: "原料类别" },
|
||||||
// autoDisabled: true
|
// autoDisabled: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: "原料最大尺寸",
|
||||||
|
prop: "maxSize",
|
||||||
|
rules: [
|
||||||
|
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
|
||||||
|
],
|
||||||
|
elparams: { placeholder: "请输入原料最大尺寸" }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
select: true,
|
select: true,
|
||||||
label: "基础原料",
|
label: "基础原料",
|
||||||
@ -156,7 +166,6 @@ export default function () {
|
|||||||
fetchData: () => this.$http.get("/pms/baseMaterial/page", { params: { limit: 999, page: 1, key: "" } }),
|
fetchData: () => this.$http.get("/pms/baseMaterial/page", { params: { limit: 999, page: 1, key: "" } }),
|
||||||
elparams: { placeholder: "请选择基础原料" },
|
elparams: { placeholder: "请选择基础原料" },
|
||||||
},
|
},
|
||||||
{ input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "堆积密度" } },
|
|
||||||
// {
|
// {
|
||||||
// input: true,
|
// input: true,
|
||||||
// label: "设备类型",
|
// label: "设备类型",
|
||||||
@ -166,6 +175,7 @@ export default function () {
|
|||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
{ input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "请输入堆积密度" } },
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: "加料下限",
|
label: "加料下限",
|
||||||
@ -185,7 +195,9 @@ export default function () {
|
|||||||
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
|
{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
|
||||||
],
|
],
|
||||||
elparams: { placeholder: "请输入加料上限" },
|
elparams: { placeholder: "请输入加料上限" },
|
||||||
},
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "请输入备注" } },
|
{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "请输入备注" } },
|
||||||
// {
|
// {
|
||||||
// select: true,
|
// select: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user