@aochuang/common 1.0.0 → 1.0.1

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 (194) hide show
  1. package/common/loading/index.js +7 -0
  2. package/common/loading/loading.vue +71 -0
  3. package/common/tips/index.js +7 -0
  4. package/common/tips/tips.vue +82 -0
  5. package/common/tooltip/index.js +7 -0
  6. package/common/tooltip/popper.js +18 -0
  7. package/common/tooltip/tooltip.vue +55 -0
  8. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-boolean.vue +33 -0
  9. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date-range.vue +30 -0
  10. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date.vue +41 -0
  11. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime-range.vue +34 -0
  12. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime.vue +41 -0
  13. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number-range.vue +67 -0
  14. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number.vue +35 -0
  15. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-string.vue +41 -0
  16. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-value.vue +73 -0
  17. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item.vue +226 -0
  18. package/components/advanced-filter/advanced-filter-condition-toggle.vue +112 -0
  19. package/components/advanced-filter/advanced-filter-condition.vue +352 -0
  20. package/components/advanced-filter/advanced-filter-permanent-item.vue +10 -0
  21. package/components/advanced-filter/advanced-filter-permanent.vue +10 -0
  22. package/components/advanced-filter/advanced-filter-scene-form.vue +95 -0
  23. package/components/advanced-filter/advanced-filter-scene-item.vue +64 -0
  24. package/components/advanced-filter/advanced-filter-scene-manage.vue +264 -0
  25. package/components/advanced-filter/advanced-filter-scene-transfer.vue +283 -0
  26. package/components/advanced-filter/advanced-filter-scene.vue +199 -0
  27. package/components/advanced-filter/advanced-filter.vue +114 -0
  28. package/components/advanced-filter/index.js +36 -0
  29. package/components/advanced-filter/utils.js +132 -0
  30. package/components/autocomplete/autocomplete.vue +121 -0
  31. package/components/autocomplete/index.js +7 -0
  32. package/components/avatar/avatar.png +0 -0
  33. package/components/avatar/avatar.vue +212 -0
  34. package/components/avatar/index.js +7 -0
  35. package/components/brick-wall/brick-wall-skeleton.vue +125 -0
  36. package/components/brick-wall/brick-wall.vue +293 -0
  37. package/components/brick-wall/index.js +7 -0
  38. package/components/button/button.vue +537 -0
  39. package/components/button/index.js +7 -0
  40. package/components/button/utils.js +20 -0
  41. package/components/cascader/cascader.vue +184 -0
  42. package/components/cascader/index.js +7 -0
  43. package/components/cascader/util.js +50 -0
  44. package/components/checkbox/checkbox.vue +114 -0
  45. package/components/checkbox/index.js +7 -0
  46. package/components/checkbox-button/index.js +8 -0
  47. package/components/checkbox-group/checkbox-group.vue +11 -0
  48. package/components/checkbox-group/index.js +7 -0
  49. package/components/date-picker/date-picker.vue +300 -0
  50. package/components/date-picker/index.js +7 -0
  51. package/components/dialog/dialog.vue +182 -0
  52. package/components/dialog/index.js +14 -0
  53. package/components/dialog/utils.js +20 -0
  54. package/components/drawer/drawer.vue +186 -0
  55. package/components/drawer/index.js +14 -0
  56. package/components/drawer/utils.js +36 -0
  57. package/components/dropdown/dropdown-item.vue +63 -0
  58. package/components/dropdown/dropdown.vue +286 -0
  59. package/components/dropdown/index.js +16 -0
  60. package/components/empty/empty.vue +62 -0
  61. package/components/empty/index.js +7 -0
  62. package/components/filter/filter-group.vue +44 -0
  63. package/components/filter/filter-item.vue +122 -0
  64. package/components/filter/filter-more.vue +114 -0
  65. package/components/filter/filter.vue +407 -0
  66. package/components/filter/index.js +20 -0
  67. package/components/filter/refresh-line.svg +1 -0
  68. package/components/filter/util.js +5 -0
  69. package/components/form/form-cell.vue +231 -0
  70. package/components/form/form-group.vue +147 -0
  71. package/components/form/form-row.vue +51 -0
  72. package/components/form/form.vue +256 -0
  73. package/components/form/index.js +13 -0
  74. package/components/grid/grid-card-view/grid-card-view.vue +157 -0
  75. package/components/grid/grid-column.vue +136 -0
  76. package/components/grid/grid-filter/grid-filter-group.vue +41 -0
  77. package/components/grid/grid-filter/grid-filter-item.vue +68 -0
  78. package/components/grid/grid-filter/grid-filter.vue +115 -0
  79. package/components/grid/grid-filter/util.js +7 -0
  80. package/components/grid/grid-filter-operate/grid-filter-operate-item.vue +55 -0
  81. package/components/grid/grid-filter-operate/grid-filter-operate.vue +46 -0
  82. package/components/grid/grid-sort/grid-sort-proxy.js +27 -0
  83. package/components/grid/grid-sort/grid-sort.vue +205 -0
  84. package/components/grid/grid-sort/icons/asc.png +0 -0
  85. package/components/grid/grid-sort/icons/desc.png +0 -0
  86. package/components/grid/grid-sort/index.js +7 -0
  87. package/components/grid/grid-table-view/grid-table-view.vue +178 -0
  88. package/components/grid/grid-table.vue +547 -0
  89. package/components/grid/grid-toolbar/grid-batch-toolbar-proxy.js +21 -0
  90. package/components/grid/grid-toolbar/grid-batch-toolbar.vue +129 -0
  91. package/components/grid/grid-toolbar/grid-global-toolbar-proxy.js +21 -0
  92. package/components/grid/grid-toolbar/grid-global-toolbar.vue +37 -0
  93. package/components/grid/grid-toolbar/grid-more-toolbar-proxy.js +21 -0
  94. package/components/grid/grid-toolbar/grid-more-toolbar.vue +138 -0
  95. package/components/grid/grid-toolbar/grid-row-toolbar.vue +279 -0
  96. package/components/grid/grid-view-select.vue +78 -0
  97. package/components/grid/grid.vue +1102 -0
  98. package/components/grid/icons/more-line.svg +1 -0
  99. package/components/grid/icons/refresh.svg +14 -0
  100. package/components/grid/index.js +61 -0
  101. package/components/grid/util.js +31 -0
  102. package/components/icon/demo.css +539 -0
  103. package/components/icon/demo_index.html +7433 -0
  104. package/components/icon/icon.vue +96 -0
  105. package/components/icon/iconfont.css +1275 -0
  106. package/components/icon/iconfont.eot +0 -0
  107. package/components/icon/iconfont.js +1 -0
  108. package/components/icon/iconfont.json +2214 -0
  109. package/components/icon/iconfont.svg +455 -0
  110. package/components/icon/iconfont.ttf +0 -0
  111. package/components/icon/iconfont.woff +0 -0
  112. package/components/icon/iconfont.woff2 +0 -0
  113. package/components/icon/index.js +7 -0
  114. package/components/image/image.vue +299 -0
  115. package/components/image/index.js +12 -0
  116. package/components/image/util.js +26 -0
  117. package/components/index.js +153 -0
  118. package/components/loading/index.js +7 -0
  119. package/components/loading/loading.vue +130 -0
  120. package/components/menu/index.js +14 -0
  121. package/components/menu/menu-group.vue +240 -0
  122. package/components/menu/menu-item.vue +215 -0
  123. package/components/menu/menu.vue +64 -0
  124. package/components/message/index.js +19 -0
  125. package/components/message/message.js +28 -0
  126. package/components/message/message.less +6 -0
  127. package/components/message-box/index.js +10 -0
  128. package/components/message-box/message-box.js +140 -0
  129. package/components/message-box/message-box.less +5 -0
  130. package/components/pagination/index.js +7 -0
  131. package/components/pagination/pagination.vue +193 -0
  132. package/components/panel/index.js +7 -0
  133. package/components/panel/panel.vue +44 -0
  134. package/components/popover/index.js +7 -0
  135. package/components/popover/popover.vue +140 -0
  136. package/components/popup-select/index.js +7 -0
  137. package/components/popup-select/popup-select.vue +114 -0
  138. package/components/radio/index.js +7 -0
  139. package/components/radio/radio.vue +92 -0
  140. package/components/radio-button/index.js +7 -0
  141. package/components/radio-button/radio-button.vue +20 -0
  142. package/components/radio-group/index.js +7 -0
  143. package/components/radio-group/radio-group.vue +22 -0
  144. package/components/searchbox/index.js +7 -0
  145. package/components/searchbox/searchbox.vue +260 -0
  146. package/components/select/index.js +9 -0
  147. package/components/select/select-load-more.vue +53 -0
  148. package/components/select/select.vue +572 -0
  149. package/components/skeleton/index.js +14 -0
  150. package/components/skeleton/skeleton-rows.vue +52 -0
  151. package/components/skeleton/skeleton.vue +72 -0
  152. package/components/sortable/index.js +9 -0
  153. package/components/sortable/sortable-item.vue +77 -0
  154. package/components/sortable/sortable.vue +62 -0
  155. package/components/spinner/index.js +7 -0
  156. package/components/spinner/spinner.vue +121 -0
  157. package/components/spinner-range/index.js +7 -0
  158. package/components/spinner-range/spinner-range.vue +97 -0
  159. package/components/spinner-textarea/index.js +7 -0
  160. package/components/spinner-textarea/spinner-textarea.vue +65 -0
  161. package/components/switch/index.js +7 -0
  162. package/components/switch/switch.vue +105 -0
  163. package/components/tabs/index.js +10 -0
  164. package/components/tabs/tabs.vue +115 -0
  165. package/components/tag/index.js +9 -0
  166. package/components/tag/tag.less +30 -0
  167. package/components/text/index.js +7 -0
  168. package/components/text/text.vue +69 -0
  169. package/components/textarea/index.js +7 -0
  170. package/components/textarea/textarea.vue +229 -0
  171. package/components/textbox/index.js +7 -0
  172. package/components/textbox/textbox.vue +275 -0
  173. package/components/time-picker/index.js +7 -0
  174. package/components/time-picker/time-picker.vue +77 -0
  175. package/components/toolbar/index.js +14 -0
  176. package/components/toolbar/toolbar-item.vue +43 -0
  177. package/components/toolbar/toolbar.vue +81 -0
  178. package/components/tooltip/index.js +9 -0
  179. package/components/tooltip/tooltip.vue +86 -0
  180. package/components/transfer/index.js +7 -0
  181. package/components/transfer/transfer-load-more.vue +53 -0
  182. package/components/transfer/transfer.vue +245 -0
  183. package/components/tree/index.js +7 -0
  184. package/components/tree/tree.vue +326 -0
  185. package/components/tree/utils.js +122 -0
  186. package/components/video/index.js +7 -0
  187. package/components/video/video.vue +53 -0
  188. package/package.json +4 -1
  189. package/utils/date.js +55 -0
  190. package/utils/emitter.js +3 -0
  191. package/utils/json.js +19 -0
  192. package/utils/resize-event.js +35 -0
  193. package/utils/util.js +12 -0
  194. package/utils/utils.js +0 -0
@@ -0,0 +1,7 @@
1
+ import Loading from './loading'
2
+
3
+ Loading.install = (Vue) => {
4
+ Vue.component(Loading.name, Loading)
5
+ }
6
+
7
+ export default Loading
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <transition>
3
+ <div class="ac-loading" v-if="visible" :style="style">
4
+ <ui-icon class="ac-loading__icon" name="loading" :size="40" color="#28a4e6"></ui-icon>
5
+ <div v-if="text" class="ac-loading__text">{{text}}</div>
6
+ </div>
7
+ </transition>
8
+ </template>
9
+ <script>
10
+ export default {
11
+ name: 'AcLoading',
12
+ props: {
13
+ visible: {
14
+ type: Boolean
15
+ },
16
+ opacity: {
17
+ type: Number,
18
+ default: 1
19
+ },
20
+ text: {
21
+ type: String
22
+ }
23
+ },
24
+ computed: {
25
+ style () {
26
+ const sy = {}
27
+ if (this.opacity) {
28
+ sy['background-color'] = `rgba(255, 255, 255, ${this.opacity})`
29
+ }
30
+ return sy
31
+ }
32
+ }
33
+ }
34
+ </script>
35
+ <style lang="less">
36
+ .ac-loading{
37
+ position: absolute;
38
+ left: 0;
39
+ right: 0;
40
+ top: 1px;
41
+ bottom: 0;
42
+ background-color: #fff;
43
+ z-index: 100000;
44
+ display: flex;
45
+ flex-direction: column;
46
+ justify-content: center;
47
+ align-items: center;
48
+ &.v-enter{
49
+ opacity: 0;
50
+ }
51
+ &.v-enter-active{
52
+ transition: all .3s;
53
+ }
54
+ &.v-enter-active{
55
+ opacity: 1;
56
+ }
57
+ &.v-leave{
58
+ opacity: 1;
59
+ }
60
+ &.v-leave-active{
61
+ transition: all .3s;
62
+ }
63
+ &.v-leave-active{
64
+ opacity: 0;
65
+ }
66
+ }
67
+ .ac-loading__text{
68
+ display: block;
69
+ color: #999;
70
+ }
71
+ </style>
@@ -0,0 +1,7 @@
1
+ import AcTips from './tips'
2
+
3
+ AcTips.install = (Vue) => {
4
+ Vue.component(AcTips.name, AcTips)
5
+ }
6
+
7
+ export default AcTips
@@ -0,0 +1,82 @@
1
+ <script>
2
+ export default {
3
+ name: 'AcTips',
4
+ functional: true,
5
+ props: {
6
+ showIcon: {
7
+ type: Boolean,
8
+ default: true
9
+ },
10
+ type: {
11
+ type: String,
12
+ default: 'info',
13
+ validator (value) {
14
+ return ['info', 'warning'].includes(value)
15
+ }
16
+ },
17
+ title: {
18
+ type: String
19
+ },
20
+ bgColor: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ inline: {
25
+ type: Boolean,
26
+ default: false
27
+ }
28
+ },
29
+ render (h, context) {
30
+ const { props, data } = context
31
+ return h('div', {
32
+ class: ['ac-tips', 'ac-tips--' + props.type, { 'is-bgcolor': props.bgColor, 'is-inline': props.inline }, data.staticClass]
33
+ }, [
34
+ h('span', {
35
+ class: 'ac-tips__title'
36
+ }, [
37
+ props.showIcon ? h('ui-icon', {
38
+ props: {
39
+ name: props.type === 'warning' ? 'alert-fill1' : 'error-warning-line'
40
+ }
41
+ }) : null,
42
+ props.title ? h('span', {
43
+ class: 'ac-tips__title-text'
44
+ }, [props.title]) : null
45
+ ]),
46
+ h('div', {
47
+ class: 'ac-tips__main'
48
+ }, [context.slots().default])
49
+ ])
50
+ }
51
+ }
52
+ </script>
53
+ <style lang="less">
54
+ .ac-tips{
55
+ line-height: 24px;
56
+ padding: 4px 0;
57
+ display: flex;
58
+ flex-direction: row;
59
+ .ui-icon{
60
+ margin-right: 3px;
61
+ vertical-align: top;
62
+ display: inline-block;
63
+ }
64
+ &.is-bgcolor{
65
+ background-color: #f3f3f3;
66
+ border-radius: 3px;
67
+ padding: 6px 12px;
68
+ }
69
+ &.is-inline{
70
+ display: inline-block;
71
+ }
72
+ }
73
+ .ac-tips__title-text {
74
+ margin-right: 6px;
75
+ }
76
+ .ac-tips--warning {
77
+ color: #E6A23C;
78
+ }
79
+ .ac-tips--tips {
80
+ color: #999;
81
+ }
82
+ </style>
@@ -0,0 +1,7 @@
1
+ import Tooltip from './tooltip'
2
+
3
+ Tooltip.install = (Vue) => {
4
+ Vue.component(Tooltip.name, Tooltip)
5
+ }
6
+
7
+ export default Tooltip
@@ -0,0 +1,18 @@
1
+ import Vue from 'vue'
2
+ import UiTooltip from '../../components/tooltip'
3
+
4
+ const TooltipConstructor = Vue.extend(UiTooltip)
5
+
6
+ let tooltip = null
7
+
8
+ export function getTooltip () {
9
+ if (!tooltip) {
10
+ const $mound = document.createElement('div')
11
+ tooltip = new TooltipConstructor({
12
+ el: $mound
13
+ })
14
+ tooltip.manual = true
15
+ document.body.appendChild($mound)
16
+ }
17
+ return tooltip
18
+ }
@@ -0,0 +1,55 @@
1
+ <script>
2
+ import { getTooltip } from './popper'
3
+
4
+ export default {
5
+ name: 'BiTooltip',
6
+ functional: true,
7
+ props: {
8
+ text: {
9
+ type: String
10
+ },
11
+ html: {
12
+ type: String
13
+ }
14
+ },
15
+ render (h, context) {
16
+ if (!context.props.text && !context.props.html) {
17
+ return context.scopedSlots.default ? context.scopedSlots.default() : null
18
+ }
19
+ return h('span', {
20
+ class: ['bi-tooltip'].concat(context.data.class || '', context.data.staticClass || ''),
21
+ attrs: context.data.attrs,
22
+ on: {
23
+ ...context.listeners,
24
+ mouseenter (e) {
25
+ const tooltip = getTooltip()
26
+ tooltip.visible = true
27
+ tooltip.content = context.props.text
28
+ tooltip.html = context.props.html
29
+ tooltip.setReferenceElm(e.target)
30
+ },
31
+ mouseleave () {
32
+ const tooltip = getTooltip()
33
+ tooltip.visible = false
34
+ }
35
+ }
36
+ }, [
37
+ context.children
38
+ ])
39
+ }
40
+ }
41
+ </script>
42
+ <style lang="less">
43
+ body {
44
+ .el-tooltip__popper{
45
+ white-space: pre-wrap;
46
+ }
47
+ }
48
+ .bi-tooltip{
49
+ display: inline-block;
50
+ max-width: 100%;
51
+ overflow: hidden;
52
+ text-overflow: ellipsis;
53
+ vertical-align: middle;
54
+ }
55
+ </style>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <ui-select
3
+ type="date"
4
+ v-model="innerValue"
5
+ :placeholder="placeholder"
6
+ >
7
+ <ui-select-item label="为真" :value="true"></ui-select-item>
8
+ <ui-select-item label="为假" :value="false"></ui-select-item>
9
+ </ui-select>
10
+ </template>
11
+ <script>
12
+ export default {
13
+ name: 'UiAdvancedFilterconditionItemDate',
14
+ props: {
15
+ placeholder: {
16
+ type: String
17
+ },
18
+ value: {
19
+ type: String
20
+ }
21
+ },
22
+ computed: {
23
+ innerValue: {
24
+ get () {
25
+ return this.value
26
+ },
27
+ set (val) {
28
+ this.$emit('input', val)
29
+ }
30
+ }
31
+ }
32
+ }
33
+ </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <ui-date-picker
3
+ type="daterange"
4
+ v-model="innerValue"
5
+ start-placeholder="起始日期"
6
+ end-placeholder="截止日期"
7
+ format="yyyy-MM-dd"
8
+ value-format="yyyy-MM-dd HH:mm:ss"
9
+ ></ui-date-picker>
10
+ </template>
11
+ <script>
12
+ export default {
13
+ name: 'UiAdvancedFilterconditionItemDateRange',
14
+ props: {
15
+ value: {
16
+ type: Array
17
+ }
18
+ },
19
+ computed: {
20
+ innerValue: {
21
+ get () {
22
+ return this.value
23
+ },
24
+ set (val) {
25
+ this.$emit('input', val)
26
+ }
27
+ }
28
+ }
29
+ }
30
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <ui-date-picker
3
+ type="date"
4
+ v-model="innerValue"
5
+ :placeholder="placeholder"
6
+ format="yyyy-MM-dd"
7
+ value-format="yyyy-MM-dd HH:mm:ss"
8
+ ></ui-date-picker>
9
+ </template>
10
+ <script>
11
+ export default {
12
+ name: 'UiAdvancedFilterconditionItemDate',
13
+ props: {
14
+ placeholder: {
15
+ type: String,
16
+ default: '选择日期'
17
+ },
18
+ value: {
19
+ type: Array
20
+ }
21
+ },
22
+ computed: {
23
+ innerValue: {
24
+ get () {
25
+ if (Array.isArray(this.value)) {
26
+ return this.value[0]
27
+ }
28
+ return this.value
29
+ },
30
+ set (val) {
31
+ if (val === null || val === undefined) {
32
+ val = []
33
+ } else {
34
+ val = [val]
35
+ }
36
+ this.$emit('input', val)
37
+ }
38
+ }
39
+ }
40
+ }
41
+ </script>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <ui-date-picker
3
+ type="datetimerange"
4
+ v-model="innerValue"
5
+ start-placeholder="起始日期"
6
+ end-placeholder="截止日期"
7
+ format="yyyy-MM-dd HH:mm"
8
+ value-format="yyyy-MM-dd HH:mm:ss"
9
+ ></ui-date-picker>
10
+ </template>
11
+ <script>
12
+ export default {
13
+ name: 'UiAdvancedFilterconditionItemDatetimeRange',
14
+ props: {
15
+ placeholder: {
16
+ type: String,
17
+ default: '选择时间'
18
+ },
19
+ value: {
20
+ type: Array
21
+ }
22
+ },
23
+ computed: {
24
+ innerValue: {
25
+ get () {
26
+ return this.value
27
+ },
28
+ set (val) {
29
+ this.$emit('input', val)
30
+ }
31
+ }
32
+ }
33
+ }
34
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <ui-date-picker
3
+ type="datetime"
4
+ v-model="innerValue"
5
+ :placeholder="placeholder"
6
+ format="yyyy-MM-dd HH:mm"
7
+ value-format="yyyy-MM-dd HH:mm:ss"
8
+ ></ui-date-picker>
9
+ </template>
10
+ <script>
11
+ export default {
12
+ name: 'UiAdvancedFilterconditionItemDatetime',
13
+ props: {
14
+ placeholder: {
15
+ type: String,
16
+ default: '选择时间'
17
+ },
18
+ value: {
19
+ type: Array
20
+ }
21
+ },
22
+ computed: {
23
+ innerValue: {
24
+ get () {
25
+ if (Array.isArray(this.value)) {
26
+ return this.value[0]
27
+ }
28
+ return this.value
29
+ },
30
+ set (val) {
31
+ if (val === null || val === undefined) {
32
+ val = []
33
+ } else {
34
+ val = [val]
35
+ }
36
+ this.$emit('input', val)
37
+ }
38
+ }
39
+ }
40
+ }
41
+ </script>
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <div class="ui-advanced-filter-conditon-item-number-range">
3
+ <div class="ui-advanced-filter-conditon-item-number-range__item">
4
+ <ui-spinner
5
+ v-model="startValue"
6
+ placeholder="起始值"
7
+ style="width: 100%"
8
+ ></ui-spinner>
9
+ </div>
10
+ <div class="ui-advanced-filter-conditon-item-number-range__line">~</div>
11
+ <div class="ui-advanced-filter-conditon-item-number-range__item">
12
+ <ui-spinner
13
+ v-model="endValue"
14
+ placeholder="截止值"
15
+ style="width: 100%"
16
+ ></ui-spinner>
17
+ </div>
18
+ </div>
19
+ </template>
20
+ <script>
21
+ export default {
22
+ name: 'UiAdvancedFilterConditionItemNumberRange',
23
+ props: {
24
+ value: {
25
+ type: Array
26
+ }
27
+ },
28
+ computed: {
29
+ innerValue: {
30
+ get () {
31
+ if (!Array.isArray(this.value)) {
32
+ return []
33
+ }
34
+ return this.value
35
+ },
36
+ set (val) {
37
+ this.$emit('input', val)
38
+ }
39
+ },
40
+ startValue: {
41
+ get () {
42
+ return this.innerValue[0]
43
+ },
44
+ set (val) {
45
+ this.innerValue = [val, this.endValue]
46
+ }
47
+ },
48
+ endValue: {
49
+ get () {
50
+ return this.innerValue[1]
51
+ },
52
+ set (val) {
53
+ this.innerValue = [this.startValue, val]
54
+ }
55
+ }
56
+ }
57
+ }
58
+ </script>
59
+ <style lang="less">
60
+ .ui-advanced-filter-conditon-item-number-range{
61
+ display: flex;
62
+ flex-direction: row;
63
+ }
64
+ .ui-advanced-filter-conditon-item-number-range__line{
65
+ margin: 0 6px;
66
+ }
67
+ </style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <ui-spinner
3
+ v-model="innerValue"
4
+ placeholder="请输入"
5
+ style="width: 100%"
6
+ ></ui-spinner>
7
+ </template>
8
+ <script>
9
+ export default {
10
+ name: 'UiAdvancedFilterconditionItemNumber',
11
+ props: {
12
+ value: {
13
+ type: Array
14
+ }
15
+ },
16
+ computed: {
17
+ innerValue: {
18
+ get () {
19
+ if (Array.isArray(this.value)) {
20
+ return this.value[0]
21
+ }
22
+ return this.value
23
+ },
24
+ set (val) {
25
+ if (val === null || val === undefined) {
26
+ val = []
27
+ } else {
28
+ val = [val]
29
+ }
30
+ this.$emit('input', val)
31
+ }
32
+ }
33
+ }
34
+ }
35
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <ui-textbox
3
+ v-model="innerValue"
4
+ placeholder="多个条件使用;隔开"
5
+ @blur="handleBlur"
6
+ :maxlength="null"
7
+ ></ui-textbox>
8
+ </template>
9
+ <script>
10
+ export default {
11
+ name: 'UiAdvancedFilterconditionItemString',
12
+ props: {
13
+ placeholder: {
14
+ type: String
15
+ },
16
+ value: {
17
+ type: Array
18
+ }
19
+ },
20
+ computed: {
21
+ innerValue: {
22
+ get () {
23
+ if (Array.isArray(this.value)) {
24
+ return this.value.join(';')
25
+ }
26
+ return this.value
27
+ },
28
+ set (val) {
29
+ val = val.split(/[;;]/)
30
+ this.$emit('input', val)
31
+ }
32
+ }
33
+ },
34
+ methods: {
35
+ handleBlur() {
36
+ let innerValue = (this.innerValue || '').split(/[;;]/).filter(v => !!v)
37
+ this.$emit('input', innerValue)
38
+ }
39
+ }
40
+ }
41
+ </script>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <component :is="component" v-model="innerValues"></component>
3
+ </template>
4
+ <script>
5
+ export default {
6
+ name: 'UiAdvancedFilterConditionItemValue',
7
+ inject: ['UiAdvancedFilter'],
8
+ provide () {
9
+ return {
10
+ UiAdvancedFilterConditionItemValue: this
11
+ }
12
+ },
13
+ props: {
14
+ component: {
15
+ type: Object,
16
+ required: true
17
+ },
18
+ name: {
19
+ type: String
20
+ },
21
+ value: {
22
+ type: Array
23
+ }
24
+ },
25
+ computed: {
26
+ innerValues: {
27
+ get () {
28
+ return this.value
29
+ },
30
+ set (val) {
31
+ this.$emit('input', val)
32
+ }
33
+ }
34
+ },
35
+ created () {
36
+ this.UiAdvancedFilter.$on('collect-condition-text-data', this.handleCollectConditionTextData)
37
+ },
38
+ methods: {
39
+ handleCollectConditionTextData (evt) {
40
+ if (!this.name) {
41
+ return
42
+ }
43
+ if (!evt || !evt.conditions || !evt.conditions.length) {
44
+ return
45
+ }
46
+ const condition = evt.conditions.find(v => v.name === this.name)
47
+ let isSet = false
48
+ this.$emit('ui-advanced-filter-condition-item-collect_text', {
49
+ getValue () {
50
+ return condition.values
51
+ },
52
+ /**
53
+ * 设置值对应的textMap
54
+ * {
55
+ * [value]: text
56
+ * ...
57
+ * }
58
+ */
59
+ setTextMap (textMap) {
60
+ // 设置了就不在继续设置,防止类型用户选择组件里面包select基础组件,导致重复触发问题
61
+ if (isSet) {
62
+ return
63
+ }
64
+ condition.valueMap = textMap
65
+ }
66
+ })
67
+ }
68
+ },
69
+ beforeDestroy () {
70
+ this.UiAdvancedFilter.$off('collect-condition-text-data', this.handleCollectConditionTextData)
71
+ }
72
+ }
73
+ </script>