🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ibuild-community/app-websdk

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ibuild-community/app-websdk

云筑智联 app websdk

latest
npmnpm
Version
1.5.1
Version published
Maintainers
1
Created
Source

云筑智联 app-websdk

安装

$ npm i @ibuild-community/app-websdk --save

快速使用

import websdk from "@ibuild-community/app-websdk"

//比如获取当前的位置信息
websdk.getCurrentPosition()
    .then(value=>{
        console.log(value);
    })
    .catch(ex=>{
        console.error(ex);
    })

API

  • close ()=>Promise 关闭当前页面
  • title (title?:string)=>Promise<void|string> 设置或者获取页面的title
  • getCurrentPosition ()=>Promise 获取当前的地理位置
  • openImagePicker (option:ImagePickerOption={multiple:false,mediaType:"photo"})=>Promise<ImagePickerResult | Array<ImagePickerResult> | null> 选择设备上的文件,包括视频,照片等

Modal

  • openScanModal (props?:QRScanModalProps)=>Promise | null> 二维码扫描
  • openCameraModal (props?:CameraProps)=>Promise | null> 拍摄视频/照片
  • openAreaModal (props?:TreeModalProps)=>Promise | null> 区域选择
  • openCheckItemModal (props?:TreeModalProps)=>Promise | null> 分部分项选择
  • openSafetyCheckAreaModal (props?:TreeModalProps)=>Promise | null> 安全检查部位选
  • openQualityCheckAreaModal (props?:TreeModalProps)=>Promise | null> 质量检查部位选择
  • openTaskCheckAreaModal (props?:TreeModalProps)=>Promise | null> 进度任务流水段选择
  • openHiddenDangerModal (props?:TreeModalProps)=>Promise | null> 安全隐患选择
  • openSubContractorModal (props?:TreeModalProps)=>Promise | null> 分包单位选择
  • openMemberModal (props?:MemberModalProps)=>Promise | null> 项目人员选择
  • openRectificationMemberModal (props?:MemberModalProps)=>Promise | null> 整改人选择
  • openOrganizationModal (props?:OrganizationModalProps)=>Promise | null> 组织机构选择

    types

    ImagePickerOption

    • mediaType "any" | "photo" | "video" 媒体类型
    • multiple boolean 是否可以多选

    ImagePickerResult

    • path string
    • width number
    • height number
    • mime string
    • size number
    • modificationDate string

    TakePicType

    Properties

    • all
    • photo
    • video

    QRScanModalProps

    • visible boolean
    • transition?: **$Values<typeof TransitionType> ** modal切换动画
    • barCodeTypes? $Values<typeof QRBarCodeType> [] 识别的二维码类型。默认为空,表示支持所有类型
    • maskColor? string 蒙层背景颜色
    • cornerColor? string扫描区转角线条颜色
    • borderColor? string边线颜色
    • loadingColor? string loading 颜色
    • rectHeight? number 扫描区高度*
    • rectWidth? number 扫描区宽度
    • borderWidth? number 扫描区border宽度
    • cornerBorderWidth? number 扫描区转角线条宽度
    • cornerBorderLength? number 扫描去转角线条长度
    • isLoading? boolean 是否显示loading
    • scanBarAnimateTime? number 扫描线动画时间
    • scanBarColor? string 扫描线颜色
    • scanBarMargin? number 扫描线margin
    • isShowScanBar? boolean 是否显示扫描线
    • topTipText? string 上部分提示文字
    • bottomTipText? string 下部分提示文字

    TreeModalProps

    • visible boolean
    • title? string
    • multiple? boolean 是否支持多选
    • selectedDataSouce *Array 已经选择数据
    • lastSelectedPath? Array 已选择数据的全路径
    • historyKey? string 提供一个字符串key用以保存历史选择数据以实现数据分离,如果不传的将使用默认key对历史选择数据进行保存
    • type?: **$Values<typeof CascadeSelectorType> ** 只有当type==0时才支持多选
    • maxLevel?:number 一页最多显示多少列,超过将按单列现实 type==1时,默认为1;type==0时,默认为10
    • initLevel?:number 初始化显示列 type==1时,默认为0;type==0时,默认为2
    • transition? $Values<typeof TransitionType> 默认为horizontal
    • onShown? Function
    • onHidden? Function 禁止在IOS 在onHidden中调用alert

    CascadeSelectorType

    • 0 只能选择到最后一层级
    • 1 *可以选择任一层级

    MemberModalProps

    • visible boolean
    • title? string
    • multiple? boolean 是否支持多选
    • selectedDataSouce *Array 已经选择数据
    • lastSelectedPath? Array 已选择数据的全路径
    • historyKey? string 提供一个字符串key用以保存历史选择数据以实现数据分离,如果不传的将使用默认key对历史选择数据进行保存
    • onRequestClose function(selectedData?: Object[]|null):void 点击关闭、确定按钮或者选择完数据后触发。点击关闭或者确定按钮时selectedData为空
    • transition? $Values<typeof TransitionType> 默认为horizontal
    • onShown? Function
    • onHidden? Function 禁止在IOS 在onHidden中调用alert

    OrganizationModalProps

    • visible boolean
    • type?: **$Values<typeof CascadeSelectorType> ** 只有当type==0时才支持多选
    • title? string
    • lastSelectedPath? Array 已选择数据的全路径
    • onChanged? ***function (path: Object[]) => void ** 每次选择数据改变触发
    • transition? $Values<typeof TransitionType> 默认为horizontal
    • onShown? Function
    • onHidden? Function 禁止在IOS 在onHidden中调用alert

FAQs

Package last updated on 12 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts