diff --git a/code/makecode.go b/code/makecode.go index a2921d3..ecda328 100644 --- a/code/makecode.go +++ b/code/makecode.go @@ -403,26 +403,29 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB) { if oldTableName == "parent" { oldTableName = fk } + //如果本身匹配则不再继续精简匹配 + if that.TableConfig[oldTableName] == nil { - //如果依然找不到则查询system_org是否存在 - if that.TableConfig[DefaultMenuParentName+"_"+oldTableName] != nil { - oldTableName = DefaultMenuParentName + "_" + oldTableName - } + //如果依然找不到则查询system_org是否存在 + if that.TableConfig[DefaultMenuParentName+"_"+oldTableName] != nil { + oldTableName = DefaultMenuParentName + "_" + oldTableName + } - //字段有动词前缀,自动进行解析 - prefixColumn := strings.Index(oldTableName, "_") + //字段有动词前缀,自动进行解析 + prefixColumn := strings.Index(oldTableName, "_") - //sys_org_id oldTableName即为sys此处判断为org表存在 + //sys_org_id oldTableName即为sys此处判断为org表存在 - if prefixColumn > -1 && that.TableConfig[oldTableName[prefixColumn+1:]] != nil { - oldTableName = oldTableName[prefixColumn+1:] - } - if prefixColumn >= len(oldTableName) { - prefixColumn = -1 - } - //如果依然找不到则查询system_org是否存在 - if prefixColumn > -1 && that.TableConfig[DefaultMenuParentName+"_"+oldTableName[prefixColumn+1:]] != nil { - oldTableName = DefaultMenuParentName + "_" + oldTableName[prefixColumn+1:] + if prefixColumn > -1 && that.TableConfig[oldTableName[prefixColumn+1:]] != nil { + oldTableName = oldTableName[prefixColumn+1:] + } + if prefixColumn >= len(oldTableName) { + prefixColumn = -1 + } + //如果依然找不到则查询system_org是否存在 + if prefixColumn > -1 && that.TableConfig[DefaultMenuParentName+"_"+oldTableName[prefixColumn+1:]] != nil { + oldTableName = DefaultMenuParentName + "_" + oldTableName[prefixColumn+1:] + } } //普通方式查询不到,则转换为大型项目模块划分,暂时只支持一级模块划分, @@ -571,7 +574,12 @@ func (that *MakeCode) Add(table string, req *http.Request) Map { if v.Get("add") == nil || v.GetBool("add") { if len(req.Form[v.GetString("name")]) == 0 { - return nil + if v.GetBool("must") { + return nil + } else { + continue + } + } reqValue := req.FormValue(v.GetString("name")) if (reqValue == "" || reqValue == "null") && strings.Contains(v.GetString("name"), "id") { @@ -680,6 +688,11 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db * hasUser = true } + reqValue := req.FormValue(v.GetString("name")) + if reqValue != "" { + data[table+"."+v.GetString("name")] = reqValue + } + } else { reStr += table + "." + v.GetString("name") + "," } diff --git a/example/config/app.json b/example/config/app.json index a8b816e..2c054c2 100644 --- a/example/config/app.json +++ b/example/config/app.json @@ -1,5 +1,5 @@ { - "id": "ede7cc05f2e6c63b4572883f4b9a9853", + "id": "a549346388b58195866106b5f2072b26", "label": "HoTime管理平台", "menus": [ { @@ -7,17 +7,40 @@ "label": "平台首页", "name": "HelloWorld" }, + { + "icon": "el-icon-setting", + "label": "生产成品", + "menus": [ + { + "label": "生产成品", + "table": "produce_product" + }, + { + "label": "生产计划", + "table": "produce" + }, + { + "label": "消耗原材料", + "table": "produce_material" + }, + { + "label": "生产计划", + "table": "produce" + } + ], + "name": "sys:produce" + }, { "icon": "el-icon-setting", "label": "系统管理", "menus": [ { - "label": "角色管理", - "table": "role" + "label": "客户管理", + "table": "user" }, { - "label": "群众管理", - "table": "user" + "label": "部门管理", + "table": "org" }, { "label": "人员管理", @@ -28,19 +51,61 @@ "table": "category" }, { - "label": "排号计划", - "table": "ctg_order_date" + "label": "角色管理", + "table": "role" }, { - "label": "预约管理", - "table": "order" - }, - { - "label": "部门管理", - "table": "org" + "label": "炉温监控", + "table": "furnace_temperature" } ], "name": "sys" + }, + { + "icon": "el-icon-setting", + "label": "抽检管理", + "menus": [ + { + "label": "抽检管理", + "table": "product_spot_check" + }, + { + "label": "成品管理", + "table": "product" + }, + { + "label": "质检管理", + "table": "product_check" + }, + { + "label": "产线管理", + "table": "product_line" + }, + { + "label": "成品管理", + "table": "product" + } + ], + "name": "sys:product" + }, + { + "icon": "el-icon-setting", + "label": "原材料管理", + "menus": [ + { + "label": "原材料管理", + "table": "material" + }, + { + "label": "出入库管理", + "table": "material_inout" + }, + { + "label": "原材料管理", + "table": "material" + } + ], + "name": "sys:material" } ], "name": "admin", @@ -284,126 +349,7 @@ "type": "select" }, { - "label": "周一上午", - "name": "am1", - "sortable": true, - "type": "number" - }, - { - "label": "周二上午", - "name": "am2", - "sortable": true, - "type": "number" - }, - { - "label": "周三上午", - "name": "am3", - "sortable": true, - "type": "number" - }, - { - "label": "周四上午", - "name": "am4", - "sortable": true, - "type": "number" - }, - { - "label": "周五上午", - "name": "am5", - "sortable": true, - "type": "number" - }, - { - "label": "周一下午", - "name": "pm1", - "sortable": true, - "type": "number" - }, - { - "label": "周二下午", - "name": "pm2", - "sortable": true, - "type": "number" - }, - { - "label": "周三下午", - "name": "pm3", - "sortable": true, - "type": "number" - }, - { - "label": "周四下午", - "name": "pm4", - "sortable": true, - "type": "number" - }, - { - "label": "周五下午", - "name": "pm5", - "sortable": true, - "type": "number" - }, - { - "label": "办理地址", - "list": false, - "must": false, - "name": "address", - "type": "text" - }, - { - "label": "叫号起始号", - "name": "startnum", - "sortable": true, - "type": "number" - }, - { - "label": "办理窗口", - "name": "window", - "type": "text" - }, - { - "label": "天府通办APP端", - "must": true, - "name": "tftbapp", - "options": [ - { - "name": "未启用", - "value": "0" - }, - { - "name": "已启用", - "value": "1" - } - ], - "sortable": true, - "type": "select" - }, - { - "label": "天府通办web端", - "must": true, - "name": "tftbweb", - "options": [ - { - "name": "未启用", - "value": "0" - }, - { - "name": "已启用", - "value": "1" - } - ], - "sortable": true, - "type": "select" - }, - { - "label": "图标", - "list": false, - "must": false, - "name": "icon", - "type": "image" - }, - { - "label": "关联部门", + "label": "部门", "link": "org", "name": "org_id", "sortable": true, @@ -442,50 +388,6 @@ "type": "search", "value": null }, - { - "label": "天府通办APP端", - "must": true, - "name": "tftbapp", - "options": [ - { - "name": "未启用", - "value": "0" - }, - { - "name": "已启用", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "sortable": true, - "type": "select", - "value": null - }, - { - "label": "天府通办web端", - "must": true, - "name": "tftbweb", - "options": [ - { - "name": "未启用", - "value": "0" - }, - { - "name": "已启用", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "sortable": true, - "type": "select", - "value": null - }, { "label": "状态", "list": false, @@ -520,7 +422,7 @@ "value": "name" }, { - "label": "关联部门", + "label": "部门", "link": "org", "name": "org_id", "type": "tree", @@ -529,7 +431,7 @@ ], "table": "category" }, - "ctg_order_date": { + "furnace_temperature": { "auth": [ "add", "delete", @@ -547,10 +449,22 @@ "type": "number" }, { - "label": "名称", + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "日期", "name": "name", "type": "text" }, + { + "label": "炉温照片", + "list": false, + "must": false, + "name": "img", + "type": "image" + }, { "add": false, "edit": false, @@ -590,38 +504,15 @@ "type": "select" }, { - "label": "预约日期", - "name": "date", - "type": "time" - }, - { - "label": "排号起始数", - "name": "start_sn", - "sortable": true, - "type": "number" - }, - { - "label": "排号结束号", - "name": "max_sn", - "sortable": true, - "type": "number" - }, - { - "label": "当前排号", - "name": "now_sn", - "sortable": true, - "type": "number" - }, - { - "label": "类别", - "link": "category", - "name": "category_id", + "label": "产线", + "link": "product_line", + "name": "product_line_id", "sortable": true, "type": "number", "value": "name" } ], - "label": "排号计划", + "label": "炉温监控", "search": [ { "label": "请输入关键词", @@ -666,18 +557,11 @@ ], "type": "select", "value": null - }, - { - "label": "类别", - "link": "category", - "name": "category_id", - "type": "tree", - "value": "name" } ], - "table": "ctg_order_date" + "table": "furnace_temperature" }, - "order": { + "material": { "auth": [ "add", "delete", @@ -695,113 +579,140 @@ "type": "number" }, { - "label": "预约时间", + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "原材料名称", "name": "name", "type": "text" }, { - "add": false, - "edit": false, - "label": "创建时间", + "label": "图片", "list": false, "must": false, - "name": "create_time", - "type": "time" + "name": "img", + "type": "image" }, { - "add": false, - "edit": false, - "label": "变更时间", - "must": false, - "name": "modify_time", - "type": "time" - }, - { - "label": "状态", - "list": false, - "must": true, - "name": "state", - "options": [ - { - "name": "已启用", - "value": "0" - }, - { - "name": "未启用", - "value": "1" - }, - { - "name": "异常", - "value": "2" - } - ], - "type": "select" - }, - { - "label": "预约用户", - "link": "user", - "name": "user_id", - "sortable": true, - "type": "number", - "value": "name" - }, - { - "label": "预约日期", - "name": "date", - "type": "time" - }, - { - "label": "排号", - "name": "sn", + "label": "当前数量", + "name": "count", "sortable": true, "type": "number" }, { - "label": "预约分类", - "link": "category", - "name": "category_id", + "label": "总消耗数", + "name": "used", "sortable": true, - "type": "number", - "value": "name" + "type": "number" }, { - "label": "预约状态", - "must": true, - "name": "status", - "options": [ - { - "name": "待分配", - "value": "0" - }, - { - "name": "待办结", - "value": "1" - }, - { - "name": "已办结", - "value": "2" - }, - { - "name": "已逾期", - "value": "3" - }, - { - "name": "异常", - "value": "4" - } - ], - "type": "select" + "label": "总存储数", + "name": "saved", + "sortable": true, + "type": "number" }, { - "label": "办事员", + "label": "默认添加数量", + "name": "num", + "sortable": true, + "type": "number" + }, + { + "label": "经办人", "link": "admin", "name": "admin_id", "sortable": true, "type": "number", "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "基本信息", + "list": false, + "must": false, + "name": "rule", + "type": "form" + }, + { + "label": "有效期", + "must": true, + "name": "validity", + "options": [ + { + "name": "半年", + "value": "0" + }, + { + "name": "一年", + "value": "1" + }, + { + "name": "两年", + "value": "2" + }, + { + "name": "三年", + "value": "3" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "识别数据", + "list": false, + "must": false, + "name": "content", + "type": "text" + }, + { + "label": "备注信息", + "list": false, + "must": false, + "name": "description", + "type": "text" } ], - "label": "预约管理", + "label": "原材料管理", "search": [ { "label": "请输入关键词", @@ -821,39 +732,6 @@ "type": "search", "value": null }, - { - "label": "预约状态", - "must": true, - "name": "status", - "options": [ - { - "name": "待分配", - "value": "0" - }, - { - "name": "待办结", - "value": "1" - }, - { - "name": "已办结", - "value": "2" - }, - { - "name": "已逾期", - "value": "3" - }, - { - "name": "异常", - "value": "4" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "状态", "list": false, @@ -881,14 +759,211 @@ "value": null }, { - "label": "预约分类", - "link": "category", - "name": "category_id", - "type": "tree", - "value": "name" + "label": "有效期", + "must": true, + "name": "validity", + "options": [ + { + "name": "半年", + "value": "0" + }, + { + "name": "一年", + "value": "1" + }, + { + "name": "两年", + "value": "2" + }, + { + "name": "三年", + "value": "3" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null } ], - "table": "order" + "table": "material" + }, + "material_inout": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "图片", + "list": false, + "must": false, + "name": "img", + "type": "image" + }, + { + "label": "出入库数量", + "name": "count", + "sortable": true, + "type": "number" + }, + { + "label": "剩余数量", + "name": "saved", + "sortable": true, + "type": "number" + }, + { + "label": "对应原材料", + "link": "material", + "name": "material_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "经办人", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "入库", + "value": "0" + }, + { + "name": "出库", + "value": "1" + }, + { + "name": "退货", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "基础信息", + "list": false, + "must": false, + "name": "rule", + "type": "form" + }, + { + "label": "关联生产计划", + "link": "produce", + "name": "produce_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "识别信息", + "list": false, + "must": false, + "name": "content", + "type": "text" + }, + { + "label": "备注信息", + "list": false, + "must": false, + "name": "description", + "type": "text" + } + ], + "label": "出入库管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "入库", + "value": "0" + }, + { + "name": "出库", + "value": "1" + }, + { + "name": "退货", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "material_inout" }, "org": { "auth": [ @@ -1040,6 +1115,1104 @@ ], "table": "org" }, + "produce": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "二维码起始编码", + "name": "sn", + "type": "text" + }, + { + "label": "计划名", + "name": "name", + "type": "text" + }, + { + "label": "对应成品", + "link": "product", + "name": "product_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "经办人", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "客户", + "link": "user", + "name": "user_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "开始时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "生产状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已完成", + "value": "0" + }, + { + "name": "待生产", + "value": "1" + }, + { + "name": "生产中", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "计划生产总量", + "name": "count", + "sortable": true, + "type": "number" + }, + { + "label": "当前已生产", + "name": "now", + "sortable": true, + "type": "number" + }, + { + "label": "计划完成时间", + "name": "finish_time", + "type": "time" + }, + { + "label": "其他规则", + "list": false, + "must": false, + "name": "rule", + "type": "form" + }, + { + "label": "抽检覆盖量", + "name": "spot_check_count", + "sortable": true, + "type": "number" + }, + { + "label": "发货抽检总覆盖量", + "name": "spot_check_used", + "sortable": true, + "type": "number" + }, + { + "label": "总抽检总覆盖量", + "name": "spot_check_saved", + "sortable": true, + "type": "number" + } + ], + "label": "生产计划", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "生产状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已完成", + "value": "0" + }, + { + "name": "待生产", + "value": "1" + }, + { + "name": "生产中", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "produce" + }, + "produce_material": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "原材料", + "link": "material", + "name": "material_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "计划使用数量", + "name": "count", + "sortable": true, + "type": "number" + }, + { + "label": "已使用数量", + "name": "used", + "sortable": true, + "type": "number" + }, + { + "label": "生产计划", + "link": "produce", + "name": "produce_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "生产状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "经办人", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "消耗原材料", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "生产状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "produce_material" + }, + "produce_product": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "成品", + "link": "product", + "name": "product_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "生产计划", + "link": "produce", + "name": "produce_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "生产状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "炉温", + "link": "furnace_temperature", + "name": "furnace_temperature_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "生产线", + "link": "product_line", + "name": "product_line_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "生产成品", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "生产状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "produce_product" + }, + "product": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "成品名称", + "name": "name", + "type": "text" + }, + { + "label": "图片", + "list": false, + "must": false, + "name": "img", + "type": "image" + }, + { + "label": "当前数量", + "name": "count", + "sortable": true, + "type": "number" + }, + { + "label": "总发货量", + "name": "used", + "sortable": true, + "type": "number" + }, + { + "label": "总生产量", + "name": "saved", + "sortable": true, + "type": "number" + }, + { + "label": "抽检覆盖量", + "name": "spot_check_count", + "sortable": true, + "type": "number" + }, + { + "label": "发货抽检总覆盖量", + "name": "spot_check_used", + "sortable": true, + "type": "number" + }, + { + "label": "总抽检总覆盖量", + "name": "spot_check_saved", + "sortable": true, + "type": "number" + }, + { + "label": "经办人", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "抽检参数", + "list": false, + "must": false, + "name": "rule_spot_check", + "type": "form" + }, + { + "label": "抽检百分比", + "list": false, + "must": false, + "name": "spot_check_percentage", + "sortable": true, + "type": "number" + }, + { + "label": "质检参数", + "list": false, + "must": false, + "name": "rule_check", + "type": "form" + } + ], + "label": "成品管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "product" + }, + "product_check": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "图片", + "list": false, + "must": false, + "name": "img", + "type": "image" + }, + { + "label": "生产成品", + "link": "produce_product", + "name": "produce_product_id", + "sortable": true, + "type": "number", + "value": "sn" + }, + { + "label": "经办人", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "质检结论", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "基本信息", + "list": false, + "must": false, + "name": "rule", + "type": "form" + }, + { + "label": "生产计划", + "link": "produce", + "name": "produce_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "成品名称", + "link": "product", + "name": "product_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "备注信息", + "list": false, + "must": false, + "name": "description", + "type": "text" + } + ], + "label": "质检管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "质检结论", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "product_check" + }, + "product_line": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "扫码枪ip地址", + "name": "ipaddr", + "type": "text" + } + ], + "label": "产线管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "product_line" + }, + "product_spot_check": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "must": false, + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "SN", + "name": "sn", + "type": "text" + }, + { + "label": "图片", + "list": false, + "must": false, + "name": "img", + "type": "image" + }, + { + "label": "成品", + "link": "product", + "name": "product_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "经办人", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "must": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "must": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "抽检结论", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "基本信息", + "list": false, + "must": false, + "name": "rule", + "type": "form" + }, + { + "label": "生产计划", + "link": "produce", + "name": "produce_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "生产成品", + "link": "produce_product", + "name": "produce_product_id", + "sortable": true, + "type": "number", + "value": "sn" + }, + { + "label": "备注信息", + "list": false, + "must": false, + "name": "description", + "type": "text" + } + ], + "label": "抽检管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "抽检结论", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "其他", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "product_spot_check" + }, "role": { "auth": [ "add", @@ -1102,8 +2275,10 @@ }, { "label": "规则", + "list": false, + "must": false, "name": "rule", - "type": "text" + "type": "form" } ], "label": "角色管理", @@ -1173,7 +2348,7 @@ "type": "number" }, { - "label": "编号", + "label": "SN", "name": "sn", "type": "text" }, @@ -1182,6 +2357,11 @@ "name": "name", "type": "text" }, + { + "label": "公司名称", + "name": "company", + "type": "text" + }, { "label": "手机号码", "name": "phone", @@ -1191,7 +2371,7 @@ "label": "邮箱", "list": false, "must": false, - "name": "idcard", + "name": "email", "type": "text" }, { @@ -1240,7 +2420,7 @@ "type": "time" } ], - "label": "群众管理", + "label": "客户管理", "search": [ { "label": "请输入关键词", @@ -1290,4 +2470,4 @@ "table": "user" } } -} \ No newline at end of file +} diff --git a/example/tpt/file/2021/12/27/a24a4bc4d8f4947de0eed6bcf9b7186c.jpg b/example/tpt/file/2021/12/27/a24a4bc4d8f4947de0eed6bcf9b7186c.jpg new file mode 100644 index 0000000..ebd3817 Binary files /dev/null and b/example/tpt/file/2021/12/27/a24a4bc4d8f4947de0eed6bcf9b7186c.jpg differ