diff --git a/.eslintrc.js b/.eslintrc.js index 5e62c103..028cfe19 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,16 +4,13 @@ module.exports = { es2021: true }, extends: [ - 'plugin:vue/essential', + 'plugin:vue/vue3-essential', 'standard' ], parserOptions: { ecmaVersion: 12, sourceType: 'module' }, - plugins: [ - 'vue' - ], rules: { eqeqeq: 0, // 关闭必须使用全等 'no-extend-native': 0, diff --git a/package.json b/package.json index e7daabfc..fb01bca3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "sn", + "name": "cn", "version": "0.1.0", "private": true, "scripts": { @@ -14,13 +14,14 @@ "element-plus": "^1.0.2-beta.44", "lib-flexible": "^0.3.2", "lodash": "^4.17.21", + "moment-timezone": "^0.5.33", "node-sass": "^4.14.1", "postcss-px2rem-exclude": "0.0.6", "sass-loader": "^8.0.2", "sass-resources-loader": "^2.2.1", "vue": "^3.0.0", "vue-grid-layout": "^2.3.12", - "vue-i18n": "^8.24.4", + "vue-i18n": "^9.1.6", "vue-router": "^4.0.8", "vuex": "^4.0.1" }, diff --git a/postcss.config.js b/postcss.config.js index 5b140d02..f2c5dd71 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ module.exports = { plugins: { - autoprefixer: {}, + autoprefixer: {} /* 'postcss-px2rem-exclude': { remUnit: 16, exclude: /node_modules/i diff --git a/public/config.json b/public/config.json new file mode 100644 index 00000000..490693c8 --- /dev/null +++ b/public/config.json @@ -0,0 +1 @@ +{"baseUrl": "http://192.168.44.53:8090/", "version": "2.0.2021.05.11.19.43"} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 25a281df..386191d0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,7 +4,15 @@ diff --git a/src/Login.vue b/src/Login.vue index d721d837..508430c6 100644 --- a/src/Login.vue +++ b/src/Login.vue @@ -1,10 +1,36 @@ diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index 3982d2e5..e133b6d0 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -1,3 +1,5 @@ @import './font/iconfont'; @import './theme'; -@import './common'; \ No newline at end of file +@import './common'; +@import './rightBoxCommon'; +@import './tableCommon'; \ No newline at end of file diff --git a/src/assets/css/rightBoxCommon.scss b/src/assets/css/rightBoxCommon.scss new file mode 100644 index 00000000..2a90a7c8 --- /dev/null +++ b/src/assets/css/rightBoxCommon.scss @@ -0,0 +1,312 @@ +.right-box, .right-sub-box { + display: flex; + flex-direction: column; + position: fixed; + right: 0; + top: 50px; + padding: 0; + height: calc(100% - 50px); + width: 700px; + box-shadow: 0 0 5px #ccc; + background-color: white; + z-index: 410; + + .el-date-editor { + .el-input__inner { + padding-left: 32px; + } + } +} + +.right-box__header { + display: flex; + justify-content: space-between; + align-items: center; + height: 60px; + padding: 0 20px; + border-bottom: 1px solid $--right-box-border-color; + box-sizing: border-box; + + .header__title { + font-size: 16px; + font-weight: bold; + color: #333; + } + .header__operation { + i { + color: #999; + font-size: 14px; + } + } +} + +.right-box__container { + .right-box-form{ + width: calc(100% - 60px); + } + height: calc(100% - 130px); + padding: 0 30px; + overflow-x: hidden; + overflow-y: auto; + + .el-textarea__inner { + padding: 5px 70px 4px 15px; + } + .container__form-width.container__form{ + .input-box { + .el-textarea { + .el-textarea__inner { + width: 530px; + height: 32px; + padding: 5px 70px 4px 10px; + } + .el-input__count { + right: -40px; + line-height: 29px; + height: 25px; + } + } + } + } + .el-form-item__content { + .el-input-group--prepend { + width: 626px; + height: 32px; + } + .input-box { + .el-textarea { + .el-textarea__inner { + width: 517px; + height: 32px; + padding: 5px 70px 4px 10px; + } + .el-input__count { + right: -40px; + line-height: 29px; + height: 25px; + } + } + } + } + .form-row-item { + .input-box { + .el-textarea { + .el-textarea__inner { + width: 466px; + height: 32px; + padding: 5px 70px 4px 10px; + } + .el-input__count { + right: 0; + } + } + } + } + .el-form-item { + .el-input__count { + line-height: 29px; + height: 25px; + } + } + .el-form-item { + .el-input--small.not-fixed-height { + height: 32px; + .el-input__count { + line-height: 29px; + height: 25px; + } + } + } + .el-input__inner, .el-textarea__inner { + padding: 0 10px; + border-radius: $--border-radius-primary; + border: 1px solid $--right-box-border-color; + } + .el-textarea__inner { + padding: 5px 70px 4px 15px; + } + .el-form { + padding-top: 20px; + + .el-form-item { + margin-bottom: 16px; + .el-form-item__label{ + padding-bottom: 6px; + font-size: 14px; + line-height: 16px; + color: #666; + } + + .el-input__inner:hover { + border-color: darken($--right-box-border-color, 10%); + } + .el-input__inner:focus { + border-color: darken($--right-box-border-color, 20%); + } + } + .el-form-item.is-error .el-input__inner, .el-form-item.is-error .el-input__inner:focus, .el-form-item.is-error .el-textarea__inner, .el-form-item.is-error .el-textarea__inner:focus, .el-message-box__input input.invalid, .el-message-box__input input.invalid:focus { + border-color: #F56C6C + } + + .form__sub-title { + display: flex; + justify-content: space-between; + padding: 0 10px; + margin-bottom: 20px; + line-height: 32px; + font-size: 14px; + font-weight: bold; + color: #555; + background-color: #F6F6F6; + } + /* 虚线框类型的form-item */ + .form__dotted-item { + padding: 10px 10px 6px 10px; + margin-bottom: 10px; + border: 1px dashed $--border-color-primary; + border-radius: $--border-radius-primary; + + .el-form-item { + margin-bottom: 0; + + .el-form-item__label { + width: 100%; + } + .form__labels-label { + display: flex; + justify-content: space-between; + } + } + } + .form__create-btn { + margin-bottom: 20px; + width: 300px; + height: 28px; + border: 1px solid var(--theme-color-light-71); + border-radius: $--border-radius-primary; + background-color: var(--theme-color-light-98); + + i { + color: var(--theme-color); + } + } + .form__flex-container { + display: flex; + justify-content: center; + align-items: center; + } + .one-third-form-item-left{ + display: inline-block; + width: calc(50% - 5px); + } + .one-third-form-item-right{ + display: inline-block; + width: calc(50% - 5px); + } + .form-item--half-width-other-two{ + display: inline-block; + width: calc(50% - 10px); + } + .form-item--half-width-other{ + display: inline-block; + width: calc(50% - 10px); + } + } +} + +.right-box__footer { + display: flex; + align-items: center; + justify-content: center; + height: 70px; + box-shadow: -3px 0 8px -3px rgba(205,205,205,0.77); + + .footer__btn { + margin: 0 15px; + height: 30px; + min-width: 74px; + padding: 0 15px; + color: white; + background-color: var(--theme-color); + border: none; + border-radius: 4px; + outline: none; + box-sizing: border-box; + font-size: 14px; + cursor: pointer; + transition: background-color linear .2s, color linear .1s; + } + .footer__btn:hover:not(.footer__btn--disabled) { + background-color: var(--theme-color-light-20); + } + .footer__btn--light { + background-color: white; + border: 1px solid $--border-color-primary; + color: #333; + } + .footer__btn.footer__btn--light:hover:not(.footer__btn--disabled) { + background-color: white; + border-color: var(--theme-color-light-50); + color: var(--theme-color); + } + .footer__btn--disabled { + opacity: .6; + cursor: default; + } +} +/* 隐藏label新增按钮处级联选择器的input */ +.hide-casc-input { + position: relative; + + .hide-input { + position: absolute; + top: 0; + width: 300px; + opacity: 0; + } +} +.label__multi-text { + display: flex; + justify-content: space-between; +} +.right-box__select { + width: 100%; +} +.right-box-select-dropdown { + width: 625px; +} +.limit-height .el-cascader-menu { + max-height: 200px; + overflow: auto; +} + +.form-items--half-width-group { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + + .form-item--half-width { + width: calc(50% - 10px); + + .el-select { + width: 100%; + } + } +} +.nz-icon-minus-position { + display: inline-flex; + flex-direction: column; + position: absolute; + right: 0; + top: 50%; + height: 100%; + transform: translateY(-50%); + justify-content: space-between; + box-sizing: border-box; +} +.form-item--end-with-btn { // 末尾留出btn宽度空间的form item + +} +.el-form-item__content .el-autocomplete .el-input-group { + vertical-align: unset; +} diff --git a/src/assets/css/tableCommon.scss b/src/assets/css/tableCommon.scss new file mode 100644 index 00000000..9f37bfff --- /dev/null +++ b/src/assets/css/tableCommon.scss @@ -0,0 +1,381 @@ +/*列表table通用样式*/ +.list-page { + height: 100%; + width: 100%; + box-sizing: border-box; + background-color: #f6f6f6; + + .main-list { + background-color: white; + position: relative; + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + z-index: 0; + } + .main-container { + padding: 10px; + height: 100%; + background-color: #f6f6f6; + &>div { + background-color: white; + } + } + .main-list.main-list-with-sub { + height: 50%; + } + .main-modal { + position: absolute; + height: 100%; + width: 100%; + display: none; + z-index: 100; + } + .top-tools { + display: flex; + align-items : center; + position: relative; + justify-content: space-between; + padding: 14px 20px; + + &.top-tools--sub { + align-items: center; + padding: 0 70px 0 15px; + height: 44px; + background-color: white; + border: 1px solid #E6EAED; + box-sizing: border-box; + } + + .top-tool-right { + display: flex; + } + .top-tool-left { + display: flex; + } + .top-tool-btn-group { + display: flex; + .top-tool-btn:not(:last-of-type):not(:first-of-type) { + border-left: none; + border-radius: 0; + } + .top-tool-btn:first-of-type:not(:last-of-type) { + border-radius: $--button-border-radius 0 0 $--button-border-radius; + } + .top-tool-btn:last-of-type:not(:first-of-type) { + border-radius: 0 $--button-border-radius $--button-border-radius 0; + border-left: none; + } + } + .top-tool-btn { + height: 32px; + width: 36px; + border: 1px solid $--border-color-primary; + outline: none; + border-radius: $--button-border-radius; + background-color: $--button-gray-background-color; + transition: background-color linear .1s; + + i { + font-size: 14px; + color: $--button-gray-color; + } + } + .top-tool-btn.top-tool-btn--text { + padding: 0 8px; + width: unset; + color: #666; + } + .top-tool-btn:hover:not(.cn-btn-disabled) { + background-color: $--button-gray-hover-background-color; + } + .top-tool-btn:focus:not(.cn-btn-disabled), .top-tool-btn.is-focus { + background-color: $--button-gray-hover-background-color; + border: 1px solid #FBCEA4 !important; + i { + color: $--button-gray-active-color; + } + } + .top-tool-btn--delete.top-tool-btn:focus:not(.cn-btn-disabled) { + background-color: $--button-gray-hover-background-color; + border-color: #FFC4B9; + + i { + color: #F0745A; + } + } + .top-tool-btn--dropdown { + position: relative; + width: auto; + min-width: 36px; + } + } + .top-tools--sub { + .top-tool-left { + height: 100%; + } + .sub-list-title { + width: 200px; + line-height: 40px; + font-size: 16px; + color: #202F3F; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .sub-list-tabs { + height: 100%; + display: flex; + align-items: center; + + .sub-list-tab { + height: 100%; + width: 120px; + color: #666666; + font-size: 14px; + text-align: center; + box-sizing: border-box; + line-height: 40px; + + &.sub-list-tab--active { + border-bottom: 2px solid $--color-primary; + color: #FA901C; + } + } + + } + } + /* 上滑resize工具条 */ + .sub-list-resize, .sub-list-resize-copy { + display: flex; + align-items: center; + justify-content: center; + height: 9px; + width: 100%; + box-shadow: inset 0 1px 0 0 #BEBEBE; + background-color: #e6eaed; + position: absolute; + z-index: 1; + box-sizing: border-box; + user-select: none; + color: #5f6368; + cursor: ns-resize; + } + .sub-list-window-control { + display: flex; + align-items: center; + margin-left: 14px; + position: absolute; + right: 0; + height: 44px; + z-index: 2; + + .window-control-btn { + cursor: pointer; + margin-right: 20px; + } + .window-control-btn>i { + color: #999999; + font-size: 14px; + transition: all .2s; + } + .window-control-btn>i:hover { + color: $--color-primary; + } + } + /* 上滑resize工具条--end */ + .cn-table { + position: relative; + padding: 0 20px; + width: 100%; + box-sizing: border-box; + flex: auto; + height: calc(100% - 58px); + + .el-table:not(.chart-table) { + position: absolute; + width: calc(100% - 40px); + border: 1px solid $--right-box-border-color; + border-bottom: none; + + .caret-wrapper { + height: 23px; + .sort-caret.ascending { + top: 1px; + } + .sort-caret.descending { + bottom: 0; + } + } + + .el-table-column--selection { + width: 55px !important; + } + + td { + padding: 8px 0; + border-bottom: 1px solid $--right-box-border-color; + } + th { + border-color: $--right-box-border-color; + padding: 8px 0; + background: #F9F9F9; + } + .el-table__header th:first-of-type { + border-left: none; + } + .gutter { + position: fixed; + right: 31px; + height: 49px; + border-bottom: 1px solid $--right-box-border-color; + background-color: white; + box-sizing: content-box; + } + thead { + color: #333; + } + + .el-table__body tr:hover>td, .el-table__body tr.hover-row.current-row>td, + .el-table__body tr.hover-row.el-table__row--striped.current-row>td, + .el-table__body tr.hover-row.el-table__row--striped>td, .el-table__body tr.hover-row>td { + background-color: var(--theme-color-light-96) !important; + } + .table-operation-title { + text-align: center; + } + .table-operation-items { + display: flex; + justify-content: center; + .table-operation-item { + display: flex; + height: 22px; + border-radius: $--button-border-radius; + outline: none; + transition: background-color linear .1s; + } + .table-operation-item.table-operation-item--disable{ + border: 1px solid $--border-color-primary; + background-color: #DEDEDE; + opacity: 0.6; + outline: none; + i { + font-size: 14px; + color: #fff; + } + } + &>.table-operation-item { + justify-content: center; + align-items: center; + width: 30px; + margin-right: 10px; + border: none; + border-radius: $--button-border-radius; + background-color: $--button-primary-background-color; + opacity: 1; + cursor: pointer; + transition: all .2s; + i { + color: $--button-primary-color; + font-size: 12px; + } + } + &>.table-operation-item:hover { + opacity: .8; + } + .table-operation-item.table-operation-item--more { + justify-content: center; + align-items: center; + border: 1px solid $--border-color-primary; + width: 30px; + i { + color: #999; + font-size: 12px; + } + } + } + } + } + /* start--覆盖el-table边框、gutter等样式 */ + .el-table__body-wrapper, .el-table__fixed-body-wrapper { + box-shadow: 1px 0 $--right-box-border-color; + + .cell { + color: #333; + } + } + .el-table__body-wrapper .is-hidden, .el-table__header-wrapper .is-hidden { + visibility: hidden; + } + .cn-table { + .el-table--border td { + border-right: none !important; + } + /* 最后一列用box-shadow模拟边框 */ + .el-table:not(.no-operation):not(.chart-table).el-table--border .el-table__body-wrapper td:nth-last-child(2) { + box-shadow: 1px 0 $--right-box-border-color; + } + .el-table:not(.no-operation):not(.chart-table).el-table--border .el-table__header-wrapper th:nth-last-child(3) { + border-right: none !important; + box-shadow: 1px 0 $--right-box-border-color; + } + .el-table__fixed-body-wrapper { + td:not(.is-hidden) { + border-left: 1px solid $--right-box-border-color; + } + } + .el-table__fixed-header-wrapper { + th:not(.is-hidden) { + border-left: 1px solid $--right-box-border-color; + } + th:last-of-type { + border-right: none !important; + } + } + .el-table--border:not(.chart-table)::after, .el-table--group:not(.chart-table)::after { + width: 0; + } + } + /* end--覆盖el-table边框、gutter等样式 */ + .pagination-bottom { + position: absolute; + bottom: 8px; + height: 48px; + width: calc(100% - 20px); + } +} +.operation-dropdown-text { + display: inline-block; + font-size: 13px; +} + +.search-box { + padding: 0 20px 20px; +} +.click-search-dropdown { + width: calc(100% - 300px) !important; + left: 270px !important; + margin-top: -3px !important; + box-shadow: none; + box-sizing: border-box; + border-radius: 0; + border-color: #c7c7c7; + + .popper__arrow { + display: none; + } + .el-cascader-menu__list { + display: flex; + flex-wrap: wrap; + width: 100%; + max-height: 120px; + } +} +.el-popper.el-cascader__dropdown.click-search-dropdown::after { + content: ''; + position: absolute; + top: -1px; + height: 1px; + background-color: white; +} diff --git a/src/assets/css/theme.scss b/src/assets/css/theme.scss index 928472eb..cb67b2cc 100644 --- a/src/assets/css/theme.scss +++ b/src/assets/css/theme.scss @@ -1,8 +1,7 @@ /*** 定义自定义变量和重写element-ui变量 ***/ -/** 自定义变量 **/ - /** 重写element-ui变量 **/ + $--color-primary: #0091ff; // 主题色 /* menu相关 */ @@ -11,6 +10,55 @@ $--menu-hover-background-color: #000C18; // menu背景色 $--menu-item-font-color: #BEBEBE; // menu字色 $--menu-item-hover-fill: $--color-primary; // menu鼠标悬浮、激活时背景色 +/** 自定义变量 **/ +:root { + --theme-color: #FA901C; // 默认主题色,下方深化、浅化的色值默认值是写死的;用户自定义修改主题色后,由js计算新值 + --theme-color-dark-10: #E18219; // 默认主题色 深10% + --theme-color-light-10: #FA9B33; // 默认主题色 浅10% + --theme-color-light-20: #FBA649; // 默认主题色 浅20% + --theme-color-light-30: #FBB160; // 默认主题色 浅30% + --theme-color-light-40: #FBBC77; // 默认主题色 浅40% + --theme-color-light-50: #FCC88D; // 默认主题色 浅50% + --theme-color-light-60: #FCD4A4; // 默认主题色 浅60% + --theme-color-light-71: #FFDFBD; // 默认主题色 浅71% + --theme-color-light-80: #FFEAD2; // 默认主题色 浅80% + --theme-color-light-90: #FFF5E8; // 默认主题色 浅90% + --theme-color-light-96: #FFFBF6; // 默认主题色 浅90% + --theme-color-light-98: #FFFCF8; // 默认主题色 浅98% +} + +$--border-color-primary: #DEDEDE; +$--border-radius-primary: 2px; + +$--right-box-border-color: #E7EAED; + +/* 按钮 */ +$--button-border-radius: $--border-color-primary; // 按钮圆角 + +$--button-primary-color: #FFF; // 普通按钮字色 +$--button-primary-background-color: $--color-primary; // 普通按钮背景色 +$--button-hover-tint-percent: 20%; // 非灰色按钮在鼠标hover时背景色变浅的幅度 +$--button-active-shade-percent: 0; // 非灰色按钮在focus时背景色变深的幅度 + +$--button-gray-color: #666; // 灰色按钮字色 +$--button-gray-hover-color: $--button-gray-color; // 灰色按钮hover字色 +$--button-gray-active-color: $--color-primary; // 灰色按钮focus字色 +$--button-gray-background-color: #F9F9F9; // 灰色按钮背景色 +$--button-gray-hover-background-color: #FFF; // 灰色按钮hover背景色 +$--button-gray-active-background-color: $--button-gray-hover-background-color; // 灰色按钮focus背景色 +$--button-gray-border-color: $--border-color-primary; // 灰色按钮边框色 +$--button-gray-hover-border-color: $--button-gray-border-color; // 灰色按钮hover边框色 +$--button-gray-active-border-color-tint-percent: 30%; // 灰色按钮在focus时边框色相对于主题色变浅的幅度 + +$--color-danger: #DE5D3F; //全局警告色红色 +$--color-success: #23BF9A; //全局正常色绿色 +$--color-warning: $--color-primary; //全局警告橙色 +$--color-suspended: #9e9c98; //全局停用色灰色 +$--color-monitor: #98AEC5; //全局停用色灰色 + /** 改变 icon 字体路径变量,并引入element-ui变量文件 **/ $--font-path: '~element-plus/lib/theme-chalk/fonts'; -@import "~element-plus/packages/theme-chalk/src/index"; \ No newline at end of file +@import "~element-plus/packages/theme-chalk/src/index"; +:export { + themeColor: $--color-primary; +} \ No newline at end of file diff --git a/src/components/layout/LeftMenu.vue b/src/components/layout/LeftMenu.vue index 2fe33862..6a9da20c 100644 --- a/src/components/layout/LeftMenu.vue +++ b/src/components/layout/LeftMenu.vue @@ -1,6 +1,10 @@