ai.touchui-vue 1.35.2 → 1.35.3
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/lib/ai.touchui-vue.common.js +22 -39
- package/lib/date-picker.js +16 -33
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/packages/date-picker/src/date-picker.vue +29 -46
- package/packages/theme/gulpfile.js +34 -0
- package/packages/theme/package-lock.json +5292 -0
- package/src/index.js +1 -1
- package/packages/.DS_Store +0 -0
- package/packages/article/.DS_Store +0 -0
- package/packages/chat/.DS_Store +0 -0
- package/packages/chat/src/.DS_Store +0 -0
- package/packages/date-picker/.DS_Store +0 -0
- package/packages/dis/.DS_Store +0 -0
- package/packages/emote/.DS_Store +0 -0
- package/packages/filter/.DS_Store +0 -0
- package/packages/filter/src/.DS_Store +0 -0
- package/packages/float/.DS_Store +0 -0
- package/packages/flow/.DS_Store +0 -0
- package/packages/guider/.DS_Store +0 -0
- package/packages/ip/.DS_Store +0 -0
- package/packages/org/.DS_Store +0 -0
- package/packages/page/.DS_Store +0 -0
- package/packages/page/src/.DS_Store +0 -0
- package/packages/pic/.DS_Store +0 -0
- package/packages/rate/.DS_Store +0 -0
- package/packages/reverser/.DS_Store +0 -0
- package/packages/reverser/src/.DS_Store +0 -0
- package/packages/segment/.DS_Store +0 -0
- package/packages/slide/.DS_Store +0 -0
- package/packages/tab/.DS_Store +0 -0
- package/packages/table/.DS_Store +0 -0
- package/packages/theme/lib/css/theme/B-Design.css +0 -1
- package/packages/theme/lib/css/theme/aiplan.css +0 -1
- package/packages/theme/lib/css/theme/aiplangd.css +0 -1
- package/packages/theme/lib/css/theme/chbn.css +0 -1
- package/packages/theme/lib/css/theme/default.css +0 -1
- package/packages/theme/lib/css/theme/dt.css +0 -1
- package/packages/theme/lib/css/theme/ecloud.css +0 -1
- package/packages/theme/lib/css/theme/hongkong.css +0 -1
- package/packages/theme/lib/css/theme/logistics.css +0 -1
- package/packages/theme/lib/css/theme/narrow.css +0 -1
- package/packages/theme/lib/css/theme/sdpf.css +0 -1
- package/packages/theme/lib/css/theme/upc.css +0 -1
- package/packages/theme/lib/css/theme/website.css +0 -1
- package/packages/theme/lib/css/theme/workbench-gz.css +0 -1
- package/packages/theme/lib/css/theme/zj.css +0 -1
- package/packages/theme/lib/img/curve/curve-left-bottom.png +0 -0
- package/packages/theme/lib/img/curve/curve-left-top.png +0 -0
- package/packages/theme/lib/img/curve/curve-left.png +0 -0
- package/packages/theme/lib/img/curve/curve-top.png +0 -0
- package/packages/theme/lib/img/emote/default.png +0 -0
- package/packages/theme/lib/img/emote/empty.png +0 -0
- package/packages/theme/lib/img/emote/error.png +0 -0
- package/packages/theme/lib/img/emote/help.png +0 -0
- package/packages/theme/lib/img/emote/loading.gif +0 -0
- package/packages/theme/lib/img/emote/success.png +0 -0
- package/packages/theme/lib/img/icon/OpenType-TT/icon-SVG.ttf +0 -0
- package/packages/theme/lib/img/icon/OpenType-TT/icon.ttf +0 -0
- package/packages/theme/lib/img/icon-type-fill.eot +0 -0
- package/packages/theme/lib/img/icon-type-fill.ttf +0 -0
- package/packages/theme/lib/img/icon.eot +0 -0
- package/packages/theme/lib/img/icon.ttf +0 -0
- package/packages/theme/lib/img/iconbank.ttf +0 -0
- package/packages/theme/lib/img/loading.png +0 -0
- package/packages/theme/src/.DS_Store +0 -0
- package/packages/theme/src/img/.DS_Store +0 -0
- package/packages/theme/src/img/emote/.DS_Store +0 -0
- package/packages/theme/src/less/.DS_Store +0 -0
- package/packages/theme/src/less/theme/.DS_Store +0 -0
- package/packages/tooltip/.DS_Store +0 -0
- package/packages/tree/.DS_Store +0 -0
- package/packages/upload/.DS_Store +0 -0
- package/src/.DS_Store +0 -0
- package/src/svg/.DS_Store +0 -0
- package/src/svg/menu/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<to-input
|
|
3
|
-
:
|
|
4
|
-
|
|
5
|
-
class="to-date-picker"
|
|
6
|
-
:required="required"
|
|
7
|
-
:desc="desc"
|
|
8
|
-
:color="color"
|
|
9
|
-
:prefix="prefix"
|
|
10
|
-
:suffix="suffix"
|
|
11
|
-
:mode="mode"
|
|
12
|
-
:prop-error-type="errorType"
|
|
13
|
-
:prop-error-tip="errorTip"
|
|
14
|
-
:fillet="fillet"
|
|
15
|
-
:fillet-position="filletPosition"
|
|
16
|
-
:value="datedisplay"
|
|
17
|
-
:placeholder="placeholder"
|
|
18
|
-
:readonly="disabled || !inputable"
|
|
19
|
-
:sp-chars="spChars"
|
|
20
|
-
:link="!inputable && !disabled"
|
|
21
|
-
:clearable="clearable && !disabled"
|
|
22
|
-
:width="width"
|
|
23
|
-
:comparable="comparable"
|
|
24
|
-
@focus="errorTip = '';$emit('focus',datedisplay)"
|
|
25
|
-
@click="handleClick"
|
|
26
|
-
@clear="clear()"
|
|
27
|
-
@input="handleDisplayChange"
|
|
28
|
-
@blur="handleDisplayBlur"
|
|
29
|
-
>
|
|
30
|
-
<to-icon v-if="type === 'time'" slot="suffix" :link="inputable" :class="disabled?'to-dis':''" mode="none" color="primary" value="time" @click="showLayer"></to-icon>
|
|
31
|
-
<to-icon v-else slot="suffix" :link="inputable" :class="disabled?'to-dis':''" mode="none" color="primary" value="date" @click="showLayer"></to-icon>
|
|
2
|
+
<to-input :id="id" ref="inputBox" class="to-date-picker" :required="required" :desc="desc" :color="color" :prefix="prefix" :suffix="suffix" :mode="mode" :prop-error-type="errorType" :prop-error-tip="errorTip" :fillet="fillet" :fillet-position="filletPosition" :value="datedisplay" :placeholder="placeholder" :readonly="disabled || !inputable" :sp-chars="spChars" :link="!inputable && !disabled" :clearable="clearable && !disabled" :width="width" :comparable="comparable" @focus="errorTip = ''; $emit('focus', datedisplay)" @click="handleClick" @clear="clear()" @input="handleDisplayChange" @blur="handleDisplayBlur">
|
|
3
|
+
<to-icon v-if="type === 'time'" slot="suffix" :link="inputable" :class="disabled ? 'to-dis' : ''" mode="none" color="primary" value="time" @click="showLayer"></to-icon>
|
|
4
|
+
<to-icon v-else slot="suffix" :link="inputable" :class="disabled ? 'to-dis' : ''" mode="none" color="primary" value="date" @click="showLayer"></to-icon>
|
|
32
5
|
<to-float ref="layer" :lazy="lazy" :slide="layerSlide" :position="layerPosition" :paddng="0.5" :width="$platform === 'pc' ? 23 : ''" :align="optionAlign ? optionAlign : $pc ? 'right' : 'auto'" @close="handleLayerClose">
|
|
33
6
|
<to-scroll v-if="$pc || showCalendar">
|
|
34
|
-
<to-calendar ref="calendar" v-model="date" :time="time" :type="type" :min="min" :max="max" :before-change="beforeChange" @change="select" @close="$refs.layer.close()"
|
|
7
|
+
<to-calendar ref="calendar" v-model="date" :time="time" :type="type" :min="min" :max="max" :before-change="beforeChange" @change="select" @close="$refs.layer.close()">
|
|
8
|
+
</to-calendar>
|
|
35
9
|
</to-scroll>
|
|
36
10
|
<picker v-else v-model="date" :time="time" :type="type" :min="min" :max="max" @cancel="$refs.layer.close()" @change="select" @clear="clear()"></picker>
|
|
37
11
|
</to-float>
|
|
@@ -45,7 +19,7 @@ import { matchFormat } from 'ai.touchui-vue/src/utils/date'
|
|
|
45
19
|
// import moment from 'moment';
|
|
46
20
|
export default {
|
|
47
21
|
name: 'ToDatePicker',
|
|
48
|
-
components: {picker},
|
|
22
|
+
components: { picker },
|
|
49
23
|
mixins: [Tip],
|
|
50
24
|
componentName: 'ToDatePicker',
|
|
51
25
|
model: {
|
|
@@ -221,7 +195,7 @@ export default {
|
|
|
221
195
|
} else {
|
|
222
196
|
newValue = this.getDateFromValue(newValue, this.valueFormat)
|
|
223
197
|
this.date = newValue
|
|
224
|
-
this.datedisplay = this.formatDate(newValue, this.displayFormat,val)
|
|
198
|
+
this.datedisplay = this.formatDate(newValue, this.displayFormat, val)
|
|
225
199
|
}
|
|
226
200
|
}
|
|
227
201
|
},
|
|
@@ -259,28 +233,28 @@ export default {
|
|
|
259
233
|
handleDisplayBlur() {
|
|
260
234
|
setTimeout(() => {
|
|
261
235
|
if (isNaN(new Date(this.datedisplay))) {
|
|
262
|
-
if(this.datedisplay) {
|
|
236
|
+
if (this.datedisplay) {
|
|
263
237
|
this.$emit('errTime')
|
|
264
238
|
}
|
|
265
239
|
this.datedisplay = ''
|
|
266
|
-
this.changeValue('','')
|
|
240
|
+
this.changeValue('', '')
|
|
267
241
|
} else {
|
|
268
242
|
this.$emit('beforeChange', this.datedisplay)
|
|
269
243
|
if (!this.displayFormatRegExp.test(this.datedisplay)) {
|
|
270
|
-
this.datedisplay = this.formatDate(new Date(this.datedisplay), this.displayFormat,this.datedisplay)
|
|
271
|
-
this.iValue = this.formatDate(new Date(this.datedisplay), this.displayFormat,this.datedisplay)
|
|
244
|
+
this.datedisplay = this.formatDate(new Date(this.datedisplay), this.displayFormat, this.datedisplay)
|
|
245
|
+
this.iValue = this.formatDate(new Date(this.datedisplay), this.displayFormat, this.datedisplay)
|
|
272
246
|
this.$emit('change', this.iValue)
|
|
273
247
|
} else {
|
|
274
|
-
this.changeValue(this.getDateFromValue(this.datedisplay, this.displayFormat),this.datedisplay)
|
|
248
|
+
this.changeValue(this.getDateFromValue(this.datedisplay, this.displayFormat), this.datedisplay)
|
|
275
249
|
}
|
|
276
250
|
}
|
|
277
251
|
}, 100);
|
|
278
252
|
},
|
|
279
253
|
select(value) {
|
|
280
|
-
this.changeValue(value,'')
|
|
254
|
+
this.changeValue(value, '')
|
|
281
255
|
this.$refs.layer.close()
|
|
282
256
|
},
|
|
283
|
-
changeValue(value,oldVal) {
|
|
257
|
+
changeValue(value, oldVal) {
|
|
284
258
|
this.$emit('beforeChange', value)
|
|
285
259
|
if (!value) {
|
|
286
260
|
this.clear()
|
|
@@ -289,7 +263,7 @@ export default {
|
|
|
289
263
|
this.datedisplay = value.split(' ').length > 1 ? value.split(' ')[1] : value
|
|
290
264
|
this.iValue = value.split(' ').length > 1 ? value.split(' ')[1] : value
|
|
291
265
|
} else {
|
|
292
|
-
value = this.formatDate(new Date(value), 'yyyy-MM-dd HH:mm:ss',value)
|
|
266
|
+
value = this.formatDate(new Date(value), 'yyyy-MM-dd HH:mm:ss', value)
|
|
293
267
|
const flag = isNaN(new Date(value).getTime()) // 判断是否可以使用 2022-05 如果不可用,则替换为 2022/05
|
|
294
268
|
if (flag) {
|
|
295
269
|
value = value.replace(/-/g, '/')
|
|
@@ -303,8 +277,8 @@ export default {
|
|
|
303
277
|
if (flag) {
|
|
304
278
|
value = value.replace(/-/g, '/')
|
|
305
279
|
}
|
|
306
|
-
this.datedisplay = this.formatDate(new Date(value), this.displayFormat,oldVal)
|
|
307
|
-
this.iValue = this.formatDate(new Date(value), this.valueFormat,oldVal)
|
|
280
|
+
this.datedisplay = this.formatDate(new Date(value), this.displayFormat, oldVal)
|
|
281
|
+
this.iValue = this.formatDate(new Date(value), this.valueFormat, oldVal)
|
|
308
282
|
this.$emit('change', this.iValue)
|
|
309
283
|
}
|
|
310
284
|
},
|
|
@@ -395,7 +369,7 @@ export default {
|
|
|
395
369
|
if (!yMatch) return
|
|
396
370
|
return value.substr(yMatch.index, yMatch[0].length)
|
|
397
371
|
},
|
|
398
|
-
formatDate(date, fmt,value) {
|
|
372
|
+
formatDate(date, fmt, value) {
|
|
399
373
|
if (date) {
|
|
400
374
|
// 如果 this.type 不是 'datetime' 或 'time',检查 date 是否为有效的日期格式
|
|
401
375
|
if (this.type !== 'datetime' && this.type !== 'time' && value) {
|
|
@@ -406,7 +380,13 @@ export default {
|
|
|
406
380
|
// 匹配 20250706
|
|
407
381
|
/^\d{8}$/.test(dateStr) ||
|
|
408
382
|
// 匹配 2025/07/06
|
|
409
|
-
/^\d{4}\/\d{2}\/\d{2}$/.test(dateStr)
|
|
383
|
+
/^\d{4}\/\d{2}\/\d{2}$/.test(dateStr) ||
|
|
384
|
+
// 匹配 2025-10(年-月)
|
|
385
|
+
/^\d{4}-\d{2}$/.test(dateStr) ||
|
|
386
|
+
// 匹配 2025/10(年/月)
|
|
387
|
+
/^\d{4}\/\d{2}$/.test(dateStr) ||
|
|
388
|
+
// 匹配 202510(年月连写)
|
|
389
|
+
/^\d{6}$/.test(dateStr)
|
|
410
390
|
);
|
|
411
391
|
if (!isValidDate) {
|
|
412
392
|
this.$emit('errTime')
|
|
@@ -417,7 +397,7 @@ export default {
|
|
|
417
397
|
if (!fmt) {
|
|
418
398
|
if (this.type === 'datetime') {
|
|
419
399
|
fmt = 'yyyy-MM-dd HH:mm:ss'
|
|
420
|
-
}
|
|
400
|
+
} else if (this.type === 'time') {
|
|
421
401
|
fmt = 'HH:mm:ss'
|
|
422
402
|
} else {
|
|
423
403
|
fmt = 'yyyy-MM-dd'
|
|
@@ -446,6 +426,9 @@ export default {
|
|
|
446
426
|
},
|
|
447
427
|
setDisabled(f) {
|
|
448
428
|
this.disabled = f
|
|
429
|
+
},
|
|
430
|
+
focus() {
|
|
431
|
+
this.$refs.inputBox.focus()
|
|
449
432
|
}
|
|
450
433
|
}
|
|
451
434
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { series, src, dest } = require('gulp');
|
|
4
|
+
const less = require('gulp-less');
|
|
5
|
+
const plumber = require('gulp-plumber');
|
|
6
|
+
const autoprefixer = require('gulp-autoprefixer');
|
|
7
|
+
const cssmin = require('gulp-cssmin');
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
var skin = (function(str) {
|
|
11
|
+
if (str.substr(0, 3) == 'css') {
|
|
12
|
+
return str.substr(4);
|
|
13
|
+
} else {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
})(process.env.npm_lifecycle_event);
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function compile() {
|
|
20
|
+
return src('src/less/theme/*.less', { allowEmpty: true })
|
|
21
|
+
.pipe(plumber())
|
|
22
|
+
.pipe(less())
|
|
23
|
+
.pipe(autoprefixer('last 2 version', 'firefox', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 3'))
|
|
24
|
+
.pipe(cssmin())
|
|
25
|
+
.pipe(dest('./lib/css/theme'));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function copyImg() {
|
|
29
|
+
return src('./src/img/**')
|
|
30
|
+
.pipe(cssmin())
|
|
31
|
+
.pipe(dest('./lib/img'));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.build = series(compile, copyImg);
|