Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast163

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast163

a scaffold for frontend developer to develop web app based webpack,react

  • 0.0.12
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
2
Weekly downloads
 
Created
Source
创建系统,命令如下
app-scaffold-ci projectName
cd projectName
npm install
创建业务模块
分析并创建

1、分析某页业务页面需要哪些模块,比如需要两个并排的line,一个单独的table

npm run domain userDau filter line table

注:

  • 1、npm run domain 为创建页面操作
  • 2、userDau 为页面
  • 3、filter,line,table... 为该页面包含的模块
启动服务

2、启动系统本地http服务

npm start
修改

3、根据业务需求修改配置

1、布局
  • 1、分析页面布局,一个全局检索,中间是两个横排的line,最下方是一个table
  • 2、修改 【userDau】 config.json 中关于layout.modules配置,由于需求是二维布局,所以需要按照二维进行修改 解释:[[][]] 这种是二维布局
  • 3、修改结果如下:
"layout": {
    "filter": { /* 全局检索功能,默认是放在页面最上方 */
		"uuid": "test01234"
	},
    "modules": [ /* 纵向布局 */
        [ /* 横排两个line */
            {
                "uuid": "test1",
                "type": "line"
            },
            {
                "uuid": "test2",
                "type": "line"
            }
        ],
        [ /* 最下方一个table */
            {
                "uuid": "test3",
                "type": "table"
            }
        ]
    ]
}
2、修改全局检索filter
  • 1、根据 layout.filter 的 uuid 找到对应配置中的 filter 配置(config.json 的 key),比如这个 demo 是 'test01234'
  • 2、对应业务模块中的检索做配置 test01234.filter,其中
    • 1、数组顺序即为条件顺序
    • 2、key 为请求传值 key
    • 3、type 为检索条件类型,比如输入式(input),下拉式(select),下拉式又包括该条件数据是否来自来后端
    • 4、defaultValue 为默认值,选填
    • 5、label 为该条件的文案
"test01234": {
	"uuid": "test01234",
	"type": "search",
	"filter": [{
		"key": "id",
		"type": "input",
		"defaultValue": "test",
		"label": "层ID"
	},
	{
		"key": "name",
		"type": "input",
		"label": "层名称"
	},
	{
		"key": "layerlist",
		"type": "select",
		"defaultValue": "a",
		"url": "/api/domain/layer",
		"method": "get",
		"data": [{
			"id": "a",
			"name": "A"
		}],
		"label": "layerlist"
	}]
}
3、修改对应模块(line支持中,暂不写)
  • 1、根据布局中的模块 uuid 找到对应配置中的配置(config.json 的 key),比如这个 demo 是 'test3'
  • 2、修改对应的配置,其中
    • 1、basic 为该表格的基本信息,比如 请求地址,请求方式,列信息等
      • 1、url 请求地址
      • 2、method 请求方式,默认get
      • 3、columns 表格的列信息,其中
        • 1、title 列头显示名称
        • 2、width 长度/占比
        • 3、key 后端数据中 key 值
      • 4、justOpt 为操作选项,信息和 columns 一致,多一个values
        • 1、values 表示对修改和删除的开关是否打开
    • 2、filter 为局部检索,仅仅对该模块生效,优先级高于全局检索,解释和全局检索是一样的,没啥多说的
    • 3、forms 为新建和修改通用表单,和 filter 信息基本一致,在复述一遍
      • 1、key 为请求传值 key
      • 2、type 为类型,比如输入式(input),下拉式(select),下拉式又包括该条件数据是否来自来后端
      • 3、defaultValue 为默认值,选填
      • 4、label 为文案
      • 5、isMust 为该值是否为必选项
      • 6、rule 为该值的判断和提示信息
    • 4、create 为对该表格增操作的配置
      • 1、type 为操作方式,1、打开新页面(link),2、弹窗(modal)
      • 2、forms 为除通用表单之外的表单
      • 3、submit 为提交该表单的接口信息
        • 1、url 请求地址
        • 2、method 请求方式,默认post
    • 5、modify 为对该表格改操作的配置
      • 1、type 为操作方式,1、打开新页面(link),2、弹窗(modal)
      • 2、forms 为除通用表单之外的表单
      • 3、submit 为提交该表单的接口信息
        • 1、url 请求地址
        • 2、method 请求方式,默认post
    • 6、delete 为对该表格删操作的配置
      • 1、forms 为除通用表单之外的表单
      • 2、submit 为提交该表单的接口信息
        • 1、url 请求地址
        • 2、method 请求方式,默认post
"test3": {
	"uuid": "test3",
	"type": "table",
	"basic": {
		"url": "/api/62fs6ivwv7ljs6hf",
		"method": "get",
		"columns": [
			{
				"title": "ID",
				"width": 40,
				"key": "id"
			}
		],
		"justOpt": {
			"title": "操作",
			"width": 100,
			"key": "opt",
			"values": {
				"modify": true,
				"delete": false
			}
		}
	},
	"filter": [{
		"key": "id",
		"type": "input",
		"defaultValue": "test",
		"label": "层ID"
	},
	{
		"key": "name",
		"type": "input",
		"label": "层名称"
	},
	{
		"key": "layerlist",
		"type": "select",
		"defaultValue": "a",
		"url": "/api/domain/layer",
		"method": "get",
		"data": [{
			"id": "a",
			"name": "A"
		}],
		"label": "layerlist"
	},
	{
		"key": "applist",
		"type": "select",
		"url": "/api/domain/app",
		"data": [{
			"id": "b",
			"name": "B"
		}],
		"label": "applist"
	}],
	"forms": [
		{
			"key": "name",
			"type": "input",
			"defaultValue": "defname",
			"label": "名称",
			"isMust": true,
			"rule": {
				"len": 60,
				"log": "名称不能为空且不能大于60字符"
			}
		},
		{
			"key": "url",
			"type": "input",
			"defaultValue": "",
			"label": "url"
		},
		{
			"key": "zipUrl",
			"type": "input",
			"defaultValue": "",
			"label": "zipUrl"
		},
		{
			"key": "md5",
			"type": "input",
			"defaultValue": "",
			"label": "md5"
		},
		{
			"key": "desc",
			"type": "multinput",
			"defaultValue": "",
			"label": "版本描述",
			"isMust": true,
			"rule": {
				"len": 60,
				"log": "版本描述不能为空且不能大于60字符"
			}
		},
		{
			"key": "apis",
			"type": "input",
			"defaultValue": "",
			"label": "apis"
		},
		{
			"key": "layerlist",
			"type": "select",
			"defaultValue": "a",
			"url": "/api/domain/layer",
			"method": "get",
			"data": [{
				"id": "a",
				"name": "A"
			}],
			"label": "层选择"
		}
	],
	"create": {
		"type": "link",
		"submit": {
			"url": "/api/f2suwcuildaxmlz8_create",
			"method": "post"
		}
	},
	"modify": {
		"type": "link",
		"forms": [
			{
				"key": "id",
				"type": "input",
				"defaultValue": "test",
				"label": "层ID",
				"notModify": true
			}
		],
		"data": {
			"url": "/api/f2suwcuildaxmlz8_modify_data",
			"method": "get"
		},
		"submit": {
			"url": "/api/f2suwcuildaxmlz8_modify",
			"method": "post"
		}
	},
	"delete": {
		"forms": [
			{
				"key": "id",
				"label": "ID"
			}
		],
		"submit": {
			"url": "/api/62fs6ivwv7ljs6hf_delete",
			"method": "post"
		}
	}
}

Keywords

FAQs

Package last updated on 29 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc