zydx-plus 1.32.300 → 1.32.302
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
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
:class="{ 'custom-select-options': true, 'scroll': maxHeight > 0 }">
|
|
34
34
|
<li v-for="(option, idx) in options"
|
|
35
35
|
:key="idx"
|
|
36
|
+
:class="option.disable ? 'disable': ''"
|
|
36
37
|
@click="handleClick(option)">{{ option.label }}</li>
|
|
37
38
|
</ul>
|
|
38
39
|
</template>
|
|
@@ -93,6 +94,9 @@ export default defineComponent({
|
|
|
93
94
|
this.isOpen = !this.isOpen
|
|
94
95
|
},
|
|
95
96
|
handleClick: function (option) {
|
|
97
|
+
if(option.disable) {
|
|
98
|
+
return
|
|
99
|
+
}
|
|
96
100
|
this.$emit('update:value', option.value)
|
|
97
101
|
this.$emit('select', option)
|
|
98
102
|
this.selected = option.label
|
|
@@ -260,4 +264,8 @@ export default defineComponent({
|
|
|
260
264
|
.custom-select-options li:focus {
|
|
261
265
|
color: v-bind(hover);
|
|
262
266
|
}
|
|
267
|
+
|
|
268
|
+
.disable {
|
|
269
|
+
color: gray !important;
|
|
270
|
+
}
|
|
263
271
|
</style>
|
|
@@ -8,7 +8,7 @@ render(divNode, document.body)
|
|
|
8
8
|
const container = divNode.el
|
|
9
9
|
|
|
10
10
|
// 导出函数可通过调用 Confirm() 函数动态创建 XtxConfirm 组件
|
|
11
|
-
const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText,closeShow, promptContent, middle, cancelShow, inputArr }) => {
|
|
11
|
+
const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText,closeShow, promptContent, middle, cancelShow, inputArr, countdown }) => {
|
|
12
12
|
// 返回 Promise 对象
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
14
|
// 2. 点击确认按钮,触发resolve同时销毁组件
|
|
@@ -49,7 +49,7 @@ const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText,c
|
|
|
49
49
|
render(null, container)
|
|
50
50
|
}
|
|
51
51
|
// 1. 创建 XtxConfirm 组件
|
|
52
|
-
const VNode = createVNode(XtxConfirm, { type, url ,title, submitText, cancelText, closeShow,promptContent,radioArr,checkboxArr, middle, cancelShow, inputArr, submit, cancel, close })
|
|
52
|
+
const VNode = createVNode(XtxConfirm, { type, url ,title, submitText, cancelText, closeShow,promptContent,radioArr,checkboxArr, middle, cancelShow, inputArr,countdown, submit, cancel, close })
|
|
53
53
|
render(VNode, container)
|
|
54
54
|
})
|
|
55
55
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<div class="tip-boxContent">
|
|
10
10
|
<div class="tap-p" ref="tapP">
|
|
11
11
|
<div class="tip-title2" ref="tipTitle" v-if="type === 'text'"
|
|
12
|
-
:style="{'text-align': (middles)? 'center': 'left', 'text-indent': indent? '2em': '0' }"
|
|
12
|
+
:style="{'text-align': (middles)? 'center': 'left', 'text-indent': indent? '2em': '0' }">{{ promptContent }} {{ countdown === 0?'':`(${timeo}s)` }}</div>
|
|
13
13
|
<div class="tip-img" v-if="type === 'img'">
|
|
14
14
|
<img :src="url" alt=""/>
|
|
15
15
|
</div>
|
|
@@ -94,6 +94,8 @@ import Select from '../../select/src/select.vue'
|
|
|
94
94
|
import Calendar from '../../calendar/src/Calendar'
|
|
95
95
|
import Year from '../../year/src/year'
|
|
96
96
|
|
|
97
|
+
let timeStop = null
|
|
98
|
+
|
|
97
99
|
export default {
|
|
98
100
|
name: 'zydx-tip-box',
|
|
99
101
|
components: {Select, Calendar,Year},
|
|
@@ -103,7 +105,8 @@ export default {
|
|
|
103
105
|
tipYear: false,
|
|
104
106
|
fileName: '',
|
|
105
107
|
middles: this.middle,
|
|
106
|
-
indent: false
|
|
108
|
+
indent: false,
|
|
109
|
+
timeo: 0
|
|
107
110
|
}
|
|
108
111
|
},
|
|
109
112
|
props: {
|
|
@@ -123,6 +126,10 @@ export default {
|
|
|
123
126
|
type: String,
|
|
124
127
|
default: '默认文字'
|
|
125
128
|
},
|
|
129
|
+
countdown: { // 倒计时
|
|
130
|
+
type: Number,
|
|
131
|
+
default: 0
|
|
132
|
+
},
|
|
126
133
|
middle: { // 弹窗中间的文字内容是居中 还是居左 默认居中
|
|
127
134
|
type: Boolean,
|
|
128
135
|
default: true
|
|
@@ -180,9 +187,26 @@ export default {
|
|
|
180
187
|
this.indent = true
|
|
181
188
|
}
|
|
182
189
|
}
|
|
190
|
+
if(this.countdown > 0) {
|
|
191
|
+
this.timeo = this.countdown
|
|
192
|
+
this.countdownFun()
|
|
193
|
+
}
|
|
183
194
|
})
|
|
184
195
|
},
|
|
196
|
+
beforeUnmount() {
|
|
197
|
+
clearInterval(timeStop)
|
|
198
|
+
},
|
|
185
199
|
methods: {
|
|
200
|
+
countdownFun() {
|
|
201
|
+
let that = this
|
|
202
|
+
timeStop = setInterval(function(){
|
|
203
|
+
that.timeo--;
|
|
204
|
+
if (that.timeo <= 0) {
|
|
205
|
+
clearInterval(timeStop)
|
|
206
|
+
that.cancel()
|
|
207
|
+
}
|
|
208
|
+
},1000)
|
|
209
|
+
},
|
|
186
210
|
checkboxTao(index) {
|
|
187
211
|
this.checkboxArr[index].checked = !this.checkboxArr[index].checked
|
|
188
212
|
},
|