vue2-client 1.15.104 → 1.15.105

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.15.104",
3
+ "version": "1.15.105",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -67,7 +67,7 @@
67
67
  <template v-if="panel.type === 'picture'">
68
68
  <img :src="panel.configName" alt="图片" style="width: 100%; max-width: 500px;"/>
69
69
  </template>
70
- <template v-else-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio', 'x-text-card','x-tree-rows'].includes(panel.type)">
70
+ <template v-else-if="['x-form-table','x-simple-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list','x-input','x-time-line', 'x-radio', 'x-text-card','x-tree-rows'].includes(panel.type)">
71
71
  <component
72
72
  :is="getComponentName(panel.type)"
73
73
  :ref="`dynamicComponent_${ panel.type }_${ panelIndex }`"
@@ -116,7 +116,8 @@ export default {
116
116
  XTimeLine: () => import('@vue2-client/base-client/components/common/XTimeline/XTimeline.vue'),
117
117
  XRadio: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
118
118
  XTextCard: () => import('@vue2-client/base-client/components/his/XTextCard/XTextCard.vue'),
119
- XTreeRows: () => import('@vue2-client/base-client/components/his/XTreeRows/XTreeRows.vue')
119
+ XTreeRows: () => import('@vue2-client/base-client/components/his/XTreeRows/XTreeRows.vue'),
120
+ XSimpleTable: () => import('@vue2-client/base-client/components/his/XSimpleTable/XSimpleTable.vue')
120
121
  },
121
122
  data () {
122
123
  return {
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <a-table
3
+ :columns="processedColumns"
4
+ :dataSource="tableData"
5
+ :pagination="false"
6
+ :bordered="false"
7
+ :rowKey="rowKey"
8
+ />
9
+ </template>
10
+
11
+ <script>
12
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
13
+
14
+ export default {
15
+ props: {
16
+ queryParamsName: String,
17
+ rowKey: {
18
+ type: String,
19
+ default: 'id'
20
+ },
21
+ parameter: {
22
+ type: Object,
23
+ default: () => ({})
24
+ }
25
+ },
26
+ data () {
27
+ return {
28
+ columns: [],
29
+ tableData: []
30
+ }
31
+ },
32
+ watch: {
33
+ queryParamsName: {
34
+ immediate: true,
35
+ handler (val) {
36
+ val && this.init(val, this.parameter)
37
+ }
38
+ }
39
+ },
40
+ computed: {
41
+ // 只处理headerStyle的列配置
42
+ processedColumns () {
43
+ return this.columns.map(column => ({
44
+ ...column,
45
+ customHeaderCell: column.headerStyle
46
+ ? () => ({ style: column.headerStyle })
47
+ : undefined
48
+ }))
49
+ }
50
+ },
51
+ methods: {
52
+ init (config, parameterData) {
53
+ getConfigByName(config, 'af-his', res => {
54
+ // 示例配置格式:
55
+ // columns: [{
56
+ // title: '项目名称',
57
+ // dataIndex: 'name',
58
+ // headerStyle: { color: '#1890ff', fontWeight: 'bold' }
59
+ // }]
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
+ })
69
+ }
70
+ }
71
+ }
72
+ </script>
73
+
74
+ <style scoped>
75
+ /* 基础无边框样式 */
76
+ /deep/ .ant-table {
77
+ border: none !important;
78
+ }
79
+ /deep/ .ant-table-tbody > tr > td {
80
+ border-bottom: none !important;
81
+ padding: 6px !important;
82
+ }
83
+ /deep/ .ant-table-thead > tr > th {
84
+ border-bottom: none !important;
85
+ background: none !important;
86
+ padding: 8px 6px !important;
87
+ }
88
+ </style>