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