diff --git a/src/App.vue b/src/App.vue index 31c84cb..bbf1d6b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,10 +4,10 @@ * @Author: fzq * @Date: 2022-11-25 09:51:46 * @LastEditors: fzq - * @LastEditTime: 2022-12-13 19:44:21 + * @LastEditTime: 2023-01-13 15:13:05 --> @@ -16,6 +16,9 @@ .el-table th.gutter { display: table-cell !important; } +#app { +background-color: #f2f4f9; +} + diff --git a/src/assets/img/logo2.png b/src/assets/img/logo2.png new file mode 100644 index 0000000..774214b Binary files /dev/null and b/src/assets/img/logo2.png differ diff --git a/src/assets/img/logo3.png b/src/assets/img/logo3.png new file mode 100644 index 0000000..74c7ead Binary files /dev/null and b/src/assets/img/logo3.png differ diff --git a/src/assets/scss/common.scss b/src/assets/scss/common.scss index add2c9d..23aaf6d 100644 --- a/src/assets/scss/common.scss +++ b/src/assets/scss/common.scss @@ -261,6 +261,7 @@ img { .aui-content { &__wrapper { margin-left: $sidebar--width-fold; + background-color: #F2F4F9; } &--tabs > .el-tabs > .el-tabs__header { left: $sidebar--width-fold; @@ -291,7 +292,7 @@ img { display: flex; align-items: stretch; height: $navbar--height; - background-color: #409EFF; + background-color: #0b58ff; box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05); } &--colorful { @@ -586,15 +587,21 @@ img { /* Content ------------------------------ */ .aui-content { - position: relative; - padding: $content--padding; - min-height: calc(100vh - #{$navbar--height}); + top: 16px; + margin:0 16px 0; + background-color: #fff; + border-radius: 4px; + padding: 16px 16px 0; + //此处修底部高度 + height: calc(100vh - 85px); + overflow: auto; &__wrapper { position: relative; // 注释掉可隐藏侧边栏,但需要在main.vue中加入main-content的限制条件 margin-left: $sidebar--width; min-height: calc(100vh - #{$navbar--height}); - background-color: $content--background-color; + //此处修改背景色 + background-color: #F2F4F9; transition: margin-left .3s; } > .aui-card--fill > .el-card__body { diff --git a/src/components/base-dialog/addOrUpdate/index.vue b/src/components/base-dialog/addOrUpdate/index.vue index 3010d93..d061f46 100644 --- a/src/components/base-dialog/addOrUpdate/index.vue +++ b/src/components/base-dialog/addOrUpdate/index.vue @@ -5,9 +5,8 @@ :visible.sync="visible" @close="handleClose" :distory-on-close="true" - :close-on-click-modal="false" - > -
+ :close-on-click-modal="false"> +
@@ -18,16 +17,14 @@ v-if="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)]" :prop="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name" :key="`${n}-col-${c}-item`" - :label="getLabel(n, c)" - > + :label="getLabel(n, c)"> + :disabled="isDetail" /> + @change="emitSelectChange(configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].name, $event)"> @@ -47,16 +43,14 @@ :options="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].options" :props="configs.fields[(n - 1) * COLUMN_PER_ROW + (c - 1)].props" :disabled="isDetail" - clearable - /> + clearable /> + :disabled="isDetail" /> @@ -65,14 +59,13 @@ @@ -96,11 +88,14 @@ {{ btnName[operate.name] }} @@ -125,9 +120,17 @@ const title = { // 或者也可以改造成自定义颜色: const btnType = { - save: 'success', - update: 'primary', - reset: 'text' + add :'#0b58ff', + save: '#000', + update: '#0b58ff', + reset: '' + // cancel: 'text' + // add more... +} +const btnColor = { + save: '#fff', + update: '#fff', + reset: '' // cancel: 'text' // add more... } @@ -154,7 +157,7 @@ export default { } }, filters: { - nameFilter: function(name) { + nameFilter: function (name) { if (!name) return null // for i18n const defaultNames = { @@ -181,6 +184,7 @@ export default { /** 按钮相关属性 */ btnName, btnType, + btnColor, defaultNames: { name: i18n.t('name'), code: i18n.t('code'), @@ -222,7 +226,7 @@ export default { /** 转换 configs.fields 的结构,把纯字符串转为对象 */ this.$nextTick(() => { - this.configs.fields = this.configs.fields.map(item => { + this.configs.fields = this.configs.fields.map((item) => { if (typeof item === 'string') { return { name: item } } @@ -230,13 +234,13 @@ export default { }) /** 动态设置dataForm字段 */ - this.configs.fields.forEach(item => { + this.configs.fields.forEach((item) => { this.$set(this.dataForm, [item.name], '') /** select 的默认值设置 */ if (item.type === 'select') { const opts = item.options || [] - const dft = opts.find(item => item.default || false) + const dft = opts.find((item) => item.default || false) if (dft) { this.$set(this.dataForm, [item.name], dft.value) } @@ -259,10 +263,10 @@ export default { // 如果有 relatedField,就需要在当前item的数据加载后,刷新 relatedField 的列表 if (item.relatedField) { this.$watch( - function() { + function () { return this.dataForm[item.name] }, - function(val, old) { + function (val, old) { if (val && val !== old) { this.$emit('select-change', { name: item.name, id: val }) } @@ -318,7 +322,7 @@ export default { } /** 检查是否需要额外的组件 */ this.configs.extraComponents && - this.configs.extraComponents.forEach(item => { + this.configs.extraComponents.forEach((item) => { // if (Object.hasOwn(this.dataForm, [item.name])) { if (this.dataForm.hasOwnProperty(item.name)) { return @@ -409,7 +413,7 @@ export default { this.fileList = {} if (this.dataForm.files) { // console.log('files: ', this.dataForm.files) - this.dataForm.files.forEach(file => { + this.dataForm.files.forEach((file) => { // const fileName = file.fileUrl.split('/').pop() /** [1] 处理 fileList */ // if (Object.hasOwn(this.fileList, file.typeCode)) { @@ -439,7 +443,7 @@ export default { this.shouldWait.then(() => { if (this.tempForm.length) { // console.log('create new, tempform', JSON.stringify(this.tempForm.length)) - this.tempForm.forEach(item => { + this.tempForm.forEach((item) => { // console.log('item data', item.data) this.dataForm[item.name] = item.data }) @@ -452,7 +456,7 @@ export default { }, emitSelectChange(name, id) { - const currentField = this.configs.fields.find(item => item.name === name) + const currentField = this.configs.fields.find((item) => item.name === name) if (currentField.relatedField) { this.dataForm[currentField.relatedField] = null } @@ -464,7 +468,7 @@ export default { handleClick(btn) { /** 提取url */ const urls = {} - this.configs.operations.map(item => { + this.configs.operations.map((item) => { urls[item.name] = {} urls[item.name].url = item.url urls[item.name].extraFields = item.extraFields || {} @@ -474,7 +478,7 @@ export default { case 'save': case 'update': /** 需要验证表单的操作 */ - this.$refs['dataForm'].validate(valid => { + this.$refs['dataForm'].validate((valid) => { if (valid) { /** 对于文件上传的单独处理(合并处理) */ if (Object.keys(this.fileForm).length) { @@ -513,7 +517,7 @@ export default { this.$message.error(res.msg) } }) - .catch(err => { + .catch((err) => { this.$message({ message: err, type: 'error', @@ -557,7 +561,7 @@ export default { this.$set( this.fileForm, typeCode, - filelist.map(item => item.id) + filelist.map((item) => item.id) ) // console.log('after handleUploadListUpdate(): ', this.fileForm) }, diff --git a/src/components/base-table/components/operationComponent.js b/src/components/base-table/components/operationComponent.js index 91ab305..17ce171 100644 --- a/src/components/base-table/components/operationComponent.js +++ b/src/components/base-table/components/operationComponent.js @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: fzq + * @Date: 2023-01-06 15:49:50 + * @LastEditors: fzq + * @LastEditTime: 2023-01-16 10:18:25 + */ import i18n from '@/i18n' export default { @@ -20,6 +28,7 @@ export default { delete: '#FF5454', preview: '#f09843', design: '#0b58ff', + edit: '#0b58ff' // 'view-trend': 'red' // add more... }, @@ -57,7 +66,8 @@ export default { 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])) + // 原色 #409EFF + btns.push(h('el-button', { props: { type: 'text' }, style: { color: optObj ? this.colors[optionStr.name] : this.colors[optionStr] || '#0b58ff' }, on: { click: this.emit.bind(null, optionStr) } }, typeof optionStr === 'object' ? this.text[optionStr.name] : this.text[optionStr])) } return h('span', null, btns) } diff --git a/src/components/base-table/index.vue b/src/components/base-table/index.vue index e73ee9f..a9b666a 100644 --- a/src/components/base-table/index.vue +++ b/src/components/base-table/index.vue @@ -32,7 +32,7 @@ :header-cell-style="{ background: '#FAFAFA', color: '#000', height: '40px' }" :max-height="maxHeight" :span-method="spanMethod || null" - :row-style="{ height: '20px' }" + :row-style="{ height: '40px' }" :cell-style="{ padding: '0px' }"> diff --git a/src/i18n/en.js b/src/i18n/en.js index aa0cf8a..d06475d 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -6,6 +6,7 @@ t.createTime = 'Create Time' t.brand = {} t.brand.lg = 'SCADA Platform' t.brand.mini = 'SCADA' +t.brand.home = 'Home' t.routes = {} t.routes['产品池'] = 'Products Pool' @@ -71,6 +72,7 @@ t.andeng.btnVal = 'Button Value' t.andeng.btnBoxModel = 'Button Box Model' +t.copyright = 'VISHAKHA glass pvt Ltd' t.dictValueList = 'View Details' t.save = 'Save' t.add = 'Add' @@ -136,11 +138,21 @@ t.min = 'Min Value' t.max = 'Max Value' t.status = 'Status' t.normal = 'Normal' +t.shutdown = 'Shut Down' +t.malfunction = 'Malfunction' // ? +t.diagram = 'Device Status Sequence Diagram' t.addr = 'Address' t.planStop = 'Plan to stop' t.startTime = 'Start Time' t.endTime = 'End Time' t.today = 'Today' +t.time = 'Time' +t.eqId = 'Current Equipment ID:' +t.ti = 'Time' +t.plcCode = 'PLC Code' +t.equName = 'Equipment Name' +t.equCode = 'Equipment Code' + t.graph = 'Graph' t.category = 'Category' @@ -373,6 +385,13 @@ t.pl.status = 'Product Line Status' t.pl.belong = 'Product Line' t.pl.tvalue = 'TT Value' t.pl.factoryHints = 'Please select a factory' +t.pl.process = 'Working procedure' +t.pl.add = 'Add Euipment' +t.pl.queryFirst = 'Please Query First' +t.pl.choose = 'Please select equipment' +t.pl.confirm = 'Confirm' +t.pl.cancel = 'Cancel' +t.pl.success = 'The new device data is obtained successfully' t.prompt = {} @@ -431,7 +450,8 @@ 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.login.copyright = 'Copyright @Intelligent Automation Research Institute Co., Ltd Version: 1.0' +t.login.copyright = 'Copyright @VISHAKHA glass pvt Ltd Version: 1.0' t.login.warning = 'Already Login!' t.schedule = {} diff --git a/src/i18n/index.js b/src/i18n/index.js index f63ebf9..b65dcb3 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -4,7 +4,7 @@ * @Author: fzq * @Date: 2022-11-25 09:51:46 * @LastEditors: fzq - * @LastEditTime: 2022-12-13 19:27:24 + * @LastEditTime: 2023-01-12 11:19:00 */ import Vue from 'vue' import VueI18n from 'vue-i18n' @@ -49,7 +49,8 @@ export function getLanguage() { } export default new VueI18n({ - // locale: Cookies.get('language') || 'zh-CN', + // 默认语言 + locale: Cookies.get('language') || 'en', locale: getLanguage(), // 先默认中文 messages, //抑制警告 diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 0a82079..e95d2f3 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -6,6 +6,7 @@ t.createTime = '添加时间' t.brand = {} t.brand.lg = '深加工SCADA平台' t.brand.mini = 'SCADA' +t.brand.home = '首页' t.routes = {} // 一级 @@ -71,6 +72,7 @@ t.andeng.btnVal = '按钮值' t.andeng.btnBoxModel = '按钮盒模式' +t.copyright = 'VISHAKHA glass pvt Ltd' t.dictValueList = '查看值列表' t.save = '保存' t.add = '新增' // 1 @@ -136,12 +138,21 @@ t.min = '最小值' // 1 t.max = '最大值' // 1 t.status = '状态' // 1 t.normal = '正常' // ? +t.shutdown = '停机' // ? +t.malfunction = '故障' // ? +t.diagram = '设备状态时序图' t.addr = '地址' // 1 t.planStop = '计划停机' // ? t.startTime = '开始时间' // 1 t.endTime = '结束时间' // 1 t.to = '至' // 1 t.today = '今天' // 1 +t.time = '选择时间' +t.eqId = '当前设备ID:' +t.ti = '时间' +t.plcCode = 'PLC 编码' +t.equName = '设备名称' +t.equCode = '设备编码' t.graph = '图形' t.category = '分类' @@ -373,6 +384,14 @@ t.pl.status = '产线状态' t.pl.belong = '所属产线' t.pl.tvalue = '产线TT值(每小时下片数量)' t.pl.factoryHints = '请选择所属工厂' +t.pl.process = '工序' +t.pl.add = '添加设备' +t.pl.queryFirst = '请先查询数据' +t.pl.success = '新设备数据获取成功' +t.pl.choose = '请选择设备' +t.pl.confirm = '确定' +t.pl.cancel = '取消' + t.prompt = {} t.prompt.title = '提示' @@ -430,7 +449,8 @@ t.login.username = '用户名' t.login.password = '密码' t.login.captcha = '验证码' t.login.demo = '在线演示' -t.login.copyright = '版权所有:中建材智能自动化研究院有限公司 版本: 1.0' +// t.login.copyright = '版权所有:中建材智能自动化研究院有限公司 版本: 1.0' +t.login.copyright = '版权所有:VISHAKHA glass pvt Ltd 版本: 1.0' t.login.warning = '已经登录过了' t.schedule = {} diff --git a/src/icons/index.js b/src/icons/index.js index 2234a06..aec47e8 100644 --- a/src/icons/index.js +++ b/src/icons/index.js @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: fzq + * @Date: 2022-12-13 21:01:02 + * @LastEditors: fzq + * @LastEditTime: 2023-01-11 10:47:26 + */ import './iconfont' import Vue from 'vue' import SvgIcon from '@/components/SvgIcon'// svg component @@ -9,8 +17,9 @@ const req = require.context('./svg', false, /\.svg$/) const requireAll = requireContext => requireContext.keys().map(requireContext) requireAll(req) -const svgFiles = require.context('./svg', true, /\.svg$/) -svgFiles.keys().map(item => svgFiles(item)) +// 这里注释掉了 +// const svgFiles = require.context('./svg', true, /\.svg$/) +// svgFiles.keys().map(item => svgFiles(item)) export default { // 获取图标icon-(*).svg名称列表, 例如[shouye, xitong, zhedie, ...] diff --git a/src/icons/svg/chrome.svg b/src/icons/svg/chrome.svg new file mode 100644 index 0000000..17fcca4 --- /dev/null +++ b/src/icons/svg/chrome.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/chrome2.svg b/src/icons/svg/chrome2.svg new file mode 100644 index 0000000..c9517a7 --- /dev/null +++ b/src/icons/svg/chrome2.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/countdown.svg b/src/icons/svg/countdown.svg new file mode 100644 index 0000000..6af4337 --- /dev/null +++ b/src/icons/svg/countdown.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/icons/svg/countdown2.svg b/src/icons/svg/countdown2.svg new file mode 100644 index 0000000..d0fb9cb --- /dev/null +++ b/src/icons/svg/countdown2.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/icons/svg/download.svg b/src/icons/svg/download.svg new file mode 100644 index 0000000..f8debb1 --- /dev/null +++ b/src/icons/svg/download.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/icons/svg/download2.svg b/src/icons/svg/download2.svg new file mode 100644 index 0000000..7b06329 --- /dev/null +++ b/src/icons/svg/download2.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/icons/svg/home.svg b/src/icons/svg/home.svg new file mode 100644 index 0000000..b398e96 --- /dev/null +++ b/src/icons/svg/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg index e9b56ee..2dd4511 100644 --- a/src/icons/svg/international.svg +++ b/src/icons/svg/international.svg @@ -1 +1,15 @@ - \ No newline at end of file + + + 中英 + + + + + + + + + + + + diff --git a/src/icons/svg/language2.svg b/src/icons/svg/language2.svg new file mode 100644 index 0000000..e50fe20 --- /dev/null +++ b/src/icons/svg/language2.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/icons/svg/language3.svg b/src/icons/svg/language3.svg new file mode 100644 index 0000000..d113bb2 --- /dev/null +++ b/src/icons/svg/language3.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mixins/view-module.js b/src/mixins/view-module.js index c113c54..51c72f5 100644 --- a/src/mixins/view-module.js +++ b/src/mixins/view-module.js @@ -112,8 +112,9 @@ export default { 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) { - this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home' - return false + // this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home' + // return false + this.$router.push({ name: 'home' }) } if (tabName === this.$store.state.contentTabsActiveName) { this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name }) diff --git a/src/store/index.js b/src/store/index.js index b47b4cf..4bd8b21 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -4,7 +4,7 @@ * @Author: fzq * @Date: 2022-12-11 20:33:35 * @LastEditors: fzq - * @LastEditTime: 2022-12-11 20:43:32 + * @LastEditTime: 2023-01-12 09:50:26 */ import Vue from 'vue' import Vuex from 'vuex' @@ -31,13 +31,12 @@ export default new Vuex.Store({ contentTabs: [ { ...window.SITE_CONFIG['contentTabDefault'], - // 'name': 'sys-log-login', - 'name': 'home', - 'title': 'home' + // 这里显示/隐藏 main-content的home标签 + // 'name': 'home', + // 'title': 'home' } ], - contentTabsActiveName: 'home' - // contentTabsActiveName: 'sys-log-login' + // contentTabsActiveName: 'home' }, modules: { user diff --git a/src/utils/filters.js b/src/utils/filters.js index e7f1c28..1ee971d 100644 --- a/src/utils/filters.js +++ b/src/utils/filters.js @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: fzq + * @Date: 2022-11-25 09:51:46 + * @LastEditors: fzq + * @LastEditTime: 2023-01-11 20:52:35 + */ /** filters */ import moment from 'moment' @@ -21,4 +29,12 @@ export const pick = (obj, paths) => { } }) return result -} \ No newline at end of file +} + +// export function timeFormatter(timeObj) { +// if (timeObj) { +// return moment(timeObj).format('YYYY-MM-DD HH:mm:ss') +// } else { +// return '-' +// } +// } \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 1424162..18b20d4 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -19,7 +19,8 @@ const http = axios.create({ * 请求拦截 */ http.interceptors.request.use(config => { - config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' + // config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' + config.headers['Accept-Language'] = Cookies.get('language') || 'en' config.headers['token'] = Cookies.get('token') || '' // 默认参数 var defaults = {} @@ -59,6 +60,7 @@ 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) // } diff --git a/src/views/Footerbar.vue b/src/views/Footerbar.vue new file mode 100644 index 0000000..5ad6eed --- /dev/null +++ b/src/views/Footerbar.vue @@ -0,0 +1,56 @@ + + + + + + diff --git a/src/views/main-content.vue b/src/views/main-content.vue index f102147..d4910bf 100644 --- a/src/views/main-content.vue +++ b/src/views/main-content.vue @@ -1,6 +1,6 @@