vue2-client 1.1.0 → 1.2.0

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 (132) hide show
  1. package/.eslintrc.js +81 -81
  2. package/README.md +4 -2
  3. package/babel.config.js +14 -14
  4. package/docs/index.md +29 -29
  5. package/{src/index.js → index.js} +8 -8
  6. package/jest.config.js +3 -3
  7. package/package.json +1 -1
  8. package/public/index.html +27 -27
  9. package/src/App.vue +93 -93
  10. package/src/base-client/all.js +26 -26
  11. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +4 -4
  12. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  13. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +3 -3
  14. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  15. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  16. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +3 -3
  17. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  18. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  19. package/src/base-client/components/common/XAddForm/XAddForm.vue +3 -3
  20. package/src/base-client/components/common/XAddForm/index.md +60 -60
  21. package/src/base-client/components/common/XBadge/index.md +39 -39
  22. package/src/base-client/components/common/XCard/index.md +43 -43
  23. package/src/base-client/components/common/XForm/XForm.vue +2 -2
  24. package/src/base-client/components/common/XForm/XFormItem.vue +1 -1
  25. package/src/base-client/components/common/XForm/index.md +3 -3
  26. package/src/base-client/components/common/XFormCol/index.md +35 -35
  27. package/src/base-client/components/common/XFormTable/XFormTable.vue +6 -6
  28. package/src/base-client/components/common/XFormTable/index.md +89 -89
  29. package/src/base-client/components/common/XTable/XTable.vue +3 -3
  30. package/src/base-client/components/common/XTable/index.md +3 -3
  31. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
  32. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +3 -3
  33. package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
  34. package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
  35. package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +5 -5
  36. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +3 -3
  37. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +3 -3
  38. package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
  39. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +1 -1
  40. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  41. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
  42. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +4 -4
  43. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
  44. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
  45. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +3 -3
  46. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +5 -5
  47. package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
  48. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +3 -3
  49. package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
  50. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +3 -3
  51. package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
  52. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +1 -1
  53. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +3 -3
  54. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +3 -3
  55. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +4 -4
  56. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +3 -3
  57. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +3 -3
  58. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +4 -4
  59. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
  60. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +4 -4
  61. package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
  62. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +3 -3
  63. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +5 -5
  64. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +5 -5
  65. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +3 -3
  66. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +6 -6
  67. package/src/base-client/plugins/AppData.js +3 -3
  68. package/src/base-client/plugins/GetLoginInfoService.js +2 -2
  69. package/src/base-client/plugins/index.js +4 -4
  70. package/src/bootstrap.js +4 -4
  71. package/src/components/Ellipsis/Ellipsis.vue +64 -64
  72. package/src/components/Ellipsis/index.md +38 -38
  73. package/src/components/NumberInfo/index.md +43 -43
  74. package/src/components/STable/README.md +341 -341
  75. package/src/components/Trend/index.md +45 -45
  76. package/src/components/cache/AKeepAlive.js +172 -172
  77. package/src/components/checkbox/index.js +7 -7
  78. package/src/components/index.js +36 -36
  79. package/src/components/menu/menu.js +273 -273
  80. package/src/components/setting/Setting.vue +237 -237
  81. package/src/components/table/advance/AdvanceTable.vue +275 -275
  82. package/src/components/transition/PageToggleTransition.vue +97 -97
  83. package/src/config/default/setting.config.js +33 -33
  84. package/src/layouts/CommonLayout.vue +42 -42
  85. package/src/layouts/ComponentLayoutOne.vue +47 -47
  86. package/src/layouts/PageLayout.vue +151 -151
  87. package/src/layouts/SinglePageView.vue +74 -74
  88. package/src/layouts/header/AdminHeader.vue +109 -109
  89. package/src/layouts/header/HeaderAvatar.vue +60 -60
  90. package/src/layouts/header/HeaderNotice.vue +1 -1
  91. package/src/layouts/tabs/TabsHead.vue +190 -190
  92. package/src/layouts/tabs/TabsView.vue +355 -355
  93. package/src/main.js +2 -2
  94. package/src/mock/common/reportData.js +20 -20
  95. package/src/mock/goods/index.js +108 -108
  96. package/src/mock/index.js +12 -12
  97. package/src/mock/project/index.js +17 -17
  98. package/src/mock/user/current.js +13 -13
  99. package/src/mock/user/login.js +39 -39
  100. package/src/mock/user/routes.js +61 -61
  101. package/src/mock/workplace/index.js +15 -15
  102. package/src/pages/exception/403.vue +2 -2
  103. package/src/pages/exception/404.vue +2 -2
  104. package/src/pages/exception/500.vue +2 -2
  105. package/src/pages/login/Login.vue +8 -8
  106. package/src/pages/report/ReportTable.js +125 -125
  107. package/src/pages/report/ReportTableHome.vue +2 -2
  108. package/src/pages/resourceManage/resourceManageMain.vue +1 -1
  109. package/src/pages/system/applyInstallView/Core.vue +570 -570
  110. package/src/pages/system/applyInstallView/index.vue +34 -34
  111. package/src/pages/system/dictionary/index.vue +41 -41
  112. package/src/pages/system/queryParams/index.vue +41 -41
  113. package/src/router/async/config.async.js +25 -25
  114. package/src/router/async/router.map.js +13 -13
  115. package/src/router/guards.js +104 -104
  116. package/src/router/index.js +2 -2
  117. package/src/services/api/common.js +1 -1
  118. package/src/services/api/restTools.js +1 -1
  119. package/src/services/dataSource.js +12 -12
  120. package/src/services/user.js +34 -34
  121. package/src/store/index.js +5 -5
  122. package/src/store/modules/setting.js +114 -114
  123. package/src/theme/index.less +5 -5
  124. package/src/theme/reportTable.less +58 -58
  125. package/src/utils/i18n.js +80 -80
  126. package/src/utils/indexedDB.js +1 -1
  127. package/src/utils/request.js +1 -1
  128. package/src/utils/routerUtil.js +3 -3
  129. package/tests/unit/ReportTable.spec.js +2 -2
  130. package/vue.config.js +1 -0
  131. package/webpack.config.js +1 -1
  132. package/src/router/config.js +0 -23
@@ -30,9 +30,9 @@
30
30
  </template>
31
31
  <script>
32
32
 
33
- import { STable } from '@/components'
34
- import { post } from '@/services/api/restTools'
35
- import { MeterDetailsViewApi } from '@/services/api/MeterDetailsViewApi'
33
+ import { STable } from '@vue2-client/components'
34
+ import { post } from '@vue2-client/services/api/restTools'
35
+ import { MeterDetailsViewApi } from '@vue2-client/services/api/MeterDetailsViewApi'
36
36
 
37
37
  const columns = [
38
38
  {
@@ -236,12 +236,12 @@ import {
236
236
  Trend,
237
237
  NumberInfo,
238
238
  MiniSmoothArea
239
- } from '@/components'
240
- import { formatDate } from '@/utils/util'
239
+ } from '@vue2-client/components'
240
+ import { formatDate } from '@vue2-client/utils/util'
241
241
  import { Line } from '@antv/g2plot'
242
242
  import { mapState } from 'vuex'
243
- import { post } from '@/services/api/restTools'
244
- import { WebmeterAnalysisViewApi } from '@/services/api/WebmeterAnalysisViewApi'
243
+ import { post } from '@vue2-client/services/api/restTools'
244
+ import { WebmeterAnalysisViewApi } from '@vue2-client/services/api/WebmeterAnalysisViewApi'
245
245
 
246
246
  const barData = []
247
247
  const barData2 = []
@@ -1,48 +1,48 @@
1
- # WebmeterAnalysisView 物联网表综合分析页
2
-
3
- 提供一个可以对物联网表模块综合分析,展示图表,排行等汇总数据界面的抽屉实现
4
-
5
-
6
-
7
- ## 何时使用
8
-
9
- 允许用户查看物联网表模块整体的综合分析图表,排行等汇总数据。
10
-
11
-
12
-
13
- 引用方式:
14
-
15
- ```javascript
16
- import WebmeterAnalysisView from '@/base-client/components/WebmeterAnalysisView'
17
-
18
- export default {
19
- components: {
20
- WebmeterAnalysisView
21
- }
22
- }
23
- ```
24
-
25
-
26
-
27
- ## 代码演示
28
-
29
- ```html
30
- <webmeter-analysis-view
31
- :visible.sync="detailVisible"
32
- :select-org-name="selectOrgName"
33
- :webmeter-url="selectUrl"
34
- :system-version="selectSystemVersion"
35
- :data-source="selectDataSource"
36
- v-if="selectUrl"
37
- />
38
- ```
39
-
40
- ## API
41
-
42
- | 参数 | 说明 | 类型 | 默认值 |
43
- |---------------|-----------|---------|-------|
44
- | visible | 是否显示 | Boolean | false |
45
- | selectOrgName | 燃气公司客户名 | String | null |
46
- | webmeterUrl | 物联网表服务名 | String | null |
47
- | systemVersion | 系统所属版本 | String | null |
48
- | dataSource | 系统所属数据库版本 | String | null |
1
+ # WebmeterAnalysisView 物联网表综合分析页
2
+
3
+ 提供一个可以对物联网表模块综合分析,展示图表,排行等汇总数据界面的抽屉实现
4
+
5
+
6
+
7
+ ## 何时使用
8
+
9
+ 允许用户查看物联网表模块整体的综合分析图表,排行等汇总数据。
10
+
11
+
12
+
13
+ 引用方式:
14
+
15
+ ```javascript
16
+ import WebmeterAnalysisView from '@vue2-client/base-client/components/WebmeterAnalysisView'
17
+
18
+ export default {
19
+ components: {
20
+ WebmeterAnalysisView
21
+ }
22
+ }
23
+ ```
24
+
25
+
26
+
27
+ ## 代码演示
28
+
29
+ ```html
30
+ <webmeter-analysis-view
31
+ :visible.sync="detailVisible"
32
+ :select-org-name="selectOrgName"
33
+ :webmeter-url="selectUrl"
34
+ :system-version="selectSystemVersion"
35
+ :data-source="selectDataSource"
36
+ v-if="selectUrl"
37
+ />
38
+ ```
39
+
40
+ ## API
41
+
42
+ | 参数 | 说明 | 类型 | 默认值 |
43
+ |---------------|-----------|---------|-------|
44
+ | visible | 是否显示 | Boolean | false |
45
+ | selectOrgName | 燃气公司客户名 | String | null |
46
+ | webmeterUrl | 物联网表服务名 | String | null |
47
+ | systemVersion | 系统所属版本 | String | null |
48
+ | dataSource | 系统所属数据库版本 | String | null |
@@ -57,11 +57,11 @@
57
57
  </template>
58
58
 
59
59
  <script>
60
- import { DictionaryDetailsViewApi } from '@/services/api/DictionaryDetailsViewApi'
61
- import { post } from '@/services/api/restTools'
60
+ import { DictionaryDetailsViewApi } from '@vue2-client/services/api/DictionaryDetailsViewApi'
61
+ import { post } from '@vue2-client/services/api/restTools'
62
62
  import { mapState } from 'vuex'
63
- import { formatDate } from '@/utils/util'
64
- import XFormTable from '@/base-client/components/common/XFormTable/XFormTable'
63
+ import { formatDate } from '@vue2-client/utils/util'
64
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
65
65
 
66
66
  export default {
67
67
  name: 'DictionaryDetailsView',
@@ -1,41 +1,41 @@
1
- # DictionaryDetailsView 字典详情页
2
-
3
- 提供一个可以对单个字典项进行一系列通用业务操作的抽屉实现
4
-
5
-
6
-
7
- ## 何时使用
8
-
9
- 允许用户对单个字典项进行一系列通用业务操作,常用于作为字典详情页的通用实现。
10
-
11
-
12
-
13
- 引用方式:
14
-
15
- ```javascript
16
- import DictionaryDetailsView from '@/base-client/components/DictionaryDetailsView'
17
-
18
- export default {
19
- components: {
20
- DictionaryDetailsView
21
- }
22
- }
23
- ```
24
-
25
-
26
-
27
- ## 代码演示
28
-
29
- ```html
30
- <dictionary-details-view
31
- :visible.sync="detailVisible"
32
- :id="selectId"
33
- v-if="selectId" />
34
- ```
35
-
36
- ## API
37
-
38
- | 参数 | 说明 | 类型 | 默认值 |
39
- |---------|------|---------|-------|
40
- | visible | 是否显示 | Boolean | false |
41
- | id | ID | String | null |
1
+ # DictionaryDetailsView 字典详情页
2
+
3
+ 提供一个可以对单个字典项进行一系列通用业务操作的抽屉实现
4
+
5
+
6
+
7
+ ## 何时使用
8
+
9
+ 允许用户对单个字典项进行一系列通用业务操作,常用于作为字典详情页的通用实现。
10
+
11
+
12
+
13
+ 引用方式:
14
+
15
+ ```javascript
16
+ import DictionaryDetailsView from '@vue2-client/base-client/components/DictionaryDetailsView'
17
+
18
+ export default {
19
+ components: {
20
+ DictionaryDetailsView
21
+ }
22
+ }
23
+ ```
24
+
25
+
26
+
27
+ ## 代码演示
28
+
29
+ ```html
30
+ <dictionary-details-view
31
+ :visible.sync="detailVisible"
32
+ :id="selectId"
33
+ v-if="selectId" />
34
+ ```
35
+
36
+ ## API
37
+
38
+ | 参数 | 说明 | 类型 | 默认值 |
39
+ |---------|------|---------|-------|
40
+ | visible | 是否显示 | Boolean | false |
41
+ | id | ID | String | null |
@@ -58,9 +58,9 @@
58
58
  <script>
59
59
  import JsonViewer from 'vue-json-viewer'
60
60
  import { mapState, mapGetters } from 'vuex'
61
- import { post } from '@/services/api/restTools'
62
- import XFormTable from '@/base-client/components/common/XFormTable/XFormTable'
63
- import { QueryParamsDetailsViewApi } from '@/services/api/QueryParamsDetailsViewApi'
61
+ import { post } from '@vue2-client/services/api/restTools'
62
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
63
+ import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
64
64
 
65
65
  export default {
66
66
  name: 'DeviceTypeDetailsView',
@@ -69,10 +69,10 @@
69
69
 
70
70
  <script>
71
71
  import JsonViewer from 'vue-json-viewer'
72
- import { formatDate } from '@/utils/util'
73
- import { EmployeeDetailsViewApi } from '@/services/api/EmployeeDetailsViewApi'
74
- import { post } from '@/services/api/restTools'
75
- import XTable from '@/base-client/components/common/XTable/XTable'
72
+ import { formatDate } from '@vue2-client/utils/util'
73
+ import { EmployeeDetailsViewApi } from '@vue2-client/services/api/EmployeeDetailsViewApi'
74
+ import { post } from '@vue2-client/services/api/restTools'
75
+ import XTable from '@vue2-client/base-client/components/common/XTable/XTable'
76
76
  import { mapState } from 'vuex'
77
77
  import {
78
78
  ChartCard,
@@ -84,7 +84,7 @@ import {
84
84
  Trend,
85
85
  NumberInfo,
86
86
  MiniSmoothArea
87
- } from '@/components'
87
+ } from '@vue2-client/components'
88
88
 
89
89
  export default {
90
90
  name: 'EmployeeDetailsView',
@@ -114,11 +114,11 @@
114
114
 
115
115
  <script>
116
116
  import JsonViewer from 'vue-json-viewer'
117
- import { formatDate } from '@/utils/util'
118
- import { TicketDetailsViewApi } from '@/services/api/TicketDetailsViewApi'
119
- import { EmployeeDetailsViewApi } from '@/services/api/EmployeeDetailsViewApi'
120
- import { post } from '@/services/api/restTools'
121
- import XTable from '@/base-client/components/common/XTable/XTable'
117
+ import { formatDate } from '@vue2-client/utils/util'
118
+ import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
119
+ import { EmployeeDetailsViewApi } from '@vue2-client/services/api/EmployeeDetailsViewApi'
120
+ import { post } from '@vue2-client/services/api/restTools'
121
+ import XTable from '@vue2-client/base-client/components/common/XTable/XTable'
122
122
  import { mapState } from 'vuex'
123
123
  import TicketDetailsFlow from './part/TicketDetailsFlow'
124
124
 
@@ -24,10 +24,10 @@
24
24
  </div>
25
25
  </template>
26
26
  <script>
27
- import { formatDate } from '@/utils/util'
27
+ import { formatDate } from '@vue2-client/utils/util'
28
28
  import { mapState } from 'vuex'
29
- import { TicketDetailsViewApi } from '@/services/api/TicketDetailsViewApi'
30
- import { post } from '@/services/api/restTools'
29
+ import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
30
+ import { post } from '@vue2-client/services/api/restTools'
31
31
 
32
32
  export default {
33
33
  name: 'TicketDetailsFlow',
@@ -57,13 +57,13 @@
57
57
  </template>
58
58
 
59
59
  <script>
60
- import Result from '@/components/result/Result'
61
- import DetailList from '@/components/tool/DetailList'
62
- import AStepItem from '@/components/tool/AStepItem'
63
- import { TicketDetailsViewApi } from '@/services/api/TicketDetailsViewApi'
64
- import { post } from '@/services/api/restTools'
60
+ import Result from '@vue2-client/components/result/Result'
61
+ import DetailList from '@vue2-client/components/tool/DetailList'
62
+ import AStepItem from '@vue2-client/components/tool/AStepItem'
63
+ import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
64
+ import { post } from '@vue2-client/services/api/restTools'
65
65
  import { mapState } from 'vuex'
66
- import { formatDate } from '@/utils/util'
66
+ import { formatDate } from '@vue2-client/utils/util'
67
67
 
68
68
  const AStepItemGroup = AStepItem.Group
69
69
  const DetailListItem = DetailList.Item
@@ -1,6 +1,6 @@
1
- import { post } from '@/services/api/restTools'
2
- import { manageApi } from '@/services/api/manage'
3
- import { commonApi } from '@/services/api/common'
1
+ import { post } from '@vue2-client/services/api/restTools'
2
+ import { manageApi } from '@vue2-client/services/api/manage'
3
+ import { commonApi } from '@vue2-client/services/api/common'
4
4
 
5
5
  const GetAppDataService = {
6
6
  install (Vue) {
@@ -1,6 +1,6 @@
1
1
  import Vue from 'vue'
2
- import { SEARCH } from '@/services/api'
3
- import { post } from '@/services/api/restTools'
2
+ import { SEARCH } from '@vue2-client/services/api'
3
+ import { post } from '@vue2-client/services/api/restTools'
4
4
 
5
5
  const loginGen = async function (response) {
6
6
  Vue.$login.f = response
@@ -1,7 +1,7 @@
1
- import GetLoginInfoService from '@/base-client/plugins/GetLoginInfoService'
2
- import GetAppDataService from '@/base-client/plugins/AppData'
3
- import getConfig from '@/base-client/plugins/Config'
4
- import moment from '@/base-client/plugins/moment'
1
+ import GetLoginInfoService from '@vue2-client/base-client/plugins/GetLoginInfoService'
2
+ import GetAppDataService from '@vue2-client/base-client/plugins/AppData'
3
+ import getConfig from '@vue2-client/base-client/plugins/Config'
4
+ import moment from '@vue2-client/base-client/plugins/moment'
5
5
 
6
6
  import VueI18nPlugin from './i18n-extend'
7
7
  import AuthorityPlugin from './authority-plugin'
package/src/bootstrap.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import Vue from 'vue'
2
- import { loadRoutes, loadGuards, setAppOptions } from '@/utils/routerUtil'
3
- import { loadInterceptors } from '@/utils/request'
4
- import guards from '@/router/guards'
5
- import interceptors from '@/utils/axios-interceptors'
2
+ import { loadRoutes, loadGuards, setAppOptions } from '@vue2-client/utils/routerUtil'
3
+ import { loadInterceptors } from '@vue2-client/utils/request'
4
+ import guards from '@vue2-client/router/guards'
5
+ import interceptors from '@vue2-client/utils/axios-interceptors'
6
6
 
7
7
  /**
8
8
  * 启动引导方法
@@ -1,64 +1,64 @@
1
- <script>
2
- import Tooltip from 'ant-design-vue/es/tooltip'
3
- import { cutStrByFullLength, getStrFullLength } from '@/components/_util/util'
4
- /*
5
- const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
6
-
7
- const TooltipOverlayStyle = {
8
- overflowWrap: 'break-word',
9
- wordWrap: 'break-word',
10
- };
11
- */
12
-
13
- export default {
14
- name: 'Ellipsis',
15
- components: {
16
- Tooltip
17
- },
18
- props: {
19
- prefixCls: {
20
- type: String,
21
- default: 'ant-pro-ellipsis'
22
- },
23
- tooltip: {
24
- type: Boolean
25
- },
26
- length: {
27
- type: Number,
28
- required: true
29
- },
30
- lines: {
31
- type: Number,
32
- default: 1
33
- },
34
- fullWidthRecognition: {
35
- type: Boolean,
36
- default: false
37
- }
38
- },
39
- methods: {
40
- getStrDom (str, fullLength) {
41
- return (
42
- <span>{ cutStrByFullLength(str, this.length) + (fullLength > this.length ? '...' : '') }</span>
43
- )
44
- },
45
- getTooltip (fullStr, fullLength) {
46
- return (
47
- <Tooltip>
48
- <template slot="title">{ fullStr }</template>
49
- { this.getStrDom(fullStr, fullLength) }
50
- </Tooltip>
51
- )
52
- }
53
- },
54
- render () {
55
- const { tooltip, length } = this.$props
56
- const str = this.$slots.default.map(vNode => vNode.text).join('')
57
- const fullLength = getStrFullLength(str)
58
- const strDom = tooltip && fullLength > length ? this.getTooltip(str, fullLength) : this.getStrDom(str, fullLength)
59
- return (
60
- strDom
61
- )
62
- }
63
- }
64
- </script>
1
+ <script>
2
+ import Tooltip from 'ant-design-vue/es/tooltip'
3
+ import { cutStrByFullLength, getStrFullLength } from '@vue2-client/components/_util/util'
4
+ /*
5
+ const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
6
+
7
+ const TooltipOverlayStyle = {
8
+ overflowWrap: 'break-word',
9
+ wordWrap: 'break-word',
10
+ };
11
+ */
12
+
13
+ export default {
14
+ name: 'Ellipsis',
15
+ components: {
16
+ Tooltip
17
+ },
18
+ props: {
19
+ prefixCls: {
20
+ type: String,
21
+ default: 'ant-pro-ellipsis'
22
+ },
23
+ tooltip: {
24
+ type: Boolean
25
+ },
26
+ length: {
27
+ type: Number,
28
+ required: true
29
+ },
30
+ lines: {
31
+ type: Number,
32
+ default: 1
33
+ },
34
+ fullWidthRecognition: {
35
+ type: Boolean,
36
+ default: false
37
+ }
38
+ },
39
+ methods: {
40
+ getStrDom (str, fullLength) {
41
+ return (
42
+ <span>{ cutStrByFullLength(str, this.length) + (fullLength > this.length ? '...' : '') }</span>
43
+ )
44
+ },
45
+ getTooltip (fullStr, fullLength) {
46
+ return (
47
+ <Tooltip>
48
+ <template slot="title">{ fullStr }</template>
49
+ { this.getStrDom(fullStr, fullLength) }
50
+ </Tooltip>
51
+ )
52
+ }
53
+ },
54
+ render () {
55
+ const { tooltip, length } = this.$props
56
+ const str = this.$slots.default.map(vNode => vNode.text).join('')
57
+ const fullLength = getStrFullLength(str)
58
+ const strDom = tooltip && fullLength > length ? this.getTooltip(str, fullLength) : this.getStrDom(str, fullLength)
59
+ return (
60
+ strDom
61
+ )
62
+ }
63
+ }
64
+ </script>
@@ -1,38 +1,38 @@
1
- # Ellipsis 文本自动省略号
2
-
3
- 文本过长自动处理省略号,支持按照文本长度和最大行数两种方式截取。
4
-
5
-
6
-
7
- 引用方式:
8
-
9
- ```javascript
10
- import Ellipsis from '@/components/Ellipsis'
11
-
12
- export default {
13
- components: {
14
- Ellipsis
15
- }
16
- }
17
- ```
18
-
19
-
20
-
21
- ## 代码演示 [demo](https://pro.loacg.com/test/home)
22
-
23
- ```html
24
- <ellipsis :length="100" tooltip>
25
- There were injuries alleged in three cases in 2015, and a
26
- fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.
27
- </ellipsis>
28
- ```
29
-
30
-
31
-
32
- ## API
33
-
34
-
35
- 参数 | 说明 | 类型 | 默认值
36
- ----|------|-----|------
37
- tooltip | 移动到文本展示完整内容的提示 | boolean | -
38
- length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | -
1
+ # Ellipsis 文本自动省略号
2
+
3
+ 文本过长自动处理省略号,支持按照文本长度和最大行数两种方式截取。
4
+
5
+
6
+
7
+ 引用方式:
8
+
9
+ ```javascript
10
+ import Ellipsis from '@vue2-client/components/Ellipsis'
11
+
12
+ export default {
13
+ components: {
14
+ Ellipsis
15
+ }
16
+ }
17
+ ```
18
+
19
+
20
+
21
+ ## 代码演示 [demo](https://pro.loacg.com/test/home)
22
+
23
+ ```html
24
+ <ellipsis :length="100" tooltip>
25
+ There were injuries alleged in three cases in 2015, and a
26
+ fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.
27
+ </ellipsis>
28
+ ```
29
+
30
+
31
+
32
+ ## API
33
+
34
+
35
+ 参数 | 说明 | 类型 | 默认值
36
+ ----|------|-----|------
37
+ tooltip | 移动到文本展示完整内容的提示 | boolean | -
38
+ length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | -