forked from mt-fe-group/mt-yd-ui
Compare commits
11 Commits
076eaa5f2a
...
lb
| Author | SHA1 | Date | |
|---|---|---|---|
| e532989ddf | |||
| 10e454eb2a | |||
| ce9c0f9d76 | |||
| a2423905fd | |||
| 04dc0bcc49 | |||
| 1006ef0d6a | |||
| d9ff6226b3 | |||
| 08aa78fdb1 | |||
| 2d557c8196 | |||
| e020c1e174 | |||
| e46c392e0f |
@@ -3,7 +3,8 @@
|
||||
"version": "5.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"serve": "vue-cli-service serve --mode production",
|
||||
"serve:dev": "vue-cli-service serve --mode development",
|
||||
"build": "vue-cli-service build",
|
||||
"build:prod": "vue-cli-service build --mode production",
|
||||
"build:sit": "vue-cli-service build --mode production.sit",
|
||||
|
||||
25
public/i18n.js
Normal file
25
public/i18n.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Created by Jacky.Gao on 2017-10-01.
|
||||
*/
|
||||
import defaultI18nJsonData from './designer.json';
|
||||
import en18nJsonData from './designer_en.json';
|
||||
export default function buildLocal () {
|
||||
let language = getCookie('language') || 'zh-CN';
|
||||
window.i18n = defaultI18nJsonData;
|
||||
if (language !== 'zh-CN') {
|
||||
window.i18n = en18nJsonData;
|
||||
}
|
||||
}
|
||||
|
||||
function getCookie (name) {
|
||||
var strcookie = document.cookie;//获取cookie字符串
|
||||
var arrcookie = strcookie.split("; ");//分割
|
||||
//遍历匹配
|
||||
for (var i = 0; i < arrcookie.length; i++) {
|
||||
var arr = arrcookie[i].split("=");
|
||||
if (arr[0] == name){
|
||||
return arr[1];
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
window.SITE_CONFIG['version'] = 'v5.0.0';
|
||||
window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>';
|
||||
window.SITE_CONFIG['apiURL'] = ''; // api请求地址
|
||||
window.SITE_CONFIG['projURL'] = '/yd-monitor'; // api请求地址
|
||||
window.SITE_CONFIG['projURL'] = ''; // api请求地址
|
||||
window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
|
||||
window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象
|
||||
'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
|
||||
@@ -31,25 +31,25 @@
|
||||
<!-- 开发环境 -->
|
||||
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
|
||||
<script>
|
||||
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.28:8080';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
|
||||
</script>
|
||||
<% } %>
|
||||
<!-- 集成测试环境 -->
|
||||
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
|
||||
<script>
|
||||
window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/renren-admin';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
|
||||
</script>
|
||||
<% } %>
|
||||
<!-- 验收测试环境 -->
|
||||
<% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
|
||||
<script>
|
||||
window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/renren-admin';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
|
||||
</script>
|
||||
<% } %>
|
||||
<!-- 生产环境 -->
|
||||
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
|
||||
<script>
|
||||
window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/renren-admin';
|
||||
window.SITE_CONFIG['apiURL'] = 'http://india.mes.picaiba.com/';
|
||||
</script>
|
||||
<% } %>
|
||||
</head>
|
||||
|
||||
@@ -5,7 +5,7 @@ $base--line-height: 1.15;
|
||||
$navbar--height: 50px;
|
||||
|
||||
// Sidebar
|
||||
$sidebar--width: 230px;
|
||||
$sidebar--width: 300px;
|
||||
$sidebar--width-fold: 64px;
|
||||
$sidebar--background-color-dark: #263238;
|
||||
$sidebar--text-color-dark: #8a979e;
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CKEditor from 'ckeditor4-vue'
|
||||
import AttrForm from '../AttrForm'
|
||||
import { pick } from 'lodash/object'
|
||||
import i18n from '@/i18n'
|
||||
@@ -205,6 +206,11 @@ export default {
|
||||
return Math.ceil(this.configs.fields.length / COLUMN_PER_ROW)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
/** load lang */
|
||||
// CKEditor.load()
|
||||
// console.log('lang', CKEditor.component.props.config.defaultLanguage = 'en' )
|
||||
},
|
||||
mounted() {
|
||||
/** 计算 defaultPlaceholders */
|
||||
const prefix = i18n.t('hints.input')
|
||||
|
||||
11
src/components/base-table/components/cell-container.vue
Normal file
11
src/components/base-table/components/cell-container.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div class="cell-container">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
}
|
||||
},
|
||||
render: function (h) {
|
||||
// console.log(this)
|
||||
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.buttonContent || this.defaultText)])
|
||||
// console.log('button content:', this.injectData)
|
||||
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)])
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,8 @@
|
||||
:width="head.width || null"
|
||||
:min-width="head.minWidth || null"
|
||||
:fixed="head.fixed || null"
|
||||
:show-overflow-tooltip="head.showOverflowTooltip || false"
|
||||
:show-overflow-tooltip="head.showOverflowTooltip || true"
|
||||
:tooltip-effect="head.tooltipEffect || 'light'"
|
||||
filter-placement="top"
|
||||
:align="head.align || null"
|
||||
v-bind="head.more"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="base-upload" style="border-radius: 8px; margin-top: 38px; padding: 0; max-height: 500px;">
|
||||
<div class="base-upload" style="border-radius: 8px; margin-top: 48px; padding: 0; max-height: 500px;">
|
||||
<el-upload
|
||||
class="yd-upload"
|
||||
action="#"
|
||||
@@ -181,12 +181,12 @@ export default {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.base-upload >>> .el-button {
|
||||
/* .base-upload >>> .el-button {
|
||||
display: block;
|
||||
width: 200px;
|
||||
position: relative;
|
||||
left: -100px;
|
||||
}
|
||||
left: -50px;
|
||||
} */
|
||||
|
||||
/* .base-upload >>> .el-upload--text {
|
||||
width: 100px;
|
||||
@@ -198,4 +198,16 @@ export default {
|
||||
margin-top: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.base-upload {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.yd-upload {
|
||||
/* background-color: #efefef; */
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,6 +7,55 @@ t.brand = {}
|
||||
t.brand.lg = 'Monitoring System'
|
||||
t.brand.mini = 'PMS'
|
||||
|
||||
t.routes = {}
|
||||
t.routes['产品池'] = 'Products Pool'
|
||||
t.routes['基本资料'] = 'Basic Data'
|
||||
t.routes['设备数采'] = 'Equipment PLC'
|
||||
t.routes['厂务管理'] = 'Factory Management'
|
||||
t.routes['报表管理'] = 'Report Management'
|
||||
t.routes['质量管理'] = 'Quality Management'
|
||||
t.routes['权限管理'] = 'Permission Management'
|
||||
t.routes['系统设置'] = 'System Settings'
|
||||
t.routes['日志管理'] = 'Log Management'
|
||||
|
||||
// 二级
|
||||
t.routes['厂务'] = 'Factory Affair'
|
||||
t.routes['设备'] = 'Equipment'
|
||||
t.routes['字典管理'] = 'Dict Management'
|
||||
t.routes['PLC信息'] = 'PLC'
|
||||
t.routes['设备与PLC关联配置'] = 'Relations between plc & equipments'
|
||||
t.routes['设备生产实时数据'] = 'Realtime Equipment Data'
|
||||
t.routes['产线生产实时数据'] = 'Realtime Productline Data'
|
||||
t.routes['质量检查实时数据'] = 'Realtime Quality Inspection Data'
|
||||
t.routes['报表总览'] = 'Report Overview'
|
||||
t.routes['报表分类'] = 'Report Types'
|
||||
t.routes['报表详情'] = 'Report Detail'
|
||||
t.routes['质量检测基础数据'] = 'Quality Inspection Basic Data'
|
||||
t.routes['当前检测数据'] = 'Current Inspection Data'
|
||||
t.routes['质量检查信息记录'] = 'Quality Inspection Records'
|
||||
t.routes['用户管理'] = 'User Management'
|
||||
t.routes['部门管理'] = 'Department Management'
|
||||
t.routes['角色管理'] = 'Role Management'
|
||||
t.routes['菜单管理'] = 'Menu Management'
|
||||
t.routes['参数管理'] = 'Params Management'
|
||||
t.routes['定时任务'] = 'Timed Tasks'
|
||||
t.routes['文件上传'] = 'File Upload'
|
||||
t.routes['登录日志'] = 'Login Records'
|
||||
t.routes['操作日志'] = 'Oprations Records'
|
||||
|
||||
// 三级
|
||||
t.routes['工厂'] = 'Factory'
|
||||
t.routes['产线'] = 'Product Lines'
|
||||
t.routes['工段'] = 'Work Sections'
|
||||
t.routes['设备类型'] = 'Equipment Types'
|
||||
t.routes['设备分组'] = 'Equipment Groups'
|
||||
t.routes['设备信息'] = 'Equipment Details'
|
||||
t.routes['设备参数状态监控'] = 'Current Equipment State'
|
||||
t.routes['设备分组报警信息'] = 'Equipment Group Alarm'
|
||||
t.routes['质量检测类型'] = 'Quality Inpection Types'
|
||||
t.routes['质量检测信息'] = 'Quality Inpection Details'
|
||||
|
||||
|
||||
t.save = 'Save'
|
||||
t.add = 'Add'
|
||||
t.delete = 'Delete'
|
||||
@@ -136,7 +185,7 @@ t.prod.attrname = 'Attribute Node'
|
||||
t.prod.attrnameHints = 'Please input attribute name'
|
||||
t.prod.attrvalueHints = 'Please input attribute value'
|
||||
t.prod.descHints = 'Please input description'
|
||||
t.prod.processTime = 'Processing Time'
|
||||
t.prod.processTime = 'Processing Time (Hours)'
|
||||
t.prod.processTimeHints = 'Please input processing time'
|
||||
t.prod.relatedPid = 'Related Product'
|
||||
|
||||
@@ -189,6 +238,17 @@ t.realtime.num = 'scrap quantity'
|
||||
t.realtime.rate = 'scrap rate'
|
||||
t.realtime.total = 'total production'
|
||||
t.realtime.goodrate = 'Passed Rate'
|
||||
t.realtime.runState = '是否运行'
|
||||
t.realtime.state = '状态'
|
||||
t.realtime.hasFault = '是否故障'
|
||||
t.realtime.recentParamValue = '参数近期值'
|
||||
t.realtime.view = '查看'
|
||||
t.realtime.input = '投入数'
|
||||
t.realtime.output = '产出数'
|
||||
t.realtime.eqName = '设备名称'
|
||||
t.realtime.eqCode = '设备编码'
|
||||
t.realtime.productionSnapshotTime = '生产量记录时间'
|
||||
t.realtime.statusSnapshotTime = '状态记录时间'
|
||||
|
||||
|
||||
t.ws = {}
|
||||
@@ -307,13 +367,13 @@ t.login.demo = 'Demo'
|
||||
t.login.copyright = 'Copyright @Intelligent Automation Research Institute Co., Ltd Version: 1.0'
|
||||
|
||||
t.schedule = {}
|
||||
t.schedule.beanName = 'bean名称'
|
||||
t.schedule.beanNameTips = 'spring bean名称, 如: testTask'
|
||||
t.schedule.beanName = 'Bean Name'
|
||||
t.schedule.beanNameTips = 'spring bean name, eg: testTask'
|
||||
t.schedule.pauseBatch = 'Pause'
|
||||
t.schedule.resumeBatch = 'Resume'
|
||||
t.schedule.runBatch = 'Run'
|
||||
t.schedule.log = '日志列表'
|
||||
t.schedule.params = '参数'
|
||||
t.schedule.log = 'Log List'
|
||||
t.schedule.params = 'Parameters'
|
||||
t.schedule.cronExpression = 'cron expression'
|
||||
t.schedule.cronExpressionTips = 'ex: 0 0 12 * * ?'
|
||||
t.schedule.remark = 'Remark'
|
||||
@@ -327,7 +387,7 @@ t.schedule.resume = 'Resume'
|
||||
t.schedule.run = 'Excute'
|
||||
t.schedule.jobId = 'Job ID'
|
||||
t.schedule.times = 'Time Cost (ms)'
|
||||
t.schedule.createDate = '执行时间'
|
||||
t.schedule.createDate = 'Executed Tune' // ?
|
||||
|
||||
t.oss = {}
|
||||
t.oss.config = '云存储配置'
|
||||
@@ -469,16 +529,16 @@ t.role = {}
|
||||
t.role.name = 'Role Name'
|
||||
t.role.remark = 'Remark'
|
||||
t.role.createDate = 'Create Time'
|
||||
t.role.menuList = '菜单授权'
|
||||
t.role.deptList = '数据授权'
|
||||
t.role.menuList = 'Menu authorization' // ?
|
||||
t.role.deptList = 'Data authorization' // ?
|
||||
|
||||
t.user = {}
|
||||
t.user.username = 'User Name'
|
||||
t.user.deptName = '所属部门'
|
||||
t.user.deptName = 'Department'
|
||||
t.user.email = 'Email'
|
||||
t.user.mobile = 'Phone'
|
||||
t.user.status = 'Status'
|
||||
t.user.status0 = '停用'
|
||||
t.user.status0 = 'Pause' // ?
|
||||
t.user.status1 = 'Normal'
|
||||
t.user.createDate = 'Create Time'
|
||||
t.user.password = 'Password'
|
||||
|
||||
@@ -7,14 +7,59 @@ t.brand = {}
|
||||
t.brand.lg = '生产监控系统'
|
||||
t.brand.mini = '监控'
|
||||
|
||||
// 1 代表 '' 号的替换完成
|
||||
// 2 代表 "" 号的替换完成
|
||||
// 3 代表不带引号,或 {{ }} 的替换,这三种替换需按顺序执行
|
||||
// ? 代表需要单独review
|
||||
// 基本上完成了template模板里的替换工作
|
||||
t.routes = {}
|
||||
// 一级
|
||||
t.routes['产品池'] = '产品池'
|
||||
t.routes['基本资料'] = '基本资料'
|
||||
t.routes['设备数采'] = '设备数采'
|
||||
t.routes['厂务管理'] = '厂务管理'
|
||||
t.routes['报表管理'] = '报表管理'
|
||||
t.routes['质量管理'] = '质量管理'
|
||||
t.routes['权限管理'] = '权限管理'
|
||||
t.routes['系统设置'] = '系统设置'
|
||||
t.routes['日志管理'] = '日志管理'
|
||||
|
||||
// 二级
|
||||
t.routes['厂务'] = '厂务'
|
||||
t.routes['设备'] = '设备'
|
||||
t.routes['字典管理'] = '字典管理'
|
||||
t.routes['PLC信息'] = 'PLC信息'
|
||||
t.routes['设备与PLC关联配置'] = '设备与PLC关联配置' // ?
|
||||
t.routes['设备生产实时数据'] = '设备生产实时数据'
|
||||
t.routes['产线生产实时数据'] = '产线生产实时数据'
|
||||
t.routes['质量检查实时数据'] = '质量检查实时数据'
|
||||
t.routes['报表总览'] = '报表总览'
|
||||
t.routes['报表分类'] = '报表分类'
|
||||
t.routes['报表详情'] = '报表详情'
|
||||
t.routes['质量检测基础数据'] = '质量检测基础数据'
|
||||
t.routes['当前检测数据'] = '当前检测数据'
|
||||
t.routes['质量检查信息记录'] = '质量检查信息记录'
|
||||
t.routes['用户管理'] = '用户管理'
|
||||
t.routes['部门管理'] = '部门管理'
|
||||
t.routes['角色管理'] = '角色管理'
|
||||
t.routes['菜单管理'] = '菜单管理'
|
||||
t.routes['参数管理'] = '参数管理'
|
||||
t.routes['定时任务'] = '定时任务'
|
||||
t.routes['文件上传'] = '文件上传'
|
||||
t.routes['登录日志'] = '登录日志'
|
||||
t.routes['操作日志'] = '操作日志'
|
||||
|
||||
// 三级
|
||||
t.routes['工厂'] = '工厂'
|
||||
t.routes['产线'] = '产线'
|
||||
t.routes['工段'] = '工段'
|
||||
t.routes['设备类型'] = '设备类型'
|
||||
t.routes['设备分组'] = '设备分组'
|
||||
t.routes['设备信息'] = '设备信息'
|
||||
t.routes['设备参数状态监控'] = '设备参数状态监控'
|
||||
t.routes['设备分组报警信息'] = '设备分组报警信息'
|
||||
t.routes['质量检测类型'] = '质量检测类型'
|
||||
t.routes['质量检测信息'] = '质量检测信息'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 对比 v2, v3 的结果,补充此文件和 en.js 文件
|
||||
// 然后替换vue文件的内容
|
||||
t.save = '保存'
|
||||
t.add = '新增' // 1
|
||||
t.delete = '删除' // 1
|
||||
@@ -145,7 +190,7 @@ t.prod.attrname = '属性名称'
|
||||
t.prod.attrnameHints = '请输入属性名称'
|
||||
t.prod.attrvalueHints = '请输入属性值'
|
||||
t.prod.descHints = '请输入描述'
|
||||
t.prod.processTime = '加工时间'
|
||||
t.prod.processTime = '加工时间 (h)'
|
||||
t.prod.processTimeHints = '请输入加工时间'
|
||||
t.prod.relatedPid = '关联产品'
|
||||
|
||||
@@ -198,6 +243,17 @@ t.realtime.num = '报废数量'
|
||||
t.realtime.rate = '报废比例'
|
||||
t.realtime.total = '总产量'
|
||||
t.realtime.goodrate = '良品率'
|
||||
t.realtime.runState = '是否运行'
|
||||
t.realtime.state = '状态'
|
||||
t.realtime.hasFault = '是否故障'
|
||||
t.realtime.recentParamValue = '参数近期值'
|
||||
t.realtime.view = '查看'
|
||||
t.realtime.input = '投入数'
|
||||
t.realtime.output = '产出数'
|
||||
t.realtime.eqName = '设备名称'
|
||||
t.realtime.eqCode = '设备编码'
|
||||
t.realtime.productionSnapshotTime = '生产量记录时间'
|
||||
t.realtime.statusSnapshotTime = '状态记录时间'
|
||||
|
||||
|
||||
t.ws = {}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Router from 'vue-router'
|
||||
import http from '@/utils/request'
|
||||
import { isURL } from '@/utils/validate'
|
||||
import Cookies from 'js-cookie'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
@@ -104,6 +105,13 @@ router.beforeEach((to, from, next) => {
|
||||
http.get(http.adornUrl('/sys/menu/nav')).then(({ data: res }) => {
|
||||
/** axios 的拦截器已经拦截出错情况,此处只考虑正确情况即可 */
|
||||
window.SITE_CONFIG['menuList'] = res.data
|
||||
// .map(item => {
|
||||
// if (item.name === '产品池') {
|
||||
// console.log('Got you')
|
||||
// item.name =
|
||||
// }
|
||||
// return item
|
||||
// })
|
||||
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
|
||||
next({ ...to, replace: true })
|
||||
}).catch((err) => {
|
||||
@@ -139,6 +147,8 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
|
||||
|
||||
for (var i = 0; i < menuList.length; i++) {
|
||||
if (menuList[i].children && menuList[i].children.length >= 1) {
|
||||
// 菜单的国际化
|
||||
menuList[i].name = i18n.t(`routes["${menuList[i].name}"]`)
|
||||
temp = temp.concat(menuList[i].children)
|
||||
continue
|
||||
}
|
||||
@@ -150,9 +160,15 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
|
||||
meta: {
|
||||
...window.SITE_CONFIG['contentTabDefault'],
|
||||
menuId: menuList[i].id,
|
||||
title: menuList[i].name
|
||||
// 菜单的国际化
|
||||
title: i18n.t(`routes["${menuList[i].name}"]`)
|
||||
}
|
||||
}
|
||||
|
||||
// 菜单的国际化
|
||||
menuList[i].name = i18n.t(`routes["${menuList[i].name}"]`)
|
||||
|
||||
console.log('route ===', route.meta.title)
|
||||
// eslint-disable-next-line
|
||||
let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
|
||||
if (isURL(URL)) {
|
||||
|
||||
@@ -7,7 +7,9 @@ import isPlainObject from 'lodash/isPlainObject'
|
||||
import merge from 'lodash/merge'
|
||||
|
||||
const http = axios.create({
|
||||
baseURL: window.SITE_CONFIG['apiURL'],
|
||||
// baseURL: window.SITE_CONFIG['apiURL'],
|
||||
// baseURL: '/api',
|
||||
baseURL: process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor',
|
||||
timeout: 1000 * 180,
|
||||
withCredentials: true
|
||||
})
|
||||
@@ -71,7 +73,9 @@ http.interceptors.response.use(response => {
|
||||
*/
|
||||
http.adornUrl = (actionName) => {
|
||||
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
|
||||
return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.projURL) + actionName
|
||||
// return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? window.SITE_CONFIG.projURL : '') + actionName
|
||||
// return (process.env.NODE_ENV !== 'production' ? '/yd-monitor' : '/api') + actionName
|
||||
return actionName
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ export default {
|
||||
mounted() {
|
||||
// this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
|
||||
this.$nextTick(() => {
|
||||
console.log(`window.SITE_CONFIG['menuList']`, window.SITE_CONFIG['menuList'])
|
||||
this.unhiddenMenuList = this.getUnhiddenRoutesListFrom(window.SITE_CONFIG['menuList'])
|
||||
/** 本地保存一份,store保存一份,感觉 store 都不需要保存... */
|
||||
this.$store.state.sidebarMenuList = this.unhiddenMenuList
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<h3>官方微信群</h3>
|
||||
<ul>
|
||||
<li>扫码下面的二维码,关注【人人开源】公众号,回复【加群】,即可根据提示加入微信群!</li>
|
||||
<li><img src="https://cdn.renren.io/f5cef202207132229319338.jpg" alt="微信群" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -36,16 +36,12 @@ import TableTextComponent from '@/components/base-table/components/detailCompone
|
||||
import CKEditor from 'ckeditor4-vue'
|
||||
import { calcMaxHeight } from '@/utils'
|
||||
import { timeFilter } from '@/utils/filters'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
// more: {
|
||||
// index: function(index) {
|
||||
// return (index + 1) * 2
|
||||
// }
|
||||
// }
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -170,10 +166,11 @@ const addOrUpdateConfigs = {
|
||||
fieldType: 'string',
|
||||
component: CKEditor.component,
|
||||
props: {
|
||||
value: 'tests',
|
||||
// value: 'tests',
|
||||
config: {
|
||||
// ckeditor 的配置: https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
|
||||
// toolbar: [['Bold']]
|
||||
language: Cookies.get('language') || 'en'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
249
src/views/modules/monitoring/equipmentCurrentState.vue
Normal file
249
src/views/modules/monitoring/equipmentCurrentState.vue
Normal file
@@ -0,0 +1,249 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-select v-model="dataForm.lineId" :placeholder="'产线'" clearable>
|
||||
<el-option v-for="line in lineList" :key="line.code" :value="line.id" :label="line.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="dataForm.equipmentId" :placeholder="'设备名称'" clearable>
|
||||
<el-option v-for="eq in eqList" :key="eq.code" :value="eq.id" :label="eq.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
<!-- <el-button v-if="$hasPermission('monitoring:equipmentgroup:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="calcMaxHeight(8)" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { calcMaxHeight } from '@/utils'
|
||||
import { timeFilter } from '@/utils/filters'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './equipmentGroup-add-or-update'
|
||||
import i18n from '@/i18n'
|
||||
import BaseTable from '@/components/base-table'
|
||||
// import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'equipmentName', name: i18n.t('realtime.eqName') },
|
||||
{ prop: 'equipmentCode', name: i18n.t('realtime.eqCode') },
|
||||
{ prop: 'inputNum', name: i18n.t('realtime.input') },
|
||||
{ prop: 'outputNum', name: i18n.t('realtime.output') },
|
||||
{
|
||||
prop: 'run',
|
||||
name: i18n.t('realtime.runState'),
|
||||
filter: val => {
|
||||
if (val !== null && val !== undefined) return val ? '是' : '否'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
name: i18n.t('realtime.state'),
|
||||
filter: val => {
|
||||
if (val !== null && val !== undefined) return ['正常', '计划停机', '故障'][+val]
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'error',
|
||||
name: i18n.t('realtime.hasFault'),
|
||||
filter: val => {
|
||||
if (val !== null && val !== undefined) return val ? '是' : '否'
|
||||
}
|
||||
},
|
||||
{ prop: 'quantityTime', name: i18n.t('realtime.productionSnapshotTime'), filter: timeFilter },
|
||||
{ prop: 'statusTime', name: i18n.t('realtime.statusSnapshotTime'), filter: timeFilter },
|
||||
{ prop: 'alarm', name: i18n.t('realtime.recentParamValue'), buttonContent: i18n.t('realtime.view'), subcomponent: TableTextComponent, actionName: 'view-alarm' }
|
||||
// { prop: 'operations', name: i18n.t('handle'), fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {
|
||||
type: 'dialog',
|
||||
infoUrl: '/monitoring/equipmentGroup',
|
||||
fields: [{ name: 'name', label: i18n.t('eq.groupname') }, { name: 'code', label: i18n.t('eq.groupcode') }, 'remark'],
|
||||
operations: [
|
||||
{ name: 'cancel', showAlways: true },
|
||||
{ name: 'save', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:save', showOnEdit: false },
|
||||
{ name: 'update', url: '/monitoring/equipmentGroup', permission: 'monitoring:equipmentgroup:update', showOnEdit: true }
|
||||
]
|
||||
}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
calcMaxHeight,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
equipmentId: '',
|
||||
lineId: ''
|
||||
},
|
||||
dataList: [],
|
||||
eqList: [],
|
||||
lineList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
BaseTable
|
||||
},
|
||||
activated() {
|
||||
this.getEqList()
|
||||
this.getLineList()
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 设备
|
||||
getEqList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipment/page'),
|
||||
method: 'get'
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.eqList = data.data.list
|
||||
} else {
|
||||
this.eqList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
// 产线
|
||||
getLineList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/productionLine/list'),
|
||||
method: 'get'
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.lineList = data.data
|
||||
} else {
|
||||
this.lineList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentValueMonitor/realTimePage'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
equipmentId: this.dataForm.equipmentId,
|
||||
lineId: this.dataForm.lineId
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.data.list
|
||||
this.totalPage = data.data.total
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'view-alarm':
|
||||
const { name, code } = this.dataList.find(item => item.id === id)
|
||||
this.$router.push({
|
||||
name: 'monitoring-equipmentGroupAlarm',
|
||||
params: {
|
||||
groupName: name,
|
||||
groupCode: code,
|
||||
id
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentGroup'),
|
||||
method: 'delete',
|
||||
data: this.$http.adornData(ids, false, 'raw')
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: i18n.t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -37,6 +37,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('eq.groupname') },
|
||||
{ prop: 'code', name: i18n.t('eq.groupcode') },
|
||||
|
||||
@@ -55,6 +55,10 @@ const dictEntries = {
|
||||
}
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'code', name: i18n.t('alarm.code') },
|
||||
{ prop: 'typeDictValue', name: i18n.t('alarm.type') },
|
||||
@@ -186,7 +190,7 @@ export default {
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${ i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() }) }`, i18n.t('prompt.title'), {
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
|
||||
@@ -37,6 +37,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('eq.type') },
|
||||
{ prop: 'code', name: i18n.t('eq.typecode') },
|
||||
|
||||
@@ -36,6 +36,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'equipmentId', name: i18n.t('eq.id') },
|
||||
{ prop: 'attrName', name: i18n.t('attrName') },
|
||||
|
||||
@@ -37,6 +37,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('factory.name') },
|
||||
{ prop: 'code', name: i18n.t('factory.code') },
|
||||
|
||||
@@ -36,6 +36,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'factoryName', name: i18n.t('factory.title') },
|
||||
{ prop: 'name', name: i18n.t('pl.name') },
|
||||
|
||||
@@ -37,6 +37,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'typeName', name: i18n.t('inspect.type') },
|
||||
{ prop: 'content', name: i18n.t('inspect.det') },
|
||||
@@ -169,7 +173,7 @@ export default {
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${ i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() }) }`, i18n.t('prompt.title'), {
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
|
||||
@@ -46,6 +46,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{
|
||||
prop: 'inspectionDetContent',
|
||||
|
||||
@@ -36,6 +36,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
import { calcMaxHeight } from '@/utils'
|
||||
import { timeFilter } from '@/utils/filters'
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('inspect.typename') },
|
||||
{ prop: 'code', name: i18n.t('inspect.typename') },
|
||||
@@ -140,7 +144,7 @@ export default {
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${ i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() }) }`, i18n.t('prompt.title'), {
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
else {
|
||||
this.$message({
|
||||
message: i18n.t('errors.nodata'),
|
||||
type: 'error',
|
||||
type: 'info',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
import { calcMaxHeight } from '@/utils'
|
||||
import { timeFilter } from '@/utils/filters'
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('categoryName') },
|
||||
{ prop: 'operations', name: i18n.t('handle'), width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
@@ -138,7 +142,7 @@ export default {
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${ i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() }) }`, i18n.t('prompt.title'), {
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
|
||||
@@ -11,8 +11,9 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
// url: process.env.VUE_APP_REPORT_DESIGN_URL
|
||||
url: window.SITE_CONFIG['apiURL'] + '/yd-monitor/ureport/designer'
|
||||
// url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/designer')
|
||||
// url: this.$http.adornUrl('/ureport/designer')
|
||||
url: (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + '/ureport/designer'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -22,7 +22,8 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
// url: process.env.VUE_APP_REPORT_VIEW_URL
|
||||
url: window.SITE_CONFIG['apiURL'] + '/yd-monitor/ureport/preview'
|
||||
// url: window.SITE_CONFIG['apiURL'] + this.$http.adornUrl('/ureport/preview')
|
||||
url: (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + '/ureport/preview'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -37,6 +37,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
|
||||
const tableConfigs = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
|
||||
{ prop: 'name', name: i18n.t('ws.name') },
|
||||
{ prop: 'code', name: i18n.t('ws.code') },
|
||||
@@ -166,7 +170,7 @@ export default {
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`${ i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() }) }`, i18n.t('prompt.title'), {
|
||||
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
|
||||
confirmButtonText: i18n.t('confirm'),
|
||||
cancelButtonText: i18n.t('cancel'),
|
||||
type: 'warning'
|
||||
|
||||
@@ -67,6 +67,10 @@ import TableOperateComponent from '@/components/base-table/components/operationC
|
||||
import AttrForm from './workshopSectionDialogAttrForm.vue'
|
||||
import { calcMaxHeight } from '@/utils'
|
||||
const tableProps = [
|
||||
{
|
||||
type: 'index',
|
||||
name: i18n.t('index')
|
||||
},
|
||||
{ name: i18n.t('eq.name'), prop: 'equipmentName' },
|
||||
{ name: i18n.t('dept.sort'), prop: 'sort' },
|
||||
{
|
||||
@@ -226,7 +230,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: '/yd-monitor/monitoring/workshopSectionEquipment',
|
||||
url: this.$http.adornUrl('/monitoring/workshopSectionEquipment'),
|
||||
method: 'delete',
|
||||
data: [id]
|
||||
}).then(({ data }) => {
|
||||
@@ -270,7 +274,7 @@ export default {
|
||||
},
|
||||
handleCreateOrUpdate() {
|
||||
this.$http({
|
||||
url: '/yd-monitor/monitoring/workshopSection',
|
||||
url: this.$http.adornUrl('/monitoring/workshopSection'),
|
||||
method: this.dataForm.id ? 'put' : 'post',
|
||||
data: {
|
||||
...this.dataForm
|
||||
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
this.edit = true
|
||||
// 获取信息,让用户修改排序
|
||||
this.$http({
|
||||
url: '/yd-monitor/monitoring/workshopSectionEquipment/' + id,
|
||||
url: this.$http.adornUrl('/monitoring/workshopSectionEquipment/') + id,
|
||||
method: 'get'
|
||||
}).then(({ data: res }) => {
|
||||
if (res.data) {
|
||||
@@ -102,7 +102,7 @@ export default {
|
||||
},
|
||||
handleSave() {
|
||||
this.$http({
|
||||
url: '/yd-monitor/monitoring/workshopSectionEquipment',
|
||||
url: this.$http.adornUrl('/monitoring/workshopSectionEquipment'),
|
||||
method: this.edit ? 'put' : 'post',
|
||||
data: {
|
||||
...this.dataForm,
|
||||
|
||||
@@ -22,7 +22,8 @@ export default {
|
||||
methods: {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`
|
||||
// this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`
|
||||
this.url = (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + `/sys/oss/upload?token=${Cookies.get('token')}`
|
||||
this.num = 0
|
||||
this.fileList = []
|
||||
},
|
||||
|
||||
@@ -102,7 +102,8 @@ export default {
|
||||
// 获取验证码
|
||||
getCaptcha() {
|
||||
this.dataForm.uuid = getUUID()
|
||||
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`
|
||||
// this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`
|
||||
this.captchaPath = (process.env.NODE_ENV === 'production' ? '/api' : '/yd-monitor') + `/captcha?uuid=${this.dataForm.uuid}`
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(
|
||||
@@ -114,7 +115,9 @@ export default {
|
||||
this.$http
|
||||
.post(this.$http.adornUrl('/login'), this.dataForm)
|
||||
.then(({ data: res }) => {
|
||||
console.log('res', res)
|
||||
if (res.code !== 0) {
|
||||
console.log('res', res)
|
||||
// this.getCaptcha()
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
||||
@@ -12,12 +12,31 @@ module.exports = {
|
||||
.loader('svg-sprite-loader')
|
||||
},
|
||||
productionSourceMap: false,
|
||||
configureWebpack: config => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.performance = {
|
||||
maxEntrypointSize: 2097152, // 大小改为2mb
|
||||
maxAssetSize: 1572864
|
||||
}
|
||||
}
|
||||
},
|
||||
devServer: {
|
||||
open: true,
|
||||
port: 8001,
|
||||
overlay: {
|
||||
errors: true,
|
||||
warnings: true
|
||||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://india.mes.picaiba.com/'
|
||||
},
|
||||
'/yd-monitor': {
|
||||
target: 'http://192.168.1.20:8080/' // 开发地址
|
||||
},
|
||||
'/ureport': {
|
||||
target: 'http://india.mes.picaiba.com/' // ureporter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user