vue2-client 1.9.170 → 1.9.172
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 +2 -1
- package/src/base-client/components/AI/AskAiBtn.vue +1 -2
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +3 -0
- package/src/base-client/components/common/XAddNativeForm/demo.vue +10 -2
- package/src/base-client/components/common/XConversation/XConversation.vue +27 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.172",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"lodash.debounce": "^4",
|
|
48
48
|
"lodash.get": "^4.4.2",
|
|
49
49
|
"mockjs": "^1.1.0",
|
|
50
|
+
"marked": "^4",
|
|
50
51
|
"nprogress": "^0.2.0",
|
|
51
52
|
"qs": "^6.11.2",
|
|
52
53
|
"regenerator-runtime": "^0.14.0",
|
|
@@ -67,7 +67,7 @@ const state = ref({
|
|
|
67
67
|
})
|
|
68
68
|
|
|
69
69
|
const dialogStyle = computed(() => {
|
|
70
|
-
return { left: state.value.styleLeft + 'px', top: state.value.styleTop + 'px' }
|
|
70
|
+
return { left: state.value.styleLeft + 'px', top: state.value.styleTop + 'px', resize: 'both' }
|
|
71
71
|
})
|
|
72
72
|
|
|
73
73
|
// 计算是否超出屏幕;超出后
|
|
@@ -133,5 +133,4 @@ const onMouseDown = (e) => {
|
|
|
133
133
|
</template>
|
|
134
134
|
|
|
135
135
|
<style scoped lang="less">
|
|
136
|
-
|
|
137
136
|
</style>
|
|
@@ -962,6 +962,9 @@ export default {
|
|
|
962
962
|
this.form[item.model] = JSON.parse(modifyModelData.data[item.model])
|
|
963
963
|
}
|
|
964
964
|
} catch (e) {
|
|
965
|
+
if (modifyModelData.data[item.model]) {
|
|
966
|
+
this.form[item.model] = modifyModelData.data[item.model]
|
|
967
|
+
}
|
|
965
968
|
}
|
|
966
969
|
}
|
|
967
970
|
// 追加版本号信息
|
|
@@ -6,9 +6,17 @@ export default {
|
|
|
6
6
|
name: 'Demo',
|
|
7
7
|
components: { XAddNativeForm },
|
|
8
8
|
mounted () {
|
|
9
|
-
getConfigByNameAsync('
|
|
9
|
+
getConfigByNameAsync('routineButtonCRUD', 'af-his').then(res => {
|
|
10
10
|
console.log('===res', res)
|
|
11
|
-
this.$refs.xAddFrom.init(res
|
|
11
|
+
this.$refs.xAddFrom.init(Object.assign(res, {
|
|
12
|
+
modifyModelData: {
|
|
13
|
+
data: {
|
|
14
|
+
selected_f_project_details: {
|
|
15
|
+
f_oxygen_method: '1'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}))
|
|
12
20
|
})
|
|
13
21
|
},
|
|
14
22
|
methods: {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:class="['chat-message', message.type]"
|
|
10
10
|
>
|
|
11
11
|
<span class="chat-avatar">{{ message.type === 'user' ? '👤' : '🤖' }}</span>
|
|
12
|
-
<div class="chat-text" v-if="message.text"
|
|
12
|
+
<div class="chat-text" v-if="message.text" v-html="renderMarkdown(message.text)"></div>
|
|
13
13
|
<div class="chat-text" v-else-if="message.state === 'loading'">
|
|
14
14
|
<a-spin :spinning="true"/>
|
|
15
15
|
</div>
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
import { runLogic } from '@vue2-client/services/api/common'
|
|
35
35
|
import { postByServiceName, startEventStreamPOST } from '@vue2-client/services/api/restTools'
|
|
36
36
|
import moment from 'moment/moment'
|
|
37
|
+
import { marked } from 'marked'
|
|
37
38
|
|
|
38
39
|
export default {
|
|
39
40
|
inject: {
|
|
@@ -104,6 +105,24 @@ export default {
|
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
methods: {
|
|
108
|
+
renderMarkdown (text) {
|
|
109
|
+
const markdownPatterns = [
|
|
110
|
+
/(^|\s)(#{1,6})\s/, // 标题 (# 到 ######)
|
|
111
|
+
/(\*\*|__)(.*?)\1/, // 加粗 (** 或 __)
|
|
112
|
+
/(\*|_)(.*?)\1/, // 斜体 (* 或 _)
|
|
113
|
+
/\[([^\]]+)\]\([^\)]+\)/, // 链接 [text](url)
|
|
114
|
+
/`{1,3}[^`]+`{1,3}/, // 行内代码 (`text`)
|
|
115
|
+
/\n{2,}([^\n]+)\n{2,}/, // 段落之间的换行
|
|
116
|
+
/\n{3,}([^\n]+)\n{3,}/, // 多行代码块
|
|
117
|
+
/[-\*\+]\s+/, // 无序列表 (- 或 * 或 +)
|
|
118
|
+
/\d+\.\s+/, // 有序列表 (1. 或 2. 或 3.)
|
|
119
|
+
]
|
|
120
|
+
if (markdownPatterns.some(pattern => pattern.test(text))) {
|
|
121
|
+
return marked(text)
|
|
122
|
+
} else {
|
|
123
|
+
return text
|
|
124
|
+
}
|
|
125
|
+
},
|
|
107
126
|
setAddtionalInfo (params) {
|
|
108
127
|
this.additionalInfo = params
|
|
109
128
|
},
|
|
@@ -234,4 +253,11 @@ export default {
|
|
|
234
253
|
.chat-input a-input {
|
|
235
254
|
flex: 1;
|
|
236
255
|
}
|
|
256
|
+
|
|
257
|
+
code {
|
|
258
|
+
background-color: #f5f5f5;
|
|
259
|
+
border-radius: 4px;
|
|
260
|
+
padding: 2px 4px;
|
|
261
|
+
font-size: 90%;
|
|
262
|
+
}
|
|
237
263
|
</style>
|