!2173 功能:文件列表列宽需要支持调整

pull/2161/MERGE
黄诗津 1 year ago committed by ChenX
parent a40fb28e6e
commit f599324e4c

@ -1,11 +1,13 @@
import { Button, Classes } from "@blueprintjs/core";
import { action, IObservableValue, observable } from "mobx";
import { IObservableValue, action, observable } from "mobx";
import { observer } from "mobx-react";
import React from "react";
import { app } from "../../../../../../ApplicationServices/Application";
import { TemplateUrls } from "../../../../../../Common/HostUrl";
import { KeyBoard } from "../../../../../../Common/KeyEnum";
import { DirectoryId } from "../../../../../../Common/Request";
import { BoardModalType } from "../../../../../../UI/Components/Board/BoardModalType";
import { datalistStore } from "../../../../../../UI/Components/Common/DatalistStore";
import { ModalFooter, ModalHeader } from "../../../../../../UI/Components/Modal/ModalContainer";
import { ModalState } from "../../../../../../UI/Components/Modal/ModalInterface";
import { CommonPanel } from "../../../../../../UI/Components/SourceManage/CommonPanel";
@ -14,6 +16,7 @@ import { Location } from "../../../../../../UI/Components/ToolBar/ModifyModel/Ro
import ResourceStore from "../../../../../../UI/Components/ToolBar/ResourceLibrary/RsourceStore";
import { IDrawerDoorTempInfo } from "../../../../../../UI/Store/DoorInterface";
import { ITemplateParam } from "../../../../../../UI/Store/RightPanelStore/ITemplateParam";
import { userConfigStore } from "../../../../../../UI/Store/UserConfigStore";
import { Visibility } from "./DrawWindowPanel";
import { DoorWindowPanelStore } from "./WindowPanelStore";
@ -31,7 +34,6 @@ export class WindowTempSelect extends React.Component<IWindowTempSelectProps, {}
@observable _CurrentInfo: IDrawerDoorTempInfo = { id: "", name: "" };
_Container: HTMLElement;
_FilterNameMap: Map<string, string> = new Map();
constructor(props)
{
super(props);
@ -140,6 +142,8 @@ export class WindowTempSelect extends React.Component<IWindowTempSelectProps, {}
private handleClose = (modalState: ModalState) =>
{
userConfigStore.SaveConfig(BoardModalType.DatalistStore, datalistStore, { toaster: false }); //保存配置
if (this.props.selectDiv)
{
this.props.selectDiv.style.visibility = Visibility.Hidden;

@ -6,11 +6,11 @@ import { IUpdateBoardInfosOption } from "../UI/Components/Board/UpdateBoardInfoi
import { EMetalsType, ICompHardwareOption, ICylMetalsOption, IExtMetalsOption, IToplineOption } from "../UI/Components/RightPanel/RightPanelInterface";
import { IKuGangDrawOption } from "../UI/Components/Template/TemplateInterface";
import { ECompareType, IBoardFindOption } from "../UI/Store/BoardFindInterface";
import { BehindBoardOption, BehindHeightPositon, BoardProcessOption, BoardType, BrRelativePos, ChangeColorByBoardMaterialOption, ClosingStripOption, CommonPanelConfigOption, ComposingType, CurtailType, FaceDirection, IAutoDimBrsOption, IBatchModifyPanelOption, IBoardBatchCurtailOption, IDimStyleOption, LayerBoardOption, LayerNailOption, LinesType, ModifyTextsConfigOption, PointLightOption, RadioType, RectAreaLightOption, RightPlaneLightOption, ShareBoardInfConfigurationOption, SideBoardOption, SingleBoardOption, SpotLightOption, StripType, TBBoardOption, VerticalBoardOption, ViewDirection, Viewport2ConfigOption, Viewport3ConfigOption, Viewport4ConfigOption, ViewportConfigOption, ViewportPosition, WindowPanelConfigOption } from "../UI/Store/BoardInterface";
import { BehindBoardOption, BehindHeightPositon, BoardProcessOption, BoardType, BrRelativePos, ChangeColorByBoardMaterialOption, ClosingStripOption, CommonPanelConfigOption, ComposingType, CurtailType, DatalistConfigOption, FaceDirection, IAutoDimBrsOption, IBatchModifyPanelOption, IBoardBatchCurtailOption, IDimStyleOption, LayerBoardOption, LayerNailOption, LinesType, ModifyTextsConfigOption, PointLightOption, RadioType, RectAreaLightOption, RightPlaneLightOption, ShareBoardInfConfigurationOption, SideBoardOption, SingleBoardOption, SpotLightOption, StripType, TBBoardOption, VerticalBoardOption, ViewDirection, Viewport2ConfigOption, Viewport3ConfigOption, Viewport4ConfigOption, ViewportConfigOption, ViewportPosition, WindowPanelConfigOption } from "../UI/Store/BoardInterface";
import { DoorPosType, HandleHorPos, HandleVePos, IDoorConfigOption, IDrawerConfigOption, IHingeConfigOption } from "../UI/Store/DoorInterface";
import { IHSOption } from "../UI/Store/HSInterface";
import { ELatticeArrayType, ILatticeOption } from "../UI/Store/LatticeInterface";
import { EFullDir, EFullType, EWineRackStyle, EWineRackType, EWRackArrayType, IWineRackOption } from "../UI/Store/WineRackInterface";
import { EFullDir, EFullType, EWRackArrayType, EWineRackStyle, EWineRackType, IWineRackOption } from "../UI/Store/WineRackInterface";
import { EOrderType } from "./OrderType";
export const DefaultLayerBoardConfig: LayerBoardOption = {
@ -872,6 +872,11 @@ export const DefaultCommonPanelOption: CommonPanelConfigOption = {
};
Object.freeze(DefaultCommonPanelOption);
export const DefaultDatalistOption: DatalistConfigOption = {
resizeUI: {}
};
Object.freeze(DefaultDatalistOption);
export const DefaultAutoDimBrsOption: IAutoDimBrsOption = {
total: true,
out: true,

@ -61,4 +61,5 @@ export enum BoardModalType
Sealing = "Sealing", //封边
TemplateManage = "TemplateManage",//模板管理界面信息
DimStyleConfig = "DimStyleConfig",//标注配置
DatalistStore = "DatalistStore", //数据列表配置
}

@ -6,9 +6,12 @@ import { CURRENT_HOST } from '../../../Common/HostUrl';
import { MouseKey } from '../../../Common/KeyEnum';
import { getFileSize } from '../../../Common/Utils';
import '../../Css/dataList.less';
import { AnyObject } from '../../Store/BoardInterface';
import { AnyObject, DatalistColumnWidthOption } from '../../Store/BoardInterface';
import { userConfigStore } from '../../Store/UserConfigStore';
import { BoardModalType } from '../Board/BoardModalType';
import { ScaleImages } from '../Template/ScaleImages';
import { RenderBackGroundImg } from '../ToolBar/ResourceLibrary/Resource_ResourceList';
import { datalistStore } from './DatalistStore';
export interface IDataListProps
@ -24,7 +27,7 @@ export interface IDataListProps
isSmaller?: boolean;
dbclickImg?: (data: AnyObject) => void;
dragStart?: (data: AnyObject) => void;
preview?: boolean;
preview?: boolean; //是否可预览
isSvg?: boolean;
handleMounseDown?: (e: React.MouseEvent<HTMLElement>, data: AnyObject) => void;
liStyle?: React.CSSProperties;
@ -35,7 +38,7 @@ export interface IDataListProps
canDrag?: boolean;
isFromResource?: boolean; //数据来自资源库
isTemplateListUse?: boolean; //模块管理使用UI
openScaleImages?: IObservableValue<boolean>,
openScaleImages?: IObservableValue<boolean>;
}
@observer
@ -50,6 +53,101 @@ export class DataList extends React.Component<IDataListProps> {
isSmaller: false,
};
private currentData: any;
private DataListEl = React.createRef<HTMLDivElement>();
private titleType = [["name", "名称"], ["date", "修改日期"], ["size", "大小"], ["operate", "操作"]];
private curColumnWidthEl: { name: Element[], date: Element[], size: Element[], operate: Element[]; } = { name: [], date: [], size: [], operate: [] };
private curColumnWidth: DatalistColumnWidthOption = null;
private handleResizeEl = (e: React.PointerEvent<HTMLElement>, title: string) =>
{
const columnWidthEl = this.curColumnWidthEl[title] as HTMLElement[];
if (columnWidthEl.length === 0) return;
this.UpDataColumnWidth();
const dataListEl = this.DataListEl.current;
const targetEl = (e.target as HTMLElement);
targetEl.classList.add("resize-focus");
targetEl.setPointerCapture(e.pointerId);
const clientX = e.clientX;
const originalWidth = (columnWidthEl[0] as HTMLElement).offsetWidth;
const minWidthEl = Array.from(dataListEl.querySelectorAll<HTMLDivElement>(".min-width"));
const curMinWidth = minWidthEl[0].offsetWidth;
let isMove = false;
let newWidth: number;
targetEl.onmousemove = (ev) =>
{
isMove = true;
const currentWidth = ev.clientX - clientX + originalWidth;
newWidth = Math.max(120, Math.min(500, currentWidth));
if (newWidth === originalWidth) return;
dataListEl.style.display = "none";
minWidthEl.forEach((el) => { el.style.minWidth = `${curMinWidth}px`; });
columnWidthEl.forEach((resizeEl: HTMLElement) => { resizeEl.style.width = `${newWidth}px`; });
dataListEl.style.display = "flex";
};
targetEl.onmouseup = (ev) =>
{
if (isMove)
{
this.curColumnWidth[title] = newWidth;
datalistStore.m_Option.resizeUI[this.props.idKey] = this.curColumnWidth;
minWidthEl.forEach((el) => { el.style.minWidth = "100%"; });
}
targetEl.classList.remove("resize-focus");
targetEl.releasePointerCapture(e.pointerId);
targetEl.onmousemove = null;
targetEl.onmouseup = null;
};
};
private UpDataColumnWidthEl = async () =>
{
const { idKey, dataList, showInfos } = this.props;
if (dataList.length === 0 || !showInfos) return;
for (const title in this.curColumnWidthEl)
{
this.curColumnWidthEl[title] = Array.from(
this.DataListEl.current.querySelectorAll<HTMLDivElement>(`.title-type-${title}`)
);
}
const columnWidthOption = datalistStore.m_Option.resizeUI[idKey];
if (columnWidthOption)
{
this.curColumnWidth = columnWidthOption;
this.UpDataColumnWidth();
}
else
{
let columnWidth = {} as DatalistColumnWidthOption;
for (const title in this.curColumnWidthEl)
{
columnWidth[title] = Math.floor((this.curColumnWidthEl[title][0] as HTMLElement).offsetWidth);
}
this.curColumnWidth = columnWidth;
}
};
private UpDataColumnWidth = () =>
{
const dataListEl = this.DataListEl.current;
dataListEl.style.display = "none";
for (const title in this.curColumnWidthEl)
{
this.curColumnWidthEl[title].forEach((el: HTMLElement) => { el.style.width = `${this.curColumnWidth[title]}px`; });
}
dataListEl.style.display = "flex";
};
private SaveConfig = () =>
{
userConfigStore.SaveConfig(BoardModalType.DatalistStore, datalistStore, { toaster: false }); //保存配置
};
renderBigData = () =>
{
return (
@ -68,46 +166,45 @@ export class DataList extends React.Component<IDataListProps> {
onMouseUp={(e) => this.handleMouseUp(e, data)}
>
{
this.props.preview ? <Popover
interactionKind={PopoverInteractionKind.HOVER_TARGET_ONLY}
hoverOpenDelay={1000}
usePortal={false}
content={
<div
style={{
width: 360,
height: 360,
}}
>
<img src={`${CURRENT_HOST}/${data.path}`} alt="" />
</div>
}
target={
<div
onMouseDown={(e) => this.handleMouseDown(e, data)}
onDoubleClick={() => this.handleDbImgClick(data)}
className={this.props.hintClassName}
draggable="true"
style={{ outline: "none" }}
>
<img src={`${CURRENT_HOST}/${data.thumbs ? data.thumbs['100'].path : data.path}`} alt="" />
</div>
}
/> :
this.props.preview ?
<Popover
interactionKind={PopoverInteractionKind.HOVER_TARGET_ONLY}
hoverOpenDelay={1000}
usePortal={false}
content={
<div style={{ width: 360, height: 360 }}>
<img src={`${CURRENT_HOST}/${data.path}`} alt="" />
</div>
}
target={
<div
onMouseDown={(e) => this.handleMouseDown(e, data)}
onDoubleClick={() => this.handleDbImgClick(data)}
className={this.props.hintClassName}
draggable="true"
style={{ outline: "none" }}
>
<img src={`${CURRENT_HOST}/${data.thumbs ? data.thumbs['100'].path : data.path}`} alt="" />
</div>
}
/>
:
<div
className={this.props.hintClassName}
onDoubleClick={() => this.handleDbImgClick(data)}
draggable="true"
>
{
(this.props.isSvg && !data.logo.endsWith(".png")) ? <svg
width="100px"
height="100px"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<path d={data.logo} fill="transparent" stroke="black" strokeWidth="1" />
</svg> :
(this.props.isSvg && !data.logo.endsWith(".png")) ?
<svg
width="100px"
height="100px"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<path d={data.logo} fill="transparent" stroke="black" strokeWidth="1" />
</svg>
:
<div className="imglist" >
{
this.props.isTemplateListUse &&
@ -133,12 +230,9 @@ export class DataList extends React.Component<IDataListProps> {
<div className="data-title" title={data.name}>
{data.name}
{
this.props.renderButtons && <div className="flex-center" style={{
flex: "0 1"
}}>
{
this.props.renderButtons(data)
}
this.props.renderButtons &&
<div className="flex-center">
{this.props.renderButtons(data)}
</div>
}
</div>
@ -162,90 +256,115 @@ export class DataList extends React.Component<IDataListProps> {
};
renderSmall = () =>
{
const { dataList, isSmaller, idKey, selectData, activeId, isSvg, isFromResource, renderButtons } = this.props;
return (
<>
{
this.props.dataList.length > 0 && !this.props.isSmaller &&
dataList.length > 0 && !isSmaller &&
<div className="info-header">
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div className="info-title min-width">
<div className="title">
{
this.titleType.map(title =>
{
return (
<React.Fragment key={title[0]}>
<div className={`title-item ${"title-type-" + title[0]}`}>
<span>{title[1]}</span>
</div>
<div className="resize" onPointerDown={(e) => this.handleResizeEl(e, title[0])}></div>
</React.Fragment>);
})
}
</div>
</div>
</div>
}
<ul className={"mat-list data-list-info"}>
{
this.props.dataList.map(data =>
<div className='data-list-info'>
<ul className="mat-list min-width">
{
return (
<li
key={data[this.props.idKey]}
data-id={data[this.props.idKey]}
className={this.props.selectData.has(data[this.props.idKey]) ? "selected " : "" + this.props.activeId === data[this.props.idKey] ? "active" : ""}
onMouseDown={(e) => this.handleMouseDown(e, data)}
onMouseUp={(e) => this.handleMouseUp(e, data)}
>
<div
onDragStart={() => this.handleDragStart(data)}
draggable="true"
style={{ padding: "5px 0", height: 50, display: "grid", gridTemplateColumns: "50px 1fr" }}
dataList.map(data =>
{
return (
<li
key={data[idKey]}
data-id={data[idKey]}
className={selectData.has(data[idKey]) ? "selected " : "" + activeId === data[idKey] ? "active" : ""}
onMouseDown={(e) => this.handleMouseDown(e, data)}
onMouseUp={(e) => this.handleMouseUp(e, data)}
>
{
this.props.isSvg ?
<>
<svg
width="40px"
height="40px"
viewBox="0 0 100 100"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<path
d={data.logo}
fill="transparent"
stroke="black"
strokeWidth="1" />
<div
onDragStart={() => this.handleDragStart(data)}
draggable="true"
className="file-title-item title-type-name"
>
{
isSvg ?
<svg width="40px" height="40px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d={data.logo} fill="transparent" stroke="black" strokeWidth="1" />
</svg>
<div className='data-title' style={{ width: "100%", alignSelf: "center" }}>{data.name}</div>
</>
:
<>
:
<div>
<img src={`${CURRENT_HOST}/${this.props.isFromResource ? RenderBackGroundImg(data.logo, "320x320") : data.logo ?? data.path}`} />
<img src={`${CURRENT_HOST}/${isFromResource ? RenderBackGroundImg(data.logo, "320x320") : data.logo ?? data.path}`} />
</div>
<div className='data-title' style={{ width: "100%", alignSelf: "center" }}>{data.name}</div>
</>
}
</div>
{!this.props.isSmaller &&
<>
<div>
{data.update_date ?? data.create_date}
</div>
<div>
{
getFileSize(parseFloat(data.size))
}
</div>
<div>
{
this.props.renderButtons && this.props.renderButtons(data)
}
</div>
</>}
</li>
);
})
}
</ul>
}
<div className='data-title' style={{ width: "100%", alignSelf: "center", textAlign: "left" }}>{data.name}</div>
</div>
{
!isSmaller &&
<>
<div className="file-title-item title-type-date">
<span>
{data.update_date ?? data.create_date}
</span>
</div>
<div className='file-title-item title-type-size'>
<span>
{getFileSize(parseFloat(data.size))}
</span>
</div>
<div className='file-title-item title-type-operate'>
<span>
{renderButtons && renderButtons(data)}
</span>
</div>
</>}
</li>
);
})
}
</ul>
</div>
</>
);
};
componentDidMount(): void
{
this.UpDataColumnWidthEl();
}
componentDidUpdate(prevProps: Readonly<IDataListProps>, prevState: Readonly<{}>, snapshot?: any): void
{
if (!prevProps.showInfos && this.props.showInfos)
this.UpDataColumnWidthEl();
if (prevProps.showInfos && !this.props.showInfos)
this.SaveConfig();
}
componentWillUnmount(): void
{
const { dataList, showInfos } = this.props;
if (dataList.length > 0 && showInfos)
this.SaveConfig();
}
public render()
{
return (
<div
id="data-list"
ref={this.DataListEl}
className={this.props.className}
style={this.props.style ?? {}}
onMouseDown={(e) => this.handleMouseDown(e, {})}

@ -0,0 +1,30 @@
import { observable, toJS } from "mobx";
import { Singleton } from "../../../Common/Singleton";
import { DefaultCommonPanelOption, DefaultDatalistOption } from "../../../Editor/DefaultConfig";
import { DatalistConfigOption } from "../../Store/BoardInterface";
import { IConfigStore } from "../../Store/BoardStore";
import { IConfigOption } from "../Board/UserConfigComponent";
export class DatalistStore extends Singleton implements IConfigStore
{
configName = "默认";
@observable m_Option: DatalistConfigOption = DefaultDatalistOption;
configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultCommonPanelOption);
}
UpdateOption(cof: IConfigOption<DatalistConfigOption>)
{
this.m_Option = cof.option;
}
SaveConfig()
{
//新的配置
let newConfig: IConfigOption<DatalistConfigOption> = {};
newConfig.option = toJS(this.m_Option);
return newConfig;
};
}
export const datalistStore = DatalistStore.GetInstance() as DatalistStore;

@ -66,13 +66,11 @@ export class SelectDataTool
while (el && el.id !== "modal")
{
if (el.id === "matContent")
if (el.id === "matContent" || el.classList.contains('info-header'))
return;
el = el.parentElement;
}
this.container.style.overflow = "hidden";
if (this.StartCallBack)
this.StartCallBack();
this.mouseOn = true;
@ -122,14 +120,13 @@ export class SelectDataTool
private Stop = (e: MouseEvent) =>
{
if (!this.mouseOn) return;
this.container.style.overflow = "visible";
this.container.releasePointerCapture(this.pointId);
let selDiv = this.selectEl;
let fileDivs = this.container.querySelectorAll('[data-id]') as NodeListOf<HTMLElement>;
const scrollTop = fileDivs[0]?.parentElement.parentElement?.scrollTop ?? 0;
const scrollTop = fileDivs[0]?.parentElement?.scrollTop ?? 0;
let selectedEls = [];
let l = selDiv.offsetLeft;
let t = selDiv.offsetTop + scrollTop;
let t = selDiv.offsetTop + scrollTop - 25;
let w = selDiv.offsetWidth;
let h = selDiv.offsetHeight;
for (let i = 0; i < fileDivs.length; i++)

@ -14,10 +14,12 @@
justify-content: space-between;
.soucepanel-tabs {
overflow: hidden;
width: 100%;
.bp3-tab-panel {
flex: 1;
min-width: 200px;
margin-top: 0;
padding-left: 0;
}

@ -30,7 +30,7 @@
display: flex;
flex-direction: column;
& > :nth-child(n) {
&> :nth-child(n) {
margin: 2px 10px;
}
}
@ -119,11 +119,9 @@
}
.panel-datalist {
flex-basis: 100px;
flex-grow: 1;
min-height: 200px;
flex: 1;
overflow: auto;
// position: relative;
// height: calc(~"100% - 50px");
padding: 0;
display: flex;
justify-content: space-between;
@ -132,21 +130,21 @@
// width: 75%;
flex: 1;
padding: 0 10px;
overflow: visible;
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
&>:nth-child(1){
&>:nth-child(1) {
flex: 1;
height: auto;
}
& > .bp3-control {
&>.bp3-control {
margin: 0;
}
& > ul:first-child {
&>ul:first-child {
list-style: none;
display: flex;
flex-wrap: wrap;
@ -156,17 +154,16 @@
margin: 0;
overflow: visible;
& > li {
&>li {
width: 20%;
padding: 5px;
position: relative;
// height: 32%;
.bp3-transition-container {
z-index: 31;
}
& > .look-img .bp3-popover-target,
&>.look-img .bp3-popover-target,
.look-mat {
width: 100%;
height: 0px;
@ -201,7 +198,7 @@
}
}
& > p {
&>p {
width: 70%;
overflow: hidden;
padding: 0;
@ -210,7 +207,7 @@
text-overflow: ellipsis;
}
& > .bp3-control {
&>.bp3-control {
display: none;
position: absolute;
top: 5px;
@ -225,11 +222,11 @@
}
}
& > .selected {
&>.selected {
display: block;
}
& > .bp3-popover-wrapper:not(:first-child) {
&>.bp3-popover-wrapper:not(:first-child) {
position: absolute;
top: 0;
right: 0px;
@ -243,20 +240,20 @@
}
}
&:hover > .bp3-control {
&:hover>.bp3-control {
display: block;
}
&:hover > .bp3-popover-wrapper .bp3-button {
&:hover>.bp3-popover-wrapper .bp3-button {
display: flex;
}
& > .bp3-popover-wrapper .bp3-active {
&>.bp3-popover-wrapper .bp3-active {
display: flex;
}
}
& > .bp3-card > p {
&>.bp3-card>p {
position: static;
}
}
@ -270,21 +267,15 @@
user-select: none;
}
& > li {
&>li {
text-align: center;
// &>.bp3-popover-wrapper {
// position: absolute;
// top: 5px;
// right: 0px;
// }
& > .bp3-control {
&>.bp3-control {
left: 10px;
top: 10;
}
& > p {
&>p {
width: 100%;
bottom: -10px;
}
@ -343,7 +334,7 @@
}
}
.thumbnail > div.border {
.thumbnail>div.border {
display: block;
width: 100%;
height: 180px;
@ -368,7 +359,7 @@
.bp3-dialog-footer-actions {
justify-content: space-between;
& > div:first-child {
&>div:first-child {
line-height: 30px;
}
}
@ -462,7 +453,7 @@
outline: none;
.link-shop {
& > div {
&>div {
position: relative;
.bp3-input-action {
@ -484,7 +475,7 @@
}
}
& > div:last-child {
&>div:last-child {
display: flex;
justify-content: flex-end;
@ -508,6 +499,6 @@
}
}
.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;
}

@ -93,11 +93,12 @@ export class TemplateList extends React.Component<ITemplateListProps> {
this.watchDir();
this.watchDir = null;
}
public render()
{
return (
<div id="TemplateList" className="flex template-right">
<div
id="TemplateList"
className="flex template-right">
<DataList
style={{ flex: 1, borderRight: "1px solid #ccc" }}
dataList={this.props.dataList}

@ -1,9 +1,11 @@
#data-list ul {
list-style: none;
padding: 0;
margin: 0;
&>li {
outline: 1px solid #ccc;
border-bottom: 1px solid #ccc;
width: 100%;
}
&>li.selected {
@ -25,6 +27,7 @@
}
}
//大图标样式
#data-list .fileList {
display: flex;
flex-wrap: wrap;
@ -56,64 +59,163 @@
}
}
//列表样式
#data-list {
overflow: scroll;
height: 100%;
display: flex;
flex-direction: column;
overflow-y: hidden;
overflow-x: scroll;
.info-header {
display: flex;
padding: 5px 0;
&>:first-child {
span {
margin-left: 50px;
}
}
&>:nth-child(-n + 2) {
flex: 3 3 0%;
}
height: 25px;
position: relative;
&>:nth-child(n + 3) {
flex: 2 2 0%;
}
}
.info-title {
position: absolute;
left: 0;
min-width: 100%;
.data-list-info {
margin-top: 0;
.title {
height: 25px;
width: 100%;
border-bottom: 1px solid #ccc;
display: inline-flex;
}
&>li {
display: flex;
align-items: center;
.title-item {
cursor: default;
overflow: hidden;
line-height: 25px;
height: 25px;
border-right: 1px solid #eee;
padding: 0 10px;
margin-left: -10px;
font-size: 1em;
white-space: nowrap;
text-overflow: ellipsis;
flex-shrink: 0;
}
&>:nth-child(-n + 2) {
flex: 3 3 0%;
.title-type {
&-name {
width: 30%;
margin-left: 0px;
padding: 0 0 0 50px;
}
&-date {
width: 30%;
}
&-size {
width: 20%;
text-align: right;
}
&-operate {
width: 20%;
}
}
&>:nth-child(n + 3) {
flex: 2 2 0%;
.resize {
display: inline-block;
cursor: col-resize;
z-index: 1;
position: relative;
margin-left: -10px;
width: 20px;
height: 25px;
&:hover {
background-image: initial;
background-color: rgba(1, 132, 254, 0.1);
}
&::before {
content: '';
position: absolute;
width: 1px;
background: #68b7ff;
height: 2000px;
z-index: 10;
margin-left: 10px;
visibility: hidden;
opacity: 0;
transition: all .2s;
}
}
// &>div {
// flex: 1;
// text-align: left;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// }
img {
height: 40px;
width: 40px;
vertical-align: middle;
.resize-focus {
&::before {
opacity: 1;
visibility: visible;
}
}
}
}
svg {
vertical-align: middle;
.data-list-info {
flex: 1;
position: relative;
&>ul {
position: absolute;
top: 0;
overflow-y: auto;
height: 100%;
&>li {
display: inline-flex;
align-items: center;
.title-type {
&-name {
width: 30%;
padding: 5px 0;
height: 50px;
display: grid;
grid-template-columns: 50px 1fr;
}
&-date {
width: 30%;
text-align: left;
padding-left: 10px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
&-size {
width: 20%;
text-align: right;
padding-right: 10px;
}
&-operate {
width: 20%;
text-align: left;
padding-left: 10px;
}
}
img {
height: 40px;
width: 40px;
vertical-align: middle;
}
svg {
vertical-align: middle;
}
}
}
}
.min-width {
min-width: 100%;
}
.apply-img-hint {
position: relative;
}

@ -500,6 +500,20 @@ export interface CommonPanelConfigOption extends IBaseOption
{
orderType: string;
}
export interface DatalistColumnWidthOption
{
name: number,
date: number,
size: number,
operate: number,
}
export interface DatalistConfigOption extends IBaseOption
{
resizeUI: {
[key: string]: DatalistColumnWidthOption;
};
}
export interface TemplateManageOption extends IBaseOption
{

@ -15,7 +15,7 @@ import { CADFiler } from "../../DatabaseServices/CADFiler";
import { CommandServer } from "../../DatabaseServices/CommandServer";
import { FileServer } from "../../DatabaseServices/FileServer";
import { Light } from "../../DatabaseServices/Lights/Light";
import { doorPanelStore, DoorWindowPanelStore, windowPanelStore } from "../../DatabaseServices/Room/Entity/Wall/Hole/Window/WindowPanelStore";
import { DoorWindowPanelStore, doorPanelStore, windowPanelStore } from "../../DatabaseServices/Room/Entity/Wall/Hole/Window/WindowPanelStore";
import { LimitCommand } from "../../Editor/CommandRegister";
import { userConfig } from "../../Editor/UserConfig";
import { RenderType } from "../../GraphicsSystem/RenderType";
@ -25,12 +25,13 @@ import { ConfigTagCommand } from "../Components/Board/ConfigTagCommand";
import { IConfigOption } from "../Components/Board/UserConfigComponent";
import { ChatReset } from "../Components/ChatButton";
import { AppConfirm } from "../Components/Common/Confirm";
import { datalistStore } from "../Components/Common/DatalistStore";
import { commonPanelStore } from "../Components/SourceManage/CommonPanelStore";
import { AppToaster, ToasterValueError } from "../Components/Toaster";
import RoomBaseParamsStore from "../Components/ToolBar/ModifyModel/RoomBaseParamsStore";
import ResourceStore from "../Components/ToolBar/ResourceLibrary/RsourceStore";
import { bbsEditorStore } from "./BBSEditorStore";
import { AnyObject, CommonPanelConfigOption } from "./BoardInterface";
import { AnyObject, CommonPanelConfigOption, DatalistConfigOption } from "./BoardInterface";
import { IConfigStore } from "./BoardStore";
import { DoorStore } from "./DoorDrawerStore/DoorStore";
import { DrawerStore } from "./DoorDrawerStore/DrawerStore";
@ -192,6 +193,14 @@ export class UserConfigStore extends Singleton
}
}
}
async InitDatalistStore()
{
let config = await this.GetConfig(BoardModalType.DatalistStore) as IConfigOption<DatalistConfigOption>;
if (config)
{
datalistStore.UpdateOption(config);
}
}
//ModelingStore
async InitModelingStore()
{
@ -235,6 +244,7 @@ export class UserConfigStore extends Singleton
await this.InitUserConfig();
await this.InitBBSTabIndex();
await this.InitCommonPanelStore();
await this.InitDatalistStore();
await this.InitModelingStore();
await DownPanelStore.GetInstance().Update();
this.InitDoorWindowPanelStore();

Loading…
Cancel
Save