From 83ff2ebbb1d61c2cd7762df33f61ff0418b2b1c9 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期日, 28 四月 2024 22:19:49 +0800 Subject: [PATCH] 页面添加 --- src/views/comm/commScenario/commScenario.vue | 227 ++ src/assets/img/lg_03.png | 0 src/assets/css/index.css | 298 +- src/views/comm/commScheme/commScheme.vue | 227 ++ src/components/login.vue | 248 +- src/views/comm/commNetwork/commNetwork.vue | 229 ++ src/views/comm/planReview/planReview.vue | 48 src/router/index.js | 101 + src/assets/img/lg_04.png | 0 src/views/comm/planFormulation/planFormulation.vue | 48 src/views/comm/multimedia/multimedia.vue | 48 src/assets/img/LOGO1.png | 0 public/config/config.js | 8 public/layer/permsselectMenus.json | 1006 +++++++++++ src/views/datamanage/catalogueManage.vue | 1125 +++++------- src/views/comm/simulationModel/simulationModel.vue | 48 src/views/maintenance/menuSettings.vue | 852 ++++----- src/assets/img/menu/navbg.png | 0 src/components/navMenu.vue | 331 +-- src/views/comm/damageAssess/damageAssess.vue | 48 src/views/comm/commResource/commResource.vue | 227 ++ 21 files changed, 3,579 insertions(+), 1,540 deletions(-) diff --git a/public/config/config.js b/public/config/config.js index 4950f23..6b4745b 100644 --- a/public/config/config.js +++ b/public/config/config.js @@ -22,8 +22,8 @@ var LFData = iisHost + "/LFData"; // Server -var BASE_URL = webHost + '/server'; - +var BASE_URL = 'http://192.168.11.14:12316/server'; +// var BASE_URL = webHost+ '/server'; // GeoServerUrl var geoServerURl = webHost + '/geoserver/LF/wms'; @@ -34,6 +34,10 @@ var geoserverWFSLine = '/geoserver/LF/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=LF%3Am_pipeline&maxFeatures=50&outputFormat=application%2Fjson&cql_filter=projname='; + +var getLayerJosn = location.origin+"/layer/" + + // 妯″瀷鍔犺浇鍦板潃 var modelUrl = LFData; diff --git a/public/layer/permsselectMenus.json b/public/layer/permsselectMenus.json new file mode 100644 index 0000000..f251cdd --- /dev/null +++ b/public/layer/permsselectMenus.json @@ -0,0 +1,1006 @@ +{ + "code": 200, + "count": 0, + "msg": "鎴愬姛", + "result": [{ + "cnName": "棣栭〉", + "css": null, + "enName": "Index", + "icon": null, + "id": 3, + "isShow": 1, + "level": 2, + "orderNum": 1, + "perms": "/comprehensive", + "pid": 2, + "type": 1, + "url": "Synthesis" + }, + { + "cnName": "娴嬬粯涓撲笟", + "css": null, + "enName": "Major in surveying and mapping", + "icon": "", + "id": 67, + "isShow": 1, + "level": 2, + "orderNum": 1, + "perms": null, + "pid": 64, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=娴嬬粯涓撲笟&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "璧勬簮鐩綍", + "css": null, + "enName": "Resource Directory", + "icon": "", + "id": 75, + "isShow": 1, + "level": 2, + "orderNum": 1, + "perms": null, + "pid": 66, + "type": 1, + "url": "{fmeHost}/resm/#/resourceManage?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鏁版嵁涓婁紶", + "css": null, + "enName": "Data Updata", + "icon": null, + "id": 15, + "isShow": 1, + "level": 3, + "orderNum": 1, + "perms": "/dataUpload", + "pid": 86, + "type": 1, + "url": "dataUpdata" + }, + + { + "cnName": "涓嬭浇鏃ュ織", + "css": null, + "enName": "Download Log", + "icon": "", + "id": 60, + "isShow": 1, + "level": 3, + "orderNum": 1, + "perms": "/downlog", + "pid": 35, + "type": 1, + "url": "downlog" + }, + { + "cnName": "鍥惧眰", + "css": null, + "enName": "Coverage", + "icon": null, + "id": 4, + "isShow": 1, + "level": 3, + "orderNum": 1, + "perms": null, + "pid": 3, + "type": 2, + "url": null + }, + { + "cnName": "绠¢亾鍩虹澶ф暟鎹钩鍙�", + "css": null, + "enName": "Pipeline Basic Big Data Platform", + "icon": null, + "id": 1, + "isShow": 0, + "level": 0, + "orderNum": 1, + "perms": "/perms", + "pid": 0, + "type": 0, + "url": null + }, + { + "cnName": "鏍煎紡杞崲", + "css": null, + "enName": "Format Conversion", + "icon": "", + "id": 70, + "isShow": 1, + "level": 2, + "orderNum": 1, + "perms": null, + "pid": 65, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=鏁版嵁浜ゆ崲&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鐧诲綍鏃ュ織", + "css": null, + "enName": "Login Log", + "icon": null, + "id": 36, + "isShow": 1, + "level": 3, + "orderNum": 2, + "perms": "/login", + "pid": 35, + "type": 1, + "url": "logLog" + }, + { + "cnName": "瑙嗗浘", + "css": null, + "enName": "Viewport", + "icon": null, + "id": 5, + "isShow": 1, + "level": 3, + "orderNum": 2, + "perms": null, + "pid": 3, + "type": 2, + "url": null + }, + { + "cnName": "椤圭洰绠$悊", + "css": null, + "enName": "Project management", + "icon": null, + "id": 16, + "isShow": 1, + "level": 3, + "orderNum": 2, + "perms": "/dir", + "pid": 85, + "type": 1, + "url": "catalogueManage" + }, + { + "cnName": "鍕樺療涓撲笟", + "css": null, + "enName": "Major in investigation", + "icon": "", + "id": 68, + "isShow": 1, + "level": 2, + "orderNum": 2, + "perms": null, + "pid": 64, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=鍕樺療涓撲笟&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "璧勬簮瀹℃牳", + "css": null, + "enName": "Resource audit", + "icon": null, + "id": 76, + "isShow": 1, + "level": 2, + "orderNum": 2, + "perms": null, + "pid": 66, + "type": 1, + "url": "{fmeHost}/resm/#/resapproval?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鎬佸娍涓�寮犲浘", + "css": "m5", + "enName": "Comprehensive Display", + "icon": null, + "id": 2, + "isShow": 1, + "level": 1, + "orderNum": 2, + "perms": "/comprehensive", + "pid": 1, + "type": 1, + "url": "Synthesis" + }, + { + "cnName": "鍦ㄧ嚎鍒跺浘", + "css": null, + "enName": "Online Cartography", + "icon": "", + "id": 45, + "isShow": 1, + "level": 3, + "orderNum": 2, + "perms": "/export", + "pid": 2, + "type": 1, + "url": "ExportMap" + }, + { + "cnName": "淇℃伅绠$悊", + "css": null, + "enName": "Information management", + "icon": null, + "id": 20, + "isShow": 1, + "level": 3, + "orderNum": 2, + "perms": "/meta", + "pid": 86, + "type": 1, + "url": "metadataManage" + }, + { + "cnName": "鍧愭爣杞崲", + "css": null, + "enName": "Coordinate Transformation", + "icon": null, + "id": 71, + "isShow": 1, + "level": 2, + "orderNum": 2, + "perms": null, + "pid": 65, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=鍧愭爣杞崲&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鏁版嵁鍒嗗彂", + "css": null, + "enName": "Data distribution", + "icon": null, + "id": 72, + "isShow": 1, + "level": 2, + "orderNum": 3, + "perms": null, + "pid": 65, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=鏁版嵁鍒嗗彂&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鎿嶄綔鏃ュ織", + "css": null, + "enName": "Operation Log", + "icon": null, + "id": 37, + "isShow": 1, + "level": 3, + "orderNum": 3, + "perms": "/operate", + "pid": 35, + "type": 1, + "url": "operationLog" + }, + { + "cnName": "鍙戝竷绠$悊", + "css": null, + "enName": "Release management", + "icon": "", + "id": 90, + "isShow": 1, + "level": 3, + "orderNum": 3, + "perms": "/publish", + "pid": 86, + "type": 1, + "url": "uploadmanage" + }, + { + "cnName": "婕父", + "css": null, + "enName": "Wander", + "icon": null, + "id": 6, + "isShow": 1, + "level": 3, + "orderNum": 3, + "perms": null, + "pid": 3, + "type": 2, + "url": null + }, + + { + "cnName": "鍦扮伨涓撲笟", + "css": null, + "enName": "Major in Earth disaster", + "icon": "", + "id": 88, + "isShow": 1, + "level": 2, + "orderNum": 3, + "perms": null, + "pid": 64, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=鍦扮伨涓撲笟&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "椤圭洰淇℃伅", + "css": null, + "enName": "Project Information", + "icon": "", + "id": 58, + "isShow": 1, + "level": 3, + "orderNum": 3, + "perms": "/project", + "pid": 85, + "type": 1, + "url": "projectManage" + }, + { + "cnName": "鍒嗘瀽", + "css": null, + "enName": "Analyse", + "icon": null, + "id": 7, + "isShow": 1, + "level": 3, + "orderNum": 4, + "perms": null, + "pid": 3, + "type": 2, + "url": null + }, + { + "cnName": "鍥惧眰绠$悊", + "css": null, + "enName": " Layer Management", + "icon": "", + "id": 93, + "isShow": 1, + "level": 3, + "orderNum": 4, + "perms": "/layer", + "pid": 86, + "type": 1, + "url": "layerManagement" + }, + { + "cnName": "鏁版嵁鐢宠", + "css": null, + "enName": "Data application", + "icon": "", + "id": 62, + "isShow": 1, + "level": 2, + "orderNum": 4, + "perms": "/apply", + "pid": 2, + "type": 1, + "url": "dataApplication" + }, + { + "cnName": "娲炲簱涓撲笟", + "css": null, + "enName": "Professional Cave", + "icon": null, + "id": 89, + "isShow": 1, + "level": 2, + "orderNum": 4, + "perms": null, + "pid": 64, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=娲炲簱涓撲笟&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鏁版嵁绠$悊", + "css": "m3", + "enName": "Data Manage", + "icon": null, + "id": 14, + "isShow": 1, + "level": 1, + "orderNum": 4, + "perms": "", + "pid": 1, + "type": 1, + "url": "" + }, + { + "cnName": "鏁版嵁娌荤悊", + "css": null, + "enName": "Data governance", + "icon": null, + "id": 73, + "isShow": 1, + "level": 2, + "orderNum": 4, + "perms": null, + "pid": 65, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/task_zsy?tags=鏁版嵁娌荤悊&embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鐗堟湰绠$悊", + "css": null, + "enName": "Version Management", + "icon": null, + "id": 18, + "isShow": 1, + "level": 3, + "orderNum": 4, + "perms": "/ver", + "pid": 85, + "type": 1, + "url": "versionManage" + }, + { + "cnName": "璧勬簮鏃ュ織", + "css": null, + "enName": "Resource Log", + "icon": null, + "id": 38, + "isShow": 1, + "level": 3, + "orderNum": 4, + "perms": "/resOp", + "pid": 35, + "type": 1, + "url": "eventlogManage" + }, + { + "cnName": "浠诲姟绠$悊", + "css": null, + "enName": "Task management", + "icon": null, + "id": 81, + "isShow": 1, + "level": 2, + "orderNum": 5, + "perms": "", + "pid": 66, + "type": 1, + "url": "{fmeHost}/dataxdi/#/task/list?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鍊煎煙绠$悊", + "css": null, + "enName": "Domain Management", + "icon": "", + "id": 44, + "isShow": 1, + "level": 3, + "orderNum": 5, + "perms": "/domain", + "pid": 86, + "type": 1, + "url": "domainManage" + }, + { + "cnName": "鏂规绠$悊", + "css": null, + "enName": "Programme management", + "icon": "", + "id": 80, + "isShow": 1, + "level": 2, + "orderNum": 5, + "perms": null, + "pid": 66, + "type": 1, + "url": "{fmeHost}/dataxdi/#/schema/list?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鏁版嵁缁熻", + "css": null, + "enName": "dataStatistics", + "icon": "", + "id": 94, + "isShow": 1, + "level": 2, + "orderNum": 5, + "perms": null, + "pid": 2, + "type": 1, + "url": "/dataCount" + }, + { + "cnName": "浠ょ墝绠$悊", + "css": null, + "enName": "Token Management", + "icon": null, + "id": 39, + "isShow": 1, + "level": 3, + "orderNum": 5, + "perms": "/token", + "pid": 35, + "type": 1, + "url": "tokentool" + }, + { + "cnName": "鍋滅敤璧勬簮", + "css": null, + "enName": "Application record", + "icon": "", + "id": 87, + "isShow": 1, + "level": 2, + "orderNum": 5, + "perms": null, + "pid": 66, + "type": 1, + "url": "{fmeHost}/resm/#/resdisabled?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鏌ヨ", + "css": null, + "enName": "IQuery", + "icon": null, + "id": 8, + "isShow": 1, + "level": 3, + "orderNum": 5, + "perms": "/inquiry", + "pid": 3, + "type": 2, + "url": null + }, + + { + "cnName": "榛�/鐧藉悕鍗�", + "css": null, + "enName": "Black/White List", + "icon": null, + "id": 40, + "isShow": 1, + "level": 3, + "orderNum": 6, + "perms": "/blacklist", + "pid": 35, + "type": 1, + "url": "blackwhiteList" + }, + { + "cnName": "瀹氫綅", + "css": null, + "enName": "Orientation", + "icon": null, + "id": 9, + "isShow": 1, + "level": 3, + "orderNum": 6, + "perms": "/locate", + "pid": 3, + "type": 2, + "url": null + }, + { + "cnName": "璧勬簮鎺堟潈", + "css": null, + "enName": "Resource Management", + "icon": "", + "id": 91, + "isShow": 1, + "level": 2, + "orderNum": 6, + "perms": null, + "pid": 66, + "type": 1, + "url": "{fmeHost}/resm/#/rescancelauth?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "璧勬枡棣�", + "css": null, + "enName": "Data Library", + "icon": null, + "id": 13, + "isShow": 1, + "level": 2, + "orderNum": 6, + "perms": "/dataLib", + "pid": 2, + "type": 1, + "url": "Archive" + }, + { + "cnName": "瀛楀吀绠$悊", + "css": null, + "enName": "Dictionary Management", + "icon": null, + "id": 19, + "isShow": 1, + "level": 3, + "orderNum": 6, + "perms": "/dict", + "pid": 86, + "type": 1, + "url": "dictionaryManage" + }, + + { + "cnName": "鏍峰紡绠$悊", + "css": null, + "enName": "Style Management", + "icon": null, + "id": 21, + "isShow": 1, + "level": 3, + "orderNum": 7, + "perms": "/style", + "pid": 86, + "type": 1, + "url": "styleManage" + }, + { + "cnName": "鐢宠鐘舵��", + "css": null, + "enName": "Application status", + "icon": "", + "id": 92, + "isShow": 1, + "level": 2, + "orderNum": 7, + "perms": null, + "pid": 66, + "type": 1, + "url": "{fmeHost}/resm/#/resrequest?embed=true&theme=dark&lang=zh&token=" + }, + { + "cnName": "鏁版嵁搴撶洃鎺�", + "css": null, + "enName": "Database Monitoring", + "icon": null, + "id": 41, + "isShow": 1, + "level": 3, + "orderNum": 7, + "perms": "/sign/toDruid", + "pid": 35, + "type": 1, + "url": "{webHost}/server/druid/index.html" + }, + { + "cnName": "娴嬮噺", + "css": null, + "enName": "Measurement", + "icon": null, + "id": 10, + "isShow": 1, + "level": 3, + "orderNum": 7, + "perms": null, + "pid": 3, + "type": 2, + "url": null + }, + + { + "cnName": "鏁版嵁璧勬簮绠$悊", + "css": "m6", + "enName": "Operat Management", + "icon": null, + "id": 22, + "isShow": 1, + "level": 1, + "orderNum": 7, + "perms": "", + "pid": 1, + "type": 1, + "url": "" + }, + { + "cnName": "缁煎悎鎬佸娍鏄剧ず", + "css": "m5", + "enName": "Operat Management", + "icon": null, + "id": 202, + "isShow": 1, + "level": 1, + "orderNum": 7, + "perms": "", + "pid": 1, + "type": 1, + "url": "" + }, + { + "cnName": "鏍囩粯", + "css": null, + "enName": "Plotting", + "icon": null, + "id": 11, + "isShow": 1, + "level": 3, + "orderNum": 8, + "perms": "/mark", + "pid": 3, + "type": 2, + "url": null + }, + { + "cnName": "鏁版嵁鏌ヨ", + "css": null, + "enName": "Data Query", + "icon": null, + "id": 17, + "isShow": 1, + "level": 3, + "orderNum": 8, + "perms": "/dataQuery", + "pid": 86, + "type": 1, + "url": "SpatialData" + }, + { + "cnName": "绯荤粺鐩戞帶", + "css": null, + "enName": "System Monitoring", + "icon": null, + "id": 42, + "isShow": 1, + "level": 3, + "orderNum": 8, + "perms": "/ws", + "pid": 35, + "type": 1, + "url": "systemMonitoring" + }, + { + "cnName": "鍦烘櫙", + "css": null, + "enName": "Scene", + "icon": "", + "id": 61, + "isShow": 1, + "level": 2, + "orderNum": 9, + "perms": "/Scene", + "pid": 3, + "type": 2, + "url": "" + }, + { + "cnName": "绠¢亾绌洪棿鍒嗘瀽", + "css": null, + "enName": " Pipe space analysis", + "icon": "", + "id": 63, + "isShow": 1, + "level": 3, + "orderNum": 10, + "perms": "/pipeline", + "pid": 3, + "type": 2, + "url": "/pipeline" + }, + { + "cnName": "椤圭洰绠$悊", + "css": null, + "enName": "Project management", + "icon": "", + "id": 85, + "isShow": 1, + "level": 2, + "orderNum": 11, + "perms": null, + "pid": 14, + "type": 1, + "url": "/projectController" + }, + { + "cnName": "鏁版嵁搴撶鐞�", + "css": null, + "enName": "Database management", + "icon": null, + "id": 86, + "isShow": 1, + "level": 2, + "orderNum": 12, + "perms": null, + "pid": 14, + "type": 1, + "url": "/bankController" + }, + { + "cnName": "绯荤粺绠$悊", + "css": null, + "enName": "System Management", + "icon": null, + "id": 23, + "isShow": 1, + "level": 2, + "orderNum": 23, + "perms": null, + "pid": 22, + "type": 1, + "url": "/systemController" + }, + { + "cnName": "鑿滃崟绠$悊", + "css": null, + "enName": "Menu Management", + "icon": null, + "id": 24, + "isShow": 1, + "level": 3, + "orderNum": 24, + "perms": "/menu", + "pid": 23, + "type": 1, + "url": "menuSettings" + }, + { + "cnName": "鐢ㄦ埛绠$悊", + "css": null, + "enName": "User Management", + "icon": null, + "id": 25, + "isShow": 1, + "level": 3, + "orderNum": 25, + "perms": "/user", + "pid": 23, + "type": 1, + "url": "userInfoManage" + }, + { + "cnName": "鍗曚綅绠$悊", + "css": null, + "enName": "Organization Management", + "icon": null, + "id": 26, + "isShow": 1, + "level": 3, + "orderNum": 26, + "perms": "/dep", + "pid": 23, + "type": 1, + "url": "orgManage" + }, + { + "cnName": "璧勬簮绠$悊", + "css": null, + "enName": "Resource Management", + "icon": null, + "id": 27, + "isShow": 0, + "level": 3, + "orderNum": 27, + "perms": "/res", + "pid": 23, + "type": 1, + "url": "resourceManage" + }, + { + "cnName": "瑙掕壊绠$悊", + "css": null, + "enName": "Role Management", + "icon": null, + "id": 28, + "isShow": 1, + "level": 3, + "orderNum": 28, + "perms": "/role", + "pid": 23, + "type": 1, + "url": "roleManage" + }, + { + "cnName": "鏉冮檺绠$悊", + "css": null, + "enName": "Permission Management", + "icon": null, + "id": 29, + "isShow": 1, + "level": 3, + "orderNum": 29, + "perms": "/auth", + "pid": 23, + "type": 1, + "url": "authorityManage" + }, + { + "cnName": "鎺堟潈绠$悊", + "css": null, + "enName": "Authorization Management", + "icon": null, + "id": 30, + "isShow": 1, + "level": 2, + "orderNum": 30, + "perms": null, + "pid": 22, + "type": 1, + "url": "/empowerController" + }, + { + "cnName": "妯℃澘绠$悊", + "css": null, + "enName": "Template management", + "icon": "", + "id": 82, + "isShow": 1, + "level": 3, + "orderNum": 30, + "perms": "/report", + "pid": 23, + "type": 1, + "url": "templateManage" + }, + { + "cnName": "鐢ㄦ埛瑙掕壊鎺堟潈", + "css": null, + "enName": "User Role Authorization", + "icon": null, + "id": 31, + "isShow": 1, + "level": 3, + "orderNum": 31, + "perms": "/roleUser", + "pid": 30, + "type": 1, + "url": "userRoleAuthorization" + }, + { + "cnName": "鑿滃崟鏉冮檺鎺堟潈", + "css": null, + "enName": "Menu Permission Authorization", + "icon": null, + "id": 32, + "isShow": 1, + "level": 3, + "orderNum": 32, + "perms": "/menuAuth", + "pid": 30, + "type": 1, + "url": "menuRoleAuthorization" + }, + { + "cnName": "瑙掕壊鑿滃崟鎺堟潈", + "css": null, + "enName": "Role Menu Authorization", + "icon": null, + "id": 33, + "isShow": 1, + "level": 3, + "orderNum": 33, + "perms": "/roleMenuAuth", + "pid": 30, + "type": 1, + "url": "roleMenuAuthorization" + }, + { + "cnName": "瑙掕壊璧勬簮鎺堟潈", + "css": null, + "enName": "Role Resource Authorization", + "icon": null, + "id": 34, + "isShow": 0, + "level": 3, + "orderNum": 34, + "perms": "/roleRes", + "pid": 30, + "type": 1, + "url": "roleResAuthorization" + }, + { + "cnName": "杩愮淮鐩戞帶", + "css": null, + "enName": "Operation And Monitoring", + "icon": null, + "id": 35, + "isShow": 1, + "level": 2, + "orderNum": 35, + "perms": "/ctrl", + "pid": 22, + "type": 1, + "url": "/opexController" + }, + { + "cnName": "绯荤粺閰嶇疆", + "css": null, + "enName": "System Configuration", + "icon": null, + "id": 43, + "isShow": 1, + "level": 2, + "orderNum": 43, + "perms": "/args", + "pid": 22, + "type": 1, + "url": "parameterConfiguration" + } + ], + "time": 1714294558805 +} \ No newline at end of file diff --git a/src/assets/css/index.css b/src/assets/css/index.css index 5d0b969..5ba1477 100644 --- a/src/assets/css/index.css +++ b/src/assets/css/index.css @@ -2,306 +2,306 @@ /* Home椤甸潰 */ .home { - height: 100vh; - position: relative; + height: 100vh; + position: relative; } .el-container { - height: 100%; + height: 100%; } .el-header { - padding: 0; - height: 60px !important; + padding: 0; + height: 60px !important; } .el-main { - margin: 0px; - padding: 0px !important; - background: #3B4D6E; + margin: 0px; + padding: 0px !important; + background: #3B4D6E; } /* 瀵艰埅鏍忛〉闈� */ .NavBox { - width: 100%; - height: 100%; - background-image: url("../../assets/img/menu/navbg.jpg"); - background-repeat: no-repeat; - background-size: 100% 100%; - /*background-image: linear-gradient(rgb(34, 33, 33), rgb(27, 31, 78));*/ + width: 100%; + height: 100%; + background-image: url("../../assets/img/menu/navbg.png"); + background-repeat: no-repeat; + background-size: 100% 100%; + /*background-image: linear-gradient(rgb(34, 33, 33), rgb(27, 31, 78));*/ } .topBox { - width: 100%; - height: 100%; - display: flex; - justify-content: space-around; - align-items: center; + width: 100%; + height: 100%; + display: flex; + justify-content: space-around; + align-items: center; } .topTitle { - /* width: 415px; + /* width: 415px; height: 70px; background: url("../img/LOGO.png") no-repeat center; */ - width: 18%; - height: 50px; - background: url("../img/menu/navtitle.png") no-repeat center center; - background-size: 100% 100%; + width: 18%; + height: 50px; + /* background: url("../img/menu/navtitle.png") no-repeat center center; */ + background-size: 100% 100%; } .topMenu { - width: auto; - flex: 1; - height: 60px; - margin-left: 3%; + width: auto; + flex: 1; + height: 60px; + margin-left: 3%; } .menuContent { - width: 100%; - height: 100%; - display: flex; - align-items: center; - /* justify-content: center; */ + width: 100%; + height: 100%; + display: flex; + align-items: center; + /* justify-content: center; */ } .topUser { - color: white; - width: 9%; - height: 100%; - display: flex; - align-items: center; - padding-left: 10px; + color: white; + width: 9%; + height: 100%; + display: flex; + align-items: center; + padding-left: 10px; } .contentDiv { - margin-left: 1%; + margin-left: 1%; } .ImgMenu { - /*width: 100%;*/ - width: 40px; - height: auto; - display: flex; - justify-content: center; + /*width: 100%;*/ + width: 40px; + height: auto; + display: flex; + justify-content: center; } .menuImage { - width: 40px; - height: 40px; + width: 40px; + height: 40px; } .menulabel { - font-size: 15px; - font-family: Source Han Sans CN; - text-align: left; - padding: 0 10px; - /*width: 100px;*/ - /*width: 120px;*/ - color: #fff + font-size: 15px; + font-family: Source Han Sans CN; + text-align: left; + padding: 0 10px; + /*width: 100px;*/ + /*width: 120px;*/ + color: #fff } .changeStyle { - color: #fec801; + color: #fec801; } .m1 { - background: url("../img/menu/menu11.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu11.png") no-repeat; + background-size: 100% 100%; } .m2 { - background: url("../img/menu/menu21.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu21.png") no-repeat; + background-size: 100% 100%; } .m3 { - background: url("../img/menu/menu31.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu31.png") no-repeat; + background-size: 100% 100%; } .m4 { - background: url("../img/menu/menu41.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu41.png") no-repeat; + background-size: 100% 100%; } .m5 { - background: url("../img/menu/menu51.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu51.png") no-repeat; + background-size: 100% 100%; } .m6 { - background: url("../img/menu/menu61.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu61.png") no-repeat; + background-size: 100% 100%; } .m7 { - background: url("../img/menu/qwyzt.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/qwyzt.png") no-repeat; + background-size: 100% 100%; } .m11 { - background: url("../img/menu/menu12.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu12.png") no-repeat; + background-size: 100% 100%; } .m21 { - background: url("../img/menu/menu22.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu22.png") no-repeat; + background-size: 100% 100%; } .m31 { - background: url("../img/menu/menu32.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu32.png") no-repeat; + background-size: 100% 100%; } .m41 { - background: url("../img/menu/menu42.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu42.png") no-repeat; + background-size: 100% 100%; } .m51 { - background: url("../img/menu/menu52.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu52.png") no-repeat; + background-size: 100% 100%; } .m61 { - background: url("../img/menu/menu62.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/menu62.png") no-repeat; + background-size: 100% 100%; } .m71 { - background: url("../img/menu/qwyzt-h.png") no-repeat; - background-size: 100% 100%; + background: url("../img/menu/qwyzt-h.png") no-repeat; + background-size: 100% 100%; } .userName { - margin: 0px 10px 0 5px; - /*margin-right: 10px;*/ - display: flex; - justify-content: space-between; - height: 30px; - align-items: center; + margin: 0px 10px 0 5px; + /*margin-right: 10px;*/ + display: flex; + justify-content: space-between; + height: 30px; + align-items: center; } .userLanguage { - /*margin: 0px 10px;*/ - /*margin-top: 10px;*/ - display: flex; - height: 30px; - align-items: center; + /*margin: 0px 10px;*/ + /*margin-top: 10px;*/ + display: flex; + height: 30px; + align-items: center; } .userImage { - width: 20px; - height: 20px; - float: left; - margin-right: 10px; + width: 20px; + height: 20px; + float: left; + margin-right: 10px; } .user1 { - /*background: url("../img/user.png") no-repeat;*/ - background: url("../img/menu/user.png") no-repeat; - background-size: 100% 100%; + /*background: url("../img/user.png") no-repeat;*/ + background: url("../img/menu/user.png") no-repeat; + background-size: 100% 100%; } .user2 { - /*background: url("../img/EN.png") no-repeat;*/ - background: url("../img/menu/en.png") no-repeat; - background-size: 100% 100%; - cursor: pointer; + /*background: url("../img/EN.png") no-repeat;*/ + background: url("../img/menu/en.png") no-repeat; + background-size: 100% 100%; + cursor: pointer; } .theme { - background: url("../img/menu/theme.png") no-repeat; - background-size: 100% 100%; - cursor: pointer; + background: url("../img/menu/theme.png") no-repeat; + background-size: 100% 100%; + cursor: pointer; } .userText { - font-size: 10px; - line-height: 15px; - font-family: Microsoft YaHei; - font-weight: 400; + font-size: 10px; + line-height: 15px; + font-family: Microsoft YaHei; + font-weight: 400; - text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.35); + text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.35); } .TextLanguage { - font-size: 10px; - line-height: 15px; - font-family: Microsoft YaHei; - font-weight: 400; + font-size: 10px; + line-height: 15px; + font-family: Microsoft YaHei; + font-weight: 400; - text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.35); + text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.35); } .elLink { - margin-left: 5px; - font-size: 10px; - margin-bottom: 4px; - color: white; + margin-left: 5px; + font-size: 10px; + margin-bottom: 4px; + color: white; } .topUser .el-link--default:hover { - color: #409eff !important; + color: #409eff !important; } .topUser .el-link--default { - color: white !important; + color: white !important; } .el-menu { - border: transparent; + border: transparent; } .secondMenuDiv { - position: absolute; - z-index: 1024; - margin-top: 15px; - background: rgba(244, 248, 255, 1); - box-shadow: 0px 0px 6px 2px rgba(244, 248, 255, 0.85); - border-radius: 5px; - border: 1px solid #DCDFE6; + position: absolute; + z-index: 1024; + margin-top: 15px; + background: rgba(244, 248, 255, 1); + box-shadow: 0px 0px 6px 2px rgba(244, 248, 255, 0.85); + border-radius: 5px; + border: 1px solid #DCDFE6; } .secondMenuDiv div { - line-height: 30px; - padding: 10px; - font-size: 12px; - font-family: Microsoft YaHei; - font-weight: 400; - text-align: center; - line-height: 20px; - min-width: 100px; + line-height: 30px; + padding: 10px; + font-size: 12px; + font-family: Microsoft YaHei; + font-weight: 400; + text-align: center; + line-height: 20px; + min-width: 100px; } .secondMenuDiv .changeLiStyle { - color: #409eff; - box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1); - border: 1px solid #409eff; - /* background: #182E45 */ - /* + color: #409eff; + box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1); + border: 1px solid #409eff; + /* background: #182E45 */ + /* */ } .distance-legend { - bottom: 55px !important; + bottom: 55px !important; } .ol-scale-line { - bottom: 70px !important; - right: 110px + bottom: 70px !important; + right: 110px } .ol-scale-line { - display: block !important; + display: block !important; } /*.mapTerrain {*/ diff --git a/src/assets/img/LOGO.png b/src/assets/img/LOGO1.png similarity index 100% rename from src/assets/img/LOGO.png rename to src/assets/img/LOGO1.png Binary files differ diff --git a/src/assets/img/lg_03.png b/src/assets/img/lg_03.png index 9b4ff35..86f422d 100644 --- a/src/assets/img/lg_03.png +++ b/src/assets/img/lg_03.png Binary files differ diff --git a/src/assets/img/lg_04.png b/src/assets/img/lg_04.png new file mode 100644 index 0000000..9b4ff35 --- /dev/null +++ b/src/assets/img/lg_04.png Binary files differ diff --git a/src/assets/img/menu/navbg.png b/src/assets/img/menu/navbg.png new file mode 100644 index 0000000..5ba883d --- /dev/null +++ b/src/assets/img/menu/navbg.png Binary files differ diff --git a/src/components/login.vue b/src/components/login.vue index 4a88b67..08f4ade 100644 --- a/src/components/login.vue +++ b/src/components/login.vue @@ -1,118 +1,90 @@ <template> <div class="container"> - <vue-particles - :particleOpacity="0.7" - :particlesNumber="80" - shapeType="circle" - :particleSize="4" - :linesWidth="1" - :lineLinked="true" - :lineOpacity="0.4" - :linesDistance="80" - :moveSpeed="2" - :hoverEffect="true" - hoverMode="grab" - :clickEffect="false" - clickMode="bubble" - > + <vue-particles :particleOpacity="0.7" + :particlesNumber="80" + shapeType="circle" + :particleSize="4" + :linesWidth="1" + :lineLinked="true" + :lineOpacity="0.4" + :linesDistance="80" + :moveSpeed="2" + :hoverEffect="true" + hoverMode="grab" + :clickEffect="false" + clickMode="bubble"> </vue-particles> <div class="MapMenu"> - <iframe - id="ifream" - style="border: none" - width="100%" - height="100%" - v-bind:src="reportUrl" - ></iframe> + <iframe id="ifream" + style="border: none" + width="100%" + height="100%" + v-bind:src="reportUrl"></iframe> </div> <div class="title_img"> - <img - src="../assets/img/lg_03.png" - alt="" - /> + <img src="../assets/img/lg_03.png" + alt="" /> </div> <div class="login"> <div class="login_title"> <span>鐢ㄦ埛鐧诲綍</span> </div> - <el-form - :model="loginForm" - :rules="rules" - ref="loginForm" - class="loginForm" - > + <el-form :model="loginForm" + :rules="rules" + ref="loginForm" + class="loginForm"> <el-form-item prop="uid"> - <el-input - v-model="loginForm.uid" - placeholder="杈撳叆鐧诲綍璐﹀彿" - class="nobr" - size="meddle" - autocomplete="off" - > - <i - slot="prefix" - class="el-icon-user" - ></i> + <el-input v-model="loginForm.uid" + placeholder="杈撳叆鐧诲綍璐﹀彿" + class="nobr" + size="meddle" + autocomplete="off"> + <i slot="prefix" + class="el-icon-user"></i> </el-input> </el-form-item> <el-form-item prop="pwd"> - <el-input - show-password - v-model="loginForm.pwd" - placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�" - class="nobr" - autocomplete="off" - > - <i - slot="prefix" - class="el-icon-lock" - ></i> + <el-input show-password + v-model="loginForm.pwd" + placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�" + class="nobr" + autocomplete="off"> + <i slot="prefix" + class="el-icon-lock"></i> </el-input> </el-form-item> <el-form-item required> <el-col :span="18"> <el-form-item prop="validCode"> - <el-input - v-model="loginForm.validCode" - placeholder="璇疯緭鍏ラ獙璇佺爜锛堝拷鐣ュぇ灏忓啓锛�" - class="nobr" - ></el-input> + <el-input v-model="loginForm.validCode" + placeholder="璇疯緭鍏ラ獙璇佺爜锛堝拷鐣ュぇ灏忓啓锛�" + class="nobr"></el-input> </el-form-item> </el-col> - <el-col - :span="6" - align="right" - > - <validCode - v-model="validCode" - ref="refresh" - @sendData="getCode" - ></validCode> + <el-col :span="6" + align="right"> + <validCode v-model="validCode" + ref="refresh" + @sendData="getCode"></validCode> </el-col> </el-form-item> <el-form-item> - <img - src="../assets/img/zhengshu.png" - alt="" - /><span style="color: black">璇佷功瀹夎涓庢坊鍔犱俊浠荤珯鐐�</span> + <img src="../assets/img/zhengshu.png" + alt="" /><span style="color: black">璇佷功瀹夎涓庢坊鍔犱俊浠荤珯鐐�</span> </el-form-item> <el-form-item> - <img - src="../assets/img/document.png" - alt="" - /><span style="color: black">浣跨敤甯姪鏂囨。</span> + <img src="../assets/img/document.png" + alt="" /><span style="color: black">浣跨敤甯姪鏂囨。</span> </el-form-item> <el-form-item> - <el-button - type="primary" - class="nobr loginbtn" - style="" - :loading="loading" - @click="submitForm('loginForm')" - >鐧诲綍</el-button> + <el-button type="primary" + class="nobr loginbtn" + style="" + :loading="loading" + @click="submitForm('loginForm')">鐧诲綍</el-button> </el-form-item> </el-form> </div> @@ -127,27 +99,27 @@ export default { components: { validCode }, - data() { - let validUserName = (rule, value, callback) => { - if (!value) { + data () { + let validUserName=(rule,value,callback) => { + if(!value) { return callback(new Error("鐢ㄦ埛鍚嶄笉鑳戒负绌�")); } else { callback(); } }; - let validPassword = (rule, value, callback) => { - if (!value) { + let validPassword=(rule,value,callback) => { + if(!value) { return callback(new Error("瀵嗙爜涓嶈兘涓虹┖")); } else { callback(); } }; - const checkValidCode = (rule, value, callback) => { - if (!value) { + const checkValidCode=(rule,value,callback) => { + if(!value) { callback(new Error("璇疯緭鍏ラ獙璇佺爜")); - } else if (value.toUpperCase() !== this.validCode.toUpperCase()) { + } else if(value.toUpperCase()!==this.validCode.toUpperCase()) { callback(new Error("楠岃瘉鐮佷笉姝g‘")); } else { callback(); @@ -165,35 +137,35 @@ pwd: "", }, rules: { - uid: [{ validator: validUserName, trigger: "blur" }], - pwd: [{ validator: validPassword, trigger: "blur" }], - validCode: [{ validator: checkValidCode, trigger: "blur" }], + uid: [{ validator: validUserName,trigger: "blur" }], + pwd: [{ validator: validPassword,trigger: "blur" }], + validCode: [{ validator: checkValidCode,trigger: "blur" }], showSessionId: "", reportUrl: "", }, }; }, - mounted() { + mounted () { this.getpublickey(); }, methods: { - handlePaste(e) { + handlePaste (e) { e.preventDefault(); }, // 鑾峰彇vuex涓瑼ctions閲岀殑鏂规硶 - ...mapActions(["login", "getpublickey"]), - getCode(data) { - this.validCode = data; //鍦╠ata涓畾涔変竴涓� validCode:'',鐢ㄦ潵璁板綍楠岃瘉鐮併�� + ...mapActions(["login","getpublickey"]), + getCode (data) { + this.validCode=data; //鍦╠ata涓畾涔変竴涓� validCode:'',鐢ㄦ潵璁板綍楠岃瘉鐮併�� }, - submitForm(formName) { + submitForm (formName) { this.$refs[formName].validate((valid) => { - if (valid) { - this.loading = true; + if(valid) { + this.loading=true; this.login(this.loginForm) .then((response) => { - if (response.code != 200) { - this.loading = false; + if(response.code!=200) { + this.loading=false; this.$message({ message: response.msg, type: "error", @@ -206,7 +178,7 @@ return; } - if (response.msg != "") { + if(response.msg!="") { this.$message({ message: response.msg, type: "warning", @@ -215,45 +187,49 @@ this.setCookies(response); getPerms().then((res) => { - if (res.code == 200) { - this.$store.commit("getPermsEntity", res.result); + if(res.code==200) { + this.$store.commit("getPermsEntity",res.result); - if (res.result.length != 0) { - sessionStorage.setItem("routerName", "/Thematic"); - sessionStorage.setItem("changeSelectStyle", 1); - this.$router.push("/"); + if(res.result.length!=0) { + + // sessionStorage.setItem("routerName","/Synthesis"); + // sessionStorage.setItem("routerName", "/Thematic"); + // sessionStorage.setItem("changeSelectStyle",1); + // this.$router.push("/"); + sessionStorage.setItem("changeSelectStyle",1) + this.$router.push("/Synthesis") } else { this.$message({ message: "璇锋偍鑱旂郴绠$悊鍛樺垎閰嶈鑹茶彍鍗�", type: "error", }); } - this.loading = false; + this.loading=false; } else { - this.loading = false; + this.loading=false; console.log("error submit!!"); } }); - this.loading = false; + this.loading=false; //璋冪敤褰曟帴鍙� }) .catch((response) => { - this.loading = false; + this.loading=false; }); //濡傛灉鐧诲綍澶辫触锛岄渶瑕佸埛鏂伴獙璇佺爜鐨� this.$refs.refresh.createdCode(); - this.validCode = ""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹� + this.validCode=""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹� } else { - this.loading = false; + this.loading=false; console.log("error submit!!"); return false; } }); }, - setCookies(res) { - var timeData = moment(res.result.expire).format("YYYY-MM-DD HH:mm:ss"); - var LfPrems = { + setCookies (res) { + var timeData=moment(res.result.expire).format("YYYY-MM-DD HH:mm:ss"); + var LfPrems={ token: res.result.token, uname: res.result.uname, time: timeData, @@ -261,16 +237,16 @@ expire: res.result.expire, autoLogOut: res.result.autoLogOut, }; - LfPrems = JSON.stringify(LfPrems); - localStorage.setItem("LFToken", LfPrems); + LfPrems=JSON.stringify(LfPrems); + localStorage.setItem("LFToken",LfPrems); }, - enterLogin() { - document.onkeydown = (e) => { - e = window.event || e; + enterLogin () { + document.onkeydown=(e) => { + e=window.event||e; - if ( - this.$route.path == "/login" && - (e.code == "Enter" || e.code == "enter" || e.code == "NumpadEnter") + if( + this.$route.path=="/login"&& + (e.code=="Enter"||e.code=="enter"||e.code=="NumpadEnter") ) { //鏈�閲嶈鏈�鍚庤皟鐢�1.鐧诲綍鏍¢獙鏂规硶 //this.login(); @@ -278,17 +254,17 @@ } }; }, - startURL() { - var url = window.location.href; - var testurl = ""; - if (url.indexOf("web") != -1) { - testurl = "/web"; + startURL () { + var url=window.location.href; + var testurl=""; + if(url.indexOf("web")!=-1) { + testurl="/web"; } - this.reportUrl = - window.location.origin + testurl + "/mapscreen/index.html"; + this.reportUrl= + window.location.origin+testurl+"/mapscreen/index.html"; }, }, - created() { + created () { this.startURL(); this.enterLogin(); }, diff --git a/src/components/navMenu.vue b/src/components/navMenu.vue index 57b86e2..c4fce7b 100644 --- a/src/components/navMenu.vue +++ b/src/components/navMenu.vue @@ -1,40 +1,28 @@ <template> - <div - class="NavBox" - @click.stop - > + <div class="NavBox" + @click.stop> <div class="topBox"> <div class="topTitle"></div> <div class="topMenu"> <div class="menuContent"> - <div - class="contentDiv" - @click="setMenuMove(index, item)" - v-for="(item, index) in listMenu" - > + <div class="contentDiv" + @click="setMenuMove(index, item)" + v-for="(item, index) in listMenu"> <div style="display: flex;align-items: center"> <div class="ImgMenu"> - <div - class="menuImage" - :class="changeSelectStyle == index ? item.checkClass : item.css" - ></div> + <div class="menuImage" + :class="changeSelectStyle == index ? item.checkClass : item.css"></div> </div> - <div - class="menulabel" - :class="{ changeStyle: changeSelectStyle == index }" - > + <div class="menulabel" + :class="{ changeStyle: changeSelectStyle == index }"> <span v-show="language"> {{ item.cnName }}</span> <span v-show="!language"> {{ item.enName }}</span> </div> </div> - <div - class="secondMenuDiv subpage_Div" - v-show="index == showFlag ? true :false" - > - <div - v-for="res in item.children" - @click="setLiClick(res,index)" - :class="{ changeLiStyle: changeliSelect == res.cnName }" - > + <div class="secondMenuDiv subpage_Div" + v-show="index == showFlag ? true :false"> + <div v-for="res in item.children" + @click="setLiClick(res,index)" + :class="{ changeLiStyle: changeliSelect == res.cnName }"> <span v-show="language"> {{ res.cnName }}</span> <span v-show="!language"> {{ res.enName }}</span> </div> </div> @@ -43,25 +31,19 @@ </div> <div class="topUser"> <div class="userLanguage"> - <div - class="userImage theme" - @click="themeChange" - ></div> - <div - class="userImage user2" - @click="switchLang" - ></div> + <div class="userImage theme" + @click="themeChange"></div> + <!-- <div class="userImage user2" + @click="switchLang"></div> --> </div> <div class="userName"> <div class="userImage user1"></div> <div class="userText"> <span>{{ this.$store.state.uname }}</span> - <el-link - @click="logOut" - :underline="false" - class="elLink" - >{{ $t('common.logout') }}</el-link> + <el-link @click="logOut" + :underline="false" + class="elLink">{{ $t('common.logout') }}</el-link> </div> </div> </div> @@ -71,12 +53,13 @@ </template> <script> -import { logout, selectMenuRecursive, sign_insertOpLog } from '@/api/api'; -import { removeToken, getToken } from '@/utils/auth'; +import { logout,selectMenuRecursive,sign_insertOpLog } from '@/api/api'; +import { removeToken,getToken } from '@/utils/auth'; import customElMenu from '../components/customElMenu.vue'; -import { queryMenuTree, getPerms } from '../api/api'; +import { queryMenuTree,getPerms } from '../api/api'; import colorChange from '../views/maintenance/colorChange.vue'; import { containsCoordinate } from 'ol/extent'; +import axios from "axios"; import Vue from 'vue'; import $ from 'jquery' export default { @@ -86,7 +69,7 @@ customElMenu, colorChange, }, - data() { + data () { return { themeColor: true, @@ -140,34 +123,34 @@ ] }; }, - created() { }, - mounted() { - this.$store.state.themeflag = false; + created () { }, + mounted () { + this.$store.state.themeflag=false; $("#app").removeClass("Black_theme"); this.getMenuTree(); - if (sessionStorage.getItem('changeliSelect')) { - this.$set(this, 'changeliSelect', sessionStorage.getItem('changeliSelect')) + if(sessionStorage.getItem('changeliSelect')) { + this.$set(this,'changeliSelect',sessionStorage.getItem('changeliSelect')) // this.changeliSelect = sessionStorage.getItem('changeliSelect') } - document.body.addEventListener('click', () => { - this.showFlag = null; - }, false); + document.body.addEventListener('click',() => { + this.showFlag=null; + },false); // this.$bus.$on('closeMenuSecond', res => { // this.showFlag = null; // }) - window.addEventListener('message', (e) => { + window.addEventListener('message',(e) => { - this.showFlag = null; + this.showFlag=null; }) }, computed: {}, methods: { - closeSecondMenu() { - this.showFlag = null + closeSecondMenu () { + this.showFlag=null }, - themeChange() { - this.$store.state.themeflag = !this.$store.state.themeflag; - if (this.$store.state.themeflag == true) { + themeChange () { + this.$store.state.themeflag=!this.$store.state.themeflag; + if(this.$store.state.themeflag==true) { $("#app").addClass("Black_theme"); } else { @@ -175,32 +158,32 @@ } }, - async getCookies() { - var boolean = this.getTimeCookies(); - if (boolean != true) { + async getCookies () { + var boolean=this.getTimeCookies(); + if(boolean!=true) { this.$router.push('/login'); return; } - if (this.$store.state.permsEntity.length == 0) { - const data = await getPerms(); - this.$store.state.permsEntity = data.result; + if(this.$store.state.permsEntity.length==0) { + const data=await getPerms(); + this.$store.state.permsEntity=data.result; } - this.$store.state.uname = JSON.parse( + this.$store.state.uname=JSON.parse( localStorage.getItem('LFToken') ).uname; - this.$store.state.unid = JSON.parse( + this.$store.state.unid=JSON.parse( localStorage.getItem('LFToken') ).userid; this.$router.push('/'); }, - getTimeCookies() { - if (!localStorage.getItem('LFToken')) { + getTimeCookies () { + if(!localStorage.getItem('LFToken')) { return false } - var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time); - var time2 = new Date(); - if (time2 > time1) { + var time1=new Date(JSON.parse(localStorage.getItem('LFToken')).time); + var time2=new Date(); + if(time2>time1) { return false; } else { return true; @@ -208,77 +191,77 @@ }, //涓婚鍒囨崲 - setThemeColors() { }, - async signInsertOpLog(m1, m2) { - var obj = { + setThemeColors () { }, + async signInsertOpLog (m1,m2) { + var obj={ m1: m1, m2: m2, } - const data = await sign_insertOpLog(obj); + const data=await sign_insertOpLog(obj); }, //榧犳爣绉诲叆鑿滃崟浜嬩欢 - setMenuMove(index, item) { + setMenuMove (index,item) { - if (item.perms != null && item.perms != "") { + if(item.perms!=null&&item.perms!="") { this.$router.push(item.url); - if (this.showFlag != null) { + if(this.showFlag!=null) { - this.changeliSelect = '%%'; - this.showFlag = null; + this.changeliSelect='%%'; + this.showFlag=null; } - if (item.url == "Thematic") { - this.signInsertOpLog("缁煎悎灞曠ず", item.cnName) + if(item.url=="Thematic") { + this.signInsertOpLog("缁煎悎灞曠ず",item.cnName) } - this.changeSelectStyle = index; - sessionStorage.setItem('changeSelectStyle', index) + this.changeSelectStyle=index; + sessionStorage.setItem('changeSelectStyle',index) } else { - if (this.showFlag != index) { - this.showFlag = index; + if(this.showFlag!=index) { + this.showFlag=index; } else { - this.showFlag = null; + this.showFlag=null; } } // - if (index === 4 || index === 5 || index === 6) { + if(index===4||index===5||index===6) { sessionStorage.removeItem('changeliSelect') - this.$set(this, 'changeliSelect', null) + this.$set(this,'changeliSelect',null) } }, - closeAllChildren() { - var val = this.listMenu - for (var i = 0; i < val.length; i++) { - let newItem = val[i]; - newItem.show = false; + closeAllChildren () { + var val=this.listMenu + for(var i=0;i<val.length;i++) { + let newItem=val[i]; + newItem.show=false; - Vue.set(val, i, newItem); + Vue.set(val,i,newItem); } }, - setShowFalseDiv(bolean) { - var index = this.showFlag; - if (index != null) { - let newItem = this.listMenu[index]; + setShowFalseDiv (bolean) { + var index=this.showFlag; + if(index!=null) { + let newItem=this.listMenu[index]; - newItem.show = bolean; - Vue.set(this.listMenu, index, newItem); + newItem.show=bolean; + Vue.set(this.listMenu,index,newItem); } }, - setLiClick(res, index) { - this.changeSelectStyle = index; - sessionStorage.setItem('changeSelectStyle', index) + setLiClick (res,index) { + this.changeSelectStyle=index; + sessionStorage.setItem('changeSelectStyle',index) sessionStorage.removeItem('hanleselectmochaitmo') sessionStorage.removeItem('hanleselectindex') // this.signInsertOpLog(this.listMenu[index].cnName, res.cnName) setTimeout(() => { - this.changeliSelect = res.cnName; - sessionStorage.setItem('changeliSelect', res.cnName) - if (res.url.indexOf('{fmeHost}') != -1) { - this.$store.reporturl = res.url; - sessionStorage.setItem('iframehttpurl', this.$store.reporturl) + this.changeliSelect=res.cnName; + sessionStorage.setItem('changeliSelect',res.cnName) + if(res.url.indexOf('{fmeHost}')!=-1) { + this.$store.reporturl=res.url; + sessionStorage.setItem('iframehttpurl',this.$store.reporturl) this.$router.push('/QualityInspection'); // if (location.href.indexOf('/WareInspection') == -1) { // this.$store.reporturl = res.url; @@ -287,29 +270,33 @@ // this.$bus.$emit('changeNaveUrl', res.url); // } } else { - this.$store.reporturl = null; - sessionStorage.setItem('iframehttpurl', null) + this.$store.reporturl=null; + sessionStorage.setItem('iframehttpurl',null) // sessionStorage.setItem('changeliSelect', null) this.$router.push(res.url); - this.$store.commit('currentPerms', res.perms); + this.$store.commit('currentPerms',res.perms); } this.setShowFalseDiv(false) - }, 100) + },100) }, - async getMenuTree() { + async getMenuTree () { this.getCookies(); - const data = await queryMenuTree(); + const data=await queryMenuTree(); + var that=this; - var that = this; - if (data.code == 200) { + that.showTreeData(data) + }, + showTreeData (data) { + var that=this; + if(data.code==200) { - if (data.result.length != 0) { - let menuLists = data.result.filter((value) => { - return value.pid == 1; + if(data.result.length!=0) { + let menuLists=data.result.filter((value) => { + return value.pid==1; }); - that.menuList = menuLists; + that.menuList=menuLists; that.setMenuTree(menuLists); } else { @@ -320,22 +307,22 @@ } } }, - async setMenuTree(res) { + async setMenuTree (res) { - for (var i in res) { - res[i].checkClass = res[i].css + '1'; - res[i].show = false; //鎺у埗鏄鹃殣 + for(var i in res) { + res[i].checkClass=res[i].css+'1'; + res[i].show=false; //鎺у埗鏄鹃殣 - if (res[i].perms == null || res[i].perms == "") { - const result = await selectMenuRecursive({ id: res[i].id }); + if(res[i].perms==null||res[i].perms=="") { + const result=await selectMenuRecursive({ id: res[i].id }); - if (result.code == 200) { + if(result.code==200) { - res[i].children = result.result.filter((value) => { - return value.isShow == 1; + res[i].children=result.result.filter((value) => { + return value.isShow==1; }) .filter((value) => { - return value.pid == res[i].id; + return value.pid==res[i].id; }); } @@ -353,7 +340,7 @@ // this.changeSelectStyle = this.listMenu.length - 1; // } - this.changeSelectStyle = sessionStorage.getItem('changeSelectStyle') + this.changeSelectStyle=sessionStorage.getItem('changeSelectStyle') // var strartMneu = res[i].children[0]; // this.$store.commit('currentPerms', strartMneu.perms); // this.changeliSelect = strartMneu.cnName; @@ -363,17 +350,17 @@ } } }, - treeData(source) { - let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 // console.log(cloneData); - if (cloneData.length != 0) { + if(cloneData.length!=0) { return cloneData.filter((father) => { // 寰幆鎵�鏈夐」 - let branchArr = cloneData.filter((child) => father.id == child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 - branchArr.length > 0 ? (father.children = branchArr) : ''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length>0? (father.children=branchArr):''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� - return father.pid == 1; // 杩斿洖涓�绾ц彍鍗� + return father.pid==1; // 杩斿洖涓�绾ц彍鍗� }); } else { this.$message({ @@ -382,16 +369,16 @@ }); } }, - logOut() { - this.$confirm('纭鏄惁閫�鍑虹櫥褰�?', '鎻愮ず', { + logOut () { + this.$confirm('纭鏄惁閫�鍑虹櫥褰�?','鎻愮ず',{ confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning', }) .then(async () => { - const data = await logout({ token: getToken() }); + const data=await logout({ token: getToken() }); // console.log(data); - if (data.code != 200) { + if(data.code!=200) { return this.$message.error('閫�鍑虹櫥褰曞け璐�'); } removeToken(); @@ -408,59 +395,59 @@ }); }); }, - switchLang() { + switchLang () { //褰撳墠en - if (this.lang == 'en') { + if(this.lang=='en') { //璇█鎹㈡垚zh - this.lang = 'zh'; - this.language = true; - this.$store.state.language = true; + this.lang='zh'; + this.language=true; + this.$store.state.language=true; //鑿滃崟鎹负zh - this.$store.commit('changeLang', 'zh'); + this.$store.commit('changeLang','zh'); //i18鎹㈡垚zh - this.$i18n.locale = this.lang; + this.$i18n.locale=this.lang; } //褰撳墠zh else { - this.lang = 'en'; - this.language = false; - this.$store.state.language = false; - this.$i18n.locale = this.lang; - this.$store.commit('changeLang', 'en'); //浼犻�掔偣鍑荤殑鑺傜偣 + this.lang='en'; + this.language=false; + this.$store.state.language=false; + this.$i18n.locale=this.lang; + this.$store.commit('changeLang','en'); //浼犻�掔偣鍑荤殑鑺傜偣 } }, - handleselect(index, indexPath, e) { + handleselect (index,indexPath,e) { // console.log(e.$attrs.perms); - this.$store.commit('currentPerms', e.$attrs.perms.perms); - if (Window.ws != null) { + this.$store.commit('currentPerms',e.$attrs.perms.perms); + if(Window.ws!=null) { Window.ws.close(); - Window.ws.onclose = () => { + Window.ws.onclose=() => { console.log('鏈嶅姟鍣ㄥ叧闂�'); }; - Window.ws = null; + Window.ws=null; } -debugger - if (index.indexOf('{fmeHost}') != -1) { + debugger + if(index.indexOf('{fmeHost}')!=-1) { this.$router.push('/databaseMonitoring'); - this.$store.commit('getIframe', index); - } else if (isNaN(Number(index))) { + this.$store.commit('getIframe',index); + } else if(isNaN(Number(index))) { this.$router.push(index); } }, }, watch: { - $route() { - let str = this.$route.path; - if (str[0] == '/') { - this.activeIndex = str.slice(1); + $route () { + let str=this.$route.path; + if(str[0]=='/') { + this.activeIndex=str.slice(1); } }, }, - created() { - this.$store.reporturl = null; - let str = this.$route.path; - if (str[0] == '/') { - this.activeIndex = str.slice(1); + created () { + this.$store.reporturl=null; + let str=this.$route.path; + if(str[0]=='/') { + this.activeIndex=str.slice(1); } }, }; diff --git a/src/router/index.js b/src/router/index.js index c3b608b..2285517 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -61,6 +61,25 @@ import QualityInspection from '@/views/PackageTwo/index.vue'; //鏁版嵁璐ㄦ-鍏ュ簱璐ㄦ +// 閫氫俊璧勬簮绠$悊 +import commResource from '../views/comm/commResource/commResource.vue' +// 閫氫俊缃戠郴绠$悊 +import commNetwork from '../views/comm/commNetwork/commNetwork.vue' +// 閫氫俊鎯冲畾绠$悊 +import commScenario from '../views/comm/commScenario/commScenario.vue' +// 澶氬獟浣撶礌鏉愮鐞� +import multimedia from '../views/comm/multimedia/multimedia.vue' +// 浠跨湡妯″瀷绠$悊 +import simulationModel from '../views/comm/simulationModel/simulationModel.vue' +//閫氫俊鏂规绠$悊 +import commScheme from '../views/comm/commScheme/commScheme.vue' +//鏂规鎷熷埗 +import planFormulation from '../views/comm/planFormulation/planFormulation.vue' +//鏂规璁茶瘎 +import planReview from '../views/comm/planReview/planReview.vue' +//閫氫俊姣佷激褰卞儚璇勪及 +import damageAssess from '../views/comm/damageAssess/damageAssess.vue' + const originalPush = VueRouter.prototype.push; @@ -98,6 +117,87 @@ component: Home, redirect: '/Synthesis', children: [ + { + path: '/damageAssess', + component: damageAssess, + name: 'damageAssess', + meta: { + title: '閫氫俊姣佷激褰卞搷璇勪及', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/planFormulation', + component: planFormulation, + name: 'planFormulation', + meta: { + title: '閫氫俊鏂规鎷熷埗', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/planReview', + component: planReview, + name: 'planReview', + meta: { + title: '鏂规璁茶瘎', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/commScheme', + component: commScheme, + name: 'commScheme', + meta: { + title: '閫氫俊鏂规绠$悊', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/simulationModel', + component: simulationModel, + name: 'simulationModel', + meta: { + title: '浠跨湡妯″瀷绠$悊', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/multimedia', + component: multimedia, + name: 'multimedia', + meta: { + title: '澶氬獟浣撶礌鏉愮鐞�', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/commScenario', + component: commScenario, + name: 'commScenario', + meta: { + title: '閫氫俊鎯冲畾绠$悊', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/commNetwork', + component: commNetwork, + name: 'commNetwork', + meta: { + title: '閫氫俊缃戠郴绠$悊', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, + { + path: '/commResource', + component: commResource, + name: 'commResource', + meta: { + title: '閫氫俊璧勬簮绠$悊', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, { path: '/WareInspection', component: WareInspection, @@ -536,6 +636,7 @@ requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� }, }, + ], }, ]; diff --git a/src/views/comm/commNetwork/commNetwork.vue b/src/views/comm/commNetwork/commNetwork.vue new file mode 100644 index 0000000..27f85bc --- /dev/null +++ b/src/views/comm/commNetwork/commNetwork.vue @@ -0,0 +1,229 @@ +<template> + <div class="contentBox"> + + <div class="box" + ref="box"> + <div class="left box_div"> + <el-menu :default-active="activeIndex" + background-color="transparent" + @select="handleselect"> + <customElMenu :menuData="menuList"></customElMenu> + </el-menu> + </div> + <div class="resize" + title="鏀剁缉渚ц竟鏍�"> + 鈰� + </div> + <div class="mid box_div"> + <My-bread :list="[ + `閫氫俊璧勬簮绠$悊`, + nodeName, + ]"></My-bread> + <el-divider /> + </div> + </div> + + </div> + +</template> + +<script> + +import { selectMenuRecursive,queryMenuTree,sign_insertOpLog } from '@/api/api.js' +import MyBread from "@/components/MyBread.vue"; +import customElMenu from "@/components/customElMenu.vue"; +export default { + components: { + MyBread, + customElMenu + + }, + data () { + return { + setMenuFlag: ' ', + activeIndex: ' ', + oriData: [], //鍘熷鏍戞暟鎹� + dirData: [], //el鏍戞暟鎹� + newData: [], //鎷栧姩鍚庢暟鎹� + lang: 'zh', + + menuList: [], + editTitle: '', + showPopover: false, + showEditInfoWrapper: false, + showEdit: false, + editMenu: false, + editCatalogue: false, + editUnit: false, + itemdetail: {}, + formLabelWidth: '70px', + pid: null, + nodeName: null, + }; + }, + created () { }, + mounted () { + + this.getTreeData(); + //宸﹀彸鎷栧嫊 + this.dragControllerDiv(); + }, + methods: { + //宸﹀彸鎷栧嫊 + dragControllerDiv: function() { + var resize=document.getElementsByClassName('resize'); + var left=document.getElementsByClassName('left'); + var mid=document.getElementsByClassName('mid'); + var box=document.getElementsByClassName('box'); + for(let i=0;i<resize.length;i++) { + // 榧犳爣鎸変笅浜嬩欢 + resize[i].onmousedown=function(e) { + //棰滆壊鏀瑰彉鎻愰啋 + resize[i].style.background='#818181'; + var startX=e.clientX; + resize[i].left=resize[i].offsetLeft; + // 榧犳爣鎷栧姩浜嬩欢 + document.onmousemove=function(e) { + var endX=e.clientX; + var moveLen=resize[i].left+(endX-startX); // 锛坋ndx-startx锛�=绉诲姩鐨勮窛绂汇�俽esize[i].left+绉诲姩鐨勮窛绂�=宸﹁竟鍖哄煙鏈�鍚庣殑瀹藉害 + var maxT=box[i].clientWidth-resize[i].offsetWidth; // 瀹瑰櫒瀹藉害 - 宸﹁竟鍖哄煙鐨勫搴� = 鍙宠竟鍖哄煙鐨勫搴� + + if(moveLen<205) moveLen=205; // 宸﹁竟鍖哄煙鐨勬渶灏忓搴︿负32px + if(moveLen>maxT-300) moveLen=maxT-300; //鍙宠竟鍖哄煙鏈�灏忓搴︿负150px + + resize[i].style.left=moveLen; // 璁剧疆宸︿晶鍖哄煙鐨勫搴� + + for(let j=0;j<left.length;j++) { + left[j].style.width=moveLen+'px'; + mid[j].style.width=(box[i].clientWidth-moveLen-10)+'px'; + } + }; + // 榧犳爣鏉惧紑浜嬩欢 + document.onmouseup=function(evt) { + //棰滆壊鎭㈠ + resize[i].style.background='#d6d6d6'; + document.onmousemove=null; + document.onmouseup=null; + resize[i].releaseCapture&&resize[i].releaseCapture(); //褰撲綘涓嶅湪闇�瑕佺户缁幏寰楅紶鏍囨秷鎭氨瑕佸簲璇ヨ皟鐢≧eleaseCapture()閲婃斁鎺� + }; + resize[i].setCapture&&resize[i].setCapture(); //璇ュ嚱鏁板湪灞炰簬褰撳墠绾跨▼鐨勬寚瀹氱獥鍙i噷璁剧疆榧犳爣鎹曡幏 + return false; + }; + } + }, + + + + //鑾峰彇鏍� + async getTreeData () { + const data=await queryMenuTree(); + + let menuLists=data.result.filter((value) => { + return value.url=="/commNetWork"; + }); + + this.pid=menuLists[0].id; + + const res=await selectMenuRecursive({ id: menuLists[0].id }); + + if(res.code==200) { + if(res.result.length!=0) { + let menuList=res.result.filter((value) => { + return value.type==1; + }); + this.menuList=this.treeData(menuList); + + this.m1=this.menuList[0].cnName; + this.setViewController(this.menuList[0]); + this.nodeName=this.m1 + const hanleselectindex=sessionStorage.getItem('hanleselectindex') + if(hanleselectindex) { + this.$nextTick(function() { + this.handleselecttwo(JSON.parse(hanleselectindex).url,JSON.parse(hanleselectindex)) + this.setViewController(JSON.parse(hanleselectindex)) + }) + } + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + } else { + this.$message.error('鎺ュ彛鎶ラ敊'); + } + + // this.treeList = this.treeData(data.result); + }, + setViewController (res) { + if(res.children!=null) { + this.setViewController(res.children[0]); + } else { + this.signInsertOpLog(this.m1,res.cnName) + this.$store.state.currentPerms=res.perms; + this.setMenuFlag=res.url; + this.activeIndex=res.url; + } + }, + async signInsertOpLog (m1,m2) { + var obj={ + m1: m1, + m2: m2, + } + // const data = await sign_insertOpLog(obj); + }, + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + var that=this; + // console.log(cloneData); + if(cloneData.length!=0) { + return cloneData.filter((father) => { + // 寰幆鎵�鏈夐」 + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length>0? (father.children=branchArr):''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� + // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� + return father.pid==that.pid; // 杩斿洖涓�绾ц彍鍗� + }); + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + }, + + handleselect (index,indexPath,e) { + const a=JSON.stringify(e.$attrs.perms) + this.signInsertOpLog(this.m1,e.$attrs.perms.cnName) + sessionStorage.setItem('hanleselectindex',a) + var data=e.$attrs.perms; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + this.nodeName=data.cnName + }, + + handleselecttwo (index,e) { + const a=JSON.stringify(e) + sessionStorage.setItem('hanleselectindex',a) + var data=e; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + }, + }, +}; +</script> + + \ No newline at end of file diff --git a/src/views/comm/commResource/commResource.vue b/src/views/comm/commResource/commResource.vue new file mode 100644 index 0000000..f1cc158 --- /dev/null +++ b/src/views/comm/commResource/commResource.vue @@ -0,0 +1,227 @@ +<template> + <div class="contentBox"> + + <div class="box" + ref="box"> + <div class="left box_div"> + <el-menu :default-active="activeIndex" + background-color="transparent" + @select="handleselect"> + <customElMenu :menuData="menuList"></customElMenu> + </el-menu> + </div> + <div class="resize" + title="鏀剁缉渚ц竟鏍�"> + 鈰� + </div> + <div class="mid box_div"> + <My-bread :list="[ + `閫氫俊璧勬簮绠$悊`, + nodeName, + ]"></My-bread> + <el-divider /> + </div> + </div> + + </div> + +</template> + +<script> + +import { selectMenuRecursive,queryMenuTree,sign_insertOpLog } from '@/api/api.js' +import MyBread from "@/components/MyBread.vue"; +import customElMenu from "@/components/customElMenu.vue"; +export default { + components: { + MyBread, + customElMenu + + }, + data () { + return { + setMenuFlag: ' ', + activeIndex: ' ', + oriData: [], //鍘熷鏍戞暟鎹� + dirData: [], //el鏍戞暟鎹� + newData: [], //鎷栧姩鍚庢暟鎹� + lang: 'zh', + + menuList: [], + editTitle: '', + showPopover: false, + showEditInfoWrapper: false, + showEdit: false, + editMenu: false, + editCatalogue: false, + editUnit: false, + itemdetail: {}, + formLabelWidth: '70px', + pid: null, + nodeName: null, + }; + }, + created () { }, + mounted () { + + this.getTreeData(); + //宸﹀彸鎷栧嫊 + this.dragControllerDiv(); + }, + methods: { + //宸﹀彸鎷栧嫊 + dragControllerDiv: function() { + var resize=document.getElementsByClassName('resize'); + var left=document.getElementsByClassName('left'); + var mid=document.getElementsByClassName('mid'); + var box=document.getElementsByClassName('box'); + for(let i=0;i<resize.length;i++) { + // 榧犳爣鎸変笅浜嬩欢 + resize[i].onmousedown=function(e) { + //棰滆壊鏀瑰彉鎻愰啋 + resize[i].style.background='#818181'; + var startX=e.clientX; + resize[i].left=resize[i].offsetLeft; + // 榧犳爣鎷栧姩浜嬩欢 + document.onmousemove=function(e) { + var endX=e.clientX; + var moveLen=resize[i].left+(endX-startX); // 锛坋ndx-startx锛�=绉诲姩鐨勮窛绂汇�俽esize[i].left+绉诲姩鐨勮窛绂�=宸﹁竟鍖哄煙鏈�鍚庣殑瀹藉害 + var maxT=box[i].clientWidth-resize[i].offsetWidth; // 瀹瑰櫒瀹藉害 - 宸﹁竟鍖哄煙鐨勫搴� = 鍙宠竟鍖哄煙鐨勫搴� + + if(moveLen<205) moveLen=205; // 宸﹁竟鍖哄煙鐨勬渶灏忓搴︿负32px + if(moveLen>maxT-300) moveLen=maxT-300; //鍙宠竟鍖哄煙鏈�灏忓搴︿负150px + + resize[i].style.left=moveLen; // 璁剧疆宸︿晶鍖哄煙鐨勫搴� + + for(let j=0;j<left.length;j++) { + left[j].style.width=moveLen+'px'; + mid[j].style.width=(box[i].clientWidth-moveLen-10)+'px'; + } + }; + // 榧犳爣鏉惧紑浜嬩欢 + document.onmouseup=function(evt) { + //棰滆壊鎭㈠ + resize[i].style.background='#d6d6d6'; + document.onmousemove=null; + document.onmouseup=null; + resize[i].releaseCapture&&resize[i].releaseCapture(); //褰撲綘涓嶅湪闇�瑕佺户缁幏寰楅紶鏍囨秷鎭氨瑕佸簲璇ヨ皟鐢≧eleaseCapture()閲婃斁鎺� + }; + resize[i].setCapture&&resize[i].setCapture(); //璇ュ嚱鏁板湪灞炰簬褰撳墠绾跨▼鐨勬寚瀹氱獥鍙i噷璁剧疆榧犳爣鎹曡幏 + return false; + }; + } + }, + + + + //鑾峰彇鏍� + async getTreeData () { + const data=await queryMenuTree(); + + let menuLists=data.result.filter((value) => { + return value.url=="/commResource"; + }); + this.pid=menuLists[0].id; + const res=await selectMenuRecursive({ id: menuLists[0].id }); + + if(res.code==200) { + if(res.result.length!=0) { + let menuList=res.result.filter((value) => { + return value.type==1; + }); + this.menuList=this.treeData(menuList); + console.log(this.menuList) + this.m1=this.menuList[0].cnName; + this.setViewController(this.menuList[0]); + this.nodeName=this.m1 + const hanleselectindex=sessionStorage.getItem('hanleselectindex') + if(hanleselectindex) { + this.$nextTick(function() { + this.handleselecttwo(JSON.parse(hanleselectindex).url,JSON.parse(hanleselectindex)) + this.setViewController(JSON.parse(hanleselectindex)) + }) + } + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + } else { + this.$message.error('鎺ュ彛鎶ラ敊'); + } + + // this.treeList = this.treeData(data.result); + }, + setViewController (res) { + if(res.children!=null) { + this.setViewController(res.children[0]); + } else { + this.signInsertOpLog(this.m1,res.cnName) + this.$store.state.currentPerms=res.perms; + this.setMenuFlag=res.url; + this.activeIndex=res.url; + } + }, + async signInsertOpLog (m1,m2) { + var obj={ + m1: m1, + m2: m2, + } + // const data = await sign_insertOpLog(obj); + }, + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + var that=this; + // console.log(cloneData); + if(cloneData.length!=0) { + return cloneData.filter((father) => { + // 寰幆鎵�鏈夐」 + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length>0? (father.children=branchArr):''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� + // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� + return father.pid==that.pid; // 杩斿洖涓�绾ц彍鍗� + }); + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + }, + + handleselect (index,indexPath,e) { + const a=JSON.stringify(e.$attrs.perms) + this.signInsertOpLog(this.m1,e.$attrs.perms.cnName) + sessionStorage.setItem('hanleselectindex',a) + var data=e.$attrs.perms; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + this.nodeName=data.cnName + }, + + handleselecttwo (index,e) { + const a=JSON.stringify(e) + sessionStorage.setItem('hanleselectindex',a) + var data=e; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + }, + }, +}; +</script> + + \ No newline at end of file diff --git a/src/views/comm/commScenario/commScenario.vue b/src/views/comm/commScenario/commScenario.vue new file mode 100644 index 0000000..8e4ced5 --- /dev/null +++ b/src/views/comm/commScenario/commScenario.vue @@ -0,0 +1,227 @@ +<template> + <div class="contentBox"> + + <div class="box" + ref="box"> + <div class="left box_div"> + <el-menu :default-active="activeIndex" + background-color="transparent" + @select="handleselect"> + <customElMenu :menuData="menuList"></customElMenu> + </el-menu> + </div> + <div class="resize" + title="鏀剁缉渚ц竟鏍�"> + 鈰� + </div> + <div class="mid box_div"> + <My-bread :list="[ + `閫氫俊璧勬簮绠$悊`, + nodeName, + ]"></My-bread> + <el-divider /> + </div> + </div> + + </div> + +</template> + +<script> + +import { selectMenuRecursive,queryMenuTree,sign_insertOpLog } from '@/api/api.js' +import MyBread from "@/components/MyBread.vue"; +import customElMenu from "@/components/customElMenu.vue"; +export default { + components: { + MyBread, + customElMenu + + }, + data () { + return { + setMenuFlag: ' ', + activeIndex: ' ', + oriData: [], //鍘熷鏍戞暟鎹� + dirData: [], //el鏍戞暟鎹� + newData: [], //鎷栧姩鍚庢暟鎹� + lang: 'zh', + + menuList: [], + editTitle: '', + showPopover: false, + showEditInfoWrapper: false, + showEdit: false, + editMenu: false, + editCatalogue: false, + editUnit: false, + itemdetail: {}, + formLabelWidth: '70px', + pid: null, + nodeName: null, + }; + }, + created () { }, + mounted () { + + this.getTreeData(); + //宸﹀彸鎷栧嫊 + this.dragControllerDiv(); + }, + methods: { + //宸﹀彸鎷栧嫊 + dragControllerDiv: function() { + var resize=document.getElementsByClassName('resize'); + var left=document.getElementsByClassName('left'); + var mid=document.getElementsByClassName('mid'); + var box=document.getElementsByClassName('box'); + for(let i=0;i<resize.length;i++) { + // 榧犳爣鎸変笅浜嬩欢 + resize[i].onmousedown=function(e) { + //棰滆壊鏀瑰彉鎻愰啋 + resize[i].style.background='#818181'; + var startX=e.clientX; + resize[i].left=resize[i].offsetLeft; + // 榧犳爣鎷栧姩浜嬩欢 + document.onmousemove=function(e) { + var endX=e.clientX; + var moveLen=resize[i].left+(endX-startX); // 锛坋ndx-startx锛�=绉诲姩鐨勮窛绂汇�俽esize[i].left+绉诲姩鐨勮窛绂�=宸﹁竟鍖哄煙鏈�鍚庣殑瀹藉害 + var maxT=box[i].clientWidth-resize[i].offsetWidth; // 瀹瑰櫒瀹藉害 - 宸﹁竟鍖哄煙鐨勫搴� = 鍙宠竟鍖哄煙鐨勫搴� + + if(moveLen<205) moveLen=205; // 宸﹁竟鍖哄煙鐨勬渶灏忓搴︿负32px + if(moveLen>maxT-300) moveLen=maxT-300; //鍙宠竟鍖哄煙鏈�灏忓搴︿负150px + + resize[i].style.left=moveLen; // 璁剧疆宸︿晶鍖哄煙鐨勫搴� + + for(let j=0;j<left.length;j++) { + left[j].style.width=moveLen+'px'; + mid[j].style.width=(box[i].clientWidth-moveLen-10)+'px'; + } + }; + // 榧犳爣鏉惧紑浜嬩欢 + document.onmouseup=function(evt) { + //棰滆壊鎭㈠ + resize[i].style.background='#d6d6d6'; + document.onmousemove=null; + document.onmouseup=null; + resize[i].releaseCapture&&resize[i].releaseCapture(); //褰撲綘涓嶅湪闇�瑕佺户缁幏寰楅紶鏍囨秷鎭氨瑕佸簲璇ヨ皟鐢≧eleaseCapture()閲婃斁鎺� + }; + resize[i].setCapture&&resize[i].setCapture(); //璇ュ嚱鏁板湪灞炰簬褰撳墠绾跨▼鐨勬寚瀹氱獥鍙i噷璁剧疆榧犳爣鎹曡幏 + return false; + }; + } + }, + + + + //鑾峰彇鏍� + async getTreeData () { + const data=await queryMenuTree(); + + let menuLists=data.result.filter((value) => { + return value.url=="/commScenario"; + }); + this.pid=menuLists[0].id; + const res=await selectMenuRecursive({ id: menuLists[0].id }); + + if(res.code==200) { + if(res.result.length!=0) { + let menuList=res.result.filter((value) => { + return value.type==1; + }); + this.menuList=this.treeData(menuList); + console.log(this.menuList) + this.m1=this.menuList[0].cnName; + this.setViewController(this.menuList[0]); + this.nodeName=this.m1 + const hanleselectindex=sessionStorage.getItem('hanleselectindex') + if(hanleselectindex) { + this.$nextTick(function() { + this.handleselecttwo(JSON.parse(hanleselectindex).url,JSON.parse(hanleselectindex)) + this.setViewController(JSON.parse(hanleselectindex)) + }) + } + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + } else { + this.$message.error('鎺ュ彛鎶ラ敊'); + } + + // this.treeList = this.treeData(data.result); + }, + setViewController (res) { + if(res.children!=null) { + this.setViewController(res.children[0]); + } else { + this.signInsertOpLog(this.m1,res.cnName) + this.$store.state.currentPerms=res.perms; + this.setMenuFlag=res.url; + this.activeIndex=res.url; + } + }, + async signInsertOpLog (m1,m2) { + var obj={ + m1: m1, + m2: m2, + } + // const data = await sign_insertOpLog(obj); + }, + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + var that=this; + // console.log(cloneData); + if(cloneData.length!=0) { + return cloneData.filter((father) => { + // 寰幆鎵�鏈夐」 + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length>0? (father.children=branchArr):''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� + // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� + return father.pid==that.pid; // 杩斿洖涓�绾ц彍鍗� + }); + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + }, + + handleselect (index,indexPath,e) { + const a=JSON.stringify(e.$attrs.perms) + this.signInsertOpLog(this.m1,e.$attrs.perms.cnName) + sessionStorage.setItem('hanleselectindex',a) + var data=e.$attrs.perms; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + this.nodeName=data.cnName + }, + + handleselecttwo (index,e) { + const a=JSON.stringify(e) + sessionStorage.setItem('hanleselectindex',a) + var data=e; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + }, + }, +}; +</script> + + \ No newline at end of file diff --git a/src/views/comm/commScheme/commScheme.vue b/src/views/comm/commScheme/commScheme.vue new file mode 100644 index 0000000..019ae73 --- /dev/null +++ b/src/views/comm/commScheme/commScheme.vue @@ -0,0 +1,227 @@ +<template> + <div class="contentBox"> + + <div class="box" + ref="box"> + <div class="left box_div"> + <el-menu :default-active="activeIndex" + background-color="transparent" + @select="handleselect"> + <customElMenu :menuData="menuList"></customElMenu> + </el-menu> + </div> + <div class="resize" + title="鏀剁缉渚ц竟鏍�"> + 鈰� + </div> + <div class="mid box_div"> + <My-bread :list="[ + `閫氫俊璧勬簮绠$悊`, + nodeName, + ]"></My-bread> + <el-divider /> + </div> + </div> + + </div> + +</template> + +<script> + +import { selectMenuRecursive,queryMenuTree,sign_insertOpLog } from '@/api/api.js' +import MyBread from "@/components/MyBread.vue"; +import customElMenu from "@/components/customElMenu.vue"; +export default { + components: { + MyBread, + customElMenu + + }, + data () { + return { + setMenuFlag: ' ', + activeIndex: ' ', + oriData: [], //鍘熷鏍戞暟鎹� + dirData: [], //el鏍戞暟鎹� + newData: [], //鎷栧姩鍚庢暟鎹� + lang: 'zh', + + menuList: [], + editTitle: '', + showPopover: false, + showEditInfoWrapper: false, + showEdit: false, + editMenu: false, + editCatalogue: false, + editUnit: false, + itemdetail: {}, + formLabelWidth: '70px', + pid: null, + nodeName: null, + }; + }, + created () { }, + mounted () { + + this.getTreeData(); + //宸﹀彸鎷栧嫊 + this.dragControllerDiv(); + }, + methods: { + //宸﹀彸鎷栧嫊 + dragControllerDiv: function() { + var resize=document.getElementsByClassName('resize'); + var left=document.getElementsByClassName('left'); + var mid=document.getElementsByClassName('mid'); + var box=document.getElementsByClassName('box'); + for(let i=0;i<resize.length;i++) { + // 榧犳爣鎸変笅浜嬩欢 + resize[i].onmousedown=function(e) { + //棰滆壊鏀瑰彉鎻愰啋 + resize[i].style.background='#818181'; + var startX=e.clientX; + resize[i].left=resize[i].offsetLeft; + // 榧犳爣鎷栧姩浜嬩欢 + document.onmousemove=function(e) { + var endX=e.clientX; + var moveLen=resize[i].left+(endX-startX); // 锛坋ndx-startx锛�=绉诲姩鐨勮窛绂汇�俽esize[i].left+绉诲姩鐨勮窛绂�=宸﹁竟鍖哄煙鏈�鍚庣殑瀹藉害 + var maxT=box[i].clientWidth-resize[i].offsetWidth; // 瀹瑰櫒瀹藉害 - 宸﹁竟鍖哄煙鐨勫搴� = 鍙宠竟鍖哄煙鐨勫搴� + + if(moveLen<205) moveLen=205; // 宸﹁竟鍖哄煙鐨勬渶灏忓搴︿负32px + if(moveLen>maxT-300) moveLen=maxT-300; //鍙宠竟鍖哄煙鏈�灏忓搴︿负150px + + resize[i].style.left=moveLen; // 璁剧疆宸︿晶鍖哄煙鐨勫搴� + + for(let j=0;j<left.length;j++) { + left[j].style.width=moveLen+'px'; + mid[j].style.width=(box[i].clientWidth-moveLen-10)+'px'; + } + }; + // 榧犳爣鏉惧紑浜嬩欢 + document.onmouseup=function(evt) { + //棰滆壊鎭㈠ + resize[i].style.background='#d6d6d6'; + document.onmousemove=null; + document.onmouseup=null; + resize[i].releaseCapture&&resize[i].releaseCapture(); //褰撲綘涓嶅湪闇�瑕佺户缁幏寰楅紶鏍囨秷鎭氨瑕佸簲璇ヨ皟鐢≧eleaseCapture()閲婃斁鎺� + }; + resize[i].setCapture&&resize[i].setCapture(); //璇ュ嚱鏁板湪灞炰簬褰撳墠绾跨▼鐨勬寚瀹氱獥鍙i噷璁剧疆榧犳爣鎹曡幏 + return false; + }; + } + }, + + + + //鑾峰彇鏍� + async getTreeData () { + const data=await queryMenuTree(); + + let menuLists=data.result.filter((value) => { + return value.url=="/commScheme"; + }); + this.pid=menuLists[0].id; + const res=await selectMenuRecursive({ id: menuLists[0].id }); + + if(res.code==200) { + if(res.result.length!=0) { + let menuList=res.result.filter((value) => { + return value.type==1; + }); + this.menuList=this.treeData(menuList); + console.log(this.menuList) + this.m1=this.menuList[0].cnName; + this.setViewController(this.menuList[0]); + this.nodeName=this.m1 + const hanleselectindex=sessionStorage.getItem('hanleselectindex') + if(hanleselectindex) { + this.$nextTick(function() { + this.handleselecttwo(JSON.parse(hanleselectindex).url,JSON.parse(hanleselectindex)) + this.setViewController(JSON.parse(hanleselectindex)) + }) + } + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + } else { + this.$message.error('鎺ュ彛鎶ラ敊'); + } + + // this.treeList = this.treeData(data.result); + }, + setViewController (res) { + if(res.children!=null) { + this.setViewController(res.children[0]); + } else { + this.signInsertOpLog(this.m1,res.cnName) + this.$store.state.currentPerms=res.perms; + this.setMenuFlag=res.url; + this.activeIndex=res.url; + } + }, + async signInsertOpLog (m1,m2) { + var obj={ + m1: m1, + m2: m2, + } + // const data = await sign_insertOpLog(obj); + }, + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + var that=this; + // console.log(cloneData); + if(cloneData.length!=0) { + return cloneData.filter((father) => { + // 寰幆鎵�鏈夐」 + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length>0? (father.children=branchArr):''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� + // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� + return father.pid==that.pid; // 杩斿洖涓�绾ц彍鍗� + }); + } else { + + this.$message.error('鏆傛棤鑿滃崟鏍忔暟鎹�'); + } + }, + + handleselect (index,indexPath,e) { + const a=JSON.stringify(e.$attrs.perms) + this.signInsertOpLog(this.m1,e.$attrs.perms.cnName) + sessionStorage.setItem('hanleselectindex',a) + var data=e.$attrs.perms; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + this.nodeName=data.cnName + }, + + handleselecttwo (index,e) { + const a=JSON.stringify(e) + sessionStorage.setItem('hanleselectindex',a) + var data=e; + this.$store.state.currentPerms=data.perms; + var index=data.url; + + if(index!=null) { + if(index.indexOf('http')!=-1) { + this.$store.commit('getIframe',data.url); + index='dataIfream'; + } + } + this.setMenuFlag=index; + }, + }, +}; +</script> + + \ No newline at end of file diff --git a/src/views/comm/damageAssess/damageAssess.vue b/src/views/comm/damageAssess/damageAssess.vue new file mode 100644 index 0000000..cda937e --- /dev/null +++ b/src/views/comm/damageAssess/damageAssess.vue @@ -0,0 +1,48 @@ + +<template> + <div class="dictionaryBox"> + <My-bread :list="[ + `閫氫俊鏁堣兘璇勪及`, + `閫氫俊姣佷激褰卞搷璇勪及`, + ]"></My-bread> + <el-divider /> + <div class="mainBox"> + + </div> + </div> +</template> + +<script> + +import MyBread from "@/components/MyBread.vue"; + +export default { + name: "multimedia", + components: { MyBread }, + data () { + return { + + }; + }, + watch: { + + }, + created () { + + }, + methods () { + + } +}; +</script> +<style lang="less" scoped> +//@import url(); 寮曞叆鍏叡css绫� +.dictionaryBox { + height: calc(100% - 40px); + width: calc(100% - 40px); + padding: 10px; + background: #f4f8ff; + margin: 10px; + border-radius: 5px; +} +</style> diff --git a/src/views/comm/multimedia/multimedia.vue b/src/views/comm/multimedia/multimedia.vue new file mode 100644 index 0000000..2ae03c0 --- /dev/null +++ b/src/views/comm/multimedia/multimedia.vue @@ -0,0 +1,48 @@ + +<template> + <div class="dictionaryBox"> + <My-bread :list="[ + `鏁版嵁璧勬簮绠$悊`, + `澶氬獟浣撶礌鏉愮鐞哷, + ]"></My-bread> + <el-divider /> + <div class="mainBox"> + + </div> + </div> +</template> + +<script> + +import MyBread from "@/components/MyBread.vue"; + +export default { + name: "multimedia", + components: { MyBread }, + data () { + return { + + }; + }, + watch: { + + }, + created () { + + }, + methods () { + + } +}; +</script> +<style lang="less" scoped> +//@import url(); 寮曞叆鍏叡css绫� +.dictionaryBox { + height: calc(100% - 40px); + width: calc(100% - 40px); + padding: 10px; + background: #f4f8ff; + margin: 10px; + border-radius: 5px; +} +</style> diff --git a/src/views/comm/planFormulation/planFormulation.vue b/src/views/comm/planFormulation/planFormulation.vue new file mode 100644 index 0000000..b877856 --- /dev/null +++ b/src/views/comm/planFormulation/planFormulation.vue @@ -0,0 +1,48 @@ + +<template> + <div class="dictionaryBox"> + <My-bread :list="[ + `閫氫俊鏂规绛瑰垝`, + `鏂规鎷熷埗`, + ]"></My-bread> + <el-divider /> + <div class="mainBox"> + + </div> + </div> +</template> + +<script> + +import MyBread from "@/components/MyBread.vue"; + +export default { + name: "multimedia", + components: { MyBread }, + data () { + return { + + }; + }, + watch: { + + }, + created () { + + }, + methods () { + + } +}; +</script> +<style lang="less" scoped> +//@import url(); 寮曞叆鍏叡css绫� +.dictionaryBox { + height: calc(100% - 40px); + width: calc(100% - 40px); + padding: 10px; + background: #f4f8ff; + margin: 10px; + border-radius: 5px; +} +</style> diff --git a/src/views/comm/planReview/planReview.vue b/src/views/comm/planReview/planReview.vue new file mode 100644 index 0000000..5d97cbc --- /dev/null +++ b/src/views/comm/planReview/planReview.vue @@ -0,0 +1,48 @@ + +<template> + <div class="dictionaryBox"> + <My-bread :list="[ + `閫氫俊鏂规绛瑰垝`, + `鏂规璁茶瘎`, + ]"></My-bread> + <el-divider /> + <div class="mainBox"> + + </div> + </div> +</template> + +<script> + +import MyBread from "@/components/MyBread.vue"; + +export default { + name: "multimedia", + components: { MyBread }, + data () { + return { + + }; + }, + watch: { + + }, + created () { + + }, + methods () { + + } +}; +</script> +<style lang="less" scoped> +//@import url(); 寮曞叆鍏叡css绫� +.dictionaryBox { + height: calc(100% - 40px); + width: calc(100% - 40px); + padding: 10px; + background: #f4f8ff; + margin: 10px; + border-radius: 5px; +} +</style> diff --git a/src/views/comm/simulationModel/simulationModel.vue b/src/views/comm/simulationModel/simulationModel.vue new file mode 100644 index 0000000..2827caa --- /dev/null +++ b/src/views/comm/simulationModel/simulationModel.vue @@ -0,0 +1,48 @@ + +<template> + <div class="dictionaryBox"> + <My-bread :list="[ + `鏁版嵁璧勬簮绠$悊`, + `浠跨湡妯″瀷绠$悊`, + ]"></My-bread> + <el-divider /> + <div class="mainBox"> + + </div> + </div> +</template> + +<script> + +import MyBread from "@/components/MyBread.vue"; + +export default { + name: "multimedia", + components: { MyBread }, + data () { + return { + + }; + }, + watch: { + + }, + created () { + + }, + methods () { + + } +}; +</script> +<style lang="less" scoped> +//@import url(); 寮曞叆鍏叡css绫� +.dictionaryBox { + height: calc(100% - 40px); + width: calc(100% - 40px); + padding: 10px; + background: #f4f8ff; + margin: 10px; + border-radius: 5px; +} +</style> diff --git a/src/views/datamanage/catalogueManage.vue b/src/views/datamanage/catalogueManage.vue index a6a4fe1..3d65cd2 100644 --- a/src/views/datamanage/catalogueManage.vue +++ b/src/views/datamanage/catalogueManage.vue @@ -7,28 +7,22 @@ <el-divider /> <div class="mainBox"> - <div - class="cataLogContent leftTree subpage_Div" - style="border: 1px solid #dcdfe6;" - > + <div class="cataLogContent leftTree subpage_Div" + style="border: 1px solid #dcdfe6;"> <div style="min-width: 450px"> - <el-tree - ref="tree" - :props="defaultProps" - node-key="id" - :data="dirList" - :highlight-current="true" - :expand-on-click-node="false" - :default-expanded-keys="expandData" - @node-click="handleNodeClick" - @node-contextmenu="openTreeMenu" - > + <el-tree ref="tree" + :props="defaultProps" + node-key="id" + :data="dirList" + :highlight-current="true" + :expand-on-click-node="false" + :default-expanded-keys="expandData" + @node-click="handleNodeClick" + @node-contextmenu="openTreeMenu"> </el-tree> - <div - class="right_menu box_divm" - id="menu" - v-show="showRightMenu" - > + <div class="right_menu box_divm" + id="menu" + v-show="showRightMenu"> <ul> <li @click="setMenuDataCopy">澶嶅埗</li> <li @click="setMenuDataPaste">绮樿创</li> @@ -37,14 +31,12 @@ </div> </div> <div class="cataLog_rightContent right subpage_Div"> - <div - class="inquire" - style=" + <div class="inquire" + style=" align-items: center; display: flex; justify-content: space-between; - " - > + "> <el-breadcrumb separator="/"> <el-breadcrumb-item :to="{ path: '/' }">{{ @@ -52,94 +44,74 @@ </el-breadcrumb> <div style="margin-right: -5px"> <div class="menuTop"> - <el-form - :inline="true" - class="demo-form-inline" - > + <el-form :inline="true" + class="demo-form-inline"> <el-form-item> - <el-button - v-show="directoryFlag" - icon="el-icon-download" - type="info" - size="small" - @click="setDirectoryDownload" - >{{ $t("shuJuGuanLi.butten.folderDownload") }}</el-button> + <el-button v-show="directoryFlag" + icon="el-icon-download" + type="info" + size="small" + @click="setDirectoryDownload">{{ $t("shuJuGuanLi.butten.folderDownload") }}</el-button> </el-form-item> <el-form-item> - <el-button - icon="el-icon-download" - type="info" - size="small" - @click="setTemplateDownload" - >{{ $t("shuJuGuanLi.butten.templateDownload") }}</el-button> + <el-button icon="el-icon-download" + type="info" + size="small" + @click="setTemplateDownload">{{ $t("shuJuGuanLi.butten.templateDownload") }}</el-button> </el-form-item> <el-form-item> - <el-upload - action - accept=".xlsx, .xls" - :auto-upload="false" - :show-file-list="false" - :on-change="handleChange" - :file-list="fileList" - > - <el-button - type="success" - icon="el-icon-plus" - size="small" - >{{ $t("shuJuGuanLi.butten.uploads") }}</el-button> + <el-upload action + accept=".xlsx, .xls" + :auto-upload="false" + :show-file-list="false" + :on-change="handleChange" + :file-list="fileList"> + <el-button type="success" + icon="el-icon-plus" + size="small">{{ $t("shuJuGuanLi.butten.uploads") }}</el-button> </el-upload> </el-form-item> <el-form-item> - <el-button - v-if="menuStatus.insert" - :disabled="itemdetail.pid == null ? true : false" - @click="setNewNode(1)" - type="success" - icon="el-icon-plus" - size="small" - >{{ $t("shuJuGuanLi.butten.NewPeer") }}</el-button> + <el-button v-if="menuStatus.insert" + :disabled="itemdetail.pid == null ? true : false" + @click="setNewNode(1)" + type="success" + icon="el-icon-plus" + size="small">{{ $t("shuJuGuanLi.butten.NewPeer") }}</el-button> </el-form-item> <el-form-item> - <el-button - v-if="menuStatus.insert" - :disabled="itemdetail.pid == null ? true : false" - @click="setNewNode(2)" - type="success" - icon="el-icon-plus" - size="small" - >{{ $t("shuJuGuanLi.butten.AddChild") }}</el-button> + <el-button v-if="menuStatus.insert" + :disabled="itemdetail.pid == null ? true : false" + @click="setNewNode(2)" + type="success" + icon="el-icon-plus" + size="small">{{ $t("shuJuGuanLi.butten.AddChild") }}</el-button> </el-form-item> <el-form-item> - <el-button - v-if="menuStatus.delete" - @click="setDelNode()" - :disabled="itemdetail.pid == null ? true : false" - type="danger" - icon="el-icon-delete" - size="small" - >{{ $t("shuJuGuanLi.butten.Delete") }}</el-button> + <el-button v-if="menuStatus.delete" + @click="setDelNode()" + :disabled="itemdetail.pid == null ? true : false" + type="danger" + icon="el-icon-delete" + size="small">{{ $t("shuJuGuanLi.butten.Delete") }}</el-button> </el-form-item> <el-form-item> - <el-button - v-if="menuStatus.update" - :disabled="itemdetail.pid == null ? true : false" - @click="setEditNode(1)" - type="info" - icon="el-icon-top" - size="small" - >{{ $t("shuJuGuanLi.butten.MoveUp") }}</el-button> + <el-button v-if="menuStatus.update" + :disabled="itemdetail.pid == null ? true : false" + @click="setEditNode(1)" + type="info" + icon="el-icon-top" + size="small">{{ $t("shuJuGuanLi.butten.MoveUp") }}</el-button> </el-form-item> <el-form-item> - <el-button - v-if="menuStatus.update" - :disabled="itemdetail.pid == null ? true : false" - @click="setEditNode(2)" - type="info" - icon="el-icon-bottom" - size="small" - >{{ $t("shuJuGuanLi.butten.MoveDown") }}</el-button> + <el-button v-if="menuStatus.update" + :disabled="itemdetail.pid == null ? true : false" + @click="setEditNode(2)" + type="info" + icon="el-icon-bottom" + size="small">{{ $t("shuJuGuanLi.butten.MoveDown") }}</el-button> </el-form-item> </el-form> </div> @@ -148,54 +120,38 @@ </div> <div class="dividing-line"></div> - <el-form - :model="itemdetail" - ref="itemdetail" - :rules="rules" - style="position: relative; padding-top: 18px" - > - <el-form-item - prop="name" - :label="$t('dataManage.dataUpObj.name')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.name" - size="small" - style=" max-width: 420px" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueName')" - clearable - /> + <el-form :model="itemdetail" + ref="itemdetail" + :rules="rules" + style="position: relative; padding-top: 18px"> + <el-form-item prop="name" + :label="$t('dataManage.dataUpObj.name')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.name" + size="small" + style=" max-width: 420px" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueName')" + clearable /> <!-- style="max-width: 400px"--> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.explain')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.descr" - type="textarea" - style=" max-width: 420px" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexplain')" - clearable - /> + <el-form-item :label="$t('dataManage.dataUpObj.explain')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.descr" + type="textarea" + style=" max-width: 420px" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexplain')" + clearable /> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.inspectionItems')" - :label-width="formLabelWidth" - > - <el-select - style="width: 420px" - v-model="itemdetail.checks" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexamine')" - multiple - > - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" - > + <el-form-item :label="$t('dataManage.dataUpObj.inspectionItems')" + :label-width="formLabelWidth"> + <el-select style="width: 420px" + v-model="itemdetail.checks" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexamine')" + multiple> + <el-option v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value"> </el-option> </el-select> <!-- <el-input @@ -208,17 +164,13 @@ <!-- resize="none"--> <!-- style="height: 100%; overflow: auto; max-width: 400px"--> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.fileExtension')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.exts" - type="textarea" - style=" max-width: 420px" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuesuffix')" - clearable - /> + <el-form-item :label="$t('dataManage.dataUpObj.fileExtension')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.exts" + type="textarea" + style=" max-width: 420px" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuesuffix')" + clearable /> </el-form-item> <!-- <el-form-item :label="$t('dataManage.dataUpObj.inspectionItems')" @@ -231,17 +183,13 @@ style="height: 100%; overflow: auto; max-width: 400px" /> </el-form-item>--> - <el-form-item - :label="$t('dataManage.dataUpObj.code')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.code" - disabled - type="textarea" - style=" max-width: 420px" - autosize - /> + <el-form-item :label="$t('dataManage.dataUpObj.code')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.code" + disabled + type="textarea" + style=" max-width: 420px" + autosize /> </el-form-item> <!-- <el-form-item :label="$t('dataManage.dataUpObj.catalogRemarks')" @@ -271,22 +219,16 @@ > </div>--> </el-form> - <div - slot="footer" - class="dialog-footer" - style="padding-left: 45% ;padding-top: 20px" - > - <el-button - v-if="menuStatus.update" - type="primary" - size="small" - @click="updCata('itemdetail')" - >{{ $t("common.preservation") }}</el-button> - <el-button - v-if="menuStatus.update" - size="small" - @click="reset" - >{{ $t("common.cancel") }}</el-button> + <div slot="footer" + class="dialog-footer" + style="padding-left: 45% ;padding-top: 20px"> + <el-button v-if="menuStatus.update" + type="primary" + size="small" + @click="updCata('itemdetail')">{{ $t("common.preservation") }}</el-button> + <el-button v-if="menuStatus.update" + size="small" + @click="reset">{{ $t("common.cancel") }}</el-button> </div> </div> </div> @@ -304,122 +246,84 @@ </div> --> <!-- </div> --> - <el-dialog - :title="$t('dataManage.dataUpObj.newDirectory')" - :visible.sync="dialogFormVisible" - :before-close="handleClose" - > - <el-form - :model="ruleForm" - ref="ruleForm" - :rules="rules" - > - <el-form-item - :label="$t('dataManage.dataUpObj.name')" - prop="name" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.name" - autocomplete="off" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueName')" - ></el-input> + <el-dialog :title="$t('dataManage.dataUpObj.newDirectory')" + :visible.sync="dialogFormVisible" + :before-close="handleClose"> + <el-form :model="ruleForm" + ref="ruleForm" + :rules="rules"> + <el-form-item :label="$t('dataManage.dataUpObj.name')" + prop="name" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.name" + autocomplete="off" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueName')"></el-input> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.explain')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.descr" - autocomplete="off" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexplain')" - ></el-input> + <el-form-item :label="$t('dataManage.dataUpObj.explain')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.descr" + autocomplete="off" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexplain')"></el-input> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.fileExtension')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.exts" - type="textarea" - resize="none" - style="height: 100%; overflow: auto" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuesuffix')" - /> + <el-form-item :label="$t('dataManage.dataUpObj.fileExtension')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.exts" + type="textarea" + resize="none" + style="height: 100%; overflow: auto" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuesuffix')" /> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.inspectionItems')" - :label-width="formLabelWidth" - > + <el-form-item :label="$t('dataManage.dataUpObj.inspectionItems')" + :label-width="formLabelWidth"> <!-- <el-input type="textarea" resize="none" /> --> - <el-select - v-model="ruleForm.checks" - multiple - style="width:100%;" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexamine')" - > - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" - > + <el-select v-model="ruleForm.checks" + multiple + style="width:100%;" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueexamine')"> + <el-option v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value"> </el-option> </el-select> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.code')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.code" - disabled - type="textarea" - resize="none" - style="height: 100%; overflow: auto" - /> + <el-form-item :label="$t('dataManage.dataUpObj.code')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.code" + disabled + type="textarea" + resize="none" + style="height: 100%; overflow: auto" /> </el-form-item> - <el-form-item - :label="$t('dataManage.dataUpObj.Remarks')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.bak" - autocomplete="off" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueRemarks')" - ></el-input> + <el-form-item :label="$t('dataManage.dataUpObj.Remarks')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.bak" + autocomplete="off" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueRemarks')"></el-input> </el-form-item> </el-form> - <div - slot="footer" - class="dialog-footer" - > + <div slot="footer" + class="dialog-footer"> <el-button @click="resetForm('ruleForm')">{{ $t("common.cancel") }}</el-button> - <el-button - class="primary" - @click="submitForm('ruleForm')" - v-loading.fullscreen.lock="fullscreenLoading" - >{{ $t("common.preservation") }}</el-button> + <el-button class="primary" + @click="submitForm('ruleForm')" + v-loading.fullscreen.lock="fullscreenLoading">{{ $t("common.preservation") }}</el-button> </div> </el-dialog> - <iframe - id="Iframe1" - src="" - style="display: none; border: 0; padding: 0; height: 0; width: 0" - ></iframe> - <div - class="loadBox" - v-if="loadDialogVisible" - > + <iframe id="Iframe1" + src="" + style="display: none; border: 0; padding: 0; height: 0; width: 0"></iframe> + <div class="loadBox" + v-if="loadDialogVisible"> <div style="widht:100%; margin:20px; color:white"> <div style="margin-left:99%"> <!-- <el-link @@ -428,12 +332,10 @@ > X</el-link> --> </div> </div> - <div - v-loading="true" - element-loading-background="rgba(0, 0, 0, 0.0) " - element-loading-text="鐩綍涓婁紶涓�,璇风瓑寰�..." - style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); " - > + <div v-loading="true" + element-loading-background="rgba(0, 0, 0, 0.0) " + element-loading-text="鐩綍涓婁紶涓�,璇风瓑寰�..." + style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); "> </div> </div> </div> @@ -459,9 +361,9 @@ components: { MyBread, }, - data() { - let validName = (rule, value, callback) => { - if (value === "" || value === null || value === undefined) { + data () { + let validName=(rule,value,callback) => { + if(value===""||value===null||value===undefined) { return callback(new Error("鐩綍鍚嶇О涓嶈兘涓虹┖")); } else { callback(); @@ -503,7 +405,7 @@ checks: [] }, rules: { - name: [{ required: true, validator: validName, trigger: "blur" }], + name: [{ required: true,validator: validName,trigger: "blur" }], }, newNode: null, expandData: [], @@ -514,43 +416,43 @@ { value: 'checkMain', label: '鎬昏川妫�' - }, { + },{ value: 'checkOsgb', label: 'OSGB妫�鏌�' - }, { + },{ value: 'checkXls', label: '琛ㄦ牸鏁版嵁妫�鏌�' - }, { + },{ value: 'checkLaz', label: '鐐逛簯妫�鏌�' - }, { + },{ value: 'checkDem', label: '楂樼▼妫�鏌�' - }, { + },{ value: 'checkAttrs', label: '灞炴�ф鏌�' - }, { + },{ value: 'checkTopology', label: '鎷撴墤妫�鏌�' - }, { + },{ value: 'checkDecorate', label: '鍥鹃潰鏁撮グ妫�鏌�' - }, { + },{ value: 'checkOrigin', label: '鍘熺偣妫�鏌�' - }, { + },{ value: 'checkDom', label: '鏍呮牸妫�鏌�' - }, { + },{ value: 'checkMath', label: '鏁板鍩虹妫�鏌�' - }, { + },{ value: 'checkMeta', label: '鍏冩暟鎹鏌�' - }, { + },{ value: 'checkLogical', label: '閫昏緫涓�鑷存�ф鏌�' - }, { + },{ value: 'checkSingleIntegrity', label: '鍗曢」鎴愭灉瀹屾暣鎬ф鏌�' } @@ -565,32 +467,32 @@ }, methods: { // 澶嶅埗 - setMenuDataCopy() { - this.checksCopyData = this.checksData; + setMenuDataCopy () { + this.checksCopyData=this.checksData; }, //绮樿创 - setMenuDataPaste() { - if (!this.checksCopyData) { + setMenuDataPaste () { + if(!this.checksCopyData) { return this.$message('鏈�変腑瑕佸鍒剁殑鑺傜偣'); } - var val = this.$refs.tree.getNode(this.checksCopyData).data; + var val=this.$refs.tree.getNode(this.checksCopyData).data; - var level = this.$refs.tree.getNode(this.checksData).data.level + 1; - this.setInsertCopyData([val], this.checksData, level); + var level=this.$refs.tree.getNode(this.checksData).data.level+1; + this.setInsertCopyData([val],this.checksData,level); }, - setInsertCopyData(val, pid, level) { - for (var i in val) { - var data = val[i]; - var pchildNodes = []; + setInsertCopyData (val,pid,level) { + for(var i in val) { + var data=val[i]; + var pchildNodes=[]; - if (this.$refs.tree.getNode(pid) && this.$refs.tree.getNode(pid).childNodes) { - pchildNodes = this.$refs.tree.getNode(pid).childNodes + if(this.$refs.tree.getNode(pid)&&this.$refs.tree.getNode(pid).childNodes) { + pchildNodes=this.$refs.tree.getNode(pid).childNodes } - var orderNum = this.getMaxOrderNum(pchildNodes); - var obj = { + var orderNum=this.getMaxOrderNum(pchildNodes); + var obj={ bak: data.bak, level: level, - orderNum: orderNum + 1, + orderNum: orderNum+1, pid: pid, checks: data.checks, name: data.name, @@ -598,11 +500,11 @@ exts: data.exts, } insertDir(obj).then((res) => { - if (res.code == 200) { + if(res.code==200) { this.getDirTree(); - if (data.children && data.children.length > 0) { + if(data.children&&data.children.length>0) { - this.setInsertCopyData(data.children, res.result, level + 1) + this.setInsertCopyData(data.children,res.result,level+1) } } }) @@ -613,78 +515,78 @@ - handleNodeClick(data, node) { - this.showRightMenu = false; - document.removeEventListener('click', this.closeRightMenu) + handleNodeClick (data,node) { + this.showRightMenu=false; + document.removeEventListener('click',this.closeRightMenu) this.layerFormInline(data) }, //鍙抽敭鑿滃崟 - openTreeMenu(event, data, node, obj) { - this.showRightMenu = true; - let menu = document.getElementById('menu') - menu.style.left = event.clientX + 20 + 'px' - menu.style.top = event.clientY + 'px' - document.addEventListener('click', this.closeRightMenu) - this.checksData = data.id; + openTreeMenu (event,data,node,obj) { + this.showRightMenu=true; + let menu=document.getElementById('menu') + menu.style.left=event.clientX+20+'px' + menu.style.top=event.clientY+'px' + document.addEventListener('click',this.closeRightMenu) + this.checksData=data.id; console.log(this.checksData) }, - closeRightMenu() { - this.showRightMenu = false; - document.removeEventListener('click', this.closeRightMenu) + closeRightMenu () { + this.showRightMenu=false; + document.removeEventListener('click',this.closeRightMenu) }, - setTemplateDownload() { - var url = window.location.href; - var testurl = window.location.origin + "/"; - if (url.indexOf("web") != -1) { - testurl = testurl + "/web/"; + setTemplateDownload () { + var url=window.location.href; + var testurl=window.location.origin+"/"; + if(url.indexOf("web")!=-1) { + testurl=testurl+"/web/"; } - testurl += dirTemplateFile - $("#Iframe1").attr("src", testurl).click() + testurl+=dirTemplateFile + $("#Iframe1").attr("src",testurl).click() }, - handleChange(file, fileList) { - this.file = file; - if (fileList.length > 0) { - this.fileList = [fileList[fileList.length - 1]]; //杩欎竴姝ワ紝鏄� 灞曠ず鏈�鍚庝竴娆¢�夋嫨鏂囦欢; + handleChange (file,fileList) { + this.file=file; + if(fileList.length>0) { + this.fileList=[fileList[fileList.length-1]]; //杩欎竴姝ワ紝鏄� 灞曠ず鏈�鍚庝竴娆¢�夋嫨鏂囦欢; this.handle(); } }, - async handle() { - let file = this.file?.raw; - if (!this.file) { + async handle () { + let file=this.file?.raw; + if(!this.file) { console.log("鏂囦欢鎵撳紑澶辫触"); return; } else { - const reader = new FileReader(); - let that = this; + const reader=new FileReader(); + let that=this; reader.readAsArrayBuffer(file); - reader.onload = function () { - const buffer = reader.result; - const bytes = new Uint8Array(buffer); - const length = bytes.byteLength; - let binary = ""; - for (let i = 0; i < length; i++) { - binary += String.fromCharCode(bytes[i]); + reader.onload=function() { + const buffer=reader.result; + const bytes=new Uint8Array(buffer); + const length=bytes.byteLength; + let binary=""; + for(let i=0;i<length;i++) { + binary+=String.fromCharCode(bytes[i]); } - const XLSX = require("xlsx"); - const wb = XLSX.read(binary, { + const XLSX=require("xlsx"); + const wb=XLSX.read(binary,{ type: "binary", }); - const outdata = XLSX.utils.sheet_to_json( + const outdata=XLSX.utils.sheet_to_json( wb.Sheets[wb.SheetNames[0]], { defval: null } ); // 榛樿绗竴琛屼笅涓虹┖涔熻兘瑙f瀽鍑虹涓�鍥涜 - var data = [...outdata]; + var data=[...outdata]; that.setLeToFc(data); }; } }, - setLeToFc(res) { - var arr = []; - for (var i in res) { - var value = this.getNameAndPname(res[i], res, i) + setLeToFc (res) { + var arr=[]; + for(var i in res) { + var value=this.getNameAndPname(res[i],res,i) arr.push({ name: value[0], pname: value[1], @@ -694,77 +596,77 @@ exts: res[i].exts, orderNum: null, pid: null, - tid: parseInt(value[2]) + 1, - sid: parseInt(value[3]) + 1 + tid: parseInt(value[2])+1, + sid: parseInt(value[3])+1 }) } - this.tableData = arr; + this.tableData=arr; this.setInsertData(this.tableData); }, - getNameAndPname(res, result, flag) { - var chLevel = null; - var faLevel = null; + getNameAndPname (res,result,flag) { + var chLevel=null; + var faLevel=null; - for (var i = 1; i < 8; i++) { - var lel = 'L' + i; - if (res[lel] != null) { - chLevel = i + for(var i=1;i<8;i++) { + var lel='L'+i; + if(res[lel]!=null) { + chLevel=i } } - if (chLevel == 1) { - return [res['L' + chLevel], null, flag, -1] + if(chLevel==1) { + return [res['L'+chLevel],null,flag,-1] } else { - faLevel = chLevel - 1; - for (var i = flag; i >= 0; i--) { - var val = result[i] - if (val['L' + faLevel]) { - return [res['L' + chLevel], val['L' + faLevel], flag, i] + faLevel=chLevel-1; + for(var i=flag;i>=0;i--) { + var val=result[i] + if(val['L'+faLevel]) { + return [res['L'+chLevel],val['L'+faLevel],flag,i] break; } } } }, - setInsertData(res) { - var list = this.excelData(res); - if (list.length != 0) { - if (list[0].pname != null) { + setInsertData (res) { + var list=this.excelData(res); + if(list.length!=0) { + if(list[0].pname!=null) { return this.$message.error("涓婁紶鏁版嵁閿欒锛岀涓�鏉℃暟鎹笉涓虹┖"); } this.getAllNodeId(res); } }, - async getAllNodeId(res) { - this.loadDialogVisible = true; - for (let i = 0; i < res.length; i++) { - var val = res[i]; - if (val.pname == null) { - val.orderNum = this.dirList[this.dirList.length - 1].orderNum + 1; - val.pid = 0; + async getAllNodeId (res) { + this.loadDialogVisible=true; + for(let i=0;i<res.length;i++) { + var val=res[i]; + if(val.pname==null) { + val.orderNum=this.dirList[this.dirList.length-1].orderNum+1; + val.pid=0; } else { this.tableData.filter((child) => { - if (child.tid == val.sid) { - val.pid = child.id; - val.orderNum = i + 1; + if(child.tid==val.sid) { + val.pid=child.id; + val.orderNum=i+1; } }); } - const data = await insertDir(val); - if (data.code != 200) { - this.$message.error("鐩綍涓婁紶澶辫触" + data.msg); - this.loadDialogVisible = false; + const data=await insertDir(val); + if(data.code!=200) { + this.$message.error("鐩綍涓婁紶澶辫触"+data.msg); + this.loadDialogVisible=false; break; } this.tableData.filter((child) => { - if (child.name == val.name && child.tid == val.tid) { - child.id = data.result; + if(child.name==val.name&&child.tid==val.tid) { + child.id=data.result; } }); - this.itemaName = data.result; + this.itemaName=data.result; // this.getDirTree(); // if (res[i].children) { @@ -772,58 +674,58 @@ // } } this.getDirTree(); - this.loadDialogVisible = false; + this.loadDialogVisible=false; }, - excelData(source) { - let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + excelData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 return cloneData.filter((father) => { // 寰幆鎵�鏈夐」 - let branchArr = cloneData.filter((child) => father.tid == child.sid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + let branchArr=cloneData.filter((child) => father.tid==child.sid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 - branchArr.length > 0 ? (father.children = branchArr) : ""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + branchArr.length>0? (father.children=branchArr):""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� - return father.sid == 0; // 杩斿洖涓�绾ц彍鍗� + return father.sid==0; // 杩斿洖涓�绾ц彍鍗� }); }, - readFile(file) { + readFile (file) { //鏂囦欢璇诲彇 return new Promise((resolve) => { - let reader = new FileReader(); + let reader=new FileReader(); reader.readAsBinaryString(file); //浠ヤ簩杩涘埗鐨勬柟寮忚鍙� - reader.onload = (ev) => { + reader.onload=(ev) => { resolve(ev.target.result); }; }); }, // 璇锋眰鐩綍鏍� - async getDirTree() { + async getDirTree () { //鑾峰彇鐩綍鏍戞渶澶D锛屾柊寤鸿妭鐐逛娇鐢� // queryMaxId().then((res) => { // this.id = res.data; // }); // 鑾峰彇鐩綍鏍戞暟鎹� - const data = await queryDirTree(); + const data=await queryDirTree(); - if (data.code != 200) { + if(data.code!=200) { return this.$message.error("椤圭洰鍒楄〃鏌ヨ澶辫触"); } - this.oriData = data.result; - this.newData = data.result; - this.dirList = this.treeData(data.result); + this.oriData=data.result; + this.newData=data.result; + this.dirList=this.treeData(data.result); var cdata; - if (this.currentData) { - var rs = JSON.parse(this.currentData); - cdata = this.$refs.tree.getNode(rs.id).data; + if(this.currentData) { + var rs=JSON.parse(this.currentData); + cdata=this.$refs.tree.getNode(rs.id).data; } else { - cdata = this.dirList[this.dirList.length - 1] + cdata=this.dirList[this.dirList.length-1] } this.$nextTick(() => { - this.expandData = [cdata.id]; + this.expandData=[cdata.id]; this.$refs.tree.setCurrentKey(cdata.id); this.layerFormInline(cdata) }); @@ -848,65 +750,65 @@ // } // }); }, - handleClose() { + handleClose () { this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?") .then((_) => { this.resetForm(); }) .catch((_) => { }); }, - treeData(source) { - let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 return cloneData.filter((father) => { // 寰幆鎵�鏈夐」 - let branchArr = cloneData.filter((child) => father.id == child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 - if (branchArr.length > 0) { - branchArr.sort(function (a, b) { - return a.orderNum - b.orderNum + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + if(branchArr.length>0) { + branchArr.sort(function(a,b) { + return a.orderNum-b.orderNum }) } - branchArr.length > 0 ? (father.children = branchArr) : ""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + branchArr.length>0? (father.children=branchArr):""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� - return father.pid == 0; // 杩斿洖涓�绾ц彍鍗� + return father.pid==0; // 杩斿洖涓�绾ц彍鍗� }); }, //鍚戜笂鍚戜笅绉诲姩 - setEditNode(res) { - let node = this.$refs.tree.getCurrentNode(); - let pchildNodes = this.$refs.tree.getNode(node.id).parent.childNodes; - let currentId = {}; - for (let i = 0; i < pchildNodes.length; i++) { - if (pchildNodes[i].data.id == node.id) { - currentId = i; + setEditNode (res) { + let node=this.$refs.tree.getCurrentNode(); + let pchildNodes=this.$refs.tree.getNode(node.id).parent.childNodes; + let currentId={}; + for(let i=0;i<pchildNodes.length;i++) { + if(pchildNodes[i].data.id==node.id) { + currentId=i; } } - switch (res) { + switch(res) { case 1: //鍚戜笂绉诲姩 - if (currentId != 0) { - const tempChildrenNodex1 = pchildNodes[currentId - 1]; - const tempChildrenNodex2 = pchildNodes[currentId]; + if(currentId!=0) { + const tempChildrenNodex1=pchildNodes[currentId-1]; + const tempChildrenNodex2=pchildNodes[currentId]; // tempChildrenNodex2.orderNum = // pchildNodes[currentId - 1].data.orderNum; // tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum; - const arr = []; + const arr=[]; this.oriData.filter((res) => { - if (res.id == tempChildrenNodex2.data.id) { + if(res.id==tempChildrenNodex2.data.id) { // res.orderNum = tempChildrenNodex2.orderNum; arr.push(res); - } else if (res.id == tempChildrenNodex1.data.id) { + } else if(res.id==tempChildrenNodex1.data.id) { // res.orderNum = tempChildrenNodex1.orderNum; arr.push(res); } }); - const orderNum = arr[1].orderNum - arr[1].orderNum = arr[0].orderNum - arr[0].orderNum = orderNum + const orderNum=arr[1].orderNum + arr[1].orderNum=arr[0].orderNum + arr[0].orderNum=orderNum - this.newData = arr; + this.newData=arr; this.sendChange(); } else { this.$message({ @@ -916,27 +818,27 @@ } break; case 2: //鍚戜笅绉诲姩 - if (currentId < pchildNodes.length - 1) { - const tempChildrenNodex1 = pchildNodes[currentId + 1]; - const tempChildrenNodex2 = pchildNodes[currentId]; + if(currentId<pchildNodes.length-1) { + const tempChildrenNodex1=pchildNodes[currentId+1]; + const tempChildrenNodex2=pchildNodes[currentId]; // tempChildrenNodex2.orderNum = // pchildNodes[currentId + 1].data.orderNum; // tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum; - const arr = []; + const arr=[]; this.oriData.filter((res) => { - if (res.id == tempChildrenNodex2.data.id) { + if(res.id==tempChildrenNodex2.data.id) { // res.orderNum = tempChildrenNodex2.orderNum; arr.push(res); - } else if (res.id == tempChildrenNodex1.data.id) { + } else if(res.id==tempChildrenNodex1.data.id) { // res.orderNum = tempChildrenNodex1.orderNum; arr.push(res); } }); - const orderNum = arr[1].orderNum - arr[1].orderNum = arr[0].orderNum - arr[0].orderNum = orderNum - this.newData = arr; + const orderNum=arr[1].orderNum + arr[1].orderNum=arr[0].orderNum + arr[0].orderNum=orderNum + this.newData=arr; this.sendChange(); } else { this.$message({ @@ -947,14 +849,14 @@ break; } }, - setDelNode() { - this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ョ洰褰�, 鏄惁缁х画?", "鎻愮ず", { + setDelNode () { + this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ョ洰褰�, 鏄惁缁х画?","鎻愮ず",{ confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning", }) .then(() => { - this.remove(this.newNode, this.itemdetail); + this.remove(this.newNode,this.itemdetail); }) .catch(() => { this.$message({ @@ -963,8 +865,8 @@ }); }); }, - insertStart() { - this.ruleForm = { + insertStart () { + this.ruleForm={ level: null, orderNum: null, pid: null, @@ -974,73 +876,73 @@ checks: [] } }, - setNewNode(res) { + setNewNode (res) { this.insertStart(); - var node = this.$refs.tree.getCurrentNode(); - this.newNode = node; - var id, lever, orderNum; - if (res == 1) { + var node=this.$refs.tree.getCurrentNode(); + this.newNode=node; + var id,lever,orderNum; + if(res==1) { //鏂板鍚岀骇 - id = this.itemdetail.pid; - let pchildNodes = this.$refs.tree.getNode(this.newNode.id).parent.childNodes - orderNum = this.getMaxOrderNum(pchildNodes); - lever = this.itemdetail.level; - } else if (res == 2) { + id=this.itemdetail.pid; + let pchildNodes=this.$refs.tree.getNode(this.newNode.id).parent.childNodes + orderNum=this.getMaxOrderNum(pchildNodes); + lever=this.itemdetail.level; + } else if(res==2) { //鏂板瀛愮骇 - id = this.itemdetail.id; - let pchildNodes = this.$refs.tree.getNode(this.newNode.id).childNodes - orderNum = this.getMaxOrderNum(pchildNodes); - lever = this.itemdetail.level + 1; + id=this.itemdetail.id; + let pchildNodes=this.$refs.tree.getNode(this.newNode.id).childNodes + orderNum=this.getMaxOrderNum(pchildNodes); + lever=this.itemdetail.level+1; } - this.ruleForm.pid = id; - this.ruleForm.level = lever; - this.ruleForm.orderNum = orderNum; - this.dialogFormVisible = true; + this.ruleForm.pid=id; + this.ruleForm.level=lever; + this.ruleForm.orderNum=orderNum; + this.dialogFormVisible=true; }, - getMaxOrderNum(res) { - var val = -100; - for (var i in res) { - if (res[i].data.orderNum > val) { - val = res[i].data.orderNum; + getMaxOrderNum (res) { + var val=-100; + for(var i in res) { + if(res[i].data.orderNum>val) { + val=res[i].data.orderNum; } } - val = val + 1; + val=val+1; return val; }, - append(node, data) { - this.dialogFormVisible = true; - this.ruleForm.pid = data.id; - this.ruleForm.orderNum = node.childNodes.length + 1; - this.ruleForm.level = data.level + 1; + append (node,data) { + this.dialogFormVisible=true; + this.ruleForm.pid=data.id; + this.ruleForm.orderNum=node.childNodes.length+1; + this.ruleForm.level=data.level+1; }, - resetForm(formName) { - this.dialogFormVisible = false; - this.ruleForm = {}; + resetForm (formName) { + this.dialogFormVisible=false; + this.ruleForm={}; this.$nextTick(() => { - this.ruleForm = {}; + this.ruleForm={}; // this.$refs[formName].resetFields(); }); }, - submitForm(formName) { + submitForm (formName) { this.$nextTick(() => { this.$refs[formName].validate((valid) => { - if (valid) { - this.fullscreenLoading = true; - var val = this.ruleForm; - if (this.ruleForm.checks) { - val.checks = this.ruleForm.checks.toString() + if(valid) { + this.fullscreenLoading=true; + var val=this.ruleForm; + if(this.ruleForm.checks) { + val.checks=this.ruleForm.checks.toString() } else { - val.checks = '' + val.checks='' } // var val = JSON.parse(JSON.stringify(this.ruleForm)) // this.itemdetail = val insertDir(val) .then((res) => { setTimeout(() => { - this.fullscreenLoading = false; + this.fullscreenLoading=false; - if (res.code == 200) { + if(res.code==200) { this.$message({ message: "娣诲姞鎴愬姛", type: "success", @@ -1048,16 +950,16 @@ // this.itemdetail = {}; // this.ruleForm = {}; - this.dialogFormVisible = false; + this.dialogFormVisible=false; this.$refs[formName].resetFields(); this.getDirTree(); } - }, 500); + },500); }) .catch((res) => { - this.itemdetail = {}; + this.itemdetail={}; this.$message.error("娣诲姞澶辫触"); - this.fullscreenLoading = false; + this.fullscreenLoading=false; console.log(res); }); } else { @@ -1067,48 +969,48 @@ }); }); }, - remove(node, data) { - this.itemaName = node.parent.data.id; + remove (node,data) { + this.itemaName=node.parent.data.id; - this.$confirm("姝ゆ搷浣滃皢鍒犻櫎璇ヨ妭鐐�, 鏄惁缁х画?", "鎻愮ず", { + this.$confirm("姝ゆ搷浣滃皢鍒犻櫎璇ヨ妭鐐�, 鏄惁缁х画?","鎻愮ず",{ confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning", }) .then(() => { //鍏勫紵閲嶆柊鎺掑簭 - const parent = node.parent; - const children = parent.data.children || parent.data; - children.splice(data.orderNum - 1, 1); - children.forEach((item, index) => { - item.orderNum = index + 1; + const parent=node.parent; + const children=parent.data.children||parent.data; + children.splice(data.orderNum-1,1); + children.forEach((item,index) => { + item.orderNum=index+1; }); this.traverseArr(data); //鑾峰彇鍒犻櫎鐨勫瓙ID this.delChildIDs.push(data.id); //瑕佸垹闄ょ殑鍏ㄩ儴ID - let delIDs = this.delChildIDs; + let delIDs=this.delChildIDs; Promise.all([ deleteDir({ ids: delIDs.toString() }), updateDirTrees(children), ]) .then((res) => { - if (res[0].code == 200 && res[1].code == 200) { + if(res[0].code==200&&res[1].code==200) { this.$message({ type: "success", message: "鍒犻櫎鎴愬姛!", }); - let pchildNodes = this.$refs.tree.getNode(this.itemdetail.id).parent; - if (pchildNodes.data.id) { - this.currentData = JSON.stringify(pchildNodes.data) + let pchildNodes=this.$refs.tree.getNode(this.itemdetail.id).parent; + if(pchildNodes.data.id) { + this.currentData=JSON.stringify(pchildNodes.data) } else { - this.currentData = null + this.currentData=null } - this.itemdetail = {}; + this.itemdetail={}; this.getDirTree(); - } else if (res[0].code == 200) { + } else if(res[0].code==200) { this.$message.error("鍒犻櫎鎴愬姛锛屼綅缃皟鏁村け璐�"); - } else if (res[1].code == 200) { + } else if(res[1].code==200) { this.$message.error("鍒犻櫎澶辫触,浣嶇疆璋冩暣鎴愬姛"); } else { this.$message.error("鍒犻櫎澶辫触"); @@ -1119,7 +1021,7 @@ // this.itemdetail = {}; }); //閲嶇疆瑕佸垹闄ょ殑瀛怚D - this.delChildIDs = []; + this.delChildIDs=[]; }) .catch(() => { this.$message("宸插彇娑堝垹闄�"); @@ -1139,8 +1041,8 @@ // // console.log(data); // console.log(this.flaten(res)); }, - traverseArr(obj) { - if (obj.children) { + traverseArr (obj) { + if(obj.children) { return obj.children.forEach((item) => { // console.log(item.id + "---" + item.name); // this.delChildID += "id=" + item.id + "&"; @@ -1150,64 +1052,64 @@ } return; }, - flaten(arr) { - return arr.reduce((p, v, i) => { - for (let i = 0; i < p.length; i++) { - if (p[i].children) { + flaten (arr) { + return arr.reduce((p,v,i) => { + for(let i=0;i<p.length;i++) { + if(p[i].children) { delete p[i].children; } } - return p.concat(v.children ? this.flaten(v.children).concat(v) : v); - }, []); + return p.concat(v.children? this.flaten(v.children).concat(v):v); + },[]); }, - handleDragStart(node, ev) { - this.old_dirDat = JSON.parse(JSON.stringify(this.dirList)); //灏嗗浠界殑dir閲嶆柊璧嬪�� + handleDragStart (node,ev) { + this.old_dirDat=JSON.parse(JSON.stringify(this.dirList)); //灏嗗浠界殑dir閲嶆柊璧嬪�� }, - handleDrop(draggingNode, dropNode, dropType, ev) { - this.$confirm("姝ゆ搷浣滃皢淇濆瓨鐩綍鏇存敼, 鏄惁缁х画?", "鎻愮ず", { + handleDrop (draggingNode,dropNode,dropType,ev) { + this.$confirm("姝ゆ搷浣滃皢淇濆瓨鐩綍鏇存敼, 鏄惁缁х画?","鎻愮ず",{ confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning", }) .then(() => { //鐖惰妭鐐� - let data = dropType != "inner" ? dropNode.parent.data : dropNode.data; + let data=dropType!="inner"? dropNode.parent.data:dropNode.data; // 鐖惰妭鐐逛腑鍏ㄩ儴瀛愯妭鐐� - let nodeData = - dropNode.level == 1 && dropType != "inner" ? data : data.children; + let nodeData= + dropNode.level==1&&dropType!="inner"? data:data.children; //鍙樻洿鑺傜偣 - nodeData.forEach((item, i) => { - if (dropType != "inner") { - if (draggingNode.data.pid === dropNode.data.pid) { - item.pid = item.pid; + nodeData.forEach((item,i) => { + if(dropType!="inner") { + if(draggingNode.data.pid===dropNode.data.pid) { + item.pid=item.pid; } else { - item.pid = dropNode.data.pid; + item.pid=dropNode.data.pid; } } else { - item.pid = data.id; + item.pid=data.id; } - item.orderNum = i + 1; + item.orderNum=i+1; }); - let arr = []; + let arr=[]; this.oriData.forEach((e) => { nodeData.forEach((item) => { - if (item.id === e.id) e = item; + if(item.id===e.id) e=item; }); arr.push(e); }); - this.newData = arr; + this.newData=arr; this.sendChange(); }) .catch(() => { this.$message("宸插彇娑堟洿鏀�"); - this.dirList = this.old_dirDat; //灏嗗浠界殑dir閲嶆柊璧嬪�� + this.dirList=this.old_dirDat; //灏嗗浠界殑dir閲嶆柊璧嬪�� }); }, - async sendChange() { - const data = await updateDirTrees(this.newData) + async sendChange () { + const data=await updateDirTrees(this.newData) - if (data.code != 200) { + if(data.code!=200) { return this.$message.error("绉诲姩澶辫触"); } this.getDirTree(); @@ -1225,64 +1127,64 @@ // }); }, - setDirectoryDownload() { - var url = BASE_URL + '/dir/downloadDir?token=' + getToken() + '&id=' + this.directoryData.id + setDirectoryDownload () { + var url=BASE_URL+'/dir/downloadDir?token='+getToken()+'&id='+this.directoryData.id console.log(url) - $("#Iframe1").attr("src", url).click() + $("#Iframe1").attr("src",url).click() }, - layerFormInline(data) { - if (data.pid == 0) { - this.directoryData = data; - this.directoryFlag = true; + layerFormInline (data) { + if(data.pid==0) { + this.directoryData=data; + this.directoryFlag=true; } else { - this.directoryFlag = false; + this.directoryFlag=false; } - this.newNode = this.$refs.tree.getNode(data.id); - this.backUpData = JSON.stringify(data); - var val = this.$refs.tree.getNode(data.id).data; - this.itemdetail = val; - this.currentData = JSON.stringify(data) + this.newNode=this.$refs.tree.getNode(data.id); + this.backUpData=JSON.stringify(data); + var val=this.$refs.tree.getNode(data.id).data; + this.itemdetail=val; + this.currentData=JSON.stringify(data) - var checks = []; - if (val.checks) { - if (val.checks.indexOf(',') > -1) { - var value = val.checks.split(','); - for (var i in value) { + var checks=[]; + if(val.checks) { + if(val.checks.indexOf(',')>-1) { + var value=val.checks.split(','); + for(var i in value) { checks.push(value[i]) } - } else if (val.checks.indexOf('[]') > -1) { + } else if(val.checks.indexOf('[]')>-1) { } else { checks.push(val.checks) } - this.itemdetail.checks = checks; + this.itemdetail.checks=checks; } else { - this.itemdetail.checks = [] + this.itemdetail.checks=[] } }, - async updCata(formName) { - this.fullscreenLoading = true; - var val = JSON.parse(JSON.stringify(this.itemdetail)); - val.orderNum = this.newNode.data.orderNum; + async updCata (formName) { + this.fullscreenLoading=true; + var val=JSON.parse(JSON.stringify(this.itemdetail)); + val.orderNum=this.newNode.data.orderNum; - var value = this.itemdetail.checks.toString() - val.checks = value; - const data = await updateDirTree(val); - this.currentData = JSON.stringify(this.itemdetail) + var value=this.itemdetail.checks.toString() + val.checks=value; + const data=await updateDirTree(val); + this.currentData=JSON.stringify(this.itemdetail) - if (data.code != 200) { - this.fullscreenLoading = false; + if(data.code!=200) { + this.fullscreenLoading=false; return this.$message.error("淇敼澶辫触"); } this.$message({ message: '淇敼鎴愬姛', type: 'success' }); - this.fullscreenLoading = false; + this.fullscreenLoading=false; this.getDirTree(); // this.$nextTick(() => { @@ -1318,59 +1220,59 @@ // }); // }); }, - reset(formName) { - this.itemdetail = {}; + reset (formName) { + this.itemdetail={}; // this.$refs[formName].resetFields(); - if (this.backUpData != "") { - this.itemdetail = JSON.parse(this.backUpData); - var val = JSON.parse(this.backUpData); - var checks = []; - if (val.checks) { - if (val.checks.indexOf(',') > -1) { - var value = val.checks.split(','); - for (var i in value) { + if(this.backUpData!="") { + this.itemdetail=JSON.parse(this.backUpData); + var val=JSON.parse(this.backUpData); + var checks=[]; + if(val.checks) { + if(val.checks.indexOf(',')>-1) { + var value=val.checks.split(','); + for(var i in value) { checks.push(value[i]) } } else { checks.push(val.checks) } - this.itemdetail.checks = checks; + this.itemdetail.checks=checks; } else { - this.itemdetail.checks = [] + this.itemdetail.checks=[] } } }, - showPermsMenu(res) { - switch (res.tag) { + showPermsMenu (res) { + switch(res.tag) { case "/delete": - this.menuStatus.delete = true; + this.menuStatus.delete=true; break; case "/insert": - this.menuStatus.insert = true; + this.menuStatus.insert=true; break; case "/update": - this.menuStatus.update = true; + this.menuStatus.update=true; break; } }, - getPerms() { - var val = this.$store.state.currentPerms; - var permsEntity = this.$store.state.permsEntity; - if (!permsEntity || !permsEntity.length) { + getPerms () { + var val=this.$store.state.currentPerms; + var permsEntity=this.$store.state.permsEntity; + if(!permsEntity||!permsEntity.length) { getPerms().then((res) => { - if (res.code == 200) { - permsEntity = res.result; + if(res.code==200) { + permsEntity=res.result; } }); } - for (var i = 0; i < permsEntity.length; i++) { - if (val === permsEntity[i].perms) { + for(var i=0;i<permsEntity.length;i++) { + if(val===permsEntity[i].perms) { this.showPermsMenu(permsEntity[i]); } } }, }, - mounted() { + mounted () { this.getDirTree(); this.getPerms(); }, @@ -1380,9 +1282,12 @@ <style lang="less" scoped> .subpage_Box { //height: 96%; - width: 98%; + width: calc(98% - 20px); + height: calc(95% - 20px); padding: 1%; border-radius: 10px; + background: #f4f8ff; + margin: 10px; // .cataLogContent { // width: 100%; // height: 100%; diff --git a/src/views/maintenance/menuSettings.vue b/src/views/maintenance/menuSettings.vue index 0a89703..46f0caf 100644 --- a/src/views/maintenance/menuSettings.vue +++ b/src/views/maintenance/menuSettings.vue @@ -10,200 +10,155 @@ <div class="cataLogContent"> <div class="left_Tree subpage_Div"> <div style="width:auto"> - <el-tree - ref="tree" - :props="defaultProps" - node-key="id" - highlight-current - :data="menuList" - :expand-on-click-node="false" - :default-expand-all="true" - @node-click="handleNodeClick" - > + <el-tree ref="tree" + :props="defaultProps" + node-key="id" + highlight-current + :data="menuList" + :expand-on-click-node="false" + :default-expand-all="true" + @node-click="handleNodeClick"> </el-tree> </div> </div> <div class="right_menu subpage_Div"> <div style="display:flex;justify-content:right;align-items: center;padding-bottom: 14px"> - <el-breadcrumb separator="/" style="display: none"> + <el-breadcrumb separator="/" + style="display: none"> <el-breadcrumb-item :to="{ path: '/' }">{{ $t('dataManage.dictionaryManageObj.particulars') }}</el-breadcrumb-item> </el-breadcrumb> <div> - <el-button - v-if="menuStatus.insert" - :disabled="itemdetail.pid == null ? true : false" - @click="setNewNode(1)" - type="success" - icon="el-icon-plus" - size="small" - >{{$t('operatManage.menuSetObj.insert')}}</el-button> - <el-button - v-if="menuStatus.insert" - :disabled="itemdetail.pid == null ? true : false" - @click="setNewNode(2)" - type="success" - icon="el-icon-plus" - size="small" - >{{$t('operatManage.menuSetObj.subInsert')}}</el-button> - <el-button - v-if="menuStatus.delete" - @click="setDelNode()" - :disabled="itemdetail.pid == null ? true : false" - type="danger" - icon="el-icon-delete" - size="small" - >{{$t('operatManage.menuSetObj.delete')}}</el-button> - <el-button - v-if="menuStatus.update" - :disabled="itemdetail.pid == null ? true : false" - @click="setEditNode(1)" - type="info" - icon="el-icon-top" - size="small" - >{{$t('operatManage.menuSetObj.moveUp')}}</el-button> - <el-button - v-if="menuStatus.update" - :disabled="itemdetail.pid == null ? true : false" - @click="setEditNode(2)" - type="info" - icon="el-icon-bottom" - size="small" - >{{$t('operatManage.menuSetObj.moveDown')}}</el-button> + <el-button :disabled="itemdetail.pid == null ? true : false" + @click="setNewNode(1)" + type="success" + icon="el-icon-plus" + size="small">{{$t('operatManage.menuSetObj.insert')}}</el-button> + <el-button :disabled="itemdetail.pid == null ? true : false" + @click="setNewNode(2)" + type="success" + icon="el-icon-plus" + size="small">{{$t('operatManage.menuSetObj.subInsert')}}</el-button> + <el-button @click="setDelNode()" + :disabled="itemdetail.pid == null ? true : false" + type="danger" + icon="el-icon-delete" + size="small">{{$t('operatManage.menuSetObj.delete')}}</el-button> + <el-button :disabled="itemdetail.pid == null ? true : false" + @click="setEditNode(1)" + type="info" + icon="el-icon-top" + size="small">{{$t('operatManage.menuSetObj.moveUp')}}</el-button> + <el-button :disabled="itemdetail.pid == null ? true : false" + @click="setEditNode(2)" + type="info" + icon="el-icon-bottom" + size="small">{{$t('operatManage.menuSetObj.moveDown')}}</el-button> </div> </div> <div class="dividing-line"></div> -<!-- <el-divider />--> + <!-- <el-divider />--> <div class="form_box"> - <el-form - :model="itemdetail" - ref="itemdetail" - :rules="rules" - label-width="130px" - > - <el-form-item - prop="enName" - :label="$t('operatManage.menuSetObj.enName')" - :label-width="formLabelWidth" - > - <el-input - clear="el_input" - v-model="itemdetail.enName" - :placeholder="$t('operatManage.menuSetObj.enNameHolder')" - autocomplete="off" - ></el-input> + <el-form :model="itemdetail" + ref="itemdetail" + :rules="rules" + label-width="130px"> + <el-form-item prop="enName" + :label="$t('operatManage.menuSetObj.enName')" + :label-width="formLabelWidth"> + <el-input clear="el_input" + v-model="itemdetail.enName" + :placeholder="$t('operatManage.menuSetObj.enNameHolder')" + autocomplete="off"></el-input> </el-form-item> - <el-form-item - prop="cnName" - :label="$t('operatManage.menuSetObj.cnName')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.cnName" - :placeholder="$t('operatManage.menuSetObj.cnNameHolder')" - autocomplete="off" - ></el-input> + <el-form-item prop="cnName" + :label="$t('operatManage.menuSetObj.cnName')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.cnName" + :placeholder="$t('operatManage.menuSetObj.cnNameHolder')" + autocomplete="off"></el-input> </el-form-item> -<!-- <el-form-item--> -<!-- :label="$t('operatManage.menuSetObj.icon')"--> -<!-- :label-width="formLabelWidth"--> -<!-- >--> -<!-- <el-input--> -<!-- v-model="itemdetail.icon"--> -<!-- :placeholder="$t('operatManage.menuSetObj.iconHolder')"--> -<!-- autocomplete="off"--> -<!-- ></el-input>--> -<!-- </el-form-item>--> - <el-form-item - prop="isShow" - :label="$t('operatManage.menuSetObj.isShow')" - :label-width="formLabelWidth" - > - <el-select - style="width: 400px" - :popper-append-to-body="false" - v-model="itemdetail.isShow" - :placeholder="$t('operatManage.menuSetObj.show')" - > - <el-option :label="$t('operatManage.menuSetObj.hiddeen')" value="0" /> - <el-option :label="$t('operatManage.menuSetObj.isshow')" value="1" /> -<!-- <el-option--> -<!-- v-for="item in options1"--> -<!-- :key="item.value"--> -<!-- :label="item.label"--> -<!-- :value="item.value"--> -<!-- >--> -<!-- </el-option>--> + <!-- <el-form-item--> + <!-- :label="$t('operatManage.menuSetObj.icon')"--> + <!-- :label-width="formLabelWidth"--> + <!-- >--> + <!-- <el-input--> + <!-- v-model="itemdetail.icon"--> + <!-- :placeholder="$t('operatManage.menuSetObj.iconHolder')"--> + <!-- autocomplete="off"--> + <!-- ></el-input>--> + <!-- </el-form-item>--> + <el-form-item prop="isShow" + :label="$t('operatManage.menuSetObj.isShow')" + :label-width="formLabelWidth"> + <el-select style="width: 400px" + :popper-append-to-body="false" + v-model="itemdetail.isShow" + :placeholder="$t('operatManage.menuSetObj.show')"> + <el-option :label="$t('operatManage.menuSetObj.hiddeen')" + value="0" /> + <el-option :label="$t('operatManage.menuSetObj.isshow')" + value="1" /> + <!-- <el-option--> + <!-- v-for="item in options1"--> + <!-- :key="item.value"--> + <!-- :label="item.label"--> + <!-- :value="item.value"--> + <!-- >--> + <!-- </el-option>--> </el-select> </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.menuUrl')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.url" - :placeholder="$t('operatManage.menuSetObj.menuUrlHolder')" - autocomplete="off" - ></el-input> + <el-form-item :label="$t('operatManage.menuSetObj.menuUrl')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.url" + :placeholder="$t('operatManage.menuSetObj.menuUrlHolder')" + autocomplete="off"></el-input> </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.authorize')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.perms" - :placeholder="$t('operatManage.menuSetObj.permsHolder')" - autocomplete="off" - ></el-input> + <el-form-item :label="$t('operatManage.menuSetObj.authorize')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.perms" + :placeholder="$t('operatManage.menuSetObj.permsHolder')" + autocomplete="off"></el-input> </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.type')" - prop="type" - :label-width="formLabelWidth" - > - <el-select - style="width: 400px" - :popper-append-to-body="false" - v-model="itemdetail.type" - :placeholder="$t('operatManage.menuSetObj.typeHolder')" - > - <el-option :label="$t('operatManage.menuSetObj.rootpath')" value="0" /> - <el-option :label="$t('operatManage.menuSetObj.menu')" value="1" /> - <el-option :label="$t('operatManage.menuSetObj.button')" value="2" /> -<!-- <el-option--> -<!-- v-for="item in options2"--> -<!-- :key="item.value"--> -<!-- :label="item.label"--> -<!-- :value="item.value"--> -<!-- >--> -<!-- </el-option>--> + <el-form-item :label="$t('operatManage.menuSetObj.type')" + prop="type" + :label-width="formLabelWidth"> + <el-select style="width: 400px" + :popper-append-to-body="false" + v-model="itemdetail.type" + :placeholder="$t('operatManage.menuSetObj.typeHolder')"> + <el-option :label="$t('operatManage.menuSetObj.rootpath')" + value="0" /> + <el-option :label="$t('operatManage.menuSetObj.menu')" + value="1" /> + <el-option :label="$t('operatManage.menuSetObj.button')" + value="2" /> + <!-- <el-option--> + <!-- v-for="item in options2"--> + <!-- :key="item.value"--> + <!-- :label="item.label"--> + <!-- :value="item.value"--> + <!-- >--> + <!-- </el-option>--> </el-select> </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.bak')" - :label-width="formLabelWidth" - > - <el-input - v-model="itemdetail.bak" - autocomplete="off" - :placeholder="$t('operatManage.menuSetObj.bakHolder')" - ></el-input> + <el-form-item :label="$t('operatManage.menuSetObj.bak')" + :label-width="formLabelWidth"> + <el-input v-model="itemdetail.bak" + autocomplete="off" + :placeholder="$t('operatManage.menuSetObj.bakHolder')"></el-input> </el-form-item> - <div v-if="menuStatus.update"> + <div> <el-form-item> - <el-button - size="small" - type="primary" - @click="updMenu('itemdetail')" - >{{ $t('common.confirm') }}</el-button> - <el-button - size="small" - type="info" - @click="reset('itemdetail')" - >{{ + <el-button size="small" + type="primary" + @click="updMenu('itemdetail')">{{ $t('common.confirm') }}</el-button> + <el-button size="small" + type="info" + @click="reset('itemdetail')">{{ $t('common.cancel') }}</el-button> </el-form-item> @@ -214,140 +169,96 @@ </div> </div> - <el-dialog - :title="$t('common.append')" - :visible.sync="dialogFormVisible" - :before-close="handleClose" - > - <div style="height: 500px; overflow: auto"> - <el-form - :model="ruleForm" - ref="ruleForm" - :rules="rules" - label-position="top" - > - <el-form-item - prop="enName" - :label="$t('operatManage.menuSetObj.enName')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.enName" - autocomplete="off" - style="width:85%" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.enName')" - ></el-input> - </el-form-item> - <el-form-item - prop="cnName" - :label="$t('operatManage.menuSetObj.cnName')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.cnName" - autocomplete="off" - style="width:85%" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.cnName')" - ></el-input> - </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.icon')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.icon" - autocomplete="off" - style="width:85%" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.icon')" - ></el-input> - </el-form-item> - <el-form-item - prop="isShow" - :label="$t('operatManage.menuSetObj.isShow')" - :label-width="formLabelWidth" - > - <el-select - :popper-append-to-body="false" - style="width:85%" - v-model="ruleForm.isShow" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('operatManage.menuSetObj.isShow')" - > - <el-option - v-for="item in options1" - :key="item.value" - :label="item.label" - :value="item.value" - > - </el-option> - </el-select> - </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.menuUrl')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.url" - autocomplete="off" - style="width:85%" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.menuUrl')" - ></el-input> - </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.authorize')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.perms" - autocomplete="off" - style="width:85%" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.authorize')" - ></el-input> - </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.type')" - prop="type" - :label-width="formLabelWidth" - > - <el-select - :popper-append-to-body="false" - style="width:85%" - v-model="ruleForm.type" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('operatManage.menuSetObj.type')" - > - <el-option - v-for="item in options2" - :key="item.value" - :label="item.label" - :value="item.value" - > - </el-option> - </el-select> - </el-form-item> - <el-form-item - :label="$t('operatManage.menuSetObj.bak')" - :label-width="formLabelWidth" - > - <el-input - v-model="ruleForm.bak" - autocomplete="off" - style="width:85%" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.bak')" - ></el-input> - </el-form-item> - </el-form> - </div> - <div - slot="footer" - class="dialog-footer" - > + <el-dialog :title="$t('common.append')" + :visible.sync="dialogFormVisible" + :before-close="handleClose"> + <div style="height: 500px; overflow: auto"> + <el-form :model="ruleForm" + ref="ruleForm" + :rules="rules" + label-position="top"> + <el-form-item prop="enName" + :label="$t('operatManage.menuSetObj.enName')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.enName" + autocomplete="off" + style="width:85%" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.enName')"></el-input> + </el-form-item> + <el-form-item prop="cnName" + :label="$t('operatManage.menuSetObj.cnName')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.cnName" + autocomplete="off" + style="width:85%" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.cnName')"></el-input> + </el-form-item> + <el-form-item :label="$t('operatManage.menuSetObj.icon')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.icon" + autocomplete="off" + style="width:85%" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.icon')"></el-input> + </el-form-item> + <el-form-item prop="isShow" + :label="$t('operatManage.menuSetObj.isShow')" + :label-width="formLabelWidth"> + <el-select :popper-append-to-body="false" + style="width:85%" + v-model="ruleForm.isShow" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('operatManage.menuSetObj.isShow')"> + <el-option v-for="item in options1" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + <el-form-item :label="$t('operatManage.menuSetObj.menuUrl')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.url" + autocomplete="off" + style="width:85%" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.menuUrl')"></el-input> + </el-form-item> + <el-form-item :label="$t('operatManage.menuSetObj.authorize')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.perms" + autocomplete="off" + style="width:85%" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.authorize')"></el-input> + </el-form-item> + <el-form-item :label="$t('operatManage.menuSetObj.type')" + prop="type" + :label-width="formLabelWidth"> + <el-select :popper-append-to-body="false" + style="width:85%" + v-model="ruleForm.type" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('operatManage.menuSetObj.type')"> + <el-option v-for="item in options2" + :key="item.value" + :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + <el-form-item :label="$t('operatManage.menuSetObj.bak')" + :label-width="formLabelWidth"> + <el-input v-model="ruleForm.bak" + autocomplete="off" + style="width:85%" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.bak')"></el-input> + </el-form-item> + </el-form> + </div> + <div slot="footer" + class="dialog-footer"> <el-button @click="resetForm('ruleForm')">{{ $t('common.cancel') }}</el-button> - <el-button - style="background: #409eff; color: white; border: 1px solid #409eff" - @click="submitForm('ruleForm')" - v-loading.fullscreen.lock="fullscreenLoading" - >{{ $t('common.confirm') }}</el-button> + <el-button style="background: #409eff; color: white; border: 1px solid #409eff" + @click="submitForm('ruleForm')" + v-loading.fullscreen.lock="fullscreenLoading">{{ $t('common.confirm') }}</el-button> </div> </el-dialog> </div> @@ -369,7 +280,7 @@ components: { MyBread, }, - data() { + data () { return { menuStatus: { delete: false, @@ -413,12 +324,12 @@ type: null, bak: '', }, - rules : { + rules: { enName: [ - { required: true, message: this.$t('operatManage.menuSetObj.enNameHolder'), trigger: 'blur' }, + { required: true,message: this.$t('operatManage.menuSetObj.enNameHolder'),trigger: 'blur' }, ], cnName: [ - { required: true, message: this.$t('operatManage.menuSetObj.cnNameHolder'), trigger: 'blur' }, + { required: true,message: this.$t('operatManage.menuSetObj.cnNameHolder'),trigger: 'blur' }, ], isShow: [ @@ -439,27 +350,27 @@ options1: [ { value: 0, - label:this.$t('operatManage.menuSetObj.hiddeen') + label: this.$t('operatManage.menuSetObj.hiddeen') }, { value: 1, - label:this.$t('operatManage.menuSetObj.isshow') + label: this.$t('operatManage.menuSetObj.isshow') }, ], options2: [ { value: 0, - label:this.$t('operatManage.menuSetObj.rootpath') + label: this.$t('operatManage.menuSetObj.rootpath') // label: '鏍圭洰褰�', }, { value: 1, - label:this.$t('operatManage.menuSetObj.menu') + label: this.$t('operatManage.menuSetObj.menu') // label: '鑿滃崟', }, { value: 2, - label:this.$t('operatManage.menuSetObj.button') + label: this.$t('operatManage.menuSetObj.button') // label: '鎸夐挳', }, ], @@ -467,17 +378,17 @@ }; }, methods: { - getMenuTree() { + getMenuTree () { //鑾峰彇鐩綍鏍戞渶澶D锛屾柊寤鸿妭鐐逛娇鐢� // queryMaxId().then((res) => { // this.id = res.data; // }); queryMenuAll().then((res) => { - if (res.code == 200) { - this.menuList = this.treeData(res.result); - this.oriData = res.result; - this.newData = res.result; - if (this.itemdetail.id != null) { + if(res.code==200) { + this.menuList=this.treeData(res.result); + this.oriData=res.result; + this.newData=res.result; + if(this.itemdetail.id!=null) { this.$nextTick(() => { this.$refs.tree.setCurrentKey(this.itemdetail.id); }); @@ -490,44 +401,44 @@ } }); }, - treeData(source) { - let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + treeData (source) { + let cloneData=JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 return cloneData.filter((father) => { // 寰幆鎵�鏈夐」 - let branchArr = cloneData.filter((child) => father.id == child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 - branchArr.length > 0 ? (father.children = branchArr) : ''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� - return father.pid == 0; // 杩斿洖涓�绾ц彍鍗� + let branchArr=cloneData.filter((child) => father.id==child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length>0? (father.children=branchArr):''; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + return father.pid==0; // 杩斿洖涓�绾ц彍鍗� }); }, - setEditNode(res) { - let node = this.$refs.tree.getCurrentNode(); - let pchildNodes = this.$refs.tree.getNode(node.id).parent.childNodes; - let currentId = {}; - for (let i = 0; i < pchildNodes.length; i++) { - if (pchildNodes[i].data.id == node.id) { - currentId = i; + setEditNode (res) { + let node=this.$refs.tree.getCurrentNode(); + let pchildNodes=this.$refs.tree.getNode(node.id).parent.childNodes; + let currentId={}; + for(let i=0;i<pchildNodes.length;i++) { + if(pchildNodes[i].data.id==node.id) { + currentId=i; } } - switch (res) { + switch(res) { case 1://鍚戜笂绉诲姩 - if (currentId != 0) { - const tempChildrenNodex1 = pchildNodes[currentId - 1]; - const tempChildrenNodex2 = pchildNodes[currentId]; - tempChildrenNodex2.orderNum = pchildNodes[currentId - 1].data.orderNum; - tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum - var arr = []; + if(currentId!=0) { + const tempChildrenNodex1=pchildNodes[currentId-1]; + const tempChildrenNodex2=pchildNodes[currentId]; + tempChildrenNodex2.orderNum=pchildNodes[currentId-1].data.orderNum; + tempChildrenNodex1.orderNum=pchildNodes[currentId].data.orderNum + var arr=[]; this.oriData.filter(res => { - if (res.id == tempChildrenNodex2.data.id) { - res.orderNum = tempChildrenNodex2.orderNum; + if(res.id==tempChildrenNodex2.data.id) { + res.orderNum=tempChildrenNodex2.orderNum; arr.push(res) - } else if (res.id == tempChildrenNodex1.data.id) { - res.orderNum = tempChildrenNodex1.orderNum; + } else if(res.id==tempChildrenNodex1.data.id) { + res.orderNum=tempChildrenNodex1.orderNum; arr.push(res) } }) - this.newData = arr; + this.newData=arr; this.sendChange(); } else { this.$message({ @@ -537,22 +448,22 @@ } break; case 2://鍚戜笅绉诲姩 - if (currentId < (pchildNodes.length - 1)) { - const tempChildrenNodex1 = pchildNodes[currentId + 1]; - const tempChildrenNodex2 = pchildNodes[currentId]; - tempChildrenNodex2.orderNum = pchildNodes[currentId + 1].data.orderNum; - tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum; - var arr = []; + if(currentId<(pchildNodes.length-1)) { + const tempChildrenNodex1=pchildNodes[currentId+1]; + const tempChildrenNodex2=pchildNodes[currentId]; + tempChildrenNodex2.orderNum=pchildNodes[currentId+1].data.orderNum; + tempChildrenNodex1.orderNum=pchildNodes[currentId].data.orderNum; + var arr=[]; this.oriData.filter(res => { - if (res.id == tempChildrenNodex2.data.id) { - res.orderNum = tempChildrenNodex2.orderNum; + if(res.id==tempChildrenNodex2.data.id) { + res.orderNum=tempChildrenNodex2.orderNum; arr.push(res) - } else if (res.id == tempChildrenNodex1.data.id) { - res.orderNum = tempChildrenNodex1.orderNum; + } else if(res.id==tempChildrenNodex1.data.id) { + res.orderNum=tempChildrenNodex1.orderNum; arr.push(res) } }) - this.newData = arr; + this.newData=arr; this.sendChange(); } else { this.$message({ @@ -565,36 +476,36 @@ } }, - setDelNode() { - this.remove(this.newNode, this.itemdetail) + setDelNode () { + this.remove(this.newNode,this.itemdetail) }, - setNewNode(res) { - var id, lever, orderNum; - if (res == 1) {//鏂板鍚岀骇 - id = this.itemdetail.pid; - orderNum = this.getMaxOrderNum(this.newNode.parent.childNodes) + setNewNode (res) { + var id,lever,orderNum; + if(res==1) {//鏂板鍚岀骇 + id=this.itemdetail.pid; + orderNum=this.getMaxOrderNum(this.newNode.parent.childNodes) - lever = this.itemdetail.level; - } else if (res == 2) {//鏂板瀛愮骇 - id = this.itemdetail.id; - orderNum = this.getMaxOrderNum(this.newNode.childNodes) + lever=this.itemdetail.level; + } else if(res==2) {//鏂板瀛愮骇 + id=this.itemdetail.id; + orderNum=this.getMaxOrderNum(this.newNode.childNodes) - lever = this.itemdetail.level + 1; + lever=this.itemdetail.level+1; } - this.ruleForm.pid = id; - this.ruleForm.level = lever; - this.ruleForm.orderNum = orderNum - this.dialogFormVisible = true; + this.ruleForm.pid=id; + this.ruleForm.level=lever; + this.ruleForm.orderNum=orderNum + this.dialogFormVisible=true; }, - getMaxOrderNum(res) { - var val = -100; - for (var i in res) { - if (res[i].data.orderNum > val) { - val = res[i].data.orderNum + getMaxOrderNum (res) { + var val=-100; + for(var i in res) { + if(res[i].data.orderNum>val) { + val=res[i].data.orderNum } } - val = val + 1; + val=val+1; return val; }, @@ -603,49 +514,49 @@ - append(node, data) { - this.dialogFormVisible = true; - this.ruleForm.pid = data.id; - this.ruleForm.orderNum = node.childNodes.length + 1; - this.ruleForm.level = data.level + 1; + append (node,data) { + this.dialogFormVisible=true; + this.ruleForm.pid=data.id; + this.ruleForm.orderNum=node.childNodes.length+1; + this.ruleForm.level=data.level+1; }, - resetForm(formName) { + resetForm (formName) { this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?") .then((_) => { - this.dialogFormVisible = false; + this.dialogFormVisible=false; this.$nextTick(() => { this.$refs[formName].resetFields(); - this.ruleForm = {}; + this.ruleForm={}; }); }) .catch((_) => { }); }, - submitForm(formName) { + submitForm (formName) { this.$nextTick(() => { this.$refs[formName].validate((valid) => { - if (valid) { - this.fullscreenLoading = true; + if(valid) { + this.fullscreenLoading=true; insertMenu(this.ruleForm) .then((res) => { setTimeout(() => { - this.fullscreenLoading = false; - if (res.code == 200) { + this.fullscreenLoading=false; + if(res.code==200) { this.$message({ message: '娣诲姞鎴愬姛', type: 'success', }); this.getMenuTree(); - this.itemdetail = {}; - this.ruleForm = {}; - this.dialogFormVisible = false; + this.itemdetail={}; + this.ruleForm={}; + this.dialogFormVisible=false; this.$refs[formName].resetFields(); } - }, 500); + },500); }) .catch((res) => { - this.itemdetail = {}; + this.itemdetail={}; this.$message.error('娣诲姞澶辫触'); - this.fullscreenLoading = false; + this.fullscreenLoading=false; console.log(res); }); } else { @@ -655,40 +566,40 @@ }); }); }, - remove(node, data) { - this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ヨ妭鐐�, 鏄惁缁х画?', '鎻愮ず', { + remove (node,data) { + this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ヨ妭鐐�, 鏄惁缁х画?','鎻愮ず',{ confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning', }) .then(() => { //鍏勫紵閲嶆柊鎺掑簭 - const parent = node.parent; - const children = parent.data.children || parent.data; - children.splice(data.orderNum - 1, 1); - children.forEach((item, index) => { - item.orderNum = index + 1; + const parent=node.parent; + const children=parent.data.children||parent.data; + children.splice(data.orderNum-1,1); + children.forEach((item,index) => { + item.orderNum=index+1; }); this.traverseArr(data); //鑾峰彇鍒犻櫎鐨勫瓙ID this.delChildIDs.push(data.id); //瑕佸垹闄ょ殑鍏ㄩ儴ID - let delIDs = this.delChildIDs; + let delIDs=this.delChildIDs; Promise.all([ deleteMenu({ ids: delIDs.toString() }), updateMenuTrees(children), ]) .then((res) => { - if (res[0].code == 200 && res[1].code == 200) { + if(res[0].code==200&&res[1].code==200) { this.$message({ type: 'success', message: '鍒犻櫎鎴愬姛!', }); this.getMenuTree(); - this.itemdetail = {}; - } else if (res[0].code == 200) { + this.itemdetail={}; + } else if(res[0].code==200) { this.getMenuTree(); this.$message.error('鍒犻櫎鎴愬姛锛屼綅缃皟鏁村け璐�'); - } else if (res[1].code == 200) { + } else if(res[1].code==200) { this.getMenuTree(); this.$message.error('鍒犻櫎澶辫触,浣嶇疆璋冩暣鎴愬姛'); } else { @@ -703,14 +614,14 @@ }); //閲嶇疆瑕佸垹闄ょ殑瀛怚D - this.delChildIDs = []; + this.delChildIDs=[]; }) .catch(() => { this.$message('宸插彇娑堝垹闄�'); }); }, - traverseArr(obj) { - if (obj.children) { + traverseArr (obj) { + if(obj.children) { return obj.children.forEach((item) => { // console.log(item.id + "---" + item.name); // this.delChildID += "id=" + item.id + "&"; @@ -720,55 +631,55 @@ } return; }, - flaten(arr) { - return arr.reduce((p, v, i) => { - for (let i = 0; i < p.length; i++) { - if (p[i].children) { + flaten (arr) { + return arr.reduce((p,v,i) => { + for(let i=0;i<p.length;i++) { + if(p[i].children) { delete p[i].children; } } - return p.concat(v.children ? this.flaten(v.children).concat(v) : v); - }, []); + return p.concat(v.children? this.flaten(v.children).concat(v):v); + },[]); }, - handleDragStart(node, ev) { - this.old_dirDat = JSON.parse(JSON.stringify(this.menuList)); //灏嗗浠界殑dir閲嶆柊璧嬪�� + handleDragStart (node,ev) { + this.old_dirDat=JSON.parse(JSON.stringify(this.menuList)); //灏嗗浠界殑dir閲嶆柊璧嬪�� }, - handleDrop(draggingNode, dropNode, dropType, ev) { - this.$confirm('姝ゆ搷浣滃皢淇濆瓨鐩綍鏇存敼, 鏄惁缁х画?', '鎻愮ず', { + handleDrop (draggingNode,dropNode,dropType,ev) { + this.$confirm('姝ゆ搷浣滃皢淇濆瓨鐩綍鏇存敼, 鏄惁缁х画?','鎻愮ず',{ confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning', }) .then(() => { //鐖惰妭鐐� - let data = dropType != 'inner' ? dropNode.parent.data : dropNode.data; + let data=dropType!='inner'? dropNode.parent.data:dropNode.data; // 鐖惰妭鐐逛腑鍏ㄩ儴瀛愯妭鐐� - let nodeData = - dropNode.level == 1 && dropType != 'inner' ? data : data.children; + let nodeData= + dropNode.level==1&&dropType!='inner'? data:data.children; //鍙樻洿鑺傜偣 // console.log(nodeData); - nodeData.forEach((item, i) => { - if (dropType != 'inner') { - if (draggingNode.data.pid === dropNode.data.pid) { - item.pid = item.pid; + nodeData.forEach((item,i) => { + if(dropType!='inner') { + if(draggingNode.data.pid===dropNode.data.pid) { + item.pid=item.pid; } else { - item.pid = dropNode.data.pid; + item.pid=dropNode.data.pid; } } else { - item.pid = data.id; + item.pid=data.id; } - item.orderNum = i + 1; + item.orderNum=i+1; }); // console.log(nodeData); //鏇存柊鍘熷鏁翠綋鏁版嵁 - let arr = []; + let arr=[]; this.oriData.forEach((e) => { nodeData.forEach((item) => { - if (item.id === e.id) e = item; + if(item.id===e.id) e=item; }); arr.push(e); }); - this.newData = arr; + this.newData=arr; this.sendChange(); }) .catch(() => { @@ -776,18 +687,18 @@ type: 'info', message: '宸插彇娑堟洿鏀�', }); - this.menuList = this.old_dirDat; //灏嗗浠界殑dir閲嶆柊璧嬪�� + this.menuList=this.old_dirDat; //灏嗗浠界殑dir閲嶆柊璧嬪�� }); }, - sendChange() { + sendChange () { this.newData.forEach((item) => { - if (item.pid == 0) { - item.type = 0; + if(item.pid==0) { + item.type=0; } }); updateMenuTrees(this.newData) .then((res) => { - if (res.code == 200) { + if(res.code==200) { this.getMenuTree(); return; } else { @@ -798,34 +709,34 @@ this.$message.error('璋冩暣澶辫触锛岃閲嶈瘯锛�'); }); }, - handleNodeClick(data, node) { - this.newNode = node; - this.backUpData = JSON.stringify(data); - this.itemdetail = JSON.parse(JSON.stringify(data)); - this.itemdetail.isShow = this.itemdetail.isShow.toString(); - this.itemdetail.type = this.itemdetail.type.toString(); + handleNodeClick (data,node) { + this.newNode=node; + this.backUpData=JSON.stringify(data); + this.itemdetail=JSON.parse(JSON.stringify(data)); + this.itemdetail.isShow=this.itemdetail.isShow.toString(); + this.itemdetail.type=this.itemdetail.type.toString(); }, - updMenu(formName) { + updMenu (formName) { this.$nextTick(() => { this.$refs[formName].validate((valid) => { - if (valid) { - this.fullscreenLoading = true; + if(valid) { + this.fullscreenLoading=true; updateMenuTree(this.itemdetail) .then((res) => { setTimeout(() => { - this.fullscreenLoading = false; - if (res.code == 200) { + this.fullscreenLoading=false; + if(res.code==200) { this.$router.go(0); this.getMenuTree(); - this.itemdetail = {}; - this.dialogFormVisible = false; + this.itemdetail={}; + this.dialogFormVisible=false; this.$refs[formName].resetFields(); } - }, 500); + },500); }) .catch((res) => { this.$message.error('璋冩暣澶辫触锛岃閲嶈瘯锛�'); - this.fullscreenLoading = false; + this.fullscreenLoading=false; }); } else { return false; @@ -833,56 +744,56 @@ }); }); }, - reset(formName) { + reset (formName) { this.$refs[formName].resetFields(); - if (this.backUpData != '') { - this.itemdetail = JSON.parse(this.backUpData); + if(this.backUpData!='') { + this.itemdetail=JSON.parse(this.backUpData); } }, - showPermsMenu(res) { + showPermsMenu (res) { - switch (res.tag) { + switch(res.tag) { case '/delete': - this.menuStatus.delete = true; + this.menuStatus.delete=true; break; case '/insert': - this.menuStatus.insert = true; + this.menuStatus.insert=true; break; case '/update': - this.menuStatus.update = true; + this.menuStatus.update=true; break; } }, - getPerms() { - var val = this.$store.state.currentPerms; - var permsEntity = this.$store.state.permsEntity; + getPerms () { + var val=this.$store.state.currentPerms; + var permsEntity=this.$store.state.permsEntity; - if (permsEntity.length == 0) { + if(permsEntity.length==0) { getPerms().then((res) => { - if (res.code == 200) { - permsEntity = res.result; + if(res.code==200) { + permsEntity=res.result; } }); } - for (var i = 0; i < permsEntity.length; i++) { - if (permsEntity[i].perms == val) { + for(var i=0;i<permsEntity.length;i++) { + if(permsEntity[i].perms==val) { this.showPermsMenu(permsEntity[i]); } } }, - handleClose() { + handleClose () { this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?") .then((_) => { - this.dialogFormVisible = false + this.dialogFormVisible=false }) .catch((_) => { }); }, }, - mounted() { + mounted () { this.getMenuTree(); this.getPerms(); }, - created() { }, + created () { }, }; </script> <style lang="less" scoped> @@ -903,7 +814,7 @@ border-radius: 5px; padding: 1%; overflow-y: auto; - border-right: 1px solid #dcdfe6; + border-right: 1px solid #dcdfe6; } .right_menu { width: 80%; @@ -922,8 +833,7 @@ } } } -.btnBox{ - +.btnBox { position: absolute; bottom: 0; right: 0; -- Gitblit v1.9.3