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,24 +0,0 @@
1
- <template>
2
- <Result status="404" title="404" sub-title="对不起,您访问的页面不存在">
3
- <template #extra>
4
- <Button type="primary" @click="toHomePage">返回首页</Button>
5
- </template>
6
- </Result>
7
- </template>
8
-
9
- <script>
10
- import { mapGetters } from 'vuex'
11
- import { Result, Button } from 'ant-design-vue'
12
- export default {
13
- name: 'Exception404',
14
- components: { Result, Button },
15
- computed: {
16
- ...mapGetters(['toHome'])
17
- },
18
- methods: {
19
- toHomePage() {
20
- this.$router.replace(this.toHome ?? '/')
21
- }
22
- }
23
- }
24
- </script>
@@ -1,76 +0,0 @@
1
- import PropTypes from 'ant-design-vue/es/_util/vue-types'
2
-
3
- import './index.less'
4
-
5
- import { Base64 } from '../../utils/Base64'
6
-
7
- import { getPictureAttrs } from '../../utils/Utils'
8
-
9
- const pictureType = [ "gif", "jpeg", "png", "jpg", "bmp", "tif", "svg", "psd", "raw", "WMF", "webp", "apng" ]
10
- const audioType = [ "mp3", "wma", "flac", "aac", "mmf", "amr", "m4a", "m4r", "ogg", "mp2", "wav" ]
11
- const videoType = [ "avi", "flv", "mpg", "mpeg", "mpe", "m1v", "m2v", "mpv2", "mp2v", "dat", "ts", "tp", "tpr", "pva", "pss", "mp4", "m4v",
12
- "m4p", "m4b", "3gp", "3gpp", "3g2", "3gp2", "ogg", "mov", "qt", "amr", "rm", "ram", "rmvb", "rpm" ]
13
-
14
- const BrowseProps = {
15
- data: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.object]).def([]),
16
- /** 支持http地址可配置 */
17
- httpsUrl: PropTypes.object.def({}),
18
- /** 限制高度 */
19
- astrictH: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
20
- }
21
-
22
- const renderContent = (h, item, https, astrictH) => {
23
-
24
- const type = item.url.slice(item.url.lastIndexOf('.') + 1).toLowerCase()
25
-
26
- const CustomTag =
27
- pictureType.includes(type) && 'img' ||
28
- audioType.includes(type) && 'audio' ||
29
- videoType.includes(type) && 'video' || 'iframe'
30
-
31
- const attrs = {
32
- controls: true,
33
- src: https.FILEURL + item.url
34
- }
35
-
36
- CustomTag === 'iframe'
37
- && ( attrs.src = https.KKFILEURL + encodeURIComponent( Base64.encode( https.OVERVIEWFILEURL + item.url ) ) )
38
-
39
- if(astrictH) {
40
- const style = getPictureAttrs(attrs.src, astrictH)
41
- attrs.style = `width: ${style.width}px; height: ${style.height}px;`
42
- }
43
-
44
- return (
45
- <CustomTag {...{ attrs }} />
46
- )
47
- }
48
-
49
- const Browse = {
50
- name: 'Browse',
51
- props: BrowseProps,
52
- render(h, content) {
53
- let { data, $https, httpsUrl, astrictH } = this
54
- const https = { ...$https, ...httpsUrl }
55
- if(typeof(data) === 'string') {
56
- try {
57
- data = JSON.parse(data)
58
- } catch(error) { data = [] }
59
- }
60
- return (
61
- <div class="Browse">
62
- {
63
- data instanceof Array ?
64
- data.map( dataItem => renderContent(h, dataItem, https, astrictH) ) :
65
- renderContent(h, data, https, astrictH)
66
- }
67
- </div>
68
- )
69
- }
70
- }
71
-
72
- Browse.install = function (Vue) {
73
- Vue.component('Browse', Browse)
74
- }
75
-
76
- export default Browse
@@ -1,4 +0,0 @@
1
- iframe {
2
- width: 100%;
3
- height: 100%;
4
- }
@@ -1,89 +0,0 @@
1
- import Message from 'ant-design-vue/es/message'
2
- import { Button, Upload, Popconfirm } from 'ant-design-vue'
3
-
4
- /* 弹出框默认配置 */
5
- const PopconfirmProps = {
6
- title: "确定执行此操作吗?",
7
- okText: "确定",
8
- cancelText: "取消",
9
- placement: "topRight"
10
- }
11
-
12
- export default {
13
- name: "Button",
14
- props: {
15
- buttonProps: {
16
- type: [ Array, Object ],
17
- default: () => ({})
18
- }
19
- },
20
- methods: {
21
- UploadBtn( props ) {
22
- const { ButtonRender, UploadChange, $https, $store } = this
23
- /* 上传按钮默认配置 */
24
- const UploadProps = {
25
- name: "file",
26
- showUploadList: false,
27
- action: $https.WEBSWG + $https.BASEURL + props.url,
28
- headers: {
29
- token: $store.getters.token
30
- }
31
- }
32
- return (
33
- <Upload
34
- props={{ ...UploadProps, ...props.config }}
35
- {...{ on: { change: UploadChange,...props.event } }}
36
- >
37
- { ButtonRender( props ) }
38
- </Upload>
39
- )
40
- },
41
- UploadChange({ file }) {
42
- if(!file.hasOwnProperty('response')) return
43
- const { code, data, msg } = file.response
44
- code == 200 ?
45
- Message.success('导入成功!'):
46
- Message.error(msg)
47
- this.$emit('ButtonUploadOver', data)
48
- },
49
- PopconfirmBtn( props ) {
50
- const { ButtonRender } = this
51
- return (
52
- <Popconfirm props={{ ...PopconfirmProps, ...props.config }} {...{ on: props.event }} >
53
- { ButtonRender( props ) }
54
- </Popconfirm>
55
- )
56
- },
57
- ButtonRender( props ) {
58
- // const buttonEvent = props.type
59
- return (
60
- <Button
61
- props={ props }
62
- {...{ on: props.event }}
63
- >
64
- { props.text }
65
- </Button>
66
- )
67
- },
68
- SwitchButton( props ) {
69
- const { PopconfirmBtn, UploadBtn, ButtonRender } = this
70
- if( props.mode == 'popconfirm' ) return PopconfirmBtn( props )
71
- else if( props.mode == 'upload' ) return UploadBtn( props )
72
- return ButtonRender( props )
73
- }
74
- },
75
- render() {
76
- const { buttonProps, SwitchButton } = this
77
- // console.log( buttonProps.constructor === Array )
78
-
79
- return (
80
- <div class='ButtonDiversity'>
81
- { buttonProps.constructor === Array ? (
82
- buttonProps.map( props => {
83
- return SwitchButton( props )
84
- })
85
- ) : ( SwitchButton( buttonProps ) ) }
86
- </div>
87
- )
88
- }
89
- }
@@ -1,7 +0,0 @@
1
- import Button from './Button.js'
2
-
3
- Button.install = function (Vue) {
4
- Vue.component(Button.name, Button)
5
- }
6
-
7
- export default Button
@@ -1,7 +0,0 @@
1
- import DateTime from './index.vue'
2
-
3
- DateTime.install = function (Vue) {
4
- Vue.component(DateTime.name, DateTime)
5
- }
6
-
7
- export default DateTime
@@ -1,108 +0,0 @@
1
- import PropTypes from 'ant-design-vue/es/_util/vue-types'
2
- import Descriptions from 'ant-design-vue/es/descriptions'
3
-
4
- import Browse from '../browse/index.jsx'
5
- import { transferData } from '../../utils/Filter.js'
6
-
7
- const {
8
- Item: DescriptionsItem
9
- } = Descriptions
10
-
11
- import './index.less'
12
-
13
- const descDefaultAttrs = {
14
- size: 'middle',
15
- bordered: true
16
- }
17
-
18
- const DescriptionsProps = {
19
- title: PropTypes.string,
20
- column: PropTypes.oneOfType([PropTypes.number, PropTypes.object]).def(3),
21
- descDetails: PropTypes.object,
22
- descSettings: PropTypes.array,
23
- descAttrs: PropTypes.object,
24
- }
25
-
26
- const renderContent = (h, item, details) => {
27
- const CustomTag = item.type === 'file' && Browse || 'span'
28
- const data =
29
- item.hasOwnProperty( 'multiProps' ) ?
30
- item.multiProps.map( propsItem => transferData(details[propsItem], 'Array') ).flat() :
31
- transferData(details[item.props], 'Array')
32
- const props = {
33
- data,
34
- astrictH: 104
35
- }
36
- return (
37
- <CustomTag {...{ props }}>
38
- { (item.customRender && item.customRender(details[item.props], details) || details[item.props]) ?? '暂无'}
39
- </CustomTag>
40
- )
41
- }
42
-
43
- const DescriptionsList = {
44
- name: 'Descriptions',
45
- props: DescriptionsProps,
46
- render(h, content) {
47
- const { title, column, descAttrs, descDetails, descSettings, $slots, $scopedSlots } = this
48
- return (
49
- <div class="Descriptions" ref="Descriptions">
50
- <Descriptions
51
- title={title}
52
- column={column}
53
- {...{ attrs: { ...descDefaultAttrs, ...descAttrs } }}
54
- >
55
- {
56
- descSettings.map( (descItem, key) => {
57
- return (
58
- <DescriptionsItem
59
- key={key}
60
- span={descItem.span ?? 1}
61
- >
62
- <span slot="label">
63
- {$slots[`${descItem.props}Lable`] ?? descItem.label}
64
- </span>
65
- {
66
- $scopedSlots[`${descItem.props}`] ?
67
- $scopedSlots[`${descItem.props}`](descDetails) :
68
- renderContent(h, descItem, descDetails)
69
- }
70
- </DescriptionsItem>
71
- )
72
- } )
73
- }
74
- </Descriptions>
75
- </div>
76
- )
77
-
78
- },
79
- mounted() {
80
- window.addEventListener('resize', this.setDescContentWidth())
81
- },
82
- methods: {
83
- setDescContentWidth() {
84
- const elementG = this.$refs.Descriptions.querySelectorAll('.ant-descriptions-item-content')
85
- const width = document.querySelector('.ant-descriptions-row').offsetWidth
86
- const labelWidth = document.querySelector('.ant-descriptions-item-label').offsetWidth
87
- const { column, descSettings } = this
88
- for (let i = 0; i < elementG.length; i++) {
89
- const contentWidth = (
90
- descSettings[i].span ?
91
- width * (descSettings[i].span / column) :
92
- width / column ) - labelWidth + 'px'
93
- const element = elementG[i]
94
- element.style = `
95
- width: ${contentWidth};
96
- min-width: ${contentWidth};
97
- max-width: ${contentWidth};
98
- `
99
- }
100
- }
101
- }
102
- }
103
-
104
- DescriptionsList.install = function (Vue) {
105
- Vue.component('DescriptionsList', DescriptionsList)
106
- }
107
-
108
- export default DescriptionsList
@@ -1,15 +0,0 @@
1
- .Descriptions {
2
- .ant-descriptions-bordered {
3
- .ant-descriptions-item-label {
4
- width: 160px;
5
- min-width: 160px;
6
- max-width: 160px;
7
- text-align: left;
8
- word-wrap: break-word;
9
- }
10
-
11
- .ant-descriptions-item-content {
12
- word-wrap: break-word;
13
- }
14
- }
15
- }
@@ -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,129 +0,0 @@
1
- <template>
2
- <div class="ADatePicker">
3
- <DatePicker
4
- v-model="date[0]"
5
- v-bind="startPickerAttrs"
6
- @openChange="handleStartOpenChange"
7
- />
8
- ~
9
- <DatePicker
10
- v-model="date[1]"
11
- :open="endOpen"
12
- v-bind="endPickerAttrs"
13
- @openChange="handleEndOpenChange"
14
- />
15
- </div>
16
- </template>
17
- <script>
18
-
19
- const defaultConfig = {
20
- showTime: true,
21
- format: 'YYYY-MM-DD HH:mm:ss',
22
- valueFormat: 'YYYY-MM-DD HH:mm:ss'
23
- }
24
-
25
- import moment from 'moment'
26
- import { DatePicker } from 'ant-design-vue'
27
-
28
- export default {
29
- components: { DatePicker },
30
- model: {
31
- prop: 'value',
32
- event: 'update:rangePicker'
33
- },
34
- data() {
35
- return {
36
- date: [],
37
- endOpen: false
38
- }
39
- },
40
- props: {
41
- value: {
42
- type: Array,
43
- default: () => ([])
44
- },
45
- /* 开始日期配置项 */
46
- startConfig: {
47
- type: Object,
48
- default: () => ({})
49
- },
50
- /* 结束日期配置项 */
51
- endConfig: {
52
- type: Object,
53
- default: () => ({})
54
- }
55
- },
56
- watch: {
57
- value(newVal, oldVal) {
58
- if (newVal.toString() === oldVal.toString()) return
59
- this.date = newVal
60
- },
61
- 'date.length': {
62
- handler(newLen) {
63
- this.$emit('update:rangePicker', newLen == 2 ? this.date : [])
64
- },
65
- deep: true
66
- }
67
- },
68
- computed: {
69
- /* 开始日期 */
70
- startPickerAttrs() {
71
- return {
72
- ...defaultConfig,
73
- placeholder: '开始日期',
74
- disabledDate: this.disabledStartDate,
75
- ...this.startConfig
76
- }
77
- },
78
- /* 结束日期 */
79
- endPickerAttrs() {
80
- return {
81
- ...defaultConfig,
82
- placeholder: '结束日期',
83
- disabledDate: this.disabledEndDate,
84
- ...this.endConfig
85
- }
86
- }
87
- },
88
- methods: {
89
- disabledStartDate(startValue) {
90
- const endValue = this.date[1]
91
- if (!startValue || !endValue) {
92
- return false
93
- }
94
- const startDate = moment(startValue, this.startPickerAttrs.valueFormat)
95
- const endDate = moment(endValue, this.endPickerAttrs.valueFormat)
96
- return startDate.valueOf() > endDate.valueOf()
97
- },
98
- disabledEndDate(endValue) {
99
- const startValue = this.date[0]
100
- if (!endValue || !startValue) {
101
- return false
102
- }
103
- const startDate = moment(startValue, this.startPickerAttrs.valueFormat)
104
- const endDate = moment(endValue, this.endPickerAttrs.valueFormat)
105
- return startDate.valueOf() >= endDate.valueOf()
106
- },
107
- handleStartOpenChange(open) {
108
- if (!open) {
109
- this.endOpen = true
110
- }
111
- },
112
- handleEndOpenChange(open) {
113
- this.endOpen = open
114
- }
115
- }
116
- }
117
- </script>
118
- <style lang="less" scoped>
119
- .ADatePicker {
120
- width: 100%;
121
- display: flex;
122
- align-items: center;
123
- gap: 0 6px;
124
-
125
- .ant-calendar-picker {
126
- flex: 1;
127
- }
128
- }
129
- </style>