|
6 | 6 | <div class="p-24"> |
7 | 7 | <div class="flex-between"> |
8 | 8 | <div> |
9 | | - <el-button |
10 | | - v-if="knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id)" |
11 | | - type="primary" |
12 | | - @click=" |
13 | | - router.push({ |
14 | | - path: `/knowledge/document/upload/${folderId}`, |
15 | | - query: { id: id }, |
16 | | - }) |
17 | | - " |
18 | | - >{{ $t('views.document.uploadDocument') }} |
19 | | - </el-button> |
20 | | - <el-button |
21 | | - v-if="knowledgeDetail?.type === 1 && permissionPrecise.doc_create(id)" |
22 | | - type="primary" |
23 | | - @click="importDoc" |
24 | | - >{{ $t('views.document.importDocument') }} |
25 | | - </el-button> |
26 | | - <el-button |
27 | | - v-if="knowledgeDetail?.type === 2 && permissionPrecise.doc_create(id)" |
28 | | - type="primary" |
29 | | - @click=" |
30 | | - router.push({ |
31 | | - path: `/knowledge/import`, |
32 | | - query: { |
33 | | - id: id, |
34 | | - folder_token: knowledgeDetail?.meta.folder_token, |
35 | | - }, |
36 | | - }) |
37 | | - " |
38 | | - >{{ $t('views.document.importDocument') }} |
39 | | - </el-button> |
40 | | - <el-button |
41 | | - @click="batchRefresh" |
42 | | - :disabled="multipleSelection.length === 0" |
43 | | - v-if="permissionPrecise.doc_vector(id)" |
44 | | - >{{ $t('views.knowledge.setting.vectorization') }} |
45 | | - </el-button> |
46 | | - <el-button |
47 | | - @click="openGenerateDialog()" |
48 | | - :disabled="multipleSelection.length === 0" |
49 | | - v-if="permissionPrecise.doc_generate(id)" |
50 | | - >{{ $t('views.document.generateQuestion.title') }} |
51 | | - </el-button> |
52 | | - <el-button |
53 | | - @click="openknowledgeDialog()" |
54 | | - :disabled="multipleSelection.length === 0" |
55 | | - v-if="permissionPrecise.doc_migrate(id)" |
56 | | - >{{ $t('views.document.setting.migration') }} |
57 | | - </el-button> |
58 | | - <el-dropdown> |
59 | | - <el-button class="ml-12 mr-12"> |
60 | | - <el-icon><MoreFilled /></el-icon> |
| 9 | + <template v-if="!isShared"> |
| 10 | + <el-button |
| 11 | + v-if="knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id)" |
| 12 | + type="primary" |
| 13 | + @click=" |
| 14 | + router.push({ |
| 15 | + path: `/knowledge/document/upload/${folderId}`, |
| 16 | + query: { id: id }, |
| 17 | + }) |
| 18 | + " |
| 19 | + >{{ $t('views.document.uploadDocument') }} |
61 | 20 | </el-button> |
62 | | - <template #dropdown> |
63 | | - <el-dropdown-menu> |
64 | | - <el-dropdown-item |
65 | | - @click="openBatchEditDocument" |
66 | | - :disabled="multipleSelection.length === 0" |
67 | | - v-if="permissionPrecise.doc_edit(id)" |
68 | | - > |
69 | | - {{ $t('common.setting') }} |
70 | | - </el-dropdown-item> |
71 | | - <el-dropdown-item |
72 | | - divided |
73 | | - @click="syncMulDocument" |
74 | | - :disabled="multipleSelection.length === 0" |
75 | | - v-if="knowledgeDetail?.type === 1 &&permissionPrecise.doc_sync(id)" |
76 | | - >{{ $t('views.document.syncDocument') }} |
77 | | - </el-dropdown-item> |
78 | | - <el-dropdown-item |
79 | | - divided |
80 | | - @click="syncLarkMulDocument" |
81 | | - :disabled="multipleSelection.length === 0" |
82 | | - v-if="knowledgeDetail?.type === 2 && permissionPrecise.doc_sync(id)" |
83 | | - >{{ $t('views.document.syncDocument') }} |
84 | | - </el-dropdown-item> |
85 | | - <el-dropdown-item |
86 | | - divided |
87 | | - @click="deleteMulDocument" |
88 | | - :disabled="multipleSelection.length === 0" |
89 | | - v-if="permissionPrecise.doc_delete(id)" |
90 | | - >{{ $t('common.delete') }} |
91 | | - </el-dropdown-item> |
92 | | - </el-dropdown-menu> |
93 | | - </template> |
94 | | - </el-dropdown> |
| 21 | + <el-button |
| 22 | + v-if="knowledgeDetail?.type === 1 && permissionPrecise.doc_create(id)" |
| 23 | + type="primary" |
| 24 | + @click="importDoc" |
| 25 | + >{{ $t('views.document.importDocument') }} |
| 26 | + </el-button> |
| 27 | + <el-button |
| 28 | + v-if="knowledgeDetail?.type === 2 && permissionPrecise.doc_create(id)" |
| 29 | + type="primary" |
| 30 | + @click=" |
| 31 | + router.push({ |
| 32 | + path: `/knowledge/import`, |
| 33 | + query: { |
| 34 | + id: id, |
| 35 | + folder_token: knowledgeDetail?.meta.folder_token, |
| 36 | + }, |
| 37 | + }) |
| 38 | + " |
| 39 | + >{{ $t('views.document.importDocument') }} |
| 40 | + </el-button> |
| 41 | + <el-button |
| 42 | + @click="batchRefresh" |
| 43 | + :disabled="multipleSelection.length === 0" |
| 44 | + v-if="permissionPrecise.doc_vector(id)" |
| 45 | + >{{ $t('views.knowledge.setting.vectorization') }} |
| 46 | + </el-button> |
| 47 | + <el-button |
| 48 | + @click="openGenerateDialog()" |
| 49 | + :disabled="multipleSelection.length === 0" |
| 50 | + v-if="permissionPrecise.doc_generate(id)" |
| 51 | + >{{ $t('views.document.generateQuestion.title') }} |
| 52 | + </el-button> |
| 53 | + <el-button |
| 54 | + @click="openknowledgeDialog()" |
| 55 | + :disabled="multipleSelection.length === 0" |
| 56 | + v-if="permissionPrecise.doc_migrate(id)" |
| 57 | + >{{ $t('views.document.setting.migration') }} |
| 58 | + </el-button> |
| 59 | + <el-dropdown> |
| 60 | + <el-button class="ml-12 mr-12"> |
| 61 | + <el-icon><MoreFilled /></el-icon> |
| 62 | + </el-button> |
| 63 | + <template #dropdown> |
| 64 | + <el-dropdown-menu> |
| 65 | + <el-dropdown-item |
| 66 | + @click="openBatchEditDocument" |
| 67 | + :disabled="multipleSelection.length === 0" |
| 68 | + v-if="permissionPrecise.doc_edit(id)" |
| 69 | + > |
| 70 | + {{ $t('common.setting') }} |
| 71 | + </el-dropdown-item> |
| 72 | + <el-dropdown-item |
| 73 | + divided |
| 74 | + @click="syncMulDocument" |
| 75 | + :disabled="multipleSelection.length === 0" |
| 76 | + v-if="knowledgeDetail?.type === 1 && permissionPrecise.doc_sync(id)" |
| 77 | + >{{ $t('views.document.syncDocument') }} |
| 78 | + </el-dropdown-item> |
| 79 | + <el-dropdown-item |
| 80 | + divided |
| 81 | + @click="syncLarkMulDocument" |
| 82 | + :disabled="multipleSelection.length === 0" |
| 83 | + v-if="knowledgeDetail?.type === 2 && permissionPrecise.doc_sync(id)" |
| 84 | + >{{ $t('views.document.syncDocument') }} |
| 85 | + </el-dropdown-item> |
| 86 | + <el-dropdown-item |
| 87 | + divided |
| 88 | + @click="deleteMulDocument" |
| 89 | + :disabled="multipleSelection.length === 0" |
| 90 | + v-if="permissionPrecise.doc_delete(id)" |
| 91 | + >{{ $t('common.delete') }} |
| 92 | + </el-dropdown-item> |
| 93 | + </el-dropdown-menu> |
| 94 | + </template> |
| 95 | + </el-dropdown> |
| 96 | + </template> |
95 | 97 | </div> |
96 | 98 |
|
97 | 99 | <el-input |
|
108 | 110 | class="mt-16" |
109 | 111 | :data="documentData" |
110 | 112 | :pagination-config="paginationConfig" |
111 | | - :quick-create="knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id)" |
| 113 | + :quick-create=" |
| 114 | + knowledgeDetail?.type === 0 && permissionPrecise.doc_create(id) && !isShared |
| 115 | + " |
112 | 116 | @sizeChange="handleSizeChange" |
113 | 117 | @changePage="getList" |
114 | 118 | @cell-mouse-enter="cellMouseEnter" |
|
121 | 125 | :row-key="(row: any) => row.id" |
122 | 126 | :storeKey="storeKey" |
123 | 127 | > |
124 | | - <el-table-column type="selection" width="55" :reserve-selection="true" /> |
| 128 | + <el-table-column |
| 129 | + type="selection" |
| 130 | + width="55" |
| 131 | + :reserve-selection="true" |
| 132 | + v-if="!isShared" |
| 133 | + /> |
125 | 134 | <el-table-column prop="name" :label="$t('views.document.table.name')" min-width="280"> |
126 | 135 | <template #default="{ row }"> |
127 | 136 | <ReadWrite |
| 137 | + v-if="!isShared" |
128 | 138 | @change="editName($event, row.id)" |
129 | 139 | :data="row.name" |
130 | 140 | :showEditIcon="row.id === currentMouseId" |
131 | 141 | /> |
| 142 | + <span v-else>{{ row.name }}</span> |
132 | 143 | </template> |
133 | 144 | </el-table-column> |
134 | 145 | <el-table-column |
|
344 | 355 | {{ datetimeFormat(row.update_time) }} |
345 | 356 | </template> |
346 | 357 | </el-table-column> |
347 | | - <el-table-column :label="$t('common.operation')" align="left" width="160" fixed="right"> |
| 358 | + <el-table-column |
| 359 | + :label="$t('common.operation')" |
| 360 | + align="left" |
| 361 | + width="160" |
| 362 | + fixed="right" |
| 363 | + v-if="!isShared" |
| 364 | + > |
348 | 365 | <template #default="{ row }"> |
349 | 366 | <span @click.stop> |
350 | 367 | <el-switch |
@@ -629,6 +646,10 @@ onBeforeRouteLeave((to: any) => { |
629 | 646 | } |
630 | 647 | }) |
631 | 648 |
|
| 649 | +const isShared = computed(() => { |
| 650 | + return folderId === 'share' |
| 651 | +}) |
| 652 | +
|
632 | 653 | const apiType = computed(() => { |
633 | 654 | if (route.path.includes('shared')) { |
634 | 655 | return 'systemShare' |
@@ -852,7 +873,10 @@ function rowClickHandle(row: any, column: any) { |
852 | 873 | return |
853 | 874 | } |
854 | 875 |
|
855 | | - router.push({ path: `/paragraph/${id}/${row.id}`, query: { type: apiType.value } }) |
| 876 | + router.push({ |
| 877 | + path: `/paragraph/${id}/${row.id}`, |
| 878 | + query: { type: apiType.value, isShared: isShared.value ? 'true' : 'false' }, |
| 879 | + }) |
856 | 880 | } |
857 | 881 |
|
858 | 882 | /* |
|
0 commit comments