摘要: laravel 查询构建器 $query=DB::connection($conn)->table($table) ->select('*', DB::raw("CONCAT(date,' ',time) AS dttm")) ->where('P', $p) ->whereIn('status', 阅读全文
posted @ 2022-11-19 10:47 carol2014 阅读(34) 评论(0) 推荐(0)
摘要: 宏指令允许添加自定义功能到 Laravel 的内部组件里去,需要在 App\Providers\AppServiceProvider 的 boot() 方法中注册宏指令。 Request // 注册 Request::macro('introduce', function ($name) { ret 阅读全文
posted @ 2022-11-19 10:43 carol2014 阅读(358) 评论(0) 推荐(0)
摘要: 安装代码包 composer require maatwebsite/excel 导出多个 sheet // ExportMulSheets.php namespace App\Exports; use Maatwebsite\Excel\Concerns\Exportable; use Maatw 阅读全文
posted @ 2022-11-19 10:28 carol2014 阅读(489) 评论(0) 推荐(0)
摘要: JSZIP 的 github 地址:https://github.com/Stuk/jszip 多个 echarts 图一键下载 charts_all.map(([index, myChart]) => { const imgContent = myChart.getDataURL({ type: 阅读全文
posted @ 2022-11-19 10:21 carol2014 阅读(116) 评论(0) 推荐(0)
摘要: 使用 FileReader 读取 csv 档 <script> function readCsv(elem) { const file = elem.files[0]; if (file.type != "text/csv") { alert("文件类型错误"); return; } var rea 阅读全文
posted @ 2022-11-19 10:16 carol2014 阅读(944) 评论(0) 推荐(0)
摘要: 闲来无事,总结下 jquery ajax 的常用方法 <div> <span>1</span> <span>2</span> <span>3</span> </div> <div id="container"></div> <input type="file" id="upload" /> <br 阅读全文
posted @ 2022-11-19 10:15 carol2014 阅读(27) 评论(0) 推荐(0)
摘要: xlsx的github地址:https://github.com/SheetJS/sheetjs <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <script src="jquery/jquery-1.9.1.min.js"></scr 阅读全文
posted @ 2022-11-19 10:12 carol2014 阅读(157) 评论(0) 推荐(0)
摘要: 有些场景需要生成 pdf 文件,然而多数情况下对 pdf 文件的格式内容都有要求,因此研究下由 html 生成 pdf 的组件,找到了 jspdf 和 html2pdf 这两种,而 html2pdf 是基于 jspdf 的。 jspdf 2.5.1 html2canvas 1.4.1 html2pd 阅读全文
posted @ 2022-11-19 10:03 carol2014 阅读(1295) 评论(0) 推荐(0)
摘要: 几种常见的 Content-Type 类型 application/x-www-form-urlencoded 数据会转换为键值对并按照 key1=val1&key2=val2 的方式进行编码,key 和 val 都进行了 URL 转码。 multipart/form-data(带文件提交) 将表单 阅读全文
posted @ 2022-11-19 09:56 carol2014 阅读(187) 评论(0) 推荐(0)
摘要: 用到树形组件,研究记录下 zTree 常用用法 <!DOCTYPE html> <html> <head> <title>ZTREE DEMO</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 阅读全文
posted @ 2022-11-19 09:54 carol2014 阅读(110) 评论(0) 推荐(0)