diff --git a/frontend/package.json b/frontend/package.json
index 0fa253ac4c..0592096178 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -38,7 +38,7 @@
"@7polo/kity": "2.0.8",
"@7polo/kityminder-core": "1.4.53",
"@arco-design/web-vue": "^2.49.2",
- "@arco-themes/vue-ms-theme-default": "^0.0.25",
+ "@arco-themes/vue-ms-theme-default": "^0.0.28",
"@form-create/arco-design": "^3.1.22",
"@types/color": "^3.0.3",
"@vueuse/core": "^10.2.1",
diff --git a/frontend/src/api/modules/setting/system/organizationAndProject.ts b/frontend/src/api/modules/setting/system/organizationAndProject.ts
index 5476fdaa8c..2592a956eb 100644
--- a/frontend/src/api/modules/setting/system/organizationAndProject.ts
+++ b/frontend/src/api/modules/setting/system/organizationAndProject.ts
@@ -2,7 +2,10 @@ import MSR from '@/api/http/index';
import * as orgUrl from '@/api/requrls/setting/system/organizationAndProject';
import { TableQueryParams } from '@/models/common';
import { AddUserToOrgOrProjectParams } from '@/models/setting/systemOrg';
-import { CreateOrUpdateSystemOrgParams } from '@/models/setting/system/orgAndProject';
+import {
+ CreateOrUpdateSystemOrgParams,
+ CreateOrUpdateSystemProjectParams,
+} from '@/models/setting/system/orgAndProject';
// 获取组织列表
export function postOrgTable(data: TableQueryParams) {
@@ -10,7 +13,7 @@ export function postOrgTable(data: TableQueryParams) {
}
// 创建或修改组织
-export function createOrUpdateOrg(data: CreateOrUpdateSystemOrgParams) {
+export function createOrUpdateOrg(data: CreateOrUpdateSystemOrgParams | CreateOrUpdateSystemProjectParams) {
return MSR.post({ url: data.id ? orgUrl.postModifyOrgUrl : orgUrl.postAddOrgUrl, data });
}
diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue
index ec2e69c410..6ac77d5581 100644
--- a/frontend/src/components/pure/ms-table/base-table.vue
+++ b/frontend/src/components/pure/ms-table/base-table.vue
@@ -11,8 +11,12 @@
v-bind="$attrs"
:row-class="getRowClass"
:selected-keys="props.selectedKeys"
+ :span-method="spanMethod"
@selection-change="(e) => selectionChange(e, true)"
>
+
+
+
void;
}>();
const emit = defineEmits<{
(e: 'selectedChange', value: (string | number)[]): void;
@@ -152,6 +157,31 @@
// 编辑input的Ref
const currentInputRef = ref(null);
const { rowKey, editKey }: Partial> = attrs;
+ // 第一行表格合并
+ const currentSpanMethod = ({
+ rowIndex,
+ columnIndex,
+ }: {
+ record: TableData;
+ rowIndex: number;
+ columnIndex: number;
+ }) => {
+ if (rowIndex === 0 && columnIndex === 0) {
+ return {
+ rowspan: 1,
+ colspan: currentColumns.value.length,
+ };
+ }
+ };
+ const spanMethod = computed(() => {
+ if (props.spanMethod) {
+ return props.spanMethod;
+ }
+ if (attrs.showFirstOperation) {
+ return currentSpanMethod;
+ }
+ return undefined;
+ });
const setSelectAllTotal = (isAll: boolean) => {
const { data, msPagination }: Partial> = attrs;
diff --git a/frontend/src/components/pure/ms-table/type.ts b/frontend/src/components/pure/ms-table/type.ts
index afbacd8c11..3a58bc8f99 100644
--- a/frontend/src/components/pure/ms-table/type.ts
+++ b/frontend/src/components/pure/ms-table/type.ts
@@ -77,6 +77,8 @@ export interface MsTableProps {
tableErrorStatus?: MsTableErrorStatus;
// debug模式,开启后会打印表格所有state
debug?: boolean;
+ // 是否展示第一行的操作
+ showFirstOperation?: boolean;
[key: string]: any;
}
diff --git a/frontend/src/components/pure/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts
index fa69e302d4..379e260524 100644
--- a/frontend/src/components/pure/ms-table/useTable.ts
+++ b/frontend/src/components/pure/ms-table/useTable.ts
@@ -56,6 +56,7 @@ export default function useTableProps(
// 表格的错误状态
tableErrorStatus: false,
debug: false,
+ showFirstOperation: false,
...props,
};
diff --git a/frontend/src/models/setting/system/orgAndProject.ts b/frontend/src/models/setting/system/orgAndProject.ts
index 5151003257..219f7ec4a7 100644
--- a/frontend/src/models/setting/system/orgAndProject.ts
+++ b/frontend/src/models/setting/system/orgAndProject.ts
@@ -4,3 +4,15 @@ export interface CreateOrUpdateSystemOrgParams {
description: string;
memberIds: string[];
}
+export interface CreateOrUpdateSystemProjectParams {
+ id?: string;
+ name: string;
+ description: string;
+ enable: boolean;
+ userIds: string[];
+ // 模块配置 后端需要的字段 JSON string
+ moduleSetting?: string;
+ // 前端展示的模块配置 string[]
+ module?: string[];
+ organizationId?: string;
+}
diff --git a/frontend/src/store/modules/setting/types.ts b/frontend/src/store/modules/setting/types.ts
index 0a2dcaf20b..970c6e8843 100644
--- a/frontend/src/store/modules/setting/types.ts
+++ b/frontend/src/store/modules/setting/types.ts
@@ -7,4 +7,5 @@ export interface UserGroupState {
currentType: string;
// 菜单开启关闭
collapse: boolean;
+ currentInternal: boolean;
}
diff --git a/frontend/src/store/modules/setting/usergroup.ts b/frontend/src/store/modules/setting/usergroup.ts
index 6c01bc7e05..d9a4856b76 100644
--- a/frontend/src/store/modules/setting/usergroup.ts
+++ b/frontend/src/store/modules/setting/usergroup.ts
@@ -7,6 +7,7 @@ const useUserGroupStore = defineStore('userGroup', {
currentTitle: '',
currentId: '',
currentType: '',
+ currentInternal: false,
collapse: true,
}),
getters: {
diff --git a/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue b/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue
index 26135fcf5d..7f0d87b5a2 100644
--- a/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue
+++ b/frontend/src/views/setting/system/organizationAndProject/components/addProjectModal.vue
@@ -3,17 +3,17 @@
v-model:visible="currentVisible"
width="680px"
class="ms-modal-form ms-modal-medium"
- :ok-text="t('system.organization.create')"
+ :ok-text="isEdit ? t('common.update') : t('common.create')"
unmount-on-close
@cancel="handleCancel"
>
- {{ t('system.organization.updateOrganization') }}
- ({{ props.currentOrganization?.name }})
+ {{ t('system.project.updateProject') }}
+ ({{ props.currentProject?.name }})
- {{ t('system.organization.createOrganization') }}
+ {{ t('system.project.create') }}
@@ -55,26 +58,30 @@
import MsUserSelector from '@/components/bussiness/ms-user-selector/index.vue';
import { createOrUpdateOrg } from '@/api/modules/setting/system/organizationAndProject';
import { Message } from '@arco-design/web-vue';
- import { CreateOrUpdateSystemOrgParams } from '@/models/setting/system/orgAndProject';
+ import { CreateOrUpdateSystemProjectParams } from '@/models/setting/system/orgAndProject';
const { t } = useI18n();
const props = defineProps<{
visible: boolean;
- currentOrganization?: CreateOrUpdateSystemOrgParams;
+ currentProject?: CreateOrUpdateSystemProjectParams;
}>();
const formRef = ref();
const loading = ref(false);
+ const isEdit = computed(() => !!props.currentProject?.id);
const emit = defineEmits<{
(e: 'cancel'): void;
}>();
- const form = reactive<{ name: string; memberIds: string[]; description: string }>({
+ const form = reactive({
name: '',
- memberIds: [],
+ userIds: [],
+ organizationId: '',
description: '',
+ enable: true,
+ module: [],
});
const currentVisible = ref(props.visible);
@@ -93,9 +100,9 @@
}
try {
loading.value = true;
- await createOrUpdateOrg({ id: props.currentOrganization?.id, ...form });
+ await createOrUpdateOrg({ id: props.currentProject?.id, ...form });
Message.success(
- props.currentOrganization?.id
+ isEdit.value
? t('system.organization.updateOrganizationSuccess')
: t('system.organization.createOrganizationSuccess')
);
@@ -111,11 +118,12 @@
});
};
watchEffect(() => {
- if (props.currentOrganization) {
- form.name = props.currentOrganization.name;
- form.memberIds = props.currentOrganization.memberIds;
- form.description = props.currentOrganization.description;
+ if (props.currentProject) {
+ form.name = props.currentProject.name;
+ form.userIds = props.currentProject.userIds;
+ form.description = props.currentProject.description;
+ form.organizationId = props.currentProject.organizationId;
+ form.enable = props.currentProject.enable;
}
});
- const isEdit = computed(() => !!props.currentOrganization?.id);
diff --git a/frontend/src/views/setting/system/organizationAndProject/components/systemOrganization.vue b/frontend/src/views/setting/system/organizationAndProject/components/systemOrganization.vue
index aa59d3279d..e7cd4b66df 100644
--- a/frontend/src/views/setting/system/organizationAndProject/components/systemOrganization.vue
+++ b/frontend/src/views/setting/system/organizationAndProject/components/systemOrganization.vue
@@ -282,6 +282,9 @@
},
{ immediate: true }
);
+ defineExpose({
+ fetchData,
+ });