diff --git a/src/views/monitor/datasource/DataSourceDrawer.vue b/src/views/monitor/datasource/DataSourceDrawer.vue
index 67058ba..f0dcc5e 100644
--- a/src/views/monitor/datasource/DataSourceDrawer.vue
+++ b/src/views/monitor/datasource/DataSourceDrawer.vue
@@ -61,7 +61,6 @@
showFooter.value = data?.showFooter ?? true;
setDrawerProps({ confirmLoading: false, showFooter: showFooter.value });
isUpdate.value = !!data?.isUpdate;
- console.log(unref(isUpdate));
if (unref(isUpdate)){
await getDepartOptions('');
}else{
@@ -93,7 +92,6 @@
async function getDepartOptions(addFLag){
departOptions.value = [];
const data = await queryDeparts({ addFLag : addFLag });
- console.log(data);
Object.assign(departOptions.value, data);
}
diff --git a/src/views/monitor/datasource/datasource.api.ts b/src/views/monitor/datasource/datasource.api.ts
index 7b9a0f6..76a5116 100644
--- a/src/views/monitor/datasource/datasource.api.ts
+++ b/src/views/monitor/datasource/datasource.api.ts
@@ -10,6 +10,7 @@ enum Api {
testConnection = '/online/cgreport/api/testConnection',
deleteBatch = '/sys/dataSource/deleteBatch',
departList = '/sys/dataSource/departList',
+ getByCode = '/sys/dataSource/queryBySysOrgCode',
// exportXlsUrl = 'sys/dataSource/exportXls',
// importExcelUrl = 'sys/dataSource/importExcel',
}
@@ -90,3 +91,11 @@ export const batchDeleteDataSource = (params, handleSuccess) => {
export const queryDeparts = (params) => {
return defHttp.get({ url: Api.departList, params });
};
+
+/**
+ * 查询数据源详情
+ * @param params
+ */
+export const getDataSourceByCode = (params) => {
+ return defHttp.get({ url: Api.getByCode, params });
+};
diff --git a/src/views/monitor/datasource/datasource.data.ts b/src/views/monitor/datasource/datasource.data.ts
index 8de6db7..b0624a1 100644
--- a/src/views/monitor/datasource/datasource.data.ts
+++ b/src/views/monitor/datasource/datasource.data.ts
@@ -187,7 +187,7 @@ export const formSchema: FormSchema[] = [
field: 'dbUrl',
label: '数据源地址',
required: true,
- component: 'Input',
+ component: 'InputTextArea',
},
{
field: 'dbUsername',
@@ -208,3 +208,80 @@ export const formSchema: FormSchema[] = [
component: 'InputTextArea',
},
];
+
+// 数据源基础表单
+export function useDataSourceFormSchema() {
+ const dataSourceFormSchema: FormSchema[] = [
+ {
+ field: 'id',
+ label: 'id',
+ component: 'Input',
+ show: false,
+ },
+ {
+ field: 'sysOrgCode',
+ label: '所属机构',
+ component: 'Input',
+ required: true,
+ show: false,
+ },
+ {
+ field: 'code',
+ label: '数据源编码',
+ component: 'Input',
+ // required: true,
+ dynamicDisabled: true
+ },
+ {
+ field: 'name',
+ label: '数据源名称',
+ component: 'Input',
+ required: true,
+ },
+ {
+ field: 'dbType',
+ label: '数据库类型',
+ component: 'JDictSelectTag',
+ required: true,
+ componentProps: ({ formModel }) => {
+ return {
+ dictCode: 'database_type',
+ onChange: (e: any) => {
+ formModel = Object.assign(formModel, dbDriverMap[e], dbUrlMap[e]);
+ },
+ };
+ },
+ },
+ {
+ field: 'dbDriver',
+ label: '驱动类',
+ required: true,
+ component: 'Input',
+ },
+ {
+ field: 'dbUrl',
+ label: '数据源地址',
+ required: true,
+ component: 'InputTextArea',
+ },
+ {
+ field: 'dbUsername',
+ label: '用户名',
+ required: true,
+ component: 'Input',
+ },
+ {
+ field: 'dbPassword',
+ label: '密码',
+ required: true,
+ component: 'InputPassword',
+ slot: 'pwd',
+ },
+ {
+ field: 'remark',
+ label: '备注',
+ component: 'InputTextArea',
+ },
+ ];
+ return { dataSourceFormSchema };
+}
diff --git a/src/views/system/depart/components/DataSourceTab.vue b/src/views/system/depart/components/DataSourceTab.vue
new file mode 100644
index 0000000..d91121a
--- /dev/null
+++ b/src/views/system/depart/components/DataSourceTab.vue
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+
+ 测试
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/depart/components/DepartLeftTree.vue b/src/views/system/depart/components/DepartLeftTree.vue
index f4cad96..52a69a9 100644
--- a/src/views/system/depart/components/DepartLeftTree.vue
+++ b/src/views/system/depart/components/DepartLeftTree.vue
@@ -1,12 +1,12 @@
-
新增
-
添加下级
-
+ 新增机构
+ 新增区域
+
@@ -37,7 +37,7 @@
-
+
- 添加子级
+ 添加区域
删除
@@ -226,7 +226,7 @@
// 添加子级部门
function onAddChildDepart(data = currentDepart.value) {
if (data == null) {
- createMessage.warning('请先选择一个部门');
+ createMessage.warning('请先选择一个机构');
return;
}
const record = { parentId: data.id };
diff --git a/src/views/system/depart/depart.data.ts b/src/views/system/depart/depart.data.ts
index 9e0346e..7b45961 100644
--- a/src/views/system/depart/depart.data.ts
+++ b/src/views/system/depart/depart.data.ts
@@ -5,7 +5,7 @@ export function useBasicFormSchema() {
const basicFormSchema: FormSchema[] = [
{
field: 'departName',
- label: '机构名称',
+ label: '名称',
component: 'Input',
componentProps: {
placeholder: '请输入机构/部门名称',
@@ -14,7 +14,7 @@ export function useBasicFormSchema() {
},
{
field: 'parentId',
- label: '上级部门',
+ label: '上级',
component: 'TreeSelect',
componentProps: {
treeData: [],
@@ -24,7 +24,7 @@ export function useBasicFormSchema() {
},
{
field: 'orgCode',
- label: '机构编码',
+ label: '编码',
component: 'Input',
componentProps: {
placeholder: '请输入机构编码',
@@ -32,7 +32,7 @@ export function useBasicFormSchema() {
},
{
field: 'orgCategory',
- label: '机构类型',
+ label: '类型',
component: 'RadioButtonGroup',
componentProps: { options: [] },
},
@@ -42,6 +42,50 @@ export function useBasicFormSchema() {
component: 'InputNumber',
componentProps: {},
},
+ {
+ field: 'operationStartTime',
+ label: '运营开始时间',
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD',
+ style: {
+ width: '100%',
+ },
+ },
+ },
+ {
+ field: 'operationEndTime',
+ label: '运营到期时间',
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD',
+ style: {
+ width: '100%',
+ },
+ },
+ },
+ {
+ field: 'contractStartTime',
+ label: '合同开始时间',
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD',
+ style: {
+ width: '100%',
+ },
+ },
+ },
+ {
+ field: 'contractEndTime',
+ label: '合同到期时间',
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD',
+ style: {
+ width: '100%',
+ },
+ },
+ },
{
field: 'mobile',
label: '电话',
@@ -81,10 +125,9 @@ export function useBasicFormSchema() {
// 机构类型选项
export const orgCategoryOptions = {
// 一级部门
- root: [{ value: '1', label: '公司' }],
+ root: [{ value: '1', label: '机构' }],
// 子级部门
child: [
- { value: '2', label: '部门' },
- { value: '3', label: '岗位' },
+ { value: '2', label: '区域' },
],
};
diff --git a/src/views/system/depart/index.vue b/src/views/system/depart/index.vue
index 406347f..9a9b309 100644
--- a/src/views/system/depart/index.vue
+++ b/src/views/system/depart/index.vue
@@ -11,14 +11,19 @@
-
+
+
+
+
+
+
@@ -31,6 +36,7 @@
import DepartLeftTree from './components/DepartLeftTree.vue';
import DepartFormTab from './components/DepartFormTab.vue';
import DepartRuleTab from './components/DepartRuleTab.vue';
+ import DataSourceTab from './components/DataSourceTab.vue';
const { prefixCls } = useDesign('depart-manage');
provide('prefixCls', prefixCls);