1 line
34 KiB
JSON
1 line
34 KiB
JSON
|
|
{"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\nimport { ZeroCodeAxios } from \"@/request/request.js\";\nimport { flattenToSet } from \"@babel/core/lib/config/helpers/deep-array\";\nconst components = {};\nconst props = [\"above_page_data\"];\nconst data = function () {\n return {\n target_path_show: false,\n tableData: [],\n selected_page: {},\n options: [{\n label: \"单页面\",\n value: \"single\"\n }, {\n label: \"上-左-中\",\n value: \"top-left-middle\"\n }],\n components_list: [],\n select_components_dialog: false,\n create_page_dialog: false,\n create_page_form: {\n name: \"\",\n cn_name: \"\"\n },\n edit_atr_text: false,\n component_loading: false,\n select_tag: false,\n tags_list: [],\n now_select_tag: {},\n now_select_component: {},\n page_position: \"\",\n give_component_name: false,\n component_name: \"\",\n set_menu: false,\n set_route: false,\n project_router: [],\n target_path: \"\",\n menu_data_right: [],\n menu_data_left: [],\n menu_data_top: [],\n menu_data_single: \"\",\n set_menu_activeName: \"left\",\n already_components: false,\n already_components_list: [],\n select_al_tag: false,\n tags_al_list: []\n };\n};\nfunction mounted() {\n this.fetch_data();\n}\nlet id = 1000;\nconst methods = {\n saveAs() {},\n preview() {\n ZeroCodeAxios({\n method: \"POST\",\n url: \":10106/ApiClass/base_api_control/api_url/\",\n data: {\n submit_data: {\n data: {\n project_sign: this.above_page_data.sign\n }\n }\n }\n }).then(res => {\n if (res.data.status == 200) {\n window.open(res.data.return_data.data.data.start_url, '_blank');\n }\n });\n },\n add_top_menu(po) {\n let add_data = {\n \"title_en\": \"data_management\",\n \"title_cn\": \"数据管理\",\n \"icon\": \"el-icon-s-goods\",\n \"type\": \"sub\",\n \"children\": []\n };\n if (po === 'right') {\n this.menu_data_right.push(add_data);\n } else if (po === 'left') {\n this.menu_data_left.push(add_data);\n } else {\n this.menu_data_top.push(add_data);\n }\n },\n set_menu_handleClick(tab) {\n this.set_menu_activeName = tab._props.name;\n },\n set_menu_func() {\n this.set_menu = true;\n },\n submit_set_menu() {\n this.set_menu = false;\n let sub_data = {\n \"left\": this.menu_data_left,\n \"top\": this.menu_data_top,\n \"right\": this.menu_data_right\n };\n const left_keys = Object.keys(this.selected_page.left);\n const right_keys = Object.keys(this.selected_page.right);\n const top_keys = Object.keys(this.selected_page.top);\n if (left_keys.length > 1 || right_keys.length > 1 || top_keys > 1) {\n this.$notify({\n title: '警告',\n message: '左侧或右侧或顶部的组件数量不唯一,不清楚组件',\n type: 'warning'\n });\n } else {\n ZeroCodeAxios({\n method: \"POST\",\n url: \":10096/ApiClass/base_api_control/api_url/\",\n data: {\n submit_data: {\n data: {\n page_info: this.selected_page,\n project_sign: this.above_page_data.sign,\n menu_data: sub_data,\n menu_components: {\n left: {\n title_en: left_keys[0]\n },\n right: {\n title_en: right_keys[0]\n },\n top: {\n title_en: top_keys[0]\n }\n },\n position: this.set_menu_activeName\n }\n }\n }\n }).then(res => {\n console.log(res);\n });\n }\n },\n append(data) {\n const newChild = {\n \"title_en\": \"\",\n \"title_cn\": \"\",\n \"icon\": \"\",\n \"type\": \"\",\n \"children\": []\n };\n if (!data.children) {\n this.$set(data, 'children', []);\n }\n data.children.push
|