diff --git a/db/dss_ddl.sql b/db/dss_ddl.sql index 5c016e0b1b..8b942fd4e1 100644 --- a/db/dss_ddl.sql +++ b/db/dss_ddl.sql @@ -294,3 +294,155 @@ CREATE TABLE `event_status` ( `msg_id` int(11) NOT NULL COMMENT '消息的最大消费id', PRIMARY KEY (`receiver`,`topic`,`msg_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息消费状态表'; + + +-- ---------------------------- +-- Table structure for dss_workspace +-- ---------------------------- +DROP TABLE IF EXISTS `dss_workspace`; +CREATE TABLE `dss_workspace` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `department` varchar(255) DEFAULT NULL, + `product` varchar(255) DEFAULT NULL, + `source` varchar(255) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_onestop_menu +-- ---------------------------- +DROP TABLE IF EXISTS `dss_onestop_menu`; +CREATE TABLE `dss_onestop_menu` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_onestop_menu_application +-- ---------------------------- +DROP TABLE IF EXISTS `dss_onestop_menu_application`; +CREATE TABLE `dss_onestop_menu_application` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `application_id` int(20) DEFAULT NULL, + `onestop_menu_id` int(20) NOT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `desc_en` varchar(255) DEFAULT NULL, + `desc_cn` varchar(255) DEFAULT NULL, + `labels_en` varchar(255) DEFAULT NULL, + `labels_cn` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT NULL, + `access_button_en` varchar(64) DEFAULT NULL, + `access_button_cn` varchar(64) DEFAULT NULL, + `manual_button_en` varchar(64) DEFAULT NULL, + `manual_button_cn` varchar(64) DEFAULT NULL, + `manual_button_url` varchar(255) DEFAULT NULL, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_onestop_user_favorites +-- ---------------------------- +DROP TABLE IF EXISTS `dss_onestop_user_favorites`; +CREATE TABLE `dss_onestop_user_favorites` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `username` varchar(64) DEFAULT NULL, + `menu_application_id` int(20) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_homepage_demo_menu +-- ---------------------------- +DROP TABLE IF EXISTS `dss_homepage_demo_menu`; +CREATE TABLE `dss_homepage_demo_menu` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_homepage_demo_instance +-- ---------------------------- +DROP TABLE IF EXISTS `dss_homepage_demo_instance`; +CREATE TABLE `dss_homepage_demo_instance` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `menu_id` int(20) DEFAULT NULL, + `name` varchar(64) DEFAULT NULL, + `url` varchar(128) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `click_num` int(11) DEFAULT 0, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_homepage_video +-- ---------------------------- +DROP TABLE IF EXISTS `dss_homepage_video`; +CREATE TABLE `dss_homepage_video` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `url` varchar(128) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `play_num` int(11) DEFAULT 0, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java index 3aebc85926..7fbe79fcf7 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java @@ -22,9 +22,10 @@ public class DSSServerConstant { public static final String DWS_PROJECT_FIRST_VERSION = "v000001"; public static final String DWS_PROJECT_FIRST_VERSION_COMMENT = "first version"; public static final String DWS_PROJECT_SOURCE = "create by user"; + public static final String DWS_WORKSPACE_SOURCE = "create by user"; public static final String PROJECT_VERSION_ID = "projectVersionID"; public static final String PUBLISH_FLOW_REPORT_FORMATE = "工作流名:%s,版本号:%s,工作流内容为空,请自行修改或者删除"; - public static final String EMVEDDEDFLOWID ="\"embeddedFlowId\":" ; + public static final String EMVEDDEDFLOWID = "\"embeddedFlowId\":"; public static final String VERSION_FORMAT = "%06d"; public static final String VERSION_PREFIX = "v"; } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/WorkspaceMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/WorkspaceMapper.java new file mode 100644 index 0000000000..819a221d35 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/WorkspaceMapper.java @@ -0,0 +1,39 @@ +package com.webank.wedatasphere.dss.server.dao; + +import com.webank.wedatasphere.dss.server.dto.response.*; +import com.webank.wedatasphere.dss.server.entity.*; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/22 + */ +public interface WorkspaceMapper { + + List getWorkspaces(); + + List findByWorkspaceName(String name); + + void addWorkSpace(DWSWorkspace dwsWorkspace); + + List getHomepageDemoMenusEn(); + List getHomepageDemoMenusCn(); + + List getHomepageInstancesByMenuIdCn(Long id); + List getHomepageInstancesByMenuIdEn(Long id); + + List getHomepageVideosEn(); + List getHomepageVideosCn(); + + DWSWorkspace getWorkspaceById(Long workspaceId); + + List getManagementMenuCn(); + List getManagementMenuEn(); + + List getApplicationMenuCn(); + List getApplicationMenuEn(); + + List getMenuAppInstancesCn(Long id); + List getMenuAppInstanceEn(Long id); + +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/workspaceMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/workspaceMapper.xml new file mode 100644 index 0000000000..a211d50228 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/workspaceMapper.xml @@ -0,0 +1,158 @@ + + + + + + + + + id,`name`,`label`,`description`,`department`,`product`,`source`,`create_by`,`create_time`,`last_update_user`,`last_update_time` + + + + m.`id`,m.`title_cn` AS `title`, m.`desc_cn` AS `description`,m.`labels_cn` AS `labels`, + m.`access_button_cn` AS `access_button`,m.`manual_button_cn` AS `manualButton`,m.`is_active`, + m.`manual_button_url`,m.`icon`,m.`order`,app.`homepage_url` AS `access_button_url`,app.project_url, app.`name` + + + m.`id`,m.`title_en` AS `title`, m.`desc_en` AS `description`,m.`labels_en` AS `labels`, + m.`access_button_en` AS `access_button`,m.`manual_button_en` AS `manualButton`,m.`is_active` + m.`manual_button_url`,m.`icon`,m.`order`,app.`homepage_url` AS `access_button_url`,app.project_url, app.`name` + + + + + + + + + + + INSERT INTO dss_workspace () + VALUES + (#{id},#{name},#{label},#{description},#{department},#{product},#{source},#{createBy},#{createTime},#{lastUpdateUser},#{lastUpdateTime}) + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoInstanceVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoInstanceVo.java new file mode 100644 index 0000000000..c7a1942587 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoInstanceVo.java @@ -0,0 +1,80 @@ +package com.webank.wedatasphere.dss.server.dto.response; + +/** + * Created by schumiyi on 2020/6/23 + */ +public class HomepageDemoInstanceVo { + + private Long id; + private Long menuId; + private String name; + private String url; + private String title; + private String description; + private String icon; + private Integer order; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoMenuVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoMenuVo.java new file mode 100644 index 0000000000..6cdedde423 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoMenuVo.java @@ -0,0 +1,73 @@ +package com.webank.wedatasphere.dss.server.dto.response; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/23 + */ +public class HomepageDemoMenuVo { + + private Long id; + private String name; + private String title; + private String description; + private String icon; + private Integer order; + private List demoInstances; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + public List getDemoInstances() { + return demoInstances; + } + + public void setDemoInstances(List demoInstances) { + this.demoInstances = demoInstances; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageVideoVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageVideoVo.java new file mode 100644 index 0000000000..073ce49bbb --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageVideoVo.java @@ -0,0 +1,62 @@ +package com.webank.wedatasphere.dss.server.dto.response; + +/** + * Created by schumiyi on 2020/6/23 + */ +public class HomepageVideoVo { + + private Long id; + private String name; + private String url; + private String title; + private String description; + private Integer order; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuAppInstanceVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuAppInstanceVo.java new file mode 100644 index 0000000000..5df38fdf91 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuAppInstanceVo.java @@ -0,0 +1,124 @@ +package com.webank.wedatasphere.dss.server.dto.response; + +/** + * Created by schumiyi on 2020/6/24 + */ +public class OnestopMenuAppInstanceVo { + private Long id; + private String title; + private String description; + private String labels; + private String accessButton; + private String accessButtonUrl; + private String manualButton; + private String manualButtonUrl; + private String projectUrl; + private String name; + private Boolean isActive; + private String icon; + private Integer order; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLabels() { + return labels; + } + + public void setLabels(String labels) { + this.labels = labels; + } + + public String getAccessButton() { + return accessButton; + } + + public void setAccessButton(String accessButton) { + this.accessButton = accessButton; + } + + public String getAccessButtonUrl() { + return accessButtonUrl; + } + + public void setAccessButtonUrl(String accessButtonUrl) { + this.accessButtonUrl = accessButtonUrl; + } + + public String getManualButton() { + return manualButton; + } + + public void setManualButton(String manualButton) { + this.manualButton = manualButton; + } + + public String getManualButtonUrl() { + return manualButtonUrl; + } + + public void setManualButtonUrl(String manualButtonUrl) { + this.manualButtonUrl = manualButtonUrl; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + public String getProjectUrl() { + return projectUrl; + } + + public void setProjectUrl(String projectUrl) { + this.projectUrl = projectUrl; + } + + public Boolean getActive() { + return isActive; + } + + public void setActive(Boolean active) { + isActive = active; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuVo.java new file mode 100644 index 0000000000..9fbd644889 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuVo.java @@ -0,0 +1,45 @@ +package com.webank.wedatasphere.dss.server.dto.response; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/24 + */ +public class OnestopMenuVo { + private Long id; + private String title; + private Integer order; + private List appInstances; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } + + public List getAppInstances() { + return appInstances; + } + + public void setAppInstances(List appInstances) { + this.appInstances = appInstances; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceDepartmentVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceDepartmentVo.java new file mode 100644 index 0000000000..77ec90a7dc --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceDepartmentVo.java @@ -0,0 +1,27 @@ +package com.webank.wedatasphere.dss.server.dto.response; + +/** + * Created by schumiyi on 2020/6/23 + */ +public class WorkspaceDepartmentVo { + + private Long id; + + private String name; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/BaseEntity.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/BaseEntity.java new file mode 100644 index 0000000000..d01380d9e2 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/BaseEntity.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.dss.server.entity; + +import java.util.Date; + +/** + * Created by schumiyi on 2020/6/22 + */ +public class BaseEntity { + + private String createBy; + + private Date createTime = new Date(); + + private Date lastUpdateTime = new Date(); + + private String lastUpdateUser; + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + public String getLastUpdateUser() { + return lastUpdateUser; + } + + public void setLastUpdateUser(String lastUpdateUser) { + this.lastUpdateUser = lastUpdateUser; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSWorkspace.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSWorkspace.java new file mode 100644 index 0000000000..11ce3a9e77 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSWorkspace.java @@ -0,0 +1,77 @@ +package com.webank.wedatasphere.dss.server.entity; + +/** + * Created by schumiyi on 2020/6/22 + */ +public class DWSWorkspace extends BaseEntity{ + + private Long id; + + private String name; + + private String label; + + private String description; + + private String department; + + private String product; + + private String source; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getProduct() { + return product; + } + + public void setProduct(String product) { + this.product = product; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/WorkspaceRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/WorkspaceRestfulApi.java new file mode 100644 index 0000000000..a55d1e0c1b --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/WorkspaceRestfulApi.java @@ -0,0 +1,110 @@ +package com.webank.wedatasphere.dss.server.restful; + +import com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo; +import com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo; +import com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo; +import com.webank.wedatasphere.dss.server.entity.DWSWorkspace; +import com.webank.wedatasphere.dss.server.dto.response.WorkspaceDepartmentVo; +import com.webank.wedatasphere.dss.server.service.DWSWorkspaceService; +import com.webank.wedatasphere.linkis.server.Message; +import com.webank.wedatasphere.linkis.server.security.SecurityFilter; +import org.codehaus.jackson.JsonNode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.util.List; + +/** + * Created by schumiyi on 2020/6/19 + */ +@Component +@Path("/dss") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public class WorkspaceRestfulApi { + + @Autowired + private DWSWorkspaceService dwsWorkspaceService; + + + @GET + @Path("/workspaces") + public Response getAllWorkspaces(@Context HttpServletRequest req) { + // TODO: Order By time + List workspaces = dwsWorkspaceService.getWorkspaces(); + return Message.messageToResponse(Message.ok().data("workspaces", workspaces)); + } + + @GET + @Path("/workspaces/departments") + public Response getAllWorkspaceDepartments(@Context HttpServletRequest req) { + List departments = dwsWorkspaceService.getWorkSpaceDepartments(); + return Message.messageToResponse(Message.ok().data("departments", departments)); + } + + @GET + @Path("/workspaces/exists") + public Response getUsernameExistence(@Context HttpServletRequest req, @QueryParam("name") String name) { + boolean exists = dwsWorkspaceService.existWorkspaceName(name); + return Message.messageToResponse(Message.ok().data("workspaceNameExists", exists)); + } + + @POST + @Path("/workspaces") + public Response addWorkspace(@Context HttpServletRequest req, JsonNode json) { + String userName = SecurityFilter.getLoginUsername(req); + String name = json.get("name").getTextValue(); + if (dwsWorkspaceService.existWorkspaceName(name)) { + return Message.messageToResponse(Message.error("工作空间名重复")); + } + String department = json.get("department").getTextValue(); + String label = json.get("label").getTextValue(); + String description = json.get("description").getTextValue(); + Long workspaceId = dwsWorkspaceService.addWorkspace(userName, name, department, label, description); + return Message.messageToResponse(Message.ok().data("workspaceId", workspaceId)); + } + + @GET + @Path("/workspaces/demos") + public Response getAllHomepageDemos(@Context HttpServletRequest req) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + List homepageDemos = dwsWorkspaceService.getHomepageDemos(isChinese); + return Message.messageToResponse(Message.ok().data("demos", homepageDemos)); + } + + @GET + @Path("/workspaces/videos") + public Response getAllVideos(@Context HttpServletRequest req) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + List homepageVideos = dwsWorkspaceService.getHomepageVideos(isChinese); + return Message.messageToResponse(Message.ok().data("videos", homepageVideos)); + } + + @GET + @Path("workspaces/{workspaceId}/managements") + public Response getWorkspaceManagements(@Context HttpServletRequest req, @PathParam("workspaceId")Long workspaceId) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + String username = SecurityFilter.getLoginUsername(req); + + List managements = dwsWorkspaceService.getWorkspaceManagements(workspaceId, username, isChinese); + return Message.messageToResponse(Message.ok().data("managements", managements)); + } + + @GET + @Path("workspaces/{workspaceId}/applications") + public Response getWorkspaceApplications(@Context HttpServletRequest req, @PathParam("workspaceId")Long workspaceId) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + String username = SecurityFilter.getLoginUsername(req); + List applications = dwsWorkspaceService.getWorkspaceApplications(workspaceId, username, isChinese); + return Message.messageToResponse(Message.ok().data("applications", applications)); + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSWorkspaceService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSWorkspaceService.java new file mode 100644 index 0000000000..e44a11e0da --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSWorkspaceService.java @@ -0,0 +1,30 @@ +package com.webank.wedatasphere.dss.server.service; + +import com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo; +import com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo; +import com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo; +import com.webank.wedatasphere.dss.server.entity.DWSWorkspace; +import com.webank.wedatasphere.dss.server.dto.response.WorkspaceDepartmentVo; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/22 + */ +public interface DWSWorkspaceService { + List getWorkspaces(); + + Long addWorkspace(String userName, String name, String department, String label, String description); + + boolean existWorkspaceName(String name); + + List getWorkSpaceDepartments(); + + List getHomepageDemos(boolean isChinese); + + List getHomepageVideos(boolean isChinese); + + List getWorkspaceManagements(Long workspaceId, String username, boolean isChinese); + + List getWorkspaceApplications(Long workspaceId, String username, boolean isChinese); +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSWorkspaceServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSWorkspaceServiceImpl.java new file mode 100644 index 0000000000..2c270b75d9 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSWorkspaceServiceImpl.java @@ -0,0 +1,108 @@ +package com.webank.wedatasphere.dss.server.service.impl; + +import com.webank.wedatasphere.dss.server.constant.DSSServerConstant; +import com.webank.wedatasphere.dss.server.dao.WorkspaceMapper; +import com.webank.wedatasphere.dss.server.dto.response.*; +import com.webank.wedatasphere.dss.server.entity.*; +import com.webank.wedatasphere.dss.server.service.DWSWorkspaceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by schumiyi on 2020/6/22 + */ +@Service +public class DWSWorkspaceServiceImpl implements DWSWorkspaceService { + + @Autowired + private WorkspaceMapper workspaceMapper; + + @Override + public List getWorkspaces() { + return workspaceMapper.getWorkspaces(); + } + + @Override + public Long addWorkspace(String userName, String name, String department, String label, String description) { + DWSWorkspace dwsWorkspace = new DWSWorkspace(); + dwsWorkspace.setName(name); + dwsWorkspace.setDepartment(department); + dwsWorkspace.setDescription(description); + dwsWorkspace.setLabel(label); + dwsWorkspace.setCreateBy(userName); + dwsWorkspace.setSource(DSSServerConstant.DWS_WORKSPACE_SOURCE); + dwsWorkspace.setLastUpdateUser(userName); + workspaceMapper.addWorkSpace(dwsWorkspace); + return dwsWorkspace.getId(); + } + + @Override + public boolean existWorkspaceName(String name) { + return !workspaceMapper.findByWorkspaceName(name).isEmpty(); + } + + @Override + public List getWorkSpaceDepartments() { + // TODO: service层和dao层完善 + WorkspaceDepartmentVo dp = new WorkspaceDepartmentVo(); + dp.setId(1L); + dp.setName("应用开发组"); + WorkspaceDepartmentVo di = new WorkspaceDepartmentVo(); + di.setId(2L); + di.setName("平台研发组"); + List departments = new ArrayList<>(); + departments.add(dp); + departments.add(di); + return departments; + } + + @Override + public List getHomepageDemos(boolean isChinese) { + List demoMenuVos = isChinese ? workspaceMapper.getHomepageDemoMenusCn():workspaceMapper.getHomepageDemoMenusEn(); + for (HomepageDemoMenuVo demoMenuVo : demoMenuVos) { + Long menuId = demoMenuVo.getId(); + List demoInstanceVos = isChinese ? workspaceMapper.getHomepageInstancesByMenuIdCn(menuId) : workspaceMapper.getHomepageInstancesByMenuIdEn(menuId); + demoMenuVo.setDemoInstances(demoInstanceVos); + } + return demoMenuVos; + } + + @Override + public List getHomepageVideos(boolean isChinese) { + return isChinese ? workspaceMapper.getHomepageVideosCn() : workspaceMapper.getHomepageVideosEn(); + } + + @Override + public List getWorkspaceManagements(Long workspaceId, String username, boolean isChinese) { + if (!isAdminUser(workspaceId, username)) { + return new ArrayList<>(); + } + List managementMenuVos = isChinese ? workspaceMapper.getManagementMenuCn() : workspaceMapper.getManagementMenuEn(); + return getMenuAppInstances(managementMenuVos, isChinese); + } + + private List getMenuAppInstances(List menuVos, boolean isChinese) { + for (OnestopMenuVo menuVo : menuVos) { + Long menuId = menuVo.getId(); + List menuAppInstanceVos = isChinese ? workspaceMapper.getMenuAppInstancesCn(menuId) : workspaceMapper.getMenuAppInstanceEn(menuId); + menuVo.setAppInstances(menuAppInstanceVos); + } + return menuVos; + } + + @Override + public List getWorkspaceApplications(Long workspaceId, String username, boolean isChinese) { + List applicationMenuVos = isChinese ? workspaceMapper.getApplicationMenuCn() : workspaceMapper.getApplicationMenuEn(); + return getMenuAppInstances(applicationMenuVos, isChinese); + } + + private boolean isAdminUser(Long workspaceId, String username) { + DWSWorkspace workspace = workspaceMapper.getWorkspaceById(workspaceId); + return username != null && workspace != null && username.equals(workspace.getCreateBy()); + } + + +} diff --git a/web/src/assets/iconfont/font-dws-icon.svg b/web/src/assets/iconfont/font-dws-icon.svg old mode 100644 new mode 100755 index 776dd6f8c9..2b1c8c606c --- a/web/src/assets/iconfont/font-dws-icon.svg +++ b/web/src/assets/iconfont/font-dws-icon.svg @@ -1,85 +1,103 @@ -Generated by IcoMoon + + + +{ + "fontFamily": "font-dws-icon", + "description": "Font generated by IcoMoon.", + "majorVersion": 1, + "minorVersion": 0, + "version": "Version 1.0", + "fontId": "font-dws-icon", + "psName": "font-dws-icon", + "subFamily": "Regular", + "fullName": "font-dws-icon" +} + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/assets/iconfont/font-dws-icon.ttf b/web/src/assets/iconfont/font-dws-icon.ttf old mode 100644 new mode 100755 index ad3754489b..ddfdc404d2 Binary files a/web/src/assets/iconfont/font-dws-icon.ttf and b/web/src/assets/iconfont/font-dws-icon.ttf differ diff --git a/web/src/assets/iconfont/font-dws-icon.woff b/web/src/assets/iconfont/font-dws-icon.woff old mode 100644 new mode 100755 index 978571427d..efd6d59b70 Binary files a/web/src/assets/iconfont/font-dws-icon.woff and b/web/src/assets/iconfont/font-dws-icon.woff differ diff --git a/web/src/assets/styles/iconfonts.scss b/web/src/assets/styles/iconfonts.scss index 4fb16747f6..551929385c 100644 --- a/web/src/assets/styles/iconfonts.scss +++ b/web/src/assets/styles/iconfonts.scss @@ -14,21 +14,17 @@ * limitations under the License. * */ - @import 'variables.scss'; - @font-face { font-family: 'font-dws-icon'; - src: url('../iconfont/font-dws-icon.eot?fkqrnv'); - src: url('../iconfont/font-dws-icon.eot?fkqrnv#iefix') format('embedded-opentype'), - url('../iconfont/font-dws-icon.ttf?fkqrnv') format('truetype'), - url('../iconfont/font-dws-icon.woff?fkqrnv') format('woff'), - url('../iconfont/font-dws-icon.svg?fkqrnv#font-dws-icon') format('svg'); + src: url('../iconfont/font-dws-icon.eot?fkqrnv'); + src: url('../iconfont/font-dws-icon.eot?fkqrnv#iefix') format('embedded-opentype'), url('../iconfont/font-dws-icon.ttf?fkqrnv') format('truetype'), url('../iconfont/font-dws-icon.woff?fkqrnv') format('woff'), url('../iconfont/font-dws-icon.svg?fkqrnv#font-dws-icon') format('svg'); font-weight: normal; font-style: normal; } -[class^="fi-"], [class*=" fi-"] { +[class*=" fi-"], +[class^="fi-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'font-dws-icon' !important; font-style: normal; @@ -45,293 +41,377 @@ .fi-export:before { content: "\e904"; } + .fi-download:before { content: "\e905"; } + .fi-quit:before { content: "\e906"; } + .fi-search:before { content: "\e907"; } + .fi-undo:before { content: "\e908"; } + .fi-redo:before { content: "\e909"; } + .fi-format:before { content: "\e90a"; } + .fi-play:before { content: "\e90b"; } + .fi-stop:before { content: "\e90c"; } + .fi-save:before { content: "\e90d"; } + .fi-disconnect:before { content: "\e90e"; } + .fi-warn:before { content: "\e90f"; } + .fi-expand-right:before { content: "\e910"; } + .fi-cross:before { content: "\e911"; } + .fi-tick:before { content: "\e912"; } + .fi-dir-fold:before { content: "\e913"; } + .fi-dir-unfold:before { content: "\e914"; } + .fi-more-things:before { content: "\e915"; } + .fi-radio-on2:before { content: "\e918"; } + .fi-ide:before { content: "\e91d"; } + .fi-hivedb.open:before { content: "\e91e"; } + .fi-hivedb:before { content: "\e91f"; } + .fi-disk-o:before { content: "\e920"; } + .fi-disk:before { content: "\e921"; } + .fi-project-o:before { content: "\e922"; } + .fi-project:before { content: "\e923"; } + .fi-caret-down:before { content: "\e924"; } + .fi-caret-right:before { content: "\e925"; } + .fi-folder:before { content: "\e926"; padding: 0 2px; font-size: 14px; } + .fi-folder-o:before { content: "\e927"; padding: 0 2px; font-size: 14px; } + .fi-file:before { content: "\e928"; font-size: 16px; color: gray; } + .fi-file-o:before { content: "\e929"; font-size: 16px; padding: 0 2px; } + .fi-logo:before { - content: "\e930" + content: "\e930"; } + .fi-table:before { content: "\e931"; } + .fi-table.open:before { content: "\e931"; color: gray; } + .fi-field:before { content: "\e932"; font-size: 14px; color: gray; } + .fi-field.open:before { content: "\e932"; font-size: 14px; color: gray; } + .fi-open-in:before { - content: "\e92d" + content: "\e92d"; } + .fi-dock-show:before { - content: "\e92e" + content: "\e92e"; } + .fi-dock-hide:before { - content: "\e92f" + content: "\e92f"; } + .fi-hive:before { content: "\e93a"; color: #f4cf2a; font-size: 16px; } + .fi-spark:before { content: "\e93b"; color: $warning-color; font-size: 16px; } + .fi-scala:before { content: "\e93c"; color: $error-color; font-size: 16px; } + .fi-jdbc:before { content: "\e93d"; font-size: 16px; } + .fi-python:before { content: "\e93e"; color: #3573a6; font-size: 16px; font-weight: bold; } + .fi-spark-python:before { color: #3573a6; content: "\e93f"; font-size: 18px; } + .fi-storage:before { content: "\e940"; color: #4db091; font-size: 12px; } + .fi-sas:before { content: "\e941"; color: #58c6a2; } + .fi-r:before { content: "\e942"; color: #2d8cf0; font-size: 14px; } + .fi-txt:before { content: "\e943"; color: gray; font-size: 16px; } + .fi-log:before { content: "\e944"; color: gray; font-size: 16px; } + .fi-xls:before { content: "\e945"; color: #36af47; font-size: 16px; } + .fi-xlsx:before { content: "\e946"; color: #36af47; font-size: 16px; } + .fi-csv:before { content: "\e947"; color: #36af47; font-size: 16px; } + .fi-jar:before { content: "\e948"; color: #e45f3d; font-size: 16px; } + .fi-fx-method:before { content: "\e94a"; } + .fi-fx-method-o:before { content: "\e94a"; } + .fi-fx-udf:before { content: "\e94b"; } + .fi-fx-udf-o:before { - content: "\e94b" + content: "\e94b"; } + .fi-data-develop:before { content: "\e600"; color: #4cbf4b; } + .fi-resource:before { content: "\e601"; color: #3293e3; } + .fi-data-exchange:before { content: "\e602"; } + .fi-algorithms:before { content: "\e603"; color: #ff3d3d; } + .fi-workflow:before { - content: "\e604" + content: "\e604"; } + .fi-bi:before { content: "\e605"; color: #9654f5; font-size: 14px; } + .fi-schedule:before { content: "\e903"; } + .fi-workflow1:before { content: "\e901"; } + .fi-exchange:before { content: "\e902"; } + .fi-application:before { content: "\e916"; } + .fi-newproject:before { content: "\e91a"; } + .fi-addproject:before { content: "\e919"; } + .fi-visualis:before { content: "\e91b"; } + .fi-qualitis:before { content: "\e91c"; } + .fi-scriptis:before { content: "\e92a"; } + .fi-system:before { content: "\e92b"; } +.fi-plus:before { + content: "\ea0a"; +} + +.fi-cross1:before { + content: "\ea0f"; +} + // refresh icon 单独设置padding -.ivu-icon-ios-refresh{ +.ivu-icon-ios-refresh { padding: 4px 3px; } - @keyframes we-icon-loading-spin { - from { - transform: rotate(0deg); - } - 50% { - transform: rotate(180deg); - } - to { - transform: rotate(360deg); - } + from { + transform: rotate(0deg); } + + 50% { + transform: rotate(180deg); + } + + to { + transform: rotate(360deg); + } +} + .we-icon-loading { - color: #3d3d3d; - animation: we-icon-loading-spin 1s linear infinite; + color: #3d3d3d; + animation: we-icon-loading-spin 1s linear infinite; } diff --git a/web/src/assets/styles/workspace.scss b/web/src/assets/styles/workspace.scss new file mode 100644 index 0000000000..552942ed48 --- /dev/null +++ b/web/src/assets/styles/workspace.scss @@ -0,0 +1,277 @@ +/*! + * Copyright 2019 WeBank + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +@import './variables.scss'; + +.page-bgc { + background: rgb(245, 245, 245); + height: 100%; + margin: 0; + display: flex; + flex-direction: column; + //竖轴方向 + + .page-bgc-header { + padding: 10px 25px 0; + } + + .header-title { + font-size: 14px; + font-weight: bold; + padding-left: 5px; + border-left: 3px solid $primary-color; + } + + .header-info { + padding: 10px 0 10px 20px; + + p { + line-height: 24px; + } + } + +} + +.app-icon { + font-size: 14px; + height: 30px; + line-height: 30px; + color: #39f; +} + +.workspace-main { + padding: 10px 25px; + display: -webkit-box; + display: flex; + -webkit-box-pack: start; + justify-content: flex-start; + -webkit-box-align: start; + align-items: flex-start; + + .item-header { + font-size: 14px; + font-weight: bold; + padding-left: 23px; + border-left: 2px solid $primary-color; + + } + + .left { + flex: 1; + min-height: 137px; + // box-shadow: 0 1px 6px rgba(0,0,0,.2); + border-color: rgba(0,0,0,0); + padding: 0; + } + + .right { + // flex: 1; + margin-left: 25px; + min-height: 137px; + width: 500px; + // box-shadow: 0 1px 6px rgba(0,0,0,.2); + border-color: rgba(0,0,0,0); + padding: 0; + } + + .setting-bt-wrap { + position: absolute; + right: 20px; + top: 10px; + font-size: 24px; + + &.ivu-btn-text { + outline: none; + border: none; + box-shadow: 0 0 0 2px transparent; + } + } + + .app-list { + display: flex; + flex-wrap: wrap; + align-items: center; + + .app-item-add { + display: flex; + margin: 20px 10px 10px 25px; + padding: 10px; + cursor: pointer; + font-size: 24px; + transition: color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear; + + &:hover { + transition: color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear; + color: #39f; + + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + } + + .shadow { + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + + .app-item-wrap { + display: flex; + position: relative; + margin: 20px 10px 10px 25px; + padding: 10px 30px; + cursor: pointer; + border: 1px solid rgb(245, 245, 245); + border-radius: 3px; + + .close-wrap { + position: absolute; + right: -5px; + top: -5px; + color: #39f; + } + + &:hover { + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + + .label { + margin-left: 10px; + // width: 110px; + // font-weight: 700; + font-size: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 30px; + height: 30px; + } + } + } +} + +.app-list-main { + padding: 0 25px 10px; + // bottom: 0; + flex: auto; + + .app-list-tabs { + padding: 20px 20px 20px 22px; + + border-radius: 6px; + height: 100%; + position: relative; + -webkit-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; + background-color: #fff; + + &:hover { + box-shadow: 0 2px 7px rgba(0,0,0,.15); + border-color: transparent; + position: relative; + } + + .pane-wrap { + display: flex; + flex-wrap: wrap; + + .pane-item { + float: left; + margin: 10px 100px 0 0; + width: 450px; + } + + .app-entrance { + display: flex; + + .app-title-wrap { + flex: 1; + font-size: 12px; + + .app-title { + display: flex; + align-items: center; + margin-top: -10px; + + .title-sub { + margin-right: 10px; + } + + .app-tag { + color: #07C1E0; + border: 1px solid transparent; + background: #07C1E0; + } + + } + + } + + .app-status-wrap-active { + position: absolute; + right: 0; + top: 6px; + width: 70px; + font-size: 12px; + + color: #0c6; + + span { + color: #515a6e; + } + } + + .app-status-wrap-disable { + + position: absolute; + right: 0; + top: 6px; + width: 70px; + font-size: 12px; + color: #ccc; + + span { + color: #515a6e; + } + } + + } + + .button-wrap { + display: flex; + margin-top: 20px; + // justify-content: center; + + .entrace-btn { + margin-right: 10px; + } + } + + } + } + +} + +.input-wrap { + position: absolute; + right: 20px; + top: 20px; + width: 200px; +} + +.radio-box .ivu-radio .ivu-radio-inner { + border: 1px solid #2d8cf0; +} diff --git a/web/src/commonData/i18n/common/en.json b/web/src/commonData/i18n/common/en.json index d89c380632..4cdf41d22b 100644 --- a/web/src/commonData/i18n/common/en.json +++ b/web/src/commonData/i18n/common/en.json @@ -490,7 +490,7 @@ "cancel": "Cancel", "timeout": "Timeout on publishing project {name}!" }, - "tableDetails" : { + "tableDetails": { "BZBSX": "Table basic attributes", "BZDXX": "Table column information", "BTJXX": "Table statistical information", @@ -1018,6 +1018,20 @@ }, "error": { "fileExists": "Duplicated file!" + }, + "home": { + "welcome": "Welcome to the {text} workspace!", + "setting": "Seting", + "exit": "Exit", + "enter": "Enter {text}", + "dlgTitle": "New Fast entry", + "selectType": "Please select category", + "selectApp": "Please select Application", + "save": "Save", + "cancel": "Cancel", + "running": "running", + "stop": "disable", + "searchPlaceholder": "Search application" } }, "database": { @@ -1614,4 +1628,4 @@ } } } -} +} \ No newline at end of file diff --git a/web/src/commonData/i18n/common/zh.json b/web/src/commonData/i18n/common/zh.json index 93c250f1a9..1328e2b322 100644 --- a/web/src/commonData/i18n/common/zh.json +++ b/web/src/commonData/i18n/common/zh.json @@ -293,7 +293,7 @@ "WJYCZ": "文件已存在,请选择其它文件或选择其它文件夹!", "WJMCBHF": "文件名称不合法,仅支持以字母、数字、中文、下划线、中短线且带后缀的命名!", "SCBCG100": "上传文件不超过100M!", - "SCCG": "文件 {name} 上传成功!", + "SCCG": "文件 {name} 上传成功!", "WJCCXE": "文件大小超出限额!", "WJBSC": "资源文件 {name} 已被成功删除!" } @@ -490,7 +490,7 @@ "cancel": "关闭", "timeout": "工程{name}发布超时!" }, - "tableDetails" : { + "tableDetails": { "BZBSX": "表基本属性", "BZDXX": "表字段信息", "BTJXX": "表统计信息", @@ -534,7 +534,6 @@ "YES": "对", "GSHJX": "进行格式化成", "ZJXYGE": "组件需要的格式" - }, "logView": { "taskId": "任务ID:", @@ -1019,6 +1018,20 @@ }, "error": { "fileExists": "该文件已经存在!" + }, + "home": { + "welcome": "欢迎来到 {text} 的工作空间!", + "setting": "设置", + "exit": "退出设置", + "enter": "进入{text}", + "dlgTitle": "新增快速入口", + "selectType": "请选择分类", + "selectApp": "请选择系统", + "save": "保存", + "cancel": "取消", + "running": "运行中", + "stop": "不可用", + "searchPlaceholder": "搜索应用系统" } }, "database": { @@ -1615,4 +1628,4 @@ } } } -} +} \ No newline at end of file diff --git a/web/src/js/component/table/index.js b/web/src/js/component/table/index.js index 350c6b1a73..5def7449c0 100644 --- a/web/src/js/component/table/index.js +++ b/web/src/js/component/table/index.js @@ -15,7 +15,7 @@ * */ -import WeTable from './table.vue'; +import WeTable from './resultTable/table.vue'; import historyTable from './historyTable/historyTable.vue'; export default { WeTable, diff --git a/web/src/js/component/table/resultTable/body.vue b/web/src/js/component/table/resultTable/body.vue new file mode 100644 index 0000000000..502a4aa3f2 --- /dev/null +++ b/web/src/js/component/table/resultTable/body.vue @@ -0,0 +1,285 @@ + + + diff --git a/web/src/js/component/table/resultTable/header.vue b/web/src/js/component/table/resultTable/header.vue new file mode 100644 index 0000000000..f8bfc2fec5 --- /dev/null +++ b/web/src/js/component/table/resultTable/header.vue @@ -0,0 +1,128 @@ + + diff --git a/web/src/js/component/table/resultTable/list.vue b/web/src/js/component/table/resultTable/list.vue new file mode 100644 index 0000000000..aab7cf4e1e --- /dev/null +++ b/web/src/js/component/table/resultTable/list.vue @@ -0,0 +1,102 @@ + + diff --git a/web/src/js/component/table/resultTable/table.vue b/web/src/js/component/table/resultTable/table.vue new file mode 100644 index 0000000000..faa5693b04 --- /dev/null +++ b/web/src/js/component/table/resultTable/table.vue @@ -0,0 +1,188 @@ + + + + diff --git a/web/src/js/module/footer/index.scss b/web/src/js/module/footer/index.scss index 5df19daf3a..ee8cf90c60 100644 --- a/web/src/js/module/footer/index.scss +++ b/web/src/js/module/footer/index.scss @@ -50,3 +50,12 @@ color: $text-color; } } +.footer-mask { + position: fixed; + top: -100vh; + left: -100vw; + width: 200vw; + height: 200vh; + background-color: #00000000; +} + \ No newline at end of file diff --git a/web/src/js/module/footer/index.vue b/web/src/js/module/footer/index.vue index 16d9fd6441..e47a22d738 100644 --- a/web/src/js/module/footer/index.vue +++ b/web/src/js/module/footer/index.vue @@ -9,6 +9,7 @@ ref="resourceSimple" @update-job="updateJob"> + + + +
{ + if (!isEmpty(rst)) { + this.workspaces = rst.workspaces; + } + }) }); + + }, goto(name) { this.$router.push({ @@ -247,6 +263,17 @@ export default { setTimeout(() => { newTab.location.href = url; }, 500); + }, + goSpaceHome(){ + console.log('workspaceId', this.$route.query.workspaceId) + this.$router.push({path: '/home',query: Object.assign({}, this.$route.query)}); + }, + goConsole(){ + console.log('workspaceId', this.$route.query.workspaceId) + this.$router.push({path: '/console',query: Object.assign({}, this.$route.query)}); + }, + changeWorkspace(data){ + this.$router.push({path: '/workspace',query: Object.assign({}, this.$route.query, {workspaceId: data.id})}); } }, }; diff --git a/web/src/js/module/header/workspaceMenu.vue b/web/src/js/module/header/workspaceMenu.vue new file mode 100644 index 0000000000..f497c31c1c --- /dev/null +++ b/web/src/js/module/header/workspaceMenu.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/web/src/js/module/hiveSidebar/hiveSidebar.vue b/web/src/js/module/hiveSidebar/hiveSidebar.vue index 4479c4d27b..2edfe52691 100644 --- a/web/src/js/module/hiveSidebar/hiveSidebar.vue +++ b/web/src/js/module/hiveSidebar/hiveSidebar.vue @@ -307,8 +307,8 @@ export default { this.dispatch('Workbench:pasteInEditor', value, this.node); }, queryTable() { - const tabName = `${this.currentAcitved.dbName}.${this.currentAcitved.name}`; - const code = `select * from ${tabName} limit 100`; + const tabName = `${this.currentAcitved.dbName}_${this.currentAcitved.name}`; + const code = `select * from ${this.currentAcitved.dbName}.${this.currentAcitved.name} limit 100`; const filename = `${tabName}_select.hql`; const md5Path = util.md5(filename); this.dispatch('Workbench:add', { diff --git a/web/src/js/module/process/module.vue b/web/src/js/module/process/module.vue index 5b734c3bbd..06846caa42 100644 --- a/web/src/js/module/process/module.vue +++ b/web/src/js/module/process/module.vue @@ -797,7 +797,7 @@ export default { 'msgName': '', 'queryFrequency': 10, 'maxReceiveHours': 12, - 'msgSavekey': '', + 'msgSavekey': 'msg.body', 'onlyReceiveToday': 'true', }, }); @@ -1635,7 +1635,7 @@ export default { const fileName = `${time.getTime()}${match.ext}`; const params = { fileName, - scriptContent: rst.fileContent, + scriptContent: rst.fileContent[0][0], metadata: rst.params, }; api.fetch('/filesystem/saveScriptToBML', params, 'post') diff --git a/web/src/js/module/project/feature.vue b/web/src/js/module/project/feature.vue index 437e04b825..989654ee55 100644 --- a/web/src/js/module/project/feature.vue +++ b/web/src/js/module/project/feature.vue @@ -72,6 +72,7 @@ export default { }, methods: { goto(type) { + console.log('--->', type) this.gotoCommonIframe(type); }, createProject() { diff --git a/web/src/js/module/workbench/container.vue b/web/src/js/module/workbench/container.vue index 64c7dd8e2f..68773e0067 100644 --- a/web/src/js/module/workbench/container.vue +++ b/web/src/js/module/workbench/container.vue @@ -441,13 +441,13 @@ export default { api.fetch('/filesystem/openFile', { path: option.path, }, 'get').then((rst) => { - const ismodifyByOldTab = option.code && !rst.fileContent; + const ismodifyByOldTab = option.code && !rst.fileContent[0][0]; const params = ismodifyByOldTab ? option.params : this.convertSettingParams(rst.params); this[methodName]({ id: md5Path, filename: option.filename, filepath: option.path, - code: rst.fileContent || option.code, + code: rst.fileContent[0][0] || option.code, params, type: option.type, saveAs: option.saveAs || false, diff --git a/web/src/js/module/workbench/script/result.vue b/web/src/js/module/workbench/script/result.vue index 30c0458a87..b0b6842d10 100644 --- a/web/src/js/module/workbench/script/result.vue +++ b/web/src/js/module/workbench/script/result.vue @@ -36,6 +36,7 @@ :height="tableData.height" :columns="data.headRows" :data="data.bodyRows" + @on-sort-change="sortChange" @on-current-change="onRowClick" class="result-normal-table"> @@ -58,7 +59,8 @@ @on-scroll="saveOffset" @dbl-click="copyLabel" @on-click="onWeTableRowClick" - @change-status="changeStatus"/> + @change-status="changeStatus" + @handleSortClick="handleSortClick"/> + v-html="result.bodyRows[0][0]"/> {{ $t('message.workBench.body.script.result.emptyText') }} @@ -111,6 +113,7 @@ import WeWaterMask from '@js/component/watermark'; import WeToolbar from './toolbar.vue'; import elementResizeEvent from '@js/helper/elementResizeEvent'; import resultSetList from './resultSetList.vue'; +import pinyin from 'pinyin'; export default { components: { WeTable: Table.WeTable, @@ -243,6 +246,146 @@ export default { 'Workbench:setParseAction'(id) { this.resize(); }, + handleSortClick(args) { + let { reverse,col, colIndex, cb } = args; + let order = 'normal'; + if (args.reverse === -1) { + order = 'desc' + } else if (args.reverse === 1) { + order = 'asc' + } + // 先通过表头的内容找到对应全数据数据的index + let sortIndex + this.data.headRows.map((head, index) => { + if (head.content === col.content) { + sortIndex = index + } + }) + // 大于50列排序现将要排序的列和原始index保持 + let sortColumnAll = this.originRows.map((row, index) => { + return { + originIndex: index, + value: row[sortIndex] + } + }) + // 将找出的列排序 + sortColumnAll = this.arraySortByName(sortColumnAll, col.columnType, 'value');// 从小到大 + let newRow = []; + if (order === 'asc') {// 升序 + sortColumnAll.map((item, index) => { + newRow[index] = this.originRows[item.originIndex]; + }) + this.originRows = newRow; + } else if (order === 'desc') {// 降序 + sortColumnAll.reverse(); + sortColumnAll.map((item, index) => { + newRow[index] = this.originRows[item.originIndex]; + }) + this.originRows = newRow; + } else if (order === 'normal') {// 恢复原来数据 + this.originRows = this.result.bodyRows || []; + this.data.originRows = this.originRows; + } + this.pageingData(); + }, + addCellClassName() { + // 需要将每一行中的NULL挑选出来 + if (this.tableData.type === 'normal') { + this.originRows = this.originRows.map((row) => { + row.cellClassName = {}; + Object.keys(row).forEach((key)=> { + if (row[key] === 'NULL') { + row.cellClassName[key] = 'is-null'; + } + }) + return row; + }) + } + }, + sortChange({column, key, order}) { + this.originRows = this.arraySortByName(this.originRows, column.columnType, key);// 从小到大 + if (order === 'asc') {// 升序 + this.addCellClassName(); + } else if (order === 'desc') {// 降序 + this.originRows.reverse(); + this.addCellClassName(); + } else if (order === 'normal') {// 恢复原来数据 + if (this.tableData.type === 'normal') { + this.originRows = this.result.bodyRows.map((row) => { + let newItem = {}; + const NullList = []; + row.forEach((item, index) => { + Object.assign(newItem, { + [this.result.headRows[index]]: item, + }); + if (item === 'NULL') { + NullList.push(this.result.headRows[index]); + } + }); + // 对于NULL值加上高亮样式 + if (NullList.length) { + newItem.cellClassName = {}; + NullList.forEach((item) => { + newItem.cellClassName[item] = 'is-null'; + }); + } + return newItem; + }); + } else { + this.originRows = this.result.bodyRows || []; + } + this.data.originRows = this.originRows; + } + this.pageingData(); + }, + arraySortByName(list, valueType, key) { + if (list === undefined || list === null) return []; + list.sort((a, b) => { + let strA = a[key]; + let strB = b[key]; + // 谁为非法值谁在前面 + if (strA === undefined || strA === null || strA === '' || strA === ' ' || strA === ' ' || strA === 'NULL') { + return -1; + } + if (strB === undefined || strB === null || strB === '' || strB === ' ' || strB === ' ' || strB === 'NULL') { + return 1; + } + // 如果为整数型大小 + if (['int', 'float', 'double', 'long', 'short', 'bigInt', 'decimal'].includes(valueType.toLowerCase())) { + + return strA - strB; + } + const charAry = strA.split(''); + for (const i in charAry) { + if ((this.charCompare(strA[i], strB[i]) !== 0)) { + return this.charCompare(strA[i], strB[i]); + } + } + // 如果通过上面的循环对比还比不出来,就无解了,直接返回-1 + return -1; + }); + return list; + }, + charCompare(charA, charB) { + // 谁为非法值谁在前面 + if (charA === undefined || charA === null || charA === '' || charA === ' ' || charA === ' ') { + return -1; + } + if (charB === undefined || charB === null || charB === '' || charB === ' ' || charB === ' ') { + return 1; + } + if (!this.notChinese(charA)) { + charA = pinyin(charA)[0][0]; + } + if (!this.notChinese(charB)) { + charB = pinyin(charB)[0][0]; + } + return charA.localeCompare(charB); + }, + notChinese(char) { + const charCode = char.charCodeAt(0); + return charCode >= 0 && charCode <= 128; + }, initOffset() { let cache = this.script.result.cache; let x = 0; @@ -279,6 +422,7 @@ export default { let headRows = this.result.headRows || []; this.data.headRows = []; this.data.bodyRows = []; + this.originRows = this.result.bodyRows || []; this.tableData.total = this.result.total; if (this.tableData.type === 'normal') { @@ -289,10 +433,7 @@ export default { this.data.headRows.push({ title, key: item, - sortable: 'true', - sortMethod: function(a, b, type) { - return util.sort(a, b, type); - }, + sortable: 'custom', columnType, renderHeader: (h, params) => { return h('span', { @@ -362,7 +503,7 @@ export default { this.data.bodyRows = newArr; } }, - change(page) { + change(page = 1) { this.hightLightRow = null; this.page.current = page; this.pageingData(); diff --git a/web/src/js/service/mixin.js b/web/src/js/service/mixin.js index 4ca8713dc7..a80e7d63f6 100644 --- a/web/src/js/service/mixin.js +++ b/web/src/js/service/mixin.js @@ -142,7 +142,6 @@ export default { localStorage.removeItem('appJointProjectId') url = info.homepageUrl } - window.console.log(url, 'url') // 如果没有提示用户功能暂未开发 if (Object.keys(info).length === 0) { this.$Message.warning(this.$t('message.constants.warning.comingSoon')); diff --git a/web/src/js/service/router.js b/web/src/js/service/router.js index 7e6b57b55e..6a6697cc74 100644 --- a/web/src/js/service/router.js +++ b/web/src/js/service/router.js @@ -65,6 +65,24 @@ const router = new VueRouter({ }, component: () => import('../view/workflow/index.vue'), }, + { + path: 'workspace', + name: 'workspace', + meta: { + title: 'Workspace', + publicPage: true, + }, + component: () => import('../view/workspace/index.vue'), + }, + { + path: 'workspace1', + name: 'workspace1', + meta: { + title: 'Workspace1', + publicPage: true, + }, + component: () => import('../view/newhome/module/workspace/index.vue'), + }, { path: 'commonIframe', name: 'commonIframe', diff --git a/web/src/js/view/newhome/images/111.png b/web/src/js/view/newhome/images/111.png new file mode 100644 index 0000000000..0d0dc410e3 Binary files /dev/null and b/web/src/js/view/newhome/images/111.png differ diff --git a/web/src/js/view/newhome/images/333.png b/web/src/js/view/newhome/images/333.png new file mode 100644 index 0000000000..5f696746e0 Binary files /dev/null and b/web/src/js/view/newhome/images/333.png differ diff --git a/web/src/js/view/newhome/images/QR.jpg b/web/src/js/view/newhome/images/QR.jpg new file mode 100644 index 0000000000..f85da5edab Binary files /dev/null and b/web/src/js/view/newhome/images/QR.jpg differ diff --git a/web/src/js/view/newhome/images/desktop.ini b/web/src/js/view/newhome/images/desktop.ini new file mode 100644 index 0000000000..564c65794a --- /dev/null +++ b/web/src/js/view/newhome/images/desktop.ini @@ -0,0 +1,11 @@ +[LocalizedFileNames] +u620.png=@u620.png,0 +u501.png=@u501.png,0 +u504.png=@u504.png,0 +u509.png=@u509.png,0 +u513.png=@u513.png,0 +u517.png=@u517.png,0 +u82.svg=@u82.svg,0 +u476.png=@u476.png,0 +u619.png=@u619.png,0 +u621.png=@u621.png,0 diff --git a/web/src/js/view/newhome/images/edit1.png b/web/src/js/view/newhome/images/edit1.png new file mode 100644 index 0000000000..09c8c78ce6 Binary files /dev/null and b/web/src/js/view/newhome/images/edit1.png differ diff --git a/web/src/js/view/newhome/images/u1191.png b/web/src/js/view/newhome/images/u1191.png new file mode 100644 index 0000000000..e65a0f3425 Binary files /dev/null and b/web/src/js/view/newhome/images/u1191.png differ diff --git a/web/src/js/view/newhome/images/u1225.png b/web/src/js/view/newhome/images/u1225.png new file mode 100644 index 0000000000..47a86ba9df Binary files /dev/null and b/web/src/js/view/newhome/images/u1225.png differ diff --git a/web/src/js/view/newhome/images/u1226.png b/web/src/js/view/newhome/images/u1226.png new file mode 100644 index 0000000000..cd61e21058 Binary files /dev/null and b/web/src/js/view/newhome/images/u1226.png differ diff --git a/web/src/js/view/newhome/images/u1229.png b/web/src/js/view/newhome/images/u1229.png new file mode 100644 index 0000000000..11052cd14c Binary files /dev/null and b/web/src/js/view/newhome/images/u1229.png differ diff --git a/web/src/js/view/newhome/images/u476.png b/web/src/js/view/newhome/images/u476.png new file mode 100644 index 0000000000..106414b56f Binary files /dev/null and b/web/src/js/view/newhome/images/u476.png differ diff --git a/web/src/js/view/newhome/images/u501.png b/web/src/js/view/newhome/images/u501.png new file mode 100644 index 0000000000..9f0e0f2cc0 Binary files /dev/null and b/web/src/js/view/newhome/images/u501.png differ diff --git a/web/src/js/view/newhome/images/u504.png b/web/src/js/view/newhome/images/u504.png new file mode 100644 index 0000000000..59fd43ac27 Binary files /dev/null and b/web/src/js/view/newhome/images/u504.png differ diff --git a/web/src/js/view/newhome/images/u509.png b/web/src/js/view/newhome/images/u509.png new file mode 100644 index 0000000000..986e397194 Binary files /dev/null and b/web/src/js/view/newhome/images/u509.png differ diff --git a/web/src/js/view/newhome/images/u513.png b/web/src/js/view/newhome/images/u513.png new file mode 100644 index 0000000000..97905ddd3b Binary files /dev/null and b/web/src/js/view/newhome/images/u513.png differ diff --git a/web/src/js/view/newhome/images/u517.png b/web/src/js/view/newhome/images/u517.png new file mode 100644 index 0000000000..b39cd2120a Binary files /dev/null and b/web/src/js/view/newhome/images/u517.png differ diff --git a/web/src/js/view/newhome/images/u619.png b/web/src/js/view/newhome/images/u619.png new file mode 100644 index 0000000000..72022a302b Binary files /dev/null and b/web/src/js/view/newhome/images/u619.png differ diff --git a/web/src/js/view/newhome/images/u620.png b/web/src/js/view/newhome/images/u620.png new file mode 100644 index 0000000000..05c87dec57 Binary files /dev/null and b/web/src/js/view/newhome/images/u620.png differ diff --git a/web/src/js/view/newhome/images/u621.png b/web/src/js/view/newhome/images/u621.png new file mode 100644 index 0000000000..23932f13f6 Binary files /dev/null and b/web/src/js/view/newhome/images/u621.png differ diff --git a/web/src/js/view/newhome/images/u82.svg b/web/src/js/view/newhome/images/u82.svg new file mode 100644 index 0000000000..e67551d388 --- /dev/null +++ b/web/src/js/view/newhome/images/u82.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/src/js/view/newhome/index.vue b/web/src/js/view/newhome/index.vue new file mode 100644 index 0000000000..09d9d0d42e --- /dev/null +++ b/web/src/js/view/newhome/index.vue @@ -0,0 +1,3 @@ + diff --git a/web/src/js/view/newhome/module/caseAndIntroduction/index.js b/web/src/js/view/newhome/module/caseAndIntroduction/index.js new file mode 100644 index 0000000000..9ea52ad7e8 --- /dev/null +++ b/web/src/js/view/newhome/module/caseAndIntroduction/index.js @@ -0,0 +1,10 @@ +export default { + name: 'CaseAndIntroduction', + events: [], + dispatchs: { + }, + data: { + API_PATH: process.env.VUE_APP_MN_CONFIG_PREFIX || `http://${window.location.host}/api/rest_j/v1/`, + }, + component: () => import('./index.vue'), +}; \ No newline at end of file diff --git a/web/src/js/view/newhome/module/caseAndIntroduction/index.vue b/web/src/js/view/newhome/module/caseAndIntroduction/index.vue new file mode 100644 index 0000000000..6a84b08139 --- /dev/null +++ b/web/src/js/view/newhome/module/caseAndIntroduction/index.vue @@ -0,0 +1,227 @@ + + + + diff --git a/web/src/js/view/newhome/module/workspace/index.js b/web/src/js/view/newhome/module/workspace/index.js new file mode 100644 index 0000000000..01be3f4532 --- /dev/null +++ b/web/src/js/view/newhome/module/workspace/index.js @@ -0,0 +1,10 @@ +export default { + name: 'Workspace', + events: [], + dispatchs: { + }, + data: { + API_PATH: process.env.VUE_APP_MN_CONFIG_PREFIX || `http://${window.location.host}/api/rest_j/v1/`, + }, + component: () => import('./index.vue'), +}; \ No newline at end of file diff --git a/web/src/js/view/newhome/module/workspace/index.scss b/web/src/js/view/newhome/module/workspace/index.scss new file mode 100644 index 0000000000..45d914b50b --- /dev/null +++ b/web/src/js/view/newhome/module/workspace/index.scss @@ -0,0 +1,151 @@ +@import '../../../../../assets/styles/variables.scss'; + +.page-bgc { + background-color: #f7f7f7; + background: #fff; + + .page-bgc-header { + padding: 10px 25px 0; + } + + .header-info { + padding: 10px 0 10px 20px; + + p { + line-height: 24px; + } + } + + .workspace-main { + padding: 10px 25px; + display: flex; + justify-content: flex-start; + align-items: flex-start; + + .left { + flex: 1; + box-shadow: 0 1px 6px rgba(0, 0, 0, .2); + border-color: #eee; + min-height: 500px; + + .workspace-type-header { + padding: 10px 20px 0; + line-height: 30px; + display: flex; + justify-content: flex-start; + align-items: center; + + .workspace-type-header-label { + font-size: 14px; + display: inline-block; + margin: 0 5px; + font-weight: 900; + } + } + + .workspace-create-search { + padding: 0 35px; + display: flex; + justify-content: flex-start; + align-items: center; + margin: 10px 0 50px; + + .workspace-create { + flex-basis: 200px; + display: flex; + justify-content: flex-start; + align-items: center; + padding: 15px 10px; + + &:hover { + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + + .workspace-create-text { + margin-left: 10px; + cursor: pointer; + } + } + + .header-search { + flex: 50%; + } + } + + .item-header { + font-size: 14px; + margin: 20px 25px 10px; + font-weight: bold; + padding-left: 5px; + border-left: 3px solid $primary-color; + } + + .workspace-content { + .content-item { + .workspace-item { + cursor: pointer; + height: 180px; + margin: 15px; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2); + background: #fff; + padding: 10px; + position: relative; + // background: url("../../../../../assets/images/workspace.png") center center no-repeat; + background-size: cover; + min-width: 222px; + + .name { + display: block; + font-size: 16px; + font-weight: 600; + color: white; + } + + .desc { + width: 100%; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + color: white; + } + + .lable-list { + position: absolute; + left: 10px; + bottom: 30px; + display: flex; + justify-content: flex-start; + align-items: flex-start; + width: 100%; + + .item { + display: inline-block; + font-size: 10px; + padding: .3em .9em; + margin: 0 .5em .5em 0; + white-space: nowrap; + background-color: #f1f8ff; + border-radius: 3px; + color: #0366d6; + overflow: hidden; + text-overflow: ellipsis; + max-width: 31%; + } + } + + .editor { + position: absolute; + right: 10px; + bottom: 10px; + } + } + } + } + } + } + +} diff --git a/web/src/js/view/newhome/module/workspace/index.vue b/web/src/js/view/newhome/module/workspace/index.vue new file mode 100644 index 0000000000..953c1f68a4 --- /dev/null +++ b/web/src/js/view/newhome/module/workspace/index.vue @@ -0,0 +1,157 @@ + + + diff --git a/web/src/js/view/newhome/module/workspace/module/workspaceForm.vue b/web/src/js/view/newhome/module/workspace/module/workspaceForm.vue new file mode 100644 index 0000000000..e297a552ad --- /dev/null +++ b/web/src/js/view/newhome/module/workspace/module/workspaceForm.vue @@ -0,0 +1,168 @@ + + diff --git a/web/src/js/view/newhome/tips.md b/web/src/js/view/newhome/tips.md new file mode 100644 index 0000000000..99a8d98213 --- /dev/null +++ b/web/src/js/view/newhome/tips.md @@ -0,0 +1,12 @@ +#### 开发注意 + +1. 自定义首页就在idnex.vue文件下开发,需要的工作空间和案例、快速入门在./module下,需要自行调试哦!!! + +2. 新增其他页面在view下面新建文件夹,页面对应的路由在:src\js\service\router.js下自行配置 + +3. 开发过程中可以使用:src\js\component下的公共组件,尽量不要修改,造成不通用,也可以新增组件 + +4. 目前开源的还没工作空间概念,所以对应的接口服务还没有,需要后台上传对应服务代码 + +5. 开发过程有问题随时联系 ![扫码加入](images/QR.png) + diff --git a/web/src/js/view/workspace/index.vue b/web/src/js/view/workspace/index.vue new file mode 100644 index 0000000000..4b259bf7fd --- /dev/null +++ b/web/src/js/view/workspace/index.vue @@ -0,0 +1,327 @@ + + + + + + \ No newline at end of file diff --git a/web/vue.config.js b/web/vue.config.js index d951102270..9b48f08520 100644 --- a/web/vue.config.js +++ b/web/vue.config.js @@ -32,6 +32,31 @@ const getVersion = () => { module.exports = { publicPath: './', outputDir: 'dist/dist', + devServer: { + port: 8080, + open: true, + disableHostCheck: true, + overlay: { + warnings: false, + errors: true + }, + proxy: { //代理转发 + '^/api/rest_j/v1': { + target: 'http://host:port', //后端服务地址 + ws: true, + changeOrigin: true, + pathRewrite: { + '^/api/rest_j/v1': '/api/rest_j/v1' + } + }, + '^/ws/api': { //websocket + target: 'ws://host:port', + ws: true, + secure: false, + }, + } + // after: require('./mock/mock-server.js') + }, chainWebpack: (config) => { if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'sandbox') { config.plugin('compress').use(FileManagerPlugin, [{