---
title: "控制一文双屏、正文tab页签打开/关闭"
publicId: "39b39197-717b-47e0-876f-3bc9bb3fbf27"
source: "https://weapp.eteams.cn/build/techdoc/wdoc/index.html#/public/doc/39b39197-717b-47e0-876f-3bc9bb3fbf27"
---
```typescript
 
import { regOvProps,regOvComponent } from '@weapp/utils';
/**
 * 示例代码请，结合业务处理
 */
regOvProps('weappOdoc', 'FlowFormContent', props => {
  const {flowFormStore} = props;

  window.triggerOdocTextColVisible = (visible=false)=>{
    const {showOdocText, showTextColumn, triggerOdocTextColVisible,
      odocTextPosition,
      attachOpenOnRight,
      setProperty
    } = flowFormStore!;
    if(showOdocText) {
      if(showTextColumn ) {
        let updatePrams = {isShowAttachAreaOffice: visible};
        if ((odocTextPosition === '1' && !attachOpenOnRight)
            || (odocTextPosition === '2' && attachOpenOnRight)) {
            Object.assign(updatePrams, {attachAreaOpened: visible});
        }
        setProperty(updatePrams);
        triggerOdocTextColVisible(!visible);
      } else {
        if(!visible) {//打开tab页签
          window?.weappWorkflow?.getFlowPageSDK().switchTab("odocText")
        } else {//回到表单
          window?.weappWorkflow?.getFlowPageSDK().switchTab("main")
        }
      }
    } else {
      console.log("公文不显示")
    }
  }
  //一定记得返回
  return props;
});

```
