@zscreate/zhxy-app-component 1.0.187 → 1.0.189

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 (80) hide show
  1. package/components/DataTable/DataTable.vue +342 -342
  2. package/components/dying318-picker/Demo.vue +342 -342
  3. package/components/dying318-picker/Picker.nvue +441 -441
  4. package/components/dying318-picker/Picker.vue +442 -442
  5. package/components/dying318-picker/Pickers.vue +321 -321
  6. package/components/dying318-picker/README.md +479 -479
  7. package/components/easydrag-sort/easydrag-sort.vue +248 -248
  8. package/components/evan-form/evan-form.vue +102 -102
  9. package/components/evan-form/utils.js +127 -127
  10. package/components/evan-form-item/components/responsibility.vue +128 -128
  11. package/components/evan-form-item/evan-form-item.vue +2037 -2037
  12. package/components/evan-form-item/mixins/computedMixin.js +44 -44
  13. package/components/evan-form-item/mixins/pubSubMixin.js +191 -187
  14. package/components/evan-form-item/mixins/validateByApiMinxins.js +34 -34
  15. package/components/evan-form-item/mixins/validateFormMixin.js +74 -74
  16. package/components/evan-form-item/mixins/valueChangeMixin.js +92 -92
  17. package/components/evan-form-item/utilForForm.js +35 -35
  18. package/components/evan-form-item/utils.js +62 -62
  19. package/components/form-container/css/style_2.less +365 -365
  20. package/components/form-container/data.js +709 -709
  21. package/components/form-container/form-container.vue +1094 -1094
  22. package/components/fullModal/fullModal.vue +92 -92
  23. package/components/jin-edit/jin-edit.vue +327 -327
  24. package/components/jin-edit/jin-icons.vue +48 -48
  25. package/components/jin-edit/readme.md +64 -64
  26. package/components/l-file/l-file.vue +267 -267
  27. package/components/lb-picker/index.vue +300 -300
  28. package/components/m-textarea/m-textarea.vue +88 -88
  29. package/components/rich-editor/assets/iconfont.css +240 -240
  30. package/components/rich-editor/editor.css +46 -46
  31. package/components/rich-editor/index.vue +335 -335
  32. package/components/rich-editor/t-color-picker.vue +786 -786
  33. package/components/signatrue-write/signatrue-write.vue +228 -228
  34. package/components/t-color-picker/t-color-picker.vue +784 -784
  35. package/components/uni-datetime-picker/changelog.md +76 -76
  36. package/components/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue +182 -182
  37. package/components/uni-datetime-picker/components/uni-datetime-picker/calendar.js +546 -546
  38. package/components/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +1030 -1030
  39. package/components/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json +19 -19
  40. package/components/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js +8 -8
  41. package/components/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json +19 -19
  42. package/components/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json +19 -19
  43. package/components/uni-datetime-picker/components/uni-datetime-picker/keypress.js +44 -44
  44. package/components/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue +927 -927
  45. package/components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +966 -966
  46. package/components/uni-datetime-picker/components/uni-datetime-picker/util.js +437 -437
  47. package/components/uni-datetime-picker/components/uni-datetime-picker/year-mont-picker.vue +901 -901
  48. package/components/uni-datetime-picker/components/uni-datetime-picker/year-picker.vue +271 -271
  49. package/components/uni-datetime-picker/package.json +89 -89
  50. package/components/uni-datetime-picker/readme.md +159 -159
  51. package/components/uni-icons/icons.js +96 -96
  52. package/components/uni-icons/uni-icons.vue +57 -57
  53. package/components/uni-popup/message.js +29 -29
  54. package/components/uni-popup/popup.js +25 -25
  55. package/components/uni-popup/uni-popup-dialog.vue +243 -243
  56. package/components/uni-popup/uni-popup-message.vue +116 -116
  57. package/components/uni-popup/uni-popup-share.vue +165 -165
  58. package/components/uni-popup/uni-popup.vue +297 -297
  59. package/components/uni-rate/uni-rate.vue +361 -361
  60. package/components/uni-transition/uni-transition.vue +279 -279
  61. package/components/uploadFile/uploadFile.vue +316 -316
  62. package/components/userSelectByRole/userSelectByRole.vue +220 -220
  63. package/components/viewcomponents/applicateGrid.vue +96 -96
  64. package/components/viewcomponents/card.vue +166 -166
  65. package/components/viewcomponents/formCard.vue +82 -82
  66. package/components/viewcomponents/infocell.vue +122 -122
  67. package/components/viewcomponents/navsearch.vue +59 -59
  68. package/components/viewcomponents/newscontent.vue +85 -85
  69. package/components/xp-picker/util.js +104 -104
  70. package/components/xp-picker/xp-picker.vue +330 -330
  71. package/index.js +9 -9
  72. package/package.json +30 -30
  73. package/static/iconfont.css +32 -32
  74. package/static/uni.css +1449 -1449
  75. package/utils/formula_run.js +1 -1
  76. package/utils/js-interp.js +6501 -6501
  77. package/utils/js-interp.md +10 -10
  78. package/utils/moment.js +4600 -4600
  79. package/utils/util.js +225 -225
  80. package/components/evan-form-item/mixins/commonMixin.js +0 -15
@@ -1,342 +1,342 @@
1
- <template>
2
- <view class="wrap" :style="{ height: widget.options.height * 1.5 + 'rpx' }" v-if="dataModel && dataModel.length > 0">
3
- <!-- @scrolltolower:滚动到底部触发 lower-threshold:距离底部多少距离触发@scrolltolower -->
4
- <view style="overflow: auto;">
5
- <view class="top" id="top" :style="{ width: tableWidths + 'rpx', 'padding-left': '0rpx' }">
6
- <view class="table-header-data">
7
- <view v-for="(h, n) in header" :key='n' :class="{ 'header_dyg': true, 'flexs': h.flxe, }"
8
- :style="{ width: h.hWidth + 'rpx' }">
9
- <view v-if="h.columnName !== 'slot'" style="line-height: 40px;">{{ h.columnName }}</view>
10
- <view v-else>
11
- <u-checkbox-group>
12
- <u-checkbox @change="checkboxChangeAll" v-model="checkedAll" name="all"></u-checkbox>
13
- </u-checkbox-group>
14
- </view>
15
- </view>
16
- </view>
17
- </view>
18
- <view class="bottom" :style="{ maxHeight: (widget.options.height - 70) * 1.5 + 'rpx', width: tableWidths + 'rpx', 'padding-left': '0rpx' }"
19
- v-if="tableData.length > 0">
20
- <view class="tablebox" v-for="(t, s) in tableData" :key='s' @click="jumpDetailed(t)">
21
- <view v-for="(h, n) in header" :key="n"
22
- :class="{ 'table_dyg': true, 'tdColClass': h.bgcolor, 'tdRowClass': t.bgcolor, 'flexs': h.flxe, }"
23
- :style="{ width: h.hWidth + 'rpx' }">
24
- <!-- 不等于操作列就显示文字 -->
25
- <text v-if="h.columnCode !== 'action' && h.columnName !== 'slot'" :style="{ color: getColor(t, h), }">{{
26
- t[h.columnCode] ? t[h.columnCode] : '' }}</text>
27
- <view v-else-if="h.columnName === 'slot'">
28
- <u-checkbox-group @change="checkboxChange">
29
- <u-checkbox v-model="t.checked" :name="t[rowKey]"></u-checkbox>
30
- </u-checkbox-group>
31
- </view>
32
- <!-- 操作列显示按钮,后期用插槽 -->
33
- <view class="uni-group" v-else style="background-color: #fff;">
34
- <button class="uni-button" size="mini" type="primary" style="margin-right: 5px;"
35
- @click="editTable(t)">编辑</button>
36
- <button class="uni-button" size="mini" type="warn" @click="deleteTable(t)">删除</button>
37
- </view>
38
- </view>
39
- </view>
40
- </view>
41
- </view>
42
- <view class="empty" v-if="tableData.length == 0">
43
- <!-- <image src="../../static/images/empty.png" style="width: 90vw;height: 400rpx;margin: 50rpx 20rpx;" /> -->
44
- <view class="empty-text" style="text-align: center;width: 100%;">暂无数据</view>
45
- </view>
46
- </view>
47
- </template>
48
-
49
- <script>
50
- // 表头配置:flxe(固定列),bgcolor(列底纹)
51
- // 表体配置:bgcolor(行底纹)
52
- export default {
53
- props: {
54
- dataModel: {
55
- type: [Array, String],
56
- required: true,
57
- default: function () {
58
- return [];
59
- }
60
- },
61
- widget: {
62
- type: Object,
63
- required: true,
64
- default: function () {
65
- return {};
66
- }
67
- },
68
- },
69
- data() {
70
- return {
71
- //表体
72
- tableData: [],
73
- //表头
74
- header: [],
75
- // 表格总长度
76
- tableWidths: 0,
77
- // 全选
78
- checkedAll: false,
79
- flxed: false,
80
- isAll: false,
81
- seletedData: []
82
- }
83
- },
84
- watch: {
85
- // 监听列表
86
- dataModel: {
87
- async handler(a, b) {
88
- console.log(a, b);
89
- if(a && a.length > 0) {
90
- await this.getColumsList(this.widget.options.defaultSQL.querySql)
91
- this.tableData = a
92
- if (!this.header.some(item => item.hWidth)) this.tableWidth()
93
- }
94
- },
95
- deep: true,
96
- immediate: true,
97
- },
98
- },
99
- created() {
100
- },
101
- methods: {
102
- // 获取表头
103
- getColumsList(id) {
104
- this.$u.get('/dataset/getDatasetColumns', { id }).then(res => {
105
- if (!res.success) return
106
- this.header = res.result ? res.result : []
107
- if (!this.header.some(item => item.hWidth)) this.tableWidth()
108
- })
109
- },
110
- // 重置复选框
111
- reseChecked() {
112
- let obj = this.tableData[0]
113
- obj.checked = false
114
- this.$set(this.tableData, 0, obj);
115
- this.checkedAll = false
116
- this.$emit('isSelectAll', false);
117
- },
118
- // 单选
119
- checkboxChange(e) {
120
- let idx = this.tableData.findIndex(item => item[this.rowKey] === e.name)
121
- let obj = this.tableData[idx]
122
- obj.checked = e.value
123
- this.$set(this.tableData, idx, obj)
124
- if (!e.value && !this.tableData.every(item => item.checked)) this.checkedAll = false
125
- if (e.value && this.tableData.every(item => item.checked)) this.checkedAll = true
126
- },
127
- // 全选
128
- checkboxChangeAll(e) {
129
- if (e.value) {
130
- this.tableData.forEach(item => item.checked = true)
131
- this.$emit('isSelectAll', true);
132
- } else {
133
- this.tableData.forEach(item => item.checked = false)
134
- this.$emit('isSelectAll', false);
135
- }
136
- },
137
- // 返回行数据
138
- jumpDetailed(row) {
139
- this.$emit('rowData', row)
140
- },
141
- // 颜色对比
142
- getColor(row, col) {
143
- let color = 'black'
144
- // 传值给父组件,通过父组件的方法内计算判断当前单元格数据是否需要标红,然后通过回调函数,返回一个color值来渲染
145
- this.$emit('getTextColor', row, col, val => {
146
- color = val
147
- })
148
- return color
149
- },
150
- // 修改按钮
151
- editTable(val) {
152
- this.$emit('getEdit', val)
153
- },
154
- // 删除按钮
155
- deleteTable(val) {
156
- this.$emit('getDelete', val)
157
- },
158
- // 计算单元格宽度
159
- tableWidth() {
160
- let w = 0
161
- this.header.forEach((item, index) => {
162
- item['hWidth'] = this.replaceSpecialCharacters(item.columnName) * 40
163
- if (this.tableData.length > 0) {
164
- this.tableData.forEach((info, index) => {
165
- if (info[item.columnCode] && info[item.columnCode].length > item.columnName.length && this.replaceSpecialCharacters(info[item.columnCode]) * 40 > item['hWidth']) {
166
- item['hWidth'] = this.replaceSpecialCharacters(info[item.columnCode]) * 40
167
- }
168
- })
169
- }
170
- w += item['hWidth'] //叠加表格总长度
171
- })
172
- this.tableWidths = w //给表格赋值总长度
173
- if(this.tableWidths < 700) {
174
- this.tableWidths = 700
175
- this.header.forEach(item => {
176
- item['hWidth'] = 700 / this.header.length
177
- })
178
- }
179
- console.log(this.header);
180
- },
181
- // 替换特殊字符
182
- replaceSpecialCharacters(str) {
183
- let chineseCount = 0;
184
- let englishCount = 0;
185
- let digitCount = 0;
186
- for (let i = 0; i < str.length; i++) {
187
- const char = str[i];
188
- if (this.isChineseCharacter(char)) {
189
- chineseCount++;
190
- } else if (this.isEnglishCharacter(char)) {
191
- englishCount++;
192
- } else if (this.isDigit(char)) {
193
- digitCount++;
194
- }
195
- }
196
- return chineseCount + ((englishCount + digitCount) * 0.5)
197
- },
198
- isChineseCharacter(char) {
199
- // 使用 Unicode 范围判断是否为中文字符
200
- return /^[\u4e00-\u9fff]$/.test(char);
201
- },
202
- isEnglishCharacter(char) {
203
- // 使用正则表达式判断是否为英文字符
204
- return /^[a-zA-Z]$/.test(char);
205
- },
206
- isDigit(char) {
207
- // 使用正则表达式判断是否为数字字符
208
- return /^[0-9]$/.test(char);
209
- },
210
- }
211
- }
212
- </script>
213
-
214
- <style lang="less" scoped>
215
- /deep/ .u-checkbox__label {
216
- display: none !important;
217
- }
218
-
219
- /deep/ .uni-scroll-view-content {
220
- overflow-x: scroll;
221
-
222
- }
223
-
224
- .wrap {
225
- width: 100%;
226
-
227
- .empty {
228
- // margin: 200rpx 50rpx;
229
- }
230
- }
231
-
232
- // 表头
233
- .top {
234
- position: sticky; //表头向上滚动时固定住
235
- top: 0;
236
- //width: 750px; //左右滚动时不会把固定的表头滚动走
237
- z-index: 100; //滑动时表头不被覆盖
238
-
239
- .table-header-data{
240
- display: flex;
241
- overflow: visible;
242
-
243
- .flxed {
244
- // position: fixed;
245
- position: sticky;
246
- // top: 0;
247
- left: 0;
248
- border-left: 1px solid #ccc;
249
- }
250
-
251
- // .header_dyg:nth-child(2) {
252
- // padding-left: 90rpx;
253
- // }
254
- .header_dyg:first-child {
255
- border-left: 1px solid #ccc;
256
- }
257
-
258
- .header_dyg {
259
- height: 40px;
260
- text-align: center;
261
- line-height: 40px;
262
- border-top: 1px solid #ccc;
263
- border-right: 1px solid #ccc;
264
- border-bottom: 1px solid #ccc;
265
- padding: 0 5px;
266
- background-color: #f5f5f6;
267
- white-space: nowrap;
268
- overflow: hidden;
269
- text-overflow: ellipsis;
270
- font-size: 14px;
271
- font-weight: bold;
272
- color: #2b2b2b;
273
- flex-shrink: 0;
274
- }
275
-
276
- // 列定位固定单元格
277
- .flexs {
278
- position: absolute;
279
- left: 0;
280
- background-color: #f5f5f6;
281
- z-index: 10;
282
- }
283
- }
284
-
285
-
286
- }
287
-
288
-
289
- // 表格列表
290
- .bottom {
291
- // overflow-y: scroll;
292
- // padding-left: 77rpx;
293
-
294
- .tablebox {
295
- display: flex;
296
- font-size: 14px;
297
- overflow: visible;
298
-
299
- .flxed {
300
- position: sticky;
301
- left: 0;
302
- border-left: 1px solid #ccc;
303
- background-color: #fff;
304
- }
305
- .table_dyg:first-child {
306
- border-left: 1px solid #ccc;
307
- }
308
- .table_dyg {
309
- height: 30px;
310
- text-align: center;
311
- line-height: 30px;
312
- white-space: nowrap;
313
- overflow: hidden;
314
- text-overflow: ellipsis;
315
- border-right: 1px solid #ccc;
316
- border-bottom: 1px solid #ccc;
317
- padding: 0 5px;
318
- flex-shrink: 0;
319
- }
320
-
321
- // 列定位固定单元格
322
- .flexs {
323
- position: absolute;
324
- left: 0;
325
- background-color: #fff;
326
- z-index: 10;
327
- }
328
- }
329
- }
330
-
331
- // 列的颜色
332
- .tdColClass {
333
- background-color: #d9edf7;
334
- }
335
-
336
- // 行的颜色
337
- .tdRowClass {
338
- background-color: #afdfe4;
339
- }
340
- </style>
341
-
342
-
1
+ <template>
2
+ <view class="wrap" :style="{ height: widget.options.height * 1.5 + 'rpx' }" v-if="dataModel && dataModel.length > 0">
3
+ <!-- @scrolltolower:滚动到底部触发 lower-threshold:距离底部多少距离触发@scrolltolower -->
4
+ <view style="overflow: auto;">
5
+ <view class="top" id="top" :style="{ width: tableWidths + 'rpx', 'padding-left': '0rpx' }">
6
+ <view class="table-header-data">
7
+ <view v-for="(h, n) in header" :key='n' :class="{ 'header_dyg': true, 'flexs': h.flxe, }"
8
+ :style="{ width: h.hWidth + 'rpx' }">
9
+ <view v-if="h.columnName !== 'slot'" style="line-height: 40px;">{{ h.columnName }}</view>
10
+ <view v-else>
11
+ <u-checkbox-group>
12
+ <u-checkbox @change="checkboxChangeAll" v-model="checkedAll" name="all"></u-checkbox>
13
+ </u-checkbox-group>
14
+ </view>
15
+ </view>
16
+ </view>
17
+ </view>
18
+ <view class="bottom" :style="{ maxHeight: (widget.options.height - 70) * 1.5 + 'rpx', width: tableWidths + 'rpx', 'padding-left': '0rpx' }"
19
+ v-if="tableData.length > 0">
20
+ <view class="tablebox" v-for="(t, s) in tableData" :key='s' @click="jumpDetailed(t)">
21
+ <view v-for="(h, n) in header" :key="n"
22
+ :class="{ 'table_dyg': true, 'tdColClass': h.bgcolor, 'tdRowClass': t.bgcolor, 'flexs': h.flxe, }"
23
+ :style="{ width: h.hWidth + 'rpx' }">
24
+ <!-- 不等于操作列就显示文字 -->
25
+ <text v-if="h.columnCode !== 'action' && h.columnName !== 'slot'" :style="{ color: getColor(t, h), }">{{
26
+ t[h.columnCode] ? t[h.columnCode] : '' }}</text>
27
+ <view v-else-if="h.columnName === 'slot'">
28
+ <u-checkbox-group @change="checkboxChange">
29
+ <u-checkbox v-model="t.checked" :name="t[rowKey]"></u-checkbox>
30
+ </u-checkbox-group>
31
+ </view>
32
+ <!-- 操作列显示按钮,后期用插槽 -->
33
+ <view class="uni-group" v-else style="background-color: #fff;">
34
+ <button class="uni-button" size="mini" type="primary" style="margin-right: 5px;"
35
+ @click="editTable(t)">编辑</button>
36
+ <button class="uni-button" size="mini" type="warn" @click="deleteTable(t)">删除</button>
37
+ </view>
38
+ </view>
39
+ </view>
40
+ </view>
41
+ </view>
42
+ <view class="empty" v-if="tableData.length == 0">
43
+ <!-- <image src="../../static/images/empty.png" style="width: 90vw;height: 400rpx;margin: 50rpx 20rpx;" /> -->
44
+ <view class="empty-text" style="text-align: center;width: 100%;">暂无数据</view>
45
+ </view>
46
+ </view>
47
+ </template>
48
+
49
+ <script>
50
+ // 表头配置:flxe(固定列),bgcolor(列底纹)
51
+ // 表体配置:bgcolor(行底纹)
52
+ export default {
53
+ props: {
54
+ dataModel: {
55
+ type: [Array, String],
56
+ required: true,
57
+ default: function () {
58
+ return [];
59
+ }
60
+ },
61
+ widget: {
62
+ type: Object,
63
+ required: true,
64
+ default: function () {
65
+ return {};
66
+ }
67
+ },
68
+ },
69
+ data() {
70
+ return {
71
+ //表体
72
+ tableData: [],
73
+ //表头
74
+ header: [],
75
+ // 表格总长度
76
+ tableWidths: 0,
77
+ // 全选
78
+ checkedAll: false,
79
+ flxed: false,
80
+ isAll: false,
81
+ seletedData: []
82
+ }
83
+ },
84
+ watch: {
85
+ // 监听列表
86
+ dataModel: {
87
+ async handler(a, b) {
88
+ console.log(a, b);
89
+ if(a && a.length > 0) {
90
+ await this.getColumsList(this.widget.options.defaultSQL.querySql)
91
+ this.tableData = a
92
+ if (!this.header.some(item => item.hWidth)) this.tableWidth()
93
+ }
94
+ },
95
+ deep: true,
96
+ immediate: true,
97
+ },
98
+ },
99
+ created() {
100
+ },
101
+ methods: {
102
+ // 获取表头
103
+ getColumsList(id) {
104
+ this.$u.get('/dataset/getDatasetColumns', { id }).then(res => {
105
+ if (!res.success) return
106
+ this.header = res.result ? res.result : []
107
+ if (!this.header.some(item => item.hWidth)) this.tableWidth()
108
+ })
109
+ },
110
+ // 重置复选框
111
+ reseChecked() {
112
+ let obj = this.tableData[0]
113
+ obj.checked = false
114
+ this.$set(this.tableData, 0, obj);
115
+ this.checkedAll = false
116
+ this.$emit('isSelectAll', false);
117
+ },
118
+ // 单选
119
+ checkboxChange(e) {
120
+ let idx = this.tableData.findIndex(item => item[this.rowKey] === e.name)
121
+ let obj = this.tableData[idx]
122
+ obj.checked = e.value
123
+ this.$set(this.tableData, idx, obj)
124
+ if (!e.value && !this.tableData.every(item => item.checked)) this.checkedAll = false
125
+ if (e.value && this.tableData.every(item => item.checked)) this.checkedAll = true
126
+ },
127
+ // 全选
128
+ checkboxChangeAll(e) {
129
+ if (e.value) {
130
+ this.tableData.forEach(item => item.checked = true)
131
+ this.$emit('isSelectAll', true);
132
+ } else {
133
+ this.tableData.forEach(item => item.checked = false)
134
+ this.$emit('isSelectAll', false);
135
+ }
136
+ },
137
+ // 返回行数据
138
+ jumpDetailed(row) {
139
+ this.$emit('rowData', row)
140
+ },
141
+ // 颜色对比
142
+ getColor(row, col) {
143
+ let color = 'black'
144
+ // 传值给父组件,通过父组件的方法内计算判断当前单元格数据是否需要标红,然后通过回调函数,返回一个color值来渲染
145
+ this.$emit('getTextColor', row, col, val => {
146
+ color = val
147
+ })
148
+ return color
149
+ },
150
+ // 修改按钮
151
+ editTable(val) {
152
+ this.$emit('getEdit', val)
153
+ },
154
+ // 删除按钮
155
+ deleteTable(val) {
156
+ this.$emit('getDelete', val)
157
+ },
158
+ // 计算单元格宽度
159
+ tableWidth() {
160
+ let w = 0
161
+ this.header.forEach((item, index) => {
162
+ item['hWidth'] = this.replaceSpecialCharacters(item.columnName) * 40
163
+ if (this.tableData.length > 0) {
164
+ this.tableData.forEach((info, index) => {
165
+ if (info[item.columnCode] && info[item.columnCode].length > item.columnName.length && this.replaceSpecialCharacters(info[item.columnCode]) * 40 > item['hWidth']) {
166
+ item['hWidth'] = this.replaceSpecialCharacters(info[item.columnCode]) * 40
167
+ }
168
+ })
169
+ }
170
+ w += item['hWidth'] //叠加表格总长度
171
+ })
172
+ this.tableWidths = w //给表格赋值总长度
173
+ if(this.tableWidths < 700) {
174
+ this.tableWidths = 700
175
+ this.header.forEach(item => {
176
+ item['hWidth'] = 700 / this.header.length
177
+ })
178
+ }
179
+ console.log(this.header);
180
+ },
181
+ // 替换特殊字符
182
+ replaceSpecialCharacters(str) {
183
+ let chineseCount = 0;
184
+ let englishCount = 0;
185
+ let digitCount = 0;
186
+ for (let i = 0; i < str.length; i++) {
187
+ const char = str[i];
188
+ if (this.isChineseCharacter(char)) {
189
+ chineseCount++;
190
+ } else if (this.isEnglishCharacter(char)) {
191
+ englishCount++;
192
+ } else if (this.isDigit(char)) {
193
+ digitCount++;
194
+ }
195
+ }
196
+ return chineseCount + ((englishCount + digitCount) * 0.7)
197
+ },
198
+ isChineseCharacter(char) {
199
+ // 使用 Unicode 范围判断是否为中文字符
200
+ return /^[\u4e00-\u9fff]$/.test(char);
201
+ },
202
+ isEnglishCharacter(char) {
203
+ // 使用正则表达式判断是否为英文字符
204
+ return /^[a-zA-Z]$/.test(char);
205
+ },
206
+ isDigit(char) {
207
+ // 使用正则表达式判断是否为数字字符
208
+ return /^[0-9]$/.test(char);
209
+ },
210
+ }
211
+ }
212
+ </script>
213
+
214
+ <style lang="less" scoped>
215
+ /deep/ .u-checkbox__label {
216
+ display: none !important;
217
+ }
218
+
219
+ /deep/ .uni-scroll-view-content {
220
+ overflow-x: scroll;
221
+
222
+ }
223
+
224
+ .wrap {
225
+ width: 100%;
226
+
227
+ .empty {
228
+ // margin: 200rpx 50rpx;
229
+ }
230
+ }
231
+
232
+ // 表头
233
+ .top {
234
+ position: sticky; //表头向上滚动时固定住
235
+ top: 0;
236
+ //width: 750px; //左右滚动时不会把固定的表头滚动走
237
+ z-index: 100; //滑动时表头不被覆盖
238
+
239
+ .table-header-data{
240
+ display: flex;
241
+ overflow: visible;
242
+
243
+ .flxed {
244
+ // position: fixed;
245
+ position: sticky;
246
+ // top: 0;
247
+ left: 0;
248
+ border-left: 1px solid #ccc;
249
+ }
250
+
251
+ // .header_dyg:nth-child(2) {
252
+ // padding-left: 90rpx;
253
+ // }
254
+ .header_dyg:first-child {
255
+ border-left: 1px solid #ccc;
256
+ }
257
+
258
+ .header_dyg {
259
+ height: 40px;
260
+ text-align: center;
261
+ line-height: 40px;
262
+ border-top: 1px solid #ccc;
263
+ border-right: 1px solid #ccc;
264
+ border-bottom: 1px solid #ccc;
265
+ padding: 0 5px;
266
+ background-color: #f5f5f6;
267
+ white-space: nowrap;
268
+ overflow: hidden;
269
+ text-overflow: ellipsis;
270
+ font-size: 14px;
271
+ font-weight: bold;
272
+ color: #2b2b2b;
273
+ flex-shrink: 0;
274
+ }
275
+
276
+ // 列定位固定单元格
277
+ .flexs {
278
+ position: absolute;
279
+ left: 0;
280
+ background-color: #f5f5f6;
281
+ z-index: 10;
282
+ }
283
+ }
284
+
285
+
286
+ }
287
+
288
+
289
+ // 表格列表
290
+ .bottom {
291
+ // overflow-y: scroll;
292
+ // padding-left: 77rpx;
293
+
294
+ .tablebox {
295
+ display: flex;
296
+ font-size: 14px;
297
+ overflow: visible;
298
+
299
+ .flxed {
300
+ position: sticky;
301
+ left: 0;
302
+ border-left: 1px solid #ccc;
303
+ background-color: #fff;
304
+ }
305
+ .table_dyg:first-child {
306
+ border-left: 1px solid #ccc;
307
+ }
308
+ .table_dyg {
309
+ height: 30px;
310
+ text-align: center;
311
+ line-height: 30px;
312
+ white-space: nowrap;
313
+ overflow: hidden;
314
+ text-overflow: ellipsis;
315
+ border-right: 1px solid #ccc;
316
+ border-bottom: 1px solid #ccc;
317
+ padding: 0 5px;
318
+ flex-shrink: 0;
319
+ }
320
+
321
+ // 列定位固定单元格
322
+ .flexs {
323
+ position: absolute;
324
+ left: 0;
325
+ background-color: #fff;
326
+ z-index: 10;
327
+ }
328
+ }
329
+ }
330
+
331
+ // 列的颜色
332
+ .tdColClass {
333
+ background-color: #d9edf7;
334
+ }
335
+
336
+ // 行的颜色
337
+ .tdRowClass {
338
+ background-color: #afdfe4;
339
+ }
340
+ </style>
341
+
342
+