vue2-client 1.14.80 → 1.14.82
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/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +0 -1
- package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +1 -2
- package/package.json +1 -1
- package/src/base-client/components/common/Upload/Upload.vue +0 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1 -18
- package/src/base-client/components/common/XTab/XTab.vue +8 -0
- package/src/base-client/components/common/XUploadFilesView/index.vue +485 -485
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.json +9 -4
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.vue +45 -1
- package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
- package/src/base-client/components/his/XTreeRows/TreeNode.vue +100 -100
- package/src/base-client/components/his/XTreeRows/XTreeRows.vue +197 -197
- package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
- package/src/components/FileImageItem/FileItem.vue +1 -1
- package/src/pages/WorkflowDetail/WorkFlowDemo.vue +1 -1
- package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +388 -388
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +26 -56
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowPreview.vue +98 -0
- package/src/router/async/router.map.js +1 -3
- package/src/utils/axios-interceptors.js +19 -1
- package/src/utils/request.js +5 -0
- package/.history/public/his/editor/editor_20250606134713.html +0 -51
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +0 -509
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +0 -524
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +0 -524
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +0 -524
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +0 -207
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +0 -211
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +0 -212
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +0 -212
- package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +0 -1320
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +0 -1332
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +0 -1331
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +0 -1331
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +0 -1331
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +0 -1339
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +0 -731
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +0 -748
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +0 -748
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +0 -1071
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +0 -1078
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +0 -1077
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +0 -1077
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +0 -1077
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +0 -442
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +0 -442
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +0 -442
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +0 -475
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +0 -475
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +0 -475
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +0 -477
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +0 -477
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +0 -477
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +0 -473
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +0 -474
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +0 -474
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +0 -474
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +0 -472
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +0 -501
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +0 -501
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +0 -501
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +0 -504
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +0 -504
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +0 -504
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +0 -131
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +0 -160
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +0 -160
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +0 -160
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +0 -158
- package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +0 -173
- package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +0 -222
- package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +0 -229
- package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +0 -229
- package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +0 -229
- package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +0 -241
- package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +0 -241
- package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +0 -241
- package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +0 -245
- package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +0 -245
- package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +0 -245
- package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +0 -255
- package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +0 -255
- package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +0 -255
- package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +0 -270
- package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +0 -294
- package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +0 -294
- package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +0 -294
- package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +0 -303
- package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +0 -303
- package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +0 -303
- package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +0 -288
- package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +0 -288
- package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +0 -288
- package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +0 -317
- package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +0 -306
- package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +0 -306
- package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +0 -306
- package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +0 -36
- package/src/base-client/components/TreeList/TreeList.vue +0 -91
- package/src/base-client/components/TreeList/TreeNode.vue +0 -81
- package/src/base-client/components/common/XCardSet/XTiltle.vue +0 -191
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"config":{
|
|
3
3
|
"title":"",
|
|
4
|
-
"split":""
|
|
4
|
+
"split":"",
|
|
5
|
+
"style":""//TODO 居中方式
|
|
5
6
|
},
|
|
6
7
|
"content": [
|
|
7
8
|
{
|
|
@@ -12,15 +13,19 @@
|
|
|
12
13
|
"type":"",
|
|
13
14
|
"key": "",
|
|
14
15
|
"value": {},
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
"configName":"", // 通过后端获配置单选多选
|
|
18
|
+
"button-type":"",
|
|
19
|
+
|
|
20
|
+
|
|
16
21
|
}
|
|
17
22
|
]
|
|
18
23
|
}
|
|
19
24
|
]
|
|
20
25
|
}
|
|
21
26
|
//常量取值 checkBox多选
|
|
22
|
-
type [radio,selectionBox,text,input,time,describe]
|
|
23
|
-
|
|
27
|
+
type [radio,selectionBox,text,input,time,describe,button]
|
|
28
|
+
style = ['flex-start', 'flex-end', 'center', 'space-between', 'space-around']
|
|
24
29
|
|
|
25
30
|
"results": [{
|
|
26
31
|
"row_key": "",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<div >{{ config.header }}</div>
|
|
12
12
|
</template>
|
|
13
13
|
<a-list-item
|
|
14
|
+
:class="{'header-row': item.type === 'header'}"
|
|
14
15
|
slot="renderItem"
|
|
15
16
|
slot-scope="item, index">
|
|
16
17
|
<div
|
|
@@ -42,6 +43,22 @@
|
|
|
42
43
|
<template v-else-if="column.type === 'describe'">
|
|
43
44
|
<span :key="`row-${index}-item-${idx}`" :class="['column-item','item-describe']"> {{ column.value }} </span>
|
|
44
45
|
</template>
|
|
46
|
+
<template v-else-if="column.type === 'header'">
|
|
47
|
+
<span :key="`row-${index}-item-${idx}`" :class="['item-header']"> {{ column.value }} </span>
|
|
48
|
+
</template>
|
|
49
|
+
<template v-else-if="column.type === 'button'">
|
|
50
|
+
<a-button
|
|
51
|
+
:class="['column-item']"
|
|
52
|
+
:key="`row-${index}-item-${idx}`"
|
|
53
|
+
:disabled="column.disabled"
|
|
54
|
+
:icon="column.icon"
|
|
55
|
+
:loading="column.loading"
|
|
56
|
+
:type="column.buttonType || 'default'"
|
|
57
|
+
@click="handleButtonClick(column)"
|
|
58
|
+
>
|
|
59
|
+
{{ column.label }}
|
|
60
|
+
</a-button>
|
|
61
|
+
</template>
|
|
45
62
|
<template v-else>
|
|
46
63
|
<span :key="`row-${index}-item-${idx}`" :class="['column-item','item-text']"> {{ column.value }} </span>
|
|
47
64
|
</template>
|
|
@@ -146,6 +163,24 @@ export default {
|
|
|
146
163
|
} else if (column.type === 'radio' || column.type === 'time') {
|
|
147
164
|
this.results[resultIndex][column.key] = e
|
|
148
165
|
}
|
|
166
|
+
},
|
|
167
|
+
handleButtonClick (item) {
|
|
168
|
+
item.loading = true
|
|
169
|
+
const callback = () => {
|
|
170
|
+
item.loading = false
|
|
171
|
+
}
|
|
172
|
+
if (item.clickEventName && this.$listeners[item.clickEventName]) {
|
|
173
|
+
// 交由父级处理
|
|
174
|
+
this.$emit(item.clickEventName, item, callback)
|
|
175
|
+
} else {
|
|
176
|
+
this.defaultAction(item.clickEventName, item, callback)
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
defaultAction (clickEventName, item, callback) {
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
this.$message.warn(`已触发按钮 [${item.key}],注册事件名 [${clickEventName}],未实现事件函数`)
|
|
182
|
+
callback()
|
|
183
|
+
}, 200)
|
|
149
184
|
}
|
|
150
185
|
},
|
|
151
186
|
watch: {
|
|
@@ -196,6 +231,7 @@ export default {
|
|
|
196
231
|
display: flex;
|
|
197
232
|
justify-content: center;
|
|
198
233
|
}
|
|
234
|
+
|
|
199
235
|
.list-wrapper ::v-deep .x-radio-item {
|
|
200
236
|
margin-bottom: 0;
|
|
201
237
|
}
|
|
@@ -208,8 +244,13 @@ export default {
|
|
|
208
244
|
.list-wrapper ::v-deep .x-time-select {
|
|
209
245
|
width: auto !important;
|
|
210
246
|
}
|
|
247
|
+
.list-wrapper ::v-deep .header-row {
|
|
248
|
+
background-color: #F4F4F4; /* 自定义背景色 */
|
|
249
|
+
height: 45px !important;
|
|
250
|
+
}
|
|
211
251
|
/*每一行的整体样式*/
|
|
212
252
|
.row-item{
|
|
253
|
+
width: 100%;
|
|
213
254
|
display: flex;
|
|
214
255
|
align-items: center;
|
|
215
256
|
padding: 2px;
|
|
@@ -225,7 +266,10 @@ export default {
|
|
|
225
266
|
color: #808080 ;
|
|
226
267
|
}
|
|
227
268
|
.item-input{
|
|
228
|
-
|
|
269
|
+
width: auto !important;
|
|
270
|
+
}
|
|
271
|
+
.item-header {
|
|
272
|
+
color: rgba(0, 0, 0, 0.65)
|
|
229
273
|
}
|
|
230
274
|
|
|
231
275
|
</style>
|
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div class="text-card">
|
|
4
|
-
<div
|
|
5
|
-
v-for="(item, index) in displayItems"
|
|
6
|
-
:key="index"
|
|
7
|
-
class="text-item"
|
|
8
|
-
@click="handleItemClick(index, item.id)"
|
|
9
|
-
@contextmenu.prevent="handleContextMenu(index, item.id)">
|
|
10
|
-
<div class="text-content" :class="{ 'is-empty': !item.content }">
|
|
11
|
-
{{ item.content || '+' }}
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
<!-- 编辑弹出框 -->
|
|
15
|
-
<div
|
|
16
|
-
v-if="showEdit"
|
|
17
|
-
class="edit-overlay"
|
|
18
|
-
@click.self="handleOverlayClick">
|
|
19
|
-
<div class="edit-card">
|
|
20
|
-
<a-textarea
|
|
21
|
-
v-model="editingContent"
|
|
22
|
-
:autoSize="{ minRows: 3 }"
|
|
23
|
-
@keyup.enter="handleSave"
|
|
24
|
-
ref="textarea"/>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<!-- 删除确认弹框 -->
|
|
28
|
-
<a-modal
|
|
29
|
-
v-model="showDeleteModal"
|
|
30
|
-
title="确认删除"
|
|
31
|
-
okText="确认"
|
|
32
|
-
cancelText="取消"
|
|
33
|
-
@ok="handleDeleteConfirm">
|
|
34
|
-
<p>确定要删除这条内容吗?</p>
|
|
35
|
-
</a-modal>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
name: 'XTextCard',
|
|
45
|
-
props: {
|
|
46
|
-
// logic配置名,要求返回一个数组[{ id: , content: }]
|
|
47
|
-
queryParamsName: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: 'memorandumLOGIC'
|
|
50
|
-
},
|
|
51
|
-
queryParams: {
|
|
52
|
-
type: Object,
|
|
53
|
-
default: () => { return {} }
|
|
54
|
-
},
|
|
55
|
-
// 请求参数
|
|
56
|
-
parameter: {
|
|
57
|
-
type: Object,
|
|
58
|
-
default: () => { return {} }
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
data () {
|
|
62
|
-
return {
|
|
63
|
-
localItems: [], // 本地数据
|
|
64
|
-
showEdit: false, // 是否显示编辑框
|
|
65
|
-
editingIndex: -1, // 当前编辑的索引
|
|
66
|
-
editingContent: '', // 编辑框的内容
|
|
67
|
-
showDeleteModal: false, // 是否显示删除确认框
|
|
68
|
-
deleteIndex: -1, // 要删除的项目索引
|
|
69
|
-
ID: 0
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
computed: {
|
|
73
|
-
// 显示的列表,始终保持一个空行
|
|
74
|
-
displayItems () {
|
|
75
|
-
const items = [...this.localItems]
|
|
76
|
-
// 如果最后一项不是空的,添加一个空项
|
|
77
|
-
if (!items.length || items[items.length - 1].content) {
|
|
78
|
-
items.push({ content: '' })
|
|
79
|
-
}
|
|
80
|
-
return items
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
methods: {
|
|
84
|
-
// 点击项目
|
|
85
|
-
handleItemClick (index, id) {
|
|
86
|
-
this.ID = id
|
|
87
|
-
this.editingIndex = index
|
|
88
|
-
this.editingContent = this.displayItems[index].content
|
|
89
|
-
this.showEdit = true
|
|
90
|
-
this.$nextTick(() => {
|
|
91
|
-
this.$refs.textarea?.focus()
|
|
92
|
-
})
|
|
93
|
-
},
|
|
94
|
-
// 点击遮罩层保存
|
|
95
|
-
handleOverlayClick () {
|
|
96
|
-
this.handleSave()
|
|
97
|
-
},
|
|
98
|
-
// 保存内容
|
|
99
|
-
handleSave () {
|
|
100
|
-
if (this.editingContent.trim()) {
|
|
101
|
-
if (this.editingIndex === this.localItems.length) {
|
|
102
|
-
// 如果是在最后一个空行添加,push新内容
|
|
103
|
-
this.localItems.push({ content: this.editingContent.trim() })
|
|
104
|
-
} else {
|
|
105
|
-
// 否则更新现有内容
|
|
106
|
-
this.localItems[this.editingIndex].content = this.editingContent.trim()
|
|
107
|
-
}
|
|
108
|
-
const addData = { data: this.editingContent.trim(), ID: this.ID }
|
|
109
|
-
// 触发更新事件
|
|
110
|
-
this.$emit('add', addData)
|
|
111
|
-
}
|
|
112
|
-
this.showEdit = false
|
|
113
|
-
this.editingIndex = -1
|
|
114
|
-
this.editingContent = ''
|
|
115
|
-
},
|
|
116
|
-
// 初始化数据
|
|
117
|
-
async initData (data, parameter) {
|
|
118
|
-
// 从配置中获取数据
|
|
119
|
-
const resData = await runLogic(data, parameter, 'af-his')
|
|
120
|
-
this.localItems = resData
|
|
121
|
-
return resData
|
|
122
|
-
},
|
|
123
|
-
// 处理右键菜单
|
|
124
|
-
handleContextMenu (index, id) {
|
|
125
|
-
// 如果是最后一个空行,不显示删除框
|
|
126
|
-
if (index === this.localItems.length) {
|
|
127
|
-
return
|
|
128
|
-
}
|
|
129
|
-
this.ID = id
|
|
130
|
-
this.deleteIndex = index
|
|
131
|
-
this.showDeleteModal = true
|
|
132
|
-
},
|
|
133
|
-
// 确认删除
|
|
134
|
-
handleDeleteConfirm () {
|
|
135
|
-
if (this.deleteIndex > -1) {
|
|
136
|
-
this.localItems.splice(this.deleteIndex, 1)
|
|
137
|
-
const deleteData = { data: [...this.localItems][this.deleteIndex], ID: this.ID }
|
|
138
|
-
this.$emit('deleteData', deleteData)
|
|
139
|
-
this.deleteIndex = -1
|
|
140
|
-
}
|
|
141
|
-
this.showDeleteModal = false
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
watch: {
|
|
145
|
-
queryParamsName: {
|
|
146
|
-
immediate: true,
|
|
147
|
-
handler (newVal) {
|
|
148
|
-
this.initData(newVal, this.parameter)
|
|
149
|
-
},
|
|
150
|
-
deep: true
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
</script>
|
|
155
|
-
|
|
156
|
-
<style scoped lang="less">
|
|
157
|
-
.text-card {
|
|
158
|
-
position: relative;
|
|
159
|
-
width: 100%;
|
|
160
|
-
.text-item {
|
|
161
|
-
padding: 8px 12px;
|
|
162
|
-
border-bottom: 1px solid #f0f0f0;
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
transition: all 0.3s;
|
|
165
|
-
user-select: none;
|
|
166
|
-
|
|
167
|
-
&:hover {
|
|
168
|
-
background-color: #f5f5f5;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.text-content {
|
|
172
|
-
white-space: nowrap;
|
|
173
|
-
overflow: hidden;
|
|
174
|
-
text-overflow: ellipsis;
|
|
175
|
-
line-height: 1.5;
|
|
176
|
-
|
|
177
|
-
&.is-empty {
|
|
178
|
-
color: #5D5C5C;
|
|
179
|
-
font-weight: 400;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
.edit-overlay {
|
|
184
|
-
position: fixed;
|
|
185
|
-
top: 0;
|
|
186
|
-
left: 0;
|
|
187
|
-
right: 0;
|
|
188
|
-
bottom: 0;
|
|
189
|
-
background-color: rgba(0, 0, 0, 0.45);
|
|
190
|
-
z-index: 1000;
|
|
191
|
-
display: flex;
|
|
192
|
-
align-items: center;
|
|
193
|
-
justify-content: center;
|
|
194
|
-
.edit-card {
|
|
195
|
-
background: white;
|
|
196
|
-
padding: 16px;
|
|
197
|
-
border-radius: 8px;
|
|
198
|
-
width: 90%;
|
|
199
|
-
max-width: 500px;
|
|
200
|
-
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
201
|
-
.ant-input {
|
|
202
|
-
width: 100%;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="text-card">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(item, index) in displayItems"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="text-item"
|
|
8
|
+
@click="handleItemClick(index, item.id)"
|
|
9
|
+
@contextmenu.prevent="handleContextMenu(index, item.id)">
|
|
10
|
+
<div class="text-content" :class="{ 'is-empty': !item.content }">
|
|
11
|
+
{{ item.content || '+' }}
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<!-- 编辑弹出框 -->
|
|
15
|
+
<div
|
|
16
|
+
v-if="showEdit"
|
|
17
|
+
class="edit-overlay"
|
|
18
|
+
@click.self="handleOverlayClick">
|
|
19
|
+
<div class="edit-card">
|
|
20
|
+
<a-textarea
|
|
21
|
+
v-model="editingContent"
|
|
22
|
+
:autoSize="{ minRows: 3 }"
|
|
23
|
+
@keyup.enter="handleSave"
|
|
24
|
+
ref="textarea"/>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<!-- 删除确认弹框 -->
|
|
28
|
+
<a-modal
|
|
29
|
+
v-model="showDeleteModal"
|
|
30
|
+
title="确认删除"
|
|
31
|
+
okText="确认"
|
|
32
|
+
cancelText="取消"
|
|
33
|
+
@ok="handleDeleteConfirm">
|
|
34
|
+
<p>确定要删除这条内容吗?</p>
|
|
35
|
+
</a-modal>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { runLogic } from '@vue2-client/services/api/common'
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: 'XTextCard',
|
|
45
|
+
props: {
|
|
46
|
+
// logic配置名,要求返回一个数组[{ id: , content: }]
|
|
47
|
+
queryParamsName: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'memorandumLOGIC'
|
|
50
|
+
},
|
|
51
|
+
queryParams: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => { return {} }
|
|
54
|
+
},
|
|
55
|
+
// 请求参数
|
|
56
|
+
parameter: {
|
|
57
|
+
type: Object,
|
|
58
|
+
default: () => { return {} }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
data () {
|
|
62
|
+
return {
|
|
63
|
+
localItems: [], // 本地数据
|
|
64
|
+
showEdit: false, // 是否显示编辑框
|
|
65
|
+
editingIndex: -1, // 当前编辑的索引
|
|
66
|
+
editingContent: '', // 编辑框的内容
|
|
67
|
+
showDeleteModal: false, // 是否显示删除确认框
|
|
68
|
+
deleteIndex: -1, // 要删除的项目索引
|
|
69
|
+
ID: 0
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
computed: {
|
|
73
|
+
// 显示的列表,始终保持一个空行
|
|
74
|
+
displayItems () {
|
|
75
|
+
const items = [...this.localItems]
|
|
76
|
+
// 如果最后一项不是空的,添加一个空项
|
|
77
|
+
if (!items.length || items[items.length - 1].content) {
|
|
78
|
+
items.push({ content: '' })
|
|
79
|
+
}
|
|
80
|
+
return items
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
methods: {
|
|
84
|
+
// 点击项目
|
|
85
|
+
handleItemClick (index, id) {
|
|
86
|
+
this.ID = id
|
|
87
|
+
this.editingIndex = index
|
|
88
|
+
this.editingContent = this.displayItems[index].content
|
|
89
|
+
this.showEdit = true
|
|
90
|
+
this.$nextTick(() => {
|
|
91
|
+
this.$refs.textarea?.focus()
|
|
92
|
+
})
|
|
93
|
+
},
|
|
94
|
+
// 点击遮罩层保存
|
|
95
|
+
handleOverlayClick () {
|
|
96
|
+
this.handleSave()
|
|
97
|
+
},
|
|
98
|
+
// 保存内容
|
|
99
|
+
handleSave () {
|
|
100
|
+
if (this.editingContent.trim()) {
|
|
101
|
+
if (this.editingIndex === this.localItems.length) {
|
|
102
|
+
// 如果是在最后一个空行添加,push新内容
|
|
103
|
+
this.localItems.push({ content: this.editingContent.trim() })
|
|
104
|
+
} else {
|
|
105
|
+
// 否则更新现有内容
|
|
106
|
+
this.localItems[this.editingIndex].content = this.editingContent.trim()
|
|
107
|
+
}
|
|
108
|
+
const addData = { data: this.editingContent.trim(), ID: this.ID }
|
|
109
|
+
// 触发更新事件
|
|
110
|
+
this.$emit('add', addData)
|
|
111
|
+
}
|
|
112
|
+
this.showEdit = false
|
|
113
|
+
this.editingIndex = -1
|
|
114
|
+
this.editingContent = ''
|
|
115
|
+
},
|
|
116
|
+
// 初始化数据
|
|
117
|
+
async initData (data, parameter) {
|
|
118
|
+
// 从配置中获取数据
|
|
119
|
+
const resData = await runLogic(data, parameter, 'af-his')
|
|
120
|
+
this.localItems = resData
|
|
121
|
+
return resData
|
|
122
|
+
},
|
|
123
|
+
// 处理右键菜单
|
|
124
|
+
handleContextMenu (index, id) {
|
|
125
|
+
// 如果是最后一个空行,不显示删除框
|
|
126
|
+
if (index === this.localItems.length) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
this.ID = id
|
|
130
|
+
this.deleteIndex = index
|
|
131
|
+
this.showDeleteModal = true
|
|
132
|
+
},
|
|
133
|
+
// 确认删除
|
|
134
|
+
handleDeleteConfirm () {
|
|
135
|
+
if (this.deleteIndex > -1) {
|
|
136
|
+
this.localItems.splice(this.deleteIndex, 1)
|
|
137
|
+
const deleteData = { data: [...this.localItems][this.deleteIndex], ID: this.ID }
|
|
138
|
+
this.$emit('deleteData', deleteData)
|
|
139
|
+
this.deleteIndex = -1
|
|
140
|
+
}
|
|
141
|
+
this.showDeleteModal = false
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
watch: {
|
|
145
|
+
queryParamsName: {
|
|
146
|
+
immediate: true,
|
|
147
|
+
handler (newVal) {
|
|
148
|
+
this.initData(newVal, this.parameter)
|
|
149
|
+
},
|
|
150
|
+
deep: true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<style scoped lang="less">
|
|
157
|
+
.text-card {
|
|
158
|
+
position: relative;
|
|
159
|
+
width: 100%;
|
|
160
|
+
.text-item {
|
|
161
|
+
padding: 8px 12px;
|
|
162
|
+
border-bottom: 1px solid #f0f0f0;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
transition: all 0.3s;
|
|
165
|
+
user-select: none;
|
|
166
|
+
|
|
167
|
+
&:hover {
|
|
168
|
+
background-color: #f5f5f5;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.text-content {
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
overflow: hidden;
|
|
174
|
+
text-overflow: ellipsis;
|
|
175
|
+
line-height: 1.5;
|
|
176
|
+
|
|
177
|
+
&.is-empty {
|
|
178
|
+
color: #5D5C5C;
|
|
179
|
+
font-weight: 400;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
.edit-overlay {
|
|
184
|
+
position: fixed;
|
|
185
|
+
top: 0;
|
|
186
|
+
left: 0;
|
|
187
|
+
right: 0;
|
|
188
|
+
bottom: 0;
|
|
189
|
+
background-color: rgba(0, 0, 0, 0.45);
|
|
190
|
+
z-index: 1000;
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
.edit-card {
|
|
195
|
+
background: white;
|
|
196
|
+
padding: 16px;
|
|
197
|
+
border-radius: 8px;
|
|
198
|
+
width: 90%;
|
|
199
|
+
max-width: 500px;
|
|
200
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
201
|
+
.ant-input {
|
|
202
|
+
width: 100%;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
</style>
|