vue2-client 1.9.65 → 1.9.67
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 +1 -1
- package/src/base-client/components/common/XAddReport/XAddReport.vue +1 -1
- package/src/base-client/components/common/XButtons/XButtonDemo.vue +22 -0
- package/src/base-client/components/common/XDataCard/XDataCard.vue +1 -0
- package/src/base-client/components/common/XForm/XForm.vue +2 -2
- package/src/base-client/components/common/XFormCol/XFormCol.vue +71 -16
- package/src/base-client/components/common/XFormGroup/XFormGroup.vue +1 -1
- package/src/base-client/components/common/XFormTable/demo.vue +1 -1
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +1 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +2 -1
- package/src/base-client/components/common/XTable/TableCellRenderer.vue +161 -0
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@cancel="close"
|
|
10
10
|
@ok="onSubmit"
|
|
11
11
|
v-bind="attr">
|
|
12
|
-
<div style="max-height: 70vh; overflow-y: auto;" v-if="showReport">
|
|
12
|
+
<div style="max-height: 70vh; overflow-y: auto;overflow-x: hidden;" v-if="showReport">
|
|
13
13
|
<x-report
|
|
14
14
|
@updateImg="updateImg"
|
|
15
15
|
@selectRow="selectRow"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<x-buttons></x-buttons>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import XButtons from './XButtons.vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'XButtonDemo',
|
|
12
|
+
components: {
|
|
13
|
+
XButtons
|
|
14
|
+
},
|
|
15
|
+
data () {
|
|
16
|
+
return {
|
|
17
|
+
configName: 'drugInventAuditTab'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
methods: {},
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:model="form"
|
|
8
8
|
:rules="rules"
|
|
9
9
|
layout="inline">
|
|
10
|
-
<a-row :gutter="24">
|
|
10
|
+
<a-row :gutter="24" type="flex">
|
|
11
11
|
<x-form-item
|
|
12
12
|
v-for="(item, index) in realJsonData.slice(0,7)"
|
|
13
13
|
:showLabel="!simpleMode"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
@mounted="onItemMounted"
|
|
48
48
|
/>
|
|
49
49
|
</div>
|
|
50
|
-
<a-col>
|
|
50
|
+
<a-col style="margin-left: auto">
|
|
51
51
|
<span
|
|
52
52
|
:style="advanced && { float: 'right', overflow: 'hidden' } || {} "
|
|
53
53
|
class="table-page-search-submitButtons">
|
|
@@ -1,36 +1,91 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a-col
|
|
3
|
-
:
|
|
4
|
-
:sm="flex.sm"
|
|
5
|
-
:md="flex.md"
|
|
6
|
-
:lg="flex.lg"
|
|
7
|
-
:xl="flex.xl"
|
|
8
|
-
:xxl="flex.xxl">
|
|
3
|
+
:style="computedStyles">
|
|
9
4
|
<slot></slot>
|
|
10
5
|
</a-col>
|
|
11
6
|
</template>
|
|
12
7
|
|
|
13
8
|
<script>
|
|
9
|
+
const BREAKPOINTS = {
|
|
10
|
+
xs: 576,
|
|
11
|
+
sm: 768,
|
|
12
|
+
md: 992,
|
|
13
|
+
lg: 1200,
|
|
14
|
+
xl: 1600
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function debounce (fn, delay) {
|
|
18
|
+
let timeout = null
|
|
19
|
+
return function (...args) {
|
|
20
|
+
if (timeout) clearTimeout(timeout)
|
|
21
|
+
timeout = setTimeout(() => {
|
|
22
|
+
fn.apply(this, args)
|
|
23
|
+
}, delay)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
14
26
|
|
|
15
27
|
export default {
|
|
16
28
|
name: 'XFormCol',
|
|
17
29
|
props: {
|
|
18
30
|
flex: {
|
|
19
31
|
type: Object,
|
|
20
|
-
default: () => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
default: () => ({
|
|
33
|
+
xs: 24,
|
|
34
|
+
sm: 24,
|
|
35
|
+
md: 12,
|
|
36
|
+
lg: 8,
|
|
37
|
+
xl: 6,
|
|
38
|
+
xxl: 6,
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
computed: {
|
|
43
|
+
computedFlex () {
|
|
44
|
+
const parentWidth = this.parentWidth
|
|
45
|
+
if (parentWidth === 0) {
|
|
46
|
+
return this.flex.xs
|
|
47
|
+
}
|
|
48
|
+
if (parentWidth < BREAKPOINTS.xs) return this.flex.xs
|
|
49
|
+
if (parentWidth < BREAKPOINTS.sm) return this.flex.sm
|
|
50
|
+
if (parentWidth < BREAKPOINTS.md) return this.flex.md
|
|
51
|
+
if (parentWidth < BREAKPOINTS.lg) return this.flex.lg
|
|
52
|
+
if (parentWidth < BREAKPOINTS.xl) return this.flex.xl
|
|
53
|
+
return this.flex.xxl
|
|
54
|
+
},
|
|
55
|
+
computedStyles () {
|
|
56
|
+
const flexValue = (this.computedFlex * 100) / 24
|
|
57
|
+
return {
|
|
58
|
+
flex: `0 0 ${flexValue}%`,
|
|
59
|
+
maxWidth: `${flexValue}%`,
|
|
29
60
|
}
|
|
30
61
|
}
|
|
31
62
|
},
|
|
32
63
|
data () {
|
|
33
|
-
return {
|
|
64
|
+
return {
|
|
65
|
+
parentWidth: 0,
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
mounted () {
|
|
69
|
+
// 根据父容器宽度响应式
|
|
70
|
+
this.$nextTick(() => {
|
|
71
|
+
const container = this.$el.parentNode
|
|
72
|
+
this.parentWidth = container.offsetWidth
|
|
73
|
+
const updateWidth = debounce((width) => {
|
|
74
|
+
this.parentWidth = width
|
|
75
|
+
}, 100)
|
|
76
|
+
|
|
77
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
78
|
+
for (const entry of entries) {
|
|
79
|
+
updateWidth(entry.contentRect.width)
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
this.resizeObserver.observe(container)
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
beforeUnmount () {
|
|
86
|
+
if (this.resizeObserver) {
|
|
87
|
+
this.resizeObserver.disconnect()
|
|
88
|
+
}
|
|
34
89
|
}
|
|
35
90
|
}
|
|
36
91
|
</script>
|
|
@@ -411,6 +411,7 @@ export default {
|
|
|
411
411
|
Upload,
|
|
412
412
|
XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
|
|
413
413
|
XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
|
|
414
|
+
XFormGroup: () => import('@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'),
|
|
414
415
|
XTreePro: () => import('@vue2-client/base-client/components/common/XTree/XTreePro.vue'),
|
|
415
416
|
XHisEditor: () => import('@vue2-client/base-client/components/his/XHisEditor/XHisEditor.vue'),
|
|
416
417
|
XTab: () => import('@vue2-client/base-client/components/common/XTab/XTab.vue'),
|
|
@@ -551,7 +552,7 @@ export default {
|
|
|
551
552
|
}
|
|
552
553
|
})
|
|
553
554
|
}, this.env === 'dev')
|
|
554
|
-
} else if (cell.
|
|
555
|
+
} else if (cell.slotType === 'x-form-group') {
|
|
555
556
|
// 简易表单需要主动调用初始化方法
|
|
556
557
|
getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
|
|
557
558
|
// 如果配置了 表单初始化logic
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<x-form-item
|
|
3
|
+
v-if="isEditMode && getFromItem(item.dataIndex)"
|
|
4
|
+
class="innerTable"
|
|
5
|
+
:form="record"
|
|
6
|
+
:attr="getFromItem(item.dataIndex)"
|
|
7
|
+
:service-name="serviceName"
|
|
8
|
+
mode="新增/修改"
|
|
9
|
+
:env="env"
|
|
10
|
+
:showLabel="false"
|
|
11
|
+
/>
|
|
12
|
+
<!-- 序号列 -->
|
|
13
|
+
<span v-else-if="item.slotType === 'index'">
|
|
14
|
+
{{ index + 1 }}
|
|
15
|
+
</span>
|
|
16
|
+
<!-- 行链接 -->
|
|
17
|
+
<span v-else-if="item.slotType === 'link'">
|
|
18
|
+
<a @click="columnClick(item.dataIndex, text, record)">{{ text }}</a>
|
|
19
|
+
</span>
|
|
20
|
+
<!-- 文本溢出省略 -->
|
|
21
|
+
<span v-else-if="item.slotType === 'ellipsis'">
|
|
22
|
+
<ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
|
|
23
|
+
</span>
|
|
24
|
+
<!-- 徽标 -->
|
|
25
|
+
<span v-else-if="item.slotType === 'badge'">
|
|
26
|
+
<x-badge
|
|
27
|
+
:service-name="serviceName"
|
|
28
|
+
:env="env"
|
|
29
|
+
v-if="text !== null && text !== undefined"
|
|
30
|
+
:badge-key="item.slotKeyMap"
|
|
31
|
+
:value="text"
|
|
32
|
+
/>
|
|
33
|
+
</span>
|
|
34
|
+
<!-- 日期 -->
|
|
35
|
+
<span v-else-if="item.slotType === 'date'">
|
|
36
|
+
{{ format(text, 'yyyy-MM-dd') }}
|
|
37
|
+
</span>
|
|
38
|
+
<!-- 日期时间 -->
|
|
39
|
+
<span v-else-if="item.slotType === 'dateTime'">
|
|
40
|
+
{{ format(text, 'yyyy-MM-dd hh:mm:ss') }}
|
|
41
|
+
</span>
|
|
42
|
+
<!-- 两位小数 -->
|
|
43
|
+
<span v-else-if="item.slotType === 'towDecimal'">
|
|
44
|
+
{{ numberFormat(text, 2) }}
|
|
45
|
+
</span>
|
|
46
|
+
<!-- 四位小数 -->
|
|
47
|
+
<span v-else-if="item.slotType === 'fourDecimal'">
|
|
48
|
+
{{ numberFormat(text, 4) }}
|
|
49
|
+
</span>
|
|
50
|
+
<!-- 整数 -->
|
|
51
|
+
<span v-else-if="item.slotType === 'int'">
|
|
52
|
+
{{ numberFormat(text, 0) }}
|
|
53
|
+
</span>
|
|
54
|
+
<!-- 操作列 -->
|
|
55
|
+
<span v-else-if="item.slotType === 'action'">
|
|
56
|
+
<template v-if="item.actionArr && item.actionArr.length > 0">
|
|
57
|
+
<a-dropdown>
|
|
58
|
+
<a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
59
|
+
{{ item.scopedSlots?.customRender || item.slotValue }} <a-icon type="down"/>
|
|
60
|
+
</a>
|
|
61
|
+
<a-menu slot="overlay" style="min-width: 60px">
|
|
62
|
+
<a-menu-item
|
|
63
|
+
v-for="(action_item, actionIndex) in item.actionArr"
|
|
64
|
+
:key="actionIndex"
|
|
65
|
+
v-if="!action_item.customFunction || executeStrFunction(action_item.customFunction, [record, c_index])"
|
|
66
|
+
>
|
|
67
|
+
<a style="text-align: center" @click="action(record, item.dataIndex, action_item.func)">
|
|
68
|
+
{{ action_item.text }}
|
|
69
|
+
</a>
|
|
70
|
+
</a-menu-item>
|
|
71
|
+
</a-menu>
|
|
72
|
+
</a-dropdown>
|
|
73
|
+
</template>
|
|
74
|
+
<template v-if="!item.actionArr || item.actionArr.length === 0">
|
|
75
|
+
<a @click="action(record, item.dataIndex)">{{ item.slotValue }}</a>
|
|
76
|
+
</template>
|
|
77
|
+
</span>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script>
|
|
81
|
+
import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem.vue'
|
|
82
|
+
import Ellipsis from '@vue2-client/components/Ellipsis/Ellipsis.vue'
|
|
83
|
+
import XBadge from '@vue2-client/base-client/components/common/XBadge/XBadge.vue'
|
|
84
|
+
import { executeStrFunction } from '@vue2-client/utils/runEvalFunction'
|
|
85
|
+
import { formatDate } from '@/utils/util'
|
|
86
|
+
|
|
87
|
+
export default {
|
|
88
|
+
components: { XBadge, Ellipsis, XFormItem },
|
|
89
|
+
props: {
|
|
90
|
+
item: {
|
|
91
|
+
type: Object,
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
record: {
|
|
95
|
+
type: Object,
|
|
96
|
+
required: true,
|
|
97
|
+
},
|
|
98
|
+
index: {
|
|
99
|
+
type: Number,
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
text: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: true,
|
|
105
|
+
},
|
|
106
|
+
serviceName: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: undefined
|
|
109
|
+
},
|
|
110
|
+
env: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: undefined
|
|
113
|
+
},
|
|
114
|
+
isEditMode: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false
|
|
117
|
+
},
|
|
118
|
+
formItems: {
|
|
119
|
+
type: Array,
|
|
120
|
+
required: true,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
executeStrFunction,
|
|
125
|
+
getFromItem (model) {
|
|
126
|
+
const aa = this.formItems.find(item => item.model === model && item.editRow)
|
|
127
|
+
if (aa) {
|
|
128
|
+
return JSON.parse(JSON.stringify(aa))
|
|
129
|
+
}
|
|
130
|
+
return false
|
|
131
|
+
},
|
|
132
|
+
columnClick () {
|
|
133
|
+
this.$emit('columnClick', ...arguments)
|
|
134
|
+
},
|
|
135
|
+
action () {
|
|
136
|
+
this.$emit('action', ...arguments)
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* 格式化日期
|
|
140
|
+
* @param date 日期字符串
|
|
141
|
+
* @param format 格式化方式
|
|
142
|
+
*/
|
|
143
|
+
format (date, format) {
|
|
144
|
+
return formatDate(date, format)
|
|
145
|
+
},
|
|
146
|
+
/**
|
|
147
|
+
* 格式化数字
|
|
148
|
+
* @param number string 或者 number
|
|
149
|
+
* @param decimalPlaces 小数位数
|
|
150
|
+
*/
|
|
151
|
+
numberFormat (number, decimalPlaces = 2) {
|
|
152
|
+
const value = parseFloat(number)
|
|
153
|
+
if (!isNaN(value)) {
|
|
154
|
+
return value.toFixed(decimalPlaces)
|
|
155
|
+
} else {
|
|
156
|
+
return ''
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
}
|
|
161
|
+
</script>
|
|
@@ -85,9 +85,9 @@ routerResource.example = {
|
|
|
85
85
|
name: '示例页面',
|
|
86
86
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
87
87
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
88
|
-
|
|
88
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
89
89
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
90
|
-
component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|
|
90
|
+
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|
|
91
91
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
92
92
|
meta: {
|
|
93
93
|
// 菜单中不显示
|