eoss-mobiles 0.1.13

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 (285) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +28 -0
  3. package/lib/action-sheet.js +313 -0
  4. package/lib/button-group.js +421 -0
  5. package/lib/button.js +278 -0
  6. package/lib/calendar.js +301 -0
  7. package/lib/cascader.js +336 -0
  8. package/lib/cell.js +366 -0
  9. package/lib/checkbox.js +2170 -0
  10. package/lib/circle.js +299 -0
  11. package/lib/config/api.js +31 -0
  12. package/lib/count-down.js +299 -0
  13. package/lib/date.js +956 -0
  14. package/lib/empty.js +274 -0
  15. package/lib/eoss-mobile.common.js +15072 -0
  16. package/lib/field.js +440 -0
  17. package/lib/flow.js +5664 -0
  18. package/lib/form.js +714 -0
  19. package/lib/grid-item.js +274 -0
  20. package/lib/grid.js +317 -0
  21. package/lib/image-preview.js +325 -0
  22. package/lib/index.js +1 -0
  23. package/lib/list.js +315 -0
  24. package/lib/loading.js +279 -0
  25. package/lib/nav-bar.js +283 -0
  26. package/lib/pagination.js +323 -0
  27. package/lib/picker.js +2714 -0
  28. package/lib/popover.js +306 -0
  29. package/lib/popup.js +297 -0
  30. package/lib/radio.js +2137 -0
  31. package/lib/rate.js +300 -0
  32. package/lib/search.js +316 -0
  33. package/lib/selector.js +3496 -0
  34. package/lib/skeleton.js +277 -0
  35. package/lib/stepper.js +300 -0
  36. package/lib/switch.js +304 -0
  37. package/lib/tab.js +274 -0
  38. package/lib/table-column.js +2991 -0
  39. package/lib/table.js +2652 -0
  40. package/lib/tabs.js +315 -0
  41. package/lib/tag.js +281 -0
  42. package/lib/theme-chalk/action-sheet.css +0 -0
  43. package/lib/theme-chalk/base.css +1 -0
  44. package/lib/theme-chalk/button-group.css +1 -0
  45. package/lib/theme-chalk/button.css +1 -0
  46. package/lib/theme-chalk/calendar.css +1 -0
  47. package/lib/theme-chalk/cascader.css +1 -0
  48. package/lib/theme-chalk/cell.css +1 -0
  49. package/lib/theme-chalk/checkbox.css +1 -0
  50. package/lib/theme-chalk/circle.css +1 -0
  51. package/lib/theme-chalk/count-down.css +0 -0
  52. package/lib/theme-chalk/date.css +0 -0
  53. package/lib/theme-chalk/empty.css +0 -0
  54. package/lib/theme-chalk/field.css +1 -0
  55. package/lib/theme-chalk/flow.css +1 -0
  56. package/lib/theme-chalk/fonts/iconfont.scss +530 -0
  57. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  58. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  59. package/lib/theme-chalk/form.css +0 -0
  60. package/lib/theme-chalk/grid-item.css +1 -0
  61. package/lib/theme-chalk/grid.css +0 -0
  62. package/lib/theme-chalk/icon.css +1 -0
  63. package/lib/theme-chalk/image-preview.css +0 -0
  64. package/lib/theme-chalk/index.css +1 -0
  65. package/lib/theme-chalk/list.css +0 -0
  66. package/lib/theme-chalk/loading.css +0 -0
  67. package/lib/theme-chalk/nav-bar.css +0 -0
  68. package/lib/theme-chalk/navbar.css +1 -0
  69. package/lib/theme-chalk/pagination.css +1 -0
  70. package/lib/theme-chalk/picker.css +1 -0
  71. package/lib/theme-chalk/popover.css +0 -0
  72. package/lib/theme-chalk/popup.css +0 -0
  73. package/lib/theme-chalk/radio.css +1 -0
  74. package/lib/theme-chalk/rate.css +0 -0
  75. package/lib/theme-chalk/search.css +0 -0
  76. package/lib/theme-chalk/selector.css +1 -0
  77. package/lib/theme-chalk/skeleton.css +0 -0
  78. package/lib/theme-chalk/stepper.css +1 -0
  79. package/lib/theme-chalk/switch.css +1 -0
  80. package/lib/theme-chalk/tab.css +0 -0
  81. package/lib/theme-chalk/table-column.css +0 -0
  82. package/lib/theme-chalk/table.css +1 -0
  83. package/lib/theme-chalk/tabs.css +1 -0
  84. package/lib/theme-chalk/tag.css +1 -0
  85. package/lib/theme-chalk/theme.css +0 -0
  86. package/lib/theme-chalk/tree.css +1 -0
  87. package/lib/theme-chalk/uploader.css +0 -0
  88. package/lib/uploader.js +307 -0
  89. package/lib/utils/axios.js +199 -0
  90. package/lib/utils/date-util.js +320 -0
  91. package/lib/utils/http.js +74 -0
  92. package/lib/utils/rules.js +21 -0
  93. package/lib/utils/store.js +24 -0
  94. package/lib/utils/util.js +1315 -0
  95. package/package.json +153 -0
  96. package/packages/action-sheet/index.js +5 -0
  97. package/packages/action-sheet/src/main.vue +32 -0
  98. package/packages/button/index.js +5 -0
  99. package/packages/button/src/main.vue +15 -0
  100. package/packages/button-group/index.js +5 -0
  101. package/packages/button-group/src/main.vue +80 -0
  102. package/packages/calendar/index.js +5 -0
  103. package/packages/calendar/src/main.vue +34 -0
  104. package/packages/cascader/index.js +5 -0
  105. package/packages/cascader/src/main.vue +40 -0
  106. package/packages/cell/index.js +5 -0
  107. package/packages/cell/src/main.vue +72 -0
  108. package/packages/checkbox/index.js +5 -0
  109. package/packages/checkbox/src/main.vue +149 -0
  110. package/packages/circle/index.js +5 -0
  111. package/packages/circle/src/main.vue +27 -0
  112. package/packages/count-down/index.js +5 -0
  113. package/packages/count-down/src/main.vue +27 -0
  114. package/packages/date/index.js +5 -0
  115. package/packages/date/src/date-time.vue +290 -0
  116. package/packages/date/src/main.vue +319 -0
  117. package/packages/empty/index.js +5 -0
  118. package/packages/empty/src/main.vue +16 -0
  119. package/packages/field/index.js +5 -0
  120. package/packages/field/src/main.vue +130 -0
  121. package/packages/flow/index.js +5 -0
  122. package/packages/flow/src/components/Handle.vue +1031 -0
  123. package/packages/flow/src/components/Message.vue +96 -0
  124. package/packages/flow/src/components/Opinion.vue +112 -0
  125. package/packages/flow/src/components/Reject.vue +202 -0
  126. package/packages/flow/src/components/StartFlow.vue +440 -0
  127. package/packages/flow/src/components/TaskRead.vue +237 -0
  128. package/packages/flow/src/main.vue +43 -0
  129. package/packages/form/index.js +5 -0
  130. package/packages/form/src/main.vue +158 -0
  131. package/packages/grid/index.js +5 -0
  132. package/packages/grid/src/main.vue +28 -0
  133. package/packages/grid-item/index.js +5 -0
  134. package/packages/grid-item/src/main.vue +16 -0
  135. package/packages/image-preview/index.js +5 -0
  136. package/packages/image-preview/src/main.vue +34 -0
  137. package/packages/list/index.js +5 -0
  138. package/packages/list/src/main.vue +32 -0
  139. package/packages/loading/index.js +5 -0
  140. package/packages/loading/src/main.vue +20 -0
  141. package/packages/nav-bar/index.js +5 -0
  142. package/packages/nav-bar/src/main.vue +16 -0
  143. package/packages/pagination/index.js +5 -0
  144. package/packages/pagination/src/main.vue +29 -0
  145. package/packages/picker/index.js +5 -0
  146. package/packages/picker/src/main.vue +500 -0
  147. package/packages/popover/index.js +5 -0
  148. package/packages/popover/src/main.vue +32 -0
  149. package/packages/popup/index.js +5 -0
  150. package/packages/popup/src/main.vue +27 -0
  151. package/packages/radio/index.js +5 -0
  152. package/packages/radio/src/main.vue +147 -0
  153. package/packages/rate/index.js +5 -0
  154. package/packages/rate/src/main.vue +27 -0
  155. package/packages/search/index.js +5 -0
  156. package/packages/search/src/main.vue +39 -0
  157. package/packages/selector/index.js +5 -0
  158. package/packages/selector/src/main.vue +77 -0
  159. package/packages/selector/src/selector-field.vue +225 -0
  160. package/packages/selector/src/selector-tree.vue +472 -0
  161. package/packages/selector/src/tree.vue +179 -0
  162. package/packages/skeleton/index.js +5 -0
  163. package/packages/skeleton/src/main.vue +17 -0
  164. package/packages/stepper/index.js +5 -0
  165. package/packages/stepper/src/main.vue +25 -0
  166. package/packages/switch/index.js +5 -0
  167. package/packages/switch/src/main.vue +29 -0
  168. package/packages/tab/index.js +5 -0
  169. package/packages/tab/src/main.vue +16 -0
  170. package/packages/table/index.js +5 -0
  171. package/packages/table/src/main.vue +830 -0
  172. package/packages/table-column/index.js +5 -0
  173. package/packages/table-column/src/main.vue +742 -0
  174. package/packages/table-column/src/mixins/table.js +12 -0
  175. package/packages/tabs/index.js +5 -0
  176. package/packages/tabs/src/main.vue +34 -0
  177. package/packages/tag/index.js +5 -0
  178. package/packages/tag/src/main.vue +16 -0
  179. package/packages/theme-chalk/README.md +33 -0
  180. package/packages/theme-chalk/lib/action-sheet.css +0 -0
  181. package/packages/theme-chalk/lib/base.css +1 -0
  182. package/packages/theme-chalk/lib/button-group.css +1 -0
  183. package/packages/theme-chalk/lib/button.css +1 -0
  184. package/packages/theme-chalk/lib/calendar.css +1 -0
  185. package/packages/theme-chalk/lib/cascader.css +1 -0
  186. package/packages/theme-chalk/lib/cell.css +1 -0
  187. package/packages/theme-chalk/lib/checkbox.css +1 -0
  188. package/packages/theme-chalk/lib/circle.css +1 -0
  189. package/packages/theme-chalk/lib/count-down.css +0 -0
  190. package/packages/theme-chalk/lib/date.css +0 -0
  191. package/packages/theme-chalk/lib/empty.css +0 -0
  192. package/packages/theme-chalk/lib/field.css +1 -0
  193. package/packages/theme-chalk/lib/flow.css +1 -0
  194. package/packages/theme-chalk/lib/fonts/iconfont.scss +530 -0
  195. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  196. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  197. package/packages/theme-chalk/lib/form.css +0 -0
  198. package/packages/theme-chalk/lib/grid-item.css +1 -0
  199. package/packages/theme-chalk/lib/grid.css +0 -0
  200. package/packages/theme-chalk/lib/icon.css +1 -0
  201. package/packages/theme-chalk/lib/image-preview.css +0 -0
  202. package/packages/theme-chalk/lib/index.css +1 -0
  203. package/packages/theme-chalk/lib/list.css +0 -0
  204. package/packages/theme-chalk/lib/loading.css +0 -0
  205. package/packages/theme-chalk/lib/nav-bar.css +0 -0
  206. package/packages/theme-chalk/lib/navbar.css +1 -0
  207. package/packages/theme-chalk/lib/pagination.css +1 -0
  208. package/packages/theme-chalk/lib/picker.css +1 -0
  209. package/packages/theme-chalk/lib/popover.css +0 -0
  210. package/packages/theme-chalk/lib/popup.css +0 -0
  211. package/packages/theme-chalk/lib/radio.css +1 -0
  212. package/packages/theme-chalk/lib/rate.css +0 -0
  213. package/packages/theme-chalk/lib/search.css +0 -0
  214. package/packages/theme-chalk/lib/selector.css +1 -0
  215. package/packages/theme-chalk/lib/skeleton.css +0 -0
  216. package/packages/theme-chalk/lib/stepper.css +1 -0
  217. package/packages/theme-chalk/lib/switch.css +1 -0
  218. package/packages/theme-chalk/lib/tab.css +0 -0
  219. package/packages/theme-chalk/lib/table-column.css +0 -0
  220. package/packages/theme-chalk/lib/table.css +1 -0
  221. package/packages/theme-chalk/lib/tabs.css +1 -0
  222. package/packages/theme-chalk/lib/tag.css +1 -0
  223. package/packages/theme-chalk/lib/theme.css +0 -0
  224. package/packages/theme-chalk/lib/tree.css +1 -0
  225. package/packages/theme-chalk/lib/uploader.css +0 -0
  226. package/packages/theme-chalk/package.json +35 -0
  227. package/packages/theme-chalk/src/action-sheet.scss +0 -0
  228. package/packages/theme-chalk/src/base.scss +182 -0
  229. package/packages/theme-chalk/src/button-group.scss +26 -0
  230. package/packages/theme-chalk/src/button.scss +3 -0
  231. package/packages/theme-chalk/src/calendar.scss +12 -0
  232. package/packages/theme-chalk/src/cascader.scss +12 -0
  233. package/packages/theme-chalk/src/cell.scss +14 -0
  234. package/packages/theme-chalk/src/checkbox.scss +10 -0
  235. package/packages/theme-chalk/src/circle.scss +7 -0
  236. package/packages/theme-chalk/src/common/var.scss +1525 -0
  237. package/packages/theme-chalk/src/count-down.scss +0 -0
  238. package/packages/theme-chalk/src/date.scss +0 -0
  239. package/packages/theme-chalk/src/empty.scss +0 -0
  240. package/packages/theme-chalk/src/field.scss +28 -0
  241. package/packages/theme-chalk/src/flow.scss +542 -0
  242. package/packages/theme-chalk/src/fonts/iconfont.scss +530 -0
  243. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  244. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  245. package/packages/theme-chalk/src/form.scss +15 -0
  246. package/packages/theme-chalk/src/grid-item.scss +8 -0
  247. package/packages/theme-chalk/src/grid.scss +0 -0
  248. package/packages/theme-chalk/src/icon.scss +1661 -0
  249. package/packages/theme-chalk/src/image-preview.scss +0 -0
  250. package/packages/theme-chalk/src/index.scss +38 -0
  251. package/packages/theme-chalk/src/list.scss +0 -0
  252. package/packages/theme-chalk/src/loading.scss +0 -0
  253. package/packages/theme-chalk/src/mixins/color.scss +117 -0
  254. package/packages/theme-chalk/src/mixins/mixins.scss +25 -0
  255. package/packages/theme-chalk/src/nav-bar.scss +0 -0
  256. package/packages/theme-chalk/src/navbar.scss +6 -0
  257. package/packages/theme-chalk/src/pagination.scss +10 -0
  258. package/packages/theme-chalk/src/picker.scss +27 -0
  259. package/packages/theme-chalk/src/popover.scss +0 -0
  260. package/packages/theme-chalk/src/popup.scss +0 -0
  261. package/packages/theme-chalk/src/radio.scss +7 -0
  262. package/packages/theme-chalk/src/rate.scss +0 -0
  263. package/packages/theme-chalk/src/search.scss +0 -0
  264. package/packages/theme-chalk/src/selector.scss +218 -0
  265. package/packages/theme-chalk/src/skeleton.scss +0 -0
  266. package/packages/theme-chalk/src/stepper.scss +10 -0
  267. package/packages/theme-chalk/src/switch.scss +6 -0
  268. package/packages/theme-chalk/src/tab.scss +0 -0
  269. package/packages/theme-chalk/src/table-column.scss +0 -0
  270. package/packages/theme-chalk/src/table.scss +42 -0
  271. package/packages/theme-chalk/src/tabs.scss +21 -0
  272. package/packages/theme-chalk/src/tag.scss +13 -0
  273. package/packages/theme-chalk/src/theme.scss +2 -0
  274. package/packages/theme-chalk/src/tree.scss +115 -0
  275. package/packages/theme-chalk/src/uploader.scss +0 -0
  276. package/packages/uploader/index.js +5 -0
  277. package/packages/uploader/src/main.vue +31 -0
  278. package/src/config/api.js +29 -0
  279. package/src/index.js +130 -0
  280. package/src/utils/axios.js +198 -0
  281. package/src/utils/date-util.js +312 -0
  282. package/src/utils/http.js +66 -0
  283. package/src/utils/rules.js +18 -0
  284. package/src/utils/store.js +21 -0
  285. package/src/utils/util.js +1346 -0
@@ -0,0 +1,500 @@
1
+ <template>
2
+ <div class="em-picker">
3
+ <em-input
4
+ v-if="!isCheck"
5
+ readonly
6
+ clickable
7
+ v-bind="$attrs"
8
+ :label="label"
9
+ :value="pickerValue"
10
+ :required="required"
11
+ :label-width="labelWidth"
12
+ :disabled="disabled"
13
+ :hideLabel="hideLabel"
14
+ @click="handlePicker"
15
+ >
16
+ <!-- :placeholder="disabled ? '暂无数据' : placeholder" -->
17
+ <template slot="input">
18
+ <span :style="`color:${!pickerValue ? 'rgb(150, 151, 153)' : ''}`">{{
19
+ pickerValue
20
+ ? pickerValue
21
+ : disabled
22
+ ? '暂无数据'
23
+ : placeholder
24
+ ? placeholder
25
+ : `请选择${label}`
26
+ }}</span>
27
+ </template>
28
+ </em-input>
29
+ <em-input
30
+ v-else
31
+ readonly
32
+ clickable
33
+ :label="label"
34
+ :required="required"
35
+ :disabled="disabled"
36
+ :label-width="labelWidth"
37
+ :hideLabel="hideLabel"
38
+ @click="handlePicker"
39
+ >
40
+ <template slot="input">
41
+ <div style="width:100%">
42
+ <slot name="textTop"></slot>
43
+ <div v-if="pickerValue.length > 0">
44
+ <em-tag
45
+ v-for="(r, i) in pickerValue"
46
+ :closeable="!disabled"
47
+ type="primary"
48
+ :key="i"
49
+ @click.stop="handleClick(r)"
50
+ @close="deleteList(i, r)"
51
+ >{{ r[labelKey] || r.name }}</em-tag
52
+ >
53
+ </div>
54
+ <div v-else style="color:#969799">
55
+ {{
56
+ disabled
57
+ ? ' 暂无数据'
58
+ : !placeholder
59
+ ? '请选择' + label
60
+ : placeholder
61
+ }}
62
+ </div>
63
+ </div>
64
+ </template>
65
+ </em-input>
66
+ <van-popup v-model="showPicker" round position="bottom">
67
+ <van-picker
68
+ v-if="!isCheck"
69
+ show-toolbar
70
+ :loading="newLoading"
71
+ :columns="newColumns"
72
+ v-bind="$attrs"
73
+ v-on="$listeners"
74
+ :valueKey="labelKey"
75
+ :defaultIndex="newDefaultIndex"
76
+ @cancel="showPicker = false"
77
+ @confirm="onConfirm($event, true)"
78
+ >
79
+ <template v-for="(index, name) in $slots" :slot="name">
80
+ <slot :name="name" />
81
+ </template>
82
+ </van-picker>
83
+ <van-picker
84
+ v-else
85
+ show-toolbar
86
+ class="check-picker"
87
+ :loading="newLoading"
88
+ :columns="newColumns"
89
+ v-bind="$attrs"
90
+ v-on="$listeners"
91
+ :valueKey="labelKey"
92
+ :defaultIndex="newDefaultIndex"
93
+ @cancel="onConfirm"
94
+ @confirm="onConfirm($event, true)"
95
+ >
96
+ <template slot="columns-top">
97
+ <div class="em-picker__columns">
98
+ <em-list
99
+ v-model="listLoading"
100
+ :finished="listFinished"
101
+ :finished-text="sysAppCode || url ? '没有更多了' : ''"
102
+ @load="onLoad"
103
+ :offset="50"
104
+ >
105
+ <van-checkbox-group v-model="checkList">
106
+ <em-cell
107
+ v-for="(item, index) in newColumns"
108
+ clickable
109
+ :key="item[valueKey]"
110
+ :isGroup="false"
111
+ :title="item[labelKey]"
112
+ @click="toggle(index)"
113
+ >
114
+ <template #right-icon>
115
+ <van-checkbox :name="item[valueKey]" ref="checkboxes" />
116
+ </template>
117
+ </em-cell>
118
+ </van-checkbox-group>
119
+ </em-list>
120
+ </div>
121
+ </template>
122
+ </van-picker>
123
+ </van-popup>
124
+ </div>
125
+ </template>
126
+
127
+ <script>
128
+ import { findSysCode } from '../../../src/config/api';
129
+ import request from '../../../src/utils/http.js';
130
+ export default {
131
+ name: 'EmPicker',
132
+ inheritAttrs: false,
133
+ data() {
134
+ return {
135
+ showPicker: false,
136
+ newLoading: false,
137
+ newLabelKey: '',
138
+ newValueKey: '',
139
+ listLoading: false,
140
+ listFinished: false,
141
+ newColumns: [],
142
+ checkList: [],
143
+ newDefaultIndex: 0,
144
+ pageIndex: 1,
145
+ total: -1
146
+ };
147
+ },
148
+ props: {
149
+ // 绑定值
150
+ value: {
151
+ type: [String, Array, Object],
152
+ default: ''
153
+ },
154
+ hideLabel: {
155
+ type: Boolean,
156
+ default: false
157
+ },
158
+ isCheck: {
159
+ type: Boolean,
160
+ default: false
161
+ },
162
+ required: {
163
+ type: Boolean,
164
+ default: false
165
+ },
166
+ disabled: {
167
+ type: Boolean,
168
+ default: false
169
+ },
170
+ // 展示标题
171
+ label: {
172
+ type: String,
173
+ default: '城市'
174
+ },
175
+ // 输入框占位提示文字
176
+ placeholder: {
177
+ type: String,
178
+ default: undefined
179
+ },
180
+ // 多级选择展示拼接字符
181
+ joinStr: {
182
+ type: String,
183
+ default: '/'
184
+ },
185
+ valueKey: {
186
+ type: String,
187
+ default: 'value'
188
+ },
189
+ labelKey: {
190
+ type: String,
191
+ default: 'name'
192
+ },
193
+ sysAppCode: {
194
+ type: String,
195
+ default: ''
196
+ },
197
+ resultsName: {
198
+ type: String,
199
+ default: ''
200
+ },
201
+ method: {
202
+ type: String,
203
+ default: 'get'
204
+ },
205
+ url: {
206
+ type: String
207
+ },
208
+ param: {
209
+ type: Object,
210
+ default: () => {}
211
+ },
212
+ columns: {
213
+ type: Array,
214
+ default: () => []
215
+ },
216
+ loading: {
217
+ type: Boolean,
218
+ default: false
219
+ },
220
+ defaultIndex: {
221
+ type: [Number, String]
222
+ },
223
+ labelWidth: {
224
+ type: [Number, String],
225
+ default: '4em'
226
+ },
227
+ isTable: {
228
+ type: Boolean,
229
+ default: false
230
+ }
231
+ },
232
+ computed: {
233
+ pickerValue: {
234
+ get() {
235
+ return this.getValue();
236
+ },
237
+ set(val) {
238
+ this.$emit('input', val);
239
+ }
240
+ }
241
+ },
242
+ watch: {
243
+ labelKey: {
244
+ handler(val) {
245
+ this.newLabelKey = val;
246
+ },
247
+ deep: true,
248
+ immediate: true
249
+ },
250
+ valueKey: {
251
+ handler(val) {
252
+ this.newValueKey = val;
253
+ },
254
+ deep: true,
255
+ immediate: true
256
+ },
257
+ columns: {
258
+ handler(val) {
259
+ if(this.sysAppCode) return
260
+ this.newColumns = val;
261
+ },
262
+ deep: true,
263
+ immediate: true
264
+ },
265
+ defaultIndex: {
266
+ handler(val) {
267
+ this.newDefaultIndex = val;
268
+ },
269
+ deep: true,
270
+ immediate: true
271
+ },
272
+ loading: {
273
+ handler(val) {
274
+ this.newLoading = val;
275
+ },
276
+ deep: true,
277
+ immediate: true
278
+ }
279
+ },
280
+ mounted() {
281
+ if (
282
+ (this.sysAppCode || this.url) &&
283
+ this.newColumns.length == 0 &&
284
+ !this.isCheck
285
+ ) {
286
+ this.getSysCode();
287
+ }
288
+ if (this.defaultIndex != undefined) {
289
+ let data = this.columns[this.defaultIndex];
290
+ if (typeof data === 'string' && data) {
291
+ this.pickerValue = data;
292
+ } else if (typeof data === 'object') {
293
+ this.pickerValue = data[this.newValueKey];
294
+ }
295
+ } else if (this.isCheck) {
296
+ let data = this.value;
297
+ data.map(item => {
298
+ this.checkList.push(item[this.valueKey] || item.value || item);
299
+ });
300
+ }
301
+ },
302
+ methods: {
303
+ handleClick(val) {
304
+ this.$emit('tagClick', val);
305
+ },
306
+ onLoad() {
307
+ if (
308
+ (this.sysAppCode || this.url) &&
309
+ this.newColumns.length != this.total &&
310
+ this.isCheck
311
+ ) {
312
+ this.getSysCode();
313
+ } else {
314
+ this.listFinished = true;
315
+ }
316
+ },
317
+ /**
318
+ * deleteList
319
+ * @desc:删除选中的数据
320
+ * @date 2023年4月20日
321
+ * @author liufan
322
+ * @param {String} val 当前数据的下标
323
+ */
324
+ deleteList(val, res) {
325
+ if (this.disabled) return;
326
+ this.pickerValue.splice(val, 1);
327
+ this.checkList = this.checkList.filter(x => x != res.value);
328
+ this.$emit('input', this.pickerValue);
329
+ this.$emit('tagDelete', this.pickerValue);
330
+ },
331
+ toggle(index) {
332
+ this.$refs.checkboxes[index].toggle();
333
+ },
334
+ onConfirm(value, isConfirm) {
335
+ if (isConfirm) {
336
+ if (this.isCheck) {
337
+ let data = [];
338
+ this.newColumns.filter(x => {
339
+ this.checkList.find(y => {
340
+ if (x.value === y) {
341
+ data.push(x);
342
+ }
343
+ });
344
+ });
345
+ this.pickerValue = data;
346
+ } else {
347
+ this.pickerValue = value;
348
+ }
349
+ } else {
350
+ this.checkList = [];
351
+ this.pickerValue.map(x => {
352
+ this.checkList.push(x.value);
353
+ });
354
+ }
355
+
356
+ this.showPicker = false;
357
+ },
358
+ getValue() {
359
+ let value = '';
360
+ if (this.isCheck) {
361
+ let val = [];
362
+ if (this.newColumns && this.newColumns.length > 0) {
363
+ this.newColumns.filter(x => {
364
+ this.value.find(y => {
365
+ if (x[this.valueKey] == y || x[this.valueKey] == y.value) {
366
+ val.push(x);
367
+ }
368
+ });
369
+ });
370
+ } else {
371
+ val = this.value;
372
+ }
373
+ value = val;
374
+ } else {
375
+ if (Array.isArray(this.value) || this.value instanceof Object) {
376
+ if (!Array.isArray(this.value)) {
377
+ value = this.value[this.labelKey] || this.value[this.newValueKey];
378
+ let index = 0;
379
+ value && (value = value.replace(/<[^>]+>/g, ''));
380
+ this.newColumns.map((x, i) => {
381
+ if (typeof x === 'string' && value.indexOf(x) != -1) {
382
+ index = i;
383
+ } else if (
384
+ x[this.newValueKey] == value ||
385
+ x[this.newValueKey].indexOf(value) != -1
386
+ ) {
387
+ index = i;
388
+ }
389
+ });
390
+ this.newDefaultIndex = index;
391
+ } else {
392
+ let list = [];
393
+ this.value.map(item => {
394
+ if (item[this.labelKey] || item[this.newValueKey]) {
395
+ list.push(item[this.labelKey] || item[this.newValueKey]);
396
+ } else if (typeof item === 'string') {
397
+ list.push(item);
398
+ }
399
+ });
400
+ value = list.join(this.joinStr);
401
+ let index = 0;
402
+ this.newColumns.map((x, i) => {
403
+ if (typeof x === 'string' && value.indexOf(x) != -1) {
404
+ index = i;
405
+ } else if (x[this.newValueKey] === value) {
406
+ index = i;
407
+ }
408
+ });
409
+ this.newDefaultIndex = index;
410
+ }
411
+ } else {
412
+ let index = 0;
413
+ value = this.value;
414
+ this.newColumns.map((x, i) => {
415
+ if (typeof x === 'string' && value.indexOf(x) != -1) {
416
+ index = i;
417
+ value = x;
418
+ } else if (x[this.newValueKey] === value) {
419
+ index = i;
420
+ value = x[this.labelKey] || x[this.newValueKey];
421
+ }
422
+ });
423
+ this.newDefaultIndex = index;
424
+ }
425
+ value && (value = value.replace(/<[^>]+>/g, ''));
426
+ }
427
+ return value;
428
+ },
429
+ getSysCode() {
430
+ const { url, method, sysAppCode, param } = this;
431
+ let params = {
432
+ url: url || findSysCode,
433
+ type: method,
434
+ params: {
435
+ sysAppCode,
436
+ pageIndex: this.pageIndex,
437
+ ...param
438
+ }
439
+ };
440
+ this.newLoading = true;
441
+ request(params)
442
+ .then(res => {
443
+ const { rCode, results, msg } = res;
444
+ this.listLoading = false;
445
+ if (rCode == 0) {
446
+ let info = this.resultsName ? results[this.resultsName] : results;
447
+ info.map(x => {
448
+ if (this.isCheck) {
449
+ x.name =
450
+ x[
451
+ (this.labelKey != 'name' && this.labelKey) || 'shortName'
452
+ ] &&
453
+ x[
454
+ (this.labelKey != 'name' && this.labelKey) || 'shortName'
455
+ ].replace(/<[^>]+>/g, '');
456
+ } else {
457
+ x.name =
458
+ x[(this.labelKey != 'name' && this.labelKey) || 'shortName'];
459
+ }
460
+ x.value =
461
+ x[(this.valueKey != 'value' && this.valueKey) || 'cciValue'];
462
+ });
463
+ if (results.totalCount) {
464
+ this.total = results.totalCount;
465
+ if (results.totalCount === this.newColumns.length) {
466
+ this.listFinished = true;
467
+ } else {
468
+ if (this.newColumns.length != 0) {
469
+ this.newColumns.push.apply(this.newColumns, info);
470
+ } else {
471
+ this.newColumns = info;
472
+ }
473
+ this.pageIndex = res.results.nextPageNo;
474
+ }
475
+ } else {
476
+ this.listFinished = true;
477
+ this.newColumns = info;
478
+ }
479
+ if (this.isTable) this.$emit('tableColumns', this.newColumns);
480
+ this.getValue();
481
+ } else {
482
+ this.$toast(msg);
483
+ }
484
+ this.newLoading = false;
485
+ })
486
+ .catch(err => {
487
+ this.$toast(err.message);
488
+ });
489
+ },
490
+ handlePicker() {
491
+ if (this.disabled) return;
492
+ this.showPicker = true;
493
+
494
+ this.$emit('showPicker');
495
+ }
496
+ }
497
+ };
498
+ </script>
499
+
500
+ <style></style>
@@ -0,0 +1,5 @@
1
+ import EmPopover from './src/main';
2
+
3
+ EmPopover.install = Vue => Vue.component(EmPopover.name, EmPopover);
4
+
5
+ export default EmPopover;
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <van-popover
3
+ v-model="newValue"
4
+ v-bind="$attrs"
5
+ v-on="$listeners"
6
+ >
7
+ <template v-for="(index, name) in $slots" :slot="name">
8
+ <slot :name="name" />
9
+ </template>
10
+ </van-popover>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'EmPopover',
16
+ props:{
17
+ value:Boolean
18
+ },
19
+ computed:{
20
+ newValue:{
21
+ get(){
22
+ return this.value
23
+ },
24
+ set(val){
25
+ return val
26
+ }
27
+ }
28
+ }
29
+ };
30
+ </script>
31
+
32
+ <style></style>
@@ -0,0 +1,5 @@
1
+ import EmPopup from './src/main';
2
+
3
+ EmPopup.install = Vue => Vue.component(EmPopup.name, EmPopup);
4
+
5
+ export default EmPopup;
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <van-popup v-model="newValue" v-bind="$attrs" v-on="$listeners" >
3
+ <template>
4
+ <slot name="default" />
5
+ </template>
6
+ </van-popup>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ name: 'EmPopup',
12
+ inheritAttrs: false,
13
+ props: {
14
+ value: Boolean
15
+ },
16
+ computed: {
17
+ newValue: {
18
+ get() {
19
+ return this.value;
20
+ },
21
+ set(val) {}
22
+ }
23
+ }
24
+ };
25
+ </script>
26
+
27
+ <style></style>
@@ -0,0 +1,5 @@
1
+ import EmRadioGroup from './src/main';
2
+
3
+ EmRadioGroup.install = Vue => Vue.component(EmRadioGroup.name, EmRadioGroup);
4
+
5
+ export default EmRadioGroup;