ol-base-components 2.5.0 → 2.6.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.
package/src/App.vue CHANGED
@@ -1,354 +1,416 @@
1
- <template>
2
- <div id="app">
3
- <div>table组件案例</div>
4
- <ol-search
5
- :form-search-data="formSearchData"
6
- @handleSearch="handleSearch"
7
- @handleReset="handleReset"
8
- url="/api/app/admission-info/paged-result"
9
- />
10
- <!-- url="/api/app/admission-info/paged-result" -->
11
-
12
- <ol-table
13
- :paginations="paginations"
14
- :empty-img="tableData.emptyImg"
15
- :btnlist="[]"
16
- url="/api/app/bind-record/bind-record-detail-pages"
17
- :table-data="tableData"
18
- :multiple-selection="multipleSelection"
19
- @SelectionChange="SelectionChange"
20
- @handleSizeChange="handleSizeChange"
21
- @handleindexChange="handleindexChange"
22
- ></ol-table>
23
- <!-- <el-button @click="handlePrint">接口</el-button>
24
-
25
- <div
26
- class="ellipsis-container"
27
- id="ellipsis-container"
28
- v-for="item in 5"
29
- :key="item"
30
- >如何处理文本溢出如何实现单行文本溢出显示省略号</div>
31
-
32
- <div class="triangle-up"></div>
33
- <div class="grid-content">
34
- <div>11</div>
35
- <div>11</div>
36
- </div>
37
-
38
- <div class="container">
39
- <div class="item">1</div>
40
- <div class="item item2">2</div>
41
- <div class="item">3</div>
42
- </div>
43
-
44
- <div class="square-container">
45
- <div class="square"></div>
46
- </div> -->
47
- </div>
48
- </template>
49
-
50
- <script>
51
- export default {
52
- name: "App",
53
- components: {
54
- },
55
- data() {
56
- return {
57
- multipleSelection: [],
58
- tableData: {
59
- loading: false,
60
- emptyImg: true,
61
- options: {
62
- selection: true, // 多选框
63
- index: false, // 序号EmployeeInfoCode
64
- headTool: true, // 开启头部工具栏
65
- refreshBtn: true, // 开启表格头部刷新按钮
66
- downloadBtn: true, // 开启表格头部下载按钮
67
- useSlotHeader: false
68
- }, // 序号和复选框
69
- rows: [{
70
- bindStateEnum: '11',
71
- tagNumber: '22'
72
- }], // 表数据
73
- columns: [],
74
- operates: [], // 表格里面的操作按钮
75
- tableHeightDiff: 300,
76
- },
77
- paginations: {
78
- page: 1, // 当前位于那页面
79
- total: 10, // 总数
80
- limit: 30, // 一页显示多少条
81
- pagetionShow: true,
82
- },
83
-
84
- formSearchData: {
85
- reset: true, // 重置
86
- expendShow: true, // 展开
87
- tableSearchSlice: 5,
88
- value: {
89
- DocNo: null, // 对应输入框的value字段
90
- QualityCheckStateType: null,
91
- QualityCheckState: null,
92
- timer: []
93
- },
94
- tableSearch: [
95
- // {
96
- // label: "标签号",
97
- // value: "carBodyTagNumber",
98
- // inputType: "text"
99
- // },
100
- // {
101
- // label: "车架号",
102
- // value: "frameNumber",
103
- // inputType: "text"
104
- // // value: "QualityCheckStateType",
105
- // // inputType: "select",
106
- // // children: this.SET_enumsSelect({
107
- // // keyword: "qualityCheckTypeEnum",
108
- // // }),
109
- // },
110
- // {
111
- // label: "项目号",
112
- // value: "projectCode",
113
- // inputType: "text"
114
- // },
115
- // {
116
- // label: "状态描述",
117
- // value: "statusDescription",
118
- // inputType: "select",
119
- // // 0整车/1白车身/2碰撞加固车身/3爆破切割车身/4侧面切割下车身
120
- // children: [
121
- // {
122
- // key: 0,
123
- // value: "整车"
124
- // },
125
- // {
126
- // key: 1,
127
- // value: "白车身"
128
- // },
129
- // {
130
- // key: 2,
131
- // value: "碰撞加固车身"
132
- // },
133
- // {
134
- // key: 3,
135
- // value: "爆破切割车身"
136
- // },
137
- // {
138
- // key: 4,
139
- // value: "侧面切割下车身"
140
- // }
141
- // ]
142
- // },
143
- // {
144
- // label: "实验状态",
145
- // value: "experimentStatus",
146
- // inputType: "select",
147
- // // 0实验前 1实验中 2实验后
148
- // children: [
149
- // {
150
- // key: 0,
151
- // value: "实验前"
152
- // },
153
- // {
154
- // key: 1,
155
- // value: "实验中"
156
- // },
157
- // {
158
- // key: 2,
159
- // value: "实验后"
160
- // }
161
- // ]
162
- // },
163
- // {
164
- // label: "状态",
165
- // value: "tagStatus",
166
- // inputType: "select",
167
- // children: []
168
- // },
169
- // {
170
- // label: "车身类型",
171
- // value: "bodyWorkType",
172
- // inputType: "select",
173
- // children: []
174
- // },
175
- // {
176
- // label: "项目名称",
177
- // value: "projectName",
178
- // inputType: "text"
179
- // },
180
- // {
181
- // label: "入场日期",
182
- // inputType: "picker",
183
- // value: "admissionDate",
184
- // props: {
185
- // valueFormat: "yyyy-MM-dd",
186
- // format: "yyyy/MM/dd"
187
- // }
188
- // },
189
- // {
190
- // label: "打印次数",
191
- // value: "tagPrintNumber",
192
- // inputType: "number"
193
- // },
194
- // {
195
- // label: "创建时间",
196
- // value: "createdTime",
197
- // inputType: "picker",
198
- // props: {
199
- // type: "datetimerange",
200
- // startPlaceholder: "开始时间",
201
- // endPlaceholder: "结束时间",
202
- // placeholder: "选择时间范围",
203
- // valueFormat: "yyyy-MM-dd HH:mm:ss",
204
- // format: "yyyy/MM/dd HH:mm:ss"
205
- // }
206
- // },
207
- // {
208
- // label: "虚拟项目",
209
- // value: "tempProject",
210
- // inputType: "text"
211
- // }
212
- ]
213
- },
214
- };
215
- },
216
- // onMounted() {
217
-
218
- // },
219
- mounted() {
220
- const el = document.getElementById("ellipsis-container");
221
- this.truncateMiddleByWidth(el)
222
- },
223
- methods: {
224
- SelectionChange(row) {
225
- this.multipleSelection = row;
226
- },
227
- handleSearch(from) {
228
- this.formSearchData.value = { ...from };
229
- this.paginations.page = 1;
230
- this.getTable();
231
- },
232
- handleReset() { },
233
- handleSizeChange(val) {
234
- this.paginations.page = 1;
235
- this.paginations.limit = val;
236
- this.getTable();
237
- },
238
- handleindexChange(val) {
239
- this.paginations.page = val;
240
- this.getTable();
241
- },
242
- async handlePrint() {
243
- // console.log(this);
244
- // const aaa = this.$api.getApi("Stock.get_api_app_stock_stock_pages")
245
- // console.log(6666, aaa);
246
- },
247
- // ================
248
- getTable() { },
249
- handleSearch(from) {
250
-
251
- this.formSearchData.value = { ...from };
252
- this.paginations.page = 1;
253
- this.getTable();
254
- },
255
- handleReset() {
256
- for (let key in this.formSearchData.value) {
257
- this.formSearchData.value[key] = null;
258
- }
259
- this.paginations.page = 1;
260
- },
261
- truncateMiddleByWidth(el) {
262
- let text = el.textContent;
263
- if (el.scrollWidth <= el.clientWidth) return;
264
- const suffix = text.slice(-3);
265
- let left = 0;
266
- let right = text.length - 3;
267
- let result = '';
268
- while (left <= right) {
269
- let mid = Math.floor((left + right) / 2);
270
- const temp = text.slice(0, mid) + '...' + suffix;
271
- el.textContent = temp;
272
- if (el.scrollWidth <= el.clientWidth) {
273
- result = temp;
274
- left = mid + 1;
275
- } else {
276
- right = mid - 1;
277
- }
278
- }
279
- el.textContent = result;
280
- }
281
- },
282
- };
283
- </script>
284
-
285
- <style lang="scss" scoped>
286
- /* #app {
287
- font-family: Avenir, Helvetica, Arial, sans-serif;
288
- -webkit-font-smoothing: antialiased;
289
- -moz-osx-font-smoothing: grayscale;
290
- text-align: center;
291
- color: #2c3e50;
292
- margin-top: 60px;
293
- } */
294
- .grid-content {
295
- display: grid;
296
- // grid-template-columns: repeat(2, 1fr);
297
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
298
- // align-items: center;
299
- // justify-items: center;
300
- // justify-content: center;
301
- align-content: center;
302
- height: 300px; /* 你想要的高度 */
303
- gap: 10px;
304
- div {
305
- background-color: aqua;
306
- }
307
- }
308
-
309
- .container {
310
- display: flex;
311
- align-items: center; /* 默认让所有子项在垂直方向居中 */
312
- height: 200px;
313
- background: #eee;
314
- }
315
- .item {
316
- width: 60px;
317
- height: 60px;
318
- background: orange;
319
- margin: 5px;
320
- }
321
- .item2 {
322
- align-self: flex-start; /* 只让这个item到底部对齐 */
323
- }
324
-
325
- .triangle-up {
326
- margin-left: 400px;
327
- width: 100px;
328
- height: 100px;
329
- background-color: purple;
330
- clip-path: polygon(50% 0%, 0% 0%, 0% 100%, 100% 100%);
331
- }
332
-
333
- .square-container {
334
- width: 100px; /* 控制容器宽度 */
335
- }
336
-
337
- .square {
338
- width: 100%;
339
- aspect-ratio: 1 / 1;
340
- background-color: red;
341
- }
342
-
343
- .ellipsis-container {
344
- width: 200px;
345
- // height: 100px;
346
- border: 1px solid #ccc;
347
- overflow: hidden;
348
- white-space: nowrap;
349
- // text-overflow: ellipsis;
350
- // display: -webkit-box;
351
- // -webkit-line-clamp: 4; /* 设置行数,例如3行 */
352
- // -webkit-box-orient: vertical;
353
- }
354
- </style>
1
+ <template>
2
+ <div id="app">
3
+ <div>table组件案例</div>
4
+ <ol-search
5
+ :form-search-data="formSearchData"
6
+ @handleSearch="handleSearch"
7
+ @handleReset="handleReset"
8
+ url="/api/app/admission-info/paged-result"
9
+ />
10
+ <!-- url="/api/app/admission-info/paged-result" -->
11
+
12
+ <ol-table
13
+ :paginations="paginations"
14
+ :empty-img="tableData.emptyImg"
15
+ :btnlist="[]"
16
+ url="/api/app/bind-record/bind-record-detail-pages"
17
+ :table-data="tableData"
18
+ :multiple-selection="multipleSelection"
19
+ @SelectionChange="SelectionChange"
20
+ @handleSizeChange="handleSizeChange"
21
+ @handleindexChange="handleindexChange"
22
+ ></ol-table>
23
+ <el-button @click="handlePrint">接口</el-button>
24
+ <!-- <el-button @click="handlePrint">接口</el-button>
25
+
26
+ <div
27
+ class="ellipsis-container"
28
+ id="ellipsis-container"
29
+ v-for="item in 5"
30
+ :key="item"
31
+ >如何处理文本溢出如何实现单行文本溢出显示省略号</div>
32
+
33
+ <div class="triangle-up"></div>
34
+ <div class="grid-content">
35
+ <div>11</div>
36
+ <div>11</div>
37
+ </div>
38
+
39
+ <div class="container">
40
+ <div class="item">1</div>
41
+ <div class="item item2">2</div>
42
+ <div class="item">3</div>
43
+ </div>
44
+
45
+ <div class="square-container">
46
+ <div class="square"></div>
47
+ </div> -->
48
+ <div>
49
+ <CountCom v-model="quantity" />
50
+ </div>
51
+ </div>
52
+ </template>
53
+
54
+ <script>
55
+ import CountCom from "@/component/countCom.vue";
56
+ export default {
57
+ name: "App",
58
+ components: {
59
+ CountCom,
60
+ },
61
+ data() {
62
+ return {
63
+ quantity: 0,
64
+ multipleSelection: [],
65
+ tableData: {
66
+ loading: false,
67
+ emptyImg: true,
68
+ options: {
69
+ selection: true, // 多选框
70
+ index: false, // 序号EmployeeInfoCode
71
+ headTool: true, // 开启头部工具栏
72
+ refreshBtn: true, // 开启表格头部刷新按钮
73
+ downloadBtn: true, // 开启表格头部下载按钮
74
+ }, // 序号和复选框
75
+ rows: [
76
+ {
77
+ bindStateEnum: "11",
78
+ tagNumber: "22",
79
+ },
80
+ ], // 表数据
81
+ columns: [
82
+ {
83
+ prop: "unit",
84
+ show: false,
85
+ },
86
+ {
87
+ label: "一级表头",
88
+ beforeProp: "qty", // 位置
89
+ show: true,
90
+ children: [
91
+ {
92
+ label: "二级表头",
93
+ children: [
94
+ {
95
+ prop: "creationTime",
96
+ },
97
+ {
98
+ prop: "orginalBillNo",
99
+ },
100
+ ],
101
+ },
102
+ {
103
+ prop: "roadWayCode",
104
+ },
105
+ {
106
+ prop: "batch",
107
+ },
108
+ ],
109
+ },
110
+ {
111
+ label: "一级表头-1",
112
+ beforeProp: "containerType", // 位置
113
+ children: [
114
+ {
115
+ prop: "regionCode",
116
+ },
117
+ {
118
+ prop: "taskNo",
119
+ },
120
+ ],
121
+ },
122
+ ],
123
+ operates: [], // 表格里面的操作按钮
124
+ tableHeightDiff: 300,
125
+ },
126
+ paginations: {
127
+ page: 1, // 当前位于那页面
128
+ total: 10, // 总数
129
+ limit: 30, // 一页显示多少条
130
+ pagetionShow: true,
131
+ },
132
+
133
+ formSearchData: {
134
+ reset: true, // 重置
135
+ expendShow: true, // 展开
136
+ tableSearchSlice: 5,
137
+ value: {
138
+ DocNo: null, // 对应输入框的value字段
139
+ QualityCheckStateType: null,
140
+ QualityCheckState: null,
141
+ timer: [],
142
+ },
143
+ tableSearch: [
144
+ // {
145
+ // label: "标签号",
146
+ // value: "carBodyTagNumber",
147
+ // inputType: "text"
148
+ // },
149
+ // {
150
+ // label: "车架号",
151
+ // value: "frameNumber",
152
+ // inputType: "text"
153
+ // // value: "QualityCheckStateType",
154
+ // // inputType: "select",
155
+ // // children: this.SET_enumsSelect({
156
+ // // keyword: "qualityCheckTypeEnum",
157
+ // // }),
158
+ // },
159
+ // {
160
+ // label: "项目号",
161
+ // value: "projectCode",
162
+ // inputType: "text"
163
+ // },
164
+ // {
165
+ // label: "状态描述",
166
+ // value: "statusDescription",
167
+ // inputType: "select",
168
+ // // 0整车/1白车身/2碰撞加固车身/3爆破切割车身/4侧面切割下车身
169
+ // children: [
170
+ // {
171
+ // key: 0,
172
+ // value: "整车"
173
+ // },
174
+ // {
175
+ // key: 1,
176
+ // value: "白车身"
177
+ // },
178
+ // {
179
+ // key: 2,
180
+ // value: "碰撞加固车身"
181
+ // },
182
+ // {
183
+ // key: 3,
184
+ // value: "爆破切割车身"
185
+ // },
186
+ // {
187
+ // key: 4,
188
+ // value: "侧面切割下车身"
189
+ // }
190
+ // ]
191
+ // },
192
+ // {
193
+ // label: "实验状态",
194
+ // value: "experimentStatus",
195
+ // inputType: "select",
196
+ // // 0实验前 1实验中 2实验后
197
+ // children: [
198
+ // {
199
+ // key: 0,
200
+ // value: "实验前"
201
+ // },
202
+ // {
203
+ // key: 1,
204
+ // value: "实验中"
205
+ // },
206
+ // {
207
+ // key: 2,
208
+ // value: "实验后"
209
+ // }
210
+ // ]
211
+ // },
212
+ // {
213
+ // label: "状态",
214
+ // value: "tagStatus",
215
+ // inputType: "select",
216
+ // children: []
217
+ // },
218
+ // {
219
+ // label: "车身类型",
220
+ // value: "bodyWorkType",
221
+ // inputType: "select",
222
+ // children: []
223
+ // },
224
+ // {
225
+ // label: "项目名称",
226
+ // value: "projectName",
227
+ // inputType: "text"
228
+ // },
229
+ // {
230
+ // label: "入场日期",
231
+ // inputType: "picker",
232
+ // value: "admissionDate",
233
+ // props: {
234
+ // valueFormat: "yyyy-MM-dd",
235
+ // format: "yyyy/MM/dd"
236
+ // }
237
+ // },
238
+ // {
239
+ // label: "打印次数",
240
+ // value: "tagPrintNumber",
241
+ // inputType: "number"
242
+ // },
243
+ // {
244
+ // label: "创建时间",
245
+ // value: "createdTime",
246
+ // inputType: "picker",
247
+ // props: {
248
+ // type: "datetimerange",
249
+ // startPlaceholder: "开始时间",
250
+ // endPlaceholder: "结束时间",
251
+ // placeholder: "选择时间范围",
252
+ // valueFormat: "yyyy-MM-dd HH:mm:ss",
253
+ // format: "yyyy/MM/dd HH:mm:ss"
254
+ // }
255
+ // },
256
+ // {
257
+ // label: "虚拟项目",
258
+ // value: "tempProject",
259
+ // inputType: "text"
260
+ // }
261
+ ],
262
+ },
263
+ };
264
+ },
265
+ // onMounted() {
266
+
267
+ // },
268
+ mounted() {
269
+ // const el = document.getElementById("ellipsis-container");
270
+ // this.truncateMiddleByWidth(el)
271
+ },
272
+ methods: {
273
+ SelectionChange(row) {
274
+ this.multipleSelection = row;
275
+ },
276
+ handleSearch(from) {
277
+ this.formSearchData.value = { ...from };
278
+ this.paginations.page = 1;
279
+ this.getTable();
280
+ },
281
+ handleReset() {},
282
+ handleSizeChange(val) {
283
+ this.paginations.page = 1;
284
+ this.paginations.limit = val;
285
+ this.getTable();
286
+ },
287
+ handleindexChange(val) {
288
+ this.paginations.page = val;
289
+ this.getTable();
290
+ },
291
+ async handlePrint() {
292
+ const newColumns = JSON.parse(JSON.stringify(this.tableData.columns));
293
+ const temp = newColumns.find(e => e.label == "多级表头");
294
+ // temp.children[0].label = "3333";
295
+ // temp.children[0].show = false
296
+ this.$set(temp.children[0], "show", false);
297
+ this.tableData.columns = newColumns;
298
+ // this.$set(temp.children[0], 'show', false)
299
+ // temp.children.push({
300
+ // prop: 'containerType',
301
+ // label: '容器类型',
302
+ // show: true
303
+ // })
304
+ // this.tableData.columns.push({
305
+ // prop: 'aaaa',
306
+ // label: 'aaaa',
307
+ // show: true
308
+ // })
309
+ },
310
+ // ================
311
+ getTable() {},
312
+ handleSearch(from) {
313
+ this.formSearchData.value = { ...from };
314
+ this.paginations.page = 1;
315
+ this.getTable();
316
+ },
317
+ handleReset() {
318
+ for (let key in this.formSearchData.value) {
319
+ this.formSearchData.value[key] = null;
320
+ }
321
+ this.paginations.page = 1;
322
+ },
323
+ truncateMiddleByWidth(el) {
324
+ let text = el.textContent;
325
+ if (el.scrollWidth <= el.clientWidth) return;
326
+ const suffix = text.slice(-3);
327
+ let left = 0;
328
+ let right = text.length - 3;
329
+ let result = "";
330
+ while (left <= right) {
331
+ let mid = Math.floor((left + right) / 2);
332
+ const temp = text.slice(0, mid) + "..." + suffix;
333
+ el.textContent = temp;
334
+ if (el.scrollWidth <= el.clientWidth) {
335
+ result = temp;
336
+ left = mid + 1;
337
+ } else {
338
+ right = mid - 1;
339
+ }
340
+ }
341
+ el.textContent = result;
342
+ },
343
+ },
344
+ };
345
+ </script>
346
+
347
+ <style lang="scss" scoped>
348
+ /* #app {
349
+ font-family: Avenir, Helvetica, Arial, sans-serif;
350
+ -webkit-font-smoothing: antialiased;
351
+ -moz-osx-font-smoothing: grayscale;
352
+ text-align: center;
353
+ color: #2c3e50;
354
+ margin-top: 60px;
355
+ } */
356
+ .grid-content {
357
+ display: grid;
358
+ // grid-template-columns: repeat(2, 1fr);
359
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
360
+ // align-items: center;
361
+ // justify-items: center;
362
+ // justify-content: center;
363
+ align-content: center;
364
+ height: 300px; /* 你想要的高度 */
365
+ gap: 10px;
366
+ div {
367
+ background-color: aqua;
368
+ }
369
+ }
370
+
371
+ .container {
372
+ display: flex;
373
+ align-items: center; /* 默认让所有子项在垂直方向居中 */
374
+ height: 200px;
375
+ background: #eee;
376
+ }
377
+ .item {
378
+ width: 60px;
379
+ height: 60px;
380
+ background: orange;
381
+ margin: 5px;
382
+ }
383
+ .item2 {
384
+ align-self: flex-start; /* 只让这个item到底部对齐 */
385
+ }
386
+
387
+ .triangle-up {
388
+ margin-left: 400px;
389
+ width: 100px;
390
+ height: 100px;
391
+ background-color: purple;
392
+ clip-path: polygon(50% 0%, 0% 0%, 0% 100%, 100% 100%);
393
+ }
394
+
395
+ .square-container {
396
+ width: 100px; /* 控制容器宽度 */
397
+ }
398
+
399
+ .square {
400
+ width: 100%;
401
+ aspect-ratio: 1 / 1;
402
+ background-color: red;
403
+ }
404
+
405
+ .ellipsis-container {
406
+ width: 200px;
407
+ // height: 100px;
408
+ border: 1px solid #ccc;
409
+ overflow: hidden;
410
+ white-space: nowrap;
411
+ // text-overflow: ellipsis;
412
+ // display: -webkit-box;
413
+ // -webkit-line-clamp: 4; /* 设置行数,例如3行 */
414
+ // -webkit-box-orient: vertical;
415
+ }
416
+ </style>