agilebuilder-ui 1.1.45 → 1.1.47
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/lib/{401-1bde8dc9.js → 401-24b6b525.js} +1 -1
- package/lib/{404-48d76996.js → 404-55dbc936.js} +1 -1
- package/lib/{iframe-page-77e184a0.js → iframe-page-effbb33c.js} +1 -1
- package/lib/index-f3ef09a5.js +92745 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +33 -32
- package/lib/super-ui.umd.cjs +172 -133
- package/lib/{tab-content-iframe-index-39745d49.js → tab-content-iframe-index-4c557db3.js} +1 -1
- package/lib/{tab-content-index-65696e56.js → tab-content-index-a7350229.js} +1 -1
- package/lib/{tache-subprocess-history-ef943f95.js → tache-subprocess-history-f19dd95f.js} +1 -1
- package/package.json +7 -2
- package/packages/chat-embed/index.ts +6 -0
- package/packages/chat-embed/src/chat-embed-message.ts +79 -0
- package/packages/chat-embed/src/chat-embed.css +117 -0
- package/packages/chat-embed/src/chat-sender.vue +240 -0
- package/packages/chat-embed/src/header.vue +50 -0
- package/packages/chat-embed/src/index.vue +425 -0
- package/packages/chat-embed/src/recommendation-message.vue +37 -0
- package/packages/chat-embed/src/util.ts +33 -0
- package/packages/index.js +16 -13
- package/packages/json-view/index.ts +3 -0
- package/packages/json-view/json-view-dialog.vue +53 -0
- package/packages/json-view/json-view.vue +126 -0
- package/packages/super-grid/src/apis.js +11 -0
- package/packages/super-grid/src/dynamic-input.vue +18 -4
- package/packages/super-grid/src/normal-column.vue +8 -1
- package/packages/super-grid/src/super-grid.vue +21 -8
- package/src/assets/chat-embed/avatar.png +0 -0
- package/src/i18n/langs/cn.js +14 -2
- package/src/i18n/langs/en.js +13 -1
- package/src/store/modules/chat-ai-store.ts +78 -0
- package/src/store/modules/tab-content.js +9 -3
- package/src/styles/element-ui.scss +8 -7
- package/src/styles/index.scss +19 -0
- package/src/utils/chat-ai-util.ts +31 -0
- package/src/utils/common-util.js +56 -8
- package/src/utils/insert_css.js +14 -1
- package/lib/index-465b0d69.js +0 -73558
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
width: '100%'
|
|
5
|
+
}"
|
|
6
|
+
ref="cfCodemirrorJsonViewRef"
|
|
7
|
+
id="cf-codemirror-view-json"
|
|
8
|
+
></div>
|
|
9
|
+
</template>
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
import { ref, defineProps, defineOptions, watch, nextTick, onMounted } from 'vue'
|
|
12
|
+
defineOptions({
|
|
13
|
+
name: 'JsonView',
|
|
14
|
+
inheritAttrs: false
|
|
15
|
+
})
|
|
16
|
+
import { basicSetup, EditorView } from 'codemirror'
|
|
17
|
+
import { jsonLanguage } from '@codemirror/lang-json'
|
|
18
|
+
import { EditorState, Facet } from '@codemirror/state'
|
|
19
|
+
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
jsonObject: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: () => {}
|
|
24
|
+
},
|
|
25
|
+
height: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 0
|
|
28
|
+
},
|
|
29
|
+
theme: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: null
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
const editor = ref<any>(null)
|
|
35
|
+
const cfCodemirrorJsonViewRef = ref()
|
|
36
|
+
const codemirrorHeight = ref('400px')
|
|
37
|
+
watch(
|
|
38
|
+
() => props.jsonObject,
|
|
39
|
+
(newVal) => {
|
|
40
|
+
if (editor.value) {
|
|
41
|
+
// 更新 CodeMirror 中的值
|
|
42
|
+
loadEditor()
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{ deep: true }
|
|
46
|
+
)
|
|
47
|
+
onMounted(() => {
|
|
48
|
+
nextTick(() => {
|
|
49
|
+
loadEditor()
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
function loadEditor() {
|
|
54
|
+
if (editor.value) {
|
|
55
|
+
editor.value.destroy()
|
|
56
|
+
}
|
|
57
|
+
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : ''
|
|
58
|
+
if (props.height) {
|
|
59
|
+
codemirrorHeight.value = props.height + 'px'
|
|
60
|
+
} else {
|
|
61
|
+
if (cfCodemirrorJsonViewRef.value) {
|
|
62
|
+
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect()
|
|
63
|
+
if (rect.y || rect.y === 0) {
|
|
64
|
+
console.log('window.innerHeight - rect.y', window.innerHeight, rect.y)
|
|
65
|
+
codemirrorHeight.value = window.innerHeight - rect.y - 100 + 'px'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const state = getEditorState(jsonStr)
|
|
70
|
+
let element: Element | null = document.getElementById('cf-codemirror-view-json')
|
|
71
|
+
if (element) {
|
|
72
|
+
editor.value = new EditorView({
|
|
73
|
+
state,
|
|
74
|
+
parent: element
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// 获取编辑器状态
|
|
79
|
+
function getEditorState(jsonStr: string) {
|
|
80
|
+
// 获取主题
|
|
81
|
+
const mytheme = getTheme()
|
|
82
|
+
// 基本主题样式,主要设置字体大小和高度
|
|
83
|
+
const baseTheme = EditorView.theme({
|
|
84
|
+
'.cm-content, .cm-gutter': { minHeight: codemirrorHeight.value },
|
|
85
|
+
'&': {
|
|
86
|
+
height: codemirrorHeight.value,
|
|
87
|
+
maxHeight: codemirrorHeight.value,
|
|
88
|
+
fontSize: '12px'
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
return EditorState.create({
|
|
92
|
+
doc: jsonStr,
|
|
93
|
+
extensions: [
|
|
94
|
+
EditorState.tabSize.of(16),
|
|
95
|
+
basicSetup,
|
|
96
|
+
jsonLanguage,
|
|
97
|
+
mytheme,
|
|
98
|
+
baseTheme,
|
|
99
|
+
readOnlyFacet.of(true),
|
|
100
|
+
preventChanges
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 创建一个新的 Facet
|
|
106
|
+
const readOnlyFacet = Facet.define<boolean, boolean>({ combine: (values) => values.some((a) => a) })
|
|
107
|
+
|
|
108
|
+
// 创建一个新的 StateField 来监听更改
|
|
109
|
+
const preventChanges = EditorState.transactionFilter.of((tr: any) => {
|
|
110
|
+
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
111
|
+
return {
|
|
112
|
+
changes: {
|
|
113
|
+
from: tr.changes.from,
|
|
114
|
+
to: tr.changes.to,
|
|
115
|
+
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return tr
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
function getTheme() {
|
|
123
|
+
return EditorView.theme({})
|
|
124
|
+
}
|
|
125
|
+
</script>
|
|
126
|
+
<style scoped></style>
|
|
@@ -1460,6 +1460,17 @@ const apis = {
|
|
|
1460
1460
|
},
|
|
1461
1461
|
getCustomFunc(funcName) {
|
|
1462
1462
|
window.$PageUtil.getCustomFunc(this.pageContext, funcName)
|
|
1463
|
+
},
|
|
1464
|
+
addRequiredClass(fieldName,listCode, rowIndex, pageNum) {
|
|
1465
|
+
const gridParams = store.get(listCode)
|
|
1466
|
+
if (this.isFormSubTable && this.isSubTableShowPage){
|
|
1467
|
+
rowIndex = rowIndex - 1
|
|
1468
|
+
if(pageNum !== this.currentPage){
|
|
1469
|
+
this.currentPage = pageNum
|
|
1470
|
+
this.changePage(pageNum)
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
gridParams.gridData[rowIndex]['validateErrorField'] = fieldName
|
|
1463
1474
|
}
|
|
1464
1475
|
}
|
|
1465
1476
|
export default apis
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="type && type.indexOf('custom:') >= 0 && componentName != ''"
|
|
4
|
-
:
|
|
4
|
+
:class="!this.isFormSubTable && row.validateErrorField && row.validateErrorField === column.prop ?'required_bg':''"
|
|
5
5
|
>
|
|
6
6
|
<component
|
|
7
7
|
:is="componentName"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
@input="cellEvent('input', $event)"
|
|
27
27
|
/>
|
|
28
28
|
</div>
|
|
29
|
-
<div v-else :
|
|
29
|
+
<div v-else :class="!this.isFormSubTable && row.validateErrorField && row.validateErrorField === column.prop ?'required_bg':''">
|
|
30
30
|
<!--必须有@input ,否则无法输入值-->
|
|
31
31
|
<el-date-picker
|
|
32
32
|
v-if="type === 'year' || type === 'month' || type === 'week'"
|
|
@@ -713,7 +713,6 @@ export default {
|
|
|
713
713
|
newValue: null,
|
|
714
714
|
// disabled, // 当前用户是否禁止编辑该字段/ 是否新增行
|
|
715
715
|
componentName: '',
|
|
716
|
-
validateErrorField: '', // 保存行记录时,验证失败的字段名
|
|
717
716
|
annexUploadFlag: false,
|
|
718
717
|
defaultAction,
|
|
719
718
|
fileMultiple: false, // 文件是否多选
|
|
@@ -768,7 +767,8 @@ export default {
|
|
|
768
767
|
colConfigure, // v10字段配置原信息
|
|
769
768
|
designProperty, // 字段配置
|
|
770
769
|
myCustomParams: {},
|
|
771
|
-
systemCode
|
|
770
|
+
systemCode,
|
|
771
|
+
isFormSubTable: false // 是否是表单子表
|
|
772
772
|
}
|
|
773
773
|
},
|
|
774
774
|
computed: {},
|
|
@@ -816,6 +816,9 @@ export default {
|
|
|
816
816
|
},
|
|
817
817
|
created() {
|
|
818
818
|
const gridParams = store.get(this.listCode)
|
|
819
|
+
if (gridParams && gridParams.options && gridParams.options.isFormSubTable) {
|
|
820
|
+
this.isFormSubTable = gridParams.options.isFormSubTable
|
|
821
|
+
}
|
|
819
822
|
if (this.controlConfig?.customParams) {
|
|
820
823
|
if (!this.pageContext) {
|
|
821
824
|
this.pageContext = gridParams.options.pageContext
|
|
@@ -1111,6 +1114,7 @@ export default {
|
|
|
1111
1114
|
val = null
|
|
1112
1115
|
}
|
|
1113
1116
|
$emit(this, 'update:value', val)
|
|
1117
|
+
this.clearValidateErrorField()
|
|
1114
1118
|
isInputVal = true
|
|
1115
1119
|
// 在callCustomEvent方法中使用了innerValue属性
|
|
1116
1120
|
this.innerValue = val
|
|
@@ -1127,9 +1131,11 @@ export default {
|
|
|
1127
1131
|
if (this.innerValue.indexOf(saveAll) < 0) {
|
|
1128
1132
|
// 不包含“全选”时才走input,全选是在multiselectchange中特殊处理的
|
|
1129
1133
|
$emit(this, 'update:value', this.innerValue.join(','))
|
|
1134
|
+
this.clearValidateErrorField()
|
|
1130
1135
|
}
|
|
1131
1136
|
} else {
|
|
1132
1137
|
$emit(this, 'update:value', this.innerValue)
|
|
1138
|
+
this.clearValidateErrorField()
|
|
1133
1139
|
}
|
|
1134
1140
|
isInputVal = true
|
|
1135
1141
|
} else if (eventName === 'input' && isInputEventUpdateValue !== undefined && isInputEventUpdateValue === true) {
|
|
@@ -1137,6 +1143,7 @@ export default {
|
|
|
1137
1143
|
// 在callCustomEvent方法中使用了innerValue属性
|
|
1138
1144
|
this.innerValue = event
|
|
1139
1145
|
$emit(this, 'update:value', event)
|
|
1146
|
+
this.clearValidateErrorField()
|
|
1140
1147
|
isInputVal = true
|
|
1141
1148
|
} else if (eventName === 'blur' && !this.isSelectControll()) {
|
|
1142
1149
|
// 为了使输入时流畅,所以在blur时调用input,更改组件的数据
|
|
@@ -1193,9 +1200,16 @@ export default {
|
|
|
1193
1200
|
}
|
|
1194
1201
|
// 必须这样调用input事件 ,否则组件无法输入值
|
|
1195
1202
|
$emit(this, 'update:value', this.innerValue) // 现在的用法
|
|
1203
|
+
this.clearValidateErrorField()
|
|
1196
1204
|
// 扫描组件时监控值变化
|
|
1197
1205
|
this.watchScanValueChange(this.innerValue)
|
|
1198
1206
|
},
|
|
1207
|
+
// 清空单元格必填样式
|
|
1208
|
+
clearValidateErrorField(){
|
|
1209
|
+
if(this.row.validateErrorField){
|
|
1210
|
+
this.row.validateErrorField = undefined
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1199
1213
|
// 是否是输入框
|
|
1200
1214
|
isInputControl() {
|
|
1201
1215
|
return this.type === 'input' || this.type === 'textarea'
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
:row-index="scope.$index"
|
|
50
50
|
:line-edit="lineEdit"
|
|
51
51
|
:custom-format="customFormat"
|
|
52
|
+
:class="isValidateError(scope.row,scope.$index)?'required_bg required-corner':''"
|
|
53
|
+
:style="isValidateError(scope.row,scope.$index)?'display:block;':''"
|
|
52
54
|
@open-page="openPageEvent"
|
|
53
55
|
@refresData="refresData"
|
|
54
56
|
@refresh-list="refreshList"
|
|
@@ -60,7 +62,6 @@
|
|
|
60
62
|
</template>
|
|
61
63
|
</el-table-column>
|
|
62
64
|
</template>
|
|
63
|
-
|
|
64
65
|
<script>
|
|
65
66
|
import { CirclePlus, ZoomIn as ElIconZoomIn } from '@element-plus/icons-vue'
|
|
66
67
|
import { $emit, $off, $on } from '../../utils/gogocodeTransfer'
|
|
@@ -77,6 +78,7 @@ import RichEditorViewer from '../../rich-editor/viewer.vue'
|
|
|
77
78
|
import GridIcon from './components/grid-icon.vue'
|
|
78
79
|
import NormalColumnContent from './normal-column-content.vue'
|
|
79
80
|
import eventBus from './eventBus'
|
|
81
|
+
// border:1px solid red;padding: 10px;
|
|
80
82
|
export default {
|
|
81
83
|
components: {
|
|
82
84
|
DynamicInput,
|
|
@@ -359,6 +361,11 @@ export default {
|
|
|
359
361
|
openPageEvent(openPageParams) {
|
|
360
362
|
console.log('normalColumn----openPageEvent----', openPageParams)
|
|
361
363
|
this.$emit('open-page', openPageParams)
|
|
364
|
+
},
|
|
365
|
+
isValidateError(row,rowIndex) {
|
|
366
|
+
// const gridParams = store.get(this.listCode)
|
|
367
|
+
console.log('row.validateErrorField-----',row)
|
|
368
|
+
return this.isFormSubTable && row && row['validateErrorField'] && row['validateErrorField'] === this.column.prop
|
|
362
369
|
}
|
|
363
370
|
},
|
|
364
371
|
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
@@ -226,7 +226,7 @@ import { checkPermission } from '../../../src/utils/permission'
|
|
|
226
226
|
import { getGuId } from '../../../src/utils/guid.js'
|
|
227
227
|
// import resizeMixin from '../../../src/mixins/resizeMixin.js';
|
|
228
228
|
import storeVuex from '../../../src/store'
|
|
229
|
-
|
|
229
|
+
import { setPageDataToChatAiStore, setPageInfoToChatStore } from '../../../src/utils/chat-ai-util.ts'
|
|
230
230
|
export default {
|
|
231
231
|
components: {
|
|
232
232
|
IndexColumn,
|
|
@@ -924,6 +924,16 @@ export default {
|
|
|
924
924
|
deep: true
|
|
925
925
|
}
|
|
926
926
|
)
|
|
927
|
+
if (!this.isFormSubTable) {
|
|
928
|
+
setPageInfoToChatStore(this.pageContext.menuCode, {
|
|
929
|
+
listRefs: [
|
|
930
|
+
{
|
|
931
|
+
ref: this
|
|
932
|
+
}
|
|
933
|
+
],
|
|
934
|
+
pageType: 'list'
|
|
935
|
+
})
|
|
936
|
+
}
|
|
927
937
|
})
|
|
928
938
|
},
|
|
929
939
|
beforeDestroy() {
|
|
@@ -1649,16 +1659,16 @@ export default {
|
|
|
1649
1659
|
}
|
|
1650
1660
|
return isCanRefreshTableData
|
|
1651
1661
|
},
|
|
1652
|
-
getSubTableGridData(subTableData) {
|
|
1662
|
+
getSubTableGridData(subTableData, currentPage) {
|
|
1653
1663
|
let gridData = subTableData
|
|
1654
1664
|
if (this.isSubTableShowPage === true) {
|
|
1655
1665
|
if (subTableData && subTableData.length > 0) {
|
|
1656
1666
|
// const subTableData = JSON.parse(JSON.stringify(this.subTableData))
|
|
1657
1667
|
this.pagination.total = subTableData.length
|
|
1658
1668
|
// 当前是第几页
|
|
1659
|
-
let
|
|
1660
|
-
if (
|
|
1661
|
-
|
|
1669
|
+
let newCurrentPage = currentPage!== undefined && currentPage !== null ?currentPage: this.currentPage
|
|
1670
|
+
if (newCurrentPage === undefined || newCurrentPage === null) {
|
|
1671
|
+
newCurrentPage = 1
|
|
1662
1672
|
}
|
|
1663
1673
|
// 每页显示多少条记录
|
|
1664
1674
|
let pageSize = this.pageSize
|
|
@@ -1669,7 +1679,7 @@ export default {
|
|
|
1669
1679
|
pageSize = 20
|
|
1670
1680
|
}
|
|
1671
1681
|
// 当前页的第一条记录的数组下标
|
|
1672
|
-
const startRowIndex = (
|
|
1682
|
+
const startRowIndex = (newCurrentPage - 1) * pageSize
|
|
1673
1683
|
// 当前页的最后一条记录的数组下标
|
|
1674
1684
|
let lastRowIndex = startRowIndex + pageSize
|
|
1675
1685
|
if (subTableData.length > startRowIndex) {
|
|
@@ -2380,13 +2390,13 @@ export default {
|
|
|
2380
2390
|
this.changePage()
|
|
2381
2391
|
}
|
|
2382
2392
|
},
|
|
2383
|
-
changePage() {
|
|
2393
|
+
changePage(currentPage) {
|
|
2384
2394
|
console.log('点击了分页')
|
|
2385
2395
|
// 翻页操作会导致筛选项发生变化,所以需要清空已有的
|
|
2386
2396
|
this.$refs.superGrid?.clearFilter()
|
|
2387
2397
|
// TODO: 把当前页数、每页条数、查询条件、排序信息传回后台
|
|
2388
2398
|
if (this.isSubTableShowPage) {
|
|
2389
|
-
this.gridData = this.getSubTableGridData(this.subTableData)
|
|
2399
|
+
this.gridData = this.getSubTableGridData(this.subTableData, currentPage)
|
|
2390
2400
|
const gridParams = store.get(this.code)
|
|
2391
2401
|
gridParams.gridData = this.gridData
|
|
2392
2402
|
// 完成深拷贝,复制一份对象,行编辑时使用
|
|
@@ -3222,6 +3232,9 @@ export default {
|
|
|
3222
3232
|
// this.$refs.superGrid?.toggleRowSelection(newSelection[newSelection.length - 1], false)
|
|
3223
3233
|
// }
|
|
3224
3234
|
}
|
|
3235
|
+
if (!this.isFormSubTable) {
|
|
3236
|
+
setPageDataToChatAiStore(newSelection)
|
|
3237
|
+
}
|
|
3225
3238
|
this.selectionChange(newSelection)
|
|
3226
3239
|
},
|
|
3227
3240
|
// 显示移动端查询区域
|
|
Binary file
|
package/src/i18n/langs/cn.js
CHANGED
|
@@ -84,7 +84,7 @@ const cn = {
|
|
|
84
84
|
uploadFileTip: '上传的文件不超过{fileSize}M',
|
|
85
85
|
asyncExportJumpMsg: '或点击我跳转到下载页面',
|
|
86
86
|
mustFill: '{label} 必须填写',
|
|
87
|
-
filePathNotFound: '文件UUID未找到,请检查配置'
|
|
87
|
+
filePathNotFound: '文件UUID未找到,请检查配置'
|
|
88
88
|
},
|
|
89
89
|
// 列表组件
|
|
90
90
|
superGrid: {
|
|
@@ -136,7 +136,7 @@ const cn = {
|
|
|
136
136
|
prevRow: '上一行',
|
|
137
137
|
nextRow: '下一行',
|
|
138
138
|
detail: '详情',
|
|
139
|
-
searchEmpty:'查询空值'
|
|
139
|
+
searchEmpty: '查询空值'
|
|
140
140
|
},
|
|
141
141
|
// 部门树组件
|
|
142
142
|
departmentTree: {},
|
|
@@ -299,6 +299,18 @@ const cn = {
|
|
|
299
299
|
},
|
|
300
300
|
imatrixUIPromptMessage: {
|
|
301
301
|
NoContent: '暂无内容'
|
|
302
|
+
},
|
|
303
|
+
chatEmbed: {
|
|
304
|
+
name: '小助手',
|
|
305
|
+
history: '历史记录',
|
|
306
|
+
minimize: '缩小',
|
|
307
|
+
fullscreen: '全屏',
|
|
308
|
+
close: '关闭',
|
|
309
|
+
regenerate: '重新生成',
|
|
310
|
+
copy: '复制',
|
|
311
|
+
newChat: '新建会话',
|
|
312
|
+
copySuccess: '复制成功',
|
|
313
|
+
requestFailed: '请求会话失败!'
|
|
302
314
|
}
|
|
303
315
|
}
|
|
304
316
|
export default cn
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -136,7 +136,7 @@ const en = {
|
|
|
136
136
|
prevRow: 'Prev Row',
|
|
137
137
|
nextRow: 'Next Row',
|
|
138
138
|
detail: 'Detail',
|
|
139
|
-
searchEmpty:'Search Empty'
|
|
139
|
+
searchEmpty: 'Search Empty'
|
|
140
140
|
},
|
|
141
141
|
departmentTree: {},
|
|
142
142
|
departmentTreeInline: {
|
|
@@ -298,6 +298,18 @@ const en = {
|
|
|
298
298
|
},
|
|
299
299
|
imatrixUIPromptMessage: {
|
|
300
300
|
NoContent: 'No content'
|
|
301
|
+
},
|
|
302
|
+
chatEmbed: {
|
|
303
|
+
name: 'Assistant',
|
|
304
|
+
history: 'History',
|
|
305
|
+
minimize: 'Minimize',
|
|
306
|
+
fullscreen: 'Full Screen',
|
|
307
|
+
close: 'Close',
|
|
308
|
+
regenerate: 'Regenerate',
|
|
309
|
+
copy: 'Copy',
|
|
310
|
+
newChat: 'New Chat',
|
|
311
|
+
copySuccess: 'Copy successful',
|
|
312
|
+
requestFailed: 'Request failed!'
|
|
301
313
|
}
|
|
302
314
|
}
|
|
303
315
|
export default en
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ref, computed, reactive } from 'vue'
|
|
2
|
+
import { defineStore } from 'pinia'
|
|
3
|
+
|
|
4
|
+
type Menu = {
|
|
5
|
+
menuCode: string
|
|
6
|
+
menuName: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default defineStore('ChatAiStore', () => {
|
|
10
|
+
const currentTabName = ref('chat')
|
|
11
|
+
const activeMenu = ref<Menu>({
|
|
12
|
+
menuCode: '',
|
|
13
|
+
menuName: ''
|
|
14
|
+
})
|
|
15
|
+
const pageInfo = ref<any>({})
|
|
16
|
+
|
|
17
|
+
// 最后操作的表格实例
|
|
18
|
+
const pageRef = ref<any>(null)
|
|
19
|
+
const pageData = ref<any[]>([])
|
|
20
|
+
|
|
21
|
+
function setCurrentTabName(name: string) {
|
|
22
|
+
currentTabName.value = name
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getCurrentTabName() {
|
|
26
|
+
return currentTabName.value
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function setPageInfoToChatStore(menuCode: string, info: any) {
|
|
30
|
+
pageInfo.value[menuCode] = info
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getPageInfo(menuCode: string) {
|
|
34
|
+
return pageInfo.value[menuCode] || null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getActiveMenuPageInfo() {
|
|
38
|
+
return pageInfo.value[activeMenu.value.menuCode] || null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function setPageData(newSelection: any[]) {
|
|
42
|
+
pageData.value = JSON.parse(JSON.stringify(newSelection))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getPageData() {
|
|
46
|
+
return pageData.value
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function clearPageData() {
|
|
50
|
+
pageData.value = []
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function setActiveMenu(menu: any) {
|
|
54
|
+
activeMenu.value = menu
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function getActiveMenu() {
|
|
58
|
+
return activeMenu.value
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function getPageType() {}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
setCurrentTabName,
|
|
65
|
+
getCurrentTabName,
|
|
66
|
+
setPageData,
|
|
67
|
+
getPageData,
|
|
68
|
+
clearPageData,
|
|
69
|
+
getActiveMenu,
|
|
70
|
+
setActiveMenu,
|
|
71
|
+
getPageType,
|
|
72
|
+
setPageInfoToChatStore,
|
|
73
|
+
getPageInfo,
|
|
74
|
+
getActiveMenuPageInfo,
|
|
75
|
+
pageData,
|
|
76
|
+
activeMenu
|
|
77
|
+
}
|
|
78
|
+
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { setActiveMenuToChatAiStore } from '../../utils/chat-ai-util.ts'
|
|
1
2
|
const tabContent = {
|
|
2
3
|
state: {
|
|
3
4
|
openTab: [], // 所有打开的路由
|
|
4
|
-
activeIndex: null
|
|
5
|
+
activeIndex: null // 激活状态
|
|
5
6
|
},
|
|
6
7
|
mutations: {
|
|
7
8
|
// 添加tabs
|
|
@@ -21,6 +22,11 @@ const tabContent = {
|
|
|
21
22
|
},
|
|
22
23
|
// 设置当前激活的tab
|
|
23
24
|
set_active_index(state, index) {
|
|
25
|
+
const activeTab = state.openTab.find((item) => item.code === index)
|
|
26
|
+
setActiveMenuToChatAiStore({
|
|
27
|
+
menuCode: index,
|
|
28
|
+
menuName: activeTab?.name || ''
|
|
29
|
+
})
|
|
24
30
|
state.activeIndex = index
|
|
25
31
|
},
|
|
26
32
|
// 清空tabs
|
|
@@ -28,9 +34,9 @@ const tabContent = {
|
|
|
28
34
|
if (state.openTab.length > 0) {
|
|
29
35
|
state.openTab.splice(0, state.openTab.length)
|
|
30
36
|
}
|
|
31
|
-
}
|
|
37
|
+
}
|
|
32
38
|
},
|
|
33
|
-
actions: {}
|
|
39
|
+
actions: {}
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
export default tabContent
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
display: none;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461 Dialog内select tree等组件在点击箭头时有虚晃
|
|
13
|
+
// 去掉这个配置是因为margin: 0 auto;影响弹框位置,紧贴浏览器顶部,没有间距。例如:权限系统/授权管理/分支字段权限管理/新建按钮弹框
|
|
14
|
+
// .el-dialog {
|
|
15
|
+
// transform: none;
|
|
16
|
+
// left: 0;
|
|
17
|
+
// position: relative;
|
|
18
|
+
// margin: 0 auto;
|
|
19
|
+
// }
|
|
19
20
|
|
|
20
21
|
//element ui upload
|
|
21
22
|
.upload-container {
|
package/src/styles/index.scss
CHANGED
|
@@ -303,4 +303,23 @@ body .el-table colgroup.gutter {
|
|
|
303
303
|
|
|
304
304
|
.dec-page-main {
|
|
305
305
|
padding: var(--dec-page-main-padding, 15px);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// 必填背景色
|
|
309
|
+
.required_bg {
|
|
310
|
+
background-color: #fff3e0 !important;
|
|
311
|
+
border-left: 4px solid #ff9800 !important;
|
|
312
|
+
padding: 10px;
|
|
313
|
+
display: block;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// 必填时右上角标样式
|
|
317
|
+
.required-corner::after {
|
|
318
|
+
content: "*";
|
|
319
|
+
color: #e74c3c;
|
|
320
|
+
font-size: 18px;
|
|
321
|
+
font-weight: bold;
|
|
322
|
+
position: absolute;
|
|
323
|
+
top: 3px;
|
|
324
|
+
right: 5px;
|
|
306
325
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function setPageDataToChatAiStore(ref, newSelection, type = 'list') {
|
|
2
|
+
try {
|
|
3
|
+
if (window.top.ChatAiStore) {
|
|
4
|
+
window.top.ChatAiStore.setPageData(ref, newSelection, type)
|
|
5
|
+
}
|
|
6
|
+
} catch (error) {
|
|
7
|
+
console.error('ChatAiStore not found', error)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function setActiveMenuToChatAiStore(activeMenu) {
|
|
12
|
+
try {
|
|
13
|
+
if (window.top.ChatAiStore) {
|
|
14
|
+
window.top.ChatAiStore.setActiveMenu(activeMenu)
|
|
15
|
+
}
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error('ChatAiStore not found', error)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function setPageInfoToChatStore(menuCode, info) {
|
|
22
|
+
try {
|
|
23
|
+
if (window.top.ChatAiStore) {
|
|
24
|
+
window.top.ChatAiStore.setPageInfoToChatStore(menuCode, info)
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error('ChatAiStore not found', error)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { setPageDataToChatAiStore, setActiveMenuToChatAiStore, setPageInfoToChatStore }
|