|
@@ -1,26 +1,28 @@
|
|
|
<template>
|
|
|
<div class="hotspot-icon-personalized-tag">
|
|
|
<div class="line-show-setting switcher-wrap">
|
|
|
- <span class="label">{{$i18n.t('hotspot.if_show_marking_line')}}</span>
|
|
|
- <Switcher :value="hotspot.personalizedTagInfo.isShowLine" @change="onSwitcherChange"></Switcher>
|
|
|
+ <span class="label">{{ $i18n.t("hotspot.if_show_marking_line") }}</span>
|
|
|
+ <Switcher
|
|
|
+ :value="hotspot.personalizedTagInfo.isShowLine"
|
|
|
+ @change="onSwitcherChange"
|
|
|
+ ></Switcher>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div class="svg-wrapper"></div>
|
|
|
|
|
|
- <div class="remark-highlight">{{ $i18n.t('hotspot.hotspot_title') }}</div>
|
|
|
+ <div class="remark-highlight">{{ $i18n.t("hotspot.hotspot_title") }}</div>
|
|
|
<div class="title-input-wrapper">
|
|
|
<input
|
|
|
v-model.trim="hotspot.hotspotTitle"
|
|
|
- type="text" maxlength="15"
|
|
|
+ type="text"
|
|
|
+ maxlength="15"
|
|
|
:placeholder="$i18n.t('hotspot.title_placeholder')"
|
|
|
/>
|
|
|
<span class="count">{{ hotspot.hotspotTitle.length }}/15</span>
|
|
|
</div>
|
|
|
|
|
|
- <div class="remark">{{ $i18n.t('hotspot.hotspot_title') }}</div>
|
|
|
- <div
|
|
|
- class="color-picker-wrap"
|
|
|
- >
|
|
|
+ <div class="remark">{{ $i18n.t("hotspot.hotspot_title") }}</div>
|
|
|
+ <div class="color-picker-wrap">
|
|
|
<div class="color-value">{{ hotspot.personalizedTagInfo.fillColor }}</div>
|
|
|
<div
|
|
|
class="color-preview"
|
|
@@ -34,11 +36,11 @@
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div class="remark">{{ $i18n.t('hotspot.shape_border_color') }}</div>
|
|
|
- <div
|
|
|
- class="color-picker-wrap"
|
|
|
- >
|
|
|
- <div class="color-value">{{ hotspot.personalizedTagInfo.borderColor }}</div>
|
|
|
+ <div class="remark">{{ $i18n.t("hotspot.shape_border_color") }}</div>
|
|
|
+ <div class="color-picker-wrap">
|
|
|
+ <div class="color-value">
|
|
|
+ {{ hotspot.personalizedTagInfo.borderColor }}
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="color-preview"
|
|
|
:style="`background-color: ${hotspot.personalizedTagInfo.borderColor};`"
|
|
@@ -51,10 +53,8 @@
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div class="remark">{{ $i18n.t('hotspot.text_color') }}</div>
|
|
|
- <div
|
|
|
- class="color-picker-wrap"
|
|
|
- >
|
|
|
+ <div class="remark">{{ $i18n.t("hotspot.text_color") }}</div>
|
|
|
+ <div class="color-picker-wrap">
|
|
|
<div class="color-value">{{ hotspot.personalizedTagInfo.textColor }}</div>
|
|
|
<div
|
|
|
class="color-preview"
|
|
@@ -68,7 +68,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div class="remark">{{ $i18n.t('hotspot.text_direction') }}</div>
|
|
|
+ <div class="remark">{{ $i18n.t("hotspot.text_direction") }}</div>
|
|
|
<TabbarSwitcherIcon
|
|
|
class="text-direction-switcher"
|
|
|
:tabList="[
|
|
@@ -86,17 +86,20 @@
|
|
|
/>
|
|
|
|
|
|
<div class="text-wrap-setting switcher-wrap">
|
|
|
- <span class="label">{{ $i18n.t('hotspot.if_wrap') }}</span>
|
|
|
- <Switcher :value="hotspot.personalizedTagInfo.isTextWrap" @change="onTextWrapChange"></Switcher>
|
|
|
+ <span class="label">{{ $i18n.t("hotspot.if_wrap") }}</span>
|
|
|
+ <Switcher
|
|
|
+ :value="hotspot.personalizedTagInfo.isTextWrap"
|
|
|
+ @change="onTextWrapChange"
|
|
|
+ ></Switcher>
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
class="text-num-per-line-wrap"
|
|
|
:class="{
|
|
|
- disable: !hotspot.personalizedTagInfo.isTextWrap
|
|
|
+ disable: !hotspot.personalizedTagInfo.isTextWrap,
|
|
|
}"
|
|
|
>
|
|
|
- <div class="remark">{{ $i18n.t('hotspot.text_num_per_line') }}</div>
|
|
|
+ <div class="remark">{{ $i18n.t("hotspot.text_num_per_line") }}</div>
|
|
|
<div class="value-wrap">
|
|
|
<input
|
|
|
v-model.trim.number="hotspot.personalizedTagInfo.textNumPerLine"
|
|
@@ -104,11 +107,10 @@
|
|
|
type="number"
|
|
|
min="1"
|
|
|
:disabled="!hotspot.personalizedTagInfo.isTextWrap"
|
|
|
- >
|
|
|
- <span class="remark">{{ $i18n.t('hotspot.words') }}</span>
|
|
|
+ />
|
|
|
+ <span class="remark">{{ $i18n.t("hotspot.words") }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -131,103 +133,103 @@ export default {
|
|
|
|
|
|
endpointListForShow: [
|
|
|
{
|
|
|
- id: 'left-top',
|
|
|
- x: 'calc(0% + 7px)',
|
|
|
- cx: 'calc(0% + 7px + (7px / 2))',
|
|
|
- y: 'calc(0% + 7px)',
|
|
|
- cy: 'calc(0% + 7px + (7px / 2))',
|
|
|
+ id: "left-top",
|
|
|
+ x: "calc(0% + 7px)",
|
|
|
+ cx: "calc(0% + 7px + (7px / 2))",
|
|
|
+ y: "calc(0% + 7px)",
|
|
|
+ cy: "calc(0% + 7px + (7px / 2))",
|
|
|
},
|
|
|
{
|
|
|
- id: 'center-top',
|
|
|
- x: 'calc(50% - 7px / 2)',
|
|
|
- cx: '50%',
|
|
|
- y: 'calc(0% + 7px)',
|
|
|
- cy: 'calc(0% + 7px + (7px / 2))',
|
|
|
+ id: "center-top",
|
|
|
+ x: "calc(50% - 7px / 2)",
|
|
|
+ cx: "50%",
|
|
|
+ y: "calc(0% + 7px)",
|
|
|
+ cy: "calc(0% + 7px + (7px / 2))",
|
|
|
},
|
|
|
{
|
|
|
- id: 'right-top',
|
|
|
- x: 'calc(100% - 7px - 7px)',
|
|
|
- cx: 'calc(100% - 7px - (7px / 2))',
|
|
|
- y: 'calc(0% + 7px)',
|
|
|
- cy: 'calc(0% + 7px + (7px / 2))',
|
|
|
+ id: "right-top",
|
|
|
+ x: "calc(100% - 7px - 7px)",
|
|
|
+ cx: "calc(100% - 7px - (7px / 2))",
|
|
|
+ y: "calc(0% + 7px)",
|
|
|
+ cy: "calc(0% + 7px + (7px / 2))",
|
|
|
},
|
|
|
{
|
|
|
- id: 'right-center',
|
|
|
- x: 'calc(100% - 7px - 7px)',
|
|
|
- cx: 'calc(100% - 7px - (7px / 2))',
|
|
|
- y: 'calc(50% - 7px / 2)',
|
|
|
- cy: '50%',
|
|
|
+ id: "right-center",
|
|
|
+ x: "calc(100% - 7px - 7px)",
|
|
|
+ cx: "calc(100% - 7px - (7px / 2))",
|
|
|
+ y: "calc(50% - 7px / 2)",
|
|
|
+ cy: "50%",
|
|
|
},
|
|
|
{
|
|
|
- id: 'right-bottom',
|
|
|
- x: 'calc(100% - 7px - 7px)',
|
|
|
- cx: 'calc(100% - 7px - (7px / 2))',
|
|
|
- y: 'calc(100% - 7px - 7px)',
|
|
|
- cy: 'calc(100% - 7px - (7px / 2))',
|
|
|
+ id: "right-bottom",
|
|
|
+ x: "calc(100% - 7px - 7px)",
|
|
|
+ cx: "calc(100% - 7px - (7px / 2))",
|
|
|
+ y: "calc(100% - 7px - 7px)",
|
|
|
+ cy: "calc(100% - 7px - (7px / 2))",
|
|
|
},
|
|
|
{
|
|
|
- id: 'center-bottom',
|
|
|
- x: 'calc(50% - 7px / 2)',
|
|
|
- cx: '50%',
|
|
|
- y: 'calc(100% - 7px - 7px)',
|
|
|
- cy: 'calc(100% - 7px - (7px / 2))',
|
|
|
+ id: "center-bottom",
|
|
|
+ x: "calc(50% - 7px / 2)",
|
|
|
+ cx: "50%",
|
|
|
+ y: "calc(100% - 7px - 7px)",
|
|
|
+ cy: "calc(100% - 7px - (7px / 2))",
|
|
|
},
|
|
|
{
|
|
|
- id: 'left-bottom',
|
|
|
- x: 'calc(0% + 7px)',
|
|
|
- cx: 'calc(0% + 7px + (7px / 2))',
|
|
|
- y: 'calc(100% - 7px - 7px)',
|
|
|
- cy: 'calc(100% - 7px - (7px / 2))',
|
|
|
+ id: "left-bottom",
|
|
|
+ x: "calc(0% + 7px)",
|
|
|
+ cx: "calc(0% + 7px + (7px / 2))",
|
|
|
+ y: "calc(100% - 7px - 7px)",
|
|
|
+ cy: "calc(100% - 7px - (7px / 2))",
|
|
|
},
|
|
|
{
|
|
|
- id: 'left-center',
|
|
|
- x: 'calc(0% + 7px)',
|
|
|
- cx: 'calc(0% + 7px + (7px / 2))',
|
|
|
- y: 'calc(50% - 7px / 2)',
|
|
|
- cy: '50%',
|
|
|
+ id: "left-center",
|
|
|
+ x: "calc(0% + 7px)",
|
|
|
+ cx: "calc(0% + 7px + (7px / 2))",
|
|
|
+ y: "calc(50% - 7px / 2)",
|
|
|
+ cy: "50%",
|
|
|
},
|
|
|
],
|
|
|
|
|
|
endpointListForClick: [
|
|
|
{
|
|
|
- id: 'left-top',
|
|
|
- x: '0%',
|
|
|
- y: '0%',
|
|
|
+ id: "left-top",
|
|
|
+ x: "0%",
|
|
|
+ y: "0%",
|
|
|
},
|
|
|
{
|
|
|
- id: 'center-top',
|
|
|
- x: 'calc(50% - 21px / 2)',
|
|
|
- y: '0%',
|
|
|
+ id: "center-top",
|
|
|
+ x: "calc(50% - 21px / 2)",
|
|
|
+ y: "0%",
|
|
|
},
|
|
|
{
|
|
|
- id: 'right-top',
|
|
|
- x: 'calc(100% - 21px)',
|
|
|
- y: '0%',
|
|
|
+ id: "right-top",
|
|
|
+ x: "calc(100% - 21px)",
|
|
|
+ y: "0%",
|
|
|
},
|
|
|
{
|
|
|
- id: 'right-center',
|
|
|
- x: 'calc(100% - 21px)',
|
|
|
- y: 'calc(50% - 21px / 2)',
|
|
|
+ id: "right-center",
|
|
|
+ x: "calc(100% - 21px)",
|
|
|
+ y: "calc(50% - 21px / 2)",
|
|
|
},
|
|
|
{
|
|
|
- id: 'right-bottom',
|
|
|
- x: 'calc(100% - 21px)',
|
|
|
- y: 'calc(100% - 21px)',
|
|
|
+ id: "right-bottom",
|
|
|
+ x: "calc(100% - 21px)",
|
|
|
+ y: "calc(100% - 21px)",
|
|
|
},
|
|
|
{
|
|
|
- id: 'center-bottom',
|
|
|
- x: 'calc(50% - 21px / 2)',
|
|
|
- y: 'calc(100% - 21px)',
|
|
|
+ id: "center-bottom",
|
|
|
+ x: "calc(50% - 21px / 2)",
|
|
|
+ y: "calc(100% - 21px)",
|
|
|
},
|
|
|
{
|
|
|
- id: 'left-bottom',
|
|
|
- x: '0%',
|
|
|
- y: 'calc(100% - 21px)',
|
|
|
+ id: "left-bottom",
|
|
|
+ x: "0%",
|
|
|
+ y: "calc(100% - 21px)",
|
|
|
},
|
|
|
{
|
|
|
- id: 'left-center',
|
|
|
- x: '0%',
|
|
|
- y: 'calc(50% - 21px / 2)',
|
|
|
+ id: "left-center",
|
|
|
+ x: "0%",
|
|
|
+ y: "calc(50% - 21px / 2)",
|
|
|
},
|
|
|
],
|
|
|
|
|
@@ -248,164 +250,206 @@ export default {
|
|
|
"rgba(155, 155, 155, 1)",
|
|
|
"rgba(255, 255, 255, 1)",
|
|
|
],
|
|
|
- }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ "hotspot.personalizedTagInfo.lineDirection": {
|
|
|
+ handler: function (value) {
|
|
|
+ this.selectLineClick(value);
|
|
|
+ },
|
|
|
+ // deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
- hotspot: 'hotspot',
|
|
|
+ hotspot: "hotspot",
|
|
|
}),
|
|
|
currentTextDirectionIdx() {
|
|
|
switch (this.hotspot.personalizedTagInfo.textDirection) {
|
|
|
- case 'left-right':
|
|
|
- return 0
|
|
|
- case 'top-bottom':
|
|
|
- return 1
|
|
|
- default:
|
|
|
- return 0
|
|
|
+ case "left-right":
|
|
|
+ return 0;
|
|
|
+ case "top-bottom":
|
|
|
+ return 1;
|
|
|
+ default:
|
|
|
+ return 0;
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
onSwitcherChange(v) {
|
|
|
- this.hotspot.personalizedTagInfo.isShowLine = v
|
|
|
+ this.hotspot.personalizedTagInfo.isShowLine = v;
|
|
|
},
|
|
|
onFillColorActiveChange(e) {
|
|
|
- this.hotspot.personalizedTagInfo.fillColor = e
|
|
|
+ this.hotspot.personalizedTagInfo.fillColor = e;
|
|
|
},
|
|
|
onBorderColorActiveChange(e) {
|
|
|
- this.hotspot.personalizedTagInfo.borderColor = e
|
|
|
+ this.hotspot.personalizedTagInfo.borderColor = e;
|
|
|
},
|
|
|
onTextColorActiveChange(e) {
|
|
|
- this.hotspot.personalizedTagInfo.textColor = e
|
|
|
+ this.hotspot.personalizedTagInfo.textColor = e;
|
|
|
},
|
|
|
onSelectTextDirection(idx) {
|
|
|
switch (idx) {
|
|
|
case 0:
|
|
|
- this.hotspot.personalizedTagInfo.textDirection = 'left-right'
|
|
|
+ this.hotspot.personalizedTagInfo.textDirection = "left-right";
|
|
|
break;
|
|
|
case 1:
|
|
|
- this.hotspot.personalizedTagInfo.textDirection = 'top-bottom'
|
|
|
+ this.hotspot.personalizedTagInfo.textDirection = "top-bottom";
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
onTextWrapChange(v) {
|
|
|
- this.hotspot.personalizedTagInfo.isTextWrap = v
|
|
|
+ this.hotspot.personalizedTagInfo.isTextWrap = v;
|
|
|
},
|
|
|
onTextNumPerLineInputBlur() {
|
|
|
if (this.hotspot.personalizedTagInfo.textNumPerLine < 1) {
|
|
|
- this.hotspot.personalizedTagInfo.textNumPerLine = 1
|
|
|
+ this.hotspot.personalizedTagInfo.textNumPerLine = 1;
|
|
|
} else {
|
|
|
- this.hotspot.personalizedTagInfo.textNumPerLine = Math.round(this.hotspot.personalizedTagInfo.textNumPerLine)
|
|
|
+ this.hotspot.personalizedTagInfo.textNumPerLine = Math.round(
|
|
|
+ this.hotspot.personalizedTagInfo.textNumPerLine
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
+ selectLineClick(id) {
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.svgNode) {
|
|
|
+ console.log("id", id);
|
|
|
+ const selectNode = this.svgNode
|
|
|
+ .selectAll("rect.endpoint-for-click")
|
|
|
+ .filter((d) => {
|
|
|
+ return d.id === id;
|
|
|
+ });
|
|
|
+ console.log("selectNode", selectNode);
|
|
|
+ selectNode.dispatch("click");
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.svgNode = d3.select('.svg-wrapper')
|
|
|
+ this.svgNode = d3
|
|
|
+ .select(".svg-wrapper")
|
|
|
.append("svg")
|
|
|
- .attr("width", '100%')
|
|
|
- .attr('height', '100%')
|
|
|
-
|
|
|
+ .attr("width", "100%")
|
|
|
+ .attr("height", "100%");
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
- const that = this
|
|
|
+ const that = this;
|
|
|
|
|
|
// 大方框
|
|
|
- this.svgNode.append('rect')
|
|
|
- .attr('x', 'calc(7px + (7px / 2))')
|
|
|
- .attr('y', 'calc(7px + (7px / 2)')
|
|
|
- .attr('width', 'calc(100% - (7px + (7px / 2)) * 2)')
|
|
|
- .attr('height', 'calc(100% - (7px + (7px / 2)) * 2)')
|
|
|
- .attr('fill', 'none')
|
|
|
- .attr('stroke-width', '1px')
|
|
|
- .attr('stroke', '#404040')
|
|
|
+ this.svgNode
|
|
|
+ .append("rect")
|
|
|
+ .attr("x", "calc(7px + (7px / 2))")
|
|
|
+ .attr("y", "calc(7px + (7px / 2)")
|
|
|
+ .attr("width", "calc(100% - (7px + (7px / 2)) * 2)")
|
|
|
+ .attr("height", "calc(100% - (7px + (7px / 2)) * 2)")
|
|
|
+ .attr("fill", "none")
|
|
|
+ .attr("stroke-width", "1px")
|
|
|
+ .attr("stroke", "#404040");
|
|
|
|
|
|
// 中心小圆
|
|
|
- this.svgNode.append('circle')
|
|
|
- .attr('cx', '50%')
|
|
|
- .attr('cy', '50%')
|
|
|
- .attr('r', '5px')
|
|
|
- .attr('fill', '#fff')
|
|
|
+ this.svgNode
|
|
|
+ .append("circle")
|
|
|
+ .attr("cx", "50%")
|
|
|
+ .attr("cy", "50%")
|
|
|
+ .attr("r", "5px")
|
|
|
+ .attr("fill", "#fff");
|
|
|
|
|
|
// 中心稍大的圈
|
|
|
- this.svgNode.append('circle')
|
|
|
- .attr('cx', '50%')
|
|
|
- .attr('cy', '50%')
|
|
|
- .attr('r', '7px')
|
|
|
- .attr('fill', 'none')
|
|
|
- .attr('stroke-width', '1px')
|
|
|
- .attr('stroke', 'rgba(255, 255, 255, 0.2)')
|
|
|
+ this.svgNode
|
|
|
+ .append("circle")
|
|
|
+ .attr("cx", "50%")
|
|
|
+ .attr("cy", "50%")
|
|
|
+ .attr("r", "7px")
|
|
|
+ .attr("fill", "none")
|
|
|
+ .attr("stroke-width", "1px")
|
|
|
+ .attr("stroke", "rgba(255, 255, 255, 0.2)");
|
|
|
|
|
|
// 中心到各端点的线
|
|
|
- this.svgNode.selectAll('line')
|
|
|
+ this.svgNode
|
|
|
+ .selectAll("line")
|
|
|
.data(this.endpointListForShow)
|
|
|
.enter()
|
|
|
- .append('line')
|
|
|
- .attr('x1', '50%')
|
|
|
- .attr('y1', '50%')
|
|
|
- .attr('x2', (d) => d.cx)
|
|
|
- .attr('y2', (d) => d.cy)
|
|
|
- .attr('stroke-width', '1px')
|
|
|
- .attr('stroke', 'none')
|
|
|
+ .append("line")
|
|
|
+ .attr("x1", "50%")
|
|
|
+ .attr("y1", "50%")
|
|
|
+ .attr("x2", (d) => d.cx)
|
|
|
+ .attr("y2", (d) => d.cy)
|
|
|
+ .attr("stroke-width", "1px")
|
|
|
+ .attr("stroke", "none");
|
|
|
|
|
|
// 各端点-用于显示
|
|
|
- this.svgNode.selectAll('rect.endpoint-for-show')
|
|
|
+ this.svgNode
|
|
|
+ .selectAll("rect.endpoint-for-show")
|
|
|
.data(this.endpointListForShow)
|
|
|
.enter()
|
|
|
- .append('rect')
|
|
|
- .classed('endpoint-for-show', true)
|
|
|
- .attr('x', (d) => d.x)
|
|
|
- .attr('y', (d) => d.y)
|
|
|
- .attr('width', '7px')
|
|
|
- .attr('height', '7px')
|
|
|
- .attr('rx', '2px')
|
|
|
- .attr('ry', '2px')
|
|
|
- .attr('fill', '#1a1b1d')
|
|
|
- .attr('stroke-width', '1px')
|
|
|
- .attr('stroke', '#666')
|
|
|
- .attr('idx', (d, i) => i)
|
|
|
- .attr('cursor', 'pointer')
|
|
|
+ .append("rect")
|
|
|
+ .classed("endpoint-for-show", true)
|
|
|
+ .attr("x", (d) => d.x)
|
|
|
+ .attr("y", (d) => d.y)
|
|
|
+ .attr("width", "7px")
|
|
|
+ .attr("height", "7px")
|
|
|
+ .attr("rx", "2px")
|
|
|
+ .attr("ry", "2px")
|
|
|
+ .attr("fill", "#1a1b1d")
|
|
|
+ .attr("stroke-width", "1px")
|
|
|
+ .attr("stroke", "#666")
|
|
|
+ .attr("idx", (d, i) => i)
|
|
|
+ .attr("cursor", "pointer");
|
|
|
|
|
|
// 各端点-用于点击
|
|
|
- this.svgNode.selectAll('rect.endpoint-for-click')
|
|
|
+ this.svgNode
|
|
|
+ .selectAll("rect.endpoint-for-click")
|
|
|
.data(this.endpointListForClick)
|
|
|
.enter()
|
|
|
- .append('rect')
|
|
|
- .classed('endpoint-for-click', true)
|
|
|
- .attr('x', (d) => d.x)
|
|
|
- .attr('y', (d) => d.y)
|
|
|
- .attr('width', '21px')
|
|
|
- .attr('height', '21px')
|
|
|
- .attr('rx', '2px')
|
|
|
- .attr('ry', '2px')
|
|
|
- .attr('fill', 'transparent')
|
|
|
- .attr('idx', (d, i) => i)
|
|
|
- .attr('cursor', 'pointer')
|
|
|
- .on('click', function(e, datum) {
|
|
|
- that.svgNode.selectAll('line').attr('stroke', 'none')
|
|
|
- that.svgNode.selectAll('rect.endpoint-for-show')
|
|
|
- .attr('fill', '#1a1b1d')
|
|
|
- .attr('stroke', '#666')
|
|
|
-
|
|
|
- that.svgNode.selectAll('line').filter((d) => {
|
|
|
- return d.id === datum.id
|
|
|
- }).attr('stroke', '#fff')
|
|
|
- that.svgNode.selectAll('rect.endpoint-for-show').filter((d) => {
|
|
|
- return d.id === datum.id
|
|
|
- }).attr('fill', '#0076F6')
|
|
|
- .attr('stroke', '#fff')
|
|
|
+ .append("rect")
|
|
|
+ .classed("endpoint-for-click", true)
|
|
|
+ .attr("x", (d) => d.x)
|
|
|
+ .attr("y", (d) => d.y)
|
|
|
+ .attr("width", "21px")
|
|
|
+ .attr("height", "21px")
|
|
|
+ .attr("rx", "2px")
|
|
|
+ .attr("ry", "2px")
|
|
|
+ .attr("fill", "transparent")
|
|
|
+ .attr("idx", (d, i) => i)
|
|
|
+ .attr("cursor", "pointer")
|
|
|
+ .on("click", function (e, datum) {
|
|
|
+ that.svgNode.selectAll("line").attr("stroke", "none");
|
|
|
+ that.svgNode
|
|
|
+ .selectAll("rect.endpoint-for-show")
|
|
|
+ .attr("fill", "#1a1b1d")
|
|
|
+ .attr("stroke", "#666");
|
|
|
+
|
|
|
+ that.svgNode
|
|
|
+ .selectAll("line")
|
|
|
+ .filter((d) => {
|
|
|
+ return d.id === datum.id;
|
|
|
+ })
|
|
|
+ .attr("stroke", "#fff");
|
|
|
+ that.svgNode
|
|
|
+ .selectAll("rect.endpoint-for-show")
|
|
|
+ .filter((d) => {
|
|
|
+ return d.id === datum.id;
|
|
|
+ })
|
|
|
+ .attr("fill", "#0076F6")
|
|
|
+ .attr("stroke", "#fff");
|
|
|
|
|
|
- that.hotspot.personalizedTagInfo.lineDirection = datum.id
|
|
|
- })
|
|
|
+ that.hotspot.personalizedTagInfo.lineDirection = datum.id;
|
|
|
+ });
|
|
|
|
|
|
// 初始状态
|
|
|
- this.svgNode.selectAll('rect.endpoint-for-click').filter((d) => {
|
|
|
- return d.id === that.hotspot.personalizedTagInfo.lineDirection
|
|
|
- }).dispatch('click')
|
|
|
-
|
|
|
+
|
|
|
+ // this.svgNode
|
|
|
+ // .selectAll("rect.endpoint-for-click")
|
|
|
+ // .filter((d) => {
|
|
|
+ // return d.id === that.hotspot.personalizedTagInfo.lineDirection;
|
|
|
+ // })
|
|
|
+ // .dispatch("click");
|
|
|
}, 100);
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -413,12 +457,12 @@ export default {
|
|
|
.remark-highlight {
|
|
|
margin-top: 16px;
|
|
|
font-size: 18px;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
.remark {
|
|
|
margin-top: 16px;
|
|
|
font-size: 14px;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
opacity: 0.6;
|
|
|
}
|
|
|
|
|
@@ -436,24 +480,24 @@ export default {
|
|
|
> .svg-wrapper {
|
|
|
margin-top: 16px;
|
|
|
height: 110px;
|
|
|
- background: #1A1B1D;
|
|
|
+ background: #1a1b1d;
|
|
|
border-radius: 2px;
|
|
|
border: 1px solid #404040;
|
|
|
}
|
|
|
|
|
|
- >.title-input-wrapper {
|
|
|
+ > .title-input-wrapper {
|
|
|
position: relative;
|
|
|
border: 1px solid rgba(151, 151, 151, 0.2);
|
|
|
padding: 0 16px;
|
|
|
- background: #1A1B1D;
|
|
|
+ background: #1a1b1d;
|
|
|
border-radius: 2px;
|
|
|
height: 36px;
|
|
|
width: 100%;
|
|
|
margin-top: 18px;
|
|
|
&:focus-within {
|
|
|
- border-color: #0076F6;
|
|
|
+ border-color: #0076f6;
|
|
|
}
|
|
|
- >input {
|
|
|
+ > input {
|
|
|
border: none;
|
|
|
background: transparent;
|
|
|
outline: none;
|
|
@@ -464,7 +508,7 @@ export default {
|
|
|
letter-spacing: 1px;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
- >.count {
|
|
|
+ > .count {
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
@@ -487,7 +531,7 @@ export default {
|
|
|
position: relative;
|
|
|
.color-value {
|
|
|
font-size: 14px;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
.color-preview {
|
|
|
width: 26px;
|
|
@@ -527,11 +571,11 @@ export default {
|
|
|
> input {
|
|
|
width: 60px;
|
|
|
height: 36px;
|
|
|
- background: #1A1B1D;
|
|
|
+ background: #1a1b1d;
|
|
|
border-radius: 2px;
|
|
|
border: 1px solid #404040;
|
|
|
font-size: 14px;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
margin-right: 10px;
|
|
|
padding-left: 16px;
|
|
|
&:focus {
|
|
@@ -541,4 +585,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|