Skip to content

Commit c080808

Browse files
committed
feat: authorized workspace model UI
1 parent d5d5e87 commit c080808

12 files changed

Lines changed: 907 additions & 10 deletions

frontend/src/api/workspace.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ export const workspaceModelMapping = (aiModelId: any) =>
2020
request.get(`/system/aimodel/${aiModelId}/ws_mapping`)
2121
export const workspaceModelMappingUpdate = (aiModelId: any, data: any) =>
2222
request.put(`/system/aimodel/${aiModelId}/ws_mapping`, data)
23+
export const workspaceModelMappingAdd = (aiModelId: any, data: any) =>
24+
request.post(`/system/aimodel/${aiModelId}/ws_mapping`, data)
25+
export const workspaceModelMappingDelete = (aiModelId: any, data: any) =>
26+
request.delete(`/system/aimodel/${aiModelId}/ws_mapping`, { data })
Lines changed: 11 additions & 0 deletions
Loading

frontend/src/i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"workspaces_authorized": "Authorized {num} Workspaces",
4141
"number_of_members": "Number of Members",
4242
"delete_selected_workspaces": "Are you sure you want to delete the selected {msg} workspaces?",
43-
"delete_workspace": "Are you sure you want to delete the workspace: {msg}?"
43+
"delete_workspace": "Are you sure you want to delete the workspace: {msg}?",
44+
"no_workspace": "No Workspaces"
4445
},
4546
"sync": {
4647
"records": "Displaying {num} records out of {total}",
@@ -189,6 +190,7 @@
189190
"system_manage": "System Management",
190191
"update_success": "Update",
191192
"save_success": "Save Successful",
193+
"operation_success": "Operation successful",
192194
"next": "Next",
193195
"save": "Save",
194196
"logout": "Logout",

frontend/src/i18n/ko-KR.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"workspaces_authorized": "{num}개의 권한 있는 작업 공간",
4141
"number_of_members": "회원 수",
4242
"delete_selected_workspaces": "선택한 {msg}개의 작업 공간을 삭제하시겠습니까?",
43-
"delete_workspace": "작업 공간을 삭제하시겠습니까: {msg}?"
43+
"delete_workspace": "작업 공간을 삭제하시겠습니까: {msg}?",
44+
"no_workspace": "작업 공간 없음"
4445
},
4546
"sync": {
4647
"records": "{total}개 중 {num}개의 레코드 표시",
@@ -189,6 +190,7 @@
189190
"system_manage": "시스템 관리",
190191
"update_success": "업데이트 성공",
191192
"save_success": "저장 성공",
193+
"operation_success": "작업 성공",
192194
"next": "다음 단계",
193195
"save": "저장",
194196
"logout": "로그아웃",

frontend/src/i18n/zh-CN.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
"modify_authorized_space": "修改授权空间",
4040
"workspaces_authorized": "已授权 {num} 个工作空间",
4141
"number_of_members": "成员数量",
42-
"delete_selected_workspaces": "是否删除选中的 {msg} 个工作空间?",
43-
"delete_workspace": "是否删除工作空间:{msg}?"
42+
"delete_selected_workspaces": "是否移除选中的 {msg} 个工作空间?",
43+
"delete_workspace": "是否移除工作空间:{msg}?",
44+
"no_workspace": "暂无工作空间"
4445
},
4546
"sync": {
4647
"records": "显示 {num} 条数据,共 {total} 条",
@@ -189,6 +190,7 @@
189190
"system_manage": "系统管理",
190191
"update_success": "更新成功",
191192
"save_success": "保存成功",
193+
"operation_success": "操作成功",
192194
"next": "下一步",
193195
"save": "保存",
194196
"logout": "退出登录",

frontend/src/i18n/zh-TW.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
"modify_authorized_space": "修改授權空間",
4040
"workspaces_authorized": "已授權 {num} 個工作空間",
4141
"number_of_members": "成員數量",
42-
"delete_selected_workspaces": "是否刪除選中的 {msg} 個工作空間?",
43-
"delete_workspace": "是否刪除工作空間:{msg}?"
42+
"delete_selected_workspaces": "是否移除選中的 {msg} 個工作空間?",
43+
"delete_workspace": "是否移除工作空間:{msg}?",
44+
"no_workspace": "暫無工作空間"
4445
},
4546
"sync": {
4647
"records": "顯示 {num} 筆資料,共 {total} 筆",
@@ -189,6 +190,7 @@
189190
"system_manage": "系統管理",
190191
"update_success": "更新成功",
191192
"save_success": "儲存成功",
193+
"operation_success": "操作成功",
192194
"next": "下一步",
193195
"save": "儲存",
194196
"logout": "登出",

frontend/src/views/system/model/Card.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const showErrorMask = (msg?: string) => {
4343
errorMsg.value = ''
4444
}, 3000)
4545
}
46-
const emits = defineEmits(['edit', 'del', 'default', 'authorizedSpace', 'editworkspaceList'])
46+
const emits = defineEmits(['edit', 'del', 'default', 'authorizedSpace', 'editWorkspaceList'])
4747
4848
const handleDefault = () => {
4949
emits('default')
@@ -58,7 +58,7 @@ const handleEdit = () => {
5858
}
5959
6060
const handleEditWorkspaceList = () => {
61-
emits('editworkspaceList')
61+
emits('editWorkspaceList')
6262
}
6363
const handleAuthorizedSpace = () => {
6464
emits('authorizedSpace')
@@ -99,7 +99,6 @@ defineExpose({ showErrorMask })
9999
<span class="value" style="display: flex; align-items: center">
100100
{{ $t('permission.2', { msg: num }) }}
101101
<el-tooltip
102-
v-if="false"
103102
effect="dark"
104103
:content="$t('authorized_space.authorized_space_list')"
105104
placement="top"

frontend/src/views/system/model/Model.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useI18n } from 'vue-i18n'
1717
import { get_supplier } from '@/entity/supplier'
1818
import { highlightKeyword } from '@/utils/xss'
1919
import AuthorizedWorkspaceDialogForModel from '@/views/system/workspace/AuthorizedWorkspaceDialogForModel.vue'
20+
import AuthorizedWorkspaceDraw from '@/views/system/workspace/AuthorizedWorkspaceDraw.vue'
2021
2122
interface Model {
2223
ws_mapping_count: number | undefined
@@ -252,12 +253,13 @@ const deleteHandler = (item: any) => {
252253
}
253254
254255
const AuthorizedWorkspaceDialogForModelRef = ref()
256+
const AuthorizedWorkspaceDrawRef = ref()
255257
256258
const handleAuthorizedSpace = (item: any) => {
257259
AuthorizedWorkspaceDialogForModelRef.value.open(item.id)
258260
}
259261
const handleEditWorkspaceList = (item: any) => {
260-
AuthorizedWorkspaceDialogForModelRef.value.open(item.id)
262+
AuthorizedWorkspaceDrawRef.value.open(item.id)
261263
}
262264
263265
const clickModel = (ele: any) => {
@@ -483,6 +485,7 @@ const submit = (item: any) => {
483485
</el-drawer>
484486
</div>
485487
<AuthorizedWorkspaceDialogForModel ref="AuthorizedWorkspaceDialogForModelRef" @refresh="search" />
488+
<AuthorizedWorkspaceDraw ref="AuthorizedWorkspaceDrawRef" @refresh="search" />
486489
</template>
487490

488491
<style lang="less" scoped>

frontend/src/views/system/workspace/AuthorizedWorkspaceDialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</el-input>
2929
<div class="mt-8 max-height_workspace">
3030
<el-checkbox
31+
v-if="workspaceWithKeywords.length"
3132
v-model="checkAll"
3233
class="mb-8"
3334
style="margin-left: 16px"

frontend/src/views/system/workspace/AuthorizedWorkspaceDialogForModel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</el-input>
2525
<div class="mt-8 max-height_workspace">
2626
<el-checkbox
27+
v-if="workspaceWithKeywords.length"
2728
v-model="checkAll"
2829
class="mb-8"
2930
style="margin-left: 16px"

0 commit comments

Comments
 (0)