zydx-plus 1.1.13 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.1.13",
3
+ "version": "1.1.16",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -30,6 +30,10 @@
30
30
  </div>
31
31
  </div>
32
32
  </div>
33
+ <div class="color-but">
34
+ <button @click="empty">清空</button>
35
+ <button @click="submit">确认</button>
36
+ </div>
33
37
  </div>
34
38
  </template>
35
39
 
@@ -39,7 +43,7 @@ export default {
39
43
  name: 'zydx-coloring',
40
44
  data() {
41
45
  return {
42
- backColor: 'rgb(103, 194, 58)',
46
+ backColor: 'rgb(103, 194, 58,1)',
43
47
  isCDown: false,
44
48
  circleCDown: false,
45
49
  colorX: 0,
@@ -55,16 +59,35 @@ export default {
55
59
  }
56
60
  },
57
61
  props: {
58
- color: Object,
62
+ color: String,
63
+ type: String
59
64
  },
60
65
  created() {
61
66
  this.$nextTick(() => {
67
+ console.log(this.color)
62
68
  if(this.color === undefined) return
63
69
  this.alternativeColor(this.color)
64
70
  })
65
71
  },
66
72
  methods: {
67
- alternativeColor(data) {
73
+ submit() {
74
+ this.$emit('submit', {
75
+ type: (this.type === undefined)? '': this.type,
76
+ rgba: `rgba(${this.maskRgb.r},${this.maskRgb.g},${this.maskRgb.b},${this.maskRgb.a})`
77
+ })
78
+ },
79
+ empty() {
80
+ this.$emit('empty', {
81
+ type: (this.type === undefined)? '': this.type,
82
+ rgba: `rgba(255,255,255,1)`
83
+ })
84
+ },
85
+ rgbaNum(rgba) {
86
+ let val = rgba.match(/(\d(\.\d+)?)+/g);
87
+ return {r: val[0],g: val[1],b: val[2],a: val[3]};
88
+ },
89
+ alternativeColor(rgba) {
90
+ let data = this.rgbaNum(rgba)
68
91
  let a = this.$refs.color.getBoundingClientRect().width
69
92
  let b = this.$refs.color.getBoundingClientRect().height
70
93
  let c = this.$refs.circle.getBoundingClientRect().width
@@ -111,7 +134,10 @@ export default {
111
134
  let hsv = rgb2hsv(this.Rgb.r,this.Rgb.g,this.Rgb.b)
112
135
  let hsvRgb = hsv2rgb(hsv.h,this.s,this.l)
113
136
  this.maskRgb = {r: hsvRgb.r,g: hsvRgb.g,b: hsvRgb.b,a: this.opacity}
114
- this.$emit('rgba', this.maskRgb)
137
+ this.$emit('rgba', {
138
+ type: (this.type === undefined)? '': this.type,
139
+ rgba: `rgba(${this.maskRgb.r},${this.maskRgb.g},${this.maskRgb.b},${this.maskRgb.a})`
140
+ })
115
141
  },
116
142
  circleBegin(event) {
117
143
  this.circleCDown = true
@@ -143,6 +169,20 @@ export default {
143
169
  </script>
144
170
 
145
171
  <style>
172
+ .color-but{
173
+ text-align: right;
174
+ padding-top: 10px;
175
+ }
176
+ .color-but button{
177
+ margin-left: 5px;
178
+ font-size: 12px;
179
+ background-color: transparent;
180
+ border: 1px solid #000;
181
+ border-radius: 3px;
182
+ padding: 2px 5px;
183
+ cursor: pointer;
184
+ min-width: 60px;
185
+ }
146
186
  .color-pop{
147
187
  position: absolute;
148
188
  top: 0;
@@ -49,6 +49,10 @@ export default defineComponent({
49
49
  pageCount: {
50
50
  type: Number,
51
51
  default: 10
52
+ },
53
+ currentPage: {
54
+ type: Number,
55
+ default: 1
52
56
  }
53
57
  },
54
58
  data() {
@@ -64,7 +68,7 @@ export default defineComponent({
64
68
  },
65
69
  computed: {
66
70
  pages: function () {
67
- return this.total / this.pageCount
71
+ return Math.ceil(this.total / this.pageCount)
68
72
  }
69
73
 
70
74
  },
@@ -72,12 +76,23 @@ export default defineComponent({
72
76
  page: {
73
77
  handler: function (v) {
74
78
  if (v >= this.pages) {
75
- this.page = this.pages
79
+ this.page = Number(String(this.page).slice(2))
76
80
  }
77
81
  if (v <= 1) {
78
82
  this.page = 1
79
83
  }
80
84
  }
85
+ },
86
+ currentPage: {
87
+ handler: function (v) {
88
+ if (v >= this.pages) {
89
+ this.page = this.pages
90
+ } else {
91
+
92
+ this.page = v
93
+ }
94
+ },
95
+ immediate: true
81
96
  }
82
97
  }
83
98
  })
@@ -51,7 +51,7 @@ export default defineComponent({
51
51
  return this.currentPage === this.pages
52
52
  },
53
53
  pages: function () {
54
- return this.total / this.pageCount
54
+ return Math.ceil(this.total / this.pageCount)
55
55
  }
56
56
  },
57
57
  watch: {
@@ -131,7 +131,7 @@ export default {
131
131
  v-html="tree.icon.value"></span>
132
132
  </template>
133
133
  <template v-else>
134
- <i :class="`iconfont' 'tree_icon' ${tree.icon.value}`"></i>
134
+ <i :class="`iconfont tree_icon ${tree.icon.value}`"></i>
135
135
  </template>
136
136
  </template>
137
137
  <span class="tree_text"
package/src/index.js CHANGED
@@ -23,7 +23,7 @@ function install(app) {
23
23
  }
24
24
 
25
25
  export default {
26
- version: '1.1.12',
26
+ version: '1.1.16',
27
27
  install,
28
28
  Calendar,
29
29
  Message,