af-mobile-client-vue3 1.2.57 → 1.3.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/.editorconfig +5 -34
- package/.env +1 -1
- package/.env.development +0 -3
- package/.env.production +1 -7
- package/build/vite/index.ts +2 -12
- package/build/vite/optimize.ts +2 -2
- package/compress.js +36 -0
- package/package.json +114 -114
- package/src/App.vue +3 -5
- package/src/assets/img/banner/appraise-banner-1.png +0 -0
- package/src/assets/img/banner/appraise-banner-2.png +0 -0
- package/src/components/core/BeautifulLoading/index.vue +1 -2
- package/src/components/core/ImageUploader/index.vue +3 -2
- package/src/components/core/NavBar/index.vue +23 -13
- package/src/components/core/Tabbar/index.vue +5 -3
- package/src/components/data/XBadge/index.vue +2 -2
- package/src/components/data/XCellList/index.vue +20 -66
- package/src/components/data/XFormGroup/doc/DeviceForm.vue +1 -1
- package/src/components/data/XFormGroup/doc/FormGroupDemo.vue +4 -4
- package/src/components/data/XFormGroup/doc/UserForm.vue +1 -1
- package/src/components/data/XFormGroup/index.vue +11 -1
- package/src/components/data/XFormItem/index.vue +2 -22
- package/src/components/data/XReportForm/XReportFormJsonRender.vue +22 -22
- package/src/components/data/XReportForm/index.vue +23 -14
- package/src/components/data/XReportGrid/XAddReport/XAddReport.vue +1 -2
- package/src/components/data/XReportGrid/XReport.vue +3 -3
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/XReportDesign.vue +13 -13
- package/src/components/data/XReportGrid/XReportDrawer/XReportDrawer.vue +1 -1
- package/src/components/data/XReportGrid/XReportJsonRender.vue +11 -11
- package/src/components/data/XReportGrid/XReportTrGroup.vue +3 -3
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/components/layout/NormalDataLayout/index.vue +2 -3
- package/src/config/routes.ts +6 -2
- package/src/constants/index.ts +2 -0
- package/src/locales/en-US.json +52 -28
- package/src/locales/zh-CN.json +57 -33
- package/src/main.ts +0 -2
- package/src/router/types.ts +0 -2
- package/src/types/vue-router.d.ts +0 -2
- package/src/utils/mobileUtil.ts +2 -2
- package/src/utils/set-page-title.ts +3 -5
- package/src/views/common/LoadError.vue +1 -2
- package/src/views/common/NotFound.vue +2 -3
- package/src/views/component/XCellListView/index.vue +94 -133
- package/src/views/component/XFormGroupView/index.vue +7 -16
- package/src/views/component/XFormView/index.vue +15 -95
- package/src/views/user/login/LoginForm.vue +3 -3
- package/tsconfig.json +5 -8
- package/uno.config.ts +32 -1
- package/vite.config.ts +3 -3
- package/.env.envoiceShow +0 -7
- package/src/components/core/App/MicroAppView.vue +0 -59
- package/src/components/core/SvgIcon/index.vue +0 -61
- package/src/utils/local-storage.ts +0 -9
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XBadge from '@af-mobile-client-vue3/components/data/XBadge/index.vue'
|
|
3
3
|
import XCellListFilter from '@af-mobile-client-vue3/components/data/XCellListFilter/index.vue'
|
|
4
|
-
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
5
4
|
import { getConfigByName, query } from '@af-mobile-client-vue3/services/api/common'
|
|
6
5
|
import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
|
|
7
6
|
import { getRangeByType } from '@af-mobile-client-vue3/utils/queryFormDefaultRangePicker'
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
Icon as VanIcon,
|
|
16
15
|
List as VanList,
|
|
17
16
|
Popover as VanPopover,
|
|
18
|
-
Popup as VanPopup,
|
|
19
17
|
PullRefresh as VanPullRefresh,
|
|
20
18
|
Row as VanRow,
|
|
21
19
|
Search as VanSearch,
|
|
@@ -25,7 +23,15 @@ import {
|
|
|
25
23
|
import { computed, defineEmits, defineProps, getCurrentInstance, onBeforeMount, ref, useSlots, watch } from 'vue'
|
|
26
24
|
import { useRouter } from 'vue-router'
|
|
27
25
|
|
|
28
|
-
const {
|
|
26
|
+
const {
|
|
27
|
+
configName = '',
|
|
28
|
+
fixQueryForm = null,
|
|
29
|
+
idKey = 'o_id',
|
|
30
|
+
serviceName,
|
|
31
|
+
scanOptions,
|
|
32
|
+
customAdd = false,
|
|
33
|
+
customEdit = false,
|
|
34
|
+
} = defineProps<{
|
|
29
35
|
configName?: string
|
|
30
36
|
fixQueryForm?: object
|
|
31
37
|
idKey?: string
|
|
@@ -38,15 +44,7 @@ const { configName, serviceName, fixQueryForm, customAdd, customEdit } = withDef
|
|
|
38
44
|
// 是否自定义新增、编辑按钮
|
|
39
45
|
customAdd?: boolean
|
|
40
46
|
customEdit?: boolean
|
|
41
|
-
}>()
|
|
42
|
-
configName: '',
|
|
43
|
-
fixQueryForm: null,
|
|
44
|
-
idKey: 'o_id',
|
|
45
|
-
serviceName: undefined,
|
|
46
|
-
scanOptions: undefined,
|
|
47
|
-
customAdd: false,
|
|
48
|
-
customEdit: false,
|
|
49
|
-
})
|
|
47
|
+
}>()
|
|
50
48
|
|
|
51
49
|
const emit = defineEmits<{
|
|
52
50
|
(e: 'toDetail', item: any): void
|
|
@@ -151,9 +149,6 @@ const slots = useSlots()
|
|
|
151
149
|
// 当前组件实例(不推荐使用,可能会在后续的版本更迭中调整,暂时用来绑定函数的上下文)
|
|
152
150
|
const currInst = getCurrentInstance()
|
|
153
151
|
|
|
154
|
-
// 控制抽屉显示
|
|
155
|
-
const showDrawer = ref(false)
|
|
156
|
-
|
|
157
152
|
// 列表底部的文字显示
|
|
158
153
|
function finishedBottomText() {
|
|
159
154
|
if (buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
|
|
@@ -469,7 +464,16 @@ function addOption() {
|
|
|
469
464
|
emit('add')
|
|
470
465
|
}
|
|
471
466
|
else {
|
|
472
|
-
|
|
467
|
+
// 默认行为 - 导航到XForm页面
|
|
468
|
+
router.push({
|
|
469
|
+
name: 'XForm',
|
|
470
|
+
query: {
|
|
471
|
+
groupFormItems: JSON.stringify(groupFormItems.value),
|
|
472
|
+
serviceName,
|
|
473
|
+
formData: JSON.stringify({}),
|
|
474
|
+
mode: '新增',
|
|
475
|
+
},
|
|
476
|
+
})
|
|
473
477
|
}
|
|
474
478
|
}
|
|
475
479
|
|
|
@@ -744,23 +748,6 @@ defineExpose({
|
|
|
744
748
|
</VanPullRefresh>
|
|
745
749
|
<VanBackTop />
|
|
746
750
|
</div>
|
|
747
|
-
<VanPopup v-model:show="showDrawer" position="bottom" :style="{ height: '90vh', borderTopLeftRadius: '10px', borderTopRightRadius: '10px', overflow: 'hidden', padding: 0 }">
|
|
748
|
-
<div class="drawer-header">
|
|
749
|
-
<span class="drawer-title">{{ title || '新增' }}</span>
|
|
750
|
-
<van-icon name="cross" class="drawer-close" @click="showDrawer = false" />
|
|
751
|
-
</div>
|
|
752
|
-
<div class="drawer-content-scroll">
|
|
753
|
-
<XForm
|
|
754
|
-
:config-name="configName"
|
|
755
|
-
:service-name="serviceName"
|
|
756
|
-
:form-data="{}"
|
|
757
|
-
:group-form-items="groupFormItems"
|
|
758
|
-
mode="新增"
|
|
759
|
-
@on-submit="showDrawer = false"
|
|
760
|
-
@close="showDrawer = false"
|
|
761
|
-
/>
|
|
762
|
-
</div>
|
|
763
|
-
</VanPopup>
|
|
764
751
|
</div>
|
|
765
752
|
</template>
|
|
766
753
|
|
|
@@ -1081,37 +1068,4 @@ defineExpose({
|
|
|
1081
1068
|
}
|
|
1082
1069
|
}
|
|
1083
1070
|
}
|
|
1084
|
-
.drawer-header {
|
|
1085
|
-
position: sticky;
|
|
1086
|
-
top: 0;
|
|
1087
|
-
left: 0;
|
|
1088
|
-
right: 0;
|
|
1089
|
-
z-index: 2;
|
|
1090
|
-
display: flex;
|
|
1091
|
-
align-items: center;
|
|
1092
|
-
justify-content: center;
|
|
1093
|
-
height: 48px;
|
|
1094
|
-
border-bottom: 1px solid #f0f0f0;
|
|
1095
|
-
background: #fff;
|
|
1096
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.03);
|
|
1097
|
-
}
|
|
1098
|
-
.drawer-title {
|
|
1099
|
-
font-size: 18px;
|
|
1100
|
-
font-weight: 600;
|
|
1101
|
-
color: #222;
|
|
1102
|
-
}
|
|
1103
|
-
.drawer-close {
|
|
1104
|
-
position: absolute;
|
|
1105
|
-
right: 16px;
|
|
1106
|
-
top: 50%;
|
|
1107
|
-
transform: translateY(-50%);
|
|
1108
|
-
font-size: 22px;
|
|
1109
|
-
color: #888;
|
|
1110
|
-
cursor: pointer;
|
|
1111
|
-
}
|
|
1112
|
-
.drawer-content-scroll {
|
|
1113
|
-
height: calc(90vh - 48px);
|
|
1114
|
-
overflow-y: auto;
|
|
1115
|
-
background: #fff;
|
|
1116
|
-
}
|
|
1117
1071
|
</style>
|
|
@@ -33,21 +33,21 @@ function handleSubmit(result: any) {
|
|
|
33
33
|
@submit="handleSubmit"
|
|
34
34
|
>
|
|
35
35
|
<!-- 用户信息插槽 -->
|
|
36
|
-
<template #user="{ setRef, removeRef,
|
|
36
|
+
<template #user="{ setRef, removeRef, formData }">
|
|
37
37
|
<UserForm
|
|
38
38
|
:set-ref="setRef"
|
|
39
39
|
:remove-ref="removeRef"
|
|
40
40
|
form-group-name="userInfo"
|
|
41
|
-
:form-data="
|
|
41
|
+
:form-data="formData"
|
|
42
42
|
/>
|
|
43
43
|
</template>
|
|
44
44
|
<!-- 设备信息插槽 -->
|
|
45
|
-
<template #device="{ setRef, removeRef,
|
|
45
|
+
<template #device="{ setRef, removeRef, formData }">
|
|
46
46
|
<DeviceForm
|
|
47
47
|
:set-ref="setRef"
|
|
48
48
|
:remove-ref="removeRef"
|
|
49
49
|
form-group-name="deviceInfo"
|
|
50
|
-
:form-data="
|
|
50
|
+
:form-data="formData"
|
|
51
51
|
/>
|
|
52
52
|
</template>
|
|
53
53
|
</XFormGroup>
|
|
@@ -10,12 +10,14 @@ const props = withDefaults(defineProps<{
|
|
|
10
10
|
groupFormData?: object
|
|
11
11
|
mode?: string
|
|
12
12
|
isScrollspy?: boolean
|
|
13
|
+
formShow?: any
|
|
13
14
|
}>(), {
|
|
14
15
|
configName: '',
|
|
15
16
|
serviceName: undefined,
|
|
16
17
|
groupFormData: () => ({}),
|
|
17
18
|
mode: '查询',
|
|
18
19
|
isScrollspy: true,
|
|
20
|
+
formShow: undefined,
|
|
19
21
|
})
|
|
20
22
|
const emit = defineEmits(['submit', 'xFormItemEmitFunc'])
|
|
21
23
|
|
|
@@ -25,6 +27,7 @@ interface Form {
|
|
|
25
27
|
groupFormData?: object
|
|
26
28
|
mode?: string
|
|
27
29
|
isScrollspy?: boolean
|
|
30
|
+
formShow?: any
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
const groupItems = ref([])
|
|
@@ -38,6 +41,12 @@ const propsData = ref<Partial<Form>>({})
|
|
|
38
41
|
const slots = useSlots()
|
|
39
42
|
const renderableGroupItems = computed(() => {
|
|
40
43
|
return groupItems.value.filter((item) => {
|
|
44
|
+
if (props.formShow && (item.groupName || item.slotName)) {
|
|
45
|
+
const showKey = `show${item.groupName || item.slotName}`
|
|
46
|
+
if (props.formShow[showKey] === false) {
|
|
47
|
+
return false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
41
50
|
if (item.formGroupType === 'slot') {
|
|
42
51
|
return !!(item.slotName && slots[item.slotName])
|
|
43
52
|
}
|
|
@@ -53,6 +62,7 @@ function init(params: Form) {
|
|
|
53
62
|
serviceName: props.serviceName,
|
|
54
63
|
groupFormData: props.groupFormData,
|
|
55
64
|
mode: props.mode,
|
|
65
|
+
formShow: props.formShow,
|
|
56
66
|
...params,
|
|
57
67
|
}
|
|
58
68
|
formData.value = propsData.value.groupFormData
|
|
@@ -141,7 +151,7 @@ defineExpose({ init, removeRef, xFormListRef })
|
|
|
141
151
|
>
|
|
142
152
|
<div
|
|
143
153
|
class="x-form-group-item"
|
|
144
|
-
:class="{ 'is-last': index ===
|
|
154
|
+
:class="{ 'is-last': index === renderableGroupItems.length - 1 }"
|
|
145
155
|
>
|
|
146
156
|
<div v-if="item.describe && propsData.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
|
|
147
157
|
<span class="form-group-bar" />
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type { FieldType } from 'vant'
|
|
3
3
|
import type { Numeric } from 'vant/es/utils'
|
|
4
4
|
import ImageUploader from '@af-mobile-client-vue3/components/core/ImageUploader/index.vue'
|
|
5
|
-
import Uploader from '@af-mobile-client-vue3/components/core/Uploader/index.vue'
|
|
6
5
|
import XGridDropOption from '@af-mobile-client-vue3/components/core/XGridDropOption/index.vue'
|
|
7
6
|
import XMultiSelect from '@af-mobile-client-vue3/components/core/XMultiSelect/index.vue'
|
|
8
7
|
import XSelect from '@af-mobile-client-vue3/components/core/XSelect/index.vue'
|
|
@@ -964,29 +963,9 @@ function findOptionInTree(options, value) {
|
|
|
964
963
|
</VanField>
|
|
965
964
|
|
|
966
965
|
<!-- 文件上传 -->
|
|
967
|
-
<VanField
|
|
968
|
-
v-if="attr.type === 'file' && showItem"
|
|
969
|
-
name="uploader"
|
|
970
|
-
:label="labelData"
|
|
971
|
-
:label-align="labelAlign"
|
|
972
|
-
:input-align="attr.inputAlign ? attr.inputAlign : 'left'"
|
|
973
|
-
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
974
|
-
:required="attr.rule.required === 'true'"
|
|
975
|
-
>
|
|
976
|
-
<template #input>
|
|
977
|
-
<!-- <van-uploader v-model="localValue" /> -->
|
|
978
|
-
<Uploader
|
|
979
|
-
upload-mode="server"
|
|
980
|
-
:image-list="(modelData as any[])"
|
|
981
|
-
authority="admin"
|
|
982
|
-
@update-file-list="updateFile"
|
|
983
|
-
/>
|
|
984
|
-
</template>
|
|
985
|
-
</VanField>
|
|
986
|
-
|
|
987
966
|
<!-- 图片上传, 手机端拍照 -->
|
|
988
967
|
<VanField
|
|
989
|
-
v-if="attr.type === 'image' && showItem"
|
|
968
|
+
v-if="(attr.type === 'image' || attr.type === 'file') && showItem"
|
|
990
969
|
name="image"
|
|
991
970
|
:label="labelData"
|
|
992
971
|
:label-align="labelAlign"
|
|
@@ -1000,6 +979,7 @@ function findOptionInTree(options, value) {
|
|
|
1000
979
|
:image-list="(modelData as any[])"
|
|
1001
980
|
authority="admin"
|
|
1002
981
|
:attr="attr"
|
|
982
|
+
:mode="props.mode"
|
|
1003
983
|
@update-file-list="updateFile"
|
|
1004
984
|
/>
|
|
1005
985
|
</template>
|
|
@@ -81,10 +81,10 @@ initComponent()
|
|
|
81
81
|
function initComponent() {
|
|
82
82
|
for (let i = 0; i < props.jsonConfig.content.length; i++) {
|
|
83
83
|
receivedFunction.push({
|
|
84
|
-
// eslint-disable-next-line no-
|
|
85
|
-
labelFunction:
|
|
86
|
-
// eslint-disable-next-line no-
|
|
87
|
-
valueFunction:
|
|
84
|
+
// eslint-disable-next-line no-new-func
|
|
85
|
+
labelFunction: new Function(`return ${props.jsonConfig.content[i].customFunctionForLabel}`)(),
|
|
86
|
+
// eslint-disable-next-line no-new-func
|
|
87
|
+
valueFunction: new Function(`return ${props.jsonConfig.content[i].customFunctionForValue}`)(),
|
|
88
88
|
})
|
|
89
89
|
}
|
|
90
90
|
formatConfig()
|
|
@@ -127,25 +127,25 @@ function initComponent() {
|
|
|
127
127
|
</template>
|
|
128
128
|
|
|
129
129
|
<style scoped lang="less">
|
|
130
|
-
.main{
|
|
130
|
+
.main {
|
|
131
131
|
padding-top: 4vh;
|
|
132
132
|
width: 100vw;
|
|
133
133
|
height: 100vh;
|
|
134
134
|
background-color: #eff2f5;
|
|
135
135
|
|
|
136
|
-
.title{
|
|
136
|
+
.title {
|
|
137
137
|
padding-bottom: 2vh;
|
|
138
138
|
color: rgb(50, 50, 51);
|
|
139
139
|
text-align: center;
|
|
140
140
|
margin: 0 0 3vh;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
.text_box{
|
|
143
|
+
.text_box {
|
|
144
144
|
margin-top: 2vh;
|
|
145
145
|
margin-bottom: 2vh;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
.main_text{
|
|
148
|
+
.main_text {
|
|
149
149
|
padding-left: 16px;
|
|
150
150
|
font-weight: 400;
|
|
151
151
|
line-height: 1.6;
|
|
@@ -154,53 +154,53 @@ function initComponent() {
|
|
|
154
154
|
font-size: 14px;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
.show_value_item{
|
|
157
|
+
.show_value_item {
|
|
158
158
|
text-align: center;
|
|
159
159
|
font-size: 1.2em;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
.cell_group{
|
|
162
|
+
.cell_group {
|
|
163
163
|
margin-top: 2vh;
|
|
164
164
|
margin-bottom: 2vh;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
.form_item{
|
|
167
|
+
.form_item {
|
|
168
168
|
margin-top: 2vh;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
.button_group{
|
|
171
|
+
.button_group {
|
|
172
172
|
text-align: center;
|
|
173
173
|
margin-top: 3vh;
|
|
174
174
|
margin-bottom: 3vh;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.button_group
|
|
177
|
+
.button_group > :first-child {
|
|
178
178
|
margin-right: 3vw;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.divider{
|
|
181
|
+
.divider {
|
|
182
182
|
color: #1989fa;
|
|
183
183
|
border-color: #1989fa;
|
|
184
|
-
padding: 0 16px
|
|
184
|
+
padding: 0 16px;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
.submit_button{
|
|
187
|
+
.submit_button {
|
|
188
188
|
background-color: #eff2f5;
|
|
189
189
|
padding: 5vh;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
.skeleton{
|
|
194
|
-
margin-top: 5vh
|
|
193
|
+
.skeleton {
|
|
194
|
+
margin-top: 5vh;
|
|
195
195
|
}
|
|
196
|
-
.my-cell-group{
|
|
197
|
-
margin: 0 0 10px 0
|
|
196
|
+
.my-cell-group {
|
|
197
|
+
margin: 0 0 10px 0;
|
|
198
198
|
}
|
|
199
199
|
:deep(.van-collapse-item__content) {
|
|
200
200
|
background-color: #eff2f5;
|
|
201
201
|
padding: 10px 0;
|
|
202
202
|
}
|
|
203
|
-
:deep(.van-cell-group__title){
|
|
203
|
+
:deep(.van-cell-group__title) {
|
|
204
204
|
padding-top: 10px;
|
|
205
205
|
padding-bottom: 10px;
|
|
206
206
|
}
|
|
@@ -210,7 +210,7 @@ function initComponent() {
|
|
|
210
210
|
:deep(.van-cell__title) {
|
|
211
211
|
font-weight: 600;
|
|
212
212
|
}
|
|
213
|
-
:deep(.van-uploader__wrapper){
|
|
213
|
+
:deep(.van-uploader__wrapper) {
|
|
214
214
|
padding: 10px;
|
|
215
215
|
display: flex;
|
|
216
216
|
flex-wrap: wrap;
|
|
@@ -143,10 +143,7 @@ function isFieldEmpty(value: any): boolean {
|
|
|
143
143
|
if (Array.isArray(value) && value.length === 0) {
|
|
144
144
|
return true
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
return true
|
|
148
|
-
}
|
|
149
|
-
return false
|
|
146
|
+
return typeof value === 'object' && Object.keys(value).length === 0
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
// 表单校验
|
|
@@ -432,16 +429,28 @@ function getConfigAndJoin(config: configDefine, outerLock: getConfigLock): void
|
|
|
432
429
|
}
|
|
433
430
|
}
|
|
434
431
|
|
|
435
|
-
function deserializeFunctionAndRun(functionStr, value) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
432
|
+
function deserializeFunctionAndRun(functionStr: string, value: any) {
|
|
433
|
+
try {
|
|
434
|
+
// eslint-disable-next-line no-new-func
|
|
435
|
+
const fun = new Function('value', 'activatedConfig', `return (${functionStr})(value, activatedConfig)`)
|
|
436
|
+
return fun(value, activatedConfig)
|
|
437
|
+
}
|
|
438
|
+
catch (err) {
|
|
439
|
+
console.error('Failed to deserialize and run function:', err)
|
|
440
|
+
return null
|
|
441
|
+
}
|
|
439
442
|
}
|
|
440
443
|
|
|
441
|
-
function deserializeFunctionAndRunWithConfig(functionStr) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
444
|
+
function deserializeFunctionAndRunWithConfig(functionStr: string) {
|
|
445
|
+
try {
|
|
446
|
+
// eslint-disable-next-line no-new-func
|
|
447
|
+
const fun = new Function('activatedConfig', `return (${functionStr})(activatedConfig)`)
|
|
448
|
+
return fun(activatedConfig)
|
|
449
|
+
}
|
|
450
|
+
catch (err) {
|
|
451
|
+
console.error('Failed to deserialize and run function with config:', err)
|
|
452
|
+
return null
|
|
453
|
+
}
|
|
445
454
|
}
|
|
446
455
|
|
|
447
456
|
// 将table配置的表格转换为适合Form展示的格式
|
|
@@ -1009,9 +1018,9 @@ function getNow() {
|
|
|
1009
1018
|
<van-cell-group v-else-if="row.type === 'signature'" inset style="margin-top: 4vh">
|
|
1010
1019
|
<van-field
|
|
1011
1020
|
:label="row.valueText ? `${row.valueText}:` : ''"
|
|
1012
|
-
|
|
1021
|
+
|
|
1013
1022
|
rows="1"
|
|
1014
|
-
autosize
|
|
1023
|
+
autosize readonly
|
|
1015
1024
|
>
|
|
1016
1025
|
<template #button>
|
|
1017
1026
|
<XSignature v-model="activatedConfig.data[row.dataIndex]" />
|
|
@@ -33,7 +33,7 @@ const attr = ref({})
|
|
|
33
33
|
|
|
34
34
|
// Store
|
|
35
35
|
const userStore = useUserStore()
|
|
36
|
-
const
|
|
36
|
+
const currUser = storeToRefs(userStore)
|
|
37
37
|
|
|
38
38
|
// Refs
|
|
39
39
|
const mainRef = ref()
|
|
@@ -142,7 +142,6 @@ async function onSubmit() {
|
|
|
142
142
|
if (result?.message) {
|
|
143
143
|
showDialog({
|
|
144
144
|
message: result.message,
|
|
145
|
-
type: messageType,
|
|
146
145
|
})
|
|
147
146
|
}
|
|
148
147
|
|
|
@@ -295,7 +295,7 @@ function exportData() {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
function printDocument() {
|
|
298
|
-
const printContent = window.rawDocument.getElementById('printReady')
|
|
298
|
+
const printContent = (window as any).rawDocument.getElementById('printReady')
|
|
299
299
|
// printElement(printContent)
|
|
300
300
|
showDialog({ message: '操作成功!' })
|
|
301
301
|
}
|
|
@@ -321,8 +321,8 @@ function configInit() {
|
|
|
321
321
|
activeConfig.value.columns.forEach((row: any[]) => {
|
|
322
322
|
row.forEach((cell) => {
|
|
323
323
|
if (cell.dynamicDataIndex === true) {
|
|
324
|
-
// eslint-disable-next-line no-
|
|
325
|
-
const func =
|
|
324
|
+
// eslint-disable-next-line no-new-func
|
|
325
|
+
const func = new Function(`return ${cell.customFunctionForDynamicDataIndex}`)()
|
|
326
326
|
cell.dataIndex = func(config.value)
|
|
327
327
|
}
|
|
328
328
|
if (['action', 'click'].includes(cell.eventType) && cell.customFunction && !cell.events) {
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, ref } from 'vue'
|
|
3
|
-
import XReport from './XReport.vue'
|
|
4
|
-
|
|
5
|
-
const mainRef = ref()
|
|
6
|
-
|
|
7
|
-
onMounted(() => {
|
|
8
|
-
// 初始化逻辑
|
|
9
|
-
})
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div id="test">
|
|
14
|
-
<van-card :bordered="false">
|
|
15
|
-
<XReport
|
|
16
|
-
ref="mainRef"
|
|
17
|
-
:use-oss-for-img="false"
|
|
18
|
-
config-name="nurseWorkstationCover"
|
|
19
|
-
server-name="af-his"
|
|
20
|
-
:show-img-in-cell="true"
|
|
21
|
-
:display-only="true"
|
|
22
|
-
:edit-mode="false"
|
|
23
|
-
:show-save-button="false"
|
|
24
|
-
:no-padding="true"
|
|
25
|
-
:dont-format="true"
|
|
26
|
-
/>
|
|
27
|
-
</van-card>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<style scoped>
|
|
32
|
-
|
|
33
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
|
+
import XReport from './XReport.vue'
|
|
4
|
+
|
|
5
|
+
const mainRef = ref()
|
|
6
|
+
|
|
7
|
+
onMounted(() => {
|
|
8
|
+
// 初始化逻辑
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div id="test">
|
|
14
|
+
<van-card :bordered="false">
|
|
15
|
+
<XReport
|
|
16
|
+
ref="mainRef"
|
|
17
|
+
:use-oss-for-img="false"
|
|
18
|
+
config-name="nurseWorkstationCover"
|
|
19
|
+
server-name="af-his"
|
|
20
|
+
:show-img-in-cell="true"
|
|
21
|
+
:display-only="true"
|
|
22
|
+
:edit-mode="false"
|
|
23
|
+
:show-save-button="false"
|
|
24
|
+
:no-padding="true"
|
|
25
|
+
:dont-format="true"
|
|
26
|
+
/>
|
|
27
|
+
</van-card>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
|
|
33
|
+
</style>
|
|
@@ -151,7 +151,7 @@ onMounted(() => {
|
|
|
151
151
|
})
|
|
152
152
|
|
|
153
153
|
// 监听
|
|
154
|
-
watch(() => props.config, (
|
|
154
|
+
watch(() => props.config, () => {
|
|
155
155
|
// 配置变化时的处理
|
|
156
156
|
}, { deep: true })
|
|
157
157
|
|
|
@@ -248,10 +248,10 @@ watch(() => activatedConfig.value, (val) => {
|
|
|
248
248
|
<span class="inputsDivItemLabel">{{ displayFormatStartText(item.format) }}</span>
|
|
249
249
|
<template v-if="!forDisplay">
|
|
250
250
|
<template v-if="item.inputReadOnly === true">
|
|
251
|
-
<
|
|
251
|
+
<van-field v-model="data[item.dataIndex][index]" :style="`width:${item.inputWidth ? item.inputWidth : '100'}%`" :disabled="true" />
|
|
252
252
|
</template>
|
|
253
253
|
<template v-else>
|
|
254
|
-
<
|
|
254
|
+
<van-field v-model="data[item.dataIndex][index]" :style="`width:${item.inputWidth ? item.inputWidth : '100'}%`" />
|
|
255
255
|
</template>
|
|
256
256
|
</template>
|
|
257
257
|
<template v-else>
|
|
@@ -446,7 +446,7 @@ watch(() => activatedConfig.value, (val) => {
|
|
|
446
446
|
</template>
|
|
447
447
|
|
|
448
448
|
<style lang="less" scoped>
|
|
449
|
-
.img{
|
|
449
|
+
.img {
|
|
450
450
|
width: 95%;
|
|
451
451
|
height: 180px;
|
|
452
452
|
object-fit: cover;
|
|
@@ -490,8 +490,8 @@ watch(() => activatedConfig.value, (val) => {
|
|
|
490
490
|
.reportTable {
|
|
491
491
|
width: 100%;
|
|
492
492
|
border-collapse: collapse;
|
|
493
|
-
table-layout:fixed;
|
|
494
|
-
word-break:break-all;
|
|
493
|
+
table-layout: fixed;
|
|
494
|
+
word-break: break-all;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
.reportMainForDisplay {
|
|
@@ -532,8 +532,8 @@ watch(() => activatedConfig.value, (val) => {
|
|
|
532
532
|
.reportTable {
|
|
533
533
|
width: 100%;
|
|
534
534
|
border-collapse: collapse;
|
|
535
|
-
table-layout:fixed;
|
|
536
|
-
word-break:break-all;
|
|
535
|
+
table-layout: fixed;
|
|
536
|
+
word-break: break-all;
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
.reportMainNoPadding {
|
|
@@ -544,7 +544,7 @@ watch(() => activatedConfig.value, (val) => {
|
|
|
544
544
|
// background-color: #fff;
|
|
545
545
|
border-radius: 8px;
|
|
546
546
|
height: auto;
|
|
547
|
-
min-height
|
|
547
|
+
min-height: 20vh;
|
|
548
548
|
overflow-y: auto;
|
|
549
549
|
overflow-x: hidden;
|
|
550
550
|
|
|
@@ -578,17 +578,17 @@ watch(() => activatedConfig.value, (val) => {
|
|
|
578
578
|
.reportTable {
|
|
579
579
|
width: 100%;
|
|
580
580
|
border-collapse: collapse;
|
|
581
|
-
table-layout:fixed;
|
|
582
|
-
word-break:break-all;
|
|
581
|
+
table-layout: fixed;
|
|
582
|
+
word-break: break-all;
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
.tools{
|
|
585
|
+
.tools {
|
|
586
586
|
position: fixed;
|
|
587
587
|
right: 2%;
|
|
588
588
|
text-align: right;
|
|
589
589
|
width: 60%;
|
|
590
590
|
cursor: pointer;
|
|
591
|
-
.toolsItem{
|
|
591
|
+
.toolsItem {
|
|
592
592
|
width: 15%;
|
|
593
593
|
margin-right: 3%;
|
|
594
594
|
display: inline-block;
|