From 77e2622f735869b80f167139d369f5b11eaa5287 Mon Sep 17 00:00:00 2001 From: luxiaolong Date: Mon, 6 Jul 2020 10:19:05 +0800 Subject: [PATCH 1/7] fix delect FavoriteApp error. key error --- web/src/commonData/i18n/common/en.json | 3 ++- web/src/commonData/i18n/common/zh.json | 3 ++- .../view/newhome/module/workspace/index.vue | 4 ++-- web/src/js/view/workspace/index.vue | 22 ++++++++++++++----- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/web/src/commonData/i18n/common/en.json b/web/src/commonData/i18n/common/en.json index f2c9e7cccb..78285d935a 100644 --- a/web/src/commonData/i18n/common/en.json +++ b/web/src/commonData/i18n/common/en.json @@ -1065,7 +1065,8 @@ "running": "running", "stop": "disable", "searchPlaceholder": "Search application", - "tips": "No data or no addition" + "tips": "No data or no addition", + "repeat": "You cannot add the same application repeatedly" } }, "database": { diff --git a/web/src/commonData/i18n/common/zh.json b/web/src/commonData/i18n/common/zh.json index 3ab5b70568..e26d7745a4 100644 --- a/web/src/commonData/i18n/common/zh.json +++ b/web/src/commonData/i18n/common/zh.json @@ -1065,7 +1065,8 @@ "running": "运行中", "stop": "不可用", "searchPlaceholder": "搜索应用系统", - "tips": "没有数据或者未添加" + "tips": "没有数据或者未添加", + "repeat": "不能重复添加相同的应用" } }, "database": { diff --git a/web/src/js/view/newhome/module/workspace/index.vue b/web/src/js/view/newhome/module/workspace/index.vue index 8b6ac831ba..f30dbe7930 100644 --- a/web/src/js/view/newhome/module/workspace/index.vue +++ b/web/src/js/view/newhome/module/workspace/index.vue @@ -168,12 +168,12 @@ export default { this.getVideos(); }, mounted(){ - this.listWrap = this.$refs.row.$el.offsetWidth; + this.listWrap = this.$refs.row.$el && this.$refs.row.$el.offsetWidth; this.initWorkspace(); window.onresize = () => { const that = this return (() => { - that.listWrap = this.$refs.row.$el.offsetWidth; + that.listWrap = this.$refs.row.$el && this.$refs.row.$el.offsetWidth; })() } }, diff --git a/web/src/js/view/workspace/index.vue b/web/src/js/view/workspace/index.vue index f46077081f..3d35a2bfbb 100644 --- a/web/src/js/view/workspace/index.vue +++ b/web/src/js/view/workspace/index.vue @@ -218,8 +218,8 @@ export default { this.applications = data.applications || []; }) }, - deleteFavoriteApp(favouritesId, index){ - api.fetch(`/dss/workspaces/${this.workspaceId}/favorites/${favouritesId}`, 'delete').then(data=>{ + deleteFavoriteApp(favoriteId, index){ + api.fetch(`/dss/workspaces/${this.workspaceId}/favorites/${favoriteId}`, 'delete').then(data=>{ this.favoriteApps.splice(index, 1); }) }, @@ -228,14 +228,20 @@ export default { this.$refs.dynamicForm.validate((valid) => { if (valid) { // this.addAppLoading = true; + const menuApplicationId = parseInt(this.formDynamic.selectApp, 10); + const favoriteApp = this.findFavoriteAppsByMenuId(menuApplicationId); + if(favoriteApp) { + return this.$Message.error(`${this.$t('message.workSpace.home.repeat')}`); + } this.show = false; - api.fetch(`/dss/workspaces/${this.workspaceId}/favorites`, {menuApplicationId: parseInt(this.formDynamic.selectApp, 10)},'post').then(data=>{ + api.fetch(`/dss/workspaces/${this.workspaceId}/favorites`, {menuApplicationId: menuApplicationId},'post').then(data=>{ const app = this.findAppByApplicationId(this.formDynamic.selectApp) this.favoriteApps.push({ ...app, - "id": data.favouritesId, + "id": data.favoriteId, "menuApplicationId": app.id, //application表里的id - }) + }); + }) } }); @@ -247,6 +253,12 @@ export default { return result; }, + findFavoriteAppsByMenuId(menuId){ + const arr = this.favoriteApps; + const result = arr.find(item=>item.menuApplicationId==menuId); + return result; + }, + flatApps(){ const arr = []; this.applications.forEach(item=>{ From d06d46d24227f34280ef4eab5e9e9e4bfaa8cd50 Mon Sep 17 00:00:00 2001 From: luxiaolong Date: Mon, 6 Jul 2020 10:37:21 +0800 Subject: [PATCH 2/7] destroy event --- web/src/js/view/newhome/module/workspace/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/js/view/newhome/module/workspace/index.vue b/web/src/js/view/newhome/module/workspace/index.vue index f30dbe7930..7ab1d4cad3 100644 --- a/web/src/js/view/newhome/module/workspace/index.vue +++ b/web/src/js/view/newhome/module/workspace/index.vue @@ -177,6 +177,9 @@ export default { })() } }, + beforeDestroy(){ + window.onresize = null; + }, watch: { 'listWrap': function(val){ //监听容器宽度变化 this.pageSize = Math.floor(val / 252) From 1cdb649bc1af6108150fa4a8bff504bce37d9cf8 Mon Sep 17 00:00:00 2001 From: luxiaolong Date: Mon, 6 Jul 2020 10:47:00 +0800 Subject: [PATCH 3/7] delete mock data --- web/src/js/component/navMenu/index.vue | 161 +------------------------ 1 file changed, 1 insertion(+), 160 deletions(-) diff --git a/web/src/js/component/navMenu/index.vue b/web/src/js/component/navMenu/index.vue index 3d5504e090..4b16b6d633 100644 --- a/web/src/js/component/navMenu/index.vue +++ b/web/src/js/component/navMenu/index.vue @@ -47,166 +47,7 @@ export default { data() { return { menuList: [ - { - "id": 1, - "title": "应用开发", - "order": null, - "appInstances": [ - { - "id": 1, - "title": "工作流开发", - "description": "工作流开发是微众银行微数域(WeDataSphere)打造的数据应用开发工具,以任意桥(Linkis)做为内核,将满足从数据交换、脱敏清洗、分析挖掘、质量检测、可视化展现、定时调度到数据输出等数据应用开发全流程场景需求。", - "labels": "工作流,数仓开发", - "accessButton": "进入工作流开发", - "accessButtonUrl": "/project", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "/workflow", - "name": "workflow", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": true - }, - { - "id": 2, - "title": "StreamSQL开发", - "description": "实时应用开发是微众银行微数域(WeDataSphere)、Boss直聘大数据团队 和 中国电信天翼云大数据团队 社区联合共建的流式解决方案,以 Linkis 做为内核,基于 Flink Engine 构建的批流统一的 Flink SQL,助力实时化转型。", - "labels": "流式,实时", - "accessButton": "联合共建中", - "accessButtonUrl": "/streamSQL", - "manualButton": "相关资讯", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "/streamSQL/project", - "name": "streamSQL", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": false - }, - { - "id": 3, - "title": "数据服务开发", - "description": "数据服务是微众银行微数域(WeDataSphere)与 艾佳生活大数据团队 社区联合共建的统一API服务,以 Linkis 和 DataSphere Studio 做为内核,提供快速将 Scriptis 脚本生成数据API的能力,协助企业统一管理对内对外的API服务。", - "labels": "API,数据服务", - "accessButton": "联合共建中", - "accessButtonUrl": "/dataService", - "manualButton": "相关资讯", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "/dataService/project", - "name": "dataService", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": false - }] - }, - { - "id": 2, - "title": "数据分析", - "order": null, - "appInstances": [ - { - "id": 4, - "title": "Scriptis", - "description": "Scriptis是微众银行微数域(WeDataSphere)打造的一站式交互式数据探索分析工具,以任意桥(Linkis)做为内核,提供多种计算存储引擎(如Spark、Hive、TiSpark等)、Hive数据库管理功能、资源(如Yarn资源、服务器资源)管理、应用管理和各种用户资源(如UDF、变量等)管理的能力。", - "labels": "脚本开发,IDE", - "accessButton": "进入Scriptis", - "accessButtonUrl": "/home", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "/home", - "name": "scriptis", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": true - }, - { - "id": 5, - "title": "Visualis", - "description": "Visualis是基于宜信开源项目Davinci开发的数据可视化BI工具,以任意桥(Linkis)做为内核,支持拖拽式报表定义、图表联动、钻取、全局筛选、多维分析、实时查询等数据开发探索的分析模式,并做了水印、数据质量校验等金融级增强。", - "labels": "可视化,报表", - "accessButton": "进入Visualis", - "accessButtonUrl": "http://42.123.106.20:8088/dss/visualis/#/projects ", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "http://42.123.106.20:8088/dss/visualis/#/project/${projectId}", - "name": "visualis", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": true - }] - }, - { - "id": 3, - "title": "生产运维", - "order": null, - "appInstances": [ - { - "id": 6, - "title": "Schedulis", - "description": "Scriptis是微众银行微数域(WeDataSphere)打造的一站式交互式数据探索分析工具,以任意桥(Linkis)做为内核,提供多种计算存储引擎(如Spark、Hive、TiSpark等)、Hive数据库管理功能、资源(如Yarn资源、服务器资源)管理、应用管理和各种用户资源(如UDF、变量等)管理的能力。", - "labels": "调度,工作流", - "accessButton": "进入Schedulis", - "accessButtonUrl": "http://***REMOVED***:8091/homepage", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "http://***REMOVED***:8091/manager?project=${projectName}", - "name": "schedulis", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": true - }, - { - "id": 7, - "title": "应用运维中心", - "description": "Scriptis是微众银行微数域(WeDataSphere)打造的一站式交互式数据探索分析工具,以任意桥(Linkis)做为内核,提供多种计算存储引擎(如Spark、Hive、TiSpark等)、Hive数据库管理功能、资源(如Yarn资源、服务器资源)管理、应用管理和各种用户资源(如UDF、变量等)管理的能力。", - "labels": "生产,运维", - "accessButton": "进入应用运维中心", - "accessButtonUrl": "/devops", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "/devops/project", - "name": "devops", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": false - }] - }, - { - "id": 4, - "title": "数据质量", - "order": null, - "appInstances": [ - { - "id": 8, - "title": "Qualitis", - "description": "Qualitis是一套金融级、一站式的数据质量管理平台,提供了数据质量模型定义,数据质量结果可视化、可监控等功能,并用一整套统一的流程来定义和检测数据集的质量并及时报告问题。", - "labels": "生产,运维", - "accessButton": "进入Qualitis", - "accessButtonUrl": "http://***REMOVED***:8090/#/dashboard", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "http://***REMOVED***:8090/#/projects/list?id=${projectId}&flow=true", - "name": "qualitis", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": true - }, - { - "id": 9, - "title": "Exchangis", - "description": "Exchangis是一个轻量级的、高扩展性的数据交换平台,支持对结构化及无结构化的异构数据源之间的数据传输,在应用层上具有数据权限管控、节点服务高可用和多租户资源隔离等业务特性,而在数据层上又具有传输架构多样化、模块插件化和组件低耦合等架构特点。", - "labels": "生产,运维", - "accessButton": "进入Exchangis", - "accessButtonUrl": "http://42.123.106.20:9503", - "manualButton": "用户手册", - "manualButtonUrl": "https://www.baidu.com", - "projectUrl": "http://42.123.106.20:19503", - "name": "exchangis", - "icon": "fi-scriptis|rgb(102, 102, 255)", - "order": null, - "active": true - }] - }] - , + ], current: null } }, From 8d51c9c06529b9f8ab3e6b3cb368280e346bc845 Mon Sep 17 00:00:00 2001 From: luxiaolong Date: Mon, 6 Jul 2020 15:08:21 +0800 Subject: [PATCH 4/7] add login captcha --- web/src/assets/styles/login.scss | 9 ++++-- web/src/commonData/i18n/common/en.json | 3 +- web/src/commonData/i18n/common/zh.json | 3 +- web/src/js/view/login/index.vue | 43 +++++++++++++++++++++++--- 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/web/src/assets/styles/login.scss b/web/src/assets/styles/login.scss index d0ed8583e5..43402abe39 100644 --- a/web/src/assets/styles/login.scss +++ b/web/src/assets/styles/login.scss @@ -44,7 +44,6 @@ } .login-main { width: 380px; - height: 300px; background-color: $body-background; margin-right: 9.5%; padding: 20px; @@ -76,9 +75,15 @@ } } .remember-user-name { - margin: 5px 0 0 10px; + margin: 0px 0 10px 10px; } .ivu-form-item { margin-bottom: 20px; } + .captcha-wp { + display: flex; + img{ + height: 44px; + } + } } diff --git a/web/src/commonData/i18n/common/en.json b/web/src/commonData/i18n/common/en.json index 78285d935a..51eb4d3f5e 100644 --- a/web/src/commonData/i18n/common/en.json +++ b/web/src/commonData/i18n/common/en.json @@ -800,7 +800,8 @@ "password": "Please enter password!", "loginSuccess": "Login Success", "haveLogin": "You have already logged in, please do not login repeatedly", - "vaildFaild": "Authentication failed!" + "vaildFaild": "Authentication failed!", + "captcha": "Please enter captcha" }, "userMenu": { "title": "Warning", diff --git a/web/src/commonData/i18n/common/zh.json b/web/src/commonData/i18n/common/zh.json index e26d7745a4..c94b895056 100644 --- a/web/src/commonData/i18n/common/zh.json +++ b/web/src/commonData/i18n/common/zh.json @@ -800,7 +800,8 @@ "password": "请输入密码!", "loginSuccess": "登录成功", "haveLogin": "您已经登录,请不要重复登录", - "vaildFaild": "验证未通过!" + "vaildFaild": "验证未通过!", + "captcha": "请输入验证码" }, "userMenu": { "title": "警告", diff --git a/web/src/js/view/login/index.vue b/web/src/js/view/login/index.vue index 8b68082936..52c50362fd 100644 --- a/web/src/js/view/login/index.vue +++ b/web/src/js/view/login/index.vue @@ -23,13 +23,23 @@ - {{$t('message.login.remenber')}} + +
+ +
+
+
+ {{$t('message.login.remenber')}}