@bytenew/bn-bus-ui 1.1.461 → 1.1.463

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/install.js +134 -0
  2. package/package.json +20 -4
  3. package/packages/BnAddress/index.vue +141 -0
  4. package/packages/BnAddressParse/index.vue +75 -0
  5. package/packages/BnAdvancedFilter/BnFilterView.vue +145 -0
  6. package/packages/BnAdvancedFilter/index.vue +345 -0
  7. package/packages/BnAdvancedFilter/util.js +171 -0
  8. package/packages/BnCascader/BnCascader.vue +543 -0
  9. package/packages/BnCascader/BnCascaderPanel.vue +1331 -0
  10. package/packages/BnCascader/cascaderDisplay.js +102 -0
  11. package/packages/BnCheck/BnCheck.vue +253 -0
  12. package/packages/BnColumnConfig/columnConfigDialog.vue +134 -0
  13. package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +143 -0
  14. package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +314 -0
  15. package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +243 -0
  16. package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +114 -0
  17. package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +210 -0
  18. package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +126 -0
  19. package/packages/BnColumnConfig/component/packageFilter/index.vue +141 -0
  20. package/packages/BnColumnConfig/component/paraExplainSet/index.vue +156 -0
  21. package/packages/BnColumnConfig/component/setOption/setOption.vue +321 -0
  22. package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +277 -0
  23. package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +144 -0
  24. package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +642 -0
  25. package/packages/BnColumnConfig/data.js +129 -0
  26. package/packages/BnColumnConfig/index.scss +23 -0
  27. package/packages/BnColumnConfig/index.vue +309 -0
  28. package/packages/BnCondVal/BnCondVal.vue +112 -0
  29. package/packages/BnCondVal/itemVal/dateRegVal.vue +39 -0
  30. package/packages/BnCondVal/itemVal/dateVal.vue +39 -0
  31. package/packages/BnCondVal/itemVal/numRegVal.vue +67 -0
  32. package/packages/BnCondVal/itemVal/numVal.vue +44 -0
  33. package/packages/BnCondVal/itemVal/relationVal.vue +73 -0
  34. package/packages/BnCondVal/itemVal/selectColumnVal.vue +58 -0
  35. package/packages/BnCondVal/itemVal/selectVal.vue +59 -0
  36. package/packages/BnCondVal/itemVal/stringVal.vue +156 -0
  37. package/packages/BnCondition/index.vue +551 -0
  38. package/packages/BnCondition/util.js +232 -0
  39. package/packages/BnDatePicker/BnDatePicker.vue +194 -0
  40. package/packages/BnDrop/BnDrop.vue +917 -0
  41. package/packages/BnEmptyTip/BnEmptyTip.vue +107 -0
  42. package/packages/BnExportOrder/BnExportOrder.vue +241 -0
  43. package/packages/BnExportOrder/validatorCode.vue +94 -0
  44. package/packages/BnFileView/BnFileView.vue +271 -0
  45. package/packages/BnFileView/FileDetail.vue +125 -0
  46. package/packages/BnFileView/videoPreview.vue +70 -0
  47. package/packages/BnFilterOption/BnFilterOption.vue +160 -0
  48. package/packages/BnFunExpr/BnFunExpr.vue +608 -0
  49. package/packages/BnImportOrder/BnImportOrder.vue +323 -0
  50. package/packages/BnImportTemplate/BnImportTemplate.vue +866 -0
  51. package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
  52. package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
  53. package/packages/BnImportTemplate/assets/xls.png +0 -0
  54. package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +198 -0
  55. package/packages/BnImportTemplate/components/TemplateEditDialog.vue +340 -0
  56. package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +401 -0
  57. package/packages/BnImportTemplate/components/TemplateListDialog.vue +297 -0
  58. package/packages/BnInpNum/BnInpNum.vue +165 -0
  59. package/packages/BnMenus/BnMenus.vue +502 -0
  60. package/packages/BnMenus/MenuItem.vue +321 -0
  61. package/packages/BnOrderCard/BnOrderCard.vue +389 -0
  62. package/packages/BnOrderCard/orderRemark.vue +178 -0
  63. package/packages/BnOrderCard/util.js +94 -0
  64. package/packages/BnOrderDetail/BnOrderDetail.vue +338 -0
  65. package/packages/BnOrderDetail/filterLogByUser.vue +108 -0
  66. package/packages/BnOrderDetail/orderLogs.vue +53 -0
  67. package/packages/BnOrderDetail/showSubForm/index.vue +41 -0
  68. package/packages/BnOrderDetail/showSubForm/showChildTable.vue +61 -0
  69. package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +131 -0
  70. package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +84 -0
  71. package/packages/BnOrderShare/index.vue +378 -0
  72. package/packages/BnOrderShare/shareUrlInp.vue +54 -0
  73. package/packages/BnRadio/BnRadio.vue +181 -0
  74. package/packages/BnRelation/BnRelation.vue +120 -0
  75. package/packages/BnSelect/BnSelect.vue +485 -0
  76. package/packages/BnSmartForm/BnBatchForm.vue +334 -0
  77. package/packages/BnSmartForm/BnBatchFormDialog.vue +423 -0
  78. package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +57 -0
  79. package/packages/BnSmartForm/BnSmartElf/index.vue +95 -0
  80. package/packages/BnSmartForm/BnSmartFormPsychic.js +629 -0
  81. package/packages/BnSmartForm/BnSmartFormUtil.js +524 -0
  82. package/packages/BnSmartForm/addressForm/index.vue +73 -0
  83. package/packages/BnSmartForm/checkboxForm/index.vue +99 -0
  84. package/packages/BnSmartForm/childrenForm/childFormFile.vue +237 -0
  85. package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +260 -0
  86. package/packages/BnSmartForm/childrenForm/index.vue +110 -0
  87. package/packages/BnSmartForm/childrenForm/searchInventory.vue +115 -0
  88. package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +451 -0
  89. package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +229 -0
  90. package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +84 -0
  91. package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +158 -0
  92. package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +307 -0
  93. package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +84 -0
  94. package/packages/BnSmartForm/choosePackage/choosePackage.vue +361 -0
  95. package/packages/BnSmartForm/dateDualForm/index.vue +37 -0
  96. package/packages/BnSmartForm/dateForm/index.vue +38 -0
  97. package/packages/BnSmartForm/fileForm/fileFormData.js +50 -0
  98. package/packages/BnSmartForm/fileForm/index.vue +240 -0
  99. package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +38 -0
  100. package/packages/BnSmartForm/formItemTop/formItemTop.vue +42 -0
  101. package/packages/BnSmartForm/index.vue +1201 -0
  102. package/packages/BnSmartForm/numberForm/index.vue +63 -0
  103. package/packages/BnSmartForm/radioForm/index.vue +72 -0
  104. package/packages/BnSmartForm/receiveForm/index.vue +112 -0
  105. package/packages/BnSmartForm/relationForm/index.vue +82 -0
  106. package/packages/BnSmartForm/scoreForm/index.vue +39 -0
  107. package/packages/BnSmartForm/selectForm/index.vue +55 -0
  108. package/packages/BnSmartForm/showValForm/index.vue +42 -0
  109. package/packages/BnSmartForm/showValForm/showValFormTable.vue +104 -0
  110. package/packages/BnSmartForm/smartFormsCommon.scss +43 -0
  111. package/packages/BnSmartForm/stringForm/index.vue +170 -0
  112. package/packages/BnVirtPopover/index.vue +319 -0
  113. package/packages/BnWebLog/BnWebLog.vue +140 -0
  114. package/packages/BnWorkSettingDrop/advancedOptions.js +112 -0
  115. package/packages/BnWorkSettingDrop/benBenAIUtil.js +89 -0
  116. package/packages/BnWorkSettingDrop/index.vue +292 -0
  117. package/packages/font/iconfont.css +243 -0
  118. package/packages/font/iconfont.ttf +0 -0
  119. package/packages/font/iconfont.woff +0 -0
  120. package/packages/font/iconfont.woff2 +0 -0
  121. package/utils/addressParse-old.js +645 -0
  122. package/utils/addressParse.js +735 -0
  123. package/utils/config.js +68 -0
  124. package/utils/index.js +1171 -0
  125. package/dist/assocTableSearch-C14i_zJO.js +0 -349
  126. package/dist/assocTableSearch.css +0 -1
  127. package/dist/bn-bus-ui.es.js +0 -65
  128. package/dist/bn-bus-ui.umd.js +0 -49
  129. package/dist/chooseIPaasData-Cl_5qkFA.js +0 -391
  130. package/dist/chooseIPaasData.css +0 -1
  131. package/dist/defaultSet-I4xpf8a4.js +0 -297
  132. package/dist/defaultSet.css +0 -1
  133. package/dist/fileFormData-D_Q1vylE.js +0 -53
  134. package/dist/formItemFooter-CTA7rDtV.js +0 -108
  135. package/dist/formItemFooter.css +0 -1
  136. package/dist/funcExprDialog-Cm5BiRM3.js +0 -139
  137. package/dist/funcExprDialog.css +0 -1
  138. package/dist/index-B6b4uj8v.js +0 -51
  139. package/dist/index-BWdkDTbz.js +0 -109
  140. package/dist/index-BdZ1zOap.js +0 -89
  141. package/dist/index-BdzNjjMC.js +0 -64
  142. package/dist/index-BfpZqab2.js +0 -66
  143. package/dist/index-BmkiB4hr.js +0 -66
  144. package/dist/index-Br1sqCoo.js +0 -58
  145. package/dist/index-C9qrl-yc.js +0 -183
  146. package/dist/index-CXFJXCn5.js +0 -746
  147. package/dist/index-DF114jZq.js +0 -135
  148. package/dist/index-DFPfZ_Il.js +0 -178
  149. package/dist/index-DSEtu7TN.js +0 -44
  150. package/dist/index-Did0UUWV.js +0 -221
  151. package/dist/index-DrPj-tmI.js +0 -45
  152. package/dist/index-DzDf9s2W.js +0 -89
  153. package/dist/index-LnjudNEI.js +0 -118
  154. package/dist/index-ObCfCmDT.js +0 -45
  155. package/dist/index.css +0 -1
  156. package/dist/index2.css +0 -1
  157. package/dist/index3.css +0 -1
  158. package/dist/index4.css +0 -1
  159. package/dist/index5.css +0 -1
  160. package/dist/index6.css +0 -1
  161. package/dist/index7.css +0 -1
  162. package/dist/install-C-scqkds.js +0 -23103
  163. package/dist/install.css +0 -1
  164. package/dist/setOption-CSnWzOny.js +0 -329
  165. package/dist/setOption.css +0 -1
  166. package/dist/setRelationOption-CJcHdfaa.js +0 -5217
  167. package/dist/setRelationOption.css +0 -1
@@ -0,0 +1,232 @@
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
+ }
@@ -0,0 +1,194 @@
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>