doway-coms 2.2.18 → 2.2.21
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/.browserslistrc +2 -2
- package/README.md +28 -28
- package/package.json +53 -53
- package/packages/AuditsList/index.js +7 -7
- package/packages/AuditsList/src/index.vue +262 -262
- package/packages/BaseButton/index.js +7 -7
- package/packages/BaseButton/src/index.vue +241 -241
- package/packages/BaseCheckbox/index.js +7 -7
- package/packages/BaseCheckbox/src/index.vue +134 -134
- package/packages/BaseDate/index.js +7 -7
- package/packages/BaseDate/src/index.vue +197 -197
- package/packages/BaseDateWeek/index.js +7 -7
- package/packages/BaseDateWeek/src/index.vue +163 -163
- package/packages/BaseDatetime/index.js +7 -7
- package/packages/BaseDatetime/src/index.vue +196 -196
- package/packages/BaseForm/index.js +7 -7
- package/packages/BaseForm/src/index.vue +728 -728
- package/packages/BaseGantt/index.js +9 -9
- package/packages/BaseGantt/src/index.vue +608 -608
- package/packages/BaseGrid/index.js +9 -9
- package/packages/BaseGrid/src/SeqSetting.vue +278 -278
- package/packages/BaseGrid/src/index.vue +3580 -3580
- package/packages/BaseGridAdjust/index.js +9 -9
- package/packages/BaseGridAdjust/src/index.vue +482 -482
- package/packages/BaseInput/index.js +7 -7
- package/packages/BaseInput/src/index.vue +164 -164
- package/packages/BaseIntervalInput/index.js +7 -7
- package/packages/BaseIntervalInput/src/index.vue +310 -310
- package/packages/BaseKanbanEmpty/index.js +7 -7
- package/packages/BaseKanbanEmpty/src/index.vue +176 -176
- package/packages/BaseNumberInput/index.js +7 -7
- package/packages/BaseNumberInput/src/index.vue +293 -293
- package/packages/BasePagination/index.js +7 -7
- package/packages/BasePagination/src/index.vue +91 -91
- package/packages/BasePictureCard/index.js +7 -7
- package/packages/BasePictureCard/src/index.vue +580 -580
- package/packages/BasePrintPreview/index.js +7 -7
- package/packages/BasePrintPreview/src/index.vue +129 -129
- package/packages/BasePulldown/index.js +7 -7
- package/packages/BasePulldown/src/index.vue +1265 -1265
- package/packages/BaseSearch/index.js +7 -7
- package/packages/BaseSearch/src/index.vue +935 -935
- package/packages/BaseSelect/index.js +7 -7
- package/packages/BaseSelect/src/index.vue +155 -155
- package/packages/BaseSelectMulti/index.js +7 -7
- package/packages/BaseSelectMulti/src/index.vue +148 -148
- package/packages/BaseTextArea/index.js +7 -7
- package/packages/BaseTextArea/src/index.vue +178 -178
- package/packages/BaseTime/index.js +7 -7
- package/packages/BaseTime/src/index.vue +166 -166
- package/packages/BaseTool/index.js +7 -7
- package/packages/BaseTool/src/index.vue +349 -349
- package/packages/BaseToolStatus/index.js +7 -7
- package/packages/BaseToolStatus/src/index.vue +388 -388
- package/packages/BaseTreeSelect/index.js +8 -8
- package/packages/BaseTreeSelect/src/index.vue +437 -416
- package/packages/LeaveAMessage/index.js +7 -7
- package/packages/LeaveAMessage/src/index.vue +597 -597
- package/packages/index.js +191 -191
- package/packages/styles/default.css +78 -78
- package/packages/styles/default.less +84 -84
- package/packages/utils/api.js +107 -107
- package/packages/utils/auth.js +38 -38
- package/packages/utils/common.js +610 -610
- package/packages/utils/dom.js +181 -181
- package/packages/utils/enum.js +86 -86
- package/packages/utils/filters.js +472 -472
- package/packages/utils/gridFormat.js +66 -66
- package/packages/utils/msg.js +84 -84
- package/packages/utils/patchFiles.js +44 -44
- package/packages/utils/request.js +178 -178
- package/packages/utils/store.js +305 -303
- package/vue.config.js +59 -59
|
@@ -1,310 +1,310 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="d-control-container">
|
|
3
|
-
<div class="d-control-label">
|
|
4
|
-
{{ label
|
|
5
|
-
}}
|
|
6
|
-
<span
|
|
7
|
-
v-if="rules && Object.getOwnPropertyNames(rules).length > 0"
|
|
8
|
-
class="d-control-label-required"
|
|
9
|
-
>*</span
|
|
10
|
-
>
|
|
11
|
-
<Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
|
|
12
|
-
<img src="../../styles/icon/help.png" alt="" style="width: 14px">
|
|
13
|
-
</Tooltip>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="d-control" style="font-size:12px">
|
|
16
|
-
<ValidationProvider
|
|
17
|
-
:name="label"
|
|
18
|
-
v-slot="v"
|
|
19
|
-
:rules="rules"
|
|
20
|
-
v-if="edit === true"
|
|
21
|
-
>
|
|
22
|
-
<input v-model="currentValue" style="display:none" />
|
|
23
|
-
<div style="display:flex;flex-flow:row nowrap">
|
|
24
|
-
<input
|
|
25
|
-
type="number"
|
|
26
|
-
v-model="dayValue"
|
|
27
|
-
@input="dayChange"
|
|
28
|
-
@focus="dayFocus"
|
|
29
|
-
class="input-class"
|
|
30
|
-
/>
|
|
31
|
-
<div style="width:18px;margin-left:2px">
|
|
32
|
-
<span>天</span>
|
|
33
|
-
</div>
|
|
34
|
-
<input
|
|
35
|
-
type="number"
|
|
36
|
-
v-model="hourValue"
|
|
37
|
-
@input="hourChange"
|
|
38
|
-
@focus="hourFocus"
|
|
39
|
-
class="input-class"
|
|
40
|
-
/>
|
|
41
|
-
<div style="width:30px">
|
|
42
|
-
<span>小时</span>
|
|
43
|
-
</div>
|
|
44
|
-
<input
|
|
45
|
-
@input="minuteChange"
|
|
46
|
-
v-if="displayType === 'minute' || displayType === 'second'"
|
|
47
|
-
type="number"
|
|
48
|
-
v-model="minuteValue"
|
|
49
|
-
@focus="minuteFocus"
|
|
50
|
-
class="input-class"
|
|
51
|
-
/>
|
|
52
|
-
<div
|
|
53
|
-
v-if="displayType === 'minute' || displayType === 'second'"
|
|
54
|
-
style="width:30px"
|
|
55
|
-
>
|
|
56
|
-
<span>分钟</span>
|
|
57
|
-
</div>
|
|
58
|
-
<input
|
|
59
|
-
@input="secondChange"
|
|
60
|
-
v-if="displayType === 'second'"
|
|
61
|
-
type="number"
|
|
62
|
-
@focus="secondFocus"
|
|
63
|
-
v-model="secondValue"
|
|
64
|
-
class="input-class"
|
|
65
|
-
/>
|
|
66
|
-
<div v-if="displayType === 'second'" style="width:20px">
|
|
67
|
-
<span>秒</span>
|
|
68
|
-
</div>
|
|
69
|
-
<input
|
|
70
|
-
@input="secondTotalChange"
|
|
71
|
-
v-if="displayType === 'second'"
|
|
72
|
-
type="number"
|
|
73
|
-
class="input-second-class"
|
|
74
|
-
v-model="secondTotalValue"
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="d-error-msg">
|
|
78
|
-
{{ v.errors[0] }}
|
|
79
|
-
</div>
|
|
80
|
-
</ValidationProvider>
|
|
81
|
-
<span v-else>{{ dayValue }}天{{ hourValue }}小时</span>
|
|
82
|
-
</div>
|
|
83
|
-
<div style="display:none">
|
|
84
|
-
{{ currentValue }}
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</template>
|
|
88
|
-
|
|
89
|
-
<script>
|
|
90
|
-
import XEUtils from 'xe-utils'
|
|
91
|
-
import moment from 'moment'
|
|
92
|
-
import { ValidationProvider } from 'vee-validate'
|
|
93
|
-
import { Tooltip } from 'ant-design-vue'
|
|
94
|
-
|
|
95
|
-
export default {
|
|
96
|
-
name: 'BaseIntervalInput',
|
|
97
|
-
components:{
|
|
98
|
-
ValidationProvider,
|
|
99
|
-
Tooltip,
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
data() {
|
|
103
|
-
return {
|
|
104
|
-
dayValue: 0,
|
|
105
|
-
hourValue: 0,
|
|
106
|
-
minuteValue: 0,
|
|
107
|
-
secondValue: 0,
|
|
108
|
-
secondTotalValue: 0,
|
|
109
|
-
testValue: 0,
|
|
110
|
-
filterValue: '',
|
|
111
|
-
isInputChanged: false,
|
|
112
|
-
inputTimeout: null,
|
|
113
|
-
searchRows: [],
|
|
114
|
-
filterCols: [],
|
|
115
|
-
gridLoading: false,
|
|
116
|
-
gridPagerConfig: {
|
|
117
|
-
total: 0,
|
|
118
|
-
currentPage: 1,
|
|
119
|
-
pageSize: 10
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
computed: {
|
|
124
|
-
currentValue: {
|
|
125
|
-
// 动态计算currentValue的值
|
|
126
|
-
get: function() {
|
|
127
|
-
console.debug('get value')
|
|
128
|
-
//分钟计算成小时
|
|
129
|
-
let tempValue = this.value
|
|
130
|
-
if (this.valueType === 'hour') {
|
|
131
|
-
tempValue = XEUtils.multiply(tempValue, 3600)
|
|
132
|
-
} else if (this.valueType === 'minute') {
|
|
133
|
-
tempValue = XEUtils.multiply(tempValue, 60)
|
|
134
|
-
}
|
|
135
|
-
//设置天数
|
|
136
|
-
this.dayValue = XEUtils.floor(XEUtils.divide(tempValue, 24 * 3600))
|
|
137
|
-
//天之后的剩余秒数
|
|
138
|
-
tempValue = XEUtils.subtract(tempValue, this.dayValue * 3600 * 24)
|
|
139
|
-
if (tempValue >= 0) {
|
|
140
|
-
//设置小时数
|
|
141
|
-
this.hourValue = XEUtils.floor(XEUtils.divide(tempValue, 3600))
|
|
142
|
-
//小时之后的剩余秒数
|
|
143
|
-
tempValue = XEUtils.subtract(tempValue, this.hourValue * 3600)
|
|
144
|
-
}
|
|
145
|
-
if (tempValue >= 0) {
|
|
146
|
-
//设置分钟
|
|
147
|
-
this.minuteValue = XEUtils.floor(XEUtils.divide(tempValue, 60))
|
|
148
|
-
//小时之后的剩余秒数
|
|
149
|
-
tempValue = XEUtils.subtract(tempValue, this.minuteValue * 60)
|
|
150
|
-
}
|
|
151
|
-
if (tempValue >= 0) {
|
|
152
|
-
//设置秒数
|
|
153
|
-
this.secondValue = tempValue
|
|
154
|
-
}
|
|
155
|
-
this.secondTotalValue = this.value
|
|
156
|
-
|
|
157
|
-
return this.value // 将props中的value赋值给currentValue
|
|
158
|
-
},
|
|
159
|
-
set: function(val) {
|
|
160
|
-
if (val === '') {
|
|
161
|
-
val = 0
|
|
162
|
-
}
|
|
163
|
-
if (XEUtils.isNumber(val)) {
|
|
164
|
-
this.$emit('input', XEUtils.toInteger(val))
|
|
165
|
-
}
|
|
166
|
-
// 通过$emit触发父组件
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
props: {
|
|
171
|
-
value: {
|
|
172
|
-
type: Number,
|
|
173
|
-
default: function() {
|
|
174
|
-
return 0
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
rules: {
|
|
178
|
-
type: Object,
|
|
179
|
-
default: function() {
|
|
180
|
-
return null
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
displayType: {
|
|
184
|
-
type: String,
|
|
185
|
-
default: function() {
|
|
186
|
-
return ''
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
valueType: {
|
|
190
|
-
type: String,
|
|
191
|
-
default: function() {
|
|
192
|
-
return ''
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
edit: {
|
|
196
|
-
type: Boolean,
|
|
197
|
-
default: function() {
|
|
198
|
-
return false
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
name: {
|
|
202
|
-
type: String,
|
|
203
|
-
default: function() {
|
|
204
|
-
return ''
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
label: {
|
|
208
|
-
type: String,
|
|
209
|
-
default: function() {
|
|
210
|
-
return ''
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
placeholder: {
|
|
214
|
-
type: String,
|
|
215
|
-
default: function() {
|
|
216
|
-
return ''
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
tooltip: {
|
|
220
|
-
type: String,
|
|
221
|
-
default: function() {
|
|
222
|
-
return ''
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
created() {},
|
|
227
|
-
methods: {
|
|
228
|
-
dayFocus($event) {
|
|
229
|
-
$event.target.select()
|
|
230
|
-
},
|
|
231
|
-
hourFocus($event) {
|
|
232
|
-
$event.target.select()
|
|
233
|
-
},
|
|
234
|
-
minuteFocus($event) {
|
|
235
|
-
$event.target.select()
|
|
236
|
-
},
|
|
237
|
-
secondFocus($event) {
|
|
238
|
-
$event.target.select()
|
|
239
|
-
},
|
|
240
|
-
dayChange() {
|
|
241
|
-
this.setCurrentValue()
|
|
242
|
-
this.$emit('change')
|
|
243
|
-
},
|
|
244
|
-
hourChange() {
|
|
245
|
-
this.setCurrentValue()
|
|
246
|
-
this.$emit('change')
|
|
247
|
-
},
|
|
248
|
-
minuteChange() {
|
|
249
|
-
this.setCurrentValue()
|
|
250
|
-
this.$emit('change')
|
|
251
|
-
},
|
|
252
|
-
secondChange() {
|
|
253
|
-
this.setCurrentValue()
|
|
254
|
-
this.$emit('change')
|
|
255
|
-
},
|
|
256
|
-
secondTotalChange() {
|
|
257
|
-
this.currentValue = XEUtils.toNumber(this.secondTotalValue)
|
|
258
|
-
this.$emit('change')
|
|
259
|
-
},
|
|
260
|
-
setCurrentValue() {
|
|
261
|
-
if (this.valueType === 'hour') {
|
|
262
|
-
this.currentValue =
|
|
263
|
-
XEUtils.multiply(this.dayValue, 24) +
|
|
264
|
-
XEUtils.toInteger(this.hourValue)
|
|
265
|
-
}
|
|
266
|
-
if (this.valueType === 'minute') {
|
|
267
|
-
this.currentValue =
|
|
268
|
-
XEUtils.multiply(this.dayValue, 24 * 60) +
|
|
269
|
-
XEUtils.multiply(this.hourValue, 60) +
|
|
270
|
-
XEUtils.toInteger(this.minuteValue)
|
|
271
|
-
}
|
|
272
|
-
if (this.valueType === 'second') {
|
|
273
|
-
this.currentValue =
|
|
274
|
-
XEUtils.multiply(this.dayValue, 24 * 3600) +
|
|
275
|
-
XEUtils.multiply(this.hourValue, 3600) +
|
|
276
|
-
XEUtils.multiply(this.minuteValue, 60) +
|
|
277
|
-
XEUtils.toInteger(this.secondValue)
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
</script>
|
|
283
|
-
|
|
284
|
-
<style lang="scss" scoped>
|
|
285
|
-
.input-class {
|
|
286
|
-
border-top: none;
|
|
287
|
-
border-right: none;
|
|
288
|
-
border-left: none;
|
|
289
|
-
outline: none;
|
|
290
|
-
width: 25px;
|
|
291
|
-
}
|
|
292
|
-
.input-second-class {
|
|
293
|
-
border-top: none;
|
|
294
|
-
border-right: none;
|
|
295
|
-
border-left: none;
|
|
296
|
-
outline: none;
|
|
297
|
-
width: 100px;
|
|
298
|
-
}
|
|
299
|
-
input[type="number"] {
|
|
300
|
-
&::-webkit-outer-spin-button,
|
|
301
|
-
&::-webkit-inner-spin-button {
|
|
302
|
-
-webkit-appearance: none;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
-moz-appearance: textfield;
|
|
306
|
-
}
|
|
307
|
-
</style>
|
|
308
|
-
<style lang="less">
|
|
309
|
-
@import '../../styles/default.less';
|
|
310
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-control-container">
|
|
3
|
+
<div class="d-control-label">
|
|
4
|
+
{{ label
|
|
5
|
+
}}
|
|
6
|
+
<span
|
|
7
|
+
v-if="rules && Object.getOwnPropertyNames(rules).length > 0"
|
|
8
|
+
class="d-control-label-required"
|
|
9
|
+
>*</span
|
|
10
|
+
>
|
|
11
|
+
<Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
|
|
12
|
+
<img src="../../styles/icon/help.png" alt="" style="width: 14px">
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="d-control" style="font-size:12px">
|
|
16
|
+
<ValidationProvider
|
|
17
|
+
:name="label"
|
|
18
|
+
v-slot="v"
|
|
19
|
+
:rules="rules"
|
|
20
|
+
v-if="edit === true"
|
|
21
|
+
>
|
|
22
|
+
<input v-model="currentValue" style="display:none" />
|
|
23
|
+
<div style="display:flex;flex-flow:row nowrap">
|
|
24
|
+
<input
|
|
25
|
+
type="number"
|
|
26
|
+
v-model="dayValue"
|
|
27
|
+
@input="dayChange"
|
|
28
|
+
@focus="dayFocus"
|
|
29
|
+
class="input-class"
|
|
30
|
+
/>
|
|
31
|
+
<div style="width:18px;margin-left:2px">
|
|
32
|
+
<span>天</span>
|
|
33
|
+
</div>
|
|
34
|
+
<input
|
|
35
|
+
type="number"
|
|
36
|
+
v-model="hourValue"
|
|
37
|
+
@input="hourChange"
|
|
38
|
+
@focus="hourFocus"
|
|
39
|
+
class="input-class"
|
|
40
|
+
/>
|
|
41
|
+
<div style="width:30px">
|
|
42
|
+
<span>小时</span>
|
|
43
|
+
</div>
|
|
44
|
+
<input
|
|
45
|
+
@input="minuteChange"
|
|
46
|
+
v-if="displayType === 'minute' || displayType === 'second'"
|
|
47
|
+
type="number"
|
|
48
|
+
v-model="minuteValue"
|
|
49
|
+
@focus="minuteFocus"
|
|
50
|
+
class="input-class"
|
|
51
|
+
/>
|
|
52
|
+
<div
|
|
53
|
+
v-if="displayType === 'minute' || displayType === 'second'"
|
|
54
|
+
style="width:30px"
|
|
55
|
+
>
|
|
56
|
+
<span>分钟</span>
|
|
57
|
+
</div>
|
|
58
|
+
<input
|
|
59
|
+
@input="secondChange"
|
|
60
|
+
v-if="displayType === 'second'"
|
|
61
|
+
type="number"
|
|
62
|
+
@focus="secondFocus"
|
|
63
|
+
v-model="secondValue"
|
|
64
|
+
class="input-class"
|
|
65
|
+
/>
|
|
66
|
+
<div v-if="displayType === 'second'" style="width:20px">
|
|
67
|
+
<span>秒</span>
|
|
68
|
+
</div>
|
|
69
|
+
<input
|
|
70
|
+
@input="secondTotalChange"
|
|
71
|
+
v-if="displayType === 'second'"
|
|
72
|
+
type="number"
|
|
73
|
+
class="input-second-class"
|
|
74
|
+
v-model="secondTotalValue"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="d-error-msg">
|
|
78
|
+
{{ v.errors[0] }}
|
|
79
|
+
</div>
|
|
80
|
+
</ValidationProvider>
|
|
81
|
+
<span v-else>{{ dayValue }}天{{ hourValue }}小时</span>
|
|
82
|
+
</div>
|
|
83
|
+
<div style="display:none">
|
|
84
|
+
{{ currentValue }}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<script>
|
|
90
|
+
import XEUtils from 'xe-utils'
|
|
91
|
+
import moment from 'moment'
|
|
92
|
+
import { ValidationProvider } from 'vee-validate'
|
|
93
|
+
import { Tooltip } from 'ant-design-vue'
|
|
94
|
+
|
|
95
|
+
export default {
|
|
96
|
+
name: 'BaseIntervalInput',
|
|
97
|
+
components:{
|
|
98
|
+
ValidationProvider,
|
|
99
|
+
Tooltip,
|
|
100
|
+
|
|
101
|
+
},
|
|
102
|
+
data() {
|
|
103
|
+
return {
|
|
104
|
+
dayValue: 0,
|
|
105
|
+
hourValue: 0,
|
|
106
|
+
minuteValue: 0,
|
|
107
|
+
secondValue: 0,
|
|
108
|
+
secondTotalValue: 0,
|
|
109
|
+
testValue: 0,
|
|
110
|
+
filterValue: '',
|
|
111
|
+
isInputChanged: false,
|
|
112
|
+
inputTimeout: null,
|
|
113
|
+
searchRows: [],
|
|
114
|
+
filterCols: [],
|
|
115
|
+
gridLoading: false,
|
|
116
|
+
gridPagerConfig: {
|
|
117
|
+
total: 0,
|
|
118
|
+
currentPage: 1,
|
|
119
|
+
pageSize: 10
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
computed: {
|
|
124
|
+
currentValue: {
|
|
125
|
+
// 动态计算currentValue的值
|
|
126
|
+
get: function() {
|
|
127
|
+
console.debug('get value')
|
|
128
|
+
//分钟计算成小时
|
|
129
|
+
let tempValue = this.value
|
|
130
|
+
if (this.valueType === 'hour') {
|
|
131
|
+
tempValue = XEUtils.multiply(tempValue, 3600)
|
|
132
|
+
} else if (this.valueType === 'minute') {
|
|
133
|
+
tempValue = XEUtils.multiply(tempValue, 60)
|
|
134
|
+
}
|
|
135
|
+
//设置天数
|
|
136
|
+
this.dayValue = XEUtils.floor(XEUtils.divide(tempValue, 24 * 3600))
|
|
137
|
+
//天之后的剩余秒数
|
|
138
|
+
tempValue = XEUtils.subtract(tempValue, this.dayValue * 3600 * 24)
|
|
139
|
+
if (tempValue >= 0) {
|
|
140
|
+
//设置小时数
|
|
141
|
+
this.hourValue = XEUtils.floor(XEUtils.divide(tempValue, 3600))
|
|
142
|
+
//小时之后的剩余秒数
|
|
143
|
+
tempValue = XEUtils.subtract(tempValue, this.hourValue * 3600)
|
|
144
|
+
}
|
|
145
|
+
if (tempValue >= 0) {
|
|
146
|
+
//设置分钟
|
|
147
|
+
this.minuteValue = XEUtils.floor(XEUtils.divide(tempValue, 60))
|
|
148
|
+
//小时之后的剩余秒数
|
|
149
|
+
tempValue = XEUtils.subtract(tempValue, this.minuteValue * 60)
|
|
150
|
+
}
|
|
151
|
+
if (tempValue >= 0) {
|
|
152
|
+
//设置秒数
|
|
153
|
+
this.secondValue = tempValue
|
|
154
|
+
}
|
|
155
|
+
this.secondTotalValue = this.value
|
|
156
|
+
|
|
157
|
+
return this.value // 将props中的value赋值给currentValue
|
|
158
|
+
},
|
|
159
|
+
set: function(val) {
|
|
160
|
+
if (val === '') {
|
|
161
|
+
val = 0
|
|
162
|
+
}
|
|
163
|
+
if (XEUtils.isNumber(val)) {
|
|
164
|
+
this.$emit('input', XEUtils.toInteger(val))
|
|
165
|
+
}
|
|
166
|
+
// 通过$emit触发父组件
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
props: {
|
|
171
|
+
value: {
|
|
172
|
+
type: Number,
|
|
173
|
+
default: function() {
|
|
174
|
+
return 0
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
rules: {
|
|
178
|
+
type: Object,
|
|
179
|
+
default: function() {
|
|
180
|
+
return null
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
displayType: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: function() {
|
|
186
|
+
return ''
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
valueType: {
|
|
190
|
+
type: String,
|
|
191
|
+
default: function() {
|
|
192
|
+
return ''
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
edit: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: function() {
|
|
198
|
+
return false
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
name: {
|
|
202
|
+
type: String,
|
|
203
|
+
default: function() {
|
|
204
|
+
return ''
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
label: {
|
|
208
|
+
type: String,
|
|
209
|
+
default: function() {
|
|
210
|
+
return ''
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
placeholder: {
|
|
214
|
+
type: String,
|
|
215
|
+
default: function() {
|
|
216
|
+
return ''
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
tooltip: {
|
|
220
|
+
type: String,
|
|
221
|
+
default: function() {
|
|
222
|
+
return ''
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
created() {},
|
|
227
|
+
methods: {
|
|
228
|
+
dayFocus($event) {
|
|
229
|
+
$event.target.select()
|
|
230
|
+
},
|
|
231
|
+
hourFocus($event) {
|
|
232
|
+
$event.target.select()
|
|
233
|
+
},
|
|
234
|
+
minuteFocus($event) {
|
|
235
|
+
$event.target.select()
|
|
236
|
+
},
|
|
237
|
+
secondFocus($event) {
|
|
238
|
+
$event.target.select()
|
|
239
|
+
},
|
|
240
|
+
dayChange() {
|
|
241
|
+
this.setCurrentValue()
|
|
242
|
+
this.$emit('change')
|
|
243
|
+
},
|
|
244
|
+
hourChange() {
|
|
245
|
+
this.setCurrentValue()
|
|
246
|
+
this.$emit('change')
|
|
247
|
+
},
|
|
248
|
+
minuteChange() {
|
|
249
|
+
this.setCurrentValue()
|
|
250
|
+
this.$emit('change')
|
|
251
|
+
},
|
|
252
|
+
secondChange() {
|
|
253
|
+
this.setCurrentValue()
|
|
254
|
+
this.$emit('change')
|
|
255
|
+
},
|
|
256
|
+
secondTotalChange() {
|
|
257
|
+
this.currentValue = XEUtils.toNumber(this.secondTotalValue)
|
|
258
|
+
this.$emit('change')
|
|
259
|
+
},
|
|
260
|
+
setCurrentValue() {
|
|
261
|
+
if (this.valueType === 'hour') {
|
|
262
|
+
this.currentValue =
|
|
263
|
+
XEUtils.multiply(this.dayValue, 24) +
|
|
264
|
+
XEUtils.toInteger(this.hourValue)
|
|
265
|
+
}
|
|
266
|
+
if (this.valueType === 'minute') {
|
|
267
|
+
this.currentValue =
|
|
268
|
+
XEUtils.multiply(this.dayValue, 24 * 60) +
|
|
269
|
+
XEUtils.multiply(this.hourValue, 60) +
|
|
270
|
+
XEUtils.toInteger(this.minuteValue)
|
|
271
|
+
}
|
|
272
|
+
if (this.valueType === 'second') {
|
|
273
|
+
this.currentValue =
|
|
274
|
+
XEUtils.multiply(this.dayValue, 24 * 3600) +
|
|
275
|
+
XEUtils.multiply(this.hourValue, 3600) +
|
|
276
|
+
XEUtils.multiply(this.minuteValue, 60) +
|
|
277
|
+
XEUtils.toInteger(this.secondValue)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
</script>
|
|
283
|
+
|
|
284
|
+
<style lang="scss" scoped>
|
|
285
|
+
.input-class {
|
|
286
|
+
border-top: none;
|
|
287
|
+
border-right: none;
|
|
288
|
+
border-left: none;
|
|
289
|
+
outline: none;
|
|
290
|
+
width: 25px;
|
|
291
|
+
}
|
|
292
|
+
.input-second-class {
|
|
293
|
+
border-top: none;
|
|
294
|
+
border-right: none;
|
|
295
|
+
border-left: none;
|
|
296
|
+
outline: none;
|
|
297
|
+
width: 100px;
|
|
298
|
+
}
|
|
299
|
+
input[type="number"] {
|
|
300
|
+
&::-webkit-outer-spin-button,
|
|
301
|
+
&::-webkit-inner-spin-button {
|
|
302
|
+
-webkit-appearance: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
-moz-appearance: textfield;
|
|
306
|
+
}
|
|
307
|
+
</style>
|
|
308
|
+
<style lang="less">
|
|
309
|
+
@import '../../styles/default.less';
|
|
310
|
+
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// 导入组件,组件必须声明 name
|
|
2
|
-
import BaseKanbanEmpty from './src/index.vue';
|
|
3
|
-
// 为组件提供 install 安装方法,供按需引入
|
|
4
|
-
BaseKanbanEmpty.install = function(Vue) {
|
|
5
|
-
Vue.component(BaseKanbanEmpty.name, BaseKanbanEmpty);
|
|
6
|
-
};
|
|
7
|
-
// 默认导出组件
|
|
1
|
+
// 导入组件,组件必须声明 name
|
|
2
|
+
import BaseKanbanEmpty from './src/index.vue';
|
|
3
|
+
// 为组件提供 install 安装方法,供按需引入
|
|
4
|
+
BaseKanbanEmpty.install = function(Vue) {
|
|
5
|
+
Vue.component(BaseKanbanEmpty.name, BaseKanbanEmpty);
|
|
6
|
+
};
|
|
7
|
+
// 默认导出组件
|
|
8
8
|
export default BaseKanbanEmpty;
|