Skip to content

Commit

Permalink
Merge pull request CloudOrc#160 from liangxm-swan/dev
Browse files Browse the repository at this point in the history
Issues CloudOrc#81&CloudOrc#46 complete
  • Loading branch information
dlimeng authored Sep 10, 2023
2 parents f6a3ecd + b8b0646 commit 225cc62
Show file tree
Hide file tree
Showing 6 changed files with 612 additions and 5 deletions.
19 changes: 19 additions & 0 deletions solidui-web/src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,25 @@ const datasource = {
ApiService.get<T>(
`/solidui/metadataQuery/queryDatabases?dataSourceName=${params.dataSourceName}&typeName=${params.typeName}`,
),
tables: <T>(
params: { dataSourceName: string | undefined; database: string | undefined } = {
dataSourceName: "",
database: "",
},
) =>
ApiService.get<T>(
`/solidui/metadataQuery/queryTables?dataSourceName=${params.dataSourceName}&database=${params.database}`,
),
tableData: <T>(
params: { dataSourceName: string; database: string; tableName: string } = {
dataSourceName: "",
database: "",
tableName: ""
},
) =>
ApiService.get<T>(
`/solidui/metadataQuery/queryTableData?dataSourceName=${params.dataSourceName}&database=${params.database}&tableName=${params.tableName}`,
),
querySql: <T>(params: {
dataSourceName: string;
typeName: string;
Expand Down
85 changes: 84 additions & 1 deletion solidui-web/src/pages/Designer/Properties/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import PagePropertiesPanel from "./PagePropertiesPanel";
import StylePropertiesPanel from "./StylePropertiesPanel";
import DataPropertiesPanel from "./DataPropertiesPanel";
import useProperties from "./useProperties";
import { LeftExpand, RightExpand } from "@icon-park/react";
import { useMemoizedFn } from "ahooks";

import "./configurations.less";

Expand All @@ -40,6 +42,9 @@ function Properties() {
],
});

const [modelOpen, setModelOpen] = React.useState<boolean>(true);
const [modelWidth, setModelWidth] = React.useState<number>(326);

function renderByPropertyKey() {
if (propertyKey === "scene") {
return <ScenePropertiesPanel />;
Expand Down Expand Up @@ -70,9 +75,87 @@ function Properties() {
return undefined;
}

function handleChangeOpen(type: string) {
const dom: any = document.getElementById("section-properties");
const DbConfig: any = document.getElementById("db-config");
const asideEastContainer : any = document.getElementById('aside-east__container');
if (type === "close") {
setModelWidth(dom.offsetWidth)
dom.style.width = 0
setModelOpen(false)
if (DbConfig) {
DbConfig.style.display = 'none'
}
if (asideEastContainer) {
asideEastContainer.style.display = 'none'
}
} else {
dom.style.width = modelWidth + 'px'
setModelOpen(true)
if (DbConfig) {
DbConfig.style.display = 'block'
}
if (asideEastContainer) {
asideEastContainer.style.display = 'block'
}
}
}

return (
<section id="section-properties" className="aside-east" ref={asideRef}>
<div className="aside-east__container">{renderByPropertyKey()}</div>
<div className="aside-east__container" id="aside-east__container">{renderByPropertyKey()}</div>
{ modelOpen ? (
<div className="expand" style={{
position: "absolute",
left: 0,
top: 0,
zIndex: 99,
display: "flex",
alignItems: "center",
height: "100%"
}}>
<LeftExpand
theme="outline"
size="20"
fill="#757272"
strokeWidth={2}
strokeLinejoin="miter"
strokeLinecap="square"
style={{
cursor: "pointer"
}}
onClick={() => {
handleChangeOpen('close')
}}
/>
</div>
): (
<div className="expand" style={{
position: "absolute",
left: -20,
top: 0,
zIndex: 99,
display: "flex",
alignItems: "center",
height: "100%"
}}>
<RightExpand
theme="outline"
size="20"
fill="#757272"
strokeWidth={2}
strokeLinejoin="miter"
strokeLinecap="square"
style={{
cursor: "pointer"
}}
onClick={() => {
handleChangeOpen('open')
}}
/>
</div>
) }

</section>
);
}
Expand Down
8 changes: 8 additions & 0 deletions solidui-web/src/pages/Designer/Properties/configurations.less
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,11 @@
// }
// }
// }

.database-dialog {
// position: absolute;
// width: 300px;
// height: 600px;
// background-color: red;
// z-index: 999;
}
Loading

0 comments on commit 225cc62

Please sign in to comment.