2022-11-10 16:10:21 +08:00
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import { WeaTableEdit } from "ecCom";
|
|
|
|
|
import { inject, observer } from "mobx-react";
|
2022-11-11 17:09:18 +08:00
|
|
|
import { toJS } from "mobx";
|
2022-11-10 16:10:21 +08:00
|
|
|
|
2022-11-10 18:50:45 +08:00
|
|
|
@inject("columnSetting")
|
2022-11-10 16:10:21 +08:00
|
|
|
@observer
|
|
|
|
|
class CustomItem extends Component {
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init = () => {
|
2022-11-10 18:50:45 +08:00
|
|
|
const { columnSetting } = this.props;
|
|
|
|
|
columnSetting.loadTabThreeRelatedData();
|
2022-11-10 16:10:21 +08:00
|
|
|
};
|
|
|
|
|
|
2022-11-11 17:09:18 +08:00
|
|
|
onRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => {
|
|
|
|
|
const { columnSetting } = this.props;
|
|
|
|
|
if (dataIndex === undefined || selectedDatas === undefined) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-11-14 10:42:44 +08:00
|
|
|
columnSetting.setEnableThreeRows(selectedDatas.status);
|
2022-11-11 17:09:18 +08:00
|
|
|
};
|
|
|
|
|
|
2022-11-10 16:10:21 +08:00
|
|
|
render() {
|
2022-11-11 17:09:18 +08:00
|
|
|
const { columnSetting } = this.props, { tabThreeRelatedData } = columnSetting;
|
|
|
|
|
const { datas, columns, selectedData, loading } = tabThreeRelatedData;
|
2022-11-10 16:10:21 +08:00
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<WeaTableEdit
|
2022-11-11 17:09:18 +08:00
|
|
|
ecId={`${this && this.props && this.props.ecId || ""}_WeaTableEdit@7rorir`}
|
|
|
|
|
draggable
|
|
|
|
|
deleteConfirm
|
|
|
|
|
title=""
|
|
|
|
|
columns={toJS(columns)}
|
|
|
|
|
datas={toJS(datas)}
|
|
|
|
|
copyFilterProps={["id"]}
|
|
|
|
|
selectedData={!loading && toJS(selectedData)}
|
|
|
|
|
onChange={e => columnSetting.setCustomTableEditDatas(e)}
|
|
|
|
|
onRowSelect={(sRowKeys, rows, dataIndex, selectedDatas) => this.onRowSelect(sRowKeys, rows, dataIndex, selectedDatas)}
|
2022-11-10 16:10:21 +08:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default CustomItem;
|