vue2-client 1.3.6 → 1.3.9

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 (74) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +1 -1
  3. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +4 -4
  4. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1 -1
  5. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +1 -1
  6. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  7. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  8. package/src/base-client/components/common/Upload/Upload.vue +3 -3
  9. package/src/base-client/components/common/XAddForm/XAddForm.vue +6 -2
  10. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +7 -2
  11. package/src/base-client/components/common/XForm/XForm.vue +1 -1
  12. package/src/base-client/components/common/XForm/XFormItem.vue +4 -2
  13. package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -0
  14. package/src/base-client/components/system/LogDetailsView/LogDetailsView.vue +376 -372
  15. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +1 -1
  16. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +14 -13
  17. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  18. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  19. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +1 -1
  20. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  21. package/src/base-client/plugins/AppData.js +4 -6
  22. package/src/base-client/plugins/GetLoginInfoService.js +252 -252
  23. package/src/base-client/plugins/PagedList.js +3 -3
  24. package/src/base-client/plugins/i18n-extend.js +32 -32
  25. package/src/components/Ellipsis/index.md +38 -38
  26. package/src/components/NumberInfo/index.md +43 -43
  27. package/src/components/STable/README.md +341 -341
  28. package/src/components/Trend/index.md +45 -45
  29. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  30. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  31. package/src/components/exception/ExceptionPage.vue +70 -70
  32. package/src/components/form/FormRow.vue +52 -52
  33. package/src/components/menu/SideMenu.vue +62 -62
  34. package/src/components/menu/menu.js +273 -273
  35. package/src/components/setting/Setting.vue +235 -235
  36. package/src/components/table/advance/ActionColumns.vue +158 -158
  37. package/src/components/table/advance/SearchArea.vue +355 -355
  38. package/src/components/tool/AStepItem.vue +60 -60
  39. package/src/components/tool/AvatarList.vue +68 -69
  40. package/src/components/tool/Drawer.vue +142 -142
  41. package/src/components/transition/PageToggleTransition.vue +97 -97
  42. package/src/config/replacer/resolve.config.js +67 -67
  43. package/src/layouts/AdminLayout.vue +174 -174
  44. package/src/layouts/header/AdminHeader.vue +3 -3
  45. package/src/layouts/header/HeaderNotice.vue +1 -1
  46. package/src/layouts/header/HeaderSearch.vue +67 -67
  47. package/src/layouts/header/InstitutionDetail.vue +3 -3
  48. package/src/layouts/tabs/TabsHead.vue +190 -190
  49. package/src/layouts/tabs/TabsView.vue +379 -379
  50. package/src/mock/goods/index.js +108 -108
  51. package/src/pages/CreateQueryPage.vue +2 -2
  52. package/src/pages/report/ReportTable.js +124 -125
  53. package/src/pages/report/ReportTableHome.vue +28 -28
  54. package/src/pages/system/file/index.vue +3 -3
  55. package/src/pages/system/ticket/index.vue +4 -1
  56. package/src/services/api/DictionaryDetailsViewApi.js +1 -1
  57. package/src/services/api/LogDetailsViewApi.js +3 -3
  58. package/src/services/api/QueryParamsDetailsViewApi.js +1 -1
  59. package/src/services/api/TicketDetailsViewApi.js +15 -23
  60. package/src/services/api/common.js +11 -11
  61. package/src/services/api/commonTempTable.js +3 -3
  62. package/src/services/api/manage.js +2 -2
  63. package/src/theme/default/nprogress.less +76 -76
  64. package/src/utils/colors.js +103 -103
  65. package/src/utils/excel/Blob.js +53 -54
  66. package/src/utils/excel/Export2Excel.js +4 -4
  67. package/src/utils/formatter.js +68 -68
  68. package/src/utils/i18n.js +1 -1
  69. package/src/utils/routerUtil.js +3 -3
  70. package/src/utils/theme-color-replacer-extend.js +3 -3
  71. package/src/utils/themeUtil.js +100 -102
  72. package/src/utils/util.js +2 -2
  73. package/vue.config.js +5 -15
  74. package/vue2-client.iml +9 -0
@@ -1,252 +1,252 @@
1
- import Vue from 'vue'
2
- import { SEARCH } from '@vue2-client/services/apiService'
3
- import { post } from '@vue2-client/services/api'
4
-
5
- /**
6
- * 获取片区
7
- * @returns {Promise<void>}
8
- */
9
- // eslint-disable-next-line
10
- async function getAllArea () {
11
- try {
12
- const getAllArea = await post(SEARCH, {
13
- source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
14
- userid: Vue.$login.f.id
15
- })
16
- const areaTemp = []
17
- for (let i = 0; i < getAllArea.length; i++) {
18
- areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
19
- }
20
- Vue.$login.f.f_allArea = areaTemp
21
- } catch (error) {
22
- Vue.$login.f.f_allArea = []
23
- console.log('获取片区异常', error)
24
- }
25
- }
26
- /**
27
- * 获取抄表员
28
- * @returns {Promise<void>}
29
- */
30
- async function getGasman () {
31
- try {
32
- const getGasman = await post(SEARCH, {
33
- source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
34
- userid: Vue.$login.f.id
35
- })
36
- const gasman = []
37
- for (let i = 0; i < getGasman.length; i++) {
38
- gasman.push(getGasman[i])
39
- }
40
- Vue.$login.f.f_gasman = gasman
41
- } catch (error) {
42
- Vue.$login.f.f_gasman = []
43
- console.log('获取抄表员异常', error)
44
- }
45
- }
46
- /**
47
- * 获取资源服务权限
48
- * @returns {Promise<void>}
49
- */
50
- async function getLic () {
51
- try {
52
- const getLic = await post(SEARCH, { data: {
53
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
54
- userid: Vue.$login.f.id
55
- } }, { resolveMsg: null, rejectMsg: null })
56
- const arry = []
57
- getLic.forEach((item) => {
58
- arry.push(item.name)
59
- })
60
- Vue.$login.f.lics = arry
61
- } catch (error) {
62
- Vue.$login.f.f_gasman = []
63
- console.log('获取资源服务权限异常', error)
64
- }
65
- }
66
- /**
67
- * 获取界面细节 (界面权限)
68
- * @returns {Promise<void>}
69
- */
70
- async function getViewDetails () {
71
- try {
72
- const viewDetails = await post(SEARCH, {
73
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
74
- userid: Vue.$login.f.id
75
- }, { resolveMsg: null, rejectMsg: null })
76
- const r = viewDetails
77
- Vue.$login.r = []
78
- r.forEach(x => Vue.$login.r.push(x.name))
79
- } catch (error) {
80
- Vue.$login.r = []
81
- console.log('获取界面细节异常', error)
82
- }
83
- }
84
- /**
85
- * 获取资源功能
86
- * @returns {Promise<void>}
87
- */
88
- async function getResourceFunction () {
89
- try {
90
- const resourceFunction = await post(SEARCH, {
91
- source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
92
- userid: Vue.$login.f.id
93
- }, { resolveMsg: null, rejectMsg: null })
94
- return resourceFunction
95
- } catch (error) {
96
- console.log('获取资源功能异常', error)
97
- }
98
- }
99
- /**
100
- * 获取组织管理数据
101
- * @returns {Promise<void>}
102
- */
103
- async function getOrganization () {
104
- try {
105
- const resourceFunction = await post(SEARCH, {
106
- source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$||row.getType() == $zone$))',
107
- userid: Vue.$login.f.id
108
- }, { resolveMsg: null, rejectMsg: null })
109
- return resourceFunction
110
- } catch (error) {
111
- console.log('获取组织管理数据异常', error)
112
- }
113
- }
114
- /**
115
- * 完整资源树筛选指定名称的资源
116
- * @param fun 要筛选的资源树
117
- * @param name 筛选的资源名称
118
- * @returns {*}
119
- */
120
- function searchFun (fun, name) {
121
- if (fun.length > 0) {
122
- if (fun[0].name == name) {
123
- return fun[0].children
124
- } else {
125
- return searchFun(fun[0].children, name)
126
- }
127
- }
128
- }
129
-
130
- const loginGen = async function (response) {
131
- Vue.$login.f = response
132
- await Promise.all([Vue.$appdata.load(), getGasman(), getLic(), getViewDetails()])
133
- const login = {
134
- f: Vue.$login.f,
135
- jwt: Vue.$login.f.id,
136
- r: Vue.$login.r
137
- }
138
- Vue.$store.commit('account/setLogin', login)
139
- }
140
- const GetLoginInfoService = {
141
- install (Vue) {
142
- // 给vue增添对话框显示方法
143
- Vue.$login = Vue.prototype.$login = GetLoginInfoService
144
- },
145
-
146
- f: {
147
-
148
- },
149
-
150
- login (response) {
151
- return loginGen(response)
152
- },
153
-
154
- convertToIn (val) {
155
- let temp = ''
156
- if (val instanceof Array) {
157
- if (val.length >= 1) {
158
- temp = '('
159
- val.forEach((res) => {
160
- temp += `'${res}',`
161
- })
162
- temp = temp.substr(0, temp.length - 1) + ')'
163
- }
164
- }
165
- return temp
166
- },
167
- toStandardTimeString () {
168
- const dt = new Date()
169
- const month = dt.getMonth() + 1
170
- const date = dt.getDate()
171
- const hour = dt.getHours()
172
- const min = dt.getMinutes()
173
- const sec = dt.getSeconds()
174
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
175
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
176
- },
177
-
178
- guid () {
179
- const buf = new Uint16Array(8)
180
- window.crypto.getRandomValues(buf)
181
- const S4 = function (num) {
182
- let ret = num.toString()
183
- while (ret.length < 4) {
184
- ret = '0' + ret
185
- }
186
- return ret
187
- }
188
- return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
189
- },
190
- required (param) {
191
- if (typeof param === 'number' && param === 0) {
192
- return false
193
- }
194
- if (!param) {
195
- return true
196
- }
197
- param = param + ''
198
- param = param.trim()
199
- return !param
200
- },
201
-
202
- isInt (n) {
203
- return !window.isNaN(n) && n % 1 === 0
204
- },
205
-
206
- // 不能选择器中截取掉多余的字符
207
- orgName (name) {
208
- return name.substring(10)
209
- },
210
-
211
- addDate (date, days) {
212
- // 求取当前时间的工具
213
- let endDate = new Date(date)
214
- endDate = endDate.valueOf()
215
- endDate = endDate + days * 24 * 60 * 60 * 1000
216
- endDate = new Date(endDate)
217
- const month = endDate.getMonth() + 1
218
- const day = endDate.getDate()
219
- const hour = endDate.getHours()
220
- const min = endDate.getMinutes()
221
- const sec = endDate.getSeconds()
222
- return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
223
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
224
- // return a
225
- },
226
-
227
- // 对字符串进行加密
228
- compileStr (code) {
229
- let c = String.fromCharCode(code.charCodeAt(0) + code.length)
230
- for (let i = 1; i < code.length; i++) {
231
- c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
232
- }
233
- return escape(c)
234
- },
235
-
236
- // 字符串进行解密
237
- uncompileStr (code) {
238
- code = unescape(code)
239
- let c = String.fromCharCode(code.charCodeAt(0) - code.length)
240
- for (let i = 1; i < code.length; i++) {
241
- c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
242
- }
243
- return c
244
- }
245
- }
246
-
247
- export default GetLoginInfoService
248
- export {
249
- getResourceFunction,
250
- getOrganization,
251
- searchFun
252
- }
1
+ import Vue from 'vue'
2
+ import { SEARCH } from '@vue2-client/services/apiService'
3
+ import { post } from '@vue2-client/services/api'
4
+
5
+ /**
6
+ * 获取片区
7
+ * @returns {Promise<void>}
8
+ */
9
+ // eslint-disable-next-line
10
+ async function getAllArea () {
11
+ try {
12
+ const getAllArea = await post(SEARCH, {
13
+ source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
14
+ userid: Vue.$login.f.id
15
+ })
16
+ const areaTemp = []
17
+ for (let i = 0; i < getAllArea.length; i++) {
18
+ areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
19
+ }
20
+ Vue.$login.f.f_allArea = areaTemp
21
+ } catch (error) {
22
+ Vue.$login.f.f_allArea = []
23
+ console.log('获取片区异常', error)
24
+ }
25
+ }
26
+ /**
27
+ * 获取抄表员
28
+ * @returns {Promise<void>}
29
+ */
30
+ async function getGasman () {
31
+ try {
32
+ const getGasman = await post(SEARCH, {
33
+ source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
34
+ userid: Vue.$login.f.id
35
+ })
36
+ const gasman = []
37
+ for (let i = 0; i < getGasman.length; i++) {
38
+ gasman.push(getGasman[i])
39
+ }
40
+ Vue.$login.f.f_gasman = gasman
41
+ } catch (error) {
42
+ Vue.$login.f.f_gasman = []
43
+ console.log('获取抄表员异常', error)
44
+ }
45
+ }
46
+ /**
47
+ * 获取资源服务权限
48
+ * @returns {Promise<void>}
49
+ */
50
+ async function getLic () {
51
+ try {
52
+ const getLic = await post(SEARCH, { data: {
53
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
54
+ userid: Vue.$login.f.id
55
+ } }, { resolveMsg: null, rejectMsg: null })
56
+ const arry = []
57
+ getLic.forEach((item) => {
58
+ arry.push(item.name)
59
+ })
60
+ Vue.$login.f.lics = arry
61
+ } catch (error) {
62
+ Vue.$login.f.f_gasman = []
63
+ console.log('获取资源服务权限异常', error)
64
+ }
65
+ }
66
+ /**
67
+ * 获取界面细节 (界面权限)
68
+ * @returns {Promise<void>}
69
+ */
70
+ async function getViewDetails () {
71
+ try {
72
+ const viewDetails = await post(SEARCH, {
73
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
74
+ userid: Vue.$login.f.id
75
+ }, { resolveMsg: null, rejectMsg: null })
76
+ const r = viewDetails
77
+ Vue.$login.r = []
78
+ r.forEach(x => Vue.$login.r.push(x.name))
79
+ } catch (error) {
80
+ Vue.$login.r = []
81
+ console.log('获取界面细节异常', error)
82
+ }
83
+ }
84
+ /**
85
+ * 获取资源功能
86
+ * @returns {Promise<void>}
87
+ */
88
+ async function getResourceFunction () {
89
+ try {
90
+ const resourceFunction = await post(SEARCH, {
91
+ source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
92
+ userid: Vue.$login.f.id
93
+ }, { resolveMsg: null, rejectMsg: null })
94
+ return resourceFunction
95
+ } catch (error) {
96
+ console.log('获取资源功能异常', error)
97
+ }
98
+ }
99
+ /**
100
+ * 获取组织管理数据
101
+ * @returns {Promise<void>}
102
+ */
103
+ async function getOrganization () {
104
+ try {
105
+ const resourceFunction = await post(SEARCH, {
106
+ source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$||row.getType() == $zone$))',
107
+ userid: Vue.$login.f.id
108
+ }, { resolveMsg: null, rejectMsg: null })
109
+ return resourceFunction
110
+ } catch (error) {
111
+ console.log('获取组织管理数据异常', error)
112
+ }
113
+ }
114
+ /**
115
+ * 完整资源树筛选指定名称的资源
116
+ * @param fun 要筛选的资源树
117
+ * @param name 筛选的资源名称
118
+ * @returns {*}
119
+ */
120
+ function searchFun (fun, name) {
121
+ if (fun.length > 0) {
122
+ if (fun[0].name === name) {
123
+ return fun[0].children
124
+ } else {
125
+ return searchFun(fun[0].children, name)
126
+ }
127
+ }
128
+ }
129
+
130
+ const loginGen = async function (response) {
131
+ Vue.$login.f = response
132
+ await Promise.all([Vue.$appdata.load(), getGasman(), getLic(), getViewDetails()])
133
+ const login = {
134
+ f: Vue.$login.f,
135
+ jwt: Vue.$login.f.id,
136
+ r: Vue.$login.r
137
+ }
138
+ Vue.$store.commit('account/setLogin', login)
139
+ }
140
+ const GetLoginInfoService = {
141
+ install (Vue) {
142
+ // 给vue增添对话框显示方法
143
+ Vue.$login = Vue.prototype.$login = GetLoginInfoService
144
+ },
145
+
146
+ f: {
147
+
148
+ },
149
+
150
+ login (response) {
151
+ return loginGen(response)
152
+ },
153
+
154
+ convertToIn (val) {
155
+ let temp = ''
156
+ if (val instanceof Array) {
157
+ if (val.length >= 1) {
158
+ temp = '('
159
+ val.forEach((res) => {
160
+ temp += `'${res}',`
161
+ })
162
+ temp = temp.substr(0, temp.length - 1) + ')'
163
+ }
164
+ }
165
+ return temp
166
+ },
167
+ toStandardTimeString () {
168
+ const dt = new Date()
169
+ const month = dt.getMonth() + 1
170
+ const date = dt.getDate()
171
+ const hour = dt.getHours()
172
+ const min = dt.getMinutes()
173
+ const sec = dt.getSeconds()
174
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
175
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
176
+ },
177
+
178
+ guid () {
179
+ const buf = new Uint16Array(8)
180
+ window.crypto.getRandomValues(buf)
181
+ const S4 = function (num) {
182
+ let ret = num.toString()
183
+ while (ret.length < 4) {
184
+ ret = '0' + ret
185
+ }
186
+ return ret
187
+ }
188
+ return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
189
+ },
190
+ required (param) {
191
+ if (typeof param === 'number' && param === 0) {
192
+ return false
193
+ }
194
+ if (!param) {
195
+ return true
196
+ }
197
+ param = param + ''
198
+ param = param.trim()
199
+ return !param
200
+ },
201
+
202
+ isInt (n) {
203
+ return !window.isNaN(n) && n % 1 === 0
204
+ },
205
+
206
+ // 不能选择器中截取掉多余的字符
207
+ orgName (name) {
208
+ return name.substring(10)
209
+ },
210
+
211
+ addDate (date, days) {
212
+ // 求取当前时间的工具
213
+ let endDate = new Date(date)
214
+ endDate = endDate.valueOf()
215
+ endDate = endDate + days * 24 * 60 * 60 * 1000
216
+ endDate = new Date(endDate)
217
+ const month = endDate.getMonth() + 1
218
+ const day = endDate.getDate()
219
+ const hour = endDate.getHours()
220
+ const min = endDate.getMinutes()
221
+ const sec = endDate.getSeconds()
222
+ return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
223
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
224
+ // return a
225
+ },
226
+
227
+ // 对字符串进行加密
228
+ compileStr (code) {
229
+ let c = String.fromCharCode(code.charCodeAt(0) + code.length)
230
+ for (let i = 1; i < code.length; i++) {
231
+ c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
232
+ }
233
+ return escape(c)
234
+ },
235
+
236
+ // 字符串进行解密
237
+ uncompileStr (code) {
238
+ code = unescape(code)
239
+ let c = String.fromCharCode(code.charCodeAt(0) - code.length)
240
+ for (let i = 1; i < code.length; i++) {
241
+ c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
242
+ }
243
+ return c
244
+ }
245
+ }
246
+
247
+ export default GetLoginInfoService
248
+ export {
249
+ getResourceFunction,
250
+ getOrganization,
251
+ searchFun
252
+ }
@@ -55,7 +55,7 @@ export default class PagedList {
55
55
 
56
56
  // 初始填充数据空行
57
57
  // isNuN标记本行是否为空行
58
- if (isBlank == true) {
58
+ if (isBlank === true) {
59
59
  for (let i = 1; i <= pageSize; i++) {
60
60
  this.rows.push({ isNuN: 'true' })
61
61
  }
@@ -142,9 +142,9 @@ export default class PagedList {
142
142
  item.nanoid = nanoid()
143
143
  return item
144
144
  })
145
- if (this.isBlank == true) {
145
+ if (this.isBlank === true) {
146
146
  const size = response.length % this.pageSize
147
- if (pageNo == this.totalPage) {
147
+ if (pageNo === this.totalPage) {
148
148
  for (let i = 1; i <= this.pageSize - size; i++) {
149
149
  this.rows.push({ isNuN: 'true' })
150
150
  }
@@ -1,32 +1,32 @@
1
- // 语句模式
2
- const MODE = {
3
- STATEMENTS: 's', // 语句模式
4
- PHRASAL: 'p' // 词组模式
5
- }
6
-
7
- const VueI18nPlugin = {
8
- install: function (Vue) {
9
- Vue.mixin({
10
- methods: {
11
- $ta (syntaxKey, mode) {
12
- const _mode = mode || MODE.STATEMENTS
13
- const keys = syntaxKey.split('|')
14
- const _this = this
15
- const locale = this.$i18n.locale
16
- let message = ''
17
- const splitter = locale == 'US' ? ' ' : ''
18
- // 拼接 message
19
- keys.forEach(key => {
20
- message += _this.$t(key) + splitter
21
- })
22
- // 英文环境语句模式下,转换单词大小写
23
- if (keys.length > 0 && _mode == MODE.STATEMENTS && locale == 'US') {
24
- message = message.charAt(0).toUpperCase() + message.toLowerCase().substring(1)
25
- }
26
- return message
27
- }
28
- }
29
- })
30
- }
31
- }
32
- export default VueI18nPlugin
1
+ // 语句模式
2
+ const MODE = {
3
+ STATEMENTS: 's', // 语句模式
4
+ PHRASAL: 'p' // 词组模式
5
+ }
6
+
7
+ const VueI18nPlugin = {
8
+ install: function (Vue) {
9
+ Vue.mixin({
10
+ methods: {
11
+ $ta (syntaxKey, mode) {
12
+ const _mode = mode || MODE.STATEMENTS
13
+ const keys = syntaxKey.split('|')
14
+ const _this = this
15
+ const locale = this.$i18n.locale
16
+ let message = ''
17
+ const splitter = locale === 'US' ? ' ' : ''
18
+ // 拼接 message
19
+ keys.forEach(key => {
20
+ message += _this.$t(key) + splitter
21
+ })
22
+ // 英文环境语句模式下,转换单词大小写
23
+ if (keys.length > 0 && _mode === MODE.STATEMENTS && locale === 'US') {
24
+ message = message.charAt(0).toUpperCase() + message.toLowerCase().substring(1)
25
+ }
26
+ return message
27
+ }
28
+ }
29
+ })
30
+ }
31
+ }
32
+ export default VueI18nPlugin
@@ -1,38 +1,38 @@
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 | -
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 | - |