|
@@ -311,8 +311,11 @@ import {
|
|
|
updateTenant,
|
|
|
bindDatasource,
|
|
|
selectAllUser,
|
|
|
+ createTenant,
|
|
|
+ initTenantMenuData,
|
|
|
} from "@/api/system/tenant";
|
|
|
import { getDataSourceInfo, insertDataSource } from "@/api/system/data";
|
|
|
+import { async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
|
|
|
|
|
|
export default {
|
|
|
name: "Tenant",
|
|
@@ -355,6 +358,8 @@ export default {
|
|
|
contactInfo: null,
|
|
|
address: null,
|
|
|
},
|
|
|
+ // 当前编辑租户的信息
|
|
|
+ currentTenantInfo: {},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
@@ -525,6 +530,8 @@ export default {
|
|
|
},
|
|
|
/** 绑定数据源按钮操作 */
|
|
|
bindDatasource(row) {
|
|
|
+ this.currentTenantInfo = row;
|
|
|
+ console.log(row);
|
|
|
this.reset1();
|
|
|
this.dataSourceOpen = true;
|
|
|
this.dataSourceTitle = "配置数据库";
|
|
@@ -574,9 +581,27 @@ export default {
|
|
|
dataSource: this.dataSourceForm,
|
|
|
};
|
|
|
bindDatasource(query).then((response) => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.dataSourceOpen = false;
|
|
|
- this.getList();
|
|
|
+ if (response.code == 200) {
|
|
|
+ let data = {
|
|
|
+ userName: this.dataSourceForm.tenantAccount,
|
|
|
+ nickName: this.currentTenantInfo.tenantName,
|
|
|
+ userType: "01",
|
|
|
+ tenantId: this.currentTenantInfo.tenantId,
|
|
|
+ password: "123456",
|
|
|
+ };
|
|
|
+ createTenant(data).then(async (res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let resp = await initTenantMenuData(
|
|
|
+ this.currentTenantInfo.tenantId
|
|
|
+ );
|
|
|
+ if ((resp.code = 200)) {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.dataSourceOpen = false;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|