提交 291d5168 authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

......@@ -34,7 +34,7 @@ export default class index extends Component {
window.open(path, '_blank');
};
render() {
let { path, pathName } = this.props;
let { path, pathName, width, height } = this.props;
const { visible } = this.state;
let isShow =
pathName?.indexOf('.pdf') !== -1 ||
......@@ -95,7 +95,14 @@ export default class index extends Component {
cancelText="预览"
>
{isImg ? (
<img src={path} alt={pathName} />
<img
style={{
width: width ? width : '100%',
height: height ? height : '100%',
}}
src={path}
alt={pathName}
/>
) : (
<a target="_blank" href={path}>
{pathName}
......
......@@ -423,7 +423,68 @@ class FormList extends React.Component {
const { rights, columnRights } = this.state;
if (this.props.value && this.props.value.columns) {
this.columns = this.props.value.columns;
let cacheList = [];
let cacheChecked = [];
console.log(this.props.value.columns)
// 表头筛选逻辑
Array.isArray(this.props.value.columns) &&
this.props.value.columns.map(item => {
cacheList.push({
label: item.title,
value: item.dataIndex,
});
cacheChecked.push(item.dataIndex);
});
this.checkList = cacheList;
this.setState({
checkedList: cacheChecked,
cacheColumns: cloneDeep(this.props.value.columns),
});
if (this.props.objCode == 1 || this.props.objCode == '1') {
this.getPage();
} else {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
callback: datas => {
const querys = [];
const groups = {};
const refIds = [];
for (let t in datas) {
if (datas[t].isShowQuery) {
querys.push(datas[t]);
if (datas[t].referenceObjId != null) {
refIds.push(datas[t].id);
}
if (datas[t].isGroupQuery != null) {
dispatch({
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
callback: gourp => {
groups[datas[t].id] = gourp;
this.setState({ groups });
},
});
}
}
}
if (querys.length > 0) {
this.setState({ querys });
if (refIds.length > 0) {
dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: options => {
this.setState({ options });
},
});
}
}
this.getPage();
},
});
}
return;
}
if (this.props.objCode == 1 || this.props.objCode == '1') {
......@@ -526,7 +587,7 @@ class FormList extends React.Component {
this.setState({ tableWidth: (datas.length - 1) * 200 });
this.columns.push(column);
this.setState({
cacheColumns: this.columns,
cacheColumns: cloneDeep(this.columns),
});
if (datas[t].isShowQuery) {
querys.push(datas[t]);
......
......@@ -2101,6 +2101,8 @@ export default class tableCom extends Component {
<FilePreview
path={config.httpServer + obj[dataColumn.base52]}
pathName={obj[dataColumn.base52]}
width={json.width}
height={json.height}
/>
) : (
<img
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论