提交 66911f8b authored 作者: tb53863844's avatar tb53863844

开发

上级 9b453fba
...@@ -19,6 +19,7 @@ export default class ZdyTable extends Component { ...@@ -19,6 +19,7 @@ export default class ZdyTable extends Component {
super(props); super(props);
this.state = { this.state = {
objRealTime:{},
isChange: false, isChange: false,
selects: new Map(), selects: new Map(),
left: 0, left: 0,
...@@ -590,6 +591,9 @@ export default class ZdyTable extends Component { ...@@ -590,6 +591,9 @@ export default class ZdyTable extends Component {
return this.getT(trees, key); return this.getT(trees, key);
}; };
setRealTimeValues=(obj)=>{
this.setState({objRealTime:obj})
}
getT = (trees, key) => { getT = (trees, key) => {
for (var i = 0; i < trees.length; i++) { for (var i = 0; i < trees.length; i++) {
...@@ -845,13 +849,14 @@ export default class ZdyTable extends Component { ...@@ -845,13 +849,14 @@ export default class ZdyTable extends Component {
fatherObj={this.props.fatherObj} fatherObj={this.props.fatherObj}
datas={datas} datas={datas}
uuid={cell.uuid} uuid={cell.uuid}
setRealTimeValues={this.setRealTimeValues}
isEdit={isEdit} isEdit={isEdit}
formKey={currentFormKey} formKey={currentFormKey}
currentFormTitle={currentFormTitle} currentFormTitle={currentFormTitle}
init={init} init={init}
get={get} // 区分移动端或wen端 get={get} // 区分移动端或wen端
json={cell.content} json={cell.content}
obj={obj || {}} // 是否存在默认值 obj={{...obj,...this.state.objRealTime} || {}} // 是否存在默认值
mapData={mapData} mapData={mapData}
form={this.props.form} // antd form控件 form={this.props.form} // antd form控件
sqlData={sqlData} sqlData={sqlData}
...@@ -941,6 +946,7 @@ export default class ZdyTable extends Component { ...@@ -941,6 +946,7 @@ export default class ZdyTable extends Component {
importExcel={this.importExcel} importExcel={this.importExcel}
isPreview={isPreview} isPreview={isPreview}
trees={trees} trees={trees}
setRealTimeValues={this.setRealTimeValues}
isRowCol={isRowCol} isRowCol={isRowCol}
modalInit={modalInit} modalInit={modalInit}
items={items} items={items}
...@@ -955,7 +961,7 @@ export default class ZdyTable extends Component { ...@@ -955,7 +961,7 @@ export default class ZdyTable extends Component {
currentFormTitle={currentFormTitle} currentFormTitle={currentFormTitle}
init={init} init={init}
get={get} get={get}
obj={obj} obj={{...obj,...this.state.objRealTime}}
mapData={mapData} mapData={mapData}
form={this.props.form} form={this.props.form}
sqlData={sqlData} sqlData={sqlData}
......
...@@ -94,6 +94,7 @@ export default class isNewTable extends Component { ...@@ -94,6 +94,7 @@ export default class isNewTable extends Component {
isPreview={isPreview} isPreview={isPreview}
i={i} i={i}
j={j} j={j}
setRealTimeValues={this.props.setRealTimeValues}
index={index} index={index}
getCurrentFormTitle={ getCurrentFormTitle} getCurrentFormTitle={ getCurrentFormTitle}
fatherCode={fatherCode} fatherCode={fatherCode}
...@@ -176,6 +177,7 @@ export default class isNewTable extends Component { ...@@ -176,6 +177,7 @@ export default class isNewTable extends Component {
fatherCode={fatherCode} fatherCode={fatherCode}
datas={datas} datas={datas}
isEdit={isEdit} isEdit={isEdit}
setRealTimeValues={this.props.setRealTimeValues}
getCurrentFormTitle={getCurrentFormTitle} getCurrentFormTitle={getCurrentFormTitle}
importExcel={this.props.importExcel} importExcel={this.props.importExcel}
fatherObj={this.props.fatherObj} fatherObj={this.props.fatherObj}
...@@ -236,6 +238,7 @@ export default class isNewTable extends Component { ...@@ -236,6 +238,7 @@ export default class isNewTable extends Component {
init={init} init={init}
get={get} get={get}
key={j} key={j}
setRealTimeValues={this.props.setRealTimeValues}
sqlData={sqlData} sqlData={sqlData}
obj={obj || {}} obj={obj || {}}
form={this.props.form} form={this.props.form}
......
...@@ -147,6 +147,8 @@ export default class ChildForm extends React.Component { ...@@ -147,6 +147,8 @@ export default class ChildForm extends React.Component {
span={isEdit ? 24 : span} span={isEdit ? 24 : span}
> >
<ZdyTable <ZdyTable
setRealTimeValues={this.props.setRealTimeValues}
trees={this.props.trees} trees={this.props.trees}
key={r} key={r}
modalInit={modalInit} modalInit={modalInit}
...@@ -224,6 +226,8 @@ export default class ChildForm extends React.Component { ...@@ -224,6 +226,8 @@ export default class ChildForm extends React.Component {
return ( return (
<Col span={span}> <Col span={span}>
<ZdyTable <ZdyTable
setRealTimeValues={this.props.setRealTimeValues}
modalInit={modalInit} modalInit={modalInit}
hfInstance={hfInstance} hfInstance={hfInstance}
currentFormTitle={getCurrentFormTitle?getCurrentFormTitle(json.childFormKey):null} currentFormTitle={getCurrentFormTitle?getCurrentFormTitle(json.childFormKey):null}
......
...@@ -28,29 +28,7 @@ class GetLocation extends Component { ...@@ -28,29 +28,7 @@ class GetLocation extends Component {
} }
} }
/* updateMap=(lng,lat,params)=>{
this.map.remove(this.fugai);
this.fugai.length = 0
this.map.setCenter([lng ? lng : 116.397428, lat ? lat : 39.90923]);
if (params && params.polygons) {
for (var i = 0; i < params.polygons.length; i++) {
const p = params.polygons[i]
const path = p.path
const paths = []
for (var j = 0; j < path.lngs.length; j++) {
paths.push(new AMap.LngLat(path.lngs[j], path.lats[j]))
}
var polygon = new AMap.Polygon({
...p,
path: paths
});
this.map.add(polygon);
this.fugai.push(polygon)
}
}
} */
componentWillMount() { componentWillMount() {
...@@ -58,6 +36,10 @@ class GetLocation extends Component { ...@@ -58,6 +36,10 @@ class GetLocation extends Component {
componentDidMount = () => { componentDidMount = () => {
this.getLocation() this.getLocation()
this.searchSiteSelection() this.searchSiteSelection()
const{lng,lat,params}=this.props
if(params.setMap){
params.setMap(this.map,AMap)
}
} }
// 12,[116.171731,40.06682] // 12,[116.171731,40.06682]
//获取当前定位 //获取当前定位
......
...@@ -761,6 +761,15 @@ export default class tableCom extends Component { ...@@ -761,6 +761,15 @@ export default class tableCom extends Component {
e, e,
); );
} }
if(!this.props.isEdit){
if(this.props.setRealTimeValues){
this.props.setRealTimeValues(values)
}
}
}; };
reqUtil = (base52, json, orgCallback, url, method, params, callback, options = {}) => { reqUtil = (base52, json, orgCallback, url, method, params, callback, options = {}) => {
//查缓存 //查缓存
...@@ -1510,6 +1519,7 @@ export default class tableCom extends Component { ...@@ -1510,6 +1519,7 @@ export default class tableCom extends Component {
initialValue: fk, initialValue: fk,
})(<Input type="hidden" />)}{' '} })(<Input type="hidden" />)}{' '}
<ZdyTable <ZdyTable
setRealTimeValues={this.props.setRealTimeValues}
hfInstance={this.props.hfInstance} hfInstance={this.props.hfInstance}
currentFormTitle={this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null} currentFormTitle={this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null}
getCellValue={getCellValue} getCellValue={getCellValue}
...@@ -2274,6 +2284,8 @@ export default class tableCom extends Component { ...@@ -2274,6 +2284,8 @@ export default class tableCom extends Component {
cm = ( cm = (
<ChildForm <ChildForm
setRealTimeValues={this.props.setRealTimeValues}
modalInit={modalInit} modalInit={modalInit}
trees={this.props.trees} trees={this.props.trees}
isPreview={isPreview} isPreview={isPreview}
...@@ -3028,6 +3040,8 @@ export default class tableCom extends Component { ...@@ -3028,6 +3040,8 @@ export default class tableCom extends Component {
initialValue: initValue || {}, initialValue: initValue || {},
})( })(
<ChildForm <ChildForm
setRealTimeValues={this.props.setRealTimeValues}
rights={json.rights || []} rights={json.rights || []}
hfInstance={this.props.hfInstance} hfInstance={this.props.hfInstance}
getCurrentFormTitle={this.props.getCurrentFormTitle} getCurrentFormTitle={this.props.getCurrentFormTitle}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论