ai.touchui-vue 1.36.0 → 1.38.0

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.
Files changed (46) hide show
  1. package/lib/ai.touchui-vue.common.js +99 -81
  2. package/lib/calendar.js +11 -5
  3. package/lib/date-picker.js +13 -33
  4. package/lib/form.js +8 -8
  5. package/lib/index.js +1 -1
  6. package/lib/select.js +9 -5
  7. package/lib/slide.js +42 -14
  8. package/lib/theme/css/theme/B-Design.css +1 -1
  9. package/lib/theme/css/theme/aiplan.css +1 -1
  10. package/lib/theme/css/theme/aiplangd.css +1 -1
  11. package/lib/theme/css/theme/chbn.css +1 -1
  12. package/lib/theme/css/theme/default.css +1 -1
  13. package/lib/theme/css/theme/dt.css +1 -1
  14. package/lib/theme/css/theme/ecloud.css +1 -1
  15. package/lib/theme/css/theme/hongkong.css +1 -1
  16. package/lib/theme/css/theme/logistics.css +1 -1
  17. package/lib/theme/css/theme/narrow.css +1 -1
  18. package/lib/theme/css/theme/sdpf.css +1 -1
  19. package/lib/theme/css/theme/upc.css +1 -1
  20. package/lib/theme/css/theme/website.css +1 -1
  21. package/lib/theme/css/theme/workbench-gz.css +1 -1
  22. package/lib/theme/css/theme/zj.css +1 -1
  23. package/package.json +1 -1
  24. package/packages/calendar/src/calendar.vue +10 -4
  25. package/packages/date-picker/src/date-picker.vue +14 -34
  26. package/packages/form/src/form-item.vue +1 -1
  27. package/packages/select/src/select.vue +7 -5
  28. package/packages/slide/src/slide.vue +27 -2
  29. package/packages/theme/lib/css/theme/B-Design.css +1 -1
  30. package/packages/theme/lib/css/theme/aiplan.css +1 -1
  31. package/packages/theme/lib/css/theme/aiplangd.css +1 -1
  32. package/packages/theme/lib/css/theme/chbn.css +1 -1
  33. package/packages/theme/lib/css/theme/default.css +1 -1
  34. package/packages/theme/lib/css/theme/dt.css +1 -1
  35. package/packages/theme/lib/css/theme/ecloud.css +1 -1
  36. package/packages/theme/lib/css/theme/hongkong.css +1 -1
  37. package/packages/theme/lib/css/theme/logistics.css +1 -1
  38. package/packages/theme/lib/css/theme/narrow.css +1 -1
  39. package/packages/theme/lib/css/theme/sdpf.css +1 -1
  40. package/packages/theme/lib/css/theme/upc.css +1 -1
  41. package/packages/theme/lib/css/theme/website.css +1 -1
  42. package/packages/theme/lib/css/theme/workbench-gz.css +1 -1
  43. package/packages/theme/lib/css/theme/zj.css +1 -1
  44. package/packages/theme/src/img/.DS_Store +0 -0
  45. package/packages/theme/src/less/component/msg.less +1 -1
  46. package/src/index.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai.touchui-vue",
3
- "version": "1.36.0",
3
+ "version": "1.38.0",
4
4
  "description": "TouchUI Component Library for Vue.js.",
5
5
  "main": "lib/ai.touchui-vue.common.js",
