|
|
@@ -0,0 +1,177 @@
|
|
|
+{
|
|
|
+ "id": "module_asYA84dpEi",
|
|
|
+ "name": "兑换码后台组件",
|
|
|
+ "type": "module",
|
|
|
+ "props": {
|
|
|
+ "expandedKeys": [
|
|
|
+ "backend_PDahQ77wBZ",
|
|
|
+ "props_Z33ebPNASi",
|
|
|
+ "bPMethod_TykwkDH7RS",
|
|
|
+ "services_HNYwNKEH3w",
|
|
|
+ "group_wxnJzZy4aj"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "children": [
|
|
|
+ {
|
|
|
+ "id": "backend_PDahQ77wBZ",
|
|
|
+ "name": "后台",
|
|
|
+ "type": "backend",
|
|
|
+ "props": {},
|
|
|
+ "children": [
|
|
|
+ {
|
|
|
+ "id": "props_Z33ebPNASi",
|
|
|
+ "type": "props",
|
|
|
+ "children": [
|
|
|
+ {
|
|
|
+ "id": "bPAttr_Yx5jwB8krp",
|
|
|
+ "type": "bPAttr",
|
|
|
+ "children": []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "bPMethod_TykwkDH7RS",
|
|
|
+ "type": "bPMethod",
|
|
|
+ "children": [
|
|
|
+ {
|
|
|
+ "id": "service_7XJCaaNJiy",
|
|
|
+ "name": "兑换码搜索服务",
|
|
|
+ "type": "service",
|
|
|
+ "props": {
|
|
|
+ "devId": "service_7XJCaaNJiy",
|
|
|
+ "isOpen": false,
|
|
|
+ "jsCode": "// 搜索服务\n\nconst emitter = new events.EventEmitter();\n\n\nlet condition = {};\n\n\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0\n? parseInt(param.当前页码) : 1;\n\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小\n> 0 ? parseInt(param.每页大小) : 10;\n\nlet list = [];\n\nlet total = 0;\n\n\nemitter.on('output', () => {\n \n list = list.map(item => {\n return item;\n })\n \n _funcCb({\n code: 200, \n errMsg: 'ok',\n result: list, \n total: total\n });\n})\n\n\nemitter.on('setCondition', () => {\n let 搜索条件 = param.搜索条件 || {};\n \n if(搜索条件.关键字) {\n condition['兑换码'] = ['like', `%${搜索条件.关键字}%`]; \n }\n \n if (搜索条件.hasOwnProperty('兑换状态')) {\n condition['兑换状态'] = 搜索条件.兑换状态;\n }\n \n if (搜索条件.hasOwnProperty('兑换码')) {\n condition['兑换码'] = 搜索条件.兑换码;\n }\n \n});\n\n\nemitter.on('getTotal', () => {\n \n _F('dbViewTemp_BjKtp3Di7c').callMethod('getCount', {\n condition,\n success: (res) => {\n emitter.emit('getList', res[0].count); \n },\n fail: (err) => {\n _funcCb({\n code: 0,\n errMsg: '获取总数失败',\n result: err,\n total: 0\n });\n }\n });\n \n});\n\n\nemitter.on('getList', (total) => {\n \n _F('dbViewTemp_BjKtp3Di7c').callMethod('getRows', {\n condition,\n pageNum,\n pageSize,\n orderby: '_update',\n sort: 'desc',\n success: (res) => {\n list = res;\n total = total;\n emitter.emit('output');\n },\n fail: (err) => {\n _funcCb({\n code: 0,\n errMsg: '获取列表失败',\n result: err,\n total: 0\n });\n }\n });\n \n});\n\n\nemitter.emit('setCondition');\n\nemitter.emit('getTotal');\n",
|
|
|
+ "inParams": [
|
|
|
+ "搜索条件",
|
|
|
+ "当前页码",
|
|
|
+ "每页大小"
|
|
|
+ ],
|
|
|
+ "outParams": [],
|
|
|
+ "openApiPath": "",
|
|
|
+ "inParamsDebug": {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "service_HEyriYsYDd",
|
|
|
+ "name": "兑换码编辑服务",
|
|
|
+ "type": "service",
|
|
|
+ "props": {
|
|
|
+ "devId": "service_HEyriYsYDd",
|
|
|
+ "isOpen": false,
|
|
|
+ "jsCode": "// 编辑服务\nconst emitter = new events.EventEmitter();\n\nif (param.hasOwnProperty('行ID') && param['行ID'] > 0) {\n emitter.emit('edit');\n} else {\n emitter.emit('noId'); \n return;\n}\n\nemitter.on('noId', () => {\n _funcCb({code: 0, errMsg: '请传入行ID', result: {}});\n});\n\nemitter.on('edit', () => {\n \n let condition = {};\n condition['_id'] = param.行ID;\n \n let updateObj = {};\n \n if(param.hasOwnProperty('兑换码')) {\n updateObj['兑换码'] = param.兑换码; \n }\n \n if(param.hasOwnProperty('兑换状态')) {\n updateObj['兑换状态'] = param.兑换状态; \n }\n \n if(param.hasOwnProperty('批次ID')) {\n updateObj['批次ID'] = param.批次ID; \n }\n \n if(param.hasOwnProperty('兑换结果')) {\n updateObj['兑换结果'] = param.兑换结果; \n }\n \n _F('dbTableTemp_cryyss64wp').callMethod('editRow', {\n row: updateObj,\n condition,\n success: () => {\n _funcCb({code: 200, errMsg: '编辑成功', result: {}});\n },\n fail: (err) => {\n // 编辑失败\n _funcCb({code: 0, errMsg: '编辑失败', result: err});\n }\n });\n \n});\n\nemitter.emit('edit');\n",
|
|
|
+ "inParams": [
|
|
|
+ "兑换码",
|
|
|
+ "兑换状态",
|
|
|
+ "批次ID",
|
|
|
+ "兑换结果"
|
|
|
+ ],
|
|
|
+ "outParams": [],
|
|
|
+ "openApiPath": "",
|
|
|
+ "inParamsDebug": {
|
|
|
+ "批次ID": "",
|
|
|
+ "兑换码": "",
|
|
|
+ "兑换状态": "",
|
|
|
+ "兑换结果": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "service_8BYpSxRD3x",
|
|
|
+ "name": "兑换码新增服务",
|
|
|
+ "type": "service",
|
|
|
+ "props": {
|
|
|
+ "devId": "service_8BYpSxRD3x",
|
|
|
+ "isOpen": false,
|
|
|
+ "jsCode": "// 新增服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('add', () => {\n \n let insertObj = {\n 兑换码:param.兑换码, \n 兑换状态:0, \n 批次ID:param.批次ID, \n 兑换结果:param.兑换结果, \n };\n \n _F('dbTableTemp_cryyss64wp').callMethod('addRow', {\n row: insertObj,\n success: () => {\n _funcCb({code: 200, errMsg: '新增成功', result: {}});\n },\n fail: (err) => {\n // 新增失败\n _funcCb({code: 0, errMsg: '新增失败', result: err});\n }\n });\n \n});\n\nemitter.emit('add');\n",
|
|
|
+ "inParams": [
|
|
|
+ "兑换码",
|
|
|
+ "兑换状态",
|
|
|
+ "批次ID",
|
|
|
+ "兑换结果"
|
|
|
+ ],
|
|
|
+ "outParams": [],
|
|
|
+ "openApiPath": "",
|
|
|
+ "inParamsDebug": {
|
|
|
+ "批次ID": "",
|
|
|
+ "兑换码": "",
|
|
|
+ "兑换状态": "",
|
|
|
+ "兑换结果": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "state_NQxscsS2EP",
|
|
|
+ "type": "state",
|
|
|
+ "children": []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "services_HNYwNKEH3w",
|
|
|
+ "type": "services",
|
|
|
+ "children": [
|
|
|
+ {
|
|
|
+ "id": "group_wxnJzZy4aj",
|
|
|
+ "name": "数据表",
|
|
|
+ "type": "group",
|
|
|
+ "props": {
|
|
|
+ "devId": "group_wxnJzZy4aj"
|
|
|
+ },
|
|
|
+ "children": [
|
|
|
+ {
|
|
|
+ "id": "dbTableTemp_cryyss64wp",
|
|
|
+ "name": "兑换码表",
|
|
|
+ "type": "dbTableTemp",
|
|
|
+ "props": {
|
|
|
+ "devId": "dbTableTemp_cryyss64wp",
|
|
|
+ "fields": [
|
|
|
+ {
|
|
|
+ "columnName": "_id",
|
|
|
+ "columnType": "int unsigned"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "columnName": "兑换码",
|
|
|
+ "columnType": "varchar(100)"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "columnName": "兑换状态",
|
|
|
+ "columnType": "int"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "columnName": "批次ID",
|
|
|
+ "columnType": "int"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "columnName": "兑换结果",
|
|
|
+ "columnType": "varchar(500)"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "columnName": "_create",
|
|
|
+ "columnType": "bigint unsigned"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "columnName": "_update",
|
|
|
+ "columnType": "bigint unsigned"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "dbViewTemp_BjKtp3Di7c",
|
|
|
+ "name": "兑换码+批次视图",
|
|
|
+ "type": "dbViewTemp",
|
|
|
+ "props": {}
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": "modules_RydscackjD",
|
|
|
+ "type": "modules",
|
|
|
+ "children": []
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|