diff --git a/examples/echart/bar.html b/examples/echart/bar.html index 1ac7df909..f53402953 100644 --- a/examples/echart/bar.html +++ b/examples/echart/bar.html @@ -105,6 +105,7 @@ refresh: 3000, barWidth: 30, barRadius: 8, + labelShow: true, barColor: [{ color1: '#83bff6', color2: '#188df0', diff --git a/examples/element-ui/crud/before.html b/examples/element-ui/crud/before.html new file mode 100644 index 000000000..9e88e8f61 --- /dev/null +++ b/examples/element-ui/crud/before.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/examples/element-ui/crud/cell.html b/examples/element-ui/crud/cell.html index 76f016a89..be85d4ec1 100644 --- a/examples/element-ui/crud/cell.html +++ b/examples/element-ui/crud/cell.html @@ -24,8 +24,8 @@
- + @@ -158,7 +158,7 @@ dicUrl: 'https://cli.avuejs.com/api/area/getProvince' }, { - width: 120, + width: 150, label: '开关', prop: 'switch', type: 'switch', @@ -195,6 +195,13 @@ change: ({ index, row, column }) => { console.log(index, row, column) }, + rules: [ + { + required: true, + message: '请输入地址', + trigger: 'blur' + } + ], cell: true, }, { label: '远程搜索', @@ -230,6 +237,13 @@ }, 1000) }, methods: { + handleRowClick(row, event, column) { + this.$message({ + showClose: true, + message: '序号' + row.$index, + type: 'success', + }); + }, addRow() { this.$message.success('正在添加,请稍后') setTimeout(() => { diff --git a/examples/element-ui/crud/empty.html b/examples/element-ui/crud/empty.html index 92aa4be18..dbb5e59d1 100644 --- a/examples/element-ui/crud/empty.html +++ b/examples/element-ui/crud/empty.html @@ -24,7 +24,17 @@
- + + + + +
\ No newline at end of file diff --git a/packages/element-ui/crud/column-dynamic.vue b/packages/element-ui/crud/column-dynamic.vue new file mode 100644 index 000000000..17d34cee2 --- /dev/null +++ b/packages/element-ui/crud/column-dynamic.vue @@ -0,0 +1,132 @@ + + + + diff --git a/packages/element-ui/crud/column-menu.vue b/packages/element-ui/crud/column-menu.vue new file mode 100644 index 000000000..4b93bb5fd --- /dev/null +++ b/packages/element-ui/crud/column-menu.vue @@ -0,0 +1,166 @@ + + + \ No newline at end of file diff --git a/packages/element-ui/crud/column.vue b/packages/element-ui/crud/column.vue index 304ed6419..91bca0356 100644 --- a/packages/element-ui/crud/column.vue +++ b/packages/element-ui/crud/column.vue @@ -1,20 +1,18 @@ diff --git a/packages/element-ui/crud/header-menu.vue b/packages/element-ui/crud/header-menu.vue index acd45045e..24be670a6 100644 --- a/packages/element-ui/crud/header-menu.vue +++ b/packages/element-ui/crud/header-menu.vue @@ -205,6 +205,7 @@ export default create({ title: (this.crud.tableOption.title || '') + dateFtt('yyyy-MM-dd hh:mm:ss', new Date()), columns: (() => { let list = []; + console.log(this.crud.propOption); this.crud.propOption.forEach(ele => { if (this.columnIndex.includes(ele.prop)) { list.push({ @@ -212,7 +213,7 @@ export default create({ prop: (() => { if ( !this.validatenull(this.crud.DIC[ele.prop]) || - !this.validatenull(this.crud.cascaderDIC[ele.prop]) + !this.validatenull(ele.parentProp) ) { return "$" + ele.prop; } diff --git a/packages/element-ui/crud/header-search.vue b/packages/element-ui/crud/header-search.vue index df21d7a0b..0c584d7e7 100644 --- a/packages/element-ui/crud/header-search.vue +++ b/packages/element-ui/crud/header-search.vue @@ -132,6 +132,8 @@ export default cteate({ const detailColumn = (list = []) => { let column = []; let count = 0; + //根据order排序 + list = list.sort((a, b) => (b.searchOrder || 0) - (a.searchOrder || 0)) list.forEach(ele => { if (ele.search) { let isCount = count < this.searchIndex diff --git a/packages/element-ui/crud/index.vue b/packages/element-ui/crud/index.vue index 28552a11e..62f3ee9d7 100755 --- a/packages/element-ui/crud/index.vue +++ b/packages/element-ui/crud/index.vue @@ -54,240 +54,108 @@ - - - - -
{{scope.row.$index+1}}
- + @@ -48,7 +53,7 @@ + @@ -138,7 +148,6 @@ export default create({ immediate: true } }, - created () { }, mounted () { if (this.drag) { this.setSort() diff --git a/src/core/echart/common.js b/src/core/echart/common.js index b8a987e79..8aa8ee192 100644 --- a/src/core/echart/common.js +++ b/src/core/echart/common.js @@ -4,43 +4,13 @@ import packages from 'core/packages'; export default (() => { return { props: { - click: { - type: Function, - default: () => { - return () => { } - } - }, + click: Function, dataFormatter: Function, - titleFormatter: { - type: Function, - default: () => { - return () => { } - } - }, - labelFormatter: { - type: Function, - default: () => { - return () => { } - } - }, - clickFormatter: { - type: Function, - default: () => { - return () => { } - } - }, - formatter: { - type: Function, - default: () => { - return () => { } - } - }, - echartFormatter: { - type: Function, - default: () => { - return () => { } - } - }, + titleFormatter: Function, + labelFormatter: Function, + clickFormatter: Function, + formatter: Function, + echartFormatter: Function, width: { type: [Number, String], default: 600 diff --git a/src/utils/util.js b/src/utils/util.js index b7d126713..0246a6ea3 100755 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -10,9 +10,12 @@ export function getFixed (val = 0, len = 2) { } export function getAsVal (obj, bind = '') { let result = deepClone(obj); + if (validatenull(bind)) return result; bind.split('.').forEach(ele => { if (!validatenull(result[ele])) { result = result[ele]; + } else { + result = ''; } }); return result; @@ -453,17 +456,19 @@ export const getPasswordChar = (result = '', char) => { return result; }; -export const clearVal = (obj) => { +export const clearVal = (obj, list = []) => { if (!obj) return {}; Object.keys(obj).forEach(ele => { - if (Array.isArray(obj[ele])) { - obj[ele] = []; - } else if (obj[ele] !== null && typeof obj[ele] === 'object') { - obj[ele] = {}; - } else if (['number', 'boolean'].includes(typeof obj[ele]) || undefined === obj[ele]) { - obj[ele] = undefined; - } else { - obj[ele] = ''; + if (!list.includes(ele)) { + if (Array.isArray(obj[ele])) { + obj[ele] = []; + } else if (obj[ele] !== null && typeof obj[ele] === 'object') { + obj[ele] = {}; + } else if (['number', 'boolean'].includes(typeof obj[ele]) || undefined === obj[ele]) { + obj[ele] = undefined; + } else { + obj[ele] = ''; + } } }); return obj; diff --git a/styles/src/common.scss b/styles/src/common.scss index fb732b93b..716c526d4 100755 --- a/styles/src/common.scss +++ b/styles/src/common.scss @@ -1,186 +1,195 @@ -body { - font-family: Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; -} -*{ - outline: none; -} -.avue-canvas { - display: none; -} - -.avue-ghost { - opacity: 0.5; - background: #c8ebfb; -} -.avue--disabled{ - color:#ccc; -} -.avue--detail{ - .el-input.is-disabled .el-input__inner,.el-textarea.is-disabled .el-textarea__inner,.el-range-editor.is-disabled,.el-range-editor.is-disabled input{ - color: #606266; - background-color: #fff; - } - .hover-row td{ - background-color: #fff !important; - } - .el-input-group__append, .el-input-group__prepend{ - background-color: transparent; - border:none; - } - .el-checkbox__input.is-disabled+span.el-checkbox__label{ - color: #606266; - } - .el-input__inner,.el-textarea__inner{ - border: none; - &::-webkit-input-placeholder { - color:transparent !important; - } - &::-moz-placeholder { - color: transparent !important; - } - &::-moz-placeholder { - color:transparent !important; - } - &::-ms-input-placeholder { - color: transparent !important; - } - &::-ms-input-placeholder { - color:transparent !important; - } - } - .el-radio{ - display: none; - .el-radio__inner{ - display: none; - } - &.is-checked,.is-disabled.is-checked{ - display: inline-block; - color: #606266; - .el-radio__label{ - padding-left: 14px; - color: #606266; - font-weight: normal; - font-size: 14px; - } - } - } - .el-checkbox { - display: none; - &.is-checked,.is-disabled.is-checked{ - display: inline-block; - color: #606266; - .el-checkbox__label{ - padding-left: 14px; - color: #606266; - font-weight: normal; - font-size: 14px; - } - } - .el-checkbox__inner{ - display: none; - } - } - .el-input__suffix{ - display: none; - } - .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before, .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{ - display: none; - } -} -.avue--view{ - .el-textarea.is-disabled .el-textarea__inner{ - background-color: #fff; - border-color:rgb(220, 223, 230); - color: #606266; - } - .el-input.is-disabled .el-input__inner{ - background-color: #fff; - border-color:rgb(220, 223, 230); - color: #606266; - } -} - -.avue-grid { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-size: 20px 20px, 20px 20px; - background-image: linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 0), linear-gradient(90deg, rgba(0, 0, 0, .1) 1px, transparent 0); -} - -.avue-mask { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgba(55, 55, 55, .6); - height: 100%; - z-index: 1000; -} - -.avue--card { - box-shadow: 2px 1px 8px rgba(0, 0, 0, 0.15); - border-radius: 5px; -} - -.avue-dialog { - .el-dialog{ - border-radius: 2px; - } - .el-dialog__title,.el-drawer__header{ - color: rgba(0,0,0,.85); - font-weight: 500; - word-wrap: break-word; - } - .el-drawer__header{ - margin: 0; - min-height: 20px; - padding: 16px 10px 16px 24px; - border-bottom: 1px solid #f0f0f0; - } - .el-drawer__body{ - padding: 30px 10px; - } - .el-dialog__footer{ - padding: 10px 16px; - border-top: 1px solid #f0f0f0; - } - .el-dialog__header{ - padding: 16px 24px; - min-height: 20px; - border-bottom: 1px solid #f0f0f0; - } - iframe { - width: 100%; - height: 100%; - border: 0; - overflow: hidden; - box-sizing: border-box; - } -} - -.avue-queue--block { - display: inline-block; -} - -.avue-opacity { - opacity: 0 -} - -.avue-opacity--active { - opacity: 1 -} - -.fade-enter-active, -.fade-leave-active { - transition: opacity .3s; -} - -.fade-enter, -.fade-leave-to { - opacity: 0; -} - +body { + font-family: Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; +} +*{ + outline: none; +} +.avue-canvas { + display: none; +} + +.avue-ghost { + opacity: 0.5; + background: #c8ebfb; +} +.avue--disabled{ + color:#ccc; +} +.avue--detail{ + .el-input.is-disabled .el-input__inner,.el-textarea.is-disabled .el-textarea__inner,.el-range-editor.is-disabled,.el-range-editor.is-disabled input{ + color: #606266; + background-color: #fff; + } + .hover-row td{ + background-color: #fff !important; + } + .el-input-group__append, .el-input-group__prepend{ + background-color: transparent; + border:none; + } + .el-checkbox__input.is-disabled+span.el-checkbox__label{ + color: #606266; + } + .el-input__inner,.el-textarea__inner{ + border: none; + &::-webkit-input-placeholder { + color:transparent !important; + } + &::-moz-placeholder { + color: transparent !important; + } + &::-moz-placeholder { + color:transparent !important; + } + &::-ms-input-placeholder { + color: transparent !important; + } + &::-ms-input-placeholder { + color:transparent !important; + } + } + .el-radio{ + display: none; + .el-radio__inner{ + display: none; + } + &.is-checked,.is-disabled.is-checked{ + display: inline-block; + color: #606266; + .el-radio__label{ + padding-left: 14px; + color: #606266; + font-weight: normal; + font-size: 14px; + } + } + } + .el-checkbox { + display: none; + &.is-checked,.is-disabled.is-checked{ + display: inline-block; + color: #606266; + .el-checkbox__label{ + padding-left: 14px; + color: #606266; + font-weight: normal; + font-size: 14px; + } + } + .el-checkbox__inner{ + display: none; + } + } + .el-input__suffix{ + display: none; + } + .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before, .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{ + display: none; + } +} +.avue--view{ + .el-textarea.is-disabled .el-textarea__inner{ + background-color: #fff; + border-color:rgb(220, 223, 230); + color: #606266; + resize: none; + } + .el-input.is-disabled .el-input__inner{ + background-color: #fff; + border-color:rgb(220, 223, 230); + color: #606266; + } + .el-input-number.is-disabled{ + .el-input__inner{ + padding-left: 15px; + } + .el-input-number__decrease,.el-input-number__increase{ + display: none; + } + } +} + +.avue-grid { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-size: 20px 20px, 20px 20px; + background-image: linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 0), linear-gradient(90deg, rgba(0, 0, 0, .1) 1px, transparent 0); +} + +.avue-mask { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(55, 55, 55, .6); + height: 100%; + z-index: 1000; +} + +.avue--card { + box-shadow: 2px 1px 8px rgba(0, 0, 0, 0.15); + border-radius: 5px; +} + +.avue-dialog { + .el-dialog{ + border-radius: 2px; + } + .el-dialog__title,.el-drawer__header{ + color: rgba(0,0,0,.85); + font-weight: 500; + word-wrap: break-word; + } + .el-drawer__header{ + margin: 0; + min-height: 20px; + padding: 16px 10px 16px 24px; + border-bottom: 1px solid #f0f0f0; + } + .el-drawer__body{ + padding: 30px 10px; + } + .el-dialog__footer{ + padding: 10px 16px; + border-top: 1px solid #f0f0f0; + } + .el-dialog__header{ + padding: 16px 24px; + min-height: 20px; + border-bottom: 1px solid #f0f0f0; + } + iframe { + width: 100%; + height: 100%; + border: 0; + overflow: hidden; + box-sizing: border-box; + } +} + +.avue-queue--block { + display: inline-block; +} + +.avue-opacity { + opacity: 0 +} + +.avue-opacity--active { + opacity: 1 +} + +.fade-enter-active, +.fade-leave-active { + transition: opacity .3s; +} + +.fade-enter, +.fade-leave-to { + opacity: 0; +} + diff --git a/styles/src/element-ui/crud.scss b/styles/src/element-ui/crud.scss index a324877c4..1f9cc82f6 100755 --- a/styles/src/element-ui/crud.scss +++ b/styles/src/element-ui/crud.scss @@ -1,6 +1,19 @@ $color-blue: #2196f3; $space-width: 15px; .avue-crud { + .el-form-item{ + margin-bottom: 0; + } + .el-form-item__content{ + line-height: inherit; + font-size: inherit; + } + .el-form-item__error{ + position: relative; + } + .el-dropdown+.el-button { + margin-left: 10px; + } .el-checkbox:last-of-type { margin-right: 0px; } diff --git a/styles/src/element-ui/select.scss b/styles/src/element-ui/select.scss index 320151008..1c9f729fb 100644 --- a/styles/src/element-ui/select.scss +++ b/styles/src/element-ui/select.scss @@ -7,4 +7,9 @@ .el-tag { cursor: pointer; } + &__desc{ + float: right; + color: #8492a6; + font-size: 13px; + } } diff --git a/styles/src/elementui-reset.scss b/styles/src/elementui-reset.scss index 2dbd94c44..5f097d6a8 100755 --- a/styles/src/elementui-reset.scss +++ b/styles/src/elementui-reset.scss @@ -93,21 +93,16 @@ .el-table colgroup.gutter{ display: table-cell!important; } -.is-success,.is-error{ - .el-input-number__decrease,.el-input-number__increase{ - right: 25px !important; +.el-input-number{ + .el-input__suffix{ + display: none; } } .el-input-number__decrease, .el-input-number__increase{ background-color: transparent; - border-left: none !important; color: #c0c4cc !important; font-size: 16px !important; } -.el-input-number__increase{ - border-bottom: none !important; -} - .el-transfer{ display: flex; @@ -155,4 +150,8 @@ .el-table__fixed-right, .el-table__fixed { height: 100% !important; } +.el-dropdown-menu__item{ + padding-top:3px !important; + padding-bottom:3px !important; +}