npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dynamic-forms-plug-in

v0.1.2

Published

动态表单组件组件封装

Downloads

5

Readme

动态表单

本项目实现通过配置的方式针对不同的功能开发不同的表单,后期维护无需修改代码。

项目运行和构建

npm run serve

npm run build

软件架构

1. UmyUi 大数据表格
2. vue2
3. element-ui
4. vue-router
5. vuex
6. scss

界面布局

插件安装教程

  1. 安装: npm install dynamic-forms-plug-in
  2. 卸载: npm uninstall dynamic-forms-plug-in
  3. 直接升级: npm update dynamic-forms-plug-in

插件使用说明

  1. main.js里引入

    import myEdge from 'dynamic-forms-plug-in';//动态表单插件 import "dynamic-forms-plug-in/dist/dynamic-forms-plug-in.css"; //动态表单插件 Vue.use(myEdge);//动态表单插件

  2. vue.config.js中配置需要转译的依赖包 module.exports = { transpileDependencies: [ 'dynamic-forms-plug-in' ],

     ...}

description

  1. 打包: npm run lib
  2. 登录: npm login account:wh... password:my... email:lov...
  3. 发包: npm publish

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

组件引用

组操作 (作为单页面使用)

<addgroup @getSubFiled="getSubFiled" :columnTypeOptions="columnTypeOptions">

  1. columnTypeOptions:参数类型列表
  2. getSubFiled: 提交方法,参数为处理后的信息

新增
var url = ""; this.$router.push({ path: url, query: { } }); 编辑 var url = ""; this.$router.push({ path: url, query: { formGroup:"编辑信息",isEdit:true } });

表单操作 (作为单页面使用)

<addform @getSubFiled="getSubFiled" :columnTypeOptions="columnTypeOptions">

  1. columnTypeOptions:参数类型列表
  2. getSubFiled: 提交方法,参数为处理后的信息

新增
var url = ""; this.$router.push({ path: url, query: { } }); 编辑 var url = ""; this.$router.push({ path: url, query: { formDatas: "编辑信息",isEdit:true } });

组列表(表格形式)

<groupTable :mainList="mainList" :hasOperation="true":firstTotal="firstTotal" :headerList="headerList" @edit="edit" @handleCurrentChange="handleCurrentChange" @handleSelectionChange="handleSelectionChange">

  1. mainList:表格数据(需要和表头对应) versionList格式:[{id:"",version:""}]
  2. hasOperation:是否展示操作栏
  3. firstTotal:数据总条数
  4. headerList:表头数据 例子:[ { key: "entityName", comment: "实体名称" }, { key: "groupName", comment: "分组名称" }, { key: "versionList", comment: "历史版本" }, ]
  5. edit 编辑方法 可用于跳转 上方 组操作(row:所选行数据)
  6. handleCurrentChange 换页
  7. handleSelectionChange 多选

表单列表(表格形式,内置分配功能)

<formTable ref="formindexcomp" :mainList="mainList" :hasOperation="true" :firstTotal="firstTotal" :headerList="headerList" :dialogFormVisible="dialogFormVisible" :moduleOptions="moduleOptions" @allocation="allocation" @edit="edit" @getElementFormData="getElementFormData" @subBtnForms="subBtnForms" @diaClose="diaClose" @handleCurrentChange="handleCurrentChange" @handleSelectionChange="handleSelectionChange">

  1. mainList:表格数据(需要和表头对应) versionList格式:[{id:"",version:""}]
  2. hasOperation:是否展示操作栏
  3. firstTotal:数据总条数
  4. headerList:表头数据 例子:[ { key: "formName", comment: "表单名称" }, { key: "name", comment: "名称" }, { key: "versionList", comment: "历史版本" }, ]
  5. dialogFormVisible 分配弹窗是否开启
  6. moduleOptions 分配弹窗所属页面下拉数据
  7. allocation:分配按钮点击事件(row:所选行数据)
  8. edit 编辑方法 可用于跳转 上方 表单操作(row:所选行数据)
  9. getElementFormData 切换 表单所在页面的按钮弹窗
  10. subBtnForms 分配提交 (data,所选表单的内容)
  11. diaClose 分配弹窗关闭事件
  12. handleCurrentChange 换页
  13. handleSelectionChange多选

this.$refs.formindexcomp.handleTreecheckData();用于分配弹窗树形结构的默认选中 this.$refs.formindexcomp.handleAllocationData(); 调用 上方 allocation 方法后 需要 转换为树形结构的参数

表单展示组件 用于配置后,页面按钮展示的表单内容

  1. formDataList: 需要转换为表单的数据

this.$refs.basicForm.$refs.formFiles.validate((valid) => { if(valid){

}else{

}
})

//提交之前 调用这个代码块可以获取填写内容是否通过配置的校验

this.$refs.basicForm.subFormData() 获取表单填写的内容

添加 v-if 可以避免首次展示提示校验的问题