vue2-client 1.16.21 → 1.16.22

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.
@@ -1,119 +1,119 @@
1
- <template>
2
- <div class="table-container" :style="{ height: tableHeight }">
3
- <a-table
4
- :columns="processedColumns"
5
- :dataSource="tableData"
6
- :pagination="false"
7
- :bordered="false"
8
- :rowKey="rowKey"
9
- :scroll="{ y: scrollY }"
10
- />
11
- </div>
12
- </template>
13
-
14
- <script>
15
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
16
-
17
- export default {
18
- props: {
19
- queryParamsName: String,
20
- rowKey: {
21
- type: String,
22
- default: 'id'
23
- },
24
- parameter: {
25
- type: Object,
26
- default: () => ({})
27
- }
28
- },
29
- data () {
30
- return {
31
- columns: [],
32
- tableData: [],
33
- tableHeight: 'auto', // 默认高度
34
- scrollY: undefined
35
- }
36
- },
37
- watch: {
38
- queryParamsName: {
39
- immediate: true,
40
- handler (val) {
41
- val && this.init(val, this.parameter)
42
- }
43
- }
44
- },
45
- computed: {
46
- processedColumns () {
47
- return this.columns.map(column => ({
48
- ...column,
49
- customHeaderCell: column.headerStyle
50
- ? () => ({ style: column.headerStyle })
51
- : undefined
52
- }))
53
- }
54
- },
55
- methods: {
56
- init (config, parameterData) {
57
- getConfigByName(config, 'af-his', res => {
58
- // 从配置中获取表格高度
59
- this.tableHeight = res.tableHeight || '400px' // 默认400px
60
- this.columns = res.columns || []
61
-
62
- runLogic(res.logicName, parameterData, 'af-his').then(result => {
63
- this.tableData = result.map((item, index) => ({
64
- ...item,
65
- key: item[this.rowKey] || `row_${index}`
66
- }))
67
-
68
- this.$nextTick(() => {
69
- this.scrollY = this.tableHeight
70
- })
71
- })
72
- })
73
- }
74
- }
75
- }
76
- </script>
77
-
78
- <style scoped>
79
- /* 表格容器 */
80
- .table-container {
81
- overflow: hidden;
82
- display: flex;
83
- flex-direction: column;
84
- }
85
-
86
- /* 基础无边框样式 */
87
- /deep/ .ant-table {
88
- border: none !important;
89
- flex: 1;
90
- display: flex;
91
- flex-direction: column;
92
- }
93
-
94
- /deep/ .ant-table-content {
95
- flex: 1;
96
- display: flex;
97
- flex-direction: column;
98
- }
99
-
100
- /deep/ .ant-table-body {
101
- flex: 1;
102
- overflow-y: auto !important;
103
- }
104
-
105
- /deep/ .ant-table-tbody > tr > td {
106
- border-bottom: none !important;
107
- padding: 6px !important;
108
- }
109
-
110
- /deep/ .ant-table-thead > tr > th {
111
- border-bottom: none !important;
112
- background: none !important;
113
- padding: 8px 6px !important;
114
- position: sticky;
115
- top: 0;
116
- z-index: 1;
117
- background-color: white !important;
118
- }
119
- </style>
1
+ <template>
2
+ <div class="table-container" :style="{ height: tableHeight }">
3
+ <a-table
4
+ :columns="processedColumns"
5
+ :dataSource="tableData"
6
+ :pagination="false"
7
+ :bordered="false"
8
+ :rowKey="rowKey"
9
+ :scroll="{ y: scrollY }"
10
+ />
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
16
+
17
+ export default {
18
+ props: {
19
+ queryParamsName: String,
20
+ rowKey: {
21
+ type: String,
22
+ default: 'id'
23
+ },
24
+ parameter: {
25
+ type: Object,
26
+ default: () => ({})
27
+ }
28
+ },
29
+ data () {
30
+ return {
31
+ columns: [],
32
+ tableData: [],
33
+ tableHeight: 'auto', // 默认高度
34
+ scrollY: undefined
35
+ }
36
+ },
37
+ watch: {
38
+ queryParamsName: {
39
+ immediate: true,
40
+ handler (val) {
41
+ val && this.init(val, this.parameter)
42
+ }
43
+ }
44
+ },
45
+ computed: {
46
+ processedColumns () {
47
+ return this.columns.map(column => ({
48
+ ...column,
49
+ customHeaderCell: column.headerStyle
50
+ ? () => ({ style: column.headerStyle })
51
+ : undefined
52
+ }))
53
+ }
54
+ },
55
+ methods: {
56
+ init (config, parameterData) {
57
+ getConfigByName(config, 'af-his', res => {
58
+ // 从配置中获取表格高度
59
+ this.tableHeight = res.tableHeight || '400px' // 默认400px
60
+ this.columns = res.columns || []
61
+
62
+ runLogic(res.logicName, parameterData, 'af-his').then(result => {
63
+ this.tableData = result.map((item, index) => ({
64
+ ...item,
65
+ key: item[this.rowKey] || `row_${index}`
66
+ }))
67
+
68
+ this.$nextTick(() => {
69
+ this.scrollY = this.tableHeight
70
+ })
71
+ })
72
+ })
73
+ }
74
+ }
75
+ }
76
+ </script>
77
+
78
+ <style scoped>
79
+ /* 表格容器 */
80
+ .table-container {
81
+ overflow: hidden;
82
+ display: flex;
83
+ flex-direction: column;
84
+ }
85
+
86
+ /* 基础无边框样式 */
87
+ /deep/ .ant-table {
88
+ border: none !important;
89
+ flex: 1;
90
+ display: flex;
91
+ flex-direction: column;
92
+ }
93
+
94
+ /deep/ .ant-table-content {
95
+ flex: 1;
96
+ display: flex;
97
+ flex-direction: column;
98
+ }
99
+
100
+ /deep/ .ant-table-body {
101
+ flex: 1;
102
+ overflow-y: auto !important;
103
+ }
104
+
105
+ /deep/ .ant-table-tbody > tr > td {
106
+ border-bottom: none !important;
107
+ padding: 6px !important;
108
+ }
109
+
110
+ /deep/ .ant-table-thead > tr > th {
111
+ border-bottom: none !important;
112
+ background: none !important;
113
+ padding: 8px 6px !important;
114
+ position: sticky;
115
+ top: 0;
116
+ z-index: 1;
117
+ background-color: white !important;
118
+ }
119
+ </style>
@@ -1,8 +1,6 @@
1
1
  <template>
2
2
  <div class="x-time-select">
3
3
  <div class="time-select-container">
4
- <span v-if="label" class="time-select-label">{{ label }}</span>
5
-
6
4
  <div v-if="type === 'range'" class="picker-wrapper">
7
5
  <a-range-picker
8
6
  :value="dateRange"
@@ -60,7 +58,6 @@ export default {
60
58
  data () {
61
59
  return {
62
60
  dateRange: [],
63
- label: '请选择日期',
64
61
  type: 'range'
65
62
  }
66
63
  },
@@ -104,9 +101,6 @@ export default {
104
101
  if (['date', 'range'].includes(res.type)) {
105
102
  this.type = res.type
106
103
  }
107
- if (res.label !== undefined) {
108
- this.label = res.label
109
- }
110
104
  this.convertValueToMoment(this.value)
111
105
  })
112
106
  }
@@ -128,11 +122,6 @@ export default {
128
122
  align-items: center;
129
123
  }
130
124
 
131
- .time-select-label {
132
- white-space: nowrap;
133
- color: rgba(0, 0, 0, 0.85);
134
- padding-right: 8px;
135
- }
136
125
 
137
126
  .picker-wrapper {
138
127
  flex: 1;