Skip to content

Commit 20e11f5

Browse files
feat: application
1 parent bce83f7 commit 20e11f5

File tree

4 files changed

+34
-23
lines changed

4 files changed

+34
-23
lines changed

ui/src/components/folder-tree/index.vue

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
class="shared-knowledge"
1414
:class="currentNodeKey === 'share' && 'active'"
1515
>
16-
<AppIcon
17-
:iconName="currentNodeKey === 'share' ? 'app-folder-share-active' : 'app-folder-share'"
18-
style="font-size: 20px"
19-
></AppIcon>
20-
<span class="name">{{ $t('views.system.share_knowledge') }}</span>
16+
<AppIcon iconName="app-folder-share-active" style="font-size: 18px"></AppIcon>
17+
<span class="ml-8 lighter">{{ $t('views.system.share_knowledge') }}</span>
2118
</div>
2219
<el-tree
2320
ref="treeRef"
@@ -123,12 +120,5 @@ const handleSharedNodeClick = () => {
123120
width: 100%;
124121
height: 1px;
125122
}
126-
127-
.name {
128-
font-weight: 500;
129-
font-size: 14px;
130-
line-height: 22px;
131-
margin-left: 8px;
132-
}
133123
}
134124
</style>

ui/src/router/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const routes: Array<RouteRecordRaw> = [
66
{
77
path: '/',
88
name: 'home',
9-
redirect: '/knowledge',
9+
redirect: '/application',
1010
children: [...rolesRoutes],
1111
},
1212

ui/src/stores/modules/application.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ const useApplicationStore = defineStore('application', {
8080
authentication_value?: any,
8181
) {
8282
return new Promise((resolve, reject) => {
83-
applicationApi
84-
.postAppAuthentication(token, loading, authentication_value)
85-
.then((res) => {
86-
localStorage.setItem(`${token}-accessToken`, res.data)
87-
sessionStorage.setItem(`${token}-accessToken`, res.data)
88-
resolve(res)
89-
})
90-
.catch((error) => {
91-
reject(error)
92-
})
83+
// applicationApi
84+
// .postAppAuthentication(token, loading, authentication_value)
85+
// .then((res) => {
86+
// localStorage.setItem(`${token}-accessToken`, res.data)
87+
// sessionStorage.setItem(`${token}-accessToken`, res.data)
88+
// resolve(res)
89+
// })
90+
// .catch((error) => {
91+
// reject(error)
92+
// })
9393
})
9494
},
9595
async refreshAccessToken(token: string) {

ui/src/views/application/index.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@
8484
</div>
8585
</div>
8686
</el-dropdown-item>
87+
<el-dropdown-item @click="openCreateFolder" divided>
88+
<div class="flex align-center">
89+
<AppIcon iconName="app-folder" style="font-size: 32px"></AppIcon>
90+
<div class="pre-wrap ml-4">
91+
<div class="lighter">
92+
{{ $t('components.folder.addFolder') }}
93+
</div>
94+
</div>
95+
</div>
96+
</el-dropdown-item>
8797
</el-dropdown-menu>
8898
</template>
8999
</el-dropdown>
@@ -214,12 +224,14 @@
214224
</ContentContainer>
215225
<CreateApplicationDialog ref="CreateApplicationDialogRef" />
216226
<CopyApplicationDialog ref="CopyApplicationDialogRef" />
227+
<CreateFolderDialog ref="CreateFolderDialogRef" @refresh="refreshFolder" />
217228
</LayoutContainer>
218229
</template>
219230

220231
<script lang="ts" setup>
221232
import { onMounted, ref, reactive, computed } from 'vue'
222233
import CreateApplicationDialog from '@/views/application/component/CreateApplicationDialog.vue'
234+
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
223235
import CopyApplicationDialog from '@/views/application/component/CopyApplicationDialog.vue'
224236
import ApplicaitonApi from '@/api/application/application'
225237
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
@@ -398,6 +410,15 @@ const exportApplication = (application: any) => {
398410
})
399411
}
400412
413+
const CreateFolderDialogRef = ref()
414+
function openCreateFolder() {
415+
CreateFolderDialogRef.value.open('APPLICATION', currentFolder.value.parent_id)
416+
}
417+
function refreshFolder() {
418+
getFolder()
419+
getList()
420+
}
421+
401422
onMounted(() => {
402423
getFolder()
403424
})

0 commit comments

Comments
 (0)