派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-30 a312e0dd96d8f7e96fb3341f1a55561b12394405
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<template>
  <div class="bounced-box">
    <ul>
      <li>
        <form action="" class="bounced-box-title">
          <span>文字标注设置</span>
          <a @click="changeBounced()">X</a>
        </form>
      </li>
      <li>
        <form action="" class="bounced-box-content">
          <h6>内容:</h6>
          <div><textarea v-model='bouncedText' @blur="ChangeText"></textarea></div>
        </form>
      </li>
      <li class="bounced-box-choose">
        <span>颜色:</span>
        <select v-model='bouncedSelect' @click="changeLabelTextSelect()">
          <option v-for="(item,index) in selectOptions" :key="index" :value="item.value">{{ item.text }}</option>
        </select>
      </li>
    </ul>
  </div>
</template>
 
<script>
 
import MakeTation from '@components/plugin/MakeTation'
 
export default {
  name: 'TextBounced',
  data () {
    return {
      bouncedText: '',
      bouncedSelect: 'red',
      selectOptions: [
        {
          value: 'red',
          text: '红色'
        },
        {
          value: 'blue',
          text: '蓝色'
        },
        {
          value: 'yellow',
          text: '黄色'
        }
      ]
    }
  },
  methods: {
    changeBounced () {
      this.$emit('changeBounced', false)
    },
    changeLabelTextSelect () {
      // this.bouncedSelect = item
      console.log('获取颜色')
      MakeTation.setContentColor(this.bouncedSelect)
    },
    ChangeText () {
      MakeTation.setContentText(this.bouncedText)
      console.log(this.bouncedText)
    }
  }
}
</script>
 
<style lang="less" scoped>
.bounced-box {
  position: absolute;
  border: 1px solid grey;
  width: 150px;
  right: 5%;
  top: 238px;
  background-color: rgba(3, 28, 61, 0.8);
  color: white;
  cursor: default;
  left: 814px;
 
  ul {
    list-style: none;
    padding: 0;
    margin: 0;
 
    li {
      margin: 1rem 0;
    }
 
    .bounced-box-title {
      background-color: rgba(34, 83, 130, 0.8);
      cursor: move;
      display: flex;
      align-items: center;
      justify-content: space-around;
 
      a {
        color: white;
        cursor: pointer;
      }
    }
 
    .bounced-box-content {
      h6 {
        padding: 0;
        margin: 5px;
      }
 
      div {
        display: flex;
        align-items: center;
        justify-content: center;
 
        textarea {
          width: 90%;
          resize: none;
          outline: 0;
          border: 1px solid #a0b3d6;
          border-radius: 5px;
        }
      }
    }
 
    .bounced-box-choose {
      display: flex;
      align-items: center;
      justify-content: space-around;
    }
  }
}
</style>