From 7676f31de589721338f337eb0778abf9f6999229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=B2=E9=B9=8F?= Date: Mon, 1 Jun 2020 11:38:46 +0800 Subject: [PATCH 01/13] update app/model/Model.php. [2020-06-01T11:19:11+08:00][error] [10501]SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'cover_id'[E:\wwwroot\sent.feimaocms.com\vendor\topthink\think-orm\src\db\PDOConnection.php:722] --- app/model/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/model/Model.php b/app/model/Model.php index c74badcc..3f91e238 100644 --- a/app/model/Model.php +++ b/app/model/Model.php @@ -41,7 +41,7 @@ class Model extends \think\Model { 'title' => ['name' => 'title', 'title' => '标题', 'type' => 'text', 'length' => 200, 'extra' => '', 'remark' => '标题', 'is_show' => 1, 'is_must' => 1, 'value' => ''], 'category_id' => ['name' => 'category_id', 'title' => '栏目', 'type' => 'bind', 'length' => 10, 'extra' => 'category:tree', 'remark' => '栏目', 'is_show' => 1, 'is_must' => 1, 'value' => '0'], 'uid' => ['name' => 'uid', 'title' => '用户UID', 'type' => 'num', 'length' => 11, 'extra' => '', 'remark' => '用户UID', 'is_show' => 0, 'is_must' => 1, 'value' => '0'], - 'cover_id' => ['name' => 'cover_id', 'title' => '内容封面', 'type' => 'image', 'length' => 10, 'extra' => '', 'remark' => '内容封面', 'is_show' => 1, 'is_must' => 0, 'value' => ''], + 'cover_id' => ['name' => 'cover_id', 'title' => '内容封面', 'type' => 'image', 'length' => 10, 'extra' => '', 'remark' => '内容封面', 'is_show' => 1, 'is_must' => 0, 'value' => '0'], 'description' => ['name' => 'description', 'title' => '内容描述', 'type' => 'textarea', 'length' => '', 'extra' => '', 'remark' => '内容描述', 'is_show' => 1, 'is_must' => 0, 'value' => ''], 'content' => ['name' => 'content', 'title' => '内容', 'type' => 'editor', 'length' => '', 'extra' => '', 'remark' => '内容', 'is_show' => 1, 'is_must' => 0, 'value' => ''], 'status' => ['name' => 'status', 'title' => '数据状态', 'type' => 'select', 'length' => 2, 'extra' => "-1:删除\r\n0:禁用\r\n1:正常\r\n2:待审核\r\n3:草稿", 'remark' => '数据状态', 'is_show' => 1, 'is_must' => 1, 'value' => '1'], From ab40244d89ef862e7f866dd9db565185629e6881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=B2=E9=B9=8F?= Date: Tue, 2 Jun 2020 15:01:16 +0800 Subject: [PATCH 02/13] update app/model/Model.php. --- app/model/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/model/Model.php b/app/model/Model.php index c74badcc..3f91e238 100644 --- a/app/model/Model.php +++ b/app/model/Model.php @@ -41,7 +41,7 @@ class Model extends \think\Model { 'title' => ['name' => 'title', 'title' => '标题', 'type' => 'text', 'length' => 200, 'extra' => '', 'remark' => '标题', 'is_show' => 1, 'is_must' => 1, 'value' => ''], 'category_id' => ['name' => 'category_id', 'title' => '栏目', 'type' => 'bind', 'length' => 10, 'extra' => 'category:tree', 'remark' => '栏目', 'is_show' => 1, 'is_must' => 1, 'value' => '0'], 'uid' => ['name' => 'uid', 'title' => '用户UID', 'type' => 'num', 'length' => 11, 'extra' => '', 'remark' => '用户UID', 'is_show' => 0, 'is_must' => 1, 'value' => '0'], - 'cover_id' => ['name' => 'cover_id', 'title' => '内容封面', 'type' => 'image', 'length' => 10, 'extra' => '', 'remark' => '内容封面', 'is_show' => 1, 'is_must' => 0, 'value' => ''], + 'cover_id' => ['name' => 'cover_id', 'title' => '内容封面', 'type' => 'image', 'length' => 10, 'extra' => '', 'remark' => '内容封面', 'is_show' => 1, 'is_must' => 0, 'value' => '0'], 'description' => ['name' => 'description', 'title' => '内容描述', 'type' => 'textarea', 'length' => '', 'extra' => '', 'remark' => '内容描述', 'is_show' => 1, 'is_must' => 0, 'value' => ''], 'content' => ['name' => 'content', 'title' => '内容', 'type' => 'editor', 'length' => '', 'extra' => '', 'remark' => '内容', 'is_show' => 1, 'is_must' => 0, 'value' => ''], 'status' => ['name' => 'status', 'title' => '数据状态', 'type' => 'select', 'length' => 2, 'extra' => "-1:删除\r\n0:禁用\r\n1:正常\r\n2:待审核\r\n3:草稿", 'remark' => '数据状态', 'is_show' => 1, 'is_must' => 1, 'value' => '1'], From 1c920da54d42594120e1c8185d4ea3112d91cb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=B2=E9=B9=8F?= Date: Thu, 4 Jun 2020 10:12:50 +0800 Subject: [PATCH 03/13] =?UTF-8?q?update=20view/admin/model/index.html.=20?= =?UTF-8?q?=E5=9C=A8=E6=B2=A1=E6=9C=89=E5=90=AF=E7=94=A8=E8=AF=A5=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=97=B6,=E7=9B=B4=E6=8E=A5=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=AE=BF=E9=97=AE'=E6=95=B0=E6=8D=AE'=E4=BC=9A=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/admin/model/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/view/admin/model/index.html b/view/admin/model/index.html index c37f4bd2..c935ddb9 100644 --- a/view/admin/model/index.html +++ b/view/admin/model/index.html @@ -51,7 +51,12 @@ {$item['status'] ? '禁用' : '启用'} 编辑 删除 - 数据 + + {if $item['status']} + 数据 + {else} + 数据 + {/if} {/volist} From 2ff5ddeb19e90b9168c7489a24662b125658db95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=B2=E9=B9=8F?= Date: Thu, 4 Jun 2020 11:12:47 +0800 Subject: [PATCH 04/13] =?UTF-8?q?update=20app/controller/admin/Form.php.?= =?UTF-8?q?=20=E5=8E=9F=E6=9D=A5=E7=9A=84=E5=86=99=E6=B3=95=E6=98=AFtp5.0?= =?UTF-8?q?=E7=9A=84,=E7=8E=B0=E5=9C=A8=E6=98=AFtp6,=20db,setField?= =?UTF-8?q?=E7=AD=89=E5=9C=A8tp6=E4=B8=8D=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controller/admin/Form.php b/app/controller/admin/Form.php index 7c0c5ae5..81ec3861 100644 --- a/app/controller/admin/Form.php +++ b/app/controller/admin/Form.php @@ -272,7 +272,7 @@ class Form extends Base { * @author K先森 <77413254@qq.com> */ public function status() { - $id = $this->getArrayParam('id'); + $id = $this->request->param('form_id', 0); $status = input('status', '0', 'trim,intval'); if (!$id) { @@ -280,7 +280,7 @@ class Form extends Base { } $map['id'] = array('IN', $id); - $result = db('form')->where($map)->setField('status', $status); + $result = FormM::where($map)->update(['status'=>$status]); if ($result) { return $this->success("设置成功!"); } else { From 0aafe38a8da7d9c8e47c06d512c9b2ae9359a5b2 Mon Sep 17 00:00:00 2001 From: tensent Date: Sun, 12 Jul 2020 18:41:48 +0800 Subject: [PATCH 05/13] =?UTF-8?q?jsxls=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/js/main.js | 4 +- public/static/admin/js/module/form.js | 17 + public/static/common/js/require-xlsx.js | 20 +- public/static/plugins/sheetjs/cpexcel.js | 14 +- public/static/plugins/sheetjs/jszip.js | 8 +- .../static/plugins/sheetjs/xlsx.core.min.js | 31 +- .../plugins/sheetjs/xlsx.extendscript.js | 2423 ++++------------- .../static/plugins/sheetjs/xlsx.full.min.js | 34 +- public/static/plugins/sheetjs/xlsx.js | 2415 ++++------------ public/static/plugins/sheetjs/xlsx.min.js | 26 +- 10 files changed, 1241 insertions(+), 3751 deletions(-) create mode 100644 public/static/admin/js/module/form.js diff --git a/public/static/admin/js/main.js b/public/static/admin/js/main.js index ce0b6282..48a38551 100644 --- a/public/static/admin/js/main.js +++ b/public/static/admin/js/main.js @@ -26,7 +26,7 @@ require.config({ paths: { 'sent': ['common/js/sent'], 'form': ['common/js/require-form'], - 'xlsx': ['common/js/require-xlsx'], + 'xlsxs': ['common/js/require-xlsx'], 'upload': 'common/js/require-upload', 'validator': 'common/js/require-validator', 'message': ['plugins/messager/messager'], @@ -70,7 +70,7 @@ require.config({ // nanoscroller 'slimscroll': 'plugins/jquery-slimscroll/jquery.slimscroll', - 'sheetjs': ['plugins/sheetjs/xlsx.full.min'] + 'xlsx': ['plugins/sheetjs/xlsx.full.min'] }, shim: { 'message': {deps: ['jquery', 'css!'+'plugins/messager/css/style.css']}, diff --git a/public/static/admin/js/module/form.js b/public/static/admin/js/module/form.js new file mode 100644 index 00000000..033aaef9 --- /dev/null +++ b/public/static/admin/js/module/form.js @@ -0,0 +1,17 @@ +define(['jquery', 'sent', 'form', 'xlsx', 'sheetjs'], function($, sent, form, xlsx, xlsx2){ + + var formModule = { + lists: function(){ + console.log('xlsx2') + if($('.btn-out').size() > 0){ + $('.btn-out').click(function(e){ + e.preventDefault(); + var url = $(this).attr('href'); + console.log(xlsx) + }) + } + } + }; + + return formModule; +}) \ No newline at end of file diff --git a/public/static/common/js/require-xlsx.js b/public/static/common/js/require-xlsx.js index abfaec1e..be900a3c 100644 --- a/public/static/common/js/require-xlsx.js +++ b/public/static/common/js/require-xlsx.js @@ -1,5 +1,4 @@ -require(['jquery', 'sheetjs'], function($, XLSX) { - +define(['jquery', 'xlsx'], function($, xlsx) { // var wopts = { bookType: 'csv', bookSST: false, type: 'binary' };//ods格式 var wopts = { bookType: 'xlsx', bookSST: false, type: 'binary' };//这里的数据是用来定义导出的格式类型 // var wopts = { bookType: 'ods', bookSST: false, type: 'binary' };//ods格式 @@ -9,10 +8,9 @@ require(['jquery', 'sheetjs'], function($, XLSX) { var xls = { downloadExl: function (data, fileName) { - checkFileIn(); var wb = { SheetNames: ['Sheet1'], Sheets: {}, Props: {} }; - wb.Sheets['Sheet1'] = XLSX.utils.json_to_sheet(data);//通过json_to_sheet转成单页(Sheet)数据 - this.saveAs(new Blob([this.s2ab(XLSX.write(wb, wopts))], { type: "application/octet-stream" }), fileName + '.' + (wopts.bookType=="biff2"?"xls":wopts.bookType)); + wb.Sheets['Sheet1'] = xlsx.utils.json_to_sheet(data);//通过json_to_sheet转成单页(Sheet)数据 + this.saveAs(new Blob([this.s2ab(xlsx.write(wb, wopts))], { type: "application/octet-stream" }), fileName + '.' + (wopts.bookType=="biff2"?"xls":wopts.bookType)); }, //如果使用 FileSaver.js 就不要同时使用以下函数 @@ -42,18 +40,6 @@ require(['jquery', 'sheetjs'], function($, XLSX) { } }; - checkFileIn = function(){ - if($("script[src='/static/js/js-xlsx/xlsx.full.min.js']").length > 0){ - return; - }else{ - var body = $("body"); - var script = $("