🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

tf-form-designer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

tf-form-designer

根目录添加.npmrc文件 ```sh registry=http://10.10.50.174:8081/repository/npm-group/ ``` ## 安装

unpublished
latest
Source
npmnpm
Version
0.0.17
Version published
Maintainers
1
Created
Source

同方问卷调查设计器

私服地址

根目录添加.npmrc文件

registry=http://10.10.50.174:8081/repository/npm-group/

安装

npm install tf-form-designer

快速上手

// 引用
import TfFormDesigner from 'tf-form-designer'
// 注册
Vue.use(TfFormDesigner)
// 使用
<tf-form-designer
  style="height: 100vh"
/>

属性

参数说明类型可选值默认值
modelType模式Number0:设计 1:再设计 2:填报 3:只读 4:预览0
formJSON表样数据Object——{}
fillJSON填报数据Object——{}
regionsApiUrl省市区接口地址String——''
cityId省市idString——''
areaId省市区idString——''
validateObj校验对象Object——{}
cityArray原始省市数据Array——[]
areaArray原始省市区数据Array——[]
showSubmit显示提交按钮Boolean——true
showHold显示暂存按钮Boolean——false
submitTxt提交按钮文字String——提交
stripe斑马条纹Boolean——true
fileUploadApi上传文件接口Promise——
fileDeleteApi上传删除接口Promise——
baseUrl文件下载前缀String——''

事件

事件名称说明回调参数
designSubmit表样提交表样数据: formJSON
submit表单提交填报数据: fillJSON
hold暂存填报数据:fillJSON
validate表单校验1:校验未通过
repeatValidate重复判断校验对象:validateObj
onCamera点击拍照控件id

传入校验对象

let validateObj = {
  id: '',
  isRepeat: false
}

传出校验对象

let validateObj = {
  formId: "",
  id: '',
  type: '',
  value: ''
}

接口所需校验对象

let validateObj = {
  // 表单id
  formId: "",
  // 表单题目列表
  subjectList: {
    // 普通题id
    subjectId: [
      {
        // 题目选项或填空控件对应的id
        valueId: "",
        // 题目选项或填空的值
        value: ""
      }
    ]
  }
}

方法

方法名称说明参数
emitSubmit提交表单-
emitHold暂存-
setCameraPath设置照片路径-

发包

修改package.json的version字段

npm run lib
npm publish

Keywords

vue

FAQs

Package last updated on 26 Jul 2022

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