123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <div class="propertys">
- <baseTextPro
- :strokeColor="strokeColor"
- :fontSize="fontSize"
- :textMsg="textMsg"
- :backgroundColor="backgroundColor"
- v-show="itemType == 'BaseText' || itemType == 'BaseExplain'"
- ></baseTextPro>
- <baseLinePro
- v-show="itemType == 'BaseArrow'"
- :strokeColor="strokeColor"
- :lineStyle="lineStyle"
- :lineWidth="lineWidth"
- :Begin="begin"
- :End="end"
- ></baseLinePro>
- <BaseGraphy
- :lineStyle="lineStyle"
- :lineWidth="lineWidth"
- :strokeColor="strokeColor"
- :fillColor="fillColor"
- :Url="Url"
- :Width="Width"
- :Height="Height"
- v-show="
- itemType == 'BaseRect' ||
- itemType == 'BaseTriangle' ||
- itemType == 'BaseCircle' ||
- itemType == 'BasePolygon'
- "
- ></BaseGraphy>
- <BaseImagePro
- :lineStyle="lineStyle"
- :lineWidth="lineWidth"
- :strokeColor="strokeColor"
- :Url="Url"
- :Width="Width"
- :Height="Height"
- v-show="itemType == 'BaseImage'"
- ></BaseImagePro>
- <BaseEquipment v-if="true"></BaseEquipment>
-
- </div>
- </template>
- <script>
- import baseTextPro from "./baseTextPro.vue";
- import baseLinePro from "./baseLinePro.vue";
- import BaseGraphy from "./BaseGraphy";
- import BaseImagePro from "./BaseImagePro";
- import BaseEquipment from "./BaseEquipment";
- import bus from "@/bus/bus";
- const lineStyle = {
- 0: "Solid",
- 1: "Dashed",
-
- 2: "Dotted",
-
- 3: "None",
- };
- const arrowType = {
- 0: "None",
- 1: "Basic",
-
- 2: "Triangle",
-
- 3: "Diamond",
- 4: "Square",
- 5: "Circle",
- };
- export default {
- components: {
- baseTextPro,
- baseLinePro,
- BaseGraphy,
- BaseImagePro,
- BaseEquipment,
- },
- data() {
- return {
- itemType: "",
- strokeColor: "",
- lineStyle: "solid",
- lineWidth: 1,
- fontSize: 0,
- textMsg: "",
- backgroundColor: "",
- Width: 0,
- Height: 0,
- Url: "",
- fillColor: "",
- begin: "",
- end: "",
- };
- },
- mounted() {
- bus.$on("emitChoice", this.emitChoice);
- },
- methods: {
- emitChoice(itemList) {
- if (itemList.length == 1) {
- const data = itemList[0].data
- ? itemList[0].data
- : itemList[0].legendData
- ? itemList[0].legendData
- : itemList[0].relationData
- ? itemList[0].relationData
- : null;
- this.itemType = data.properties.type ? data.properties.type : "";
- console.log("datadata", this.itemType);
- } else {
- this.itemType = "";
- }
- console.log(this.itemType);
-
- this.linkStyle(itemList);
- },
-
- linkStyle(itemList) {
- const item = itemList[0];
- if (this.itemType == "BaseArrow") {
- this.strokeColor = item.strokeColor.toRgba();
- this.lineStyle = lineStyle[item.lineStyle];
- this.lineWidth = item.lineWidth;
- this.begin = arrowType[item.begin];
- this.end = arrowType[item.end];
- console.log(this.begin, this.end);
- } else if (
- this.itemType == "BaseText" ||
- this.itemType == "BaseExplain"
- ) {
- this.strokeColor = item.strokeColor.toRgba();
- this.backgroundColor = item.backgroundColor.toRgba();
- this.textMsg = item.text;
- this.fontSize = item.font.size;
- } else if (
- this.itemType == "BaseImage" ||
- this.itemType == "BasePipeUninTool"
- ) {
- this.Width = item.width;
- this.Height = item.height;
- this.Url = item.url;
- this.lineStyle = lineStyle[item.lineStyle];
- this.lineWidth = item.lineWidth;
- this.strokeColor = item.strokeColor.toRgba();
- } else if (
- this.itemType == "BaseRect" ||
- this.itemType == "BaseTriangle" ||
- this.itemType == "BaseCircle" ||
- this.itemType == "BasePolygon"
- ) {
- this.Width = item.width;
- this.Height = item.height;
- this.lineStyle = lineStyle[item.lineStyle];
- this.lineWidth = item.lineWidth;
- this.strokeColor = item.strokeColor.toRgba();
- this.fillColor = item.fillColor.toRgba();
-
- }
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .propertys {
- }
- </style>
|