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

1 line
13 KiB
JSON
Raw Normal View History

2026-01-11 00:11:34 +08:00
{"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\nimport { ZeroCodeAxios } from \"@/request/request\";\nconst components = {};\nconst data = function () {\n return {\n rows: [],\n de_rows: [],\n settings_rows: [],\n select_Rows: [],\n edit_table_dialog: false,\n edit_field_dialog: false,\n search: \"\",\n de_search: \"\",\n settings_search: \"\",\n now_select_table: \"\",\n all_apps: [],\n add_model: false,\n add_model_form: {\n name: \"\",\n name_cn: \"\",\n app_id: 1\n },\n field_type_options: [{\n label: \"CharField\",\n value: \"CharField\"\n }, {\n label: \"IntegerField\",\n value: \"IntegerField\"\n }, {\n label: \"DateTimeField\",\n value: \"DateTimeField\"\n }, {\n label: \"JSONField\",\n value: \"JSONField\"\n }, {\n label: \"JSONField\",\n value: \"JSONField\"\n }]\n };\n};\nfunction mounted() {\n this.get_all_table();\n this.get_all_apps();\n}\nconst methods = {\n get_all_table() {\n ZeroCodeAxios({\n method: 'GET',\n url: '/zero_code_base/zero_code_main/api/'\n }).then(res => {\n this.rows = res.data.datas;\n });\n },\n get_all_apps() {\n ZeroCodeAxios({\n method: 'GET',\n url: '/zero_code_base/zero_code_main/apps/'\n }).then(res => {\n this.all_apps = res.data.data;\n });\n },\n get_field_list(row) {\n this.now_select_table = row.id;\n ZeroCodeAxios({\n method: 'GET',\n url: '/zero_code_base/zero_code_main/detail/',\n params: {\n id: row.id\n }\n }).then(res => {\n this.de_rows = res.data.datas;\n this.select_Rows = res.data.datas;\n });\n },\n get_setting_list(row) {\n ZeroCodeAxios({\n method: 'GET',\n url: '/zero_code_base/zero_code_main/settings_detail/',\n params: {\n id: row.id\n }\n }).then(res => {\n this.settings_rows = res.data.datas;\n });\n },\n handleEditField(row) {\n this.get_field_list(row);\n this.edit_table_dialog = true;\n },\n handleEditFieldSettings(row) {\n this.get_field_list(row);\n this.get_setting_list(row);\n this.edit_field_dialog = true;\n },\n handleDelete(row) {},\n add_field() {\n this.de_rows.push({\n model: this.now_select_table,\n name: \"\",\n name_cn: \"\",\n type: \"\"\n });\n },\n del_field(index) {\n this.de_rows.splice(index, 1);\n },\n add_setting() {\n this.settings_rows.push({\n field: {\n id: \"\"\n },\n name: \"\",\n name_cn: \"\",\n value: \"\"\n });\n },\n del_setting(index) {\n this.settings_rows.splice(index, 1);\n },\n submit_fields() {\n ZeroCodeAxios({\n method: 'POST',\n url: '/zero_code_base/zero_code_main/detail/',\n data: this.de_rows\n }).then(res => {\n this.get_field_list({\n id: this.now_select_table\n });\n this.get_setting_list({\n id: this.now_select_table\n });\n this.edit_table_dialog = false;\n });\n },\n submit_fields_settings() {\n ZeroCodeAxios({\n method: 'POST',\n url: '/zero_code_base/zero_code_main/settings_detail/',\n data: this.settings_rows\n }).then(res => {\n this.get_field_list({\n id: this.now_select_table\n });\n this.get_setting_list({\n id: this.now_select_table\n });\n this.edit_field_dialog = false;\n });\n },\n submit_model_create() {\n ZeroCodeAxios({\n method: 'POST',\n url: '/zero_code_base/zero_code_main/model/',\n data: this.add_model_form\n }).then(res => {\n this.get_all_table();\n this.add_model = false;\n });\n }\n};\nexport default {\n data: data,\n methods: methods,\n mounted: mounted,\n components: components\n};","map":{"version":3,"names":["ZeroCodeAxios","components","data","rows","de_rows","settings_rows","select_Rows","edit_table_dialog","edit_field_dialog","search","de_search","settings_search","now_select_table","all_apps","add_model","add_model_form","na