select 改变颜色

qianlishi 2 years ago
parent 9ba35a1a6c
commit 6f5161a828

@ -3,7 +3,7 @@
* @Author: qianlishi qianlishi@anji-plus.com * @Author: qianlishi qianlishi@anji-plus.com
* @Date: 2023-01-09 13:02:59 * @Date: 2023-01-09 13:02:59
* @LastEditors: qianlishi qianlishi@anji-plus.com * @LastEditors: qianlishi qianlishi@anji-plus.com
* @LastEditTime: 2023-01-12 16:44:50 * @LastEditTime: 2023-03-06 15:33:39
*/ */
export const widgetSelect = { export const widgetSelect = {
@ -33,7 +33,7 @@ export const widgetSelect = {
{ {
type: 'vue-color', type: 'vue-color',
label: '字体颜色', label: '字体颜色',
name: 'color', name: 'select_color',
required: false, required: false,
placeholder: '', placeholder: '',
value: '#FAD400', value: '#FAD400',
@ -41,7 +41,7 @@ export const widgetSelect = {
{ {
type: 'vue-color', type: 'vue-color',
label: '字体背景', label: '字体背景',
name: 'background', name: 'select_fontSize',
required: false, required: false,
placeholder: '', placeholder: '',
value: 'rgba(115,170,229,.5)', value: 'rgba(115,170,229,.5)',

@ -10,7 +10,7 @@
/> />
</template> </template>
<script> <script>
import {eventBus} from "@/utils/eventBus"; import { eventBus } from "@/utils/eventBus";
export default { export default {
name: "WidgetSelect", name: "WidgetSelect",
@ -24,17 +24,20 @@ export default {
optionsStyle: {}, optionsStyle: {},
optionsData: {}, optionsData: {},
optionsSetup: {}, optionsSetup: {},
options:{} options: {},
}; };
}, },
computed: { computed: {
styleObj() { styleObj() {
console.log(this.optionsSetup);
return { return {
position: this.ispreview ? "absolute" : "static", position: this.ispreview ? "absolute" : "static",
width: this.optionsStyle.width + "px", width: this.optionsStyle.width + "px",
height: this.optionsStyle.height + "px", height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px", left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px", top: this.optionsStyle.top + "px",
background: this.optionsSetup.select_fontSize,
color: this.optionsSetup.select_color,
}; };
}, },
eventChange() { eventChange() {
@ -47,7 +50,7 @@ export default {
this.optionsSetup = val.setup; this.optionsSetup = val.setup;
this.optionsData = val.data; this.optionsData = val.data;
this.optionsStyle = val.position; this.optionsStyle = val.position;
this.setOptions() this.setOptions();
}, },
deep: true, deep: true,
}, },
@ -56,7 +59,7 @@ export default {
this.optionsSetup = this.value.setup; this.optionsSetup = this.value.setup;
this.optionsData = this.value.data; this.optionsData = this.value.data;
this.optionsStyle = this.value.position; this.optionsStyle = this.value.position;
this.setOptions() this.setOptions();
}, },
methods: { methods: {
change(event) { change(event) {
@ -67,13 +70,13 @@ export default {
eventBus.$emit("eventParams", params); eventBus.$emit("eventParams", params);
}, },
setOptions() { setOptions() {
const optionsData = this.optionsData; const optionsData = this.optionsData;
return optionsData.dataType == "staticData" return optionsData.dataType == "staticData"
? this.staticData(optionsData.staticData) ? this.staticData(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
}, },
staticData(data) { staticData(data) {
this.options = data this.options = data;
}, },
// //
dynamicDataFn(val, refreshTime) { dynamicDataFn(val, refreshTime) {
@ -108,6 +111,11 @@ export default {
.el-input__inner { .el-input__inner {
height: 100%; height: 100%;
background: inherit;
color: inherit;
&::placeholder {
color: inherit;
}
} }
} }
} }

Loading…
Cancel
Save