From 39dc31cb8d714f417feb03773175fd57395cea4e Mon Sep 17 00:00:00 2001 From: zhoubichuan Date: Sat, 16 Dec 2023 20:35:58 +0800 Subject: [PATCH] =?UTF-8?q?tab=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/index.js | 2 +- routes/ruleModel7.js | 2 +- tab/1.json | 47 ++++++++++++++++++++ tab/2.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/3.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/4.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/5.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/6.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/7.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/8.json | 101 +++++++++++++++++++++++++++++++++++++++++++ tab/index.js | 9 ++++ 11 files changed, 765 insertions(+), 2 deletions(-) create mode 100644 tab/1.json create mode 100644 tab/2.json create mode 100644 tab/3.json create mode 100644 tab/4.json create mode 100644 tab/5.json create mode 100644 tab/6.json create mode 100644 tab/7.json create mode 100644 tab/8.json create mode 100644 tab/index.js diff --git a/model/index.js b/model/index.js index d54b91d..04f5ccc 100644 --- a/model/index.js +++ b/model/index.js @@ -189,7 +189,7 @@ const fieldTypes = { object: Object, }; const target = {}; -let targetArray = ["field", "type", "data", "template", "backend"]; +let targetArray = ["field", "type", "data", "template", "backend", "tab"]; for (let i = 0;i < targetArray.length;i++) { let item = targetArray[i]; diff --git a/routes/ruleModel7.js b/routes/ruleModel7.js index 0433903..37463f7 100644 --- a/routes/ruleModel7.js +++ b/routes/ruleModel7.js @@ -2,7 +2,7 @@ var Models = require("../model/index"); let express = require("express"); let xlsx = require('node-xlsx') let router = express.Router(); -["field", "type", "data", "template", "backend"].forEach((item) => { +["field", "type", "data", "template", "backend", "tab"].forEach((item) => { let templateData = require("../" + item); let getFileds = (key, state, data) => { let jsonArray = templateData[key + ".json"]; diff --git a/tab/1.json b/tab/1.json new file mode 100644 index 0000000..ad21b2e --- /dev/null +++ b/tab/1.json @@ -0,0 +1,47 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/2.json b/tab/2.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/2.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/3.json b/tab/3.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/3.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/4.json b/tab/4.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/4.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/5.json b/tab/5.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/5.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/6.json b/tab/6.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/6.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/7.json b/tab/7.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/7.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/8.json b/tab/8.json new file mode 100644 index 0000000..6d738ab --- /dev/null +++ b/tab/8.json @@ -0,0 +1,101 @@ +[ + { + "add": false, + "delete": false, + "edit": false, + "view": true, + "name": "id", + "type": "string", + "addDefault": "0000001" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "name", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "add", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "delete", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "edit", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "view", + "type": "boolean", + "addDefault": true + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "type", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "addDefault", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "remark", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "createdAt", + "type": "string", + "addDefault": "" + }, + { + "add": true, + "delete": true, + "edit": true, + "view": true, + "name": "updatedAt", + "type": "string", + "addDefault": "" + } +] diff --git a/tab/index.js b/tab/index.js new file mode 100644 index 0000000..fb77ee1 --- /dev/null +++ b/tab/index.js @@ -0,0 +1,9 @@ +const fs = require('fs') +const files = fs.readdirSync(__dirname) +let routes = {} +for (file of files) { + if (file !== 'index.js') { + routes[file] = require('./' + file) + } +} +module.exports = routes