6
6
  "files": [
@@ -57,7 +57,14 @@
57
57
  <!-- 日期 开始 -->
58
58
  <div v-if="type!=='month'" class="day">
59
59
  <ul>
60
- <li v-for="(item, index) in days" :key="index" v-tip="item.point && item.point.tooltip ? item.point.tooltip : ''" v-dis="isDisableDay(item)" :class="setDayClass(item)" @click="selectDay(item)">
60
+ <li
61
+ v-for="(item, index) in days"
62
+ :key="index"
63
+ v-tip="item.point && item.point.tooltip ? item.point.tooltip : ''"
64
+ v-dis="isDisableDay(item)"
65
+ :class="setDayClass(item)"
66
+ @click="selectDay(item)"
67
+ >
61
68
  <slot :item="item" :index="index">
62
69
  <span v-if="item.value" class="solar">{{ dayText(item.value) }}</span>
63
70
  <span v-if="item.point && item.point.length > 0" class="to-calendar-points">
@@ -334,7 +341,7 @@ export default {
334
341
  isDisableDay() {
335
342
  return (item) => {
336
343
  if (this.year && this.month) {
337
- let dateString = `${this.year}/${this.month}/${Number(item.value) + 1}`
344
+ let dateString = `${this.year}/${this.month}/${Number(item.value)}`
338
345
  let min = ''
339
346
  // 默认使用 2023-03-01 格式时,其 hour = 8 而不是 0,所以要转为 2023/03/01 格式
340
347
  if (typeof this.min === 'string') {
@@ -349,8 +356,7 @@ export default {
349
356
  } else {
350
357
  max = this.max
351
358
  }
352
-
353
- return new Date(dateString) <= new Date(min) || new Date(dateString) > new Date(max)
359
+ return new Date(dateString) < new Date(min) || new Date(dateString) > new Date(max)
354
360
  } else {
355
361
  return false
356
362
  }
@@ -1,37 +1,11 @@
1
1
  <template>
2
- <to-input
3
- :id="id"
4
- ref="inputBox"
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()"></to-calendar>
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: {
@@ -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
- } else if (this.type === 'time') {
400
+ } else if (this.type === 'time') {
421
401
  fmt = 'HH:mm:ss'
422
402
  } else {
423
403
  fmt = 'yyyy-MM-dd'
@@ -2,7 +2,7 @@
2
2
  <li :class="setClass" :style="setStyle" @click="$emit('click')">
3
3
  <div class="content">
4
4
  <div v-if="label || $slots.label" ref="label" class="label" :class="setLabelClass">
5
- <div ref="labelText" class="text">{{ label }}<slot name="label"></slot></div>
5
+ <div ref="labelText" class="text"><slot name="label">{{ label }}</slot></div>
6
6
  <div v-if="$slots.tip && ToForm.type === 'list'" class="tip"><slot name="tip"></slot></div>
7
7
  </div>
8
8
  <div class="value">
@@ -121,11 +121,11 @@
121
121
  </span>
122
122
  </span>
123
123
  </template>
124
- <to-input v-else ref="popupFilter" v-model="multipleFilterValue" :sp-chars="false" width="full" prevent-focus :placeholder="selected.filter(item => !item.hide).length > 0 ? '' : placeholder "></to-input>
124
+ <to-input v-else ref="popupFilter" v-model="multipleFilterValue" tabindex="-1" :sp-chars="false" width="full" prevent-focus :placeholder="selected.filter(item => !item.hide).length > 0 ? '' : placeholder "></to-input>
125
125
  </template>
126
126
  <template v-else>
127
- <to-input v-if="inputable" ref="popupInput" v-model="inputValue" :sp-chars="spChars" prevent-focus width="full" :placeholder="placeholder" @focus="inputFocus" @keyup="inputInput" @blur="inputBlur"></to-input>
128
- <to-input v-else ref="popupFilter" v-model="filterValue" :sp-chars="false" prevent-focus width="full" placeholder="筛选" @clear="filterClear" @focus="filterFocus" @keyup="filterInput" @blur="filterBlur"></to-input>
127
+ <to-input v-if="inputable" ref="popupInput" v-model="inputValue" tabindex="-1" :sp-chars="spChars" prevent-focus width="full" :placeholder="placeholder" @focus="inputFocus" @keyup="inputInput" @blur="inputBlur"></to-input>
128
+ <to-input v-else ref="popupFilter" v-model="filterValue" tabindex="-1" :sp-chars="false" prevent-focus width="full" placeholder="筛选" @clear="filterClear" @focus="filterFocus" @keyup="filterInput"></to-input>
129
129
  </template>
130
130
  </to-padding>
131
131
  </to-grid-item>
@@ -972,14 +972,16 @@ export default {
972
972
  return true
973
973
  }
974
974
  if (this.filterable) {
975
- return item[this.iLabelText].includes(this.filterValue)
975
+ // return item[this.iLabelText].includes(this.filterValue)
976
+ return item[this.iLabelText].toLowerCase().includes(this.filterValue.toLowerCase())
976
977
  } else {
977
978
  return true
978
979
  }
979
980
  },
980
981
  multipleFilter(item) {
981
982
  if (this.filterable) {
982
- return item[this.iLabelText].includes(this.multipleFilterValue)
983
+ // return item[this.iLabelText].includes(this.multipleFilterValue)
984
+ return item[this.iLabelText].toLowerCase().includes(this.multipleFilterValue.toLowerCase())
983
985
  } else {
984
986
  return true
985
987
  }
@@ -35,7 +35,8 @@ export default {
35
35
  animate: true,
36
36
  playTimer: null,
37
37
  startPosition: false,
38
- width: 0
38
+ width: 0,
39
+ observer: null
39
40
  }
40
41
  },
41
42
  computed: {
@@ -62,8 +63,28 @@ export default {
62
63
  window.addEventListener('resize', () => {
63
64
  this.width = this.$el.offsetWidth
64
65
  })
66
+
67
+ // 初始化 MutationObserver
68
+ const observer = new MutationObserver((mutations) => {
69
+ this.setLength(); // 每次子节点变化时更新长度
70
+ });
71
+ observer.observe(this.$refs.ul, {
72
+ childList: true, // 监听子节点变化
73
+ subtree: true // 监听所有后代节点
74
+ });
75
+ this.observer = observer;
76
+
65
77
  }, 100)
66
78
  },
79
+ beforeDestroy() {
80
+ if (this.observer) {
81
+ this.observer.disconnect(); // 断开监听
82
+ }
83
+ clearInterval(this.playTimer); // 清理定时器
84
+ window.removeEventListener('resize', () => {
85
+ this.width = this.$el.offsetWidth;
86
+ });
87
+ },
67
88
  methods: {
68
89
  play() {
69
90
  if (!this.autoplay || this.length < 2) {
@@ -77,7 +98,11 @@ export default {
77
98
  clearInterval(this.playTimer)
78
99
  },
79
100
  setLength() {
80
- this.length = this.$refs.ul.children.length - 2
101
+ this.$nextTick(() => {
102
+ if (this.$refs.ul) {
103
+ this.length = this.$refs.ul.children.length - 2;
104
+ }
105
+ });
81
106
  },
82
107
  next() {
83
108
  if (this.animate) {