Download the PHP package tiderjian/qs-grid-import without Composer

On this page you can find all versions of the php package tiderjian/qs-grid-import. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package qs-grid-import

介绍

在实际项目中,经常能遇到用户想用excel导入数据的场景。而通过excel编辑的数据很难控制数据的准确性和规范性。 而Grid-import要求用户先将excel数据导入系统,系统会自动转换出对应的web表格数据,让用户编辑和查看对应的出错提示,提交导入系统。 从而将不可控数据转变成可控的过程。

特点

安装

截图

将excel数据转换成web grid

导入出错错误提示

错误提示2

导入成功,确定跳转

用法

定义表格配置

列类型

  1. CellType::INPUT 单行输入框

  2. CellType::DATE 日期 (格式: 2021-06-17)

  3. CellType::INPUTNUMBER 数字

  4. CellType::SELECT 下拉选择

    类型为下拉选择是,配置值必须设置 options 下拉值,格式为键值对的数组

PS. 除INPUT类型外,其余类型都在提交时会对提交值分别进行类型有效性验证

  1. CellType::MULTI_SELECT 多选

    设置方法同 CellType::SELECT 唯一的区别是excel是文本输入类型,以半角英文逗号分隔

    独有设置 ignore

  2. CellType::DATETIME 日期+时间(格式: 2021-06-17 12:30:30)

是否必填

支持2种设置类型

  1. 布尔值

    true表示必填,false表示非必填,默认为false

  2. 闭包函数

    可通过该机制动态决定是否为必填项

    1. 第一个参数为该单元格值
    2. 第二个参数为该行的所有值

验证回调

仅支持闭包函数,接受两个参数, 返回true表示验证通过,返回字符串表示验证不通过,同时表示不通过原因

  1. 第一个参数为该单元格值
  2. 第二个参数为该行的所有值

子母表

子母表用于处理多层的数据导入情况,如用户需要在一个excel中,录入不同sheet数据,而不同sheet之间存在数据关联的情形。

举例: 一个项目,下面还存在不同的团队需要录入时,此时就可以通过设置二级子母表来一次完成项目和团队的数据导入

导入excel表格,生成grid web表格

下面是前端页面代码

完成这步,就可以看到导入的数据已经转换成web表格,确认没错后可点击提交

grid数据提交处理

异步导入

前端组件配置

后端地址配置

导入中处理异常,返回异常记录

业务场景:导入数据,如需请求第三方API,当网络异常或者API请求返回错误,需要将异常情况返回给用户

导出excel错误信息

前端组件配置


All versions of qs-grid-import with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
phpoffice/phpspreadsheet Version ^1.10
tiderjian/qs-excel Version ^1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tiderjian/qs-grid-import contains the following files

Loading the files please wait ....