@bytenew/bn-bus-ui 1.1.463 → 1.1.464

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 (167) hide show
  1. package/dist/assocTableSearch-Bfe96864.js +349 -0
  2. package/dist/assocTableSearch.css +1 -0
  3. package/dist/bn-bus-ui.es.js +65 -0
  4. package/dist/bn-bus-ui.umd.js +49 -0
  5. package/dist/chooseIPaasData-COrrvQKZ.js +391 -0
  6. package/dist/chooseIPaasData.css +1 -0
  7. package/dist/defaultSet-CzN1ec_d.js +297 -0
  8. package/dist/defaultSet.css +1 -0
  9. package/dist/fileFormData-D_Q1vylE.js +53 -0
  10. package/dist/formItemFooter-BvptZj_u.js +108 -0
  11. package/dist/formItemFooter.css +1 -0
  12. package/dist/funcExprDialog-BguNs9fl.js +139 -0
  13. package/dist/funcExprDialog.css +1 -0
  14. package/dist/index-0oB7QocU.js +44 -0
  15. package/dist/index-69fRP0M8.js +89 -0
  16. package/dist/index-BdklTJtF.js +66 -0
  17. package/dist/index-Bu3jHlby.js +45 -0
  18. package/dist/index-BxWx5kpG.js +89 -0
  19. package/dist/index-C5LQ0OSs.js +183 -0
  20. package/dist/index-C8YhrrUN.js +51 -0
  21. package/dist/index-COuPCIzB.js +45 -0
  22. package/dist/index-CSvVyjxx.js +178 -0
  23. package/dist/index-DCv51EXX.js +109 -0
  24. package/dist/index-DUSI6MuC.js +135 -0
  25. package/dist/index-DVzxs2vR.js +58 -0
  26. package/dist/index-Dd4b8zNb.js +746 -0
  27. package/dist/index-Md-ZlkCW.js +66 -0
  28. package/dist/index-hsSIY2FP.js +221 -0
  29. package/dist/index-n13-H3_Y.js +118 -0
  30. package/dist/index-wUl5aPUD.js +64 -0
  31. package/dist/index.css +1 -0
  32. package/dist/index2.css +1 -0
  33. package/dist/index3.css +1 -0
  34. package/dist/index4.css +1 -0
  35. package/dist/index5.css +1 -0
  36. package/dist/index6.css +1 -0
  37. package/dist/index7.css +1 -0
  38. package/dist/install-CNjs0u5x.js +23299 -0
  39. package/dist/install.css +1 -0
  40. package/dist/setOption-CXOifQcx.js +329 -0
  41. package/dist/setOption.css +1 -0
  42. package/dist/setRelationOption-C7VDhej7.js +5217 -0
  43. package/dist/setRelationOption.css +1 -0
  44. package/package.json +4 -20
  45. package/install.js +0 -134
  46. package/packages/BnAddress/index.vue +0 -141
  47. package/packages/BnAddressParse/index.vue +0 -75
  48. package/packages/BnAdvancedFilter/BnFilterView.vue +0 -145
  49. package/packages/BnAdvancedFilter/index.vue +0 -345
  50. package/packages/BnAdvancedFilter/util.js +0 -171
  51. package/packages/BnCascader/BnCascader.vue +0 -543
  52. package/packages/BnCascader/BnCascaderPanel.vue +0 -1331
  53. package/packages/BnCascader/cascaderDisplay.js +0 -102
  54. package/packages/BnCheck/BnCheck.vue +0 -253
  55. package/packages/BnColumnConfig/columnConfigDialog.vue +0 -134
  56. package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +0 -143
  57. package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +0 -314
  58. package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +0 -243
  59. package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +0 -114
  60. package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +0 -210
  61. package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +0 -126
  62. package/packages/BnColumnConfig/component/packageFilter/index.vue +0 -141
  63. package/packages/BnColumnConfig/component/paraExplainSet/index.vue +0 -156
  64. package/packages/BnColumnConfig/component/setOption/setOption.vue +0 -321
  65. package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +0 -277
  66. package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +0 -144
  67. package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +0 -642
  68. package/packages/BnColumnConfig/data.js +0 -129
  69. package/packages/BnColumnConfig/index.scss +0 -23
  70. package/packages/BnColumnConfig/index.vue +0 -309
  71. package/packages/BnCondVal/BnCondVal.vue +0 -112
  72. package/packages/BnCondVal/itemVal/dateRegVal.vue +0 -39
  73. package/packages/BnCondVal/itemVal/dateVal.vue +0 -39
  74. package/packages/BnCondVal/itemVal/numRegVal.vue +0 -67
  75. package/packages/BnCondVal/itemVal/numVal.vue +0 -44
  76. package/packages/BnCondVal/itemVal/relationVal.vue +0 -73
  77. package/packages/BnCondVal/itemVal/selectColumnVal.vue +0 -58
  78. package/packages/BnCondVal/itemVal/selectVal.vue +0 -59
  79. package/packages/BnCondVal/itemVal/stringVal.vue +0 -156
  80. package/packages/BnCondition/index.vue +0 -551
  81. package/packages/BnCondition/util.js +0 -232
  82. package/packages/BnDatePicker/BnDatePicker.vue +0 -194
  83. package/packages/BnDrop/BnDrop.vue +0 -917
  84. package/packages/BnEmptyTip/BnEmptyTip.vue +0 -107
  85. package/packages/BnExportOrder/BnExportOrder.vue +0 -241
  86. package/packages/BnExportOrder/validatorCode.vue +0 -94
  87. package/packages/BnFileView/BnFileView.vue +0 -271
  88. package/packages/BnFileView/FileDetail.vue +0 -125
  89. package/packages/BnFileView/videoPreview.vue +0 -70
  90. package/packages/BnFilterOption/BnFilterOption.vue +0 -160
  91. package/packages/BnFunExpr/BnFunExpr.vue +0 -608
  92. package/packages/BnImportOrder/BnImportOrder.vue +0 -323
  93. package/packages/BnImportTemplate/BnImportTemplate.vue +0 -866
  94. package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
  95. package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
  96. package/packages/BnImportTemplate/assets/xls.png +0 -0
  97. package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +0 -198
  98. package/packages/BnImportTemplate/components/TemplateEditDialog.vue +0 -340
  99. package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +0 -401
  100. package/packages/BnImportTemplate/components/TemplateListDialog.vue +0 -297
  101. package/packages/BnInpNum/BnInpNum.vue +0 -165
  102. package/packages/BnMenus/BnMenus.vue +0 -502
  103. package/packages/BnMenus/MenuItem.vue +0 -321
  104. package/packages/BnOrderCard/BnOrderCard.vue +0 -389
  105. package/packages/BnOrderCard/orderRemark.vue +0 -178
  106. package/packages/BnOrderCard/util.js +0 -94
  107. package/packages/BnOrderDetail/BnOrderDetail.vue +0 -338
  108. package/packages/BnOrderDetail/filterLogByUser.vue +0 -108
  109. package/packages/BnOrderDetail/orderLogs.vue +0 -53
  110. package/packages/BnOrderDetail/showSubForm/index.vue +0 -41
  111. package/packages/BnOrderDetail/showSubForm/showChildTable.vue +0 -61
  112. package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +0 -131
  113. package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +0 -84
  114. package/packages/BnOrderShare/index.vue +0 -378
  115. package/packages/BnOrderShare/shareUrlInp.vue +0 -54
  116. package/packages/BnRadio/BnRadio.vue +0 -181
  117. package/packages/BnRelation/BnRelation.vue +0 -120
  118. package/packages/BnSelect/BnSelect.vue +0 -485
  119. package/packages/BnSmartForm/BnBatchForm.vue +0 -334
  120. package/packages/BnSmartForm/BnBatchFormDialog.vue +0 -423
  121. package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +0 -57
  122. package/packages/BnSmartForm/BnSmartElf/index.vue +0 -95
  123. package/packages/BnSmartForm/BnSmartFormPsychic.js +0 -629
  124. package/packages/BnSmartForm/BnSmartFormUtil.js +0 -524
  125. package/packages/BnSmartForm/addressForm/index.vue +0 -73
  126. package/packages/BnSmartForm/checkboxForm/index.vue +0 -99
  127. package/packages/BnSmartForm/childrenForm/childFormFile.vue +0 -237
  128. package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +0 -260
  129. package/packages/BnSmartForm/childrenForm/index.vue +0 -110
  130. package/packages/BnSmartForm/childrenForm/searchInventory.vue +0 -115
  131. package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +0 -451
  132. package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +0 -229
  133. package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +0 -84
  134. package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +0 -158
  135. package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +0 -307
  136. package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +0 -84
  137. package/packages/BnSmartForm/choosePackage/choosePackage.vue +0 -361
  138. package/packages/BnSmartForm/dateDualForm/index.vue +0 -37
  139. package/packages/BnSmartForm/dateForm/index.vue +0 -38
  140. package/packages/BnSmartForm/fileForm/fileFormData.js +0 -50
  141. package/packages/BnSmartForm/fileForm/index.vue +0 -240
  142. package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +0 -38
  143. package/packages/BnSmartForm/formItemTop/formItemTop.vue +0 -42
  144. package/packages/BnSmartForm/index.vue +0 -1201
  145. package/packages/BnSmartForm/numberForm/index.vue +0 -63
  146. package/packages/BnSmartForm/radioForm/index.vue +0 -72
  147. package/packages/BnSmartForm/receiveForm/index.vue +0 -112
  148. package/packages/BnSmartForm/relationForm/index.vue +0 -82
  149. package/packages/BnSmartForm/scoreForm/index.vue +0 -39
  150. package/packages/BnSmartForm/selectForm/index.vue +0 -55
  151. package/packages/BnSmartForm/showValForm/index.vue +0 -42
  152. package/packages/BnSmartForm/showValForm/showValFormTable.vue +0 -104
  153. package/packages/BnSmartForm/smartFormsCommon.scss +0 -43
  154. package/packages/BnSmartForm/stringForm/index.vue +0 -170
  155. package/packages/BnVirtPopover/index.vue +0 -319
  156. package/packages/BnWebLog/BnWebLog.vue +0 -140
  157. package/packages/BnWorkSettingDrop/advancedOptions.js +0 -112
  158. package/packages/BnWorkSettingDrop/benBenAIUtil.js +0 -89
  159. package/packages/BnWorkSettingDrop/index.vue +0 -292
  160. package/packages/font/iconfont.css +0 -243
  161. package/packages/font/iconfont.ttf +0 -0
  162. package/packages/font/iconfont.woff +0 -0
  163. package/packages/font/iconfont.woff2 +0 -0
  164. package/utils/addressParse-old.js +0 -645
  165. package/utils/addressParse.js +0 -735
  166. package/utils/config.js +0 -68
  167. package/utils/index.js +0 -1171
@@ -1,232 +0,0 @@
1
- export const searchList = {
2
- 1: [
3
- {title: '等于', id: '1'},
4
- {title: '不等于', id: '2'},
5
- {title: '包含', id: '3'},
6
- {title: '不包含', id: '4'},
7
- {title: '包含任一项', id: '5'},
8
- {title: '不包含任一项', id: '6'},
9
- {title: '为空', id: '9'},
10
- {title: '不为空', id: '10'},
11
- // {title: '不重复', id: '14'},
12
- // {title: '重复', id: '15'}
13
- ],
14
- 2: [
15
- {title: '等于', id: '1'},
16
- {title: '不等于', id: '2'},
17
- {title: '大于', id: '16'},
18
- {title: '小于', id: '17'},
19
- {title: '大于等于', id: '18'},
20
- {title: '小于等于', id: '19'},
21
- // {title: '范围', id: '8'},
22
- {title: '为空', id: '9'},
23
- {title: '不为空', id: '10'},
24
- ],
25
- 3: [
26
- {title: '等于', id: '1'},
27
- {title: '不等于', id: '2'},
28
- {title: '包含任一项', id: '5'},
29
- {title: '不包含任一项', id: '6'},
30
- {title: '为空', id: '9'},
31
- {title: '不为空', id: '10'}
32
- ],
33
- 4: [
34
- {title: '等于', id: '1'},
35
- {title: '不等于', id: '2'},
36
- {title: '包含任一项', id: '5'},
37
- {title: '不包含任一项', id: '6'},
38
- {title: '为空', id: '9'},
39
- {title: '不为空', id: '10'}
40
- ],
41
- 5: [
42
- {title: '等于', id: '1'},
43
- {title: '不等于', id: '2'},
44
- {title: '包含任一项', id: '5'},
45
- {title: '不包含任一项', id: '6'},
46
- {title: '包含所有项', id: '7'},
47
- {title: '为空', id: '9'},
48
- {title: '不为空', id: '10'},
49
- ],
50
- 6: [
51
- {title: '等于', id: '1'},
52
- {title: '不等于', id: '2'},
53
- {title: '包含任一项', id: '5'},
54
- {title: '不包含任一项', id: '6'},
55
- // {title: '包含所有项', id: '7'},
56
- {title: '包含', id: '3'},
57
- {title: '不包含', id: '4'},
58
- {title: '为空', id: '9'},
59
- {title: '不为空', id: '10'},
60
- // {title: '重复', id: '15'}
61
- ],
62
- 7: [
63
- // {title: '范围', id: '8'},
64
- {title: '等于', id: '1'},
65
- {title: '不等于', id: '2'},
66
- {title: '大于', id: '16'},
67
- {title: '小于', id: '17'},
68
- {title: '大于等于', id: '18'},
69
- {title: '小于等于', id: '19'},
70
- {title: '为空', id: '9'},
71
- {title: '不为空', id: '10'},
72
- ],
73
- 10: [
74
- {title: '为空', id: '9'},
75
- {title: '不为空', id: '10'},
76
- ],
77
- 14: [
78
- {title: '等于', id: '1'},
79
- {title: '不等于', id: '2'},
80
- {title: '包含', id: '3'},
81
- {title: '包含任一项', id: '5'},
82
- {title: '不包含任一项', id: '6'},
83
- // {title: '包含所有项', id: '7'},
84
- {title: '为空', id: '9'},
85
- {title: '不为空', id: '10'},
86
- ],
87
- 15: [
88
- // {title: '等于', id: '1'},
89
- // {title: '不等于', id: '2'},
90
- // {title: '包含', id: '3'},
91
- // {title: '包含任一项', id: '5'},
92
- // {title: '不包含任一项', id: '6'},
93
- // {title: '包含所有项', id: '7'},
94
- {title: '为空', id: '9'},
95
- {title: '不为空', id: '10'},
96
- ],
97
- /*8: [
98
- {title: '范围', id: '8'},
99
- {title: '为空', id: '9'},
100
- {title: '不为空', id: '10'},
101
- // {title: '属于', id: '11'},
102
- // {title: '有交集', id: '12'},
103
- // {title: '无交集', id: '13'},
104
- ],
105
- 9: [
106
- {title: '范围', id: '8'},
107
- {title: '为空', id: '9'},
108
- {title: '不为空', id: '10'},
109
- ],
110
- 11: [
111
- {title: '等于', id: '1'},
112
- {title: '不等于', id: '2'},
113
- {title: '包含', id: '3'},
114
- {title: '不包含', id: '4'},
115
- {title: '包含任一项', id: '5'},
116
- {title: '不包含任一项', id: '6'},
117
- {title: '包含所有项', id: '7'},
118
- {title: '范围', id: '8'},
119
- {title: '为空', id: '9'},
120
- {title: '不为空', id: '10'},
121
- {title: '属于', id: '11'},
122
- {title: '有交集', id: '12'},
123
- {title: '无交集', id: '13'},],
124
- 12: [
125
- {title: '等于', id: '1'},
126
- {title: '不等于', id: '2'},
127
- {title: '包含', id: '3'},
128
- {title: '不包含', id: '4'},
129
- {title: '包含任一项', id: '5'},
130
- {title: '不包含任一项', id: '6'},
131
- {title: '包含所有项', id: '7'},
132
- {title: '范围', id: '8'},
133
- {title: '为空', id: '9'},
134
- {title: '不为空', id: '10'},
135
- {title: '属于', id: '11'},
136
- {title: '有交集', id: '12'},
137
- {title: '无交集', id: '13'},],
138
- 13: [
139
- {title: '等于', id: '1'},
140
- {title: '不等于', id: '2'},
141
- {title: '包含', id: '3'},
142
- {title: '不包含', id: '4'},
143
- {title: '包含任一项', id: '5'},
144
- {title: '不包含任一项', id: '6'},
145
- {title: '包含所有项', id: '7'},
146
- {title: '范围', id: '8'},
147
- {title: '为空', id: '9'},
148
- {title: '不为空', id: '10'},
149
- {title: '属于', id: '11'},
150
- {title: '有交集', id: '12'},
151
- {title: '无交集', id: '13'},],
152
- 15: [
153
- {title: '等于', id: '1'},
154
- {title: '为空', id: '9'},
155
- {title: '不为空', id: '10'}
156
- ],*/
157
- 20:[
158
- // {title: '等于', id: '1'},
159
- // {title: '不等于', id: '2'},
160
- {title: '包含', id: '3'},
161
- {title: '不包含', id: '4'},
162
- {title: '包含任一项', id: '5'},
163
- // {title: '不包含任一项', id: '6'},
164
- // {title: '包含所有项', id: '7'},
165
- {title: '为空', id: '9'},
166
- {title: '不为空', id: '10'},
167
- ]
168
- };
169
-
170
- //每个组件类型对应的筛选类型列表
171
- export const submitCheckTypeList = {
172
- 1: '等于',
173
- 2: '不等于',
174
- 3: '包含',
175
- 4: '不包含',
176
- 5: '包含任一项',
177
- 6: '不包含任一项',
178
- 7: '包含所有项',
179
- 8: '范围',
180
- 9: '为空',
181
- 10: '不为空',
182
- 11: '属于',
183
- 12: '有交集',
184
- 13: '无交集',
185
- 14: '不重复',
186
- 15: '重复',
187
- 16: '大于',
188
- 17: '小于',
189
- 18: '大于等于',
190
- 19: '小于等于',
191
- 20: '值改变',
192
- 21: '重复数量大于',
193
- 22: '累计等于',
194
- 23: '累计大于',
195
- 24: '累计小于',
196
- 25: '累计大于等于',
197
- 26: '累计小于等于',
198
- 27: '累计大于占比',
199
- 28: '包含任一项(模糊)', //模糊筛选
200
- 29: '不包含任一项(模糊)', //模糊筛选
201
- 101: '变更为',
202
- 102: '变更为空',
203
- 103: '变更为有值',
204
- };
205
-
206
-
207
- export const valueTypeList = {
208
- //{id: '0', title: '自定义填写'},{id: '1', title: '其他组件'},{id: '2', title: '组件选项'}, {id: '3', title: '空值'},{id: '4', title: '其他步骤'},{ id: '5', title: '工作表属性' }
209
- 1: [{id: '0', title: '自定义填写'}, {id: '1', title: '其他组件'}],
210
- 2: [{id: '0', title: '自定义填写'}, {id: '1', title: '其他组件'}],
211
- 3: [{id: '2', title: '组件选项'}, {id: '1', title: '其他组件'}],
212
- 4: [{id: '2', title: '组件选项'}, {id: '1', title: '其他组件'}],
213
- 5: [{id: '2', title: '组件选项'}],
214
- 6: [{id: '2', title: '组件选项'}],
215
- 7: [{id: '0', title: '自定义填写'}, {id: '1', title: '其他组件'}],
216
- 8: [{id: '0', title: '自定义填写'}, {id: '1', title: '其他组件'}],
217
- 9: [{id: '0', title: '自定义填写'}],
218
- 10: [{id: '2', title: '组件选项'}],
219
- 11: [{id: '2', title: '组件选项'}],
220
- 12: [{id: '2', title: '组件选项'}],
221
- 13: [{id: '2', title: '组件选项'}],
222
- 14: [{id: '2', title: '组件选项'}],
223
- 15: [{id: '2', title: '组件选项'}],
224
- 20: [{id: '2', title: '组件选项'}],
225
- }
226
- // 对比子类型
227
- export const subTypeList = {
228
- 7: [
229
- {id: '5', title: '指定时间'},{id: '0', title: '今天'},{id: '1', title: '明天'}, {id: '2', title: '昨天'}, {id: '3', title: '过去x天'}, {id: '4', title: '未来x天'},
230
- //部分支持 {id: '6', title: '过去x时'}, {id: '7', title: '未来x时'}, {id: '8', title: '过去x月'}, {id: '9', title: '未来x月'},
231
- ],
232
- }
@@ -1,194 +0,0 @@
1
- <!--
2
- @Auther:辛巴
3
- @Date:2023/3/1
4
- @Description:bnDateRange
5
- @VERSION:1.0-->
6
- <template>
7
- <el-date-picker style="width: 100%"
8
- v-model="date"
9
- :type="type"
10
- :size="size"
11
- :disabled="disabled"
12
- :editable="editable"
13
- :clearable="clearable"
14
- :placeholder="placeholder"
15
- :start-placeholder="startPlaceholder"
16
- :end-placeholder="endPlaceholder"
17
- :time-arrow-control="timeArrowControl"
18
- :format="format"
19
- :value-format="valueFormat"
20
- placement="bottom-start"
21
- :popper-class="popperClass"
22
- :range-separator="rangeSeparator"
23
- :defaultTime="defaultTime"
24
- @blur="blur"
25
- @focus="focus"/>
26
- </template>
27
-
28
- <script>
29
- export default {
30
- name: "BnDatePicker",
31
- props: {
32
- // 时间选择器类型 日期:daterange 日期+时间:datetimerange 年:year 月:month 日:date 周:week
33
- type: {
34
- type: String,
35
- default: "daterange"
36
- },
37
- // 日期格式化
38
- dataFormat: String,
39
- // 日期组件的值,默认是数组,可以传对象格式
40
- modelValue: {},
41
- // 当value是对象时,需要提供开始时间的key,默认是start
42
- startKey: {
43
- default: 'start'
44
- },
45
- // 当value是对象时,需要提供结束时间的key,默认是start
46
- endKey: {
47
- default: 'end'
48
- },
49
- // 大小:large 40px, small 32px, mini 28px 默认 small
50
- size: String,
51
- //是否禁用
52
- disabled: {
53
- default: false
54
- },
55
- // 输入框是否可输入
56
- editable: {
57
- default: true
58
- },
59
- // 是否带清空按钮
60
- clearable: {
61
- default: true
62
- },
63
- // 选择日期
64
- placeholder: {
65
- type: String,
66
- default: '选择日期'
67
- },
68
- // 开始时间的placeholder
69
- startPlaceholder: {
70
- type: String,
71
- default: '开始时间'
72
- },
73
- // 结束时间的placeholder
74
- endPlaceholder: {
75
- type: String,
76
- default: '结束时间'
77
- },
78
- // 是否使用箭头,进行时间选择
79
- timeArrowControl: {
80
- default: false
81
- },
82
- // DateTimePicker 下拉框的类名
83
- popperClass: {},
84
- // 选择期分割符
85
- rangeSeparator: {
86
- default: "-"
87
- },
88
- // 默认时间,必须是时间对象
89
- defaultTime: {
90
- type: [Date, Array],
91
- default() {
92
- return [new Date().setHours(0, 0, 0, 0), new Date().setHours(23, 59, 59, 999)]
93
- }
94
- },
95
- },
96
- data() {
97
- return {
98
- typeRangeArray: ['monthrange', 'daterange', 'datetimerange'],
99
- }
100
- },
101
- methods: {
102
- /**
103
- * 更新时间选择器数据
104
- * */
105
- updateValue(value) {
106
- // 更新value
107
- this.$emit('update:modelValue', value)
108
- },
109
- /**
110
- * 失去焦点
111
- * */
112
- blur(val) {
113
- this.$emit('blur', val)
114
- },
115
- /**
116
- * 获得焦点
117
- * */
118
- focus(val) {
119
- this.$emit('focus', val)
120
- },
121
- /**
122
- * 统一格式化日期
123
- * */
124
- formatDatePattern(input) {
125
- // 转换为统一的大写格式
126
- const formatted = input
127
- .replace(/y+/gi, 'YYYY') // 将 y 或 Y 转换为 YYYY
128
- .replace(/m+/gi, 'MM') // 将 m 或 M 转换为 MM
129
- .replace(/d+/gi, 'DD') // 将 d 或 D 转换为 DD
130
- .replace(/h+/gi, 'HH') // 将 h 或 H 转换为 HH
131
- .replace(/s+/gi, 'ss'); // 将 s 或 S 转换为 ss
132
-
133
- return formatted;
134
- }
135
- },
136
- computed: {
137
- /**
138
- * 日期组件value
139
- * */
140
- date: {
141
- get() {
142
- if (this.modelValue) {
143
- if (typeof this.modelValue == 'object' && !Array.isArray(this.modelValue) && this.typeRangeArray.includes(this.type)) {
144
- let value = ['', '']
145
- value[0] = this.modelValue[this.startKey] ? this.modelValue[this.startKey] : ''
146
- value[1] = this.modelValue[this.endKey] ? this.modelValue[this.endKey] : ''
147
- return value
148
- } else {
149
- return this.modelValue;
150
- }
151
- } else {
152
- return undefined;
153
- }
154
- },
155
- set(val) {
156
- if (!this.modelValue || Array.isArray(this.modelValue)) {
157
- this.updateValue(val)
158
- } else {
159
- if (this.typeRangeArray.includes(this.type)) {
160
- let value = JSON.parse(JSON.stringify(this.modelValue || []));
161
- value[this.startKey] = val && val[0] ? val[0] : '';
162
- value[this.endKey] = val && val[1] ? val[1] : '';
163
- this.updateValue(value)
164
- } else {
165
- this.updateValue(val)
166
- }
167
- }
168
- },
169
- },
170
- // 显示在输入框中的格式
171
- format: {
172
- get() {
173
- let format = this.type == 'daterange' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'
174
- format = this.dataFormat ? this.formatDatePattern(this.dataFormat) : format;
175
- return format;
176
- },
177
- set(val) {
178
- return val;
179
- },
180
- },
181
- // 可选,绑定值的格式。不指定则绑定值为 Date 对象 string 见日期格式
182
- valueFormat: {
183
- get() {
184
- let format = this.type == 'daterange' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'
185
- format = this.dataFormat ? this.formatDatePattern(this.dataFormat) : format;
186
- return format;
187
- },
188
- set(val) {
189
- return val;
190
- },
191
- },
192
- }
193
- }
194
- </script>