fix: disabled

This commit is contained in:
wangdan-fit2cloud 2025-07-07 18:48:28 +08:00
parent 85194599c8
commit b6c7fe8b88
3 changed files with 121 additions and 92 deletions

View File

@ -6,6 +6,7 @@
<div class="p-24"> <div class="p-24">
<div class="flex-between"> <div class="flex-between">
<div> <div>
<template v-if="!isShared">
<el-button <el-button
v-if="knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id)" v-if="knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id)"
type="primary" type="primary"
@ -72,7 +73,7 @@
divided divided
@click="syncMulDocument" @click="syncMulDocument"
:disabled="multipleSelection.length === 0" :disabled="multipleSelection.length === 0"
v-if="knowledgeDetail?.type === 1 &&permissionPrecise.doc_sync(id)" v-if="knowledgeDetail?.type === 1 && permissionPrecise.doc_sync(id)"
>{{ $t('views.document.syncDocument') }} >{{ $t('views.document.syncDocument') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
@ -92,6 +93,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</template>
</div> </div>
<el-input <el-input
@ -108,7 +110,9 @@
class="mt-16" class="mt-16"
:data="documentData" :data="documentData"
:pagination-config="paginationConfig" :pagination-config="paginationConfig"
:quick-create="knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id)" :quick-create="
knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id) && !isShared
"
@sizeChange="handleSizeChange" @sizeChange="handleSizeChange"
@changePage="getList" @changePage="getList"
@cell-mouse-enter="cellMouseEnter" @cell-mouse-enter="cellMouseEnter"
@ -121,14 +125,21 @@
:row-key="(row: any) => row.id" :row-key="(row: any) => row.id"
:storeKey="storeKey" :storeKey="storeKey"
> >
<el-table-column type="selection" width="55" :reserve-selection="true" /> <el-table-column
type="selection"
width="55"
:reserve-selection="true"
v-if="!isShared"
/>
<el-table-column prop="name" :label="$t('views.document.table.name')" min-width="280"> <el-table-column prop="name" :label="$t('views.document.table.name')" min-width="280">
<template #default="{ row }"> <template #default="{ row }">
<ReadWrite <ReadWrite
v-if="!isShared"
@change="editName($event, row.id)" @change="editName($event, row.id)"
:data="row.name" :data="row.name"
:showEditIcon="row.id === currentMouseId" :showEditIcon="row.id === currentMouseId"
/> />
<span v-else>{{ row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -344,7 +355,13 @@
{{ datetimeFormat(row.update_time) }} {{ datetimeFormat(row.update_time) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('common.operation')" align="left" width="160" fixed="right"> <el-table-column
:label="$t('common.operation')"
align="left"
width="160"
fixed="right"
v-if="!isShared"
>
<template #default="{ row }"> <template #default="{ row }">
<span @click.stop> <span @click.stop>
<el-switch <el-switch
@ -629,6 +646,10 @@ onBeforeRouteLeave((to: any) => {
} }
}) })
const isShared = computed(() => {
return folderId === 'share'
})
const apiType = computed(() => { const apiType = computed(() => {
if (route.path.includes('shared')) { if (route.path.includes('shared')) {
return 'systemShare' return 'systemShare'
@ -852,7 +873,10 @@ function rowClickHandle(row: any, column: any) {
return return
} }
router.push({ path: `/paragraph/${id}/${row.id}`, query: { type: apiType.value } }) router.push({
path: `/paragraph/${id}/${row.id}`,
query: { type: apiType.value, isShared: isShared.value ? 'true' : 'false' },
})
} }
/* /*

View File

@ -354,6 +354,7 @@ onBeforeRouteLeave((to, from) => {
const emit = defineEmits(['refreshFolder']) const emit = defineEmits(['refreshFolder'])
const apiType = computed(() => { const apiType = computed(() => {
// shareshared
if (route.path.includes('shared')) { if (route.path.includes('shared')) {
return 'systemShare' return 'systemShare'
} else if (route.path.includes('resource-management')) { } else if (route.path.includes('resource-management')) {

View File

@ -12,7 +12,7 @@
> >
</el-text> </el-text>
</div> </div>
<div class="header-button"> <div class="header-button" v-if="!shareDisabled">
<el-button @click="batchSelectedHandle(true)" v-if="isBatch === false"> <el-button @click="batchSelectedHandle(true)" v-if="isBatch === false">
{{ $t('views.paragraph.setting.batchSelected') }} {{ $t('views.paragraph.setting.batchSelected') }}
</el-button> </el-button>
@ -81,7 +81,7 @@
<VueDraggable <VueDraggable
ref="el" ref="el"
v-model="paragraphDetail" v-model="paragraphDetail"
:disabled="isBatch === true" :disabled="isBatch === true || shareDisabled"
handle=".handle" handle=".handle"
:animation="150" :animation="150"
ghostClass="ghost" ghostClass="ghost"
@ -110,6 +110,7 @@
@deleteParagraph="deleteParagraph" @deleteParagraph="deleteParagraph"
@refresh="refresh" @refresh="refresh"
@refreshMigrateParagraph="refreshMigrateParagraph" @refreshMigrateParagraph="refreshMigrateParagraph"
:disabled="shareDisabled"
/> />
</div> </div>
</div> </div>
@ -168,12 +169,15 @@ import { t } from '@/locales'
const route = useRoute() const route = useRoute()
const { const {
params: { id, documentId }, params: { id, documentId },
query: { type }, query: { type, isShared },
} = route as any } = route as any
const apiType = computed(() => { const apiType = computed(() => {
return type as 'systemShare' | 'workspace' | 'systemManage' return type as 'systemShare' | 'workspace' | 'systemManage'
}) })
const shareDisabled = computed(() => {
return isShared === 'true'
})
const SelectDocumentDialogRef = ref() const SelectDocumentDialogRef = ref()
const ParagraphDialogRef = ref() const ParagraphDialogRef = ref()