!2016 优化:模板界面UI显示

pull/2031/MERGE
黄诗津 2 years ago committed by ChenX
parent b1698ef1c2
commit 2bc2b2f56b

@ -101,6 +101,7 @@ export class CommonPanelEventBus
export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanelState> export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanelState>
{ {
private tree: HTMLElement; //目录数元素 private tree: HTMLElement; //目录数元素
private ColResizeEl = React.createRef<HTMLDivElement>();
startHandleDir = observable.box(false); //开始操作目录,重命名or新建 startHandleDir = observable.box(false); //开始操作目录,重命名or新建
private timeId = null; //搜索时的定时器 private timeId = null; //搜索时的定时器
dataList = observable([]); dataList = observable([]);
@ -132,6 +133,7 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
private event: Function[] = []; private event: Function[] = [];
private copyIds = new Set(); private copyIds = new Set();
@observable searchedDirs: IDirectoryProps[] = []; @observable searchedDirs: IDirectoryProps[] = [];
private isDragging: boolean = false; //防止两种拖拽事件冲突
constructor(props) constructor(props)
{ {
@ -365,32 +367,46 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
} }
</Navbar.Group> </Navbar.Group>
</Navbar> </Navbar>
<Card style={{ position: "relative" }}> <Card>
{
this.props.isTemplateTag &&
<TemplateTag
FindNode={this.FindNode}
currentTag={this.props.currentTag}
/>
}
<div <div
className="bp3-card img-tree" className='navigation-left'
ref={c => this.tree = c} ref={this.ColResizeEl}>
onDragStart={this.handleDirDragStart}
onClick={() =>
{ {
if (this.props.clickTree) this.props.isTemplateTag &&
this.props.clickTree(); <div className='com-tag'>
}} <TemplateTag
> FindNode={this.FindNode}
<Tree currentTag={this.props.currentTag}
contents={this.state.nodes} />
onNodeClick={this.handleNodeClick} </div>
onNodeCollapse={(node) => this.handleNodeCollapse(node, true)} }
onNodeExpand={(node) => this.handleNodeCollapse(node, false)} <div
onNodeContextMenu={this.showContextMenu} className="bp3-card img-tree"
className={Classes.ELEVATION_0} ref={c => this.tree = c}
/> onDragStart={this.handleDirDragStart}
onClick={() =>
{
if (this.props.clickTree)
this.props.clickTree();
}}
>
<Tree
contents={this.state.nodes}
onNodeClick={this.handleNodeClick}
onNodeCollapse={(node) => this.handleNodeCollapse(node, true)}
onNodeExpand={(node) => this.handleNodeCollapse(node, false)}
onNodeContextMenu={this.showContextMenu}
className={Classes.ELEVATION_0}
/>
</div>
{
//模板添加拽托条,改变目宽度大小
this.props.isTemplateTag &&
<div
className='seekBar'
onPointerDown={(e) => { this.handleResize(e); }}
></div>
}
</div> </div>
<div <div
className="bp3-card img-lib" className="bp3-card img-lib"
@ -448,6 +464,31 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
); );
} }
//拖拽调整模板目录宽度大小
private handleResize = (e: React.PointerEvent<HTMLDivElement>) =>
{
this.isDragging = true;
const target = e.target as HTMLDivElement;
target.setPointerCapture(e.pointerId);
const clientX = e.clientX;
const originalWidth = this.ColResizeEl.current.offsetWidth;
target.onmousemove = (ev) =>
{
let currentWidth = ev.clientX - clientX + originalWidth;
if (currentWidth > 200 && currentWidth < 500)
this.ColResizeEl.current.style.width = currentWidth + "px";
};
target.onmouseup = () =>
{
target.releasePointerCapture(e.pointerId);
target.onmousemove = null;
target.onmouseup = null;
this.isDragging = false;
};
};
private handleSelectAll = (e: React.FormEvent<HTMLInputElement>) => private handleSelectAll = (e: React.FormEvent<HTMLInputElement>) =>
{ {
this.setState({ isSelectAll: e.currentTarget.checked }); this.setState({ isSelectAll: e.currentTarget.checked });
@ -498,7 +539,8 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
//查找标签对应的节点 //查找标签对应的节点
FindNode = async (IDir: string) => FindNode = async (IDir: string) =>
{ {
if (!IDir) return; //没有节点树就不查找
if (!IDir || !this.tree) return;
await new Promise(res => await new Promise(res =>
{ {
let timer = setInterval(() => let timer = setInterval(() =>
@ -1139,6 +1181,12 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
private _moveElement: HTMLElement; private _moveElement: HTMLElement;
private handleDirDragStart = (e: React.DragEvent<Element>) => private handleDirDragStart = (e: React.DragEvent<Element>) =>
{ {
if (this.isDragging)
{
e.preventDefault();
return;
}
let el = e.target as HTMLElement; let el = e.target as HTMLElement;
while (true) while (true)
{ {

@ -1,9 +1,9 @@
.texturePanel { .texturePanel {
height : 100%; height: 100%;
padding: 0; padding: 0;
&>div:first-child { & > div:first-child {
display : flex; display: flex;
justify-content: space-between; justify-content: space-between;
.bp3-align-right { .bp3-align-right {
@ -11,134 +11,181 @@
} }
} }
&>div:last-child { & > div:last-child {
height : calc(~"100% - 50px"); position: relative;
display : flex; height: calc(~"100% - 50px");
display: flex;
justify-content: space-between; justify-content: space-between;
padding : 0; padding: 0;
.img-tree { .navigation-left {
width : 25%; position: relative;
padding : 0; display: flex;
overflow: auto; width: 25%;
.com-tag {
width: 50%;
.tag-name-list {
list-style: none;
text-align: left;
padding: 0;
max-height: 100%;
overflow: auto;
border-right: 1px solid #ccc;
padding-right: 5px;
width: 100%;
li {
border-bottom: 1px solid #ccc;
padding: 5px;
cursor: pointer;
}
.bp3-tree { li:hover {
height : 100%; background-color: #ccc;
box-shadow: none; }
min-width: fill-available;
min-width: -webkit-fill-available;
width: fit-content;
&>ul { li.active {
max-height: 95%; background-color: rgba(19, 124, 189);
overflow : auto; color: #fff;
}
} }
}
.bp3-tree-node-content-1 { .img-tree {
padding-left: 10px; flex: 1;
padding: 0;
overflow: auto;
.bp3-tree {
height: 100%;
box-shadow: none;
min-width: fill-available;
min-width: -webkit-fill-available;
width: fit-content;
& > ul {
max-height: 95%;
overflow: auto;
}
.bp3-tree-node-content-1 {
padding-left: 10px;
}
} }
} }
.seekBar {
cursor: col-resize;
position: absolute;
z-index: 10;
right: -3px;
padding: 0 3px;
height: 100%;
}
} }
.img-lib { .img-lib {
width : 75%; // width: 75%;
padding : 0 10px; flex: 1;
overflow : visible; padding: 0 10px;
position : relative; overflow: visible;
display : flex; position: relative;
display: flex;
flex-direction: column; flex-direction: column;
&>.bp3-control { & > .bp3-control {
margin: 0; margin: 0;
} }
&>ul:first-child { & > ul:first-child {
list-style : none; list-style: none;
display : flex; display: flex;
flex-wrap : wrap; flex-wrap: wrap;
padding : 0; padding: 0;
flex : 1; flex: 1;
align-content: start; align-content: start;
margin : 0; margin: 0;
overflow : visible; overflow: visible;
&>li { & > li {
width : 20%; width: 20%;
padding : 5px; padding: 5px;
position : relative; position: relative;
// height: 32%; // height: 32%;
.bp3-transition-container { .bp3-transition-container {
z-index: 31; z-index: 31;
} }
&>.look-img .bp3-popover-target, & > .look-img .bp3-popover-target,
.look-mat { .look-mat {
width : 100%; width: 100%;
height : 0px; height: 0px;
padding-bottom: 100%; padding-bottom: 100%;
overflow : hidden; overflow: hidden;
margin : 0; margin: 0;
position : relative; position: relative;
div { div {
position: absolute; position: absolute;
left : 0; left: 0;
width : 100%; width: 100%;
height : 100%; height: 100%;
} }
img { img {
position: absolute; position: absolute;
left : 0; left: 0;
} }
.apply-img-hint:hover:before { .apply-img-hint:hover:before {
content : "双击应用图片"; content: "双击应用图片";
position: absolute; position: absolute;
left : 0; left: 0;
right : 0; right: 0;
bottom : 0; bottom: 0;
top : 0; top: 0;
margin : auto; margin: auto;
width : max-content; width: max-content;
height : 20px; height: 20px;
opacity : 0.5; opacity: 0.5;
} }
} }
&>p { & > p {
width : 70%; width: 70%;
overflow : hidden; overflow: hidden;
padding : 0; padding: 0;
margin : 0; margin: 0;
white-space : nowrap; white-space: nowrap;
text-overflow: ellipsis text-overflow: ellipsis;
} }
&>.bp3-control { & > .bp3-control {
display : none; display: none;
position : absolute; position: absolute;
top : 5px; top: 5px;
margin : 0; margin: 0;
padding : 0; padding: 0;
height : 16px; height: 16px;
line-height: 16px; line-height: 16px;
.bp3-control-indicator { .bp3-control-indicator {
margin : 0; margin: 0;
vertical-align: baseline; vertical-align: baseline;
} }
} }
&>.selected { & > .selected {
display: block; display: block;
} }
&>.bp3-popover-wrapper:not(:first-child) { & > .bp3-popover-wrapper:not(:first-child) {
position: absolute; position: absolute;
top : 0; top: 0;
right : 0px; right: 0px;
.bp3-button { .bp3-button {
display: none; display: none;
@ -149,20 +196,20 @@
} }
} }
&:hover>.bp3-control { &:hover > .bp3-control {
display: block; display: block;
} }
&:hover>.bp3-popover-wrapper .bp3-button { &:hover > .bp3-popover-wrapper .bp3-button {
display: flex; display: flex;
} }
&>.bp3-popover-wrapper .bp3-active { & > .bp3-popover-wrapper .bp3-active {
display: flex; display: flex;
} }
} }
&>.bp3-card>p { & > .bp3-card > p {
position: static; position: static;
} }
} }
@ -176,9 +223,7 @@
user-select: none; user-select: none;
} }
& > li {
&>li {
text-align: center; text-align: center;
// &>.bp3-popover-wrapper { // &>.bp3-popover-wrapper {
@ -187,13 +232,13 @@
// right: 0px; // right: 0px;
// } // }
&>.bp3-control { & > .bp3-control {
left: 10px; left: 10px;
top : 10; top: 10;
} }
&>p { & > p {
width : 100%; width: 100%;
bottom: -10px; bottom: -10px;
} }
} }
@ -201,47 +246,46 @@
.bp3-dialog-container { .bp3-dialog-container {
position: fixed; position: fixed;
left : 0; left: 0;
top : 0; top: 0;
z-index : 30; z-index: 30;
.bp3-dialog { .bp3-dialog {
width : unset; width: unset;
margin : 0; margin: 0;
padding: 0; padding: 0;
} }
} }
} }
} }
} }
.upload { .upload {
.thumbnail { .thumbnail {
min-height: 200px; min-height: 200px;
position : relative; position: relative;
padding : 20px; padding: 20px;
.thumbnail-list { .thumbnail-list {
list-style : none; list-style: none;
display : flex; display: flex;
flex-wrap : wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
margin-right : 10px; margin-right: 10px;
margin-bottom : 10px; margin-bottom: 10px;
max-height : 400px; max-height: 400px;
overflow : auto; overflow: auto;
li { li {
width : 110px; width: 110px;
height : 110px; height: 110px;
padding : 10px; padding: 10px;
position: relative; position: relative;
button { button {
position: absolute; position: absolute;
right : 0; right: 0;
top : 0; top: 0;
svg { svg {
color: #ff7373; color: #ff7373;
@ -251,84 +295,84 @@
} }
} }
.thumbnail>div.border { .thumbnail > div.border {
display: block; display: block;
width : 100%; width: 100%;
height : 180px; height: 180px;
border : 2px dashed #ccc; border: 2px dashed #ccc;
} }
.uploadBtn { .uploadBtn {
width : 100px; width: 100px;
height : 50px; height: 50px;
line-height : 50px; line-height: 50px;
border-radius: 5px; border-radius: 5px;
text-align : center; text-align: center;
position : absolute; position: absolute;
left : 0; left: 0;
right : 0; right: 0;
top : 0; top: 0;
bottom : 0; bottom: 0;
margin : auto; margin: auto;
background : #137cbd; background: #137cbd;
} }
.bp3-dialog-footer-actions { .bp3-dialog-footer-actions {
justify-content: space-between; justify-content: space-between;
&>div:first-child { & > div:first-child {
line-height: 30px; line-height: 30px;
} }
} }
.bp3-dialog-body { .bp3-dialog-body {
h5 { h5 {
padding-left : 20px; padding-left: 20px;
padding-top : 20px; padding-top: 20px;
overflow : hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space : nowrap; white-space: nowrap;
} }
} }
} }
.newDir { .newDir {
position: fixed; position: fixed;
top : 10%; top: 10%;
left : 33%; left: 33%;
z-index : 25; z-index: 25;
label.bp3-label { label.bp3-label {
margin-bottom: 0 margin-bottom: 0;
} }
} }
.pagination { .pagination {
display : flex; display: flex;
justify-content: center; justify-content: center;
align-items : center; align-items: center;
width : 100%; width: 100%;
padding : 10px 0; padding: 10px 0;
height : 60px; height: 60px;
ul { ul {
margin : 0; margin: 0;
list-style : none; list-style: none;
display : flex; display: flex;
// width: calc(~"100% - 20px"); // width: calc(~"100% - 20px");
justify-content: center; justify-content: center;
padding-left : 0; padding-left: 0;
flex-wrap : wrap; flex-wrap: wrap;
li { li {
border : 1px solid #137cbd; border: 1px solid #137cbd;
border-radius: 5px; border-radius: 5px;
height : 36px; height: 36px;
width : 36px; width: 36px;
cursor : pointer; cursor: pointer;
text-align : center; text-align: center;
line-height : 36px; line-height: 36px;
margin-right : 5px; margin-right: 5px;
} }
li.active { li.active {
@ -336,20 +380,20 @@
} }
li.disabled { li.disabled {
cursor : not-allowed; cursor: not-allowed;
color : #ccc; color: #ccc;
border-color: #ccc; border-color: #ccc;
} }
} }
.bp3-label { .bp3-label {
display : flex; display: flex;
justify-content: center; justify-content: center;
align-items : center; align-items: center;
margin : 0; margin: 0;
input { input {
width : 35px; width: 35px;
margin: 0 5px; margin: 0 5px;
} }
} }
@ -357,10 +401,10 @@
.new-mat { .new-mat {
position: fixed; position: fixed;
outline : none; outline: none;
.link-shop { .link-shop {
&>div { & > div {
position: relative; position: relative;
.bp3-input-action { .bp3-input-action {
@ -368,11 +412,11 @@
} }
ul { ul {
font-size : 16px; font-size: 16px;
position : absolute; position: absolute;
top : 36px; top: 36px;
left : 0; left: 0;
width : 100%; width: 100%;
background: rgb(48, 64, 77); background: rgb(48, 64, 77);
li:hover { li:hover {
@ -382,8 +426,8 @@
} }
} }
&>div:last-child { & > div:last-child {
display : flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
.bp3-button { .bp3-button {
@ -394,7 +438,7 @@
.search-dir { .search-dir {
max-height: 300px; max-height: 300px;
overflow : auto; overflow: auto;
li { li {
padding: 5px 0; padding: 5px 0;
@ -402,10 +446,10 @@
li:hover { li:hover {
background-color: #ccc; background-color: #ccc;
color : #fff color: #fff;
} }
} }
.texturePanel > div:last-child .img-lib .HistoryList .mat-list:first-child li { .texturePanel > div:last-child .img-lib .HistoryList .mat-list:first-child li {
cursor:default; cursor: default;
} }

@ -10,20 +10,20 @@
#commonModal .template, #commonModal .template,
#commonModal .template-select { #commonModal .template-select {
max-width : 1300px; max-width: 1500px;
width : 90vw; width: 90vw;
height : 850px; height: 850px;
.bp3-dialog-body { .bp3-dialog-body {
height : 700px; height: 700px;
} }
.bp3-dialog-footer{ .bp3-dialog-footer {
justify-content: space-between; justify-content: space-between;
height : 110px; height: 110px;
} }
.bp3-dialog-body>div:first-child { .bp3-dialog-body > div:first-child {
min-width: 200px; min-width: 200px;
} }
@ -32,34 +32,34 @@
} }
.template-right { .template-right {
flex : 1; flex: 1;
overflow: auto; overflow: auto;
.template-list { .template-list {
padding : 0; padding: 0;
list-style : none; list-style: none;
display : flex; display: flex;
flex-wrap : wrap; flex-wrap: wrap;
width : 60%; width: 60%;
box-shadow : 1px 0 0 0 rgba(16, 22, 26, 0.15); box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15);
align-content: flex-start; align-content: flex-start;
text-align : center; text-align: center;
&>li { & > li {
padding: 5px 10px 0 10px; padding: 5px 10px 0 10px;
&>div { & > div {
width : 80%; width: 80%;
margin: 0 auto; margin: 0 auto;
} }
&>p { & > p {
width : 100px; width: 100px;
// overflow: hidden; // overflow: hidden;
// white-space: nowrap; // white-space: nowrap;
// text-overflow: ellipsis; // text-overflow: ellipsis;
margin : 0; margin: 0;
line-height : 1; line-height: 1;
} }
} }
} }
@ -68,7 +68,7 @@
width: 320px; width: 320px;
overflow: auto; overflow: auto;
&>div { & > div {
input { input {
height: 30px; height: 30px;
} }
@ -76,45 +76,44 @@
align-items: flex-start; align-items: flex-start;
} }
&>ul { & > ul {
width: 300px; width: 300px;
list-style: none; list-style: none;
padding : 0; padding: 0;
text-align: center; text-align: center;
box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15); box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15);
max-height: 40%; max-height: 40%;
overflow : auto; overflow: auto;
&>li { & > li {
display : flex; display: flex;
justify-content: space-between; justify-content: space-between;
height : 25px; height: 25px;
align-items : center; align-items: center;
white-space : nowrap; white-space: nowrap;
&>span { & > span {
width : 25%; width: 25%;
overflow : hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
} }
} }
} }
.kugan { .kugan {
margin-top: 20px; margin-top: 20px;
&>div { & > div {
&>label { & > label {
display : flex; display: flex;
align-items: center; align-items: center;
text-align : left; text-align: left;
flex : 1; flex: 1;
} }
&>label:first-child { & > label:first-child {
span { span {
width: 60px; width: 60px;
} }
@ -131,30 +130,30 @@
.delete-selete { .delete-selete {
position: relative; position: relative;
&>.bp3-control { & > .bp3-control {
display : none; display: none;
position : absolute; position: absolute;
top : 5px; top: 5px;
left : 10px; left: 10px;
margin : 0; margin: 0;
padding : 0; padding: 0;
height : 16px; height: 16px;
line-height: 16px; line-height: 16px;
.bp3-control-indicator { .bp3-control-indicator {
margin : 0; margin: 0;
vertical-align: baseline; vertical-align: baseline;
} }
} }
&>.selected { & > .selected {
display: block; display: block;
} }
&>.bp3-popover-wrapper:not(:first-child) { & > .bp3-popover-wrapper:not(:first-child) {
position: absolute; position: absolute;
top : 0px; top: 0px;
right : 0px; right: 0px;
.bp3-button { .bp3-button {
display: none; display: none;
@ -165,80 +164,52 @@
} }
} }
&:hover>.bp3-control { &:hover > .bp3-control {
display: block; display: block;
} }
&:hover>.bp3-popover-wrapper .bp3-button { &:hover > .bp3-popover-wrapper .bp3-button {
display: flex; display: flex;
} }
} }
.tag-list { .tag-list {
border-right : 1px solid #ccc; border-right: 1px solid #ccc;
display : flex; display: flex;
width : 75%; width: 75%;
flex-wrap : wrap; flex-wrap: wrap;
align-content: start; align-content: start;
.pagination { .pagination {
margin-top: 20px; margin-top: 20px;
} }
&>.tag-img { & > .tag-img {
width : 17%; width: 17%;
outline : 1px solid #ccc; outline: 1px solid #ccc;
height : 0; height: 0;
text-align : center; text-align: center;
padding-bottom: calc(20%); padding-bottom: calc(20%);
position : relative; position: relative;
} }
&>.tag-img:hover:after, & > .tag-img:hover:after,
&>.tag-img.active:after { & > .tag-img.active:after {
content : ""; content: "";
position : absolute; position: absolute;
left : 0; left: 0;
top : 0; top: 0;
width : 100%; width: 100%;
height : 100%; height: 100%;
background-color: rgb(30, 152, 209); background-color: rgb(30, 152, 209);
opacity : 0.5; opacity: 0.5;
} }
} }
.tag-name-list {
list-style : none;
width : 100px;
text-align : left;
padding : 0;
max-height : 100%;
overflow : auto;
border-right : 1px solid #ccc;
padding-right: 5px;
width : 20%;
li {
border-bottom: 1px solid #ccc;
padding : 5px;
cursor : pointer;
}
li:hover {
background-color: #ccc;
}
li.active {
background-color: rgba(19, 124, 189);
color : #fff;
}
}
} }
#commonModal .template-detail { #commonModal .template-detail {
&>.add-tag { & > .add-tag {
display : flex; display: flex;
align-items: center; align-items: center;
padding-top: 10px; padding-top: 10px;
@ -247,14 +218,14 @@
} }
button { button {
height : 20px; height: 20px;
min-height : 20px; min-height: 20px;
line-height: 20px; line-height: 20px;
padding : 0 5px; padding: 0 5px;
} }
} }
&>div { & > div {
input { input {
height: 30px; height: 30px;
} }
@ -262,32 +233,32 @@
align-items: flex-start; align-items: flex-start;
} }
&>div:last-child { & > div:last-child {
text-align: right; text-align: right;
} }
&>ul { & > ul {
list-style: none; list-style: none;
padding : 0; padding: 0;
text-align: center; text-align: center;
box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15); box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15);
max-height: 40%; max-height: 40%;
overflow : auto; overflow: auto;
&>li { & > li {
display : flex; display: flex;
justify-content: space-between; justify-content: space-between;
height : 25px; height: 25px;
align-items : center; align-items: center;
&>span { & > span {
width : 25%; width: 25%;
overflow : hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
&>li:not(:first-child) { & > li:not(:first-child) {
box-shadow: 0 1px 0 0 rgba(16, 22, 26, 0.15); box-shadow: 0 1px 0 0 rgba(16, 22, 26, 0.15);
span { span {
@ -304,7 +275,7 @@
#commonModal .tag-temp-detail { #commonModal .tag-temp-detail {
flex: 1; flex: 1;
&>ul { & > ul {
max-height: 100%; max-height: 100%;
} }
} }
@ -318,31 +289,30 @@
margin: 0; margin: 0;
} }
.bp3-dialog-body .bp3-label>span { .bp3-dialog-body .bp3-label > span {
width: auto; width: auto;
} }
.bp3-dialog-body>div { .bp3-dialog-body > div {
height: 100%; height: 100%;
&>div:first-child { & > div:first-child {
width: 60%; width: 60%;
} }
&>div:last-child { & > div:last-child {
width: 40%; width: 40%;
} }
} }
.buttons { .buttons {
& > button {
&>button { margin-right: 3px;
margin-right : 3px;
margin-bottom: 3px; margin-bottom: 3px;
border-radius: 5px; border-radius: 5px;
} }
&>span { & > span {
margin-right: 3px; margin-right: 3px;
& button { & button {
@ -353,40 +323,37 @@
} }
} }
@boxShadow: rgba(19, 124, 189, 0) 0px 0px 0px 0px, @boxShadow: rgba(19, 124, 189, 0) 0px 0px 0px 0px, rgba(19, 124, 189, 0) 0px 0px 0px 0px, rgba(16, 22, 26, 0.15) 0px 0px 0px 1px inset, rgba(16, 22, 26, 0.2) 0px 1px 1px inset;
rgba(19, 124, 189, 0) 0px 0px 0px 0px,
rgba(16, 22, 26, 0.15) 0px 0px 0px 1px inset,
rgba(16, 22, 26, 0.2) 0px 1px 1px inset;
.params-list { .params-list {
list-style: none; list-style: none;
padding : 0; padding: 0;
text-align: center; text-align: center;
box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15); box-shadow: 1px 0 0 0 rgba(16, 22, 26, 0.15);
flex : 1; flex: 1;
overflow : auto; overflow: auto;
&>li { & > li {
display : flex; display: flex;
justify-content: space-between; justify-content: space-between;
height : 25px; height: 25px;
align-items : center; align-items: center;
&>span { & > span {
line-height: 25px; line-height: 25px;
box-shadow : @boxShadow; box-shadow: @boxShadow;
} }
&>label { & > label {
box-shadow: @boxShadow; box-shadow: @boxShadow;
} }
&>span, & > span,
&>input, & > input,
label { label {
width : 20% !important; width: 20% !important;
height : 100% !important; height: 100% !important;
overflow : hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
@ -394,7 +361,7 @@
.action-list { .action-list {
overflow: auto; overflow: auto;
flex : 1; flex: 1;
.bp3-tree-node-content { .bp3-tree-node-content {
height: 20px; height: 20px;
@ -402,18 +369,16 @@
} }
#modal .action-dialog { #modal .action-dialog {
left : 0; left: 0;
right : 0; right: 0;
top : 0; top: 0;
bottom : 0; bottom: 0;
margin : auto; margin: auto;
width : 280px; width: 280px;
z-index : 35; z-index: 35;
display : flex; display: flex;
flex-direction: column; flex-direction: column;
box-shadow : 0 0 0 1px rgba(16, 22, 26, 0.15), box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.15), 0 0 0 rgba(16, 22, 26, 0), 0 0 0 rgba(16, 22, 26, 0);
0 0 0 rgba(16, 22, 26, 0),
0 0 0 rgba(16, 22, 26, 0);
h4 { h4 {
font-size: 14px; font-size: 14px;
@ -421,32 +386,32 @@
.bp3-dialog-header { .bp3-dialog-header {
min-height: auto; min-height: auto;
height : 30px; height: 30px;
} }
.bp3-dialog-body { .bp3-dialog-body {
padding: 3px; padding: 3px;
&>.bp3-label { & > .bp3-label {
display : flex; display: flex;
width : 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
font-size : 14px; font-size: 14px;
padding : 5px 10px 5px 10px; padding: 5px 10px 5px 10px;
&>input, & > input,
&>.bp3-html-select { & > .bp3-html-select {
width : 65%; width: 65%;
height: 25px; height: 25px;
margin: auto; margin: auto;
select{ select {
height: 25px; height: 25px;
} }
>span{ > span {
margin-top: 3px; margin-top: 3px;
} }
} }
.spanText{ .spanText {
width: 82px; width: 82px;
margin: auto; margin: auto;
} }
@ -456,17 +421,17 @@
margin: 0px 10px 0 0; margin: 0px 10px 0 0;
} }
.bp3-control.bp3-checkbox{ .bp3-control.bp3-checkbox {
margin: 7px 0 0 5px; margin: 7px 0 0 5px;
font-size: 13px; font-size: 13px;
} }
} }
.bp3-dialog-footer { .bp3-dialog-footer {
padding : 5px; padding: 5px;
justify-content: flex-end; justify-content: flex-end;
button{ button {
margin: 5px; margin: 5px;
} }
} }
@ -474,24 +439,24 @@
#commonModal .template-select { #commonModal .template-select {
position: absolute; position: absolute;
z-index : 30; z-index: 30;
.show-temp { .show-temp {
&>h5 { & > h5 {
text-align: left; text-align: left;
} }
&>div>div { & > div > div {
width : 50%; width: 50%;
outline : 1px solid #ccc; outline: 1px solid #ccc;
text-align: center; text-align: center;
&>img { & > img {
width : 100px; width: 100px;
height: 100px; height: 100px;
} }
&>p { & > p {
text-align: center; text-align: center;
} }
} }
@ -502,15 +467,15 @@
padding: 0; padding: 0;
ul { ul {
width : 100px; width: 100px;
text-align: center; text-align: center;
padding : 5px; padding: 5px;
max-height: 200px; max-height: 200px;
overflow : auto; overflow: auto;
li { li {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
padding : 2px 0; padding: 2px 0;
} }
li:hover { li:hover {
@ -519,8 +484,8 @@
} }
} }
.saveDir{ .saveDir {
overflow : auto; overflow: auto;
min-width : 200px; min-width: 200px;
max-height: 70vh; max-height: 70vh;
} }

@ -885,64 +885,63 @@ export class TemplateManage extends React.Component<ITemplateManage, {}> {
title={title} title={title}
close={() => app.Editor.ModalManage.Destory()} close={() => app.Editor.ModalManage.Destory()}
/> />
<div <div className={Classes.DIALOG_BODY}>
className={Classes.DIALOG_BODY}
>
{ {
this.renderBody() this.renderBody()
} }
</div> </div>
<div className={Classes.DIALOG_FOOTER} > <div className={Classes.DIALOG_FOOTER} >
{ {
!this.props.R2bReplace && !this.props.R2bReplace ?
<GetRoomCabName <>
option={this.option} <GetRoomCabName
needBoardName option={this.option}
/> needBoardName
} />
{!this.props.R2bReplace && <AutoCutCheckbox isFlex={false} autoCutOption={this.autoCutOption} />} <AutoCutCheckbox isFlex={false} autoCutOption={this.autoCutOption} />
<div className={Classes.DIALOG_FOOTER_ACTIONS}> <div className={Classes.DIALOG_FOOTER_ACTIONS}>
{ {
!this.props.R2bReplace && <Button <Button
className={Classes.INTENT_SUCCESS} className={Classes.INTENT_SUCCESS}
text={<span><i>(I)</i></span>} text={<span><i>(I)</i></span>}
disabled={!this.currentTemplateInfo.id} disabled={!this.currentTemplateInfo.id}
onClick={() => this.handleInsert(true)} onClick={() => this.handleInsert(true)}
/> />
} }
{ {
!this.props.R2bReplace && <Button <Button
className={Classes.INTENT_DANGER} className={Classes.INTENT_DANGER}
text={<span><i>(S)</i></span>} text={<span><i>(S)</i></span>}
onClick={() => this.handleInsert(false)} onClick={() => this.handleInsert(false)}
disabled={!this.currentTemplateInfo.id} disabled={!this.currentTemplateInfo.id}
/> />
} }
{ {
this.currentTemplateInfo.id && (this.currentTemplateInfo.isHandle || this.currentTemplateInfo.isHinge) && !this.props.R2bReplace && this.currentTemplateInfo.id && (this.currentTemplateInfo.isHandle || this.currentTemplateInfo.isHinge) &&
<Button
className={Classes.INTENT_DANGER}
text="拾取板件"
onClick={this.handleInsertHandleOrHinge}
disabled={!this.currentTemplateInfo.id}
/>
}
{
<Button
className={Classes.INTENT_PRIMARY}
text={<span><i>(T)</i></span>}
onClick={this.handleReplace}
disabled={!this.currentTemplateInfo.id || this.currentTemplateInfo.isKuGan}
/>
}
</div>
</>
:
<Button <Button
className={Classes.INTENT_DANGER}
text="拾取板件"
onClick={this.handleInsertHandleOrHinge}
disabled={!this.currentTemplateInfo.id}
/>
}
{
!this.props.R2bReplace && <Button
className={Classes.INTENT_PRIMARY} className={Classes.INTENT_PRIMARY}
text={<span><i>(T)</i></span>} text="确定"
onClick={this.handleReplace} onClick={this.handleR2bRepalce}
disabled={!this.currentTemplateInfo.id || this.currentTemplateInfo.isKuGan} disabled={!this.currentTemplateInfo.id || this.currentTemplateInfo.isKuGan}
/> />
}
</div>
{
this.props.R2bReplace && <Button
className={Classes.INTENT_PRIMARY}
text="确定"
onClick={this.handleR2bRepalce}
disabled={!this.currentTemplateInfo.id || this.currentTemplateInfo.isKuGan}
/>
} }
</div> </div>
</div> </div>

@ -1,59 +1,56 @@
#data-list ul { #data-list ul {
list-style: none; list-style: none;
padding : 0; padding: 0;
&>li { & > li {
outline: 1px solid #ccc; outline: 1px solid #ccc;
} }
&>li.selected { & > li.selected {
background-color: #52aee7; background-color: #52aee7;
color : #000; color: #000;
} }
.look-mat { .look-mat {
width : 100%; width: 100%;
height : 0px; height: 0px;
padding-bottom: 100%; padding-bottom: 100%;
overflow : hidden; overflow: hidden;
margin : 0; margin: 0;
position : relative; position: relative;
} }
&>li.actived { & > li.actived {
border: 2px inset #1061ae; border: 2px inset #1061ae;
} }
} }
#data-list .fileList { #data-list .fileList {
display : flex; display: flex;
flex-wrap : wrap; flex-wrap: wrap;
padding : 0; padding: 0;
flex : 1; flex: 1;
align-content: start; align-content: start;
margin : 0; margin: 0;
overflow : visible; overflow: visible;
&>li { & > li {
display : flex; display: flex;
flex-direction: column; flex-direction: column;
} }
&>li { & > li {
outline : 1px solid #ccc; outline: 1px solid #ccc;
width : 20%; width: 20%;
padding : 5px; padding: 5px;
position: relative; position: relative;
.look-mat img { .look-mat img {
position: absolute; position: absolute;
left : 0; left: 0;
} }
p{ p {
margin-bottom: 15px; margin-bottom: 15px;
} }
} }
@ -64,47 +61,29 @@
display: flex; display: flex;
padding: 5px 0; padding: 5px 0;
:nth-child(1) { :nth-child(-n + 2) {
flex: 1; flex: 3 3 0%;
}
:nth-child(2) {
width: 160px;
}
:nth-child(3) {
width: 100px;
} }
:nth-child(4) { :nth-child(n + 3) {
width: 100px; flex: 2 2 0%;
} }
} }
overflow: scroll; overflow: scroll;
height : 100%; height: 100%;
.data-list-info { .data-list-info {
& > li {
display: flex;
&>li {
display : flex;
align-items: center; align-items: center;
:nth-child(1) { :nth-child(-n + 2) {
flex: 1; flex: 3 3 0%;
}
:nth-child(2) {
width: 160px;
} }
:nth-child(3) { :nth-child(n + 3) {
width: 100px; flex: 2 2 0%;
}
:nth-child(4) {
width: 100px;
} }
// &>div { // &>div {
@ -116,8 +95,8 @@
// } // }
img { img {
height : 40px; height: 40px;
width : 40px; width: 40px;
vertical-align: middle; vertical-align: middle;
} }
@ -125,7 +104,6 @@
vertical-align: middle; vertical-align: middle;
} }
} }
} }
.apply-img-hint { .apply-img-hint {
@ -133,34 +111,34 @@
} }
.apply-img-hint:hover:before { .apply-img-hint:hover:before {
content : "双击应用图片"; content: "双击应用图片";
position : absolute; position: absolute;
left : 0; left: 0;
right : 0; right: 0;
bottom : 0; bottom: 0;
top : 0; top: 0;
margin : auto; margin: auto;
width : max-content; width: max-content;
height : 20px; height: 20px;
opacity : 1; opacity: 1;
font-weight: bold; font-weight: bold;
} }
.hint:hover::before { .hint:hover::before {
content : "双击编辑材质 拖至绘图区应用"; content: "双击编辑材质 拖至绘图区应用";
position: absolute; position: absolute;
left : 20%; left: 20%;
top : 10px; top: 10px;
margin : auto; margin: auto;
width : 55%; width: 55%;
height : 30px; height: 30px;
opacity : 1; opacity: 1;
z-index : 1; z-index: 1;
} }
} }
.data-title { .data-title {
overflow : hidden; overflow: hidden;
white-space : nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }

Loading…
Cancel
Save