web-component-gallery 1.3.12 → 2.0.2

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 (218) hide show
  1. package/dist/923.umd.js +1 -0
  2. package/dist/index.umd.js +1 -12252
  3. package/dist/js.umd.js +1 -0
  4. package/dist/style.css +17 -0
  5. package/dist/style.umd.js +1 -0
  6. package/{method → extensions}/AMap.js +1 -5
  7. package/{plugins/method → extensions}/Dialog.js +2 -2
  8. package/{lib/lazy_use.js → extensions/index.js} +16 -2
  9. package/lib/{amap/components/AmapSearch/index.jsx → amap-comp/AmapSearch.jsx} +3 -5
  10. package/lib/amap-comp/index.js +18 -0
  11. package/{plugins/lib/amap/components/AmapSearch/index.less → lib/amap-comp/style/AmapSearch.less} +5 -3
  12. package/lib/amap-comp/style/index.js +1 -0
  13. package/lib/amap-comp/style/index.less +1 -0
  14. package/lib/{amap/AmapDraw.jsx → amap-draw/index.jsx} +2 -4
  15. package/lib/amap-draw/style/index.js +1 -0
  16. package/lib/{amap/AmapDraw.less → amap-draw/style/index.less} +6 -3
  17. package/lib/browse/index.jsx +0 -2
  18. package/lib/browse/style/index.js +1 -0
  19. package/lib/button/Button.js +1 -3
  20. package/lib/button/style/index.js +1 -0
  21. package/{plugins/lib/dateTime → lib/date-time}/index.vue +3 -13
  22. package/lib/date-time/style/index.js +1 -0
  23. package/lib/date-time/style/index.less +7 -0
  24. package/lib/{descriptions → descriptions-list}/index.jsx +1 -3
  25. package/lib/descriptions-list/style/index.js +1 -0
  26. package/{plugins/lib/tree → lib/directory}/Directory.js +4 -21
  27. package/lib/directory/index.js +8 -0
  28. package/lib/directory/style/index.js +1 -0
  29. package/lib/{tree/style/Directory.less → directory/style/index.less} +3 -4
  30. package/{plugins/lib/form/components → lib/form-comp}/ACascaderMultiple.vue +1 -106
  31. package/lib/form-comp/ARadio.vue +70 -0
  32. package/lib/{form/components → form-comp}/ARangePicker.vue +9 -20
  33. package/lib/{form/components → form-comp}/ASelectCustom.vue +1 -8
  34. package/lib/form-comp/ATagsInput.vue +88 -0
  35. package/lib/form-comp/ATimePicker.vue +127 -0
  36. package/lib/{form/components → form-comp}/AUpload.vue +2 -17
  37. package/lib/form-comp/index.js +37 -0
  38. package/lib/form-comp/style/ACascaderMultiple.less +117 -0
  39. package/lib/form-comp/style/ARadio.less +0 -0
  40. package/lib/form-comp/style/ARangePicker.less +11 -0
  41. package/lib/form-comp/style/ASelectCustom.less +4 -0
  42. package/lib/form-comp/style/ATagsInput.less +24 -0
  43. package/lib/form-comp/style/ATimePicker.less +8 -0
  44. package/lib/form-comp/style/AUpload.less +15 -0
  45. package/lib/form-comp/style/index.js +1 -0
  46. package/lib/form-comp/style/index.less +7 -0
  47. package/lib/index.js +60 -45
  48. package/lib/modal/index.jsx +4 -6
  49. package/lib/modal/style/index.js +1 -0
  50. package/lib/modal/{index.less → style/index.less} +6 -7
  51. package/{plugins/lib/form → lib/model}/Model.js +1 -3
  52. package/lib/model/index.js +7 -0
  53. package/lib/model/style/index.js +1 -0
  54. package/lib/{form/style/Model.less → model/style/index.less} +10 -10
  55. package/{plugins/lib/form → lib/model}/utils/render.js +1 -1
  56. package/lib/{form → model}/utils/resetFields.js +1 -1
  57. package/lib/no-data/directive.js +65 -0
  58. package/lib/no-data/index.js +21 -0
  59. package/lib/no-data/index.vue +35 -0
  60. package/lib/no-data/style/index.js +1 -0
  61. package/lib/no-data/style/index.less +15 -0
  62. package/lib/search/index.js +7 -0
  63. package/{plugins/lib/form/Search.vue → lib/search/index.vue} +3 -6
  64. package/lib/search/style/index.js +1 -0
  65. package/{plugins/lib/form/style/Search.less → lib/search/style/index.less} +7 -8
  66. package/lib/style/mixins.less +1 -1
  67. package/lib/{svgIcon → svg-icon}/index.vue +1 -17
  68. package/lib/svg-icon/style/index.js +1 -0
  69. package/lib/svg-icon/style/index.less +15 -0
  70. package/lib/table/index.vue +4 -8
  71. package/lib/table/style/index.js +1 -0
  72. package/lib/table/style/index.less +12 -13
  73. package/lib/tree/index.js +2 -11
  74. package/{plugins/lib/tree/Tree.vue → lib/tree/index.vue} +2 -5
  75. package/lib/tree/style/index.js +1 -0
  76. package/{plugins/lib/tree/style/Tree.less → lib/tree/style/index.less} +4 -4
  77. package/lib/weather/index.vue +1 -9
  78. package/lib/weather/style/index.js +1 -0
  79. package/lib/weather/style/index.less +7 -0
  80. package/package.json +16 -34
  81. package/utils/Axios.js +91 -82
  82. package/utils/Postcss.js +12 -8
  83. package/README.md +0 -24
  84. package/dist/amap.umd.js +0 -12252
  85. package/dist/avatar.umd.js +0 -5337
  86. package/dist/button.umd.js +0 -5845
  87. package/dist/dateTime.umd.js +0 -1287
  88. package/dist/form.umd.js +0 -9981
  89. package/dist/multiTab.umd.js +0 -5556
  90. package/dist/svgIcon.umd.js +0 -1167
  91. package/dist/table.umd.js +0 -6306
  92. package/dist/tree.umd.js +0 -5393
  93. package/dist/weather.umd.js +0 -1167
  94. package/lib/amap/components/AmapSearch/index.less +0 -16
  95. package/lib/amap/index.js +0 -13
  96. package/lib/avatar/index.js +0 -7
  97. package/lib/avatar/index.vue +0 -47
  98. package/lib/basic/404.vue +0 -24
  99. package/lib/dateTime/index.vue +0 -43
  100. package/lib/form/Model.js +0 -153
  101. package/lib/form/Search.vue +0 -159
  102. package/lib/form/components/ACascaderMultiple.vue +0 -766
  103. package/lib/form/components/ARadio.vue +0 -74
  104. package/lib/form/components/ATagsInput.vue +0 -93
  105. package/lib/form/components/ATimePicker.vue +0 -73
  106. package/lib/form/index.js +0 -55
  107. package/lib/form/style/Search.less +0 -34
  108. package/lib/form/utils/render.js +0 -85
  109. package/lib/iframe/events.js +0 -2
  110. package/lib/iframe/index.jsx +0 -234
  111. package/lib/iframe/index.less +0 -19
  112. package/lib/multiTab/APIEnums.js +0 -17
  113. package/lib/multiTab/MultiTab.jsx +0 -237
  114. package/lib/multiTab/RouteAPI.js +0 -71
  115. package/lib/multiTab/RouteContent.jsx +0 -90
  116. package/lib/multiTab/RouteKeepAlive.js +0 -183
  117. package/lib/multiTab/events.js +0 -2
  118. package/lib/multiTab/index.js +0 -15
  119. package/lib/multiTab/index.less +0 -73
  120. package/lib/style/index.less +0 -2
  121. package/lib/tree/Directory.js +0 -428
  122. package/lib/tree/Tree.vue +0 -181
  123. package/lib/tree/style/Tree.less +0 -52
  124. package/method/Dialog.js +0 -134
  125. package/method/index.js +0 -12
  126. package/plugins/lib/amap/AmapDraw.jsx +0 -349
  127. package/plugins/lib/amap/AmapDraw.less +0 -45
  128. package/plugins/lib/amap/components/AmapSearch/index.jsx +0 -73
  129. package/plugins/lib/amap/index.js +0 -13
  130. package/plugins/lib/avatar/index.js +0 -7
  131. package/plugins/lib/avatar/index.vue +0 -47
  132. package/plugins/lib/basic/404.vue +0 -24
  133. package/plugins/lib/browse/index.jsx +0 -76
  134. package/plugins/lib/browse/index.less +0 -4
  135. package/plugins/lib/button/Button.js +0 -89
  136. package/plugins/lib/button/index.js +0 -7
  137. package/plugins/lib/dateTime/index.js +0 -7
  138. package/plugins/lib/descriptions/index.jsx +0 -108
  139. package/plugins/lib/descriptions/index.less +0 -15
  140. package/plugins/lib/form/components/ARadio.vue +0 -74
  141. package/plugins/lib/form/components/ARangePicker.vue +0 -129
  142. package/plugins/lib/form/components/ASelectCustom.vue +0 -226
  143. package/plugins/lib/form/components/ATagsInput.vue +0 -93
  144. package/plugins/lib/form/components/ATimePicker.vue +0 -73
  145. package/plugins/lib/form/components/AUpload.vue +0 -183
  146. package/plugins/lib/form/components/RenderComp.vue +0 -69
  147. package/plugins/lib/form/index.js +0 -55
  148. package/plugins/lib/form/style/Model.less +0 -53
  149. package/plugins/lib/form/utils/resetFields.js +0 -16
  150. package/plugins/lib/iframe/events.js +0 -2
  151. package/plugins/lib/iframe/index.jsx +0 -234
  152. package/plugins/lib/iframe/index.less +0 -19
  153. package/plugins/lib/index.js +0 -72
  154. package/plugins/lib/lazy_use.js +0 -40
  155. package/plugins/lib/modal/index.jsx +0 -53
  156. package/plugins/lib/modal/index.less +0 -50
  157. package/plugins/lib/multiTab/APIEnums.js +0 -17
  158. package/plugins/lib/multiTab/MultiTab.jsx +0 -237
  159. package/plugins/lib/multiTab/RouteAPI.js +0 -71
  160. package/plugins/lib/multiTab/RouteContent.jsx +0 -90
  161. package/plugins/lib/multiTab/RouteKeepAlive.js +0 -183
  162. package/plugins/lib/multiTab/events.js +0 -2
  163. package/plugins/lib/multiTab/index.js +0 -15
  164. package/plugins/lib/multiTab/index.less +0 -73
  165. package/plugins/lib/style/index.less +0 -2
  166. package/plugins/lib/style/mixins.less +0 -79
  167. package/plugins/lib/svgIcon/index.js +0 -7
  168. package/plugins/lib/svgIcon/index.vue +0 -77
  169. package/plugins/lib/table/index.js +0 -7
  170. package/plugins/lib/table/index.vue +0 -217
  171. package/plugins/lib/table/style/index.less +0 -50
  172. package/plugins/lib/tree/index.js +0 -17
  173. package/plugins/lib/tree/style/Directory.less +0 -119
  174. package/plugins/lib/weather/index.js +0 -7
  175. package/plugins/lib/weather/index.vue +0 -58
  176. package/plugins/method/AMap.js +0 -368
  177. package/plugins/method/PageLoading.jsx +0 -106
  178. package/plugins/method/Theme.js +0 -88
  179. package/plugins/method/index.js +0 -12
  180. package/plugins/store/auth.js +0 -31
  181. package/plugins/store/cache.js +0 -56
  182. package/plugins/store/chat.js +0 -74
  183. package/plugins/store/project.js +0 -46
  184. package/plugins/utils/Axios.js +0 -105
  185. package/plugins/utils/Base64.js +0 -314
  186. package/plugins/utils/Filter.js +0 -249
  187. package/plugins/utils/PostMessage.js +0 -16
  188. package/plugins/utils/Postcss.js +0 -9
  189. package/plugins/utils/Rem.js +0 -24
  190. package/plugins/utils/Request.js +0 -38
  191. package/plugins/utils/Storage.js +0 -73
  192. package/plugins/utils/Tree.js +0 -169
  193. package/plugins/utils/Utils.js +0 -51
  194. package/plugins/utils/Validate.js +0 -33
  195. package/plugins/utils/Websocket.js +0 -186
  196. package/utils/PostMessage.js +0 -16
  197. package/utils/Request.js +0 -38
  198. /package/{method → extensions}/PageLoading.jsx +0 -0
  199. /package/{method → extensions}/Theme.js +0 -0
  200. /package/{plugins/font → font}/DS-DIGI-1.ttf +0 -0
  201. /package/{plugins/font → font}/DS-DIGIB-2.ttf +0 -0
  202. /package/{plugins/font → font}/DS-DIGII-3.ttf +0 -0
  203. /package/{plugins/font → font}/DS-DIGIT-4.ttf +0 -0
  204. /package/{plugins/font → font}/Orbitron-Black.ttf +0 -0
  205. /package/{plugins/font → font}/Orbitron-Bold.ttf +0 -0
  206. /package/{plugins/font → font}/Orbitron-Medium.ttf +0 -0
  207. /package/{plugins/font → font}/Orbitron-Regular.ttf +0 -0
  208. /package/{plugins/font → font}/PANGMENZHENGDAOBIAOTITI-1.TTF +0 -0
  209. /package/{plugins/font → font}/PingFang SC.ttf +0 -0
  210. /package/{plugins/font → font}/YouSheBiaoTiHei.ttf +0 -0
  211. /package/{plugins/font → font}/font.css +0 -0
  212. /package/{plugins/font → font}//345/255/227/351/255/20235/345/217/267-/347/273/217/345/205/270/351/233/205/351/273/221.ttf" +0 -0
  213. /package/lib/browse/{index.less → style/index.less} +0 -0
  214. /package/{dist/css/index.css → lib/button/style/index.less} +0 -0
  215. /package/lib/{dateTime → date-time}/index.js +0 -0
  216. /package/lib/{descriptions → descriptions-list/style}/index.less +0 -0
  217. /package/lib/{form/components → form-comp}/RenderComp.vue +0 -0
  218. /package/lib/{svgIcon → svg-icon}/index.js +0 -0
@@ -1,74 +0,0 @@
1
-
2
- <template>
3
- <RadioGroup v-bind="attrs" v-on="$listeners" class="TAntdRadio" v-model="selectChecked">
4
- <component
5
- :is="radioType"
6
- v-for="child in $attrs.options"
7
- :key="child[valueKey]"
8
- :value="child[valueKey]"
9
- >
10
- {{ child[labelKey] }}
11
- </component>
12
- </RadioGroup>
13
- </template>
14
-
15
- <script>
16
-
17
- import { Radio } from 'ant-design-vue'
18
-
19
- export default {
20
- name: 'TAntdRadio',
21
- components: {
22
- Radio,
23
- RadioGroup: Radio.Group,
24
- RadioButton: Radio.Button
25
- },
26
- props: {
27
- value: [String, Number, Boolean],
28
- // radio类型为普通或按钮
29
- radioType: {
30
- type: String,
31
- default: 'Radio'
32
- },
33
- // 传入的option数组中,要作为最终选择项的键值key
34
- valueKey: {
35
- type: String,
36
- default: 'value'
37
- },
38
- // 传入的option数组中,要作为显示项的键值名称
39
- labelKey: {
40
- type: String,
41
- default: 'label'
42
- }
43
- },
44
- computed: {
45
- selectChecked: {
46
- get() {
47
- return this.value
48
- },
49
- set(val) {
50
- this.$emit('input', val)
51
- }
52
- },
53
- attrs() {
54
- const attrs = {
55
- ...this.$attrs
56
- }
57
- delete attrs.options
58
- return attrs
59
- }
60
- },
61
- data() {
62
- return {
63
- }
64
- },
65
- mounted() {
66
- },
67
- methods: {
68
- }
69
- }
70
- </script>
71
-
72
- <style lang="less" scoped>
73
- </style>
74
-
@@ -1,93 +0,0 @@
1
- <template>
2
- <div class="ant-input TAntdTags" v-on="$listeners">
3
- <Tooltip
4
- :key="i"
5
- :title="child[labelKey]"
6
- v-for="(child, i) in selectChecked"
7
- >
8
- <Tag
9
- closable
10
- @close="() => tagsClose(child[valueKey])"
11
- >
12
- <span>{{ child[labelKey] }}</span>
13
- </Tag>
14
- </Tooltip>
15
- <span v-if="!selectChecked.length">请点击进行选择</span>
16
- </div>
17
- </template>
18
-
19
- <script>
20
-
21
- import { Tag, Tooltip } from 'ant-design-vue'
22
-
23
- export default {
24
- name: 'TAntdTags',
25
- components: { Tag, Tooltip },
26
- model: {
27
- prop: 'value',
28
- event: 'update:tagsInput'
29
- },
30
- data() {
31
- return {}
32
- },
33
- computed: {
34
- selectChecked: {
35
- get() {
36
- return this.value
37
- },
38
- set(val) {
39
- this.$emit('update:tagsInput', val)
40
- }
41
- }
42
- },
43
-
44
- props: {
45
- value: {
46
- type: Array,
47
- default: () => {
48
- return []
49
- }
50
- },
51
- /* 传入的option数组中,要作为最终选择项的键值key */
52
- valueKey: {
53
- type: String,
54
- default: 'value'
55
- },
56
- /* 传入的option数组中,要作为显示项的键值名称 */
57
- labelKey: {
58
- type: String,
59
- default: 'label'
60
- }
61
- },
62
-
63
- methods: {
64
- tagsClose(checked) {
65
- const selectChecked =
66
- this.selectChecked.filter(node => node[this.valueKey] !== checked)
67
- this.$emit('update:tagsInput', selectChecked)
68
- }
69
- }
70
- }
71
- </script>
72
-
73
- <style lang="less" scoped>
74
- @import url('../../style/mixins.less');
75
- .TAntdTags {
76
- width: 100%;
77
- height: auto;
78
- cursor: pointer;
79
-
80
- :deep(.ant-tag) {
81
- cursor: pointer;
82
- display: inline-flex;
83
- align-items: center;
84
-
85
- span {
86
- display: inline-block;
87
- max-width: 100px;
88
- overflow-x: hidden;
89
- .ellipsis();
90
- }
91
- }
92
- }
93
- </style>
@@ -1,73 +0,0 @@
1
- <template>
2
- <div class="ATimePicker">
3
- <TimePicker
4
- :format="format"
5
- v-model="time[0]"
6
- placeholder="开始时间"
7
- :valueFormat="valueFormat"
8
- @change="e => time.splice(0, 1, e)"
9
- />
10
- <span>~</span>
11
- <TimePicker :format="format" v-model="time[1]" placeholder="结束时间" :valueFormat="valueFormat" />
12
- </div>
13
- </template>
14
-
15
- <script>
16
-
17
- import { TimePicker } from 'ant-design-vue'
18
-
19
- export default {
20
- components: {
21
- TimePicker
22
- },
23
- model: {
24
- prop: 'value',
25
- event: 'update:timePicker'
26
- },
27
- props: {
28
- value: {
29
- type: Array,
30
- default: () => {
31
- return []
32
- }
33
- },
34
- format: {
35
- type: String,
36
- default: 'HH:mm:ss'
37
- },
38
- valueFormat: {
39
- type: String,
40
- default: 'HH:mm:ss'
41
- }
42
- },
43
- watch: {
44
- value(e, o) {
45
- if (e.toString() == o.toString()) return
46
- this.time = e
47
- },
48
- 'time.length': {
49
- handler(e) {
50
- this.$emit('update:timePicker', e == 2 ? this.time : [])
51
- },
52
- deep: true
53
- }
54
- },
55
- data() {
56
- return {
57
- time: []
58
- }
59
- },
60
- created() {},
61
- methods: {}
62
- }
63
- </script>
64
- <style lang="less" scoped>
65
- @import "~ant-design-vue/es/style/themes/default";
66
- .ATimePicker {
67
- width: 100%;
68
- display: flex;
69
- align-items: center;
70
- &>span { margin: 0 @padding-xs; }
71
- :deep(.ant-time-picker) { flex: 1; }
72
- }
73
- </style>
package/lib/form/index.js DELETED
@@ -1,55 +0,0 @@
1
- /* Model新增修改表单 */
2
- import Model from './Model.js'
3
- /* Search搜索表单 */
4
- import Search from './Search.vue'
5
-
6
- Model.install = function (Vue) {
7
- Vue.component(Model.name, Model)
8
- }
9
-
10
- Search.install = function (Vue) {
11
- Vue.component(Search.name, Search)
12
- }
13
-
14
- export {
15
- Model,
16
- Search,
17
- }
18
-
19
- /* 下拉多选框(可支持树结构 */
20
- import ACascaderMultiple from './components/ACascaderMultiple.vue'
21
- /* 下拉单选及分页框 */
22
- import ASelectCustom from './components/ASelectCustom.vue'
23
- /* 单选框(可支持配置button形式 */
24
- import ARadio from './components/ARadio.vue'
25
- /* (已下需优化修改) */
26
- /* tag多项展示框(需修改 */
27
- import ATagsInput from './components/ATagsInput.vue'
28
- /* 日期选择框 */
29
- import ARangePicker from './components/ARangePicker.vue'
30
- /* 时间区间框(只单进行一天中的时间段选择 */
31
- import ATimePicker from './components/ATimePicker.vue'
32
- /* 文件上传选择器 */
33
- import AUpload from './components/AUpload.vue'
34
-
35
- const components = {
36
- ACascaderMultiple,
37
- ASelectCustom,
38
- ARadio,
39
- ATagsInput,
40
- ARangePicker,
41
- ATimePicker,
42
- AUpload
43
- }
44
-
45
- const install = function (Vue) {
46
- if (install.installed) return
47
- Object.keys(components).forEach(component => {
48
- Vue.component(components[component].name, components[component])
49
- })
50
- }
51
-
52
- export default {
53
- install,
54
- ...components
55
- }
@@ -1,34 +0,0 @@
1
- /* 混入样式 */
2
- @import url('../../style/mixins.less');
3
-
4
- .WebComponentFormSearch {
5
- gap: 16px 0;
6
- .flex-mixins(@justify: flex-start);
7
-
8
- .ant-form-item {
9
- display: inline-flex;
10
- margin-right: unset;
11
-
12
- :deep(.ant-form-item-label) {
13
- min-width: 70px;
14
- max-width: 100px;
15
- text-align: right;
16
- }
17
-
18
- :deep(.ant-form-item-control-wrapper) {
19
- flex: 1;
20
- }
21
-
22
- :deep(.ant-select),
23
- :deep(.ant-input-number),
24
- :deep(.ant-calendar-picker) {
25
- width: 100% !important;
26
- }
27
- }
28
-
29
- &__Actions {
30
- flex: 1;
31
- text-align: right;
32
- margin-right: 16px;
33
- }
34
- }
@@ -1,85 +0,0 @@
1
- import { FormModel } from 'ant-design-vue'
2
- import RenderComp from '../components/RenderComp.vue'
3
-
4
- const FormModelItem = FormModel.Item
5
-
6
- /** 根据layoutSize来进行距离及大小切分 */
7
- export function getFormWidth(child, layoutSize) {
8
- if (this.layout === 'vertical')
9
- return `flex: 0 1 calc((${(100 / layoutSize) * (child.size ?? 1)}% - 24px));margin-right:24px;`
10
- return `flex: 0 1 ${(100 / layoutSize) * (child.size ?? 1)}%;`
11
- }
12
-
13
- /** 动态设置单个表单项规则 (同时解决处理动态增减表单项操作 */
14
- export function setFormItemRule(node, nodeParent = {}) {
15
- const required = (node.required ?? nodeParent.required ?? this.formAttrs.required) ?? true
16
-
17
- /** node.placeholder与组件内的提示文字位置不对等 */
18
- const message =
19
- node.attrs?.placeholder ||
20
- (/(select|picker|radio|upload)/.test((node.is ?? 'Input').toLowerCase()) ? '请选择' : '请输入') +
21
- (node.label || '')
22
-
23
- const rules = [
24
- {
25
- required,
26
- message,
27
- trigger: ['change', 'blur']
28
- }
29
- ].concat(
30
- (node.rules || []).filter(i => {
31
- i.pattern && (i.pattern = new RegExp(i.pattern))
32
- return i
33
- }))
34
-
35
- return rules
36
- }
37
-
38
- /** 动态渲染表单项 */
39
- export function setFormItem(h, vModel, child, childAttrs) {
40
-
41
- const {layout, layoutSize, $scopedSlots} = this
42
-
43
- let formItemAttrs =
44
- childAttrs ??
45
- {
46
- key: child.model,
47
- prop: child.model,
48
- colon: !(layout == 'inline')
49
- }
50
-
51
- const slotsName =
52
- (childAttrs?.parentModel ?? '') + child.model
53
-
54
- const {label, customLabel} = child
55
-
56
- return (
57
- <FormModelItem
58
- class={[
59
- { FormLineVertical: child.size === layoutSize && layout === 'vertical' },
60
- { FormLine: child.size === layoutSize }
61
- ]}
62
- {...{ attrs: formItemAttrs }}
63
- >
64
- <template slot="label">
65
- {
66
- customLabel ?
67
- customLabel(vModel) :
68
- <span>{label}</span>
69
- }
70
- </template>
71
- {/* 当前表单项可slot进行单独开发配置 (目前仅支持非动态增减情况) */}
72
- {$scopedSlots[child.model] ? (
73
- $scopedSlots[child.model](child)
74
- ) : (
75
- <RenderComp
76
- v-model={vModel[child.model]}
77
- component={child.is}
78
- {...{ on: child.event, attrs: child.attrs }}
79
- />
80
- )}
81
- {/* 如若再某个model后需添加按钮等场景(例如地图的选址按钮 */}
82
- {$scopedSlots[`${slotsName}Handle`] && $scopedSlots[`${slotsName}Handle`](formItemAttrs)}
83
- </FormModelItem>
84
- )
85
- }
@@ -1,2 +0,0 @@
1
- import Vue from 'vue'
2
- export default new Vue()
@@ -1,234 +0,0 @@
1
- import PropTypes from 'ant-design-vue/es/_util/vue-types'
2
-
3
- import Modal from '../modal/index.jsx'
4
-
5
- import { Spin, Icon } from 'ant-design-vue'
6
-
7
- // const IconFont = Icon.createFromIconfontCN({
8
- // scriptUrl: '//at.alicdn.com/t/c/font_4641025_trbtf28ob8g.js'
9
- // })
10
-
11
- // Spin.setDefaultIndicator({
12
- // indicator: {
13
- // render() {
14
- // return <IconFont type="icon-loading" />
15
- // }
16
- // }
17
- // })
18
-
19
- Spin.setDefaultIndicator({
20
- indicator: {
21
- render() {
22
- return <Icon type="loading" />
23
- }
24
- }
25
- })
26
-
27
- import IframeEvent from './events.js'
28
-
29
- import './index.less'
30
-
31
- const IframeContainerProps = {
32
- activeKey: PropTypes.string,
33
- checkedKey: PropTypes.string.def('name'),
34
- linkurlKey: PropTypes.string.def('linkUrl'),
35
- operatesArr: PropTypes.array,
36
- componentsArr: PropTypes.array,
37
- postMessage: PropTypes.object
38
- }
39
-
40
- const IframeContainer = {
41
- name: 'IframeComp',
42
- props: IframeContainerProps,
43
- data () {
44
- return {
45
- /** 页面加载状态 */
46
- compSpinning: true,
47
- componentAdd: true,
48
- /** 弹窗加载状态 */
49
- modalSpinning: true,
50
- modalComponents: {}
51
- }
52
- },
53
- render(h, content) {
54
- const { $props, modalComponents } = this
55
-
56
- const { activeKey, checkedKey, componentsArr } = $props
57
-
58
- const IframeComponents = componentsArr.map(componentItem => {
59
- const isActive = activeKey === componentItem[checkedKey]
60
- return this.getIframeComponent( componentItem, isActive )
61
- })
62
-
63
- const modalKeys = Object.keys(modalComponents)
64
-
65
- const ModalOperates = modalKeys.map(modalKey => {
66
- return (
67
- <Modal
68
- {...{
69
- props: {
70
- ...modalComponents[modalKey],
71
- cancelHandle: () => this.closeModalHandle(modalKey)
72
- }
73
- }}>
74
- <Spin spinning={this.modalSpinning} tip="加载中...">
75
- { this.getIframeComponent(modalComponents[modalKey], true) }
76
- </Spin>
77
- </Modal>
78
- )
79
- })
80
-
81
- return (
82
- <div class="ant-pro-grid-content-page">
83
- <Spin spinning={this.compSpinning} tip="加载中...">
84
- {IframeComponents}
85
- </Spin>
86
- {ModalOperates}
87
- </div>
88
- )
89
-
90
- },
91
- watch: {
92
- activeKey(newVal) {
93
- this.modalComponents = {}
94
- },
95
- componentsArr: {
96
- handler(newVal, oldVal) {
97
- this.componentAdd = newVal.length > oldVal.length
98
- this.postCompMessage()
99
- },
100
- deep: true
101
- }
102
- },
103
- computed: {
104
- activeKeyAndParams() {
105
- const {activeKey, postMessage, componentsArr} = this
106
- return {
107
- activeKey,
108
- postMessage,
109
- componentsArr
110
- }
111
- }
112
- },
113
- created() {
114
- IframeEvent.$on('modalOpen', ({ name, params }) => {
115
- const activeModal = this.switchModalHandle(name, params)
116
- activeModal && (
117
- this.componentAdd = true,
118
- this.$set(
119
- this.modalComponents, name, {
120
- mode: params.mode,
121
- visible: true,
122
- ...activeModal
123
- })
124
- )
125
- })
126
- IframeEvent.$on('modalClose', ({ name, params }) => {
127
- this.closeModalHandle(name)
128
- params && (
129
- this.componentAdd = false,
130
- this.postCompMessage(params)
131
- )
132
- })
133
- IframeEvent.$on('modalGoBack', ({ name, params }, closeModal) => {
134
- this.componentAdd = false
135
- this.closeModalHandle(closeModal)
136
- this.switchModalHandle(name, params)
137
- })
138
- },
139
- mounted() {
140
- // this.postCompMessage()
141
- },
142
- methods: {
143
- postCompMessage(data = {}) {
144
- const { componentsArr, activeKey, postMessage } = this
145
- componentsArr.length &&
146
- this.postIframeMessage(componentsArr, {
147
- type: 'refreshPage',
148
- activeKey,
149
- data
150
- })
151
- },
152
- closeModalHandle(name) {
153
- this.modalComponents[name].visible = false
154
- delete this.modalComponents[name]
155
- },
156
- switchModalHandle(name, data) {
157
- const { operatesArr, checkedKey } = this
158
- const activeModal = operatesArr.find( operatesItem => operatesItem[checkedKey] === name )
159
- activeModal && this.postIframeMessage(operatesArr, {
160
- type: 'refreshModal',
161
- activeKey: name,
162
- data
163
- })
164
- return {...activeModal, ...(data.attrs ?? {})}
165
- },
166
- postIframeMessage(components, iframeConfig) {
167
- const { type, activeKey, data = {} } = iframeConfig
168
-
169
- this.$nextTick(() => {
170
-
171
- const { checkedKey, linkurlKey, postMessage } = this
172
- const activeComp = components.find(componentsItem => activeKey === componentsItem[checkedKey])
173
- const refKey = activeComp[linkurlKey]
174
- const isModal = refKey.includes('?type=modal')
175
- const spinningKey = isModal ? 'modalSpinning' : 'compSpinning'
176
-
177
- const iframeRef = () => {
178
- const _self = this
179
- const iframe = this.$refs[refKey]
180
- const iframeWin = this.$refs[refKey]?.contentWindow
181
- const iframeOptions = {
182
- type,
183
- params: {
184
- data,
185
- name: activeKey,
186
- title: isModal ? activeComp.title : activeComp.meta?.title,
187
- routeQuery: postMessage
188
- }
189
- }
190
-
191
- this.componentAdd ? (
192
- this[spinningKey] = true,
193
- iframe.onload = function() {
194
- _self[spinningKey] = false
195
- iframeWin.postMessage(iframeOptions, '*')
196
- } ) :
197
- iframeWin.postMessage(iframeOptions, '*')
198
- }
199
-
200
- if(isModal) {
201
- const timer = setTimeout( () => {
202
- iframeRef()
203
- clearTimeout(timer)
204
- }, 0 )
205
- return
206
- }
207
- iframeRef()
208
- })
209
- },
210
- getIframeComponent(componentItem, isActive) {
211
- const { linkurlKey, checkedKey } = this
212
- return (
213
- <iframe
214
- width="100%"
215
- height="100%"
216
- ref={componentItem[linkurlKey]}
217
- src={componentItem[linkurlKey]}
218
- key={componentItem[checkedKey]}
219
- style={{
220
- border: 'none',
221
- display: isActive ? 'block' : 'none'
222
- }}
223
- />
224
- )
225
- }
226
- }
227
- }
228
-
229
- IframeContainer.install = function (Vue) {
230
- Vue.prototype.$IframeBus = IframeEvent
231
- Vue.component('IframePage', IframeContainer)
232
- }
233
-
234
- export default IframeContainer
@@ -1,19 +0,0 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
-
3
- .ant-pro-grid-content-page,
4
- .ant-spin-nested-loading,
5
- .ant-spin-container {
6
- width: 100%;
7
- height: 100%;
8
- }
9
-
10
- .ant-spin-nested-loading > div > .ant-spin {
11
- .ant-spin-dot {
12
- font-size: 48px;
13
- }
14
- .ant-spin-text.ant-spin-text {
15
- top: 60%;
16
- padding-left: 36px;
17
- font-size: @font-size-lg;
18
- }
19
- }
@@ -1,17 +0,0 @@
1
- export const TAB_BINDING = {
2
- TAB_CLOSE: 'hook:tab:ck',
3
- TAB_CLOSE_ALL: 'hook:tab:ca',
4
- TAB_CLOSE_LEFT: 'hook:tab:cl',
5
- TAB_CLOSE_RIGHT: 'hook:tab:cr',
6
- TAB_CLOSE_OTHER: 'hook:tab:co',
7
- TAB_NAME: 'hook:tab:rename',
8
- TAB_ACTIVE: 'hook:tab:active'
9
- }
10
-
11
- export const ROUTE_BINDING = {
12
- R_OPEN: 'hook:open',
13
- R_CLOSE: 'hook:close',
14
- R_ACTIVE: 'hook:active',
15
- R_REFRESH: 'hook:refresh',
16
- R_GET_CACHES: 'hook:caches'
17
- }