Skip to content

Commit 6680721

Browse files
fix: bugs
1 parent 1c18b99 commit 6680721

File tree

6 files changed

+66
-64
lines changed

6 files changed

+66
-64
lines changed

ui/src/components/model-select/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
class="model-icon mr-8"
2020
></span>
2121
<span>{{ item.name }}</span>
22-
<!-- <el-tag v-if="item.permission_type === 'PUBLIC'" type="info" class="info-tag ml-8 mt-4">
23-
{{ $t('common.public') }}
24-
</el-tag> -->
22+
23+
<el-tag v-if="item.type === 'share'" type="info" class="info-tag ml-8 mt-4">
24+
{{ t('views.shared.title') }}
25+
</el-tag>
2526
</div>
2627
<el-icon class="check-icon" v-if="item.id === modelValue">
2728
<Check />

ui/src/router/modules/application-detail.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const ApplicationDetailRouter = {
2525
() => {
2626
const to: any = get_next_route()
2727
return new ComplexPermission([RoleConst.USER],[PermissionConst.APPLICATION.getApplicationWorkspaceResourcePermission( to ? to.params.id : '',)],[],'AND')},
28-
28+
2929
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
3030
PermissionConst.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,
3131
() => {
@@ -83,7 +83,7 @@ const ApplicationDetailRouter = {
8383
const to: any = get_next_route()
8484
return PermissionConst.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(
8585
to ? to.params.id : '',)
86-
}],[EditionConst.IS_EE, EditionConst.IS_PE],'OR'),
86+
}],[EditionConst.IS_EE, EditionConst.IS_PE],'OR'),
8787
]
8888
},
8989
component: () => import('@/views/application/ApplicationAccess.vue'),
@@ -108,7 +108,7 @@ const ApplicationDetailRouter = {
108108
() => {
109109
const to: any = get_next_route()
110110
return new ComplexPermission([],[PermissionConst.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(
111-
to ? to.params.id : '',)],[EditionConst.IS_EE, EditionConst.IS_PE],'OR')
111+
to ? to.params.id : '',)],[EditionConst.IS_EE, EditionConst.IS_PE],'OR')
112112
}
113113
]
114114
},

ui/src/views/application/component/AddKnowledgeDialog.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
:treeStyle="{ height: 'calc(100vh - 320px)' }"
5050
/>
5151
</template>
52-
<div class="layout-bg h-full">
52+
<div class="layout-bg" style="height: calc(100vh - 160px)">
5353
<el-scrollbar>
5454
<div class="p-16-24">
5555
<el-row :gutter="12" v-loading="loading">
@@ -111,7 +111,7 @@ const props = defineProps({
111111
loading: Boolean,
112112
})
113113
114-
const emit = defineEmits(['addData', 'refresh'])
114+
const emit = defineEmits(['addData'])
115115
const { folder, user } = useStore()
116116
const apiType = computed(() => {
117117
if (route.path.includes('shared')) {
@@ -190,7 +190,7 @@ const submitHandle = () => {
190190
}
191191
192192
const refresh = () => {
193-
emit('refresh')
193+
getList()
194194
}
195195
196196
const folderList = ref<any[]>([])

ui/src/views/system/resource-authorization/index.vue

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,7 @@ const dfsFolder = (arr: any[] = [], folderIdMap: any) => {
354354
355355
function getFolder() {
356356
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
357-
return AuthorizationApi.getSystemFolder(
358-
workspaceId,
359-
activeData.value.type,
360-
{},
361-
loading,
362-
)
357+
return AuthorizationApi.getSystemFolder(workspaceId, activeData.value.type, {}, loading)
363358
}
364359
function getResourcePermissions(user_id: string) {
365360
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
@@ -372,31 +367,38 @@ function getResourcePermissions(user_id: string) {
372367
}
373368
const getWholeTree = async (user_id: string) => {
374369
const [parentRes, childrenRes] = await Promise.all([getFolder(), getResourcePermissions(user_id)])
375-
if (!childrenRes.data || Object.keys(childrenRes.data).length > 0) {
376-
settingTags.map((item: any) => {
377-
let folderIdMap = []
378-
const folderTree = cloneDeep((parentRes as unknown as any).data)
379-
if (Object.keys(childrenRes.data).indexOf(item.type) !== -1) {
380-
item.isRole =
381-
childrenRes.data[item.type].length > 0 &&
382-
hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')
383-
? childrenRes.data[item.type][0].auth_type == 'ROLE'
384-
: false
385-
folderIdMap = getFolderIdMap(childrenRes.data[item.type])
386-
dfsFolder(folderTree, folderIdMap)
387-
const permissionHalf = {
388-
VIEW: [],
389-
MANAGE: [],
390-
ROLE: [],
391-
}
392-
Object.keys(permissionHalf).forEach((ele) => {
393-
dfsPermissionIndeterminateTrue(folderTree, ele)
394-
dfsPermissionIndeterminate(folderTree, ele, cloneDeep(permissionHalf), {}, 'default')
395-
})
396-
item.data = folderTree
397-
}
370+
// if (!childrenRes.data || Object.keys(childrenRes.data).length > 0) {
371+
// settingTags.map((item: any) => {
372+
let folderIdMap = []
373+
const folderTree = cloneDeep((parentRes as unknown as any).data)
374+
if (Object.keys(childrenRes.data).indexOf(activeData.value.type) !== -1) {
375+
activeData.value.isRole =
376+
childrenRes.data[activeData.value.type].length > 0 &&
377+
hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')
378+
? childrenRes.data[activeData.value.type][0].auth_type == 'ROLE'
379+
: false
380+
folderIdMap = getFolderIdMap(childrenRes.data[activeData.value.type])
381+
dfsFolder(folderTree, folderIdMap)
382+
const permissionHalf = {
383+
VIEW: [],
384+
MANAGE: [],
385+
ROLE: [],
386+
}
387+
Object.keys(permissionHalf).forEach((ele) => {
388+
dfsPermissionIndeterminateTrue(folderTree, ele)
389+
dfsPermissionIndeterminate(folderTree, ele, cloneDeep(permissionHalf), {}, 'default')
398390
})
391+
392+
if (activeData.value.type === AuthorizationEnum.MODEL) {
393+
activeData.value.data = folderTree[0].children
394+
} else {
395+
activeData.value.data = folderTree
396+
}
397+
} else {
398+
activeData.value.data = []
399399
}
400+
// })
401+
// }
400402
}
401403
402404
const refreshData = () => {
@@ -433,7 +435,7 @@ const currentWorkspace = computed(() => {
433435
async function getWorkspaceList() {
434436
const res = await loadPermissionApi('workspace').getSystemWorkspaceList(loading)
435437
workspaceList.value = res.data
436-
currentWorkspaceId.value = user.getWorkspaceId() as string || 'default'
438+
currentWorkspaceId.value = (user.getWorkspaceId() as string) || 'default'
437439
}
438440
439441
function changeWorkspace(item: WorkspaceItem) {

ui/src/workflow/common/EditFormCollect.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import DynamicsFormConstructor from '@/components/dynamics-form/constructor/inde
3030
import { t } from '@/locales'
3131
const props = withDefaults(
3232
defineProps<{ title?: string; editFormField: (form_data: any, index: number) => void }>(),
33-
{ title: t('views.model.form.title.editParam') }
33+
{ title: t('common.param.editParam') }
3434
)
3535
const dialogVisible = ref<boolean>(false)
3636
const dynamicsFormConstructorRef = ref<InstanceType<typeof DynamicsFormConstructor>>()

ui/src/workflow/nodes/condition-node/index.vue

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
ref="el"
1313
v-bind:modelValue="form_data.branch"
1414
:disabled="form_data.branch === 2"
15-
:filter="'.no-drag'"
1615
handle=".handle"
1716
:animation="150"
1817
ghostClass="ghost"
@@ -24,7 +23,7 @@
2423
shadow="never"
2524
class="drag-card card-never mb-8"
2625
:class="{
27-
'no-drag': index === form_data.branch.length - 1 || form_data.branch.length === 2
26+
'no-drag': index === form_data.branch.length - 1 || form_data.branch.length === 2,
2827
}"
2928
style="--el-card-padding: 12px"
3029
>
@@ -61,7 +60,7 @@
6160
type: 'array',
6261
required: true,
6362
message: $t('views.applicationWorkflow.variable.placeholder'),
64-
trigger: 'change'
63+
trigger: 'change',
6564
}"
6665
>
6766
<NodeCascader
@@ -79,9 +78,9 @@
7978
:rules="{
8079
required: true,
8180
message: $t(
82-
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage'
81+
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage',
8382
),
84-
trigger: 'change'
83+
trigger: 'change',
8584
}"
8685
>
8786
<el-select
@@ -90,7 +89,7 @@
9089
v-model="condition.compare"
9190
:placeholder="
9291
$t(
93-
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage'
92+
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage',
9493
)
9594
"
9695
clearable
@@ -106,14 +105,14 @@
106105
<el-form-item
107106
v-if="
108107
!['is_null', 'is_not_null', 'is_true', 'is_not_true'].includes(
109-
condition.compare
108+
condition.compare,
110109
)
111110
"
112111
:prop="'branch.' + index + '.conditions.' + cIndex + '.value'"
113112
:rules="{
114113
required: true,
115114
message: $t('views.applicationWorkflow.nodes.conditionNode.valueMessage'),
116-
trigger: 'blur'
115+
trigger: 'blur',
117116
}"
118117
>
119118
<el-input
@@ -177,20 +176,20 @@ const form = {
177176
{
178177
field: [],
179178
compare: '',
180-
value: ''
181-
}
179+
value: '',
180+
},
182181
],
183182
id: randomId(),
184183
type: 'IF',
185-
condition: 'and'
184+
condition: 'and',
186185
},
187186
{
188187
conditions: [],
189188
id: randomId(),
190189
type: 'ELSE',
191-
condition: 'and'
192-
}
193-
]
190+
condition: 'and',
191+
},
192+
],
194193
}
195194
196195
const wheel = (e: any) => {
@@ -206,7 +205,7 @@ const resizeCondition = (wh: any, row: any, index: number) => {
206205
const branch_condition_list = cloneDeep(
207206
props.nodeModel.properties.branch_condition_list
208207
? props.nodeModel.properties.branch_condition_list
209-
: []
208+
: [],
210209
)
211210
const new_branch_condition_list = branch_condition_list.map((item: any) => {
212211
if (item.id === row.id) {
@@ -229,15 +228,15 @@ const form_data = computed({
229228
},
230229
set: (value) => {
231230
set(props.nodeModel.properties, 'node_data', value)
232-
}
231+
},
233232
})
234233
235234
const ConditionNodeFormRef = ref<FormInstance>()
236235
const nodeCascaderRef = ref()
237236
const validate = () => {
238237
const v_list = [
239238
ConditionNodeFormRef.value?.validate(),
240-
...nodeCascaderRef.value.map((item: any) => item.validate())
239+
...nodeCascaderRef.value.map((item: any) => item.validate()),
241240
]
242241
return Promise.all(v_list).catch((err) => {
243242
return Promise.reject({ node: props.nodeModel, errMessage: err })
@@ -265,12 +264,12 @@ function addBranch() {
265264
{
266265
field: [],
267266
compare: '',
268-
value: ''
269-
}
267+
value: '',
268+
},
270269
],
271270
type: 'ELSE IF ' + (list.length - 1),
272271
id: randomId(),
273-
condition: 'and'
272+
condition: 'and',
274273
}
275274
list.splice(list.length - 1, 0, obj)
276275
refreshBranchAnchor(list, true)
@@ -280,7 +279,7 @@ function refreshBranchAnchor(list: Array<any>, is_add: boolean) {
280279
const branch_condition_list = cloneDeep(
281280
props.nodeModel.properties.branch_condition_list
282281
? props.nodeModel.properties.branch_condition_list
283-
: []
282+
: [],
284283
)
285284
const new_branch_condition_list = list
286285
.map((item, index) => {
@@ -304,7 +303,7 @@ function addCondition(index: number) {
304303
list[index]['conditions'].push({
305304
field: [],
306305
compare: '',
307-
value: ''
306+
value: '',
308307
})
309308
set(props.nodeModel.properties.node_data, 'branch', list)
310309
}
@@ -315,14 +314,14 @@ function deleteCondition(index: number, cIndex: number) {
315314
if (list[index]['conditions'].length === 0) {
316315
const delete_edge = list.splice(index, 1)
317316
const delete_target_anchor_id_list = delete_edge.map(
318-
(item: any) => props.nodeModel.id + '_' + item.id + '_right'
317+
(item: any) => props.nodeModel.id + '_' + item.id + '_right',
319318
)
320319
321320
props.nodeModel.graphModel.eventCenter.emit(
322321
'delete_edge',
323322
props.nodeModel.outgoing.edges
324323
.filter((item: any) => delete_target_anchor_id_list.includes(item.sourceAnchorId))
325-
.map((item: any) => item.id)
324+
.map((item: any) => item.id),
326325
)
327326
refreshBranchAnchor(list, false)
328327

0 commit comments

Comments
 (0)