diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..1a7c032 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "singleQuote": true, + "tabWidth": 2, + "bracketSameLine": true, + "jsxBracketSameLine": true, + "embeddedLanguageFormatting": "auto", + "printWidth": 180, + "quoteProps": "consistent", + "trailingComma": "none", + "semi": false, + "useTabs": true +} diff --git a/AddOrUpdateConfig.md b/AddOrUpdateConfig.md new file mode 100644 index 0000000..ff0a2f8 --- /dev/null +++ b/AddOrUpdateConfig.md @@ -0,0 +1,166 @@ +# Add Or Update Dialog Configs + +> 通过传入合理的配置项来使用 addOrUpdate Dialog + +## 示例 + +```js +const addOrUpdateConfigs = { + type: 'dialog', // dialog | drawer | page + infoUrl: '/monitoring/product', + fields: [ + 'name', + { + name: 'code', + api: '/monitoring/product/getCode' + }, + { + name: 'processTime', + label: '加工时间', + placeholder: '请输入加工时间', + type: 'number', // type: number(input+number) | default(input) | textarea | select(options在父组件里获取) | datetime + required: true, + rules: [ + // 除了required之外的验证规则 + { + type: 'number', + trigger: 'blur', + transform: val => Number(val), + message: '必须输入数字' + } + ] + }, + 'remark', + 'specifications', + { + name: 'typeDictValue', + rules: [{ required: true, trigger: 'blur' }], + label: '产品类型', // 对于非常见属性,最好自己指定label + type: 'select', + options: [ + // 动态获取 + ] + }, + { + name: 'unitDictValue', + label: '单位', + type: 'select', + placeholder: '请选择单位', + options: [ + // 动态获取 + ] + } + ], + operations: [ + // { name: 'reset', url: true }, + { name: 'cancel', url: true, showAlways: true }, + { name: 'save', url: '/monitoring/product', permission: '', showOnEdit: false }, + { name: 'update', url: '/monitoring/product', permission: '', showOnEdit: true } + ], + subtable: { + // for i18n + title: '动态属性', + url: '/monitoring/productArrt', + tableConfigs: [ + { type: 'index', name: '序号' }, + { prop: 'createTime', name: '添加时间', filter: val => (val ? moment(val).format('YYYY-MM-DD hh:mm:ss') : '-') }, + { prop: 'name', name: '属性名', formField: true, rules: [{ required: true, message: '必填', trigger: 'blur' }] }, + { prop: 'code', name: '属性值', formField: true }, + { prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } + ] + }, + extraComponents: [ + { + name: 'CompName', + label: 'markdown编辑器', + component: () => import('xx.vue') + } + ] +} +``` + +## 配置项 + + + +### type + +类型: string +值:dialog | drawer | page +含义:对话框、抽屉、新页面 + +### infoUrl + +类型:string +含义:详情的接口,如 `/monitoring/product` + +### fields + +含义:设置新增、编辑时的字段 +类型:`Array` + +- 当类型为 string 时,默认渲染 `` +- 当类型为 object 时,有如下选项: + - name: 字段名 + - label: 字段的 label + - api: 如果设置了该属性,则该字段会自动从服务器获取值,一般为 code 字段需要 + - placeholder + - type: 渲染何种类型的组件,默认值: 'input' + - options: 当上一条 type 值为 'select' 时,需要自行动态获取并加载 options 列表 + - required: 是否是必须填写的字段(或可用过 rules 做更加具体的设定,设定方式参考 async-validator ) + - rules: 验证规则数组,如果只有"必填"的需求,可直接用上一条 + +### operations + +含义:设置对话框等组件里,需要哪些按钮 +类型:`Array` +属性: + +- name,按钮的类型,决定按钮的文字和颜色 +- url,按钮操作的接口地址,不需要的可以给 null 或 true +- permission,该操作需要的权限,如 "sys:xxx:add" 形式 +- showOnEdit: boolean,是否编辑页面展示,不设置则始终展示 + 示例: + +```js + operations: [ + { name: 'reset', url: true }, + { name: 'cancel', url: true, showAlways: true }, + { name: 'save', url: '/monitoring/product', permission: '', showOnEdit: false }, + { name: 'update', url: '/monitoring/product', permission: '', showOnEdit: true } + ], +``` + +### subtable + +含义:有些对话框里需要额外的表格来展示更深层次的数据,如“产品属性” +类型:object +选项: +- title, 内嵌表格的标题 +- url, 内嵌表格的数据地址 +- tableConfigs,内嵌表格的配置选项 + - 类型:`Array` + - 配置: + - type: 同 element-ui 的 table 属性的 type + - fixed: 同 element-ui 的 table 属性的 fixed + - width: 同 element-ui 的 table 属性的 width + - name: 表头显示的内容 + - filter: 一般用于转换时间 + - prop: 字段 + - formField: boolean, 是否用于表单的填写 + - rules: 表单验证规则,详见:async-validator + - subcomponent: 同 base-table 的 subcomponent + - options: 表格操作列需要哪些操作 + - 值:`edit` | `delete` | `detail`,需要其他可自行添加(修改 base-table 组件) + +### extraComponents +含义: 需要在对话框里使用的自定义组件列表 +类型: Array +对象选项: + - name: 该组件对应的 dataForm 字段(需要参照后端文档来指定) + - hasModel: boolean, 上传组件一般设置为 false,设置是否和 dataForm 关联 + - label + - fieldType: 设置该组件的数据将以什么数据类型形式来保存 + - component: 组件 + - props 传给组件的配置 + \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..ff9b76b --- /dev/null +++ b/TODO.md @@ -0,0 +1,7 @@ +# TODO List + +1. 按钮加权限 +2. 国际化 +3. 表格高度 √ +4. 表格时间格式修改 √ +5. icon列表 √ \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 91aad73..f5e8c84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2603,6 +2603,12 @@ "resolved": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.5.tgz", "integrity": "sha1-3M5EMOZLRDuolF8CkPtWStW6xt0=" }, + "@types/lodash": { + "version": "4.14.182", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", + "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npm.taobao.org/@types/minimatch/download/@types/minimatch-3.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fminimatch%2Fdownload%2F%40types%2Fminimatch-3.0.3.tgz", @@ -5277,6 +5283,19 @@ "safe-buffer": "^5.0.1" } }, + "ckeditor4-integrations-common": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ckeditor4-integrations-common/-/ckeditor4-integrations-common-1.0.0.tgz", + "integrity": "sha512-OAoQT/gYrHkg0qgzf6MS/rndYhq3SScLVQ3rtXQeuCE8ju7nFHg3qZ7WGA2XpFxcZzsMP6hhugXqdel5vbcC3g==" + }, + "ckeditor4-vue": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ckeditor4-vue/-/ckeditor4-vue-2.1.1.tgz", + "integrity": "sha512-BBmpT1BYxOmaA+qy9+hvhG0tDYCGqFve1eDSol0ZNwWCm1hZvmPAke809AhkHFUjb834dbNRlTwH3c2qedjtkQ==", + "requires": { + "ckeditor4-integrations-common": "^1.0.0" + } + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npm.taobao.org/class-utils/download/class-utils-0.3.6.tgz", @@ -7101,6 +7120,22 @@ "safer-buffer": "^2.1.0" } }, + "echarts": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.3.tgz", + "integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==", + "requires": { + "tslib": "2.3.0", + "zrender": "5.3.2" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz", @@ -10942,6 +10977,11 @@ "minimist": "^1.2.5" } }, + "moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz", @@ -17245,6 +17285,21 @@ "integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=" } } + }, + "zrender": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.2.tgz", + "integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==", + "requires": { + "tslib": "2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } + } } } } diff --git a/package.json b/package.json index 73b5dab..5cc34c3 100644 --- a/package.json +++ b/package.json @@ -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", @@ -13,14 +14,17 @@ "axios": "^0.19.2", "babel-eslint": "^8.0.1", "babel-plugin-component": "^1.1.1", + "ckeditor4-vue": "^2.1.1", "core-js": "^3.6.5", + "echarts": "^5.3.3", "element-theme": "^2.0.1", "element-ui": "^2.15.7", "js-cookie": "^2.2.1", "lodash": "^4.17.19", - "sass": "^1.26.5", + "moment": "^2.29.4", "qs": "^6.9.4", "quill": "^1.3.7", + "sass": "^1.26.5", "sass-loader": "^9.0.2", "screenfull": "^4.2.1", "svg-sprite-loader": "^5.0.0", @@ -31,6 +35,7 @@ "vuex": "^3.5.1" }, "devDependencies": { + "@types/lodash": "^4.14.182", "@vue/cli-plugin-babel": "^4.4.6", "@vue/cli-service": "^4.4.6", "element-theme-chalk": "^2.15.7", diff --git a/public/i18n.js b/public/i18n.js new file mode 100644 index 0000000..592ea4f --- /dev/null +++ b/public/i18n.js @@ -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 ""; +} diff --git a/public/index.html b/public/index.html index 71f176a..5bad048 100644 --- a/public/index.html +++ b/public/index.html @@ -10,6 +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'] = ''; // api请求地址 window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态) window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象 'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径) @@ -30,25 +31,25 @@ <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% } %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %> <% } %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %> <% } %> <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %> <% } %> diff --git a/src/App.vue b/src/App.vue index f57d30a..9a78fa5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,34 +1,34 @@ - - - + + + diff --git a/src/assets/scss/variables.scss b/src/assets/scss/variables.scss index 81814d1..56d591a 100644 --- a/src/assets/scss/variables.scss +++ b/src/assets/scss/variables.scss @@ -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; diff --git a/src/components/base-detail-page/index.vue b/src/components/base-detail-page/index.vue new file mode 100644 index 0000000..c136ba5 --- /dev/null +++ b/src/components/base-detail-page/index.vue @@ -0,0 +1,548 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ btnName[operate.name] }} + + + + + + + + diff --git a/src/components/base-dialog/AttrForm/index.vue b/src/components/base-dialog/AttrForm/index.vue new file mode 100644 index 0000000..26be59b --- /dev/null +++ b/src/components/base-dialog/AttrForm/index.vue @@ -0,0 +1,288 @@ + + + + {{ title }} {{ $t('add') }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('save') }} + + + + + + + + diff --git a/src/components/base-dialog/addOrUpdate/index.vue b/src/components/base-dialog/addOrUpdate/index.vue new file mode 100644 index 0000000..4012aca --- /dev/null +++ b/src/components/base-dialog/addOrUpdate/index.vue @@ -0,0 +1,562 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ btnName[operate.name] }} + + {{ $t('cancel') }} + + + + + + + diff --git a/src/components/base-table/components/cell-container.vue b/src/components/base-table/components/cell-container.vue new file mode 100644 index 0000000..f4fcc28 --- /dev/null +++ b/src/components/base-table/components/cell-container.vue @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/src/components/base-table/components/detailComponent.js b/src/components/base-table/components/detailComponent.js new file mode 100644 index 0000000..96f60db --- /dev/null +++ b/src/components/base-table/components/detailComponent.js @@ -0,0 +1,30 @@ +import i18n from '@/i18n' + +export default { + name: 'TableTextComponent', + props: { + injectData: { + type: Object, + default: () => ({}) + } + }, + data() { + return { + // for i18n inject: + defaultText: i18n.t('viewdetail') + } + }, + methods: { + emitClick() { + // console.log('inject data:' ,this.injectData) + this.$emit('emit-data', { + type: this.injectData.head?.actionName || 'view-detail-action', + data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id + }) + } + }, + render: function (h) { + // 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)]) + } +} \ No newline at end of file diff --git a/src/components/base-table/components/operationComponent.js b/src/components/base-table/components/operationComponent.js new file mode 100644 index 0000000..bad72e8 --- /dev/null +++ b/src/components/base-table/components/operationComponent.js @@ -0,0 +1,62 @@ +import i18n from '@/i18n' + +export default { + name: 'TableOperations', + props: { + injectData: { + type: Object, + default: () => ({}) + } + }, + data() { + return { + btnTypes: { + add: 'primary', + delete: 'danger', + detail: 'info' + // add more... + }, + colors: { + delete: '#FF5454', + preview: '#f09843', + design: '#99089f' + // add more... + }, + text: { + // TODO: i18n + edit: i18n.t('edit'), + detail: i18n.t('detail'), + delete: i18n.t('delete'), + viewAttr: i18n.t('viewattr'), + preview: i18n.t('preview'), + design: i18n.t('design'), + // add more... + } + } + }, + methods: { + // 发射事件 + emit(opt) { + let emitFull = false + let eventType = 'default' + let customField + if (typeof opt === 'object') { + eventType = opt.name + customField = opt.emitField || 'id' + emitFull = opt.emitFull || false + } else { + eventType = opt + } + this.$emit('emit-data', { type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id }) + } + }, + render: function (h) { + let btns = [] + for (const optionStr of this.injectData.head?.options) { + const optObj = typeof optionStr === 'object' + // btns.push(h('el-button', { props: { type: this.btnTypes[optionStr] } }, optionStr)) + btns.push(h('el-button', { props: { type: 'text' }, style: { color: optObj ? this.colors[optionStr.name] : this.colors[optionStr] || '#409EFF' }, on: { click: this.emit.bind(null, optionStr) } }, typeof optionStr === 'object' ? this.text[optionStr.name] : this.text[optionStr])) + } + return h('span', null, btns) + } +} \ No newline at end of file diff --git a/src/components/base-table/components/table-head.vue b/src/components/base-table/components/table-head.vue new file mode 100644 index 0000000..042d1c4 --- /dev/null +++ b/src/components/base-table/components/table-head.vue @@ -0,0 +1,40 @@ + + + + + + {{ scope.row[opt.prop] | commonFilter(opt.filter) }} + + + + + + + + + diff --git a/src/components/base-table/index.vue b/src/components/base-table/index.vue new file mode 100644 index 0000000..44ec01c --- /dev/null +++ b/src/components/base-table/index.vue @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + {{ scope.row[head.prop] | commonFilter(head.filter) }} + + + + + + + + + + + + + diff --git a/src/components/base-upload/index.vue b/src/components/base-upload/index.vue new file mode 100644 index 0000000..f05663e --- /dev/null +++ b/src/components/base-upload/index.vue @@ -0,0 +1,213 @@ + + + + + + + {{ buttonContent }} + {{ tip }} + + + + + + + diff --git a/src/components/ren-dept-tree/src/ren-dept-tree.vue b/src/components/ren-dept-tree/src/ren-dept-tree.vue index 461aed1..7c1c7e3 100644 --- a/src/components/ren-dept-tree/src/ren-dept-tree.vue +++ b/src/components/ren-dept-tree/src/ren-dept-tree.vue @@ -76,7 +76,7 @@ export default { return data.name.indexOf(value) !== -1 }, getDeptList (id) { - return this.$http.get('/sys/dept/list').then(({ data: res }) => { + return this.$http.get(this.$http.adornUrl('/sys/dept/list')).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/components/ren-region-tree/src/ren-region-tree.vue b/src/components/ren-region-tree/src/ren-region-tree.vue index 9036a24..c99003a 100644 --- a/src/components/ren-region-tree/src/ren-region-tree.vue +++ b/src/components/ren-region-tree/src/ren-region-tree.vue @@ -90,7 +90,7 @@ export default { return data.name.indexOf(value) !== -1 }, getDataList (id) { - return this.$http.get('/sys/region/tree').then(({ data: res }) => { + return this.$http.get(this.$http.adornUrl('/sys/region/tree')).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/components/small-title/index.vue b/src/components/small-title/index.vue new file mode 100644 index 0000000..a939ea0 --- /dev/null +++ b/src/components/small-title/index.vue @@ -0,0 +1,67 @@ + + + + + + + + + + diff --git a/src/i18n/en.js b/src/i18n/en.js new file mode 100644 index 0000000..5be8b88 --- /dev/null +++ b/src/i18n/en.js @@ -0,0 +1,557 @@ +const t = {} + +t.loading = 'Loading...' +t.createTime = 'Create Time' + +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' +t.deleteBatch = 'Delete Batch' +t.update = 'Update' +t.query = 'Search' +t.export = 'Export' +t.handle = 'Operations' +t.confirm = 'Confirm' +t.cancel = 'Cancel' +t.clear = 'Clear' +t.logout = 'Logout' +t.manage = 'Handle' +t.createDate = 'Create Date' +t.keyword = 'Keyword(s): ' +t.choose = 'Please Choose ' +t.remark = 'Remark' +t.delMark = 'Delete Mark ' +t.isvalid = 'is valid' +t.available = 'available' +t.unavailable = 'unavailable' +t.alert = 'alert' +t.creator = 'Creator' +t.creatorName = 'Creator\'s name' +t.updator = 'Updator' +t.updatorName = 'Updator\'s name' +t.updateTime = 'Update Time' +t.version = 'Version' +t.search = 'Search' +t.countPerPage = '每页数' // ? +t.currentPage = '当前页' // ? +t.fetchList = '获取数据列表' // ? +t.multi = '多选' // ? +t.do = '进行' // ? +t.submit = '表单提交' // ? +t.desc = 'Description' +t.disable = 'Disable' +t.equipment = 'Equipment' +t.enabled = 'Enabled' +t.cannotempty = 'can\'t be empty' +t.parameter = 'Parameters' +t.enable = 'Enable' +t.index = 'Index' +t.relation = '关联' +t.fetchInfo = 'Fetch Info' +t.name = 'Name' +t.code = 'Code' +t.attrName = 'Attribute name' +t.attrValue = 'Attribute value' +t.unit = 'Unit' +t.table = 'Table' +t.table2 = 'Table' +t.downloadurl = 'Download Url' +t.recordTime = 'Record Time' +t.notCollect = 'No' +t.collect = 'Yes' +t.required = 'Required' +t.paramUrl = 'Parameter url' +t.enname = 'English Name' +t.collectOrNot = 'Collect or not' +t.min = 'Min Value' +t.max = 'Max Value' +t.status = 'Status' +t.normal = 'Normal' +t.addr = 'Address' +t.planStop = 'Plan to stop' +t.startTime = 'Start Time' +t.endTime = 'End Time' +t.today = 'Today' + +t.graph = 'Graph' +t.category = 'Category' +t.categoryName = 'Category Name' +t.categoryCode = 'Category Code' +t.rate = 'Rate' +t.link = 'Link Url' +t.refresh = 'Refresh' +t.abbr = 'Abbreviation' +t.detail = 'Details' +t.viewdetail = 'Details' +t.viewattr = 'View Attributions' +t.edit = 'Edit' +t.source = 'Source' +t.auto = 'Auto' +t.manual = 'Manually' +t.loaddone = 'Loaded' +t.produceTime = 'Date of manufacture' +t.enterTime = 'Enter Time' +t.manufacturer = 'Manufacturer' +t.success = 'success!' +t.all = 'All' +t.reset = 'Reset' +t.preview = 'Preview' +t.design = 'Design' + +t.errors = {} +t.errors.nosection = 'There is no sections on this product line.' +t.errors.numsection = 'There are {num} sections on this product line.' +t.errors.nodata = 'Error, no data available!' + +t.hints = {} +t.hints.input = 'Please input ' +t.hints.select = 'Please select ' +t.hints.date = 'Please select date' +t.hints.checktime = 'Please select inspection time' +t.hints.number = 'Please input correct number' +t.hints.addr = 'Please input address' +t.hints.upload2m = 'File size cannot be larger than 2mb (2048kb)' +t.hints.upload2mPic = 'Image files only. File size cannot be larger than 2mb (2048kb)' + +t.factory = {} +t.factory.title = 'Factory' +t.factory.name = 'Factory Name' +t.factory.code = 'Factory Code' + +t.prod = {} +t.prod.id = 'Product ID' +t.prod.name = 'Product Name' +t.prod.code = 'Product Code' +t.prod.type = 'Product Type' +t.prod.area = 'Area' +t.prod.spec = 'Product Specification' +t.prod.attr = 'Dynamic Attributes' +t.prod.attrcode = 'Attribute Code' +t.prod.attrcodeHints = 'Please input attribute code' +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 (Hours)' +t.prod.processTimeHints = 'Please input processing time' +t.prod.relatedPid = 'Related Product' + +t.alarm = {} +t.alarm.name = 'Alarm' +t.alarm.info = 'Alarm Informations' +t.alarm.view = 'View Alarm' +t.alarm.eq = 'Alarm Equipment' +t.alarm.type = 'Alarm Type' +t.alarm.code = 'Alarm Code' +t.alarm.level = 'Alarm Level' +t.alarm.content = 'Alarm Content' +t.alarm.source = 'Alarm Source' +t.alarm.det = 'Alarm Details' + +t.report = {} +t.report.name = 'Report Name' +t.report.det = 'Report Content' +t.report.type = 'Report Type' +t.report.code = 'Report Code' +t.report.lnk = 'Report Url' + +t.inspect = {} +t.inspect.type = 'Inspection Type' +t.inspect.code = 'Inspection Code' +t.inspect.det = 'Inspection Details' +t.inspect.detcode = 'Inspection Content Code' +t.inspect.people = 'Inspector' +t.inspect.time = 'Inspection Time' +t.inspect.typetotal = 'Total Inspection Types' +t.inspect.typename = 'Inspection Type' +t.inspect.typecode = 'Inspection Code' +t.inspect.ioTotal = 'Data of input/output and total inspections' +t.inspect.plTotal = 'Inspection types per line' +t.inspect.inTotal = 'Up Sum' +t.inspect.outTotal = 'Down Sum' +t.inspect.checkTotal = 'Total Inspections' +t.inspect.rate = 'Rate' +t.inspect.typeCount = 'Data of inspection types' + + +t.realtime = {} +t.realtime.eq = 'Realtime data of equipments' +t.realtime.pl = 'Realtime data of product lines' +t.realtime.inspect = 'Realtime data of quality inspections' +t.realtime.in = 'in' +t.realtime.out = 'out' +t.realtime.data = 'scrap' +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 = {} +t.ws.title = 'Work Section' +t.ws.id = 'Work Section ID' +t.ws.name = 'Work Section Name' +t.ws.code = 'Work Section Code' +t.ws.binded = 'Binded Equipments' +t.ws.unbind = 'Please select an equipment to bind.' +t.ws.sort = 'sort' +t.ws.setorder = 'Please input order of equipments in the work section.' +t.ws.bind = 'bind' +t.ws.eqbind = 'Binded Equipment(s)' +t.ws.belong = 'Product Line' + +t.file = {} +t.file.title = 'File' +t.file.name = 'File Name' +t.file.code = 'File Code' +t.file.typeName = 'File Type' +t.file.typeCode = 'File Type Code' + +t.eq = {} +t.eq.title = 'Equipment' +t.eq.id = 'Equipment ID' +t.eq.name = 'Equipment Name' +t.eq.code = 'Equipment Code' +t.eq.type = 'Equipment Type' +t.eq.grade = 'Specification of equipment' +t.eq.group = 'Equipment Group' +t.eq.groupname = 'Group Name' +t.eq.groupcode = 'Group Code' +t.eq.excode = 'External Code' +t.eq.input = 'Input Device' +t.eq.output = 'Output Device' +t.eq.tvalue = 'Device\'s TT Value' +t.eq.processingTime = 'Processing Time (s)' +t.eq.dtype = 'Data source' +t.eq.dtypenone = 'none' +t.eq.dtypeinput = 'Input Data Device' +t.eq.dtypeoutput = 'Output Data Device' +t.eq.upload = 'Upload' +t.eq.image = 'Equipment Pictures' +t.eq.viewattr = 'Equipment Attributions' +t.eq.plcbarcode = 'PLC Bar Code' +t.eq.plccode = 'PLC Code' +t.eq.plcname = 'PLC Name' +t.eq.port = 'Port' +t.eq.type = 'Type' +t.eq.typecode = 'Type Code' +t.eq.parent = 'Parent' + + +t.pl = {} +t.pl.title = 'Product Line' +t.pl.id = 'Product Line ID' +t.pl.name = 'Product Line Name' +t.pl.code = 'Product Line Code' +t.pl.status = 'Product Line Status' +t.pl.belong = 'Product Line' +t.pl.tvalue = 'TT Value' +t.pl.factoryHints = 'Please select a factory' + +t.prompt = {} +t.prompt.title = 'Prompt' +t.prompt.info = 'Are you sure to {handle}?' +t.prompt.sure = 'Are you sure to delete this record?' +t.prompt.success = 'success' +t.prompt.failed = 'failed' +t.prompt.deleteBatch = 'Please choose items to delete.' + +t.validate = {} +t.validate.required = 'This is required.' +t.validate.format = '{attr} has a wrong format.' + +t.upload = {} +t.upload.title = 'Upload Assets' +t.upload.text = '将文件拖到此处,或点击上传' +t.upload.tip = 'Only support files with format: {format}' +t.upload.button = 'upload' + +t.datePicker = {} +t.datePicker.range = 'to' +t.datePicker.start = 'Start Time' +t.datePicker.end = 'End Time' + +t.fullscreen = {} +t.fullscreen.prompt = 'This operation is not supported by your browser.' + +t.updatePassword = {} +t.updatePassword.title = 'Update Password' +t.updatePassword.username = 'Username' +t.updatePassword.password = 'Current Password' +t.updatePassword.newPassword = 'New Password' +t.updatePassword.confirmPassword = 'Confirm Password' +t.updatePassword.validate = {} +t.updatePassword.validate.confirmPassword = 'The two passwords are different. Please check again.' + +t.contentTabs = {} +t.contentTabs.closeCurrent = 'Close current tab' +t.contentTabs.closeOther = 'Close other tabs' +t.contentTabs.closeAll = 'Close all tabs' + +/* 页面 */ +t.notFound = {} +t.notFound.desc = 'Sorry! The page you\'re looking is missing.' +t.notFound.back = 'Back' +t.notFound.home = 'Home Page' + +t.login = {} +t.login.title = 'Login' +t.login.username = 'Username' +t.login.password = 'Password' +t.login.captcha = 'Captcha' +t.login.demo = 'Demo' +t.login.copyright = 'Copyright @Intelligent Automation Research Institute Co., Ltd Version: 1.0' + +t.schedule = {} +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 = 'Log List' +t.schedule.params = 'Parameters' +t.schedule.cronExpression = 'cron expression' +t.schedule.cronExpressionTips = 'ex: 0 0 12 * * ?' +t.schedule.remark = 'Remark' +t.schedule.status = 'Status' +t.schedule.status0 = 'Pause' +t.schedule.status1 = 'Normal' +t.schedule.statusLog0 = 'Failed' +t.schedule.statusLog1 = 'Success' +t.schedule.pause = 'Pause' +t.schedule.resume = 'Resume' +t.schedule.run = 'Excute' +t.schedule.jobId = 'Job ID' +t.schedule.times = 'Time Cost (ms)' +t.schedule.createDate = 'Executed Tune' // ? + +t.oss = {} +t.oss.config = '云存储配置' +t.oss.upload = '上传文件' +t.oss.url = 'URL地址' +t.oss.createDate = 'Create Time' +t.oss.type = '类型' +t.oss.type1 = '七牛' +t.oss.type2 = '阿里云' +t.oss.type3 = '腾讯云' +t.oss.qiniuDomain = '域名' +t.oss.qiniuDomainTips = '七牛绑定的域名' +t.oss.qiniuPrefix = '路径前缀' +t.oss.qiniuPrefixTips = '不设置默认为空' +t.oss.qiniuAccessKey = 'AccessKey' +t.oss.qiniuAccessKeyTips = '七牛AccessKey' +t.oss.qiniuSecretKey = 'SecretKey' +t.oss.qiniuSecretKeyTips = '七牛SecretKey' +t.oss.qiniuBucketName = '空间名' +t.oss.qiniuBucketNameTips = '七牛存储空间名' +t.oss.aliyunDomain = '域名' +t.oss.aliyunDomainTips = '阿里云绑定的域名,如:http://cdn.renren.io' +t.oss.aliyunPrefix = '路径前缀' +t.oss.aliyunPrefixTips = '不设置默认为空' +t.oss.aliyunEndPoint = 'EndPoint' +t.oss.aliyunEndPointTips = '阿里云EndPoint' +t.oss.aliyunAccessKeyId = 'AccessKeyId' +t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId' +t.oss.aliyunAccessKeySecret = 'AccessKeySecret' +t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret' +t.oss.aliyunBucketName = 'BucketName' +t.oss.aliyunBucketNameTips = '阿里云BucketName' +t.oss.qcloudDomain = '域名' +t.oss.qcloudDomainTips = '腾讯云绑定的域名' +t.oss.qcloudPrefix = '路径前缀' +t.oss.qcloudPrefixTips = '不设置默认为空' +t.oss.qcloudAppId = 'AppId' +t.oss.qcloudAppIdTips = '腾讯云AppId' +t.oss.qcloudSecretId = 'SecretId' +t.oss.qcloudSecretIdTips = '腾讯云SecretId' +t.oss.qcloudSecretKey = 'SecretKey' +t.oss.qcloudSecretKeyTips = '腾讯云SecretKey' +t.oss.qcloudBucketName = 'BucketName' +t.oss.qcloudBucketNameTips = '腾讯云BucketName' +t.oss.qcloudRegion = '所属地区' +t.oss.qcloudRegionTips = '请选择' +t.oss.qcloudRegionBeijing1 = '北京一区(华北)' +t.oss.qcloudRegionBeijing = '北京' +t.oss.qcloudRegionShanghai = '上海(华东)' +t.oss.qcloudRegionGuangzhou = '广州(华南)' +t.oss.qcloudRegionChengdu = '成都(西南)' +t.oss.qcloudRegionChongqing = '重庆' +t.oss.qcloudRegionSingapore = '新加坡' +t.oss.qcloudRegionHongkong = '香港' +t.oss.qcloudRegionToronto = '多伦多' +t.oss.qcloudRegionFrankfurt = '法兰克福' + +t.dept = {} +t.dept.name = 'Department Name' +t.dept.parentName = 'Superior Department' +t.dept.sort = 'Sort' +t.dept.parentNameDefault = 'First tier department' +t.dept.chooseerror = 'Please select a department' +t.dept.title = 'Department Selection' + +t.dict = {} +t.dict.dictName = 'Dictionary Name' +t.dict.dictType = 'Dictionary Type' +t.dict.dictLabel = 'Dictionary Label' +t.dict.dictValue = 'Dictionary Value' +t.dict.sort = 'Sort' +t.dict.remark = 'Remark' +t.dict.createDate = 'Create Time' + +t.logError = {} +t.logError.requestUri = 'Request URI' +t.logError.requestMethod = 'Request Method' +t.logError.requestParams = 'Request Parameters' +t.logError.ip = 'IP' +t.logError.userAgent = 'User Agent' +t.logError.createDate = 'Create Time' +t.logError.errorInfo = 'Exceptions' + +t.logLogin = {} +t.logLogin.creatorName = 'User Name' +t.logLogin.status = 'Status' +t.logLogin.status0 = 'Failed' +t.logLogin.status1 = 'Success' +t.logLogin.status2 = 'Account has been locked' +t.logLogin.operation = 'Operation Type' +t.logLogin.operation0 = 'Login' +t.logLogin.operation1 = 'Logout' +t.logLogin.ip = 'IP' +t.logLogin.userAgent = 'User-Agent' +t.logLogin.createDate = 'Create Time' + +t.logOperation = {} +t.logOperation.status = 'Status' +t.logOperation.status0 = 'Failed' +t.logOperation.status1 = 'Success' +t.logOperation.creatorName = 'User Name' +t.logOperation.operation = 'User Operations' +t.logOperation.requestUri = 'Request URI' +t.logOperation.requestMethod = 'Request Method' +t.logOperation.requestParams = 'Request Parameters' +t.logOperation.requestTime = 'Request Duration' +t.logOperation.ip = 'IP' +t.logOperation.userAgent = 'User-Agent' +t.logOperation.createDate = 'Create Time' + +t.menu = {} +t.menu.name = 'Name' +t.menu.icon = 'Icons' +t.menu.type = 'Type' +t.menu.type0 = 'Menu' +t.menu.type1 = 'Button' +t.menu.sort = 'Sort' +t.menu.url = 'Route' +t.menu.permissions = '授权标识' +t.menu.permissionsTips = '多个用逗号分隔,如:sys:menu:save,sys:menu:update' +t.menu.parentName = '上级菜单' +t.menu.parentNameDefault = 'First tier menu' +t.menu.resource = '授权资源' +t.menu.resourceUrl = '资源URL' +t.menu.resourceMethod = 'Request methods' +t.menu.resourceAddItem = '添加一项' + +t.params = {} +t.params.name = 'Parameter Name' +t.params.code = 'Parameter Code' +t.params.paramCode = 'Parameter Code' +t.params.paramValue = 'Parameter Value' +t.params.paramStdValue = 'Standard Parameter Code' +t.params.plctitle = 'PLC Collection Parameters' +t.params.plcid = 'PLC连接表ID' +t.params.remark = 'Remark' + +t.role = {} +t.role.name = 'Role Name' +t.role.remark = 'Remark' +t.role.createDate = 'Create Time' +t.role.menuList = 'Menu authorization' // ? +t.role.deptList = 'Data authorization' // ? + +t.user = {} +t.user.username = 'User Name' +t.user.deptName = 'Department' +t.user.email = 'Email' +t.user.mobile = 'Phone' +t.user.status = 'Status' +t.user.status0 = 'Pause' // ? +t.user.status1 = 'Normal' +t.user.createDate = 'Create Time' +t.user.password = 'Password' +t.user.confirmPassword = 'Confirm Password' +t.user.realName = 'Actual Name' +t.user.gender = 'Gender' +t.user.gender0 = 'male' +t.user.gender1 = 'female' +t.user.gender2 = 'secret' +t.user.roleIdList = 'Role Configurations' +t.user.validate = {} +t.user.validate.confirmPassword = 'The two passwords are different. Please check again.' +t.user.select = 'Select an user' +t.user.selecterror = 'Pick up a record' + +export default t \ No newline at end of file diff --git a/src/i18n/index.js b/src/i18n/index.js index 1ea81ad..65d11cf 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -2,8 +2,9 @@ import Vue from 'vue' import VueI18n from 'vue-i18n' import Cookies from 'js-cookie' import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN' +import enLocale from 'element-ui/lib/locale/lang/en' import zhCN from './zh-CN' - +import en from './en' Vue.use(VueI18n) export const messages = { @@ -11,10 +12,36 @@ export const messages = { '_lang': '简体中文', ...zhCN, ...zhCNLocale + }, + 'en': { + '_lang': 'English', + ...en, + ...enLocale } } +export function getLanguage() { + if (Cookies.get('language')) { + return Cookies.get('language') + } + + // if has not choose language + const language = (navigator.language || navigator.browserLanguage) + + const locales = Object.keys(messages) + for (const locale of locales) { + if (language.indexOf(locale) > -1) { + Cookies.set('language', locale) + return locale + } + } + Cookies.set('language', 'en') + return 'en' + +} + export default new VueI18n({ - locale: Cookies.get('language') || 'zh-CN', + // locale: Cookies.get('language') || 'zh-CN', + locale: getLanguage(), // 先默认中文 messages }) diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 7521940..6acd25b 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -1,30 +1,326 @@ const t = {} t.loading = '加载中...' +t.createTime = '添加时间' t.brand = {} -t.brand.lg = '人人权限系统' -t.brand.mini = '人人' +t.brand.lg = '生产监控系统' +t.brand.mini = '监控' -t.add = '新增' -t.delete = '删除' -t.deleteBatch = '删除' -t.update = '修改' -t.query = '查询' -t.export = '导出' -t.handle = '操作' -t.confirm = '确定' -t.cancel = '取消' -t.clear = '清除' -t.logout = '退出' -t.manage = '处理' -t.createDate = '创建时间' -t.keyword = '关键字:' -t.choose = '请选择' +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['质量检测信息'] = '质量检测信息' + + + + + +t.save = '保存' +t.add = '新增' // 1 +t.delete = '删除' // 1 +t.deleteBatch = '批量删除' // 1 +t.update = '修改' // 1 +t.query = '查询' // 1 +t.export = '导出' // 1 +t.handle = '操作' // 1 +t.confirm = '确定' // 1 +t.cancel = '取消' // 1 +t.clear = '清除' // 1 +t.logout = '退出' // 1 +t.manage = '处理' // 1 +t.createDate = '创建时间' // 1 +t.keyword = '关键字:' // 1 +t.choose = '请选择' // 1 +t.remark = '备注' // 1 +t.delMark = '删除标志' // 0 +t.isvalid = '是否有效' // 0 +t.available = '可用' // 0 +t.unavailable = '不可用' // 0 +t.alert = '弹窗' // 0 +t.creator = '创建人' // 1 +t.creatorName = '创建人姓名' // 1 +t.updator = '更新人' // 1 +t.updatorName = '更新人姓名' // 1 +t.updateTime = '更新时间' +t.version = '版本号' // 1 +t.search = '查询' // 1 +t.countPerPage = '每页数' // ? +t.currentPage = '当前页' // ? +t.fetchList = '获取数据列表' // ? +t.multi = '多选' // ? +t.do = '进行' // ? +t.submit = '表单提交' // ? +t.desc = '描述' // 1 +t.disable = '停用' // 1 +t.equipment = '设备' // 1 +t.enabled = '启用状态' // ? +t.cannotempty = '不能为空' // ? +t.parameter = '参数名' // 1 +t.enable = '启用' // 1 +t.index = '序号' // 1 +t.relation = '关联' // ? +t.fetchInfo = '获取信息' // ? +t.name = '名称' // 1 +t.code = '编码' // 1 +t.attrName = '属性名称' // 1 +t.attrValue = '属性值' // 1 +t.unit = '单位' // 1 +t.table = '表' // 1 +t.table2 = '表格' // 1 +t.downloadurl = '下载地址' // 1 +t.recordTime = '记录时间' // 1 +t.notCollect = '不采集' // 1 +t.collect = '采集' // 1 +t.required = '必填' // 1 +t.paramUrl = '参数地址' // 1 +t.enname = '英文名称' // 1 +t.collectOrNot = '是否采集' // 1 +t.min = '最小值' // 1 +t.max = '最大值' // 1 +t.status = '状态' // 1 +t.normal = '正常' // ? +t.addr = '地址' // 1 +t.planStop = '计划停机' // ? +t.startTime = '开始时间' // 1 +t.endTime = '结束时间' // 1 +t.to = '至' // 1 +t.today = '今天' // 1 + +t.graph = '图形' +t.category = '分类' +t.categoryName = '分类名称' +t.categoryCode = '分类编码' +t.rate = '比例' +t.link = '链接地址' +t.refresh = '刷新' +t.abbr = '缩写' +t.detail = '详情' +t.viewdetail = '查看详情' +t.viewattr = '查看属性' +t.edit = '编辑' +t.source = '来源' +t.auto = '自动' +t.manual = '手动' +t.loaddone = '加载完成' +t.produceTime = '生产日期' +t.enterTime = '进厂日期' +t.manufacturer = '制造商' +t.success = '修改成功!' +t.all = '全部' +t.reset = '重置' +t.preview = '预览' +t.design = '设计' + +t.errors = {} +t.errors.nosection = '该产线没有工段' +t.errors.numsection = '该产线有{num}条工段' +t.errors.nodata = '没有查询到相关数据!' + +t.hints = {} +t.hints.input = '请输入' +t.hints.select = '请选择' +t.hints.date = '请选择日期' +t.hints.checktime = '请选择检测时间' +t.hints.number = '请输入正确的数值' +t.hints.addr = '请输入地址' +t.hints.upload2m = '上传文件大小不要超过 2mb (2048kb)' +t.hints.upload2mPic = '上传图片文件,且大小不要超过 2mb (2048kb)' + +t.factory = {} +t.factory.title = '工厂' +t.factory.name = '工厂名称' +t.factory.code = '工厂编码' + +t.prod = {} +t.prod.id = '产品ID' +t.prod.name = '产品名称' +t.prod.code = '产品编码' +t.prod.type = '产品类型' +t.prod.area = '单位平方数' +t.prod.spec = '规格' +t.prod.attr = '动态属性' +t.prod.attrcode = '属性编码' +t.prod.attrcodeHints = '请输入属性编码' +t.prod.attrname = '属性名称' +t.prod.attrnameHints = '请输入属性名称' +t.prod.attrvalueHints = '请输入属性值' +t.prod.descHints = '请输入描述' +t.prod.processTime = '加工时间 (h)' +t.prod.processTimeHints = '请输入加工时间' +t.prod.relatedPid = '关联产品' + +t.alarm = {} +t.alarm.name = '报警' +t.alarm.info = '报警信息' +t.alarm.view = '查看报警' +t.alarm.eq = '报警设备' +t.alarm.type = '报警类型' +t.alarm.code = '报警编码' +t.alarm.level = '报警级别' +t.alarm.content = '报警内容' +t.alarm.source = '报警来源' +t.alarm.det = '报警详细内容' + +t.report = {} +t.report.name = '报表名称' +t.report.det = '报表内容' +t.report.type = '报表分类' +t.report.code = '报表编码' +t.report.lnk = '链接地址' + +t.inspect = {} +t.inspect.type = '检测类型' +t.inspect.code = '检测编码' +t.inspect.det = '检测内容' +t.inspect.detcode = '内容编码' +t.inspect.people = '检测人员' +t.inspect.time = '检测时间' +t.inspect.typetotal = '检测类型总数' +t.inspect.typename = '检测类型名称' +t.inspect.typecode = '检测类型编码' +t.inspect.ioTotal = '上下片及检测总数统计' +t.inspect.plTotal = '各产线检测类型统计' +t.inspect.inTotal = '上片总数' +t.inspect.outTotal = '下片总数' +t.inspect.checkTotal = '检测总数' +t.inspect.rate = '比例' +t.inspect.typeCount = '检测类型统计数据' + + +t.realtime = {} +t.realtime.eq = '设备生产实时数据' +t.realtime.pl = '产线生产实时数据' +t.realtime.inspect = '质量检查实时数据' +t.realtime.in = '进数据' +t.realtime.out = '出数据' +t.realtime.data = '报废数据' +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 = {} +t.ws.title = '工段' +t.ws.id = '工段ID' +t.ws.name = '工段名称' +t.ws.code = '工段编码' +t.ws.binded = '已绑定的设备' +t.ws.unbind = '选择一个设备进行绑定' +t.ws.sort = '排序' +t.ws.setorder = '请输入工段中设备的顺序' +t.ws.bind = '绑定' +t.ws.eqbind = '设备绑定' +t.ws.belong = '所属产线' + +t.file = {} +t.file.title = '文件' +t.file.name = '文件名称' +t.file.code = '文件编号' +t.file.typeName = '文件类型名称' +t.file.typeCode = '文件类型编号' + +t.eq = {} +t.eq.title = '设备' +t.eq.id = '设备ID' +t.eq.name = '设备名称' +t.eq.code = '设备编码' +t.eq.type = '设备类型' +t.eq.grade = '设备规格' +t.eq.group = '设备分组' +t.eq.groupname = '分组名称' +t.eq.groupcode = '分组编码' +t.eq.excode = '设备外部代码' +t.eq.input = '上片数据设备' +t.eq.output = '下片数据设备' +t.eq.tvalue = '设备TT值' +t.eq.processingTime = '单件产品加工时间(秒)' +t.eq.dtype = '数据类别' +t.eq.dtypenone = '无类别' +t.eq.dtypeinput = '上片数据设备' +t.eq.dtypeoutput = '下片数据设备' +t.eq.upload = '上传资料' +t.eq.image = '设备图片' +t.eq.viewattr = '查看设备属性' +t.eq.plcbarcode = 'plc条码' +t.eq.plccode = 'PLC编码' +t.eq.plcname = 'PLC名称' +t.eq.port = '端口' +t.eq.type = '类型名称' +t.eq.typecode = '类型编码' +t.eq.parent = '父类' + + +t.pl = {} +t.pl.title = '产线' +t.pl.id = '产线ID' +t.pl.name = '产线名称' +t.pl.code = '产线编码' +t.pl.status = '产线状态' +t.pl.belong = '所属产线' +t.pl.tvalue = '产线TT值(每小时下片数量)' +t.pl.factoryHints = '请选择所属工厂' t.prompt = {} t.prompt.title = '提示' t.prompt.info = '确定进行[{handle}]操作?' +t.prompt.sure = '确定删除这条记录吗?' t.prompt.success = '操作成功' t.prompt.failed = '操作失败' t.prompt.deleteBatch = '请选择删除项' @@ -34,6 +330,7 @@ t.validate.required = '必填项不能为空' t.validate.format = '{attr}格式错误' t.upload = {} +t.upload.title = '上传资料' t.upload.text = '将文件拖到此处,或点击上传' t.upload.tip = '只支持{format}格式文件!' t.upload.button = '点击上传' @@ -72,7 +369,7 @@ t.login.username = '用户名' t.login.password = '密码' t.login.captcha = '验证码' t.login.demo = '在线演示' -t.login.copyright = '人人开源' +t.login.copyright = '版权所有:中建材智能自动化研究院有限公司 版本: 1.0' t.schedule = {} t.schedule.beanName = 'bean名称' @@ -224,8 +521,13 @@ t.menu.resourceMethod = '请求方式' t.menu.resourceAddItem = '添加一项' t.params = {} +t.params.name = '参数名称' +t.params.code = '参数编码' t.params.paramCode = '编码' t.params.paramValue = '值' +t.params.paramStdValue = '参数设定标准值' +t.params.plctitle = 'PLC采集参数' +t.params.plcid = 'PLC连接表ID' t.params.remark = '备注' t.role = {} diff --git a/src/main.js b/src/main.js index 6837490..1944cca 100644 --- a/src/main.js +++ b/src/main.js @@ -31,6 +31,10 @@ Vue.use(renRegionTree) Vue.prototype.$http = http Vue.prototype.$hasPermission = hasPermission Vue.prototype.$getDictLabel = getDictLabel +// is auth +Vue.prototype.isAuth = permission => { + return "正在检查的权限是:" + permission +} // 保存整站vuex本地储存初始状态 window.SITE_CONFIG['storeState'] = cloneDeep(store.state) diff --git a/src/mixins/dictlist-module.js b/src/mixins/dictlist-module.js new file mode 100644 index 0000000..0c4d17e --- /dev/null +++ b/src/mixins/dictlist-module.js @@ -0,0 +1,24 @@ + +export default { + data() { + return { + dictList: {} + } + }, + methods: { + initDictList(dictTypeIdList) { + const allDictList = JSON.parse(localStorage.getItem('dictList')) + if (!Object.keys(allDictList).length) { + return this.$message({ + // TODO: i18n + message: '未能获取数据字典', + type: 'error', + duration: 2000 + }) + } + dictTypeIdList.forEach(id => { + this.dictList[id] = allDictList[id].map(item => ({ label: item.dictLabel, value: item.dictValue })) + }) + } + } +} \ No newline at end of file diff --git a/src/mixins/view-module.js b/src/mixins/view-module.js index 4306320..c113c54 100644 --- a/src/mixins/view-module.js +++ b/src/mixins/view-module.js @@ -1,7 +1,7 @@ import Cookies from 'js-cookie' import qs from 'qs' export default { - data () { + data() { /* eslint-disable */ return { // 设置属性 @@ -29,22 +29,24 @@ export default { } /* eslint-enable */ }, - created () { + created() { if (this.mixinViewModuleOptions.createdIsNeed) { this.query() } }, - activated () { + activated() { if (this.mixinViewModuleOptions.activatedIsNeed) { this.query() } }, methods: { // 获取数据列表 - query () { + query() { this.dataListLoading = true this.$http.get( - this.mixinViewModuleOptions.getDataListURL, + this.$http.adornUrl( + this.mixinViewModuleOptions.getDataListURL + ), { params: { order: this.order, @@ -68,11 +70,11 @@ export default { }) }, // 多选 - dataListSelectionChangeHandle (val) { + dataListSelectionChangeHandle(val) { this.dataListSelections = val }, // 排序 - dataListSortChangeHandle (data) { + dataListSortChangeHandle(data) { if (!data.order || !data.prop) { this.order = '' this.orderField = '' @@ -83,13 +85,13 @@ export default { this.query() }, // 分页, 每页条数 - pageSizeChangeHandle (val) { + pageSizeChangeHandle(val) { this.page = 1 this.limit = val this.query() }, // 分页, 当前页 - pageCurrentChangeHandle (val) { + pageCurrentChangeHandle(val) { this.page = val this.query() }, @@ -98,7 +100,7 @@ export default { this.query() }, // 新增 / 修改 - addOrUpdateHandle (id) { + addOrUpdateHandle(id) { this.addOrUpdateVisible = true this.$nextTick(() => { this.$refs.addOrUpdate.dataForm.id = id @@ -106,7 +108,7 @@ export default { }) }, // 关闭当前窗口 - closeCurrentTab (data) { + closeCurrentTab(data) { var tabName = this.$store.state.contentTabsActiveName this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName) if (this.$store.state.contentTabs.length <= 0) { @@ -118,7 +120,7 @@ export default { } }, // 删除 - deleteHandle (id) { + deleteHandle(id) { if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) { return this.$message({ message: this.$t('prompt.deleteBatch'), @@ -132,7 +134,7 @@ export default { type: 'warning' }).then(() => { this.$http.delete( - `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`, + this.$http.adornUrl(`${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`), this.mixinViewModuleOptions.deleteIsBatch ? { 'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey]) } : {} @@ -148,11 +150,11 @@ export default { this.query() } }) - }).catch(() => {}) - }).catch(() => {}) + }).catch(() => { }) + }).catch(() => { }) }, // 导出 - exportHandle () { + exportHandle() { var params = qs.stringify({ 'token': Cookies.get('token'), ...this.dataForm diff --git a/src/router/index.js b/src/router/index.js index 5c4c2a2..b3fbb07 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,6 +2,8 @@ import Vue from 'vue' 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) @@ -12,7 +14,7 @@ export const pageRoutes = [ component: () => import('@/views/pages/404'), name: '404', meta: { title: '404未找到' }, - beforeEnter (to, from, next) { + beforeEnter(to, from, next) { // 拦截处理特殊业务场景 // 如果, 重定向路由包含__双下划线, 为临时添加路由 if (/__.*/.test(to.redirectedFrom)) { @@ -21,7 +23,20 @@ export const pageRoutes = [ next() } }, - { path: '/login', component: () => import('@/views/pages/login'), name: 'login', meta: { title: '登录' } } + { + path: '/login', + component: () => import('@/views/pages/login'), + name: 'login', + meta: { title: '登录' }, + beforeEnter(to, from, next) { + if (Cookies.get('token')) { + Vue.prototype.$message({ message: '已经登录过了', type: 'error' }) + next(false) + } else { + next() + } + } + } ] // 模块路由(基于主入口布局页面) @@ -36,7 +51,7 @@ export const moduleRoutes = { ] } -export function addDynamicRoute (routeParams, router) { +export function addDynamicRoute(routeParams, router) { // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 var routeName = routeParams.routeName var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0] @@ -77,24 +92,30 @@ router.beforeEach((to, from, next) => { if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) { return next() } + // 获取字典列表, 添加并全局变量保存 - http.get('/sys/dict/type/all').then(({ data: res }) => { + http.get(http.adornUrl('/sys/dict/type/all')).then(({ data: res }) => { if (res.code !== 0) { return } window.SITE_CONFIG['dictList'] = res.data - }).catch(() => {}) + }).catch((err) => { + }) // 获取菜单列表, 添加并全局变量保存 - http.get('/sys/menu/nav').then(({ data: res }) => { - if (res.code !== 0) { - Vue.prototype.$message.error(res.msg) - return next({ name: 'login' }) - } + 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(() => { - next({ name: 'login' }) + }).catch((err) => { + // Vue.prototype.$message.error(err) }) }) @@ -103,7 +124,7 @@ router.beforeEach((to, from, next) => { * @param {*} route 当前路由 * @param {*} pageRoutes 页面路由 */ -function fnCurrentRouteIsPageRoute (route, pageRoutes = []) { +function fnCurrentRouteIsPageRoute(route, pageRoutes = []) { var temp = [] for (var i = 0; i < pageRoutes.length; i++) { if (route.path === pageRoutes[i].path) { @@ -121,10 +142,13 @@ function fnCurrentRouteIsPageRoute (route, pageRoutes = []) { * @param {*} menuList 菜单列表 * @param {*} routes 递归创建的动态(菜单)路由 */ -function fnAddDynamicMenuRoutes (menuList = [], routes = []) { +function fnAddDynamicMenuRoutes(menuList = [], routes = []) { var temp = [] + 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 } @@ -136,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)) { @@ -151,9 +181,11 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) { } routes.push(route) } + if (temp.length >= 1) { return fnAddDynamicMenuRoutes(temp, routes) } + // 添加路由 router.addRoutes([ { diff --git a/src/utils/filters.js b/src/utils/filters.js new file mode 100644 index 0000000..a41e535 --- /dev/null +++ b/src/utils/filters.js @@ -0,0 +1,12 @@ +/** filters */ +import moment from 'moment' + +export const dictFilter = dictTypeId => { + return val => { + return JSON.parse(localStorage.getItem('dictList'))[dictTypeId].find(item => item.dictValue === val)?.dictLabel || '-' + } +} + +export const timeFilter = (val) => { + return moment(val).format('YYYY-MM-DD HH:mm:ss') +} diff --git a/src/utils/index.js b/src/utils/index.js index bf8bb9b..3263972 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -5,7 +5,7 @@ import store from '@/store' * 权限 * @param {*} key */ -export function hasPermission (key) { +export function hasPermission(key) { return window.SITE_CONFIG['permissions'].indexOf(key) !== -1 || false } @@ -13,7 +13,7 @@ export function hasPermission (key) { * 获取字典数据列表 * @param dictType 字典类型 */ -export function getDictDataList (dictType) { +export function getDictDataList(dictType) { const type = window.SITE_CONFIG['dictList'].find((element) => (element.dictType === dictType)) if (type) { return type.dataList @@ -27,7 +27,7 @@ export function getDictDataList (dictType) { * @param dictType 字典类型 * @param dictValue 字典值 */ -export function getDictLabel (dictType, dictValue) { +export function getDictLabel(dictType, dictValue) { const type = window.SITE_CONFIG['dictList'].find((element) => (element.dictType === dictType)) if (type) { const val = type.dataList.find((element) => (element.dictValue === dictValue + '')) @@ -44,16 +44,17 @@ export function getDictLabel (dictType, dictValue) { /** * 清除登录信息 */ -export function clearLoginInfo () { +export function clearLoginInfo() { store.commit('resetStore') Cookies.remove('token') window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false + window.SITE_CONFIG['dynamicMenuRoutes'] = [] } /** * 获取uuid */ -export function getUUID () { +export function getUUID() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16) }) @@ -62,7 +63,7 @@ export function getUUID () { /** * 获取svg图标(id)列表 */ -export function getIconList () { +export function getIconList() { var res = [] var list = document.querySelectorAll('svg symbol') for (var i = 0; i < list.length; i++) { @@ -73,12 +74,12 @@ export function getIconList () { } /** - * 树形数据转换 + * 树形数据转换,把扁平的数据,转换为树形结构的数据 * @param {*} data * @param {*} id * @param {*} pid */ -export function treeDataTranslate (data, id = 'id', pid = 'pid') { +export function treeDataTranslate(data, id = 'id', pid = 'pid') { var res = [] var temp = {} for (var i = 0; i < data.length; i++) { @@ -97,3 +98,19 @@ export function treeDataTranslate (data, id = 'id', pid = 'pid') { } return res } + +/** 计算表格的最大高 */ +export function calcMaxHeight(num) { + const FIXED_HEIGHT = 220 + let clientHeight = 0 + const bodyHeight = document.body.clientHeight || null + const documentHeight = document.documentElement.clientHeight || null + if (bodyHeight && documentHeight) { + clientHeight = Math.max(bodyHeight, documentHeight) + } else { + clientHeight = documentHeight ? documentHeight : bodyHeight + } + + const finalHeight = clientHeight - num - FIXED_HEIGHT + return finalHeight > 0 ? finalHeight : -finalHeight +} \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 19eab38..134bf99 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -4,9 +4,12 @@ import router from '@/router' import qs from 'qs' import { clearLoginInfo } from '@/utils' 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 }) @@ -55,10 +58,54 @@ http.interceptors.response.use(response => { router.replace({ name: 'login' }) return Promise.reject(response.data.msg) } + // else if (response.data.code === 500) { + // return Promise.reject(response.data.msg) + // } return response }, error => { console.error(error) return Promise.reject(error) }) +/** + * 请求地址处理 + * @param {*} actionName action方法名称 + */ +http.adornUrl = (actionName) => { + // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截! + // 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 +} + +/** + * get请求参数处理 + * @param {*} params 参数对象 + * @param {*} openDefultParams 是否开启默认参数? + */ +http.adornParams = (params = {}, openDefaultParams = true) => { + var defaults = { + 't': new Date().getTime() + } + return openDefaultParams ? merge(defaults, params) : params +} + +/** + * post请求数据处理 + * @param {*} data 数据对象 + * @param {*} openDefultdata 是否开启默认数据? + * @param {*} contentType 数据格式 + * json: 'application/json; charset=utf-8' + * form: 'application/x-www-form-urlencoded; charset=utf-8' + */ +http.adornData = (data = {}, openDefaultdata = true, contentType = 'json') => { + var defaults = { + 't': new Date().getTime() + } + data = openDefaultdata ? merge(defaults, data) : data + return contentType === 'raw' ? data : contentType === 'json' ? JSON.stringify(data) : qs.stringify(data) + // return contentType === 'json' ? JSON.stringify(data, (_, v) => typeof v === 'bigint' ? v.toString() : v) : qs.stringify(data) +} + + export default http diff --git a/src/views/main-content.vue b/src/views/main-content.vue index 0ab04d4..e07e65a 100644 --- a/src/views/main-content.vue +++ b/src/views/main-content.vue @@ -1,96 +1,96 @@ - - - - - - - {{ $t('contentTabs.closeCurrent') }} - {{ $t('contentTabs.closeOther') }} - {{ $t('contentTabs.closeAll') }} - - - - - - - - - - - - - - - - - - - - - + + + + + + + {{ $t('contentTabs.closeCurrent') }} + {{ $t('contentTabs.closeOther') }} + {{ $t('contentTabs.closeAll') }} + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/main-navbar-update-password.vue b/src/views/main-navbar-update-password.vue index 6f90d85..7adb136 100644 --- a/src/views/main-navbar-update-password.vue +++ b/src/views/main-navbar-update-password.vue @@ -1,97 +1,95 @@ - - - - {{ $store.state.user.name }} - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + {{ $store.state.user.name }} + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/main-navbar.vue b/src/views/main-navbar.vue index 83e1cb0..7215699 100644 --- a/src/views/main-navbar.vue +++ b/src/views/main-navbar.vue @@ -1,103 +1,184 @@ - - - - {{ $t('brand.lg') }} - {{ $t('brand.mini') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $store.state.user.name }} - - - - {{ $t('updatePassword.title') }} - {{ $t('logout') }} - - - - - - - - + + + + {{ + $t('brand.lg') + }} + {{ + $t('brand.mini') + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + 中文 + En + + + + + + + + + + + + + {{ $store.state.user.name }} + + + + {{ + $t('updatePassword.title') + }} + {{ + $t('logout') + }} + + + + + + + + diff --git a/src/views/main-sidebar-sub-menu.vue b/src/views/main-sidebar-sub-menu.vue index c91e31a..cd5c5c6 100644 --- a/src/views/main-sidebar-sub-menu.vue +++ b/src/views/main-sidebar-sub-menu.vue @@ -1,38 +1,38 @@ - - - - {{ menu.name }} - - - - - - {{ menu.name }} - + + + + {{ menu.name }} + + + + + + {{ menu.name }} + diff --git a/src/views/main-sidebar.vue b/src/views/main-sidebar.vue index bd21b03..703e644 100644 --- a/src/views/main-sidebar.vue +++ b/src/views/main-sidebar.vue @@ -1,30 +1,58 @@ - + diff --git a/src/views/main.vue b/src/views/main.vue index 793c824..2a223d3 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -1,13 +1,13 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/views/modules/home.vue b/src/views/modules/home.vue index 3d692bc..056926e 100644 --- a/src/views/modules/home.vue +++ b/src/views/modules/home.vue @@ -1,31 +1,32 @@ - - - 项目介绍 - - renren-ui基于vue、element-ui构建开发,实现renren-security后台管理前端功能,提供一套更优的前端解决方案 - 前后端分离,通过token进行数据交互,可独立部署 - 动态菜单,通过菜单管理统一管理访问路由 - 演示地址:http://demo.open.renren.io/renren-security (账号密码:admin/admin) - - 获取帮助 - - 官方社区:https://www.renren.io/community - 前端Git地址:https://gitee.com/renrenio/renren-ui - 后台Git地址:https://gitee.com/renrenio/renren-security - 如需关注项目最新动态,请Watch、Star项目,同时也是对项目最好的支持 - - 官方微信群 - - 扫码下面的二维码,关注【人人开源】公众号,回复【加群】,即可根据提示加入微信群! - - - - + + + 项目介绍 + + + renren-ui基于vue、element-ui构建开发,实现renren-security后台管理前端功能,提供一套更优的前端解决方案 + + 前后端分离,通过token进行数据交互,可独立部署 + 动态菜单,通过菜单管理统一管理访问路由 + 演示地址:http://demo.open.renren.io/renren-security (账号密码:admin/admin) + + 获取帮助 + + 官方社区:https://www.renren.io/community + 前端Git地址:https://gitee.com/renrenio/renren-ui + 后台Git地址:https://gitee.com/renrenio/renren-security + 如需关注项目最新动态,请Watch、Star项目,同时也是对项目最好的支持 + + 官方微信群 + + 扫码下面的二维码,关注【人人开源】公众号,回复【加群】,即可根据提示加入微信群! + + + diff --git a/src/views/modules/job/schedule-add-or-update.vue b/src/views/modules/job/schedule-add-or-update.vue index 5808308..2de8da7 100644 --- a/src/views/modules/job/schedule-add-or-update.vue +++ b/src/views/modules/job/schedule-add-or-update.vue @@ -72,7 +72,7 @@ export default { }, // 获取信息 getInfo () { - this.$http.get(`/sys/schedule/${this.dataForm.id}`).then(({ data: res }) => { + this.$http.get(this.$http.adornUrl(`/sys/schedule/${this.dataForm.id}`)).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } @@ -85,7 +85,7 @@ export default { if (!valid) { return false } - this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/schedule', this.dataForm).then(({ data: res }) => { + this.$http[!this.dataForm.id ? 'post' : 'put'](this.$http.adornUrl('/sys/schedule'), this.dataForm).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/views/modules/job/schedule-log.vue b/src/views/modules/job/schedule-log.vue index 11a7f30..bf6b2c2 100644 --- a/src/views/modules/job/schedule-log.vue +++ b/src/views/modules/job/schedule-log.vue @@ -62,7 +62,7 @@ export default { }, // 失败信息 showErrorInfo (id) { - this.$http.get(`/sys/scheduleLog/${id}`).then(({ data: res }) => { + this.$http.get(this.$http.adornUrl(`/sys/scheduleLog/${id}`)).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/views/modules/job/schedule.vue b/src/views/modules/job/schedule.vue index d1af99b..9fab211 100644 --- a/src/views/modules/job/schedule.vue +++ b/src/views/modules/job/schedule.vue @@ -111,7 +111,7 @@ export default { cancelButtonText: this.$t('cancel'), type: 'warning' }).then(() => { - this.$http.put('/sys/schedule/pause', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { + this.$http.put(this.$http.adornUrl('/sys/schedule/pause'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } @@ -140,7 +140,7 @@ export default { cancelButtonText: this.$t('cancel'), type: 'warning' }).then(() => { - this.$http.put('/sys/schedule/resume', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { + this.$http.put(this.$http.adornUrl('/sys/schedule/resume'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } @@ -169,7 +169,7 @@ export default { cancelButtonText: this.$t('cancel'), type: 'warning' }).then(() => { - this.$http.put('/sys/schedule/run', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { + this.$http.put(this.$http.adornUrl('/sys/schedule/run'), id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } diff --git a/src/views/modules/monitoring/equipment.vue b/src/views/modules/monitoring/equipment.vue new file mode 100644 index 0000000..775299f --- /dev/null +++ b/src/views/modules/monitoring/equipment.vue @@ -0,0 +1,444 @@ + + + + + + + + {{ $t('search') }} + {{ $t('add') }} + {{ $t('export') }} + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentAlarmLog-add-or-update.vue b/src/views/modules/monitoring/equipmentAlarmLog-add-or-update.vue new file mode 100644 index 0000000..3d11493 --- /dev/null +++ b/src/views/modules/monitoring/equipmentAlarmLog-add-or-update.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentAlarmLog.vue b/src/views/modules/monitoring/equipmentAlarmLog.vue new file mode 100644 index 0000000..1dea355 --- /dev/null +++ b/src/views/modules/monitoring/equipmentAlarmLog.vue @@ -0,0 +1,158 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentAttr-add-or-update.vue b/src/views/modules/monitoring/equipmentAttr-add-or-update.vue new file mode 100644 index 0000000..3ea5b7c --- /dev/null +++ b/src/views/modules/monitoring/equipmentAttr-add-or-update.vue @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentCurrentState.vue b/src/views/modules/monitoring/equipmentCurrentState.vue new file mode 100644 index 0000000..fdc160c --- /dev/null +++ b/src/views/modules/monitoring/equipmentCurrentState.vue @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + {{ $t('query') }} + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentFile-add-or-update.vue b/src/views/modules/monitoring/equipmentFile-add-or-update.vue new file mode 100644 index 0000000..9ba0af5 --- /dev/null +++ b/src/views/modules/monitoring/equipmentFile-add-or-update.vue @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentFile.vue b/src/views/modules/monitoring/equipmentFile.vue new file mode 100644 index 0000000..3fe7857 --- /dev/null +++ b/src/views/modules/monitoring/equipmentFile.vue @@ -0,0 +1,161 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentGroup.vue b/src/views/modules/monitoring/equipmentGroup.vue new file mode 100644 index 0000000..8b4d61c --- /dev/null +++ b/src/views/modules/monitoring/equipmentGroup.vue @@ -0,0 +1,187 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentGroupAlarm.vue b/src/views/modules/monitoring/equipmentGroupAlarm.vue new file mode 100644 index 0000000..4e4e102 --- /dev/null +++ b/src/views/modules/monitoring/equipmentGroupAlarm.vue @@ -0,0 +1,220 @@ + + + + + {{ $route.params.groupName }} + + + {{ $route.params.groupCode }} + + + + + + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentPlc.vue b/src/views/modules/monitoring/equipmentPlc.vue new file mode 100644 index 0000000..9d3feb0 --- /dev/null +++ b/src/views/modules/monitoring/equipmentPlc.vue @@ -0,0 +1,196 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentPlcConnect.vue b/src/views/modules/monitoring/equipmentPlcConnect.vue new file mode 100644 index 0000000..21d0ec5 --- /dev/null +++ b/src/views/modules/monitoring/equipmentPlcConnect.vue @@ -0,0 +1,260 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentPlcParam-add-or-update.vue b/src/views/modules/monitoring/equipmentPlcParam-add-or-update.vue new file mode 100644 index 0000000..cf7494f --- /dev/null +++ b/src/views/modules/monitoring/equipmentPlcParam-add-or-update.vue @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentPlcParam.vue b/src/views/modules/monitoring/equipmentPlcParam.vue new file mode 100644 index 0000000..31e4e43 --- /dev/null +++ b/src/views/modules/monitoring/equipmentPlcParam.vue @@ -0,0 +1,160 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentQuantity-add-or-update.vue b/src/views/modules/monitoring/equipmentQuantity-add-or-update.vue new file mode 100644 index 0000000..2840161 --- /dev/null +++ b/src/views/modules/monitoring/equipmentQuantity-add-or-update.vue @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentQuantity.vue b/src/views/modules/monitoring/equipmentQuantity.vue new file mode 100644 index 0000000..5eec79d --- /dev/null +++ b/src/views/modules/monitoring/equipmentQuantity.vue @@ -0,0 +1,166 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentStatusLog-add-or-update.vue b/src/views/modules/monitoring/equipmentStatusLog-add-or-update.vue new file mode 100644 index 0000000..db82068 --- /dev/null +++ b/src/views/modules/monitoring/equipmentStatusLog-add-or-update.vue @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentStatusLog.vue b/src/views/modules/monitoring/equipmentStatusLog.vue new file mode 100644 index 0000000..42f3fd3 --- /dev/null +++ b/src/views/modules/monitoring/equipmentStatusLog.vue @@ -0,0 +1,162 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentType.vue b/src/views/modules/monitoring/equipmentType.vue new file mode 100644 index 0000000..fbff02a --- /dev/null +++ b/src/views/modules/monitoring/equipmentType.vue @@ -0,0 +1,211 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentTypeFile-add-or-update.vue b/src/views/modules/monitoring/equipmentTypeFile-add-or-update.vue new file mode 100644 index 0000000..2a42d6c --- /dev/null +++ b/src/views/modules/monitoring/equipmentTypeFile-add-or-update.vue @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/equipmentTypeFile.vue b/src/views/modules/monitoring/equipmentTypeFile.vue new file mode 100644 index 0000000..43ffea3 --- /dev/null +++ b/src/views/modules/monitoring/equipmentTypeFile.vue @@ -0,0 +1,162 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/equipmentattr.vue b/src/views/modules/monitoring/equipmentattr.vue new file mode 100644 index 0000000..ae9f989 --- /dev/null +++ b/src/views/modules/monitoring/equipmentattr.vue @@ -0,0 +1,160 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/factory.vue b/src/views/modules/monitoring/factory.vue new file mode 100644 index 0000000..56cecc4 --- /dev/null +++ b/src/views/modules/monitoring/factory.vue @@ -0,0 +1,189 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/icons-dialog.vue b/src/views/modules/monitoring/icons-dialog.vue new file mode 100644 index 0000000..1aba2bb --- /dev/null +++ b/src/views/modules/monitoring/icons-dialog.vue @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + Close + + + + + + + diff --git a/src/views/modules/monitoring/product.vue b/src/views/modules/monitoring/product.vue new file mode 100644 index 0000000..bb9aa9c --- /dev/null +++ b/src/views/modules/monitoring/product.vue @@ -0,0 +1,270 @@ + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/productArrt.vue b/src/views/modules/monitoring/productArrt.vue new file mode 100644 index 0000000..2436ac2 --- /dev/null +++ b/src/views/modules/monitoring/productArrt.vue @@ -0,0 +1,222 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/productionLine.vue b/src/views/modules/monitoring/productionLine.vue new file mode 100644 index 0000000..c91a572 --- /dev/null +++ b/src/views/modules/monitoring/productionLine.vue @@ -0,0 +1,215 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/productionLineRecSch-add-or-update.vue b/src/views/modules/monitoring/productionLineRecSch-add-or-update.vue new file mode 100644 index 0000000..2e60f24 --- /dev/null +++ b/src/views/modules/monitoring/productionLineRecSch-add-or-update.vue @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/productionLineRecSch.vue b/src/views/modules/monitoring/productionLineRecSch.vue new file mode 100644 index 0000000..5cee30a --- /dev/null +++ b/src/views/modules/monitoring/productionLineRecSch.vue @@ -0,0 +1,153 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/qualityInspectionCurrent.vue b/src/views/modules/monitoring/qualityInspectionCurrent.vue new file mode 100644 index 0000000..2c59361 --- /dev/null +++ b/src/views/modules/monitoring/qualityInspectionCurrent.vue @@ -0,0 +1,373 @@ + + + + + + + + + {{ $t('query') }} + + + + + + + + {{ $t('inspect.ioTotal') }} + + + + + + + + + + {{ $t('inspect.plTotal') }} + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/qualityInspectionDet.vue b/src/views/modules/monitoring/qualityInspectionDet.vue new file mode 100644 index 0000000..4de83dc --- /dev/null +++ b/src/views/modules/monitoring/qualityInspectionDet.vue @@ -0,0 +1,203 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/qualityInspectionRecord.vue b/src/views/modules/monitoring/qualityInspectionRecord.vue new file mode 100644 index 0000000..32400f8 --- /dev/null +++ b/src/views/modules/monitoring/qualityInspectionRecord.vue @@ -0,0 +1,281 @@ + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/qualityInspectionType.vue b/src/views/modules/monitoring/qualityInspectionType.vue new file mode 100644 index 0000000..b45b817 --- /dev/null +++ b/src/views/modules/monitoring/qualityInspectionType.vue @@ -0,0 +1,174 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/realtimeEquipment.vue b/src/views/modules/monitoring/realtimeEquipment.vue new file mode 100644 index 0000000..5cee31d --- /dev/null +++ b/src/views/modules/monitoring/realtimeEquipment.vue @@ -0,0 +1,203 @@ + + + + + {{ $t('realtime.eq') }} + + + + + + diff --git a/src/views/modules/monitoring/realtimeProductLine.vue b/src/views/modules/monitoring/realtimeProductLine.vue new file mode 100644 index 0000000..d733e9b --- /dev/null +++ b/src/views/modules/monitoring/realtimeProductLine.vue @@ -0,0 +1,165 @@ + + + + + {{ $t('realtime.pl') }} + + + + + + diff --git a/src/views/modules/monitoring/realtimeQualityInspection.vue b/src/views/modules/monitoring/realtimeQualityInspection.vue new file mode 100644 index 0000000..ea7bfeb --- /dev/null +++ b/src/views/modules/monitoring/realtimeQualityInspection.vue @@ -0,0 +1,145 @@ + + + + {{ $t('realtime.inspect') }} + + + + + + diff --git a/src/views/modules/monitoring/reportCategory.vue b/src/views/modules/monitoring/reportCategory.vue new file mode 100644 index 0000000..88055da --- /dev/null +++ b/src/views/modules/monitoring/reportCategory.vue @@ -0,0 +1,172 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/reportDesign.vue b/src/views/modules/monitoring/reportDesign.vue new file mode 100644 index 0000000..2dd7bc7 --- /dev/null +++ b/src/views/modules/monitoring/reportDesign.vue @@ -0,0 +1,43 @@ + + + + + + + diff --git a/src/views/modules/monitoring/reportDetail.vue b/src/views/modules/monitoring/reportDetail.vue new file mode 100644 index 0000000..74cee5f --- /dev/null +++ b/src/views/modules/monitoring/reportDetail.vue @@ -0,0 +1,265 @@ + + + + + + + + {{ $t('query') }} + + {{ $t('add') }} + + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/reportList.vue b/src/views/modules/monitoring/reportList.vue new file mode 100644 index 0000000..ff2b455 --- /dev/null +++ b/src/views/modules/monitoring/reportList.vue @@ -0,0 +1,135 @@ + + + + + + + + {{ $t('all') }} + + {{ allNum }} {{ allNum > 1 ? 'Reports' : 'Report' }} + + + + + + {{ item.name }} + + {{ item.quantity }} {{ item.quantity > 1 ? 'Reports' : 'Report' }} + + + + + + + + + diff --git a/src/views/modules/monitoring/reportPreview.vue b/src/views/modules/monitoring/reportPreview.vue new file mode 100644 index 0000000..33ad626 --- /dev/null +++ b/src/views/modules/monitoring/reportPreview.vue @@ -0,0 +1,72 @@ + + + + {{ $t('report.name') + ': ' + $route.query.name }} + + + + + + diff --git a/src/views/modules/monitoring/reportSheet-add-or-update.vue b/src/views/modules/monitoring/reportSheet-add-or-update.vue new file mode 100644 index 0000000..49d46d6 --- /dev/null +++ b/src/views/modules/monitoring/reportSheet-add-or-update.vue @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/reportSheet.vue b/src/views/modules/monitoring/reportSheet.vue new file mode 100644 index 0000000..b7e532c --- /dev/null +++ b/src/views/modules/monitoring/reportSheet.vue @@ -0,0 +1,154 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/reportSheetCategory-add-or-update.vue b/src/views/modules/monitoring/reportSheetCategory-add-or-update.vue new file mode 100644 index 0000000..718ef16 --- /dev/null +++ b/src/views/modules/monitoring/reportSheetCategory-add-or-update.vue @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/reportSheetCategory.vue b/src/views/modules/monitoring/reportSheetCategory.vue new file mode 100644 index 0000000..9c7f94e --- /dev/null +++ b/src/views/modules/monitoring/reportSheetCategory.vue @@ -0,0 +1,148 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/sysFile-add-or-update.vue b/src/views/modules/monitoring/sysFile-add-or-update.vue new file mode 100644 index 0000000..3a9988f --- /dev/null +++ b/src/views/modules/monitoring/sysFile-add-or-update.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/sysFileType-add-or-update.vue b/src/views/modules/monitoring/sysFileType-add-or-update.vue new file mode 100644 index 0000000..e23c3c1 --- /dev/null +++ b/src/views/modules/monitoring/sysFileType-add-or-update.vue @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/monitoring/sysfile.vue b/src/views/modules/monitoring/sysfile.vue new file mode 100644 index 0000000..ddd11a1 --- /dev/null +++ b/src/views/modules/monitoring/sysfile.vue @@ -0,0 +1,159 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/sysfileType.vue b/src/views/modules/monitoring/sysfileType.vue new file mode 100644 index 0000000..f452ae0 --- /dev/null +++ b/src/views/modules/monitoring/sysfileType.vue @@ -0,0 +1,156 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/testMultiBaseTable.vue b/src/views/modules/monitoring/testMultiBaseTable.vue new file mode 100644 index 0000000..4685b4c --- /dev/null +++ b/src/views/modules/monitoring/testMultiBaseTable.vue @@ -0,0 +1,42 @@ + + + + + + + diff --git a/src/views/modules/monitoring/workShopSection.vue b/src/views/modules/monitoring/workShopSection.vue new file mode 100644 index 0000000..a76dc8f --- /dev/null +++ b/src/views/modules/monitoring/workShopSection.vue @@ -0,0 +1,200 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/workShopSectionEquipment.vue b/src/views/modules/monitoring/workShopSectionEquipment.vue new file mode 100644 index 0000000..0f8232d --- /dev/null +++ b/src/views/modules/monitoring/workShopSectionEquipment.vue @@ -0,0 +1,149 @@ + + + + + + + + {{ $t('query') }} + {{ $t('add') }} + + + + + + + + + + + + diff --git a/src/views/modules/monitoring/workshopSectionDialog.vue b/src/views/modules/monitoring/workshopSectionDialog.vue new file mode 100644 index 0000000..c82df8e --- /dev/null +++ b/src/views/modules/monitoring/workshopSectionDialog.vue @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('ws.eqbind') }} + {{ $t('add') }} + + + + + + + + + + {{ $t('cancel') }} + {{ $t('update') }} + {{ $t('save') }} + + + + + + + diff --git a/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue b/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue new file mode 100644 index 0000000..a8b0e67 --- /dev/null +++ b/src/views/modules/monitoring/workshopSectionDialogAttrForm.vue @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ edit ? $t('update') : $t('ws.bind') }} + + + + + diff --git a/src/views/modules/monitoring/workshopSectionEquipment-add-or-update.vue b/src/views/modules/monitoring/workshopSectionEquipment-add-or-update.vue new file mode 100644 index 0000000..7f80d44 --- /dev/null +++ b/src/views/modules/monitoring/workshopSectionEquipment-add-or-update.vue @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + diff --git a/src/views/modules/oss/oss-config.vue b/src/views/modules/oss/oss-config.vue index bc53d5a..cfdf0bf 100644 --- a/src/views/modules/oss/oss-config.vue +++ b/src/views/modules/oss/oss-config.vue @@ -1,225 +1,205 @@ - - - - - {{ $t('oss.type1') }} - {{ $t('oss.type2') }} - {{ $t('oss.type3') }} - - - - - 免费申请(七牛)10GB储存空间 - - - - - - - - - - - - - - - - - - - - 免费领取阿里云优惠券 - - - - - - - - - - - - - - - - - - - - - - - 免费领取腾讯云优惠券 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + {{ $t('oss.type1') }} + {{ $t('oss.type2') }} + {{ $t('oss.type3') }} + + + + + 免费申请(七牛)10GB储存空间 + + + + + + + + + + + + + + + + + + + + 免费领取阿里云优惠券 + + + + + + + + + + + + + + + + + + + + + + + 免费领取腾讯云优惠券 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/oss/oss-upload.vue b/src/views/modules/oss/oss-upload.vue index 655bd11..6b4bd0d 100644 --- a/src/views/modules/oss/oss-upload.vue +++ b/src/views/modules/oss/oss-upload.vue @@ -1,65 +1,59 @@ - - - - - {{ $t('upload.tip', { 'format': 'jpg、png、gif' }) }} - - + + + + + {{ $t('upload.tip', { format: 'jpg、png、gif' }) }} + + diff --git a/src/views/modules/oss/oss.vue b/src/views/modules/oss/oss.vue index 1a2c7ac..2550fdc 100644 --- a/src/views/modules/oss/oss.vue +++ b/src/views/modules/oss/oss.vue @@ -1,48 +1,43 @@ - - - - - {{ $t('oss.config') }} - - - {{ $t('oss.upload') }} - - - {{ $t('deleteBatch') }} - - - - - - - - - {{ $t('delete') }} - - - - - - - - - - - + + + + + {{ $t('oss.config') }} + + + {{ $t('oss.upload') }} + + + {{ $t('deleteBatch') }} + + + + + + + + + {{ $t('delete') }} + + + + + + + + + + + diff --git a/src/views/modules/sys/dept-add-or-update.vue b/src/views/modules/sys/dept-add-or-update.vue index 33c0de8..e7bfc2c 100644 --- a/src/views/modules/sys/dept-add-or-update.vue +++ b/src/views/modules/sys/dept-add-or-update.vue @@ -1,154 +1,164 @@ - - - - - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/dept.vue b/src/views/modules/sys/dept.vue index 19f4dee..1ba1830 100644 --- a/src/views/modules/sys/dept.vue +++ b/src/views/modules/sys/dept.vue @@ -1,43 +1,43 @@ - - - - - {{ $t('add') }} - - - - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - + + + + + {{ $t('add') }} + + + + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + diff --git a/src/views/modules/sys/dict-data-add-or-update.vue b/src/views/modules/sys/dict-data-add-or-update.vue index 96a3f34..15ed332 100644 --- a/src/views/modules/sys/dict-data-add-or-update.vue +++ b/src/views/modules/sys/dict-data-add-or-update.vue @@ -1,101 +1,118 @@ - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/dict-data.vue b/src/views/modules/sys/dict-data.vue index 5aa30c1..42508a3 100644 --- a/src/views/modules/sys/dict-data.vue +++ b/src/views/modules/sys/dict-data.vue @@ -1,96 +1,91 @@ - - - - - - - - - - - {{ $t('query') }} - - - {{ $t('add') }} - - - {{ $t('deleteBatch') }} - - - - - - - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - - - + + + + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + + + {{ $t('deleteBatch') }} + + + + + + + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + + + diff --git a/src/views/modules/sys/dict-type-add-or-update.vue b/src/views/modules/sys/dict-type-add-or-update.vue index 8ef034b..4872106 100644 --- a/src/views/modules/sys/dict-type-add-or-update.vue +++ b/src/views/modules/sys/dict-type-add-or-update.vue @@ -1,100 +1,103 @@ - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/dict-type.vue b/src/views/modules/sys/dict-type.vue index 82249b3..3213955 100644 --- a/src/views/modules/sys/dict-type.vue +++ b/src/views/modules/sys/dict-type.vue @@ -1,101 +1,114 @@ - - - - - - - - - - - {{ $t('query') }} - - - {{ $t('add') }} - - - {{ $t('deleteBatch') }} - - - - - - - - {{ scope.row.dictType }} - - - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - - - + + + + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + + + {{ $t('deleteBatch') }} + + + 所有图标 + + + + + + + + {{ scope.row.dictType }} + + + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + + + + + diff --git a/src/views/modules/sys/log-error.vue b/src/views/modules/sys/log-error.vue index d8089e3..92cca81 100644 --- a/src/views/modules/sys/log-error.vue +++ b/src/views/modules/sys/log-error.vue @@ -1,65 +1,73 @@ - - - - - {{ $t('export') }} - - - - - - - - - - - - {{ $t('logError.errorInfo') }} - - - - - - - + + + + + {{ $t('export') }} + + + + + + + + + + + + {{ $t('logError.errorInfo') }} + + + + + + + diff --git a/src/views/modules/sys/log-login.vue b/src/views/modules/sys/log-login.vue index dc76981..dd6e9d4 100644 --- a/src/views/modules/sys/log-login.vue +++ b/src/views/modules/sys/log-login.vue @@ -1,71 +1,72 @@ - - - - - - - - - - - - - - - {{ $t('query') }} - - - {{ $t('export') }} - - - - - - - {{ scope.row.operation === 0 ? $t('logLogin.operation0') : $t('logLogin.operation1') }} - - - - - {{ $t('logLogin.status0') }} - {{ $t('logLogin.status1') }} - {{ $t('logLogin.status2') }} - - - - - - - - - - + + + + + + + + + + + + + + + {{ $t('query') }} + + + {{ $t('export') }} + + + + + + + {{ scope.row.operation === 0 ? $t('logLogin.operation0') : $t('logLogin.operation1') }} + + + + + {{ $t('logLogin.status0') }} + {{ $t('logLogin.status1') }} + {{ $t('logLogin.status2') }} + + + + + + + + + + diff --git a/src/views/modules/sys/log-operation.vue b/src/views/modules/sys/log-operation.vue index c4bd61b..ce7a243 100644 --- a/src/views/modules/sys/log-operation.vue +++ b/src/views/modules/sys/log-operation.vue @@ -1,69 +1,77 @@ - - - - - - - - - - - {{ $t('query') }} - - - {{ $t('export') }} - - - - - - - - - - - {{ `${scope.row.requestTime}ms` }} - - - - - {{ $t('logOperation.status0') }} - {{ $t('logOperation.status1') }} - - - - - - - - - - + + + + + + + + + + + {{ $t('query') }} + + + {{ $t('export') }} + + + + + + + + + + + {{ `${scope.row.requestTime}ms` }} + + + + + {{ $t('logOperation.status0') }} + {{ $t('logOperation.status1') }} + + + + + + + + + + diff --git a/src/views/modules/sys/menu-add-or-update.vue b/src/views/modules/sys/menu-add-or-update.vue index 104b3b8..4c5949e 100644 --- a/src/views/modules/sys/menu-add-or-update.vue +++ b/src/views/modules/sys/menu-add-or-update.vue @@ -1,221 +1,226 @@ - - - - - {{ $t('menu.type0') }} - {{ $t('menu.type1') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + {{ $t('menu.type0') }} + {{ $t('menu.type1') }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/menu.vue b/src/views/modules/sys/menu.vue index 4fe46da..b56f963 100644 --- a/src/views/modules/sys/menu.vue +++ b/src/views/modules/sys/menu.vue @@ -1,55 +1,55 @@ - - - - - {{ $t('add') }} - - - - - - - - - - - - {{ $t('menu.type0') }} - {{ $t('menu.type1') }} - - - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - + + + + + {{ $t('add') }} + + + + + + + + + + + + {{ $t('menu.type0') }} + {{ $t('menu.type1') }} + + + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + diff --git a/src/views/modules/sys/params-add-or-update.vue b/src/views/modules/sys/params-add-or-update.vue index df61ea8..d7b0237 100644 --- a/src/views/modules/sys/params-add-or-update.vue +++ b/src/views/modules/sys/params-add-or-update.vue @@ -1,93 +1,98 @@ - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/params.vue b/src/views/modules/sys/params.vue index 348db49..5e58d88 100644 --- a/src/views/modules/sys/params.vue +++ b/src/views/modules/sys/params.vue @@ -1,67 +1,68 @@ - - - - - - - - {{ $t('query') }} - - - {{ $t('add') }} - - - {{ $t('deleteBatch') }} - - - - - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - - - + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + + + {{ $t('deleteBatch') }} + + + + + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + + + diff --git a/src/views/modules/sys/role-add-or-update.vue b/src/views/modules/sys/role-add-or-update.vue index 9e25109..170048d 100644 --- a/src/views/modules/sys/role-add-or-update.vue +++ b/src/views/modules/sys/role-add-or-update.vue @@ -1,148 +1,141 @@ - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + + + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/role.vue b/src/views/modules/sys/role.vue index 6b30169..6593538 100644 --- a/src/views/modules/sys/role.vue +++ b/src/views/modules/sys/role.vue @@ -1,73 +1,68 @@ - - - - - - - - {{ $t('query') }} - - - {{ $t('add') }} - - - {{ $t('deleteBatch') }} - - - - - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - - - + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + + + {{ $t('deleteBatch') }} + + + + + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + + + diff --git a/src/views/modules/sys/user-add-or-update.vue b/src/views/modules/sys/user-add-or-update.vue index b76c369..4b3192a 100644 --- a/src/views/modules/sys/user-add-or-update.vue +++ b/src/views/modules/sys/user-add-or-update.vue @@ -1,212 +1,206 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('user.status0') }} - {{ $t('user.status1') }} - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ $t('user.status0') }} + {{ $t('user.status1') }} + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue index 19f146c..379df1e 100644 --- a/src/views/modules/sys/user.vue +++ b/src/views/modules/sys/user.vue @@ -1,98 +1,93 @@ - - - - - - - - - - - - - - {{ $t('query') }} - - - {{ $t('add') }} - - - {{ $t('deleteBatch') }} - - - {{ $t('export') }} - - - - - - - - - - - {{ $getDictLabel("gender", scope.row.gender) }} - - - - - {{ $t('user.status0') }} - {{ $t('user.status1') }} - - - - - - {{ $t('update') }} - {{ $t('delete') }} - - - - - - - - - + + + + + + + + + + + + + + {{ $t('query') }} + + + {{ $t('add') }} + + + {{ $t('deleteBatch') }} + + + {{ $t('export') }} + + + + + + + + + + + {{ $getDictLabel('gender', scope.row.gender) }} + + + + + {{ $t('user.status0') }} + {{ $t('user.status1') }} + + + + + + {{ $t('update') }} + {{ $t('delete') }} + + + + + + + + + diff --git a/src/views/pages/404.vue b/src/views/pages/404.vue index e7d25d2..b775a45 100644 --- a/src/views/pages/404.vue +++ b/src/views/pages/404.vue @@ -1,19 +1,18 @@ - - - - 400 - - - {{ $t('notFound.back') }} - {{ $t('notFound.home') }} - - - - + + + + 400 + + + {{ $t('notFound.back') }} + {{ $t('notFound.home') }} + + + + diff --git a/src/views/pages/login.vue b/src/views/pages/login.vue index 814999b..f5c166a 100644 --- a/src/views/pages/login.vue +++ b/src/views/pages/login.vue @@ -1,28 +1,28 @@ - - - - - {{ $t('brand.lg') }} - - - {{ $t('login.title') }} - - - - - - - - - - - - - - - - + + + + + {{ $t('brand.lg') }} + + + {{ $t('login.title') }} + + + + + + + + + + + + + + + + + + {{ $t('login.title') }} + + + + + + + diff --git a/vue.config.js b/vue.config.js index 2c785d5..ddeec80 100644 --- a/vue.config.js +++ b/vue.config.js @@ -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 + } } } }
{{ $t('all') }}
{{ item.name }}