|
@@ -43,7 +43,8 @@
|
|
|
<div class="box-padding box-border-bottom">
|
|
|
<p class="box-title" style="padding-top: 0">公式</p>
|
|
|
<div class="textarea">
|
|
|
- <el-input type="textarea" disabled v-model="EquipItem.formula" :rows="2" placeholder="请输入内容"> </el-input>
|
|
|
+ <el-input type="textarea" disabled v-model="EquipItem.formula" @change="setStyle" :rows="2" placeholder="请输入内容">
|
|
|
+ </el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="box-padding box-border-bottom property">
|
|
@@ -51,13 +52,14 @@
|
|
|
<div class="base-property">
|
|
|
<div class="base-property-item">
|
|
|
<div class="cololorSelect">
|
|
|
- <el-color-picker show-alpha class="fix-box-1" v-model="color"></el-color-picker>
|
|
|
+ <el-color-picker show-alpha class="fix-box-1" @change="setStyle" v-model="color"></el-color-picker>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="base-property-item" style="flex: 1;padding: 0;">
|
|
|
+ <div class="base-property-item" style="flex: 1; padding: 0">
|
|
|
<el-input-number
|
|
|
- style="width: 100%;"
|
|
|
+ style="width: 100%"
|
|
|
v-model="size"
|
|
|
+ @change="setStyle"
|
|
|
controls-position="right"
|
|
|
size="mini"
|
|
|
:min="1"
|
|
@@ -74,13 +76,14 @@
|
|
|
action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
:show-file-list="false"
|
|
|
:before-upload="beforeAvatarUpload"
|
|
|
+ :on-success="setStyle"
|
|
|
>
|
|
|
<el-button type="small">替换图标</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
<div class="box-padding">
|
|
|
<p class="box-title">附加数据</p>
|
|
|
- <el-input type="textarea" v-model="EquipItem.anotherMsg" :rows="3" placeholder="请填写附加数据"> </el-input>
|
|
|
+ <el-input type="textarea" v-model="EquipItem.anotherMsg" @change="setStyle" :rows="3" placeholder="请填写附加数据"> </el-input>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -108,7 +111,6 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
-
|
|
|
color: {
|
|
|
get: function () {
|
|
|
return this.EquipItem.color.toRgba();
|
|
@@ -127,23 +129,23 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ window.yu = this;
|
|
|
+ },
|
|
|
methods: {
|
|
|
...mapMutations(["ADDSTYLE"]),
|
|
|
- // 设置宽
|
|
|
- changeWidth(val) {
|
|
|
- bus.$emit("updateStyle", "sWidth", val);
|
|
|
- },
|
|
|
- // 设置高
|
|
|
- changeHeight(val) {
|
|
|
- bus.$emit("updateStyle", "sHeight", val);
|
|
|
- },
|
|
|
- // 设置附加信息
|
|
|
- changeAnotherMsg(val) {
|
|
|
- bus.$emit("updateStyle", "anotherMsg", val);
|
|
|
- },
|
|
|
// 修改样式信息
|
|
|
setStyle() {
|
|
|
-
|
|
|
+ const style = {
|
|
|
+ id: this.EquipItem.id,
|
|
|
+ style: {
|
|
|
+ color: this.EquipItem.color.value,
|
|
|
+ size: this.EquipItem.font.size,
|
|
|
+ url: this.EquipItem.defaultUrl,
|
|
|
+ formula: this.EquipItem.formula,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ this.ADDSTYLE(style);
|
|
|
},
|
|
|
beforeAvatarUpload(file) {
|
|
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -294,7 +296,7 @@ export default {
|
|
|
border-radius: 2px;
|
|
|
overflow: hidden;
|
|
|
position: relative;
|
|
|
-
|
|
|
+
|
|
|
.fix-box-1 {
|
|
|
margin-top: -8px;
|
|
|
margin-left: -8px;
|