vue2-client 1.16.99 → 1.17.1
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/.env.message +19 -19
- package/package.json +112 -112
- package/src/base-client/components/common/HIS/HFormTable/HFormTable.vue +2 -1
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +1288 -1288
- package/src/base-client/components/common/XForm/XFormItem.vue +1530 -1530
- package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -0
- package/src/base-client/components/common/XFormTable/demo.vue +89 -89
- package/src/base-client/components/common/XTable/XTable.vue +16 -0
- package/src/base-client/components/his/XRadio/XRadio.vue +88 -4
- package/src/base-client/components/his/XTitle/XTitle.vue +11 -9
- package/src/utils/common.js +8 -0
|
@@ -579,6 +579,7 @@ export default {
|
|
|
579
579
|
this.$refs.xTable.init({
|
|
580
580
|
formItems: res.formJson,
|
|
581
581
|
queryParams: setQueryParams ? res : null,
|
|
582
|
+
realQueryParams: res,
|
|
582
583
|
tableColumns: res.columnJson,
|
|
583
584
|
buttonState: Object.assign(res.buttonState, this.buttonState),
|
|
584
585
|
title: this.title || res.title,
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :bordered="false">
|
|
3
|
-
<x-form-table
|
|
4
|
-
title="示例表单"
|
|
5
|
-
:queryParamsName="queryParamsName"
|
|
6
|
-
:fixedAddForm="fixedAddForm"
|
|
7
|
-
:externalSelectedRowKeys="selectedKeys"
|
|
8
|
-
@action="action"
|
|
9
|
-
@selectRow="selectRow"
|
|
10
|
-
@columnClick="columnClick"
|
|
11
|
-
serviceName="af-
|
|
12
|
-
ref="xFormTable">
|
|
13
|
-
</x-form-table>
|
|
14
|
-
</a-card>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
19
|
-
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
name: 'Demo',
|
|
23
|
-
components: {
|
|
24
|
-
XFormTable
|
|
25
|
-
},
|
|
26
|
-
data () {
|
|
27
|
-
return {
|
|
28
|
-
// 查询配置文件名
|
|
29
|
-
queryParamsName: '
|
|
30
|
-
// 查询配置左侧tree
|
|
31
|
-
xTreeConfigName: 'addressType',
|
|
32
|
-
// 新增表单固定值
|
|
33
|
-
fixedAddForm: {},
|
|
34
|
-
// 是否显示详情抽屉
|
|
35
|
-
detailVisible: false,
|
|
36
|
-
// 当前记录
|
|
37
|
-
record: {},
|
|
38
|
-
// 选中的行keys
|
|
39
|
-
selectedKeys: [],
|
|
40
|
-
selected: {
|
|
41
|
-
keys: [],
|
|
42
|
-
rows: []
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
methods: {
|
|
47
|
-
test () {
|
|
48
|
-
this.$refs.xFormTable.setTableData([])
|
|
49
|
-
},
|
|
50
|
-
defaultF () {
|
|
51
|
-
this.$refs.xFormTable.setTableSize('default')
|
|
52
|
-
},
|
|
53
|
-
middleF () {
|
|
54
|
-
this.$refs.xFormTable.setTableSize('middle')
|
|
55
|
-
},
|
|
56
|
-
smallF () {
|
|
57
|
-
this.$refs.xFormTable.setTableSize('small')
|
|
58
|
-
},
|
|
59
|
-
columnClick (key, value, record) {
|
|
60
|
-
microDispatch({
|
|
61
|
-
type: 'v3route',
|
|
62
|
-
path: '/bingliguanli/dianzibingliluru',
|
|
63
|
-
props: { selected: arguments[0].his_f_admission_id }
|
|
64
|
-
})
|
|
65
|
-
},
|
|
66
|
-
action (record, id, actionType) {
|
|
67
|
-
this.detailVisible = true
|
|
68
|
-
console.log('触发了详情操作', record, id, actionType)
|
|
69
|
-
},
|
|
70
|
-
onClose () {
|
|
71
|
-
this.detailVisible = false
|
|
72
|
-
// 关闭详情之后重新查询表单
|
|
73
|
-
this.$refs.xFormTable.refreshTable(true)
|
|
74
|
-
},
|
|
75
|
-
selectRow (selectedRowKeys, selectedRows) {
|
|
76
|
-
this.selected = {
|
|
77
|
-
keys: selectedRowKeys,
|
|
78
|
-
rows: selectedRows
|
|
79
|
-
}
|
|
80
|
-
console.log('selectedDemo', this.selected)
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
computed: {},
|
|
84
|
-
}
|
|
85
|
-
</script>
|
|
86
|
-
|
|
87
|
-
<style scoped>
|
|
88
|
-
|
|
89
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card :bordered="false">
|
|
3
|
+
<x-form-table
|
|
4
|
+
title="示例表单"
|
|
5
|
+
:queryParamsName="queryParamsName"
|
|
6
|
+
:fixedAddForm="fixedAddForm"
|
|
7
|
+
:externalSelectedRowKeys="selectedKeys"
|
|
8
|
+
@action="action"
|
|
9
|
+
@selectRow="selectRow"
|
|
10
|
+
@columnClick="columnClick"
|
|
11
|
+
serviceName="af-system"
|
|
12
|
+
ref="xFormTable">
|
|
13
|
+
</x-form-table>
|
|
14
|
+
</a-card>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
19
|
+
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'Demo',
|
|
23
|
+
components: {
|
|
24
|
+
XFormTable
|
|
25
|
+
},
|
|
26
|
+
data () {
|
|
27
|
+
return {
|
|
28
|
+
// 查询配置文件名
|
|
29
|
+
queryParamsName: 'ceshiCRUD',
|
|
30
|
+
// 查询配置左侧tree
|
|
31
|
+
xTreeConfigName: 'addressType',
|
|
32
|
+
// 新增表单固定值
|
|
33
|
+
fixedAddForm: {},
|
|
34
|
+
// 是否显示详情抽屉
|
|
35
|
+
detailVisible: false,
|
|
36
|
+
// 当前记录
|
|
37
|
+
record: {},
|
|
38
|
+
// 选中的行keys
|
|
39
|
+
selectedKeys: [],
|
|
40
|
+
selected: {
|
|
41
|
+
keys: [],
|
|
42
|
+
rows: []
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
test () {
|
|
48
|
+
this.$refs.xFormTable.setTableData([])
|
|
49
|
+
},
|
|
50
|
+
defaultF () {
|
|
51
|
+
this.$refs.xFormTable.setTableSize('default')
|
|
52
|
+
},
|
|
53
|
+
middleF () {
|
|
54
|
+
this.$refs.xFormTable.setTableSize('middle')
|
|
55
|
+
},
|
|
56
|
+
smallF () {
|
|
57
|
+
this.$refs.xFormTable.setTableSize('small')
|
|
58
|
+
},
|
|
59
|
+
columnClick (key, value, record) {
|
|
60
|
+
microDispatch({
|
|
61
|
+
type: 'v3route',
|
|
62
|
+
path: '/bingliguanli/dianzibingliluru',
|
|
63
|
+
props: { selected: arguments[0].his_f_admission_id }
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
action (record, id, actionType) {
|
|
67
|
+
this.detailVisible = true
|
|
68
|
+
console.log('触发了详情操作', record, id, actionType)
|
|
69
|
+
},
|
|
70
|
+
onClose () {
|
|
71
|
+
this.detailVisible = false
|
|
72
|
+
// 关闭详情之后重新查询表单
|
|
73
|
+
this.$refs.xFormTable.refreshTable(true)
|
|
74
|
+
},
|
|
75
|
+
selectRow (selectedRowKeys, selectedRows) {
|
|
76
|
+
this.selected = {
|
|
77
|
+
keys: selectedRowKeys,
|
|
78
|
+
rows: selectedRows
|
|
79
|
+
}
|
|
80
|
+
console.log('selectedDemo', this.selected)
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
computed: {},
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style scoped>
|
|
88
|
+
|
|
89
|
+
</style>
|
|
@@ -145,6 +145,17 @@
|
|
|
145
145
|
<a-tooltip title="列展示/排序" placement="bottom">
|
|
146
146
|
<table-setting v-if="columnSelectLoaded" v-model="tableColumns"/>
|
|
147
147
|
</a-tooltip>
|
|
148
|
+
<a-popover title="开发者调试信息" placement="bottomRight" v-if="!isDebugUser()">
|
|
149
|
+
<template slot="content">
|
|
150
|
+
<p>租户:{{ realQueryParams.$globalProp.tenantAlias }}</p>
|
|
151
|
+
<p>命名空间:{{ realQueryParams.$globalProp.namespaceName }} - {{ realQueryParams.$globalProp.module }}</p>
|
|
152
|
+
<p>配置名称:{{ queryParamsName }}</p>
|
|
153
|
+
<p>版本号:{{ realQueryParams.$globalProp.version }}</p>
|
|
154
|
+
</template>
|
|
155
|
+
<a-button>
|
|
156
|
+
<a-icon :style="iconStyle" type="bug"/>
|
|
157
|
+
</a-button>
|
|
158
|
+
</a-popover>
|
|
148
159
|
</a-button-group>
|
|
149
160
|
</span>
|
|
150
161
|
</a-col>
|
|
@@ -296,6 +307,7 @@ import ExportExcel from '@vue2-client/base-client/components/common/XTable/Expor
|
|
|
296
307
|
import g2Charts from '@vue2-client/components/g2Charts/index.vue'
|
|
297
308
|
import moment from 'moment/moment'
|
|
298
309
|
import XTableWrapper from './XTableWrapper.vue'
|
|
310
|
+
import {isDebugUser} from "@/utils/common";
|
|
299
311
|
|
|
300
312
|
export default {
|
|
301
313
|
name: 'XTable',
|
|
@@ -456,6 +468,7 @@ export default {
|
|
|
456
468
|
// crud打印模板配置
|
|
457
469
|
printTemplate: false,
|
|
458
470
|
queryParams: {},
|
|
471
|
+
realQueryParams: {},
|
|
459
472
|
// 定义总行数
|
|
460
473
|
totalCount: 0,
|
|
461
474
|
user: {},
|
|
@@ -595,6 +608,7 @@ export default {
|
|
|
595
608
|
window.removeEventListener('resize', this.handleResize)
|
|
596
609
|
},
|
|
597
610
|
methods: {
|
|
611
|
+
isDebugUser,
|
|
598
612
|
showTempData () {
|
|
599
613
|
this.selectedRowModalVisible = true
|
|
600
614
|
this.$nextTick(() => {
|
|
@@ -729,6 +743,7 @@ export default {
|
|
|
729
743
|
const {
|
|
730
744
|
// 查询参数对象, 用于没有对应查询配置文件名时
|
|
731
745
|
queryParams,
|
|
746
|
+
realQueryParams,
|
|
732
747
|
tableColumns,
|
|
733
748
|
attachGrid,
|
|
734
749
|
expandedGrid,
|
|
@@ -799,6 +814,7 @@ export default {
|
|
|
799
814
|
this.sortSummaryData()
|
|
800
815
|
}
|
|
801
816
|
this.queryParams = queryParams
|
|
817
|
+
this.realQueryParams = realQueryParams
|
|
802
818
|
this.tableColumns = JSON.parse(JSON.stringify(tableColumns))
|
|
803
819
|
if (this.tableColumns.length === 0) {
|
|
804
820
|
return
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="x-radio-container" :class="wrapperClassObject()">
|
|
3
|
-
|
|
3
|
+
<!-- 按钮模式 -->
|
|
4
|
+
<a-radio-group
|
|
5
|
+
v-if="config.buttonMode"
|
|
6
|
+
v-model="innerValue"
|
|
7
|
+
@change="onChange"
|
|
8
|
+
:class="['x-radio-group', 'x-radio-group-button', { 'x-radio-group-left': config.alignLeft }]"
|
|
9
|
+
button-style="solid">
|
|
10
|
+
<a-radio-button
|
|
11
|
+
v-for="item in data"
|
|
12
|
+
:key="item.value"
|
|
13
|
+
:value="item.value"
|
|
14
|
+
class="x-radio-button-item"
|
|
15
|
+
>
|
|
16
|
+
{{ item.label }}
|
|
17
|
+
</a-radio-button>
|
|
18
|
+
</a-radio-group>
|
|
19
|
+
|
|
20
|
+
<!-- 普通模式 -->
|
|
21
|
+
<a-radio-group
|
|
22
|
+
v-else
|
|
23
|
+
v-model="innerValue"
|
|
24
|
+
@change="onChange"
|
|
25
|
+
:class="['x-radio-group', { 'x-radio-group-left': config.alignLeft }]">
|
|
4
26
|
<div
|
|
5
27
|
v-for="item in data"
|
|
6
28
|
:key="item.value"
|
|
@@ -66,7 +88,8 @@
|
|
|
66
88
|
indicatorActiveColor: '#1890ff',
|
|
67
89
|
alignLeft: false,
|
|
68
90
|
showBorder: false,
|
|
69
|
-
highlightBorder: false
|
|
91
|
+
highlightBorder: false,
|
|
92
|
+
buttonMode: false
|
|
70
93
|
}
|
|
71
94
|
}
|
|
72
95
|
},
|
|
@@ -106,7 +129,11 @@
|
|
|
106
129
|
}
|
|
107
130
|
}
|
|
108
131
|
}
|
|
109
|
-
// 4.
|
|
132
|
+
// 4. 加载按钮模式配置
|
|
133
|
+
if (res.buttonMode !== undefined) {
|
|
134
|
+
this.config.buttonMode = res.buttonMode
|
|
135
|
+
}
|
|
136
|
+
// 5. 初始化默认值(优先级: 配置defaultValue > 第一个选项)
|
|
110
137
|
if (this.value !== undefined && this.value !== null) {
|
|
111
138
|
this.innerValue = this.value // 优先使用外部传入的 value
|
|
112
139
|
} else if (res.defaultValue !== undefined && res.defaultValue !== null) {
|
|
@@ -116,7 +143,7 @@
|
|
|
116
143
|
// 如果没有默认值但有选项,使用第一个选项
|
|
117
144
|
this.innerValue = this.data[0].value
|
|
118
145
|
}
|
|
119
|
-
//
|
|
146
|
+
// 6. 触发初始化事件
|
|
120
147
|
this.$emit('init', this.innerValue)
|
|
121
148
|
} else {
|
|
122
149
|
this.$message.error('配置错误,radio字段不是数组')
|
|
@@ -177,6 +204,62 @@
|
|
|
177
204
|
&.x-radio-group-left {
|
|
178
205
|
justify-content: flex-start;
|
|
179
206
|
}
|
|
207
|
+
|
|
208
|
+
&.x-radio-group-button {
|
|
209
|
+
display: flex;
|
|
210
|
+
justify-content: flex-end; // 居右对齐
|
|
211
|
+
gap: 0; // 移除间距,让按钮紧密相连
|
|
212
|
+
&.x-radio-group-left {
|
|
213
|
+
justify-content: flex-start;
|
|
214
|
+
}
|
|
215
|
+
:deep(.ant-radio-button-wrapper) {
|
|
216
|
+
border-radius: 0; // 先移除所有圆角
|
|
217
|
+
border: 1px solid #d9d9d9;
|
|
218
|
+
background: #fff;
|
|
219
|
+
color: #000;
|
|
220
|
+
transition: all 0.3s;
|
|
221
|
+
min-width: 80px;
|
|
222
|
+
text-align: center;
|
|
223
|
+
margin: 0; // 确保没有外边距
|
|
224
|
+
|
|
225
|
+
&:hover {
|
|
226
|
+
border-color: #40a9ff;
|
|
227
|
+
color: #40a9ff;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&.ant-radio-button-wrapper-checked {
|
|
231
|
+
background-color: #0057FE;
|
|
232
|
+
border-color: #0057FE;
|
|
233
|
+
color: #fff;
|
|
234
|
+
|
|
235
|
+
&:hover {
|
|
236
|
+
background-color: #0057FE;
|
|
237
|
+
border-color: #0057FE;
|
|
238
|
+
color: #fff;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// 第一个按钮只保留左侧圆角
|
|
242
|
+
&:first-child {
|
|
243
|
+
border-top-left-radius: 6px;
|
|
244
|
+
border-bottom-left-radius: 6px;
|
|
245
|
+
border-right: none; // 移除右边框,与下一个按钮连接
|
|
246
|
+
}
|
|
247
|
+
// 最后一个按钮只保留右侧圆角
|
|
248
|
+
&:last-child {
|
|
249
|
+
border-top-right-radius: 6px;
|
|
250
|
+
border-bottom-right-radius: 6px;
|
|
251
|
+
}
|
|
252
|
+
// 中间按钮(如果有)移除所有圆角和右边框
|
|
253
|
+
&:not(:first-child):not(:last-child) {
|
|
254
|
+
border-radius: 0;
|
|
255
|
+
border-right: none;
|
|
256
|
+
}
|
|
257
|
+
// 除了最后一个按钮,其他按钮都移除右边框
|
|
258
|
+
&:not(:last-child) {
|
|
259
|
+
border-right: none;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
180
263
|
}
|
|
181
264
|
|
|
182
265
|
.x-radio-item-container {
|
|
@@ -291,6 +374,7 @@
|
|
|
291
374
|
transition: all 0.3s;
|
|
292
375
|
max-width: 100%;
|
|
293
376
|
}
|
|
377
|
+
|
|
294
378
|
.x-radio-description {
|
|
295
379
|
padding: 4px 4px 4px 4px;
|
|
296
380
|
}
|
|
@@ -299,14 +299,16 @@ onMounted(() => {
|
|
|
299
299
|
height: 2px;
|
|
300
300
|
}
|
|
301
301
|
.x-title-compact {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
302
|
+
:deep(.x-title){
|
|
303
|
+
height: 23px;
|
|
304
|
+
opacity: 1;
|
|
305
|
+
font-family: "Source Han Sans";
|
|
306
|
+
font-size: 16px !important;
|
|
307
|
+
font-weight: 600;
|
|
308
|
+
line-height: normal;
|
|
309
|
+
letter-spacing: 0em;
|
|
310
|
+
font-feature-settings: "kern" on;
|
|
311
|
+
color: #313131;
|
|
312
|
+
}
|
|
311
313
|
}
|
|
312
314
|
</style>
|
package/src/utils/common.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// 验证是否为blob格式
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
|
|
2
4
|
export async function blobValidate (data) {
|
|
3
5
|
try {
|
|
4
6
|
const text = await data.text()
|
|
@@ -8,3 +10,9 @@ export async function blobValidate (data) {
|
|
|
8
10
|
return true
|
|
9
11
|
}
|
|
10
12
|
}
|
|
13
|
+
|
|
14
|
+
export function isDebugUser () {
|
|
15
|
+
const store = Vue.$store
|
|
16
|
+
const currUser = store.state.account?.user
|
|
17
|
+
return currUser.name === '1' || currUser.rolesnames.indexOf('运维人员') > -1
|
|
18
|
+
}
|