Files
ZERO_CODE/ZeroCodeProject/main/client/node_modules/.cache/babel-loader/f062b9a0039f8a5fa0ffcdabcf665d1ab612e59b42be3ce19cbe3217577c3032.json

1 line
37 KiB
JSON
Raw Normal View History

2026-01-11 00:11:34 +08:00
{"ast":null,"code":"import axios from \"axios\";\nlet axios_config = require(\"./config\");\nconst components = {};\nconst props = [\"tabs\", \"activetab\"];\nconst data = function () {\n return {\n tableData: [{\n name: \"ni\",\n pwd: \"233\"\n }],\n column: [{\n label: \"名称\",\n field_name: \"name\",\n type: \"input\"\n }, {\n label: \"密码\",\n field_name: \"pwd\",\n type: \"select\"\n }],\n search: {},\n //搜索输入内容存储\n dialogTableVisible1: false,\n //显示新增弹窗控制变量\n dialogform: {\n uuid: \"sss\"\n },\n component_name: \"index\",\n form: {\n name: \"xbc\"\n },\n all_selections: [],\n activeName: \"1\",\n filtername: \"\",\n now_selection_record: \"\",\n selections: [],\n ids: [],\n // 总条数,根据接口获取数据长度(注意:这里不能为空)\n totalCount: 1,\n // 个数选择器(可修改)\n pageSizes: [8, 16],\n // 默认每页显示的条数(可修改)\n PageSize: 8,\n currentPage: 1\n };\n};\nfunction mounted() {\n const {\n url,\n method,\n data: originalData,\n then\n } = axios_config.mounted.axios;\n const data = JSON.parse(JSON.stringify(originalData));\n let new_data = this.get_config_data(data);\n new_data[\"submit_data\"][\"user_token\"] = sessionStorage.getItem(\"user\");\n // 发起请求\n axios({\n method,\n url,\n data: new_data\n }).then(res => {\n // 执行回调函数then回调\n eval(then);\n });\n}\nconst methods = {\n fresh_data(val) {\n if (val) {\n this.tableData = val;\n this.totalCount = val.length;\n }\n },\n handlePageSizeChange(val) {\n // 改变每页显示的条数\n this.PageSize = val;\n // 注意:在改变每页显示的条数时,要将页码显示到第一页\n this.currentPage = 1;\n },\n handlePageChange(val) {\n // 改变默认的页数\n this.currentPage = val;\n },\n // tabs的方法控制\n get_config_data(config_data) {\n console.log(config_data);\n // 执行转译data\n let new_data = {\n \"interaction_name\": config_data[\"interaction_name\"],\n \"return_data\": config_data[\"return_data\"],\n \"submit_data\": {\n \"interaction_source_name\": config_data[\"submit_data\"][\"interaction_source_name\"],\n \"interaction_source_uuid\": config_data[\"submit_data\"][\"interaction_source_uuid\"],\n \"interaction_object_type\": config_data[\"submit_data\"][\"interaction_object_type\"],\n \"interaction_style\": config_data[\"submit_data\"][\"interaction_style\"],\n \"target_table\": config_data[\"submit_data\"][\"target_table\"],\n \"target_api_url\": config_data[\"submit_data\"][\"target_api_url\"],\n \"target_api_ID\": config_data[\"submit_data\"][\"target_api_ID\"]\n }\n };\n let re = this.format_data(config_data[\"submit_data\"][\"data\"]);\n new_data[\"submit_data\"][\"data\"] = re;\n return new_data;\n },\n format_data(dict) {\n if (typeof dict == \"string\") {\n dict = eval(dict);\n } else {\n for (const key in dict) {\n let value = dict[key];\n if (typeof value == \"object\") {\n this.format_data(value);\n } else {\n if (typeof value == 'number') {\n dict[key] = value;\n } else {\n if (value.includes(\"this.\")) {\n if (dict.hasOwnProperty(key)) {\n dict[key] = eval(value);\n }\n } else {\n if (value.includes(\".\")) {\n if (dict.hasOwnProperty(key)) {\n dict[key] = eval(value);\n }\n } else {\n dict[key] = value;\n }\n }\n }\n }\n }\n }\n return dict;\n },\n handleSelectionChange(selection) {\n this.ids = selection.map(item => item.uuid);\n },\n handleSelection(val) {\n this.selections = val;\n },\n tableRowClassName(row) {\n