From 44df75cc819de219094a6b8c6e3efce1ce8ae4f7 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Thu, 14 Sep 2023 15:08:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=99=A8=E7=BB=84=E4=BB=B6=E5=A4=9A=E4=BD=99=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/BasicComponents/Select/index.vue | 14 +++--- .../BasicComponents/Select/setting.vue | 43 ++----------------- .../BasicComponents/Select/settingConfig.js | 9 +--- data-room-ui/packages/BorderSelect/index.vue | 10 ++--- .../packages/ComponentList/EditForm.vue | 30 ++++++------- 5 files changed, 32 insertions(+), 74 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/Select/index.vue b/data-room-ui/packages/BasicComponents/Select/index.vue index 6b0da7fb..e8ddd45c 100644 --- a/data-room-ui/packages/BasicComponents/Select/index.vue +++ b/data-room-ui/packages/BasicComponents/Select/index.vue @@ -59,7 +59,8 @@ export default { } }, watch: { }, - created () { }, + created () { + }, mounted () { window.dataSetFields = [] this.changeStyle(this.config) @@ -120,6 +121,7 @@ export default { return config }, changeStyle (config) { + config = { ...this.config, ...config } this.innerConfig = config // 选择器元素 const selectInputEl = document.querySelector(`.select-${config.code} .el-input__inner`) @@ -164,11 +166,11 @@ export default { item.style.setProperty('--dropDownHoverBackgroundColor', this.innerConfig.customize.dropDownHoverBackgroundColor) }) // 激活项 - const selectDropdownItemSelectedEl = document.querySelectorAll(`.select-popper-${this.innerConfig.code} .el-select-dropdown__item.selected`) - selectDropdownItemSelectedEl.forEach(item => { - item.style.color = this.innerConfig.customize.activeFontColor - item.style.backgroundColor = this.innerConfig.customize.activeBackgroundColor - }) + // const selectDropdownItemSelectedEl = document.querySelectorAll(`.select-popper-${this.innerConfig.code} .el-select-dropdown__item.selected`) + // selectDropdownItemSelectedEl.forEach(item => { + // item.style.color = this.innerConfig.customize.activeFontColor + // item.style.backgroundColor = this.innerConfig.customize.activeBackgroundColor + // }) } // 不是激活项的还是使用背景颜色 const selectDropdownItemEl = document.querySelectorAll(`.select-popper-${this.innerConfig.code} .el-select-dropdown__item`) diff --git a/data-room-ui/packages/BasicComponents/Select/setting.vue b/data-room-ui/packages/BasicComponents/Select/setting.vue index af998968..3b336f65 100644 --- a/data-room-ui/packages/BasicComponents/Select/setting.vue +++ b/data-room-ui/packages/BasicComponents/Select/setting.vue @@ -19,7 +19,9 @@
- 边框 + + 边框 +
- - - - - - - -
下拉项 @@ -107,20 +84,6 @@ :predefine="predefineThemeColors" /> - - - - - - - - diff --git a/data-room-ui/packages/BasicComponents/Select/settingConfig.js b/data-room-ui/packages/BasicComponents/Select/settingConfig.js index 3e986cea..2bb90a23 100644 --- a/data-room-ui/packages/BasicComponents/Select/settingConfig.js +++ b/data-room-ui/packages/BasicComponents/Select/settingConfig.js @@ -25,9 +25,8 @@ export const settingConfig = { const customConfig = { type: 'select', // 名称 - title: '下拉框', root: { - version: '2023071001' + version: '2023091402' }, // 自定义属性 customize: { @@ -44,11 +43,7 @@ const customConfig = { // 下拉项hover背景颜色 dropDownHoverBackgroundColor: '#6A7E9D', // 下拉项hover字体颜色 - dropDownHoverFontColor: '#FFFFFF', - // 激活项背景颜色 - activeBackgroundColor: '#6A7E9D', - // 激活项字体颜色 - activeFontColor: '#FFFFFF' + dropDownHoverFontColor: '#FFFFFF' } } export const dataConfig = { diff --git a/data-room-ui/packages/BorderSelect/index.vue b/data-room-ui/packages/BorderSelect/index.vue index 4d6b71e1..9d5aa9ec 100644 --- a/data-room-ui/packages/BorderSelect/index.vue +++ b/data-room-ui/packages/BorderSelect/index.vue @@ -93,7 +93,7 @@ import borderComponents from 'data-room-ui/BorderComponents/bordersList' export default { name: 'ComponentDialog', mixins: [pageMixins], - model: { + model: { prop: 'type', event: 'select' }, @@ -114,19 +114,18 @@ export default { code: '', focus: -1, searchKey: '', - remoteComponentlist: [], + remoteComponentlist: [] } }, computed: { remoteComponentsGridComputed () { return this.remoteComponentlist.length > 3 - }, + } }, watch: { }, mounted () { this.remoteComponentlist = [...borderComponents] - console.log(this.remoteComponentlist) }, methods: { chooseComponent (component) { @@ -144,9 +143,8 @@ export default { confirm () { this.dialogVisible = false if (isEmpty(this.focus)) return - console.log(this.focus.title) this.$emit('select', this.focus.title) - }, + } } } diff --git a/data-room-ui/packages/ComponentList/EditForm.vue b/data-room-ui/packages/ComponentList/EditForm.vue index acf7d28e..2f0b15de 100644 --- a/data-room-ui/packages/ComponentList/EditForm.vue +++ b/data-room-ui/packages/ComponentList/EditForm.vue @@ -29,9 +29,9 @@ class="bs-el-input" /> -