|
@@ -40,11 +40,10 @@
|
|
|
<div class="color-box">
|
|
|
<div class="cololorSelect">
|
|
|
<el-color-picker
|
|
|
- @change="changeColor"
|
|
|
popper-class="graphy-color-picker"
|
|
|
show-alpha
|
|
|
class="fix-box-1"
|
|
|
- v-model="color"
|
|
|
+ v-model="strokeColor"
|
|
|
></el-color-picker>
|
|
|
</div>
|
|
|
<span>颜色</span>
|
|
@@ -81,12 +80,11 @@ import { SColor } from "@persagy-web/draw";
|
|
|
import { rgbaNum } from "@persagy-web/big-edit/lib/until";
|
|
|
import { findIndex } from "lodash";
|
|
|
export default {
|
|
|
- props: ["GraphyItem", "strokeColor", "lineStyle", "lineWidth", "Width", "Height", "fillColor"],
|
|
|
+ props: ["GraphyItem", "lineStyle", "lineWidth", "Width", "Height", "fillColor"],
|
|
|
data() {
|
|
|
return {
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
- color: "#cccccc", //颜色
|
|
|
linewidth: 1,
|
|
|
borderLineOption: [
|
|
|
{
|
|
@@ -105,10 +103,24 @@ export default {
|
|
|
linestyle: "Solid",
|
|
|
};
|
|
|
},
|
|
|
- watch: {
|
|
|
- strokeColor(val) {
|
|
|
- this.color = val;
|
|
|
+ computed: {
|
|
|
+ strokeColor: {
|
|
|
+ get: function () {
|
|
|
+ return this.GraphyItem.strokeColor.toRgba();
|
|
|
+ },
|
|
|
+ set: function (val) {
|
|
|
+ const colorList = rgbaNum(val);
|
|
|
+ const oldVal = this.GraphyItem.strokeColor;
|
|
|
+ const newVal = new SColor(Number(colorList[0]), Number(colorList[1]), Number(colorList[2]), colorList[3] * 255);
|
|
|
+ bus.$emit("undoAttr", this.GraphyItem, "strokeColor", oldVal, newVal);
|
|
|
+ this.GraphyItem.strokeColor = newVal;
|
|
|
+ },
|
|
|
},
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // strokeColor(val) {
|
|
|
+ // this.color = val;
|
|
|
+ // },
|
|
|
lineWidth(val) {
|
|
|
this.linewidth = val;
|
|
|
},
|
|
@@ -143,9 +155,9 @@ export default {
|
|
|
changeFillcolor(val) {
|
|
|
bus.$emit("updateStyle", "fillColor", val);
|
|
|
},
|
|
|
- changeColor(val) {
|
|
|
- bus.$emit("updateStyle", "strokeColor", val);
|
|
|
- },
|
|
|
+ // changeColor(val) {
|
|
|
+ // bus.$emit("updateStyle", "strokeColor", val);
|
|
|
+ // },
|
|
|
// 改变线样式
|
|
|
changeLineStyle(val) {
|
|
|
bus.$emit("updateStyle", "lineStyle", val);
|