vue2-client 1.8.61 → 1.8.63

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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.8.63 -2024-3-4 @江超**
5
+ - 新增`XTree`组件
6
+ - 全局设置字体为`PingFangSC-Regular`
7
+ - 修复全局滚动条的样式问题
8
+ - 优化`XForm`,`XTable`,`XFormTable`的显示效果
9
+
4
10
  **1.8.47 -2024-2-27 @江超**
5
11
  - 完成数据检索功能
6
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.61",
3
+ "version": "1.8.63",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
package/public/index.html CHANGED
@@ -15,7 +15,7 @@
15
15
  <noscript>
16
16
  <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
17
17
  </noscript>
18
- <div id="popContainer" class="beauty-scroll" style="height: 100vh; overflow-y: scroll">
18
+ <div id="popContainer" class="beauty-scroll" style="height: 100vh; overflow-y: auto">
19
19
  <div id="app"></div>
20
20
  </div>
21
21
  <!-- require cdn assets js -->
package/src/App.vue CHANGED
@@ -137,6 +137,9 @@ export default {
137
137
  </style>
138
138
  <style lang="less">
139
139
  @import "./font-style/font.css";
140
+ body {
141
+ font-family: 'PingFangSC-Regular-woff2', 'Microsoft YaHei UI', serif !important;
142
+ }
140
143
  .water-mark-wrap {
141
144
  position: absolute;
142
145
  width: 100%;
@@ -122,9 +122,9 @@ export default {
122
122
  },
123
123
  mounted () {
124
124
  this.formItemLoad()
125
- if (this.nowStepContent) {
126
- this.form = this.nowStepContent
127
- }
125
+ // if (this.nowStepContent) {
126
+ // this.form = this.nowStepContent
127
+ // }
128
128
  },
129
129
  methods: {
130
130
  formItemLoad () {
@@ -8,7 +8,7 @@
8
8
  layout="inline">
9
9
  <a-row :gutter="48">
10
10
  <x-form-item
11
- v-for="(item, index) in realJsonData.slice(0,6)"
11
+ v-for="(item, index) in realJsonData.slice(0,3)"
12
12
  :key="index"
13
13
  :attr="item"
14
14
  :form="form"
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  <div v-show="advanced">
29
29
  <x-form-item
30
- v-for="(item, index) in realJsonData.slice(6)"
30
+ v-for="(item, index) in realJsonData.slice(3)"
31
31
  :key="'advanced'+index"
32
32
  :attr="item"
33
33
  :form="form"
@@ -39,17 +39,22 @@
39
39
  <span
40
40
  :style="advanced && { float: 'right', overflow: 'hidden' } || {} "
41
41
  class="table-page-search-submitButtons">
42
- <a-button htmlType="submit" style="margin-left: 8px" type="primary" @click="onSubmit">
42
+ <a v-if="realJsonData.length > 3" style="margin-left: 8px" @click="toggleAdvanced">
43
+ <span v-show="!advanced"><a-icon type="eye"/>&nbsp;更多条件</span>
44
+ <span v-show="advanced"><a-icon type="eye-invisible"/>&nbsp;收起更多</span>
45
+ </a>
46
+ <a-divider type="vertical"/>
47
+ <a-button
48
+ htmlType="submit"
49
+ style="margin-left: 8px"
50
+ type="primary"
51
+ @click="onSubmit">
43
52
  <a-icon :style="iconStyle" type="search"/>查询
44
53
  </a-button>
45
54
  <a-button style="margin-left: 8px" @click="resetForm">
46
55
  <a-icon :style="iconStyle" type="redo" />重置
47
56
  </a-button>
48
57
  <slot></slot>
49
- <a v-if="realJsonData.length > 6" style="margin-left: 8px" @click="toggleAdvanced">
50
- <span v-show="!advanced">更多条件<a-icon type="down"/></span>
51
- <span v-show="advanced">收起更多<a-icon type="up"/></span>
52
- </a>
53
58
  </span>
54
59
  </a-col>
55
60
  </a-row>
@@ -184,6 +189,7 @@ export default {
184
189
  },
185
190
  toggleVisible () {
186
191
  this.visible = !this.visible
192
+ return this.visible
187
193
  },
188
194
  resetForm () {
189
195
  this.$refs.form.resetFields()
@@ -212,3 +218,5 @@ export default {
212
218
  }
213
219
  }
214
220
  </script>
221
+ <style lang="less" scoped>
222
+ </style>
@@ -402,7 +402,7 @@ export default {
402
402
  const isEmpty = !value || !value.toString()
403
403
  // 查询表单点击重置按钮时清空树形选择框选中状态
404
404
  if (this.$refs.XTreeSelect && this.attr.type === 'treeSelect' && isEmpty) {
405
- this.$refs.xTreeSelect.setValue(undefined)
405
+ this.$refs.xTreeSelect.setValue(undefined)
406
406
  }
407
407
  },
408
408
  deep: true
@@ -7,6 +7,9 @@
7
7
  ref="xAddForm"
8
8
  @afterSubmit="onAddOrEditSubmitAfterSubmit"
9
9
  />
10
+ <div v-if="title" class="crud_title">
11
+ {{ title }}
12
+ </div>
10
13
  <x-form
11
14
  ref="xForm"
12
15
  style="margin-bottom: 14px;"
@@ -34,9 +37,11 @@
34
37
  </template>
35
38
  <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
36
39
  <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
37
- <a-button @click="toggleIsFormShow">
38
- <a-icon :style="iconStyle" type="vertical-align-top"/>
39
- </a-button>
40
+ <a-tooltip title="收起查询条件">
41
+ <a-button @click="toggleIsFormShow">
42
+ <a-icon :style="iconStyle" type="vertical-align-top"/>
43
+ </a-button>
44
+ </a-tooltip>
40
45
  </template>
41
46
  <!-- 底部插槽 -->
42
47
  <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
@@ -335,7 +340,9 @@ export default {
335
340
  * 查询表单部分显示/隐藏切换
336
341
  */
337
342
  toggleIsFormShow () {
338
- this.$refs.xForm.toggleVisible()
343
+ const visible = this.$refs.xForm.toggleVisible()
344
+ const height = visible ? 'default' : 'calc(100vh - 27rem)'
345
+ this.$refs.xTable.setScrollYHeight(height)
339
346
  },
340
347
  /**
341
348
  * 选择列事件
@@ -379,5 +386,12 @@ export default {
379
386
  }
380
387
  </script>
381
388
  <style lang="less" scoped>
382
-
389
+ .crud_title {
390
+ height: 32px;
391
+ font-size: 16px;
392
+ font-weight: 500;
393
+ color: #000000d9;
394
+ line-height: 32px;
395
+ margin-bottom: 12px;
396
+ }
383
397
  </style>
@@ -39,10 +39,14 @@
39
39
  <span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">
40
40
  <a-button-group>
41
41
  <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
42
- <a-button @click="refresh(true)">
43
- <a-icon :style="iconStyle" type="reload" />
44
- </a-button>
45
- <table-setting v-if="columnSelectLoaded" v-model="tableColumns" />
42
+ <a-tooltip title="重新查询">
43
+ <a-button @click="refresh(true)">
44
+ <a-icon :style="iconStyle" type="reload" />
45
+ </a-button>
46
+ </a-tooltip>
47
+ <a-tooltip title="列展示/排序">
48
+ <table-setting v-if="columnSelectLoaded" v-model="tableColumns" />
49
+ </a-tooltip>
46
50
  </a-button-group>
47
51
  </span>
48
52
  </a-col>
@@ -148,7 +152,7 @@ export default {
148
152
  // x滚动条宽度
149
153
  scrollXWidth: 1600,
150
154
  // y滚动条高度
151
- scrollYHeight: 437,
155
+ scrollYHeight: 'calc(100vh - 31rem)',
152
156
  // 表格选择列Key集合
153
157
  selectedRowKeys: [],
154
158
  // 表格选择Row集合
@@ -256,15 +260,8 @@ export default {
256
260
  totalWidth = totalWidth + 180
257
261
  }
258
262
  }
259
- // 设置表格高度
260
- // const height = document.documentElement.clientHeight
261
- // if (height >= 1070) {
262
- // this.scrollYHeight = 'calc(100vh - 526px)'
263
- // } else {
264
- // this.scrollYHeight = 'calc(100vh - 398px)'
265
- // }
266
263
  // 设置表格高度为固定值
267
- this.scrollYHeight = 'calc(100vh - 33rem)'
264
+ this.setScrollYHeight('default')
268
265
  // 横向滚动长度大于所有宽度,才能实现固定表头
269
266
  this.scrollXWidth = totalWidth
270
267
  // 加载筛选列完成
@@ -332,6 +329,12 @@ export default {
332
329
  this.$refs.table.refresh(bool)
333
330
  })
334
331
  },
332
+ setScrollYHeight (value) {
333
+ if (value === 'default') {
334
+ value = 'calc(100vh - 31rem)'
335
+ }
336
+ this.scrollYHeight = value
337
+ },
335
338
  /**
336
339
  * 格式化日期
337
340
  * @param date 日期字符串
@@ -378,7 +381,8 @@ export default {
378
381
  window.open('/res/excel/export/' + value)
379
382
  })
380
383
  },
381
- onCancel () {}
384
+ onCancel () {
385
+ }
382
386
  })
383
387
  },
384
388
  // 新增业务
@@ -449,7 +453,8 @@ export default {
449
453
  })
450
454
  })
451
455
  },
452
- onCancel () {}
456
+ onCancel () {
457
+ }
453
458
  })
454
459
  },
455
460
  // 导入业务
@@ -500,32 +505,11 @@ export default {
500
505
  }
501
506
  </script>
502
507
  <style lang="less" scoped>
503
- .btn-success {
504
- color: #ffffff;
505
- }
506
- .btn-success:enabled:hover {
507
- background-color: #85CE61 !important;
508
- border-color: #85CE61 !important;
509
- }
510
- .btn-success:enabled {
511
- background-color: #67c23a;
512
- border-color: #67c23a;
513
- }
514
- .btn-success:disabled {
515
- color: rgba(0, 0, 0, 0.25);
516
- }
517
- .btn-warn {
518
- color: #ffffff;
519
- }
520
- .btn-warn:enabled:hover {
521
- background-color: #ffc833 !important;
522
- border-color: #ffc833 !important;
523
- }
524
- .btn-warn:enabled {
525
- background-color: #ffba00;
526
- border-color: #ffba00;
508
+ :deep(.ant-table-thead > tr > th) {
509
+ font-weight: 600;
527
510
  }
528
- .btn-warn:disabled {
529
- color: rgba(0, 0, 0, 0.25);
511
+ :deep(.ant-table-pagination.ant-pagination){
512
+ margin-bottom: 0;
530
513
  }
514
+ :deep(.ant-table td) { white-space: nowrap; }
531
515
  </style>
@@ -0,0 +1,71 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ // 树数据
4
+ // example: [{ title: '标题', key: '1', children: []}]
5
+ treeData: {
6
+ type: Array,
7
+ required: true
8
+ }
9
+ })
10
+
11
+ const emit = defineEmits(['onSelect'])
12
+
13
+ function onSelect (keys, e) {
14
+ emit('onSelect', keys, e)
15
+ }
16
+ </script>
17
+
18
+ <template>
19
+ <div class="tree_main">
20
+ <a-directory-tree
21
+ :tree-data="props.treeData"
22
+ @select="onSelect"
23
+ :default-selected-keys="props.treeData.length > 0 ? props.treeData[0].key : null"
24
+ :default-expand-all="true"
25
+ ></a-directory-tree>
26
+ </div>
27
+ </template>
28
+
29
+ <style lang="less" scoped>
30
+ .tree_main {
31
+ :deep(.ant-tree li .ant-tree-node-content-wrapper){
32
+ color: #000000e0;
33
+ }
34
+ :deep(.ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle) {
35
+ color: #0000004d;
36
+ i {
37
+ font-size: 16px !important;
38
+ line-height: 40px;
39
+ }
40
+ }
41
+ :deep(.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper::before, .ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper::before){
42
+ height: 40px;
43
+ border-radius: 6px;
44
+ }
45
+ :deep(.ant-tree.ant-tree-directory > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before){
46
+ background: #e6f7ff;
47
+ }
48
+ :deep(.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before){
49
+ background: #e6f7ff;
50
+ }
51
+ :deep(.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-switcher){
52
+ color: #0000004d;
53
+ }
54
+ :deep(.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper.ant-tree-node-selected, .ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper.ant-tree-node-selected){
55
+ color: #000000e0;
56
+ }
57
+ :deep(.ant-tree li .ant-tree-node-content-wrapper){
58
+ line-height: 40px;
59
+ height: 40px;
60
+ }
61
+ :deep(.ant-tree li) {
62
+ padding-left: 4px;
63
+ }
64
+ :deep(.ant-tree ul) {
65
+ padding-left: 10px;
66
+ }
67
+ :deep(.ant-tree-icon__customize){
68
+ display: none;
69
+ }
70
+ }
71
+ </style>
@@ -0,0 +1,3 @@
1
+ import XTree from './XTree'
2
+
3
+ export default XTree
@@ -0,0 +1,36 @@
1
+ # XTree
2
+
3
+ 更美观的树控件
4
+
5
+
6
+ ## 何时使用
7
+
8
+ 当需要一个美观的树控件时
9
+
10
+
11
+ 引用方式:
12
+
13
+ ```javascript
14
+ import XTree from '@vue2-client/base-client/components/XTree/XTree'
15
+
16
+ export default {
17
+ components: {
18
+ XTree
19
+ }
20
+ }
21
+ ```
22
+
23
+
24
+
25
+ ## 代码演示
26
+
27
+ ```html
28
+ <x-tree :tree-data="treeData" @onSelect="onSelect"></x-tree>
29
+ ```
30
+
31
+ ## API
32
+
33
+ | 参数 | 说明 | 类型 | 默认值 |
34
+ |-----------|---------|-------|-----|
35
+ | treeData | 数据集合 | Array | [] |
36
+ | @onSelect | 树节点选择事件 | event | - |
@@ -161,7 +161,7 @@ export default {
161
161
  current: r.pageNo, // 返回结果中的当前分页数
162
162
  total: r.totalCount, // 返回结果中的总记录数
163
163
  showSizeChanger: this.showSizeChanger,
164
- showTotal: (total, range) => range[0] === range[1] ? `第 ${range[0]} / 共 ${total} 条, 合计 ${r.totalPage} 页` : `第 ${range[0]} ~ ${range[1]} / 共 ${total} 条, 合计 ${r.totalPage} 页`,
164
+ showTotal: (total, range) => range[0] === range[1] ? `${range[0]} | 共 ${total} 项` : `${range[0]}-${range[1]} | 共 ${total} 项`,
165
165
  pageSize: (pagination && pagination.pageSize) || this.localPagination.pageSize
166
166
  }) || false
167
167
  // 为防止删除数据后导致页面当前页面数据长度为 0 ,自动翻页到上一页
@@ -258,9 +258,9 @@ export default {
258
258
 
259
259
  // 绘制 alert 组件
260
260
  return (
261
- <a-alert showIcon={true} style="margin-bottom: 16px">
261
+ <a-alert showIcon={true} style="margin-bottom: 8px;font-size: 14px;">
262
262
  <template slot="message">
263
- <span style="margin-right: 12px">已选择: <a style="font-weight: 600">{this.selectedRows.length}</a></span>
263
+ <span style="margin-right: 12px;">已选择: <a style="font-weight: 600">{this.selectedRows.length}</a></span>
264
264
  {needTotalItems}
265
265
  {clearItem}
266
266
  </template>
@@ -1,6 +1,4 @@
1
1
  @font-face {
2
- font-family: 'PingFang';
3
- src: url('./PingFang.ttf');
4
- font-weight: normal;
5
- font-style: normal;
2
+ font-family: 'PingFangSC-Regular-woff2';
3
+ src: url('./PingFangSC-Regular.woff2') format('woff2');
6
4
  }
@@ -2,14 +2,23 @@
2
2
  overflow: hidden;
3
3
  filter: invert(80%);
4
4
  }
5
+
6
+ .split-right{
7
+ &:not(:last-child) {
8
+ border-right: 1px solid rgba(98, 98, 98, 0.2);
9
+ }
10
+ }
11
+ .disabled{
12
+ cursor: not-allowed;
13
+ color: @disabled-color;
14
+ pointer-events: none;
15
+ }
16
+
5
17
  .beauty-scroll{
6
- //scrollbar-color: @primary-color @primary-2;
7
- //scrollbar-width: thin;
8
18
  -ms-overflow-style:none;
9
19
  position: relative;
10
20
  &::-webkit-scrollbar{
11
21
  width: 3px;
12
- height: 1px;
13
22
  }
14
23
  &::-webkit-scrollbar-thumb {
15
24
  border-radius: 3px;
@@ -21,16 +30,6 @@
21
30
  background: @primary-3;
22
31
  }
23
32
  }
24
- .split-right{
25
- &:not(:last-child) {
26
- border-right: 1px solid rgba(98, 98, 98, 0.2);
27
- }
28
- }
29
- .disabled{
30
- cursor: not-allowed;
31
- color: @disabled-color;
32
- pointer-events: none;
33
- }
34
33
 
35
34
  // 美化滚动条
36
35
  ::-webkit-scrollbar{
@@ -50,7 +49,7 @@
50
49
  ::-webkit-scrollbar-track {
51
50
  -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
52
51
  border-radius: 10px;
53
- background: @primary-1;
52
+ background: transparent;
54
53
  }
55
54
 
56
55
  ::-webkit-scrollbar-thumb:hover {
Binary file