-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{ dataRef.title }}
+
+
+
+
{{ dataRef.title }}
-
-
-
- {{ dataRef.title }}
-
-
-
-
-
-
- 保存
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ 保存
+
+
+
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
- 新增行
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 是
+ 否
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增行
+
+
-
-
-
+
@@ -155,7 +202,7 @@
-
+
diff --git a/src/views/system/DataSource/components/EditDialog.vue b/src/views/system/DataSource/components/EditDialog.vue
index 2f52f488..f63cf04f 100644
--- a/src/views/system/DataSource/components/EditDialog.vue
+++ b/src/views/system/DataSource/components/EditDialog.vue
@@ -6,7 +6,7 @@
:title="dialogTitle"
:confirmLoading="loading"
@ok="confirm"
- @cancel="emits('update:visible', false)"
+ @cancel="emits('cancel')"
>
@@ -51,7 +51,7 @@
message: '请输入URL',
trigger: 'change',
},
- { validator: form.checkUrl, trigger: 'blur' },
+ { validator: checkUrl, trigger: 'blur' },
]"
>
();
// 弹窗相关
@@ -203,19 +202,25 @@ const dialogTitle = computed(() =>
props.data.id ? '编辑数据源' : '新增数据源',
);
const loading = ref(false);
-const confirm = () => {
- loading.value = true;
- formRef.value
- ?.validate()
- .then(() => form.submit())
- .then((resp: any) => {
- if (resp.status === 200) {
- message.success('操作成功');
- emits('confirm');
- emits('update:visible', false);
- }
- })
- .finally(() => (loading.value = false));
+
+const checkUrl = (_rule: Rule, value: string): Promise => {
+ if (!value) return Promise.reject('请输入URL');
+ const arr = value.split(':');
+ if (arr?.[0] === 'jdbc' || arr?.[0] === 'r2dbc') {
+ return Promise.resolve();
+ } else {
+ return Promise.reject('请输入正确的URL');
+ }
+};
+
+const getTypeOption = () => {
+ getDataTypeDict_api().then((resp: any) => {
+ const result = resp.result as dictItemType[];
+ form.typeOptions = result.map((item) => ({
+ label: item.name,
+ value: item.id,
+ }));
+ });
};
const formRef = ref();
@@ -223,30 +228,38 @@ const form = reactive({
data: {
...props.data,
} as sourceItemType,
-
typeOptions: [] as optionItemType[],
-
- checkUrl: (_rule: Rule, value: string): Promise => {
- if (!value) return Promise.reject('请输入URL');
- const arr = value.split(':');
- if (arr?.[0] === 'jdbc' || arr?.[0] === 'r2dbc') {
- return Promise.resolve();
- } else {
- return Promise.reject('请输入正确的URL');
- }
- },
- getTypeOption: () => {
- getDataTypeDict_api().then((resp: any) => {
- const result = resp.result as dictItemType[];
- form.typeOptions = result.map((item) => ({
- label: item.name,
- value: item.id,
- }));
- });
- },
- submit: () => {
- return saveDataSource_api(form.data);
- },
});
-form.getTypeOption();
+
+watch(
+ () => props.data,
+ (newValue) => {
+ form.data = {...newValue, shareConfig: { ...newValue?.shareConfig }}
+ },
+ {
+ immediate: true,
+ deep: true
+ },
+);
+
+onMounted(() => {
+ getTypeOption();
+})
+
+const confirm = () => {
+ loading.value = true;
+ formRef.value
+ ?.validate()
+ .then(async (_data: any) => {
+ const resp = await saveDataSource_api({ ...props.data, ..._data });
+ if (resp.status === 200) {
+ message.success('操作成功');
+ emits('confirm');
+ formRef.value?.resetFields()
+ }
+ })
+ .finally(() => {
+ loading.value = false;
+ });
+};
diff --git a/src/views/system/DataSource/index.vue b/src/views/system/DataSource/index.vue
index 4f1837af..6329b935 100644
--- a/src/views/system/DataSource/index.vue
+++ b/src/views/system/DataSource/index.vue
@@ -14,8 +14,13 @@
model="TABLE"
:params="queryParams"
:defaultParams="{
+ pageSize: 10,
sorts: [{ name: 'createTime', order: 'desc' }],
}"
+ :pagination="{
+ showSizeChanger: true,
+ pageSizeOptions: ['10', '20', '50', '100'],
+ }"
>
@@ -116,6 +121,7 @@
? '请先禁用,再删除'
: '删除',
}"
+ :danger="true"
:popConfirm="{
title: `确认删除`,
onConfirm: () => table.clickDel(slotProps),
@@ -130,7 +136,7 @@
@@ -211,7 +217,7 @@ const columns = [
value: 'enabled',
},
{
- label: '已禁用',
+ label: '禁用',
value: 'disabled',
},
],
@@ -277,7 +283,13 @@ const table = {
// 刷新列表
refresh: () => {
tableRef.value.reload();
+ dialog.visible = false
+ dialog.selectItem = {}
},
+ cancel: () => {
+ dialog.visible = false
+ dialog.selectItem = {}
+ }
};
table.getTypeOption();
diff --git a/src/views/system/Department/components/EditPermissionDialog.vue b/src/views/system/Department/components/EditPermissionDialog.vue
index 5ca42c47..d63dba83 100644
--- a/src/views/system/Department/components/EditPermissionDialog.vue
+++ b/src/views/system/Department/components/EditPermissionDialog.vue
@@ -8,12 +8,13 @@
visible
@cancel="emits('update:visible', false)"
>
-
-
+
+
+
+ 只能分配有'共享'权限的资产数据
+
+
+
资产权限:
{
});
-
+
diff --git a/src/views/system/Platforms/Api/components/ApiTest.vue b/src/views/system/Platforms/Api/components/ApiTest.vue
index e9019723..3a1de1d8 100644
--- a/src/views/system/Platforms/Api/components/ApiTest.vue
+++ b/src/views/system/Platforms/Api/components/ApiTest.vue
@@ -83,7 +83,7 @@