fix: bugs
This commit is contained in:
parent
1c18b99429
commit
66807217c1
@ -19,9 +19,10 @@
|
||||
class="model-icon mr-8"
|
||||
></span>
|
||||
<span>{{ item.name }}</span>
|
||||
<!-- <el-tag v-if="item.permission_type === 'PUBLIC'" type="info" class="info-tag ml-8 mt-4">
|
||||
{{ $t('common.public') }}
|
||||
</el-tag> -->
|
||||
|
||||
<el-tag v-if="item.type === 'share'" type="info" class="info-tag ml-8 mt-4">
|
||||
{{ t('views.shared.title') }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-icon class="check-icon" v-if="item.id === modelValue">
|
||||
<Check />
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
:treeStyle="{ height: 'calc(100vh - 320px)' }"
|
||||
/>
|
||||
</template>
|
||||
<div class="layout-bg h-full">
|
||||
<div class="layout-bg" style="height: calc(100vh - 160px)">
|
||||
<el-scrollbar>
|
||||
<div class="p-16-24">
|
||||
<el-row :gutter="12" v-loading="loading">
|
||||
@ -111,7 +111,7 @@ const props = defineProps({
|
||||
loading: Boolean,
|
||||
})
|
||||
|
||||
const emit = defineEmits(['addData', 'refresh'])
|
||||
const emit = defineEmits(['addData'])
|
||||
const { folder, user } = useStore()
|
||||
const apiType = computed(() => {
|
||||
if (route.path.includes('shared')) {
|
||||
@ -190,7 +190,7 @@ const submitHandle = () => {
|
||||
}
|
||||
|
||||
const refresh = () => {
|
||||
emit('refresh')
|
||||
getList()
|
||||
}
|
||||
|
||||
const folderList = ref<any[]>([])
|
||||
|
||||
@ -354,12 +354,7 @@ const dfsFolder = (arr: any[] = [], folderIdMap: any) => {
|
||||
|
||||
function getFolder() {
|
||||
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||
return AuthorizationApi.getSystemFolder(
|
||||
workspaceId,
|
||||
activeData.value.type,
|
||||
{},
|
||||
loading,
|
||||
)
|
||||
return AuthorizationApi.getSystemFolder(workspaceId, activeData.value.type, {}, loading)
|
||||
}
|
||||
function getResourcePermissions(user_id: string) {
|
||||
const workspaceId = currentWorkspaceId.value || user.getWorkspaceId() || 'default'
|
||||
@ -372,31 +367,38 @@ function getResourcePermissions(user_id: string) {
|
||||
}
|
||||
const getWholeTree = async (user_id: string) => {
|
||||
const [parentRes, childrenRes] = await Promise.all([getFolder(), getResourcePermissions(user_id)])
|
||||
if (!childrenRes.data || Object.keys(childrenRes.data).length > 0) {
|
||||
settingTags.map((item: any) => {
|
||||
let folderIdMap = []
|
||||
const folderTree = cloneDeep((parentRes as unknown as any).data)
|
||||
if (Object.keys(childrenRes.data).indexOf(item.type) !== -1) {
|
||||
item.isRole =
|
||||
childrenRes.data[item.type].length > 0 &&
|
||||
hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')
|
||||
? childrenRes.data[item.type][0].auth_type == 'ROLE'
|
||||
: false
|
||||
folderIdMap = getFolderIdMap(childrenRes.data[item.type])
|
||||
dfsFolder(folderTree, folderIdMap)
|
||||
const permissionHalf = {
|
||||
VIEW: [],
|
||||
MANAGE: [],
|
||||
ROLE: [],
|
||||
}
|
||||
Object.keys(permissionHalf).forEach((ele) => {
|
||||
dfsPermissionIndeterminateTrue(folderTree, ele)
|
||||
dfsPermissionIndeterminate(folderTree, ele, cloneDeep(permissionHalf), {}, 'default')
|
||||
})
|
||||
item.data = folderTree
|
||||
}
|
||||
// if (!childrenRes.data || Object.keys(childrenRes.data).length > 0) {
|
||||
// settingTags.map((item: any) => {
|
||||
let folderIdMap = []
|
||||
const folderTree = cloneDeep((parentRes as unknown as any).data)
|
||||
if (Object.keys(childrenRes.data).indexOf(activeData.value.type) !== -1) {
|
||||
activeData.value.isRole =
|
||||
childrenRes.data[activeData.value.type].length > 0 &&
|
||||
hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')
|
||||
? childrenRes.data[activeData.value.type][0].auth_type == 'ROLE'
|
||||
: false
|
||||
folderIdMap = getFolderIdMap(childrenRes.data[activeData.value.type])
|
||||
dfsFolder(folderTree, folderIdMap)
|
||||
const permissionHalf = {
|
||||
VIEW: [],
|
||||
MANAGE: [],
|
||||
ROLE: [],
|
||||
}
|
||||
Object.keys(permissionHalf).forEach((ele) => {
|
||||
dfsPermissionIndeterminateTrue(folderTree, ele)
|
||||
dfsPermissionIndeterminate(folderTree, ele, cloneDeep(permissionHalf), {}, 'default')
|
||||
})
|
||||
|
||||
if (activeData.value.type === AuthorizationEnum.MODEL) {
|
||||
activeData.value.data = folderTree[0].children
|
||||
} else {
|
||||
activeData.value.data = folderTree
|
||||
}
|
||||
} else {
|
||||
activeData.value.data = []
|
||||
}
|
||||
// })
|
||||
// }
|
||||
}
|
||||
|
||||
const refreshData = () => {
|
||||
@ -433,7 +435,7 @@ const currentWorkspace = computed(() => {
|
||||
async function getWorkspaceList() {
|
||||
const res = await loadPermissionApi('workspace').getSystemWorkspaceList(loading)
|
||||
workspaceList.value = res.data
|
||||
currentWorkspaceId.value = user.getWorkspaceId() as string || 'default'
|
||||
currentWorkspaceId.value = (user.getWorkspaceId() as string) || 'default'
|
||||
}
|
||||
|
||||
function changeWorkspace(item: WorkspaceItem) {
|
||||
|
||||
@ -30,7 +30,7 @@ import DynamicsFormConstructor from '@/components/dynamics-form/constructor/inde
|
||||
import { t } from '@/locales'
|
||||
const props = withDefaults(
|
||||
defineProps<{ title?: string; editFormField: (form_data: any, index: number) => void }>(),
|
||||
{ title: t('views.model.form.title.editParam') }
|
||||
{ title: t('common.param.editParam') }
|
||||
)
|
||||
const dialogVisible = ref<boolean>(false)
|
||||
const dynamicsFormConstructorRef = ref<InstanceType<typeof DynamicsFormConstructor>>()
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
ref="el"
|
||||
v-bind:modelValue="form_data.branch"
|
||||
:disabled="form_data.branch === 2"
|
||||
:filter="'.no-drag'"
|
||||
handle=".handle"
|
||||
:animation="150"
|
||||
ghostClass="ghost"
|
||||
@ -24,7 +23,7 @@
|
||||
shadow="never"
|
||||
class="drag-card card-never mb-8"
|
||||
:class="{
|
||||
'no-drag': index === form_data.branch.length - 1 || form_data.branch.length === 2
|
||||
'no-drag': index === form_data.branch.length - 1 || form_data.branch.length === 2,
|
||||
}"
|
||||
style="--el-card-padding: 12px"
|
||||
>
|
||||
@ -61,7 +60,7 @@
|
||||
type: 'array',
|
||||
required: true,
|
||||
message: $t('views.applicationWorkflow.variable.placeholder'),
|
||||
trigger: 'change'
|
||||
trigger: 'change',
|
||||
}"
|
||||
>
|
||||
<NodeCascader
|
||||
@ -79,9 +78,9 @@
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t(
|
||||
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage'
|
||||
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage',
|
||||
),
|
||||
trigger: 'change'
|
||||
trigger: 'change',
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
@ -90,7 +89,7 @@
|
||||
v-model="condition.compare"
|
||||
:placeholder="
|
||||
$t(
|
||||
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage'
|
||||
'views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage',
|
||||
)
|
||||
"
|
||||
clearable
|
||||
@ -106,14 +105,14 @@
|
||||
<el-form-item
|
||||
v-if="
|
||||
!['is_null', 'is_not_null', 'is_true', 'is_not_true'].includes(
|
||||
condition.compare
|
||||
condition.compare,
|
||||
)
|
||||
"
|
||||
:prop="'branch.' + index + '.conditions.' + cIndex + '.value'"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.applicationWorkflow.nodes.conditionNode.valueMessage'),
|
||||
trigger: 'blur'
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<el-input
|
||||
@ -177,20 +176,20 @@ const form = {
|
||||
{
|
||||
field: [],
|
||||
compare: '',
|
||||
value: ''
|
||||
}
|
||||
value: '',
|
||||
},
|
||||
],
|
||||
id: randomId(),
|
||||
type: 'IF',
|
||||
condition: 'and'
|
||||
condition: 'and',
|
||||
},
|
||||
{
|
||||
conditions: [],
|
||||
id: randomId(),
|
||||
type: 'ELSE',
|
||||
condition: 'and'
|
||||
}
|
||||
]
|
||||
condition: 'and',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const wheel = (e: any) => {
|
||||
@ -206,7 +205,7 @@ const resizeCondition = (wh: any, row: any, index: number) => {
|
||||
const branch_condition_list = cloneDeep(
|
||||
props.nodeModel.properties.branch_condition_list
|
||||
? props.nodeModel.properties.branch_condition_list
|
||||
: []
|
||||
: [],
|
||||
)
|
||||
const new_branch_condition_list = branch_condition_list.map((item: any) => {
|
||||
if (item.id === row.id) {
|
||||
@ -229,7 +228,7 @@ const form_data = computed({
|
||||
},
|
||||
set: (value) => {
|
||||
set(props.nodeModel.properties, 'node_data', value)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
const ConditionNodeFormRef = ref<FormInstance>()
|
||||
@ -237,7 +236,7 @@ const nodeCascaderRef = ref()
|
||||
const validate = () => {
|
||||
const v_list = [
|
||||
ConditionNodeFormRef.value?.validate(),
|
||||
...nodeCascaderRef.value.map((item: any) => item.validate())
|
||||
...nodeCascaderRef.value.map((item: any) => item.validate()),
|
||||
]
|
||||
return Promise.all(v_list).catch((err) => {
|
||||
return Promise.reject({ node: props.nodeModel, errMessage: err })
|
||||
@ -265,12 +264,12 @@ function addBranch() {
|
||||
{
|
||||
field: [],
|
||||
compare: '',
|
||||
value: ''
|
||||
}
|
||||
value: '',
|
||||
},
|
||||
],
|
||||
type: 'ELSE IF ' + (list.length - 1),
|
||||
id: randomId(),
|
||||
condition: 'and'
|
||||
condition: 'and',
|
||||
}
|
||||
list.splice(list.length - 1, 0, obj)
|
||||
refreshBranchAnchor(list, true)
|
||||
@ -280,7 +279,7 @@ function refreshBranchAnchor(list: Array<any>, is_add: boolean) {
|
||||
const branch_condition_list = cloneDeep(
|
||||
props.nodeModel.properties.branch_condition_list
|
||||
? props.nodeModel.properties.branch_condition_list
|
||||
: []
|
||||
: [],
|
||||
)
|
||||
const new_branch_condition_list = list
|
||||
.map((item, index) => {
|
||||
@ -304,7 +303,7 @@ function addCondition(index: number) {
|
||||
list[index]['conditions'].push({
|
||||
field: [],
|
||||
compare: '',
|
||||
value: ''
|
||||
value: '',
|
||||
})
|
||||
set(props.nodeModel.properties.node_data, 'branch', list)
|
||||
}
|
||||
@ -315,14 +314,14 @@ function deleteCondition(index: number, cIndex: number) {
|
||||
if (list[index]['conditions'].length === 0) {
|
||||
const delete_edge = list.splice(index, 1)
|
||||
const delete_target_anchor_id_list = delete_edge.map(
|
||||
(item: any) => props.nodeModel.id + '_' + item.id + '_right'
|
||||
(item: any) => props.nodeModel.id + '_' + item.id + '_right',
|
||||
)
|
||||
|
||||
props.nodeModel.graphModel.eventCenter.emit(
|
||||
'delete_edge',
|
||||
props.nodeModel.outgoing.edges
|
||||
.filter((item: any) => delete_target_anchor_id_list.includes(item.sourceAnchorId))
|
||||
.map((item: any) => item.id)
|
||||
.map((item: any) => item.id),
|
||||
)
|
||||
refreshBranchAnchor(list, false)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user