Commit f8240d43 authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20221012-environment' into 'master'

Feat 20221012 environment

See merge request !188
parents 181bec6a 67495b8a
This diff is collapsed.
This diff is collapsed.
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
This diff is collapsed.
@font-face {
font-family: "iconfont"; /* Project id 3701233 */
src: url('iconfont.woff2?t=1667357803082') format('woff2'),
url('iconfont.woff?t=1667357803082') format('woff'),
url('iconfont.ttf?t=1667357803082') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-bangzhuwendang:before {
content: "\e61e";
}
.icon-tubiaopaixu:before {
content: "\e608";
}
.icon-liebiaopaixu:before {
content: "\e609";
}
.icon-zhanghaoxinxi:before {
content: "\e60a";
}
.icon-xiazai:before {
content: "\e60c";
}
.icon-shaixuan:before {
content: "\e60d";
}
.icon-shangchuanwenjian:before {
content: "\e60f";
}
.icon-zhanghaoanquan:before {
content: "\e611";
}
.icon-shijianicon:before {
content: "\e612";
}
.icon-gailan:before {
content: "\e613";
}
.icon-guanbi:before {
content: "\e614";
}
.icon-tishitubiao:before {
content: "\e615";
}
.icon-gongzuoliumoban:before {
content: "\e616";
}
.icon-shanchu:before {
content: "\e617";
}
.icon-wenjianchuanshu:before {
content: "\e618";
}
.icon-renwuliebiao:before {
content: "\e61a";
}
.icon-gongzuotai:before {
content: "\e61b";
}
.icon-xiangmushezhi:before {
content: "\e61c";
}
.icon-gerenziyuan:before {
content: "\e61d";
}
.icon-shujuguanli:before {
content: "\e607";
}
.icon-chakan:before {
content: "\e605";
}
.icon-paixu:before {
content: "\e606";
}
.icon-quanping:before {
content: "\e60b";
}
.icon-sousuo:before {
content: "\e60e";
}
.icon-shuaxin:before {
content: "\e610";
}
.icon-tuichuquanping:before {
content: "\e619";
}
This diff is collapsed.
{
"id": "3701233",
"name": "云平台",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "北鲲云云平台",
"glyphs": [
{
"icon_id": "32602581",
"name": "帮助文档",
"font_class": "bangzhuwendang",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "32602444",
"name": "图表排序",
"font_class": "tubiaopaixu",
"unicode": "e608",
"unicode_decimal": 58888
},
{
"icon_id": "32602445",
"name": "列表排序",
"font_class": "liebiaopaixu",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "32602446",
"name": "账号信息",
"font_class": "zhanghaoxinxi",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "32602447",
"name": "下载",
"font_class": "xiazai",
"unicode": "e60c",
"unicode_decimal": 58892
},
{
"icon_id": "32602448",
"name": "筛选",
"font_class": "shaixuan",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "32602449",
"name": "上传文件",
"font_class": "shangchuanwenjian",
"unicode": "e60f",
"unicode_decimal": 58895
},
{
"icon_id": "32602450",
"name": "账号安全",
"font_class": "zhanghaoanquan",
"unicode": "e611",
"unicode_decimal": 58897
},
{
"icon_id": "32602451",
"name": "时间icon",
"font_class": "shijianicon",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "32602452",
"name": "概览",
"font_class": "gailan",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "32602453",
"name": "关闭",
"font_class": "guanbi",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "32602454",
"name": "提示图标",
"font_class": "tishitubiao",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "32602455",
"name": "工作流模版",
"font_class": "gongzuoliumoban",
"unicode": "e616",
"unicode_decimal": 58902
},
{
"icon_id": "32602456",
"name": "删除",
"font_class": "shanchu",
"unicode": "e617",
"unicode_decimal": 58903
},
{
"icon_id": "32602457",
"name": "文件传输",
"font_class": "wenjianchuanshu",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "32602458",
"name": "任务列表",
"font_class": "renwuliebiao",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "32602459",
"name": "工作台",
"font_class": "gongzuotai",
"unicode": "e61b",
"unicode_decimal": 58907
},
{
"icon_id": "32602460",
"name": "项目设置",
"font_class": "xiangmushezhi",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "32602461",
"name": "个人资源",
"font_class": "gerenziyuan",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "32601709",
"name": "数据管理",
"font_class": "shujuguanli",
"unicode": "e607",
"unicode_decimal": 58887
},
{
"icon_id": "32600817",
"name": "查看",
"font_class": "chakan",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "32597278",
"name": "排序",
"font_class": "paixu",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "32597283",
"name": "全屏",
"font_class": "quanping",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "32597286",
"name": "搜索",
"font_class": "sousuo",
"unicode": "e60e",
"unicode_decimal": 58894
},
{
"icon_id": "32597288",
"name": "刷新",
"font_class": "shuaxin",
"unicode": "e610",
"unicode_decimal": 58896
},
{
"icon_id": "32597297",
"name": "退出全屏",
"font_class": "tuichuquanping",
"unicode": "e619",
"unicode_decimal": 58905
}
]
}
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="%PUBLIC_URL%/iconfont/iconfont.css" />
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-13 09:56:57 * @Date: 2022-06-13 09:56:57
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-09-01 15:30:28 * @LastEditTime: 2022-10-27 11:23:23
* @FilePath: /bkunyun/src/api/api_manager.ts * @FilePath: /bkunyun/src/api/api_manager.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -48,6 +48,20 @@ const RESTAPI = { ...@@ -48,6 +48,20 @@ const RESTAPI = {
API_PROJECT_USERS_LIST:`${BACKEND_API_URI_PREFIX}/cpp/project/listusers`, // 获取项目成员 API_PROJECT_USERS_LIST:`${BACKEND_API_URI_PREFIX}/cpp/project/listusers`, // 获取项目成员
API_ADD_PROJECT_USER:`${BACKEND_API_URI_PREFIX}/cpp/project/updatemember`, // 添加项目成员 API_ADD_PROJECT_USER:`${BACKEND_API_URI_PREFIX}/cpp/project/updatemember`, // 添加项目成员
API_GET_PROJECT_POWER:`${BACKEND_API_URI_PREFIX}/cpp/project/listroles`, // 获取项目权限 API_GET_PROJECT_POWER:`${BACKEND_API_URI_PREFIX}/cpp/project/listroles`, // 获取项目权限
API_GET_HARDWARE:`${BACKEND_API_URI_PREFIX}/cpp/cpce/hardware`, // 获取计算队列列表
API_GET_PUBLIC_ENV:`${BACKEND_API_URI_PREFIX}/cpp/common/public/env`, // 获取公共环境
API_GET_PUBLIC_PROJECT:`${BACKEND_API_URI_PREFIX}/cpp/common/public/project`, // 获取公共环境
API_ACTORENV_BUILDENV:`${BACKEND_API_URI_PREFIX}/cpp/actorenv/buildenv`, // 新增应用环境
API_ACTORENV_LIST:`${BACKEND_API_URI_PREFIX}/cpp/actorenv/list`, // 查询用户的应用环境(算子环境)
API_ACTORENV_DELETE:`${BACKEND_API_URI_PREFIX}/cpp/actorenv/delete`, // 删除用户算子环境
API_ACTORENV_DETAIL:`${BACKEND_API_URI_PREFIX}/cpp/actorenv/detail`, // 查询应用环境的详情信息
API_ACTOR_ENV_OPTIONS:`${BACKEND_API_URI_PREFIX}/cpp/actorenv/usableenv`, // 查询用户应用环境下拉
API_SAVE_OPERATOR:`${BACKEND_API_URI_PREFIX}/cpp/workflow/custom/actor`, // 保存自定义批流算子
API_WORKFLOWSPEC_LIST:`${BACKEND_API_URI_PREFIX}/cpp/workbench/product/workflowspec/list`, // 模板列表 所有的
API_WORKFLOWSPEC_DELETE:`${BACKEND_API_URI_PREFIX}/cpp/workbench/workflowspec/delete`, // 删除模板
API_WORKFLOWSPEC_DETAIL:`${BACKEND_API_URI_PREFIX}/cpp/workbench/workflowspec`, // 删除模板
API_OPERATOR_DETAILS:`${BACKEND_API_URI_PREFIX}/cpp/workflow/actorspec/detail`, // 获取算子详情
API_RESOURCE_OPERATOR_LIST:`${BACKEND_API_URI_PREFIX}/cpp/workflow/actorspecs/list`, // 获取算子列表
}; };
export default RESTAPI; export default RESTAPI;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:17:48 * @Date: 2022-05-31 10:17:48
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-30 16:22:15 * @LastEditTime: 2022-10-28 13:58:40
* @FilePath: /bkunyun/src/api/api_prefix.ts * @FilePath: /bkunyun/src/api/api_prefix.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
......
...@@ -105,7 +105,7 @@ class CloudEController { ...@@ -105,7 +105,7 @@ class CloudEController {
headers["Cache-Control"] = "no-cache"; headers["Cache-Control"] = "no-cache";
headers["delfilepath"] = Base64.stringify(Utf8.parse(urls)); headers["delfilepath"] = Base64.stringify(Utf8.parse(urls));
let url = ""; let url = "";
if (getLoaclStorageOfKey("userinfo")) { if (getLoaclStorageOfKey("userInfo")) {
url += urlToken(filetoken, projectId); url += urlToken(filetoken, projectId);
} }
return axios.get(APIOPTION() + "/delete/" + url, { return axios.get(APIOPTION() + "/delete/" + url, {
...@@ -129,7 +129,7 @@ class CloudEController { ...@@ -129,7 +129,7 @@ class CloudEController {
) { ) {
if (ApiUtils.getAuthorizationHeaders(headers)) { if (ApiUtils.getAuthorizationHeaders(headers)) {
headers["Cache-Control"] = "no-cache"; headers["Cache-Control"] = "no-cache";
if (getLoaclStorageOfKey("userinfo")) { if (getLoaclStorageOfKey("userInfo")) {
url += urlToken(filetoken, projectId); url += urlToken(filetoken, projectId);
} }
return axios.get( return axios.get(
...@@ -151,7 +151,7 @@ class CloudEController { ...@@ -151,7 +151,7 @@ class CloudEController {
if (ApiUtils.getAuthorizationHeaders(headers)) { if (ApiUtils.getAuthorizationHeaders(headers)) {
headers["Cache-Control"] = "no-cache"; headers["Cache-Control"] = "no-cache";
// headers['parentName'] = '' // headers['parentName'] = ''
if (getLoaclStorageOfKey("userinfo")) { if (getLoaclStorageOfKey("userInfo")) {
url += urlToken(filetoken, projectId); url += urlToken(filetoken, projectId);
} }
return axios.get( return axios.get(
...@@ -172,7 +172,7 @@ class CloudEController { ...@@ -172,7 +172,7 @@ class CloudEController {
) { ) {
if (ApiUtils.getAuthorizationHeaders(headers)) { if (ApiUtils.getAuthorizationHeaders(headers)) {
headers["Cache-Control"] = "no-cache"; headers["Cache-Control"] = "no-cache";
if (getLoaclStorageOfKey("userinfo")) { if (getLoaclStorageOfKey("userInfo")) {
url = urlToken(filetoken, projectId) + "&q=" + url; url = urlToken(filetoken, projectId) + "&q=" + url;
} }
return axios.get( return axios.get(
...@@ -188,7 +188,7 @@ class CloudEController { ...@@ -188,7 +188,7 @@ class CloudEController {
// static JobOutFileListMove(url: any, filetoken: string, projectId: string) { // static JobOutFileListMove(url: any, filetoken: string, projectId: string) {
// if (ApiUtils.getAuthorizationHeaders(headers)) { // if (ApiUtils.getAuthorizationHeaders(headers)) {
// headers["Cache-Control"] = "no-cache"; // headers["Cache-Control"] = "no-cache";
// if (getLoaclStorageOfKey("userinfo")) { // if (getLoaclStorageOfKey("userInfo")) {
// url += urlToken(filetoken, projectId); // url += urlToken(filetoken, projectId);
// } // }
// return axios.get(APIOPTION() + "/download" + url, { // return axios.get(APIOPTION() + "/download" + url, {
...@@ -260,13 +260,14 @@ class CloudEController { ...@@ -260,13 +260,14 @@ class CloudEController {
} }
// 获取文件文本内容(字符串) // 获取文件文本内容(字符串)
static JobFileDownloadText(url: any, filetoken: string, projectId: string) { static JobFileDownloadText(url: any, filetoken: string, projectId: string, fileServerEndPoint: string = '') {
if (ApiUtils.getAuthorizationHeaders(headers)) { if (ApiUtils.getAuthorizationHeaders(headers)) {
url = url + urlToken(filetoken, projectId); url = url + urlToken(filetoken, projectId);
headers["Cache-Control"] = "no-cache"; headers["Cache-Control"] = "no-cache";
headers["Content-Type"] = "multipart/form-data"; headers["Content-Type"] = "multipart/form-data";
let origin = fileServerEndPoint ? fileServerEndPoint : APIOPTION()
return axios.get( return axios.get(
APIOPTION() + "/download" + url + "&showhidden=false", origin + "/download" + url + "&showhidden=false",
{ {
headers: headers, headers: headers,
} }
......
...@@ -30,14 +30,14 @@ const APIPORT = function () { ...@@ -30,14 +30,14 @@ const APIPORT = function () {
// 当前计算区 // 当前计算区
// let currentRegion = localStorage.getItem("current-region"); // let currentRegion = localStorage.getItem("current-region");
// let currentRegionJson = currentRegion && JSON.parse(currentRegion); // let currentRegionJson = currentRegion && JSON.parse(currentRegion);
// let user = getLoaclStorageOfKey("userinfo"); // let user = getLoaclStorageOfKey("userInfo");
// 文件路径 // 文件路径
// const FILEPATH = // const FILEPATH =
// currentRegionJson && // currentRegionJson &&
// currentRegionJson.location && // currentRegionJson.location &&
// currentRegionJson.location === "ON_PREMISE" && // currentRegionJson.location === "ON_PREMISE" &&
// localStorage.getItem("userinfo") // localStorage.getItem("userInfo")
// ? `/home/${user.name}` // ? `/home/${user.name}`
// : "/home/cloudam"; // : "/home/cloudam";
const FILEPATH_SHARE = "/share"; const FILEPATH_SHARE = "/share";
...@@ -62,7 +62,7 @@ const urlToken = (filetoken: string, projectId: string) => { ...@@ -62,7 +62,7 @@ const urlToken = (filetoken: string, projectId: string) => {
}; };
const getUuid = () => { const getUuid = () => {
const userInfo = getLoaclStorageOfKey("userinfo"); const userInfo = getLoaclStorageOfKey("userInfo");
// 是否共有文件系统 // 是否共有文件系统
if ( if (
localStorage.getItem("isShareFileSystem") && localStorage.getItem("isShareFileSystem") &&
...@@ -75,12 +75,12 @@ const getUuid = () => { ...@@ -75,12 +75,12 @@ const getUuid = () => {
}; };
const USERNAME = () => { const USERNAME = () => {
return getLoaclStorageOfKey("userinfo").name; return getLoaclStorageOfKey("userInfo").name;
}; };
// 加密传输 // 加密传输
const encryptTransfer = () => { const encryptTransfer = () => {
const userInfo = getLoaclStorageOfKey("userinfo"); const userInfo = getLoaclStorageOfKey("userInfo");
if (userInfo) { if (userInfo) {
let encryptTransfer = userInfo.encryptTransfer; let encryptTransfer = userInfo.encryptTransfer;
if (encryptTransfer) { if (encryptTransfer) {
......
...@@ -346,6 +346,15 @@ const fetchProjectPower = (params: {id: string}) => { ...@@ -346,6 +346,15 @@ const fetchProjectPower = (params: {id: string}) => {
}); });
}; };
// 获取队列列表
const getHardwreList = (params: {zoneId: string, computeType: string}) => {
return request({
url: Api.API_GET_HARDWARE,
method: "get",
params,
});
}
export { export {
current, current,
menu, menu,
...@@ -373,5 +382,6 @@ export { ...@@ -373,5 +382,6 @@ export {
fetchFlowOutputNumber, fetchFlowOutputNumber,
fetchProjectUsersList, fetchProjectUsersList,
addProjectUser, addProjectUser,
fetchProjectPower fetchProjectPower,
getHardwreList
}; };
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-19 17:09:23
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-31 11:22:34
* @FilePath: /bkunyun/src/api/resourceCenter.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "@/utils/axios/service";
import Api from "./api_manager";
type addActorenvBuildenvParams = {
title: string,
desc: string,
baseEnvId: string,
type: "BATCH" | "FLOW",
filePaths: Array<string>,
bashScript?: string,
script?: string,
computeType: string,
publicProjectId: string,
}
/** 获取算子列表请求参数 */
export interface IOperatorListParams {
keyword?: string;
productId?: string;
type?: string;
page?: number;
size?: number;
}
// 获取公共项目
const getPublicProject = () => {
return request({
url: Api.API_GET_PUBLIC_PROJECT,
method: "get",
});
}
// 获取公共环境
const getPublicEnv = (params: {taskType: 'BATCH' | 'FLOW'}) => {
return request({
url: Api.API_GET_PUBLIC_ENV,
method: "get",
params,
});
};
// 新增应用环境
const addActorenvBuildenv = (params: addActorenvBuildenvParams) => {
return request({
url: Api.API_ACTORENV_BUILDENV,
method: "post",
data: params,
});
};
// 获取公共环境
const getActorenvList = (params: {
type?: 'BATCH' | 'FLOW' | '',
page: number,
size: number,
title?: string,
order?: string,
}) => {
return request({
url: Api.API_ACTORENV_LIST,
method: "get",
params,
});
};
// 删除用户算子环境
const deleteActorenv = (params: {id: string}) => {
return request({
url:`${Api.API_ACTORENV_DELETE}/${params.id}`,
method: "delete",
});
};
// 获取算子列表
const getOperatorList = (params: IOperatorListParams) => {
return request({
url: Api.API_RESOURCE_OPERATOR_LIST,
method: "get",
params
});
}
// 查询应用环境的详情信息
const getActorenvDetail = (params: {id: string}) => {
return request({
url:`${Api.API_ACTORENV_DETAIL}/${params.id}`,
method: "get",
});
};
// 查询应用环境的详情信息
const getActorEnvOptions = (params: {type: string}) => {
return request({
url: `${Api.API_ACTOR_ENV_OPTIONS}`,
method: "get",
params
});
};
// 获取工作流模板
const getWorkflowspecList = (params: {productId?: string, title?: string}) => {
return request({
// url:`${Api.API_WORKFLOWSPEC_LIST}/${params.productId}`,
url:`${Api.API_WORKFLOWSPEC_LIST}`,
method: "get",
params
});
};
// API_WORKFLOWSPEC_LIST
// 新增应用环境
const saveOperator = (params: any) => {
return request({
url: `${Api.API_SAVE_OPERATOR}`,
method: "post",
data: params,
});
};
// 删除工作流模板
const deleteWorkflowspec = (params: {
id: string
}) => {
return request({
url:`${Api.API_WORKFLOWSPEC_DELETE}`,
method: "delete",
params
});
};
// 查询算子的详情信息
const getOperatorDetail = (id: string) => {
return request({
url:`${Api.API_OPERATOR_DETAILS}/${id}`,
method: "get",
});
};
// 获取工作流模板详情
const getWorkflowspecDetail = (id: string) => {
return request({
url: Api.API_WORKFLOWSPEC_DETAIL + '/' + id,
method: "get",
});
};
export {
getPublicEnv,
getPublicProject,
addActorenvBuildenv,
getActorenvList,
deleteActorenv,
getOperatorList,
getActorenvDetail,
getActorEnvOptions,
getWorkflowspecList,
saveOperator,
deleteWorkflowspec,
getWorkflowspecDetail,
getOperatorDetail
};
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 69备份 2</title>
<defs>
<path d="M14.2058659,3.5763545 L8.20586587,0.376450501 C7.76469814,0.141168108 7.23530186,0.141168108 6.79413413,0.376450501 L0.794134134,3.5763545 C0.305329737,3.83704236 1.54202278e-16,4.34591807 0,4.89989271 L0,11.0999285 C-8.68266642e-16,11.6538919 0.305317533,12.1627593 0.794106656,12.423452 L6.79410666,15.623516 C7.23528896,15.858818 7.76471104,15.858818 8.20589334,15.623516 L14.2058933,12.423452 C14.6946825,12.1627593 15,11.6538919 15,11.0999285 L15,4.89989271 C15,4.34591807 14.6946703,3.83704236 14.2058659,3.5763545 Z" id="path-1"></path>
</defs>
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-69备份-2">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-66" transform="translate(0.500000, 0.000000)">
<g id="矩形">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<path stroke="#8A9099" stroke-width="1.5" d="M7.14706707,1.0382196 C7.36765093,0.920578407 7.63234907,0.920578407 7.85293293,1.0382196 L7.85293293,1.0382196 L13.8529329,4.2381236 L14.25,11.0999285 L7.85294667,14.9617542 C7.63235552,15.0794052 7.36764448,15.0794052 7.14705333,14.9617542 L7.14705333,14.9617542 L1.14705333,11.7616902 L0.75,4.89989271 Z"></path>
<path d="M7.5,11.25 C9.78208033,11.25 11.543715,11.9030473 12.75,13.2731396 L12.75,13.2731396 L12.75,18.6744339 L2.25,18.6744339 L2.25,13.2731396 C3.45628505,11.9030473 5.21791967,11.25 7.5,11.25 Z" stroke="#8A9099" stroke-width="1.5" mask="url(#mask-2)"></path>
</g>
<circle id="椭圆形" stroke="#8A9099" stroke-width="1.5" cx="7.5" cy="6.8" r="2.25"></circle>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 69备份</title>
<defs>
<path d="M14.2058659,3.5763545 L8.20586587,0.376450501 C7.76469814,0.141168108 7.23530186,0.141168108 6.79413413,0.376450501 L0.794134134,3.5763545 C0.305329737,3.83704236 1.54202278e-16,4.34591807 0,4.89989271 L0,11.0999285 C-8.68266642e-16,11.6538919 0.305317533,12.1627593 0.794106656,12.423452 L6.79410666,15.623516 C7.23528896,15.858818 7.76471104,15.858818 8.20589334,15.623516 L14.2058933,12.423452 C14.6946825,12.1627593 15,11.6538919 15,11.0999285 L15,4.89989271 C15,4.34591807 14.6946703,3.83704236 14.2058659,3.5763545 Z" id="path-1"></path>
</defs>
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-69备份">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-66" transform="translate(0.500000, 0.000000)">
<g id="矩形">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<path stroke="#1370FF" stroke-width="1.5" d="M7.14706707,1.0382196 C7.36765093,0.920578407 7.63234907,0.920578407 7.85293293,1.0382196 L7.85293293,1.0382196 L13.8529329,4.2381236 L14.25,11.0999285 L7.85294667,14.9617542 C7.63235552,15.0794052 7.36764448,15.0794052 7.14705333,14.9617542 L7.14705333,14.9617542 L1.14705333,11.7616902 L0.75,4.89989271 Z"></path>
<path d="M7.5,11.25 C9.78208033,11.25 11.543715,11.9030473 12.75,13.2731396 L12.75,13.2731396 L12.75,18.6744339 L2.25,18.6744339 L2.25,13.2731396 C3.45628505,11.9030473 5.21791967,11.25 7.5,11.25 Z" stroke="#1370FF" stroke-width="1.5" mask="url(#mask-2)"></path>
</g>
<circle id="椭圆形" stroke="#1370FF" stroke-width="1.5" cx="7.5" cy="6.8" r="2.25"></circle>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 89备份</title>
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="个人资源-工作流算子" transform="translate(-982.000000, -323.000000)">
<g id="编组-6备份" transform="translate(641.000000, 298.000000)">
<g id="编组-89备份" transform="translate(349.000000, 33.000000) rotate(-270.000000) translate(-349.000000, -33.000000) translate(341.000000, 25.000000)">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<g id="编组-88" transform="translate(2.250000, 6.750000)" fill="#8A9099">
<circle id="椭圆形" cx="1.25" cy="1.25" r="1.25"></circle>
<circle id="椭圆形备份-15" cx="5.75" cy="1.25" r="1.25"></circle>
<circle id="椭圆形备份-16" cx="10.25" cy="1.25" r="1.25"></circle>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<svg width="240px" height="249px" viewBox="0 0 240 249" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>矩形备份 26</title>
<defs>
<rect id="path-1" x="0" y="0" width="240" height="249" rx="8"></rect>
<filter x="-14.5%" y="-17.6%" width="129.1%" height="135.2%" filterUnits="objectBoundingBox" id="filter-3">
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="3" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0.803607664 0 0 0 0 0.598314046 0 0 0 0 0.12907149 0 0 0 1 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
<feMerge>
<feMergeNode in="shadowMatrixOuter1"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
<rect id="path-4" x="0" y="0" width="110" height="91" rx="5.5"></rect>
</defs>
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="矩形备份-26">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="蒙版" fill="#FFFFFF" xlink:href="#path-1"></use>
<rect id="矩形备份-6" fill="#FFB919" mask="url(#mask-2)" x="0" y="0" width="240" height="165"></rect>
<g id="编组-8备份-3" mask="url(#mask-2)">
<g transform="translate(65.000000, 37.000000)" id="编组-19">
<g id="矩形" filter="url(#filter-3)">
<mask id="mask-5" fill="white">
<use xlink:href="#path-4"></use>
</mask>
<use id="蒙版" fill="#FFFFFF" xlink:href="#path-4"></use>
<rect fill="#136EFA" mask="url(#mask-5)" x="0" y="0" width="2.5" height="91.4251263"></rect>
<rect fill="#C2C6CC" mask="url(#mask-5)" x="15" y="8.76679293" width="25" height="5.00959596"></rect>
</g>
<g id="编组-7" transform="translate(15.250000, 26.070581)">
<path d="M11.25,5.51515152 L7.125,5.51515152 C5.60621694,5.51515152 4.375,6.74636845 4.375,8.26515152 L4.375,46.8863636 C4.375,48.4051467 5.60621694,49.6363636 7.125,49.6363636 L11.25,49.6363636 L11.25,49.6363636" id="路径-4" stroke="#979797" stroke-width="1.375"></path>
<rect id="矩形备份-10" fill="#F0F2F5" x="0" y="0" width="45" height="11.030303" rx="2.75"></rect>
<rect id="矩形备份-11" fill="#F0F2F5" x="0" y="22.0606061" width="24.75" height="11.030303" rx="2.75"></rect>
<rect id="矩形备份-15" fill="#F0F2F5" x="39.875" y="33.332197" width="24.75" height="11.030303" rx="2.75"></rect>
<rect id="矩形备份-12" fill="#F0F2F5" x="0" y="44.1212121" width="24.75" height="11.030303" rx="2.75"></rect>
<rect id="矩形备份-4" fill="#C2C6CC" x="2.25" y="3.20453283" width="32.5" height="3.75719697"></rect>
<rect id="矩形备份-5" fill="#C2C6CC" x="2.25" y="25.7477146" width="13.75" height="3.75719697"></rect>
<rect id="矩形备份-8" fill="#C2C6CC" x="2.25" y="48.2908965" width="13.75" height="3.75719697"></rect>
<rect id="矩形备份-9" fill="#C2C6CC" x="42.25" y="37.0193056" width="13.75" height="3.75719697"></rect>
<ellipse id="椭圆形备份-3" fill="#0DD09B" cx="39" cy="5.00959596" rx="1.25" ry="1.25239899"></ellipse>
<ellipse id="椭圆形备份-4" fill="#0DD09B" cx="20.25" cy="27.5527778" rx="1.25" ry="1.25239899"></ellipse>
<ellipse id="椭圆形备份-5" fill="#0DD09B" cx="20.25" cy="50.0959596" rx="1.25" ry="1.25239899"></ellipse>
<ellipse id="椭圆形备份-6" fill="#0DD09B" cx="60.25" cy="38.8243687" rx="1.25" ry="1.25239899"></ellipse>
<line x1="4.125" y1="38.7726641" x2="39.875" y2="38.8473485" id="路径-6" stroke="#979797" stroke-width="1.375"></line>
</g>
</g>
</g>
<text id="构建批式算子" mask="url(#mask-2)" font-family="PingFangSC-Medium, PingFang SC" font-size="16" font-weight="400" line-spacing="24" fill="#1E2633">
<tspan x="72" y="198.000567">构建批式算子</tspan>
</text>
<text id="仅支持shell脚本" mask="url(#mask-2)" font-family="PingFangSC-Regular, PingFang SC" font-size="12" font-weight="normal" line-spacing="20" fill="#8A9099">
<tspan x="77.484" y="222">仅支持shell脚本</tspan>
</text>
</g>
</g>
</svg>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<svg width="240px" height="249px" viewBox="0 0 240 249" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 40备份 8</title>
<defs>
<rect id="path-1" x="0" y="0" width="240" height="249" rx="8"></rect>
<rect id="path-3" x="0" y="0" width="96.2033898" height="23.9201798" rx="4.80638562"></rect>
<filter x="-8.8%" y="-27.2%" width="117.7%" height="171.1%" filterUnits="objectBoundingBox" id="filter-5">
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0.114151225 0 0 0 0 0.59037626 0 0 0 0 0.477660275 0 0 0 1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
<rect id="path-6" x="0" y="0" width="96.2033898" height="23.9201798" rx="4.80638562"></rect>
<filter x="-8.8%" y="-27.2%" width="117.7%" height="171.1%" filterUnits="objectBoundingBox" id="filter-8">
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0.114151225 0 0 0 0 0.59037626 0 0 0 0 0.477660275 0 0 0 1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
<rect id="path-9" x="0" y="0" width="96.2033898" height="23.9201798" rx="4.80638562"></rect>
<filter x="-8.8%" y="-27.2%" width="117.7%" height="171.1%" filterUnits="objectBoundingBox" id="filter-11">
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0.114151225 0 0 0 0 0.59037626 0 0 0 0 0.477660275 0 0 0 1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
</defs>
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-40备份-8">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="蒙版" fill="#FFFFFF" xlink:href="#path-1"></use>
<rect id="矩形" fill="#02AB83" mask="url(#mask-2)" x="0" y="0" width="240" height="165"></rect>
<g id="编组-2" mask="url(#mask-2)">
<g transform="translate(56.000000, 40.000000)">
<g id="矩形">
<mask id="mask-4" fill="white">
<use xlink:href="#path-3"></use>
</mask>
<g id="蒙版">
<use fill="black" fill-opacity="1" filter="url(#filter-5)" xlink:href="#path-3"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-3"></use>
</g>
<rect fill="#136EFA" mask="url(#mask-4)" x="0" y="0" width="2.18644068" height="24.0319281"></rect>
<rect fill="#C2C6CC" mask="url(#mask-4)" x="13.1186441" y="7.64652257" width="50.2881356" height="8.73888294"></rect>
<ellipse id="椭圆形备份-3" fill="#0DD09B" mask="url(#mask-4)" cx="77.6186441" cy="12.015964" rx="3.27966102" ry="3.2770811"></ellipse>
</g>
<g id="矩形" transform="translate(32.796610, 30.586090)">
<mask id="mask-7" fill="white">
<use xlink:href="#path-6"></use>
</mask>
<g id="蒙版">
<use fill="black" fill-opacity="1" filter="url(#filter-8)" xlink:href="#path-6"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-6"></use>
</g>
<rect fill="#136EFA" mask="url(#mask-7)" x="0" y="0" width="2.18644068" height="24.0319281"></rect>
<rect fill="#C2C6CC" mask="url(#mask-7)" x="13.1186441" y="7.64652257" width="50.2881356" height="8.73888294"></rect>
<ellipse id="椭圆形备份-3" fill="#0DD09B" mask="url(#mask-7)" cx="77.6186441" cy="12.015964" rx="3.27966102" ry="3.2770811"></ellipse>
</g>
<g id="矩形" transform="translate(4.372881, 60.079820)">
<mask id="mask-10" fill="white">
<use xlink:href="#path-9"></use>
</mask>
<g id="蒙版">
<use fill="black" fill-opacity="1" filter="url(#filter-11)" xlink:href="#path-9"></use>
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-9"></use>
</g>
<rect fill="#136EFA" mask="url(#mask-10)" x="0" y="0" width="2.18644068" height="24.0319281"></rect>
<rect fill="#C2C6CC" mask="url(#mask-10)" x="13.1186441" y="7.64652257" width="50.2881356" height="8.73888294"></rect>
<ellipse id="椭圆形备份-3" fill="#0DD09B" mask="url(#mask-10)" cx="77.6186441" cy="12.015964" rx="3.27966102" ry="3.2770811"></ellipse>
</g>
</g>
</g>
<text id="构建流式算子" mask="url(#mask-2)" font-family="PingFangSC-Medium, PingFang SC" font-size="16" font-weight="400" line-spacing="24" fill="#1E2633">
<tspan x="72" y="198">构建流式算子</tspan>
</text>
<text id="仅支持Python脚本" mask="url(#mask-2)" font-family="PingFangSC-Regular, PingFang SC" font-size="12" font-weight="normal" line-spacing="20" fill="#8A9099">
<tspan x="70.836" y="222">仅支持Python脚本</tspan>
</text>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 84</title>
<g id="上线UI" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="个人资源-工作流模版" transform="translate(-661.000000, -574.000000)">
<g id="编组-4" transform="translate(641.000000, 526.000000)">
<g id="编组-84" transform="translate(20.000000, 48.000000)">
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
<g id="编组-83" transform="translate(3.500000, 2.000000)">
<polyline id="路径" stroke="#1370FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" points="17 8.19811748 17 4.99985 8.5 0 0 4.99985 0 14.9999 2.37372196 16.396235"></polyline>
<circle id="椭圆形" fill="#1370FF" cx="3" cy="17" r="2"></circle>
<circle id="椭圆形备份-13" fill="#1370FF" cx="17" cy="12" r="2"></circle>
<polyline id="路径-72" stroke="#1370FF" stroke-width="1.5" points="0.283430346 5.19688053 8.5 9.92482816 8.5 19.6575672"></polyline>
<line x1="8.5" y1="9.92482816" x2="17" y2="4.99985" id="路径-73" stroke="#1370FF" stroke-width="1.5"></line>
<polyline id="路径" stroke="#1370FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" points="6.25871064 18.7359651 8.5 20 17 14.9999 17 12.5168189"></polyline>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 6备份 5</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#136EEF" offset="0%"></stop>
<stop stop-color="#084FC2" offset="100%"></stop>
</linearGradient>
</defs>
<g id="新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="个人资源-新建应用环境备份-6" transform="translate(-642.000000, -2505.000000)">
<g id="编组-20" transform="translate(106.000000, 996.000000)">
<g id="编组-10备份" transform="translate(392.000000, 1479.000000)">
<g id="编组-18" transform="translate(97.000000, 30.000000)">
<g id="编组-6备份-5" transform="translate(47.000000, 0.000000)">
<rect id="矩形" x="0" y="0" width="32" height="32"></rect>
<g id="编组-12备份-1" transform="translate(4.000000, 1.000000)" fill-rule="nonzero">
<path d="M2.52631579,0 L21.4736842,0 C22.8689053,0 24,1.1192875 24,2.5 L24,22.5 L17.6842105,30 L2.52631579,30 C1.13106947,30 0,28.8806875 0,27.5 L0,2.5 C0,1.1192875 1.13106947,0 2.52631579,0 Z" id="矩形备份-11" fill="url(#linearGradient-1)"></path>
<path d="M13.5789474,15 L13.5789474,18.5 C13.5788842,18.7321875 13.4965263,18.95475 13.35,19.1186875 C13.2034105,19.282875 13.0047789,19.375 12.7976842,19.375 L11.2023158,19.375 C10.9952842,19.375 10.7966526,19.2829375 10.65,19.118875 C10.5034105,18.954875 10.4210526,18.732125 10.4210526,18.4998125 L10.4210526,15 L13.5789474,15 Z M12.9473684,16.875 L11.0526316,16.875 L11.0526316,18.75 L12.9473684,18.75 L12.9473684,16.875 Z M13.5789474,11.25 L13.5789474,13.125 L11.6842105,13.125 L11.6842105,11.25 L13.5789474,11.25 Z M12.0032842,0 L12.0032842,1.7237625 L13.5789474,1.7237625 L13.5789474,3.447525 L12.0031579,3.447525 L12.0031579,5.043575 L13.5789474,5.043575 L13.5789474,6.7673125 L12.0032842,6.7673125 L12.0032842,8.4699375 L13.5789474,8.4699375 L13.5789474,10.1725625 L12.0032842,10.1725625 L12.0032842,11.875 L10.4210526,11.875 L10.4210526,10.172375 L11.9967158,10.172375 L11.9967158,8.4698125 L10.4210526,8.4698125 L10.4210526,6.7673125 L11.9967158,6.7673125 L11.9967158,5.043575 L10.4210526,5.043575 L10.4210526,3.3198125 L11.9967158,3.3198125 L11.9967158,1.7237625 L10.4210526,1.7237625 L10.4210526,0 L12.0032842,0 Z" id="形状" fill="#FFFFFF"></path>
<polygon id="矩形备份-13" fill="#FFFFFF" opacity="0.5" points="17.6842105 22.5 24 22.5 20.8421053 26.25 17.6842105 30"></polygon>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
...@@ -20,23 +20,25 @@ const NoProject = observer((props: any) => { ...@@ -20,23 +20,25 @@ const NoProject = observer((props: any) => {
// 新建弹窗显示控制 // 新建弹窗显示控制
const [addOpen, setAddOpen] = useState(false); const [addOpen, setAddOpen] = useState(false);
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
let projectList = toJS(currentProjectStore.projectList) let projectList = toJS(currentProjectStore.projectList);
return ( return (
<div className={style.noProject}> <div className={style.noProject}>
<img src={noData} alt="" className={style.noDataImg} /> <img src={noData} alt="" className={style.noDataImg} />
<div className={style.text1}>{projectList.length > 0 ? "当前未选中任何项目" : "当前产品暂无项目"}</div> <div className={style.text1}>
<div className={style.text2}>{projectList.length > 0 ? "或创建新项目" : "请先创建项目"}</div> {projectList.length > 0 ? "当前未选中任何项目" : "当前产品暂无项目"}
</div>
<div className={style.text2}>
{projectList.length > 0 ? "或创建新项目" : "请先创建项目"}
</div>
<MyButton <MyButton
text='创建项目' text="创建项目"
variant="contained" variant="contained"
size="large" size="large"
startIcon={<AddIcon />} startIcon={<AddIcon />}
onClick={() => setAddOpen(true)} onClick={() => setAddOpen(true)}
style={{ backgroundColor: "#1370ff", color: "#fff" }} style={{ backgroundColor: "#1370ff", color: "#fff" }}
/> />
{addOpen && <AddProject addOpen={addOpen} setAddOpen={setAddOpen} />}
<AddProject addOpen={addOpen} setAddOpen={setAddOpen} />
</div> </div>
); );
}); });
......
import MySelect from "@/components/mui/MySelect";
import MyDialog from "@/components/mui/MyDialog";
import { toJS } from "mobx";
import { useStores } from "@/store";
import { useEffect } from "react";
interface IProductSelectProps {
open: boolean;
setOpen: any;
productId: string;
setProductId: any;
okText?: string;
onConfirm?: any;
title?: any;
}
const ProductSelect = (props: IProductSelectProps) => {
const {
open,
productId,
setProductId,
okText = "下一步",
setOpen,
onConfirm,
title,
} = props;
const { productListStore } = useStores();
useEffect(() => {
if (!productId) {
setProductId(toJS(productListStore.productList)[0].value);
}
}, [productId, productListStore.productList, setProductId]);
const handleChange = (e: any) => {
console.log(e);
setProductId(e);
};
const handleConfirm = () => {
setOpen(false);
onConfirm && onConfirm();
};
return (
<MyDialog
open={open}
title={title || "选择产品"}
okText={okText}
onClose={() => setOpen(false)}
onConfirm={() => handleConfirm()}
>
<MySelect
value={productId}
onChange={(e) => handleChange(e)}
options={[...productListStore?.productList] || []}
fullWidth
></MySelect>
</MyDialog>
);
};
export default ProductSelect;
.queueSelectContentBox {
width: 852px;
}
.table {
height: calc(80vh - 180px);
margin-top: 20px;
}
.cpuType {
display: flex;
justify-content: space-between;
align-items: center;
}
.cpuIcon {
display: block;
width: 36px;
height: 36px;
border-radius: 6px;
margin-right: 12px;
}
.cpuInfo {
overflow: hidden;
flex: 1;
}
.cpuName {
font-size: 14px;
line-height: 22px;
color: rgba(30, 38, 51, 1);
white-space: nowrap;
font-weight: 600;
}
.cpuDetailsName {
font-size: 12px;
line-height: 20px;
color: rgba(138, 144, 153, 1);
white-space: nowrap;
}
.cpuMemory {
cursor: pointer;
}
.totalBox {
font-size: 14px;
line-height: 22px;
color: rgba(138, 144, 153, 1);
display: flex;
align-items: center;
}
.total {
font-size: 24px;
line-height: 32px;
color: rgba(255, 78, 78, 1);
font-weight: 600;
}
import MyInput from "@/components/mui/MyInput";
import MyDialog from "@/components/mui/MyDialog";
import RadioGroupOfButtonStyle from "@/components/CommonComponents/RadioGroupOfButtonStyle";
import style from "./index.module.css";
import MyTable from "@/components/mui/MyTableNew";
import MyMenu from "@/components/mui/MyMenu";
import cloneDeep from "lodash/cloneDeep";
import { useMessage } from "@/components/MySnackbar";
import { useEffect, useMemo, useState } from "react";
export type IQueueLi = {
name: string;
picUrl: string;
cpuName: string;
gpuName: string;
gpuNum: number; // 卡数
coreNum: number;
memory: number;
total: number;
partition: string;
enabled: boolean;
};
type IQueueSelectProps = {
value: string;
onChange: any;
originalCpuList: Array<IQueueLi>;
originalGpuList: Array<IQueueLi>;
error?: boolean;
helperText?: string;
disabled?: boolean;
cpuLoading?: boolean;
gpuLoading?: boolean;
};
type IMemoryLi = {
memory: number;
total: number;
partition: string;
};
export type IShowCPULi = {
name: string;
picUrl: string;
cpuName: string;
coreNum: number;
partition: string;
enabled: boolean;
memoryList: Array<IMemoryLi>;
};
const queueTypes = [
{
label: "CPU",
value: "CPU",
},
{
label: "GPU",
value: "GPU",
},
];
const QueueSelect = (props: IQueueSelectProps) => {
const {
value,
onChange,
originalCpuList,
originalGpuList,
error,
helperText,
disabled,
cpuLoading = false,
gpuLoading = false,
} = props;
// 队列列表由外面传入的设计是考虑到一个表单可能有多次队列选择, 请求队列接口在表单页面完成可以减少请求
const Message = useMessage();
const [activePartition, setActivePartition] = useState("");
const [open, setOpen] = useState(false);
const [queueType, setQueueType] = useState("CPU");
const [showCpuList, setShowCpuList] = useState<Array<IShowCPULi>>([]);
const handleOpen = () => {
setOpen(true);
};
// 队列partition和前端展示的队列信息的映射关系
const idInfoMap = useMemo(() => {
return [
...originalCpuList.map((item) => ({
partition: item.partition,
title: `${item.name}/${item.coreNum}${item.coreNum * item.memory}G/${
item.coreNum
}总核心数`,
total: item.total,
})),
...originalGpuList.map((item) => ({
partition: item.partition,
title: `${item.name}/${item.gpuNum}${item.coreNum}${item.memory}G/${item.gpuNum}总卡数`,
total: item.total,
})),
];
}, [originalCpuList, originalGpuList]);
const cpuHeadCells = [
{
id: "type",
label: "类型",
width: 510,
},
{
id: "coreNumRender",
label: "节点核数",
width: 180,
},
{
id: "memoryRender",
label: "设置内存配比",
width: 150,
},
];
const gpuHeadCells = [
{
id: "type",
label: "类型",
width: 510,
},
{
id: "gpuNumRender",
label: "节点卡数",
width: 100,
},
{
id: "coreNumRender",
label: "节点核数",
width: 100,
},
{
id: "gpuMemoryRender",
label: "节点内存容量",
width: 100,
},
];
// 有初始值的话显示初始值
useEffect(() => {
let resultList: Array<IShowCPULi> = [];
originalCpuList.forEach((item) => {
const targetIndex = resultList.findIndex((resultLi) => {
return resultLi.name === item.name;
});
if (targetIndex === -1) {
resultList.push({
name: item.name,
picUrl: item.picUrl,
cpuName: item.cpuName,
coreNum: item.coreNum,
partition: item.partition,
enabled: item.enabled,
memoryList: [
{
memory: item.memory,
total: item.total,
partition: item.partition,
},
],
});
} else {
resultList[targetIndex].memoryList.push({
memory: item.memory,
total: item.total,
partition: item.partition,
});
}
});
if (open && value) {
const cpuActivePartitionIndex = originalCpuList.findIndex(
(li) => li.partition === value
);
let cpuActivePartitionName = "";
if (cpuActivePartitionIndex !== -1) {
cpuActivePartitionName = originalCpuList[cpuActivePartitionIndex].name;
}
if (cpuActivePartitionIndex !== -1) {
resultList.forEach((li, index) => {
if (li.name === cpuActivePartitionName) {
resultList[index].partition = value;
}
});
}
setActivePartition(value);
}
setShowCpuList(resultList);
// eslint-disable-next-line
}, [open, value, originalCpuList]);
const renderType = (item: IShowCPULi) => {
return (
<div className={style.cpuType}>
<img className={style.cpuIcon} src={item.picUrl} alt="" />
<div className={style.cpuInfo}>
<div className={style.cpuName}>{item.name}</div>
<div className={style.cpuDetailsName}>{item.cpuName}</div>
</div>
</div>
);
};
const renderCoreNum = (item: IShowCPULi) => {
return item.coreNum + "核";
};
const renderGpuNum = (item: IQueueLi) => {
return item.gpuNum + "卡";
};
const renderGpuMemory = (item: IQueueLi) => {
return item.memory + "GB";
};
const setMemory = (partition: string) => {
const copyShowCpuList: Array<IShowCPULi> = cloneDeep(showCpuList);
const selectIndex = copyShowCpuList.findIndex((item) => {
return item.partition === activePartition;
});
if (selectIndex !== -1) {
copyShowCpuList[selectIndex].partition = partition;
}
// 防止被 handleRow 中的 setActiveId覆盖
setTimeout(() => {
setActivePartition(partition);
}, 10);
setShowCpuList(copyShowCpuList);
};
const renderMemory = (item: IShowCPULi) => {
return (
<MyMenu
value={item.partition}
options={item.memoryList.map((memoryLi) => ({
label: `${memoryLi.memory}GB/核`,
value: memoryLi.partition,
}))}
hasTriangle={true}
setValue={setMemory}
sx={{
zIndex: 1601,
}}
>
<span className={style.cpuMemory}>
{
item.memoryList.filter(
(memoryLi) => memoryLi.partition === item.partition
)[0].memory
}
GB/核
</span>
</MyMenu>
);
};
const handleRow = (e: any) => {
setActivePartition(e.partition);
};
const handleConfirm = () => {
if (activePartition) {
onChange && onChange(activePartition);
setOpen(false);
} else {
Message.error("请先选择一个硬件队列。");
}
};
const getTotal = () => {
let total = 0;
idInfoMap.forEach((item) => {
if (item.partition === activePartition) {
total = item.total;
}
});
return total;
};
const getTitle = () => {
let title = "";
idInfoMap.forEach((item) => {
if (item.partition === value) {
title = item.title;
}
});
return title;
};
return (
<>
<MyInput
placeholder="请选择硬件队列"
value={getTitle()}
onClick={() => handleOpen()}
error={error}
helperText={helperText}
disabled={disabled}
></MyInput>
{open && (
<MyDialog
open={open}
title="选择硬件队列"
onClose={() => setOpen(false)}
onConfirm={() => handleConfirm()}
leftSideOfButtonContent={
<div className={style.totalBox}>
费用(每小时):
<span className={style.total}>
{activePartition ? getTotal() : "-"}
</span>
</div>
}
sx={{
zIndex: 1600,
// 让提示文案在弹窗下
"& .MuiDialog-container": {
"& .MuiPaper-root": {
// 设置最大宽度, 实际宽度让子元素撑大
maxWidth: "1920px",
borderRadius: "8px",
},
},
}}
>
<div className={style.queueSelectContentBox}>
<RadioGroupOfButtonStyle
value={queueType}
radioOptions={queueTypes}
handleRadio={(e: string) => setQueueType(e)}
RadiosBoxStyle={{ width: "140px" }}
></RadioGroupOfButtonStyle>
<div className={style.table}>
{queueType === "CPU" && (
<MyTable
rows={showCpuList.map((item) => ({
...item,
type: renderType(item),
coreNumRender: renderCoreNum(item),
memoryRender: renderMemory(item),
}))}
headCells={cpuHeadCells}
fixedHead={true}
handleRow={(e: any) => handleRow(e)}
activeId={activePartition}
tableKey="partition"
loading={cpuLoading}
disableFn={(row: any) => !row.enabled}
></MyTable>
)}
{queueType === "GPU" && (
<MyTable
rows={originalGpuList.map((item: any) => ({
...item,
type: renderType(item),
gpuNumRender: renderGpuNum(item),
coreNumRender: renderCoreNum(item),
gpuMemoryRender: renderGpuMemory(item),
}))}
headCells={gpuHeadCells}
fixedHead={true}
handleRow={(e: any) => handleRow(e)}
activeId={activePartition}
tableKey="partition"
loading={gpuLoading}
disableFn={(row: any) => !row.enabled}
></MyTable>
)}
</div>
</div>
</MyDialog>
)}
</>
);
};
export default QueueSelect;
.tableBox {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
}
.itemBox {
/* flex: 1; */
}
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import style from "./index.module.css";
interface ICardTableProps {
data: Array<any>; // 列表数据
renderItem: any; // 单个卡片的渲染函数
itemMinWidth?: number; // 单个卡片的最小宽度,有这个参数时numberOfColumns参数失效,效果为根据屏幕大小和单个卡片的最小宽度来适配每行渲染个数
tableKey?: string; // 表格数据的key
numberOfColumns?: number; // 列数 每行渲染几个
horizontalSpacing?: number; // 水平方向的间隔
verticalSpacing?: number; // 垂直方向的间隔
renderBefore?: any;
}
const CardTable = (props: ICardTableProps) => {
const {
data,
renderItem,
tableKey = "id",
numberOfColumns: propsNumberOfColumns = 3,
horizontalSpacing = 20,
verticalSpacing = 20,
itemMinWidth,
renderBefore,
} = props;
const [numberOfColumns, setNumberOfColumns] = useState(3);
const tableBoxRef: any = useRef(null);
const getNumberOfColumns = useCallback(() => {
if (itemMinWidth) {
const boxWidth = tableBoxRef?.current?.offsetWidth;
if (boxWidth) {
setNumberOfColumns(Math.floor(boxWidth / itemMinWidth));
} else {
setNumberOfColumns(propsNumberOfColumns);
}
} else {
setNumberOfColumns(propsNumberOfColumns);
}
}, [itemMinWidth, propsNumberOfColumns]);
useEffect(() => {
getNumberOfColumns();
}, [getNumberOfColumns]);
const boxWidth = useMemo(() => {
return `${100 / numberOfColumns}%`;
}, [numberOfColumns]);
window.onresize = () => {
getNumberOfColumns();
};
return (
<div
className={style.tableBox}
style={{
marginLeft: `-${horizontalSpacing / 2}px`,
marginRight: `-${horizontalSpacing / 2}px`,
}}
ref={tableBoxRef}
>
{renderBefore && renderBefore() && (
<div
className={style.itemBox}
style={{
width: boxWidth,
paddingLeft: `${horizontalSpacing / 2}px`,
paddingRight: `${horizontalSpacing / 2}px`,
paddingBottom: `${verticalSpacing}px`,
boxSizing: "border-box",
}}
>
{renderBefore()}
</div>
)}
{data.map((item, index) => {
return (
<div
className={style.itemBox}
key={item[tableKey] ? item[tableKey] : index}
style={{
width: boxWidth,
paddingLeft: `${horizontalSpacing / 2}px`,
paddingRight: `${horizontalSpacing / 2}px`,
paddingBottom: `${verticalSpacing}px`,
boxSizing: "border-box",
}}
>
{renderItem(item, index)}
</div>
);
})}
</div>
);
};
export default CardTable;
/*
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-20 19:45:32
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-26 17:27:12
* @FilePath: /bkunyun/src/components/CommonComponents/Code/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import CodeMirror, { ReactCodeMirrorProps } from "@uiw/react-codemirror";
import { memo } from "react";
import { isEqual } from "lodash";
// import { javascript } from "@codemirror/lang-javascript";
interface ICodeType extends ReactCodeMirrorProps {
height?: string;
width?: string;
maxWidth?: string;
theme?: "light" | "dark";
}
const Code = (props: ICodeType) => {
const { height, theme = "dark", width, maxWidth } = props;
return (
<CodeMirror
{...props}
height={height || "100%"}
width={width || "100%"}
maxWidth={maxWidth || "100%"}
theme={theme}
/>
);
};
// const handleEqual = (prvProps: ICodeType, nextProps: ICodeType) => {
// if (isEqual(prvProps, nextProps)) {
// return true;
// }
// return true;
// };
export default Code;
import { List } from "react-virtualized";
interface IVirtuallyListProps {
list: Array<any>;
renderRow: any;
}
const VirtuallyList = (props: IVirtuallyListProps) => {
const { list, renderRow } = props;
return (
<List
width={300}
height={300}
rowCount={list.length}
rowHeight={20}
rowRenderer={renderRow}
overscanRowCount={20}
/>
);
};
export default VirtuallyList;
.VTHeader {
font-size: 12px;
color: rgba(138, 144, 153, 1);
padding: 12px 16px;
white-space: nowrap;
font-weight: 400;
box-sizing: border-box;
display: flex;
align-items: center;
}
.VTHeaderRow {
background-color: rgba(247, 248, 250, 1);
box-sizing: border-box;
border-radius: 4px 4px 0 0;
border-bottom: 1px solid rgba(240, 242, 245, 1);
}
.VTRow {
background-color: #fff;
box-sizing: border-box;
border-bottom: 1px solid rgba(240, 242, 245, 1);
&:hover {
background-color: rgba(245, 246, 247, 1);
}
}
.VTActiveRow {
@extend .VTRow;
background-color: rgba(237, 244, 255, 1);
}
.VTRowColumn {
text-align: left;
box-sizing: border-box;
font-size: 14px;
line-height: 22px;
color: rgba(30, 38, 51, 1);
padding: 16px;
}
import React from "react";
import { useCallback, useEffect, useState, useRef } from "react";
import { Column, Table } from "react-virtualized";
import style from "./index.module.scss";
import "react-virtualized/styles.css"; // only needs to be imported once
import Checkbox from "@mui/material/Checkbox";
import MyCircularProgress from "@/components/mui/MyCircularProgress";
import { createTheme, ThemeProvider } from "@mui/material";
import NoData from "@/components/BusinessComponents/NoData";
import ascIcon from "@/assets/project/ascIcon.svg";
import descIcon from "@/assets/project/descIcon.svg";
import sortIcon from "@/assets/project/sort.svg";
type Order = "ASC" | "DESC"; // 升序为asc,降序为desc。
export type sortState = {
field: string | null | undefined | ""; // 根据哪个属性来排序
order: Order | null | undefined | "";
};
interface IVirtuallyTableProps {
rows: Array<any>; // 表格数据
headCells: Array<any>; // 表头配置
tableKey?: string; // 表格数据的key
loading?: boolean; // 是否正在加载数据
hasCheckbox?: boolean; // 是否有复选框
selectItems?: Array<any>; // 选中的项
setSelectItems?: any; // 设置选中的项
noDataText?: string; // 无数据提示文案
sortState?: sortState; // 排序状态
setSortState?: any; // 设置排序状态
nodataText?: any; // 无数据文案
handleRow?: any; // 点击一行
activeId?: string; // 选中的一行的id
disableFn?: any; // 禁用时根据disableFn来判断是否禁用
headerHeight?: number; // 表头高度
}
const theme = createTheme({
components: {
// 复选框样式
MuiSvgIcon: {
styleOverrides: {
root: {
color: "rgba(209, 214, 222, 1)",
fontSize: "18px",
},
},
},
MuiCheckbox: {
styleOverrides: {
root: {
color: "rgba(209, 214, 222, 1)",
"&.MuiCheckbox-indeterminate .MuiSvgIcon-root": {
color: "rgba(19, 112, 255, 1)",
},
"&.Mui-checked .MuiSvgIcon-root": {
color: "rgba(19, 112, 255, 1)",
},
},
},
},
MuiButtonBase: {
styleOverrides: {
root: {
"&.MuiCheckbox-root": {
padding: 0,
},
},
},
},
},
});
const VirtuallyTable = (props: IVirtuallyTableProps) => {
const {
rows,
headCells,
tableKey = "id",
loading = false,
hasCheckbox = false,
selectItems = [],
setSelectItems,
sortState,
setSortState,
nodataText,
handleRow,
activeId,
disableFn,
headerHeight = 59,
} = props;
const virtuallyTableBoxRef: any = useRef(null);
const virtuallyTableRef: any = useRef(null);
const [width, setWidth] = useState(0);
const [height, setHeight] = useState(0);
const getTableWidthHeight = () => {
setWidth(virtuallyTableBoxRef?.current?.offsetWidth || 1000);
setHeight(virtuallyTableBoxRef?.current?.offsetHeight || 300);
};
useEffect(() => {
getTableWidthHeight();
}, []);
window.onresize = () => {
getTableWidthHeight();
};
const onSelectAllClick = useCallback(
(e: any) => {
if (e.target.checked) {
setSelectItems && setSelectItems(rows.map((row) => row[tableKey]));
} else {
setSelectItems && setSelectItems([]);
}
},
[setSelectItems, tableKey, rows]
);
const onSelectRowClick = useCallback(
(e: any, itemValue: string) => {
if (e.target.checked) {
setSelectItems && setSelectItems([...selectItems, itemValue]);
} else {
const selectItemIndex = selectItems.indexOf(itemValue);
const newSelectItems = [
...selectItems.slice(0, selectItemIndex),
...selectItems.slice(selectItemIndex + 1, selectItems.length),
];
setSelectItems && setSelectItems(newSelectItems);
}
},
[selectItems, setSelectItems]
);
const handleSort = useCallback(
(field: string) => {
if (sortState?.field === field) {
if (sortState?.order === "ASC") {
setSortState({
field,
order: "DESC",
});
} else if (sortState?.order === "DESC") {
setSortState({
field,
order: "ASC",
});
} else {
setSortState({
field,
order: "DESC",
});
}
} else {
setSortState({
field,
order: "DESC",
});
}
},
[sortState, setSortState]
);
const handleRowFn = useCallback(
(row: any) => {
if (!disableFn) {
handleRow && handleRow(row);
} else {
!disableFn(row) && handleRow && handleRow(row);
}
},
[disableFn, handleRow]
);
return (
<ThemeProvider theme={theme}>
<div
ref={virtuallyTableBoxRef}
style={{ width: "100%", height: "100%", position: "relative" }}
>
<MyCircularProgress loading={loading} />
{width && height && (
<Table
ref={virtuallyTableRef}
width={width}
height={height}
headerHeight={headerHeight}
rowHeight={54}
rowCount={rows.length}
rowGetter={({ index }: any) => rows[index]}
headerClassName={style.VTHeader}
onRowClick={(data: any) => {
handleRowFn(data.rowData);
}}
rowClassName={({ index }: any) => {
if (index < 0) {
return style.VTHeaderRow;
} else {
if (rows[index][tableKey] === activeId) {
return style.VTActiveRow;
} else {
return style.VTRow;
}
}
}}
rowStyle={({ index }: any) => {
if (index !== -1) {
return {
background:
activeId === rows[index][tableKey]
? "rgba(237, 244, 255, 1)"
: "",
cursor: disableFn && disableFn(rows[index]) ? "no-drop" : "",
opacity: disableFn && disableFn(rows[index]) ? "0.3" : "",
};
}
}}
>
{hasCheckbox && (
<Column
dataKey="checkbox"
headerRenderer={() => {
return (
<Checkbox
indeterminate={
selectItems.length > 0 &&
selectItems.length < rows.length
}
checked={
rows.length > 0 && selectItems.length === rows.length
}
onChange={(e) => onSelectAllClick(e)}
/>
);
}}
headerStyle={{ margin: 0 }}
style={{ margin: 0 }}
width={50}
cellRenderer={(data: any) => {
return (
<Checkbox
checked={
selectItems.filter(
(selectItem) => selectItem === data.rowData[tableKey]
).length > 0
}
onChange={(e) =>
onSelectRowClick(e, data.rowData[tableKey])
}
/>
);
}}
className={style.VTRowColumn}
/>
)}
{headCells.map((headCell) => {
return (
<Column
key={headCell.id}
// label={headCell.label}
headerRenderer={(data: any) => {
if (headCell.sort) {
return (
<div>
<span>{headCell.label}</span>
<img
src={
sortState?.field === headCell.id
? sortState?.order === "ASC"
? ascIcon
: sortState?.order === "DESC"
? descIcon
: sortIcon
: sortIcon
}
alt=""
onClick={() => handleSort(headCell.id)}
style={{
marginLeft: "8px",
cursor: "pointer",
position: "relative",
top: "3px",
}}
/>
</div>
);
} else {
return headCell.label;
}
}}
dataKey={headCell.id}
width={headCell.width}
flexGrow={headCell.flexGrow || 0}
cellRenderer={
headCell.cellRenderer
? headCell.cellRenderer
: (data: any) => {
return data.cellData;
}
}
className={style.VTRowColumn}
/>
);
})}
</Table>
)}
{rows.length === 0 && (
<NoData
text={nodataText}
noDataBoxStyle={{
position: "absolute",
bottom: 0,
width: `${width}px`,
height: `${height - headerHeight}px`,
}}
/>
)}
</div>
</ThemeProvider>
);
};
export default VirtuallyTable;
...@@ -7,9 +7,10 @@ import NotFound from "@/views/404"; ...@@ -7,9 +7,10 @@ import NotFound from "@/views/404";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import { useEffect } from "react"; import { useEffect } from "react";
import { menu } from "@/api/routes_api"; import { menu } from "@/api/routes_api";
import { IProductOption } from "@/store/modules/productList";
const useMyRouter = () => { const useMyRouter = () => {
const { permissionStore, menuStore } = useStores(); const { permissionStore, menuStore, productListStore } = useStores();
const userInfo = useMyRequest(current); const userInfo = useMyRequest(current);
const menuInfo = useMyRequest(menu); const menuInfo = useMyRequest(menu);
...@@ -27,7 +28,7 @@ const useMyRouter = () => { ...@@ -27,7 +28,7 @@ const useMyRouter = () => {
); );
permissionStore.restAddRoutes(); permissionStore.restAddRoutes();
if (window.location.host === "localhost:8088") { if (window.location.host === "localhost:8088" || window.location.host === '47.57.4.97') {
menuInfo.res.data.forEach((item: any) => { menuInfo.res.data.forEach((item: any) => {
if (item.id === 'cadd') { if (item.id === 'cadd') {
item.routes.push({ item.routes.push({
...@@ -42,16 +43,42 @@ const useMyRouter = () => { ...@@ -42,16 +43,42 @@ const useMyRouter = () => {
} }
}); });
} }
for (let item of menuInfo.res.data) { for (let item of menuInfo.res.data) {
let routeHead = `/${item.type}` || '/'
let childrenRoutes: any = []
for (let route of item.routes) { for (let route of item.routes) {
route.element = elements[route.element] || NotFound; route.element = elements[route.element] || NotFound;
route.path = `/product/${item.id}${route.path}`; route.path = `${routeHead}/${item.id}${route.path}`
if (Array.isArray(route.children)) {
route.children.forEach((childrenItem: any, index: number) => {
if (childrenItem.path) {
childrenRoutes.push({
...childrenItem,
element: elements[childrenItem.element] || NotFound,
path: `${route.path}${childrenItem.path}`,
show: false
})
}
})
route.children = route.children.filter((childrenItem: any) => !childrenItem.path)
}
} }
permissionStore.setAddRoutes(item.routes); permissionStore.setAddRoutes([...childrenRoutes, ...item.routes]);
} }
menuStore.initMenu(menuInfo.res.data); menuStore.initMenu(menuInfo.res.data);
permissionStore.initAllRoutes(); permissionStore.initAllRoutes();
// /** 所有产品列表 */
const newProductList:IProductOption[] = [];
for (let item of menuInfo.res.data) {
if (item.type === "product") {
newProductList.push({
label: item.name,
value: item.id,
});
}
}
productListStore.setProductList(newProductList)
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
......
.is_require::after {
display: inline-block;
content: "*";
color: #ff4e4e;
margin-right: 4px;
}
.dynamicFormItem_label {
display: block;
font-size: 14px;
font-weight: 600;
color: #1e2633;
}
.dynamicFormItem_col {
position: relative;
margin-bottom: 20px;
}
.dynamicFormItem_col_helpText {
margin-bottom: 46px;
}
.dynamicFormItem_content {
font-size: 14px;
color: #736f7f;
}
.dynamicFormitem_child {
position: relative;
flex: 1;
width: 100%;
text-align: left;
}
.dynamicFormitem_helpText {
position: absolute;
bottom: -36px;
font-size: 12px;
line-height: 1.15;
color: #9894a5;
}
.dynamicFormitem_helpText_warning {
color: #ff4e4e;
}
.dynamicFormitem_errorTips {
position: absolute;
bottom: -20px;
font-size: 12px;
color: #ff4e4e;
}
import React from "react";
import classNames from "classnames";
import styles from "./index.module.css";
import "./label.css";
// import { Control, ValidationRules } from 'react-hook-form/dist/types/form';
export interface IHelpText {
value: string /** 帮助文字内容 */;
className?: string;
type?: "normal" | "warning" /** 默认normal */;
}
export interface IFormItemBoxProps {
/** label 标签的文本 */
label?: string;
/** 标签宽度 */
labelWidth?: number;
/** 标签文本对齐方式 */
labelAlign?: "left" | "center" | "right";
/** 标签文本的className */
labelClassName?: string;
/** 是否必填 */
require?: boolean;
/** */
children: React.ReactNode;
className?: string;
/** 最外层class */
mainClass?: string;
/** 校验信息 */
errorMessage?: string;
errorClassName?: string;
itemFlex?: "row" | "column";
/** 帮助文字提示信息 */
helpText?: IHelpText;
}
const FormItemBox: React.FunctionComponent<IFormItemBoxProps> = (
props: IFormItemBoxProps
) => {
const {
className,
label,
children,
require,
labelWidth,
labelAlign,
errorMessage,
itemFlex,
mainClass,
helpText,
labelClassName,
errorClassName,
} = props;
return (
<div
className={classNames(
styles.dynamicFormItem_div,
mainClass,
helpText && helpText.value && styles.dynamicFormItem_col_helpText
)}
>
<div
className={classNames(
styles.dynamicFormItem_content,
`dynamicFormItem-${itemFlex}`,
className
)}
>
<span
style={{ width: `${labelWidth}px` }}
className={classNames(
styles.dynamicFormItem_label,
{ [styles.is_require]: require },
`align-${itemFlex === "row" ? labelAlign : "left"}`,
labelClassName
)}
>
{label}
</span>
<div className={styles.dynamicFormitem_child}>
{children}
{errorMessage && (
<div
className={classNames(
styles.dynamicFormitem_errorTips,
errorClassName
)}
>
{errorMessage}
</div>
)}
<div
className={classNames(
styles.dynamicFormitem_helpText,
helpText &&
helpText.type === "warning" &&
styles.dynamicFormitem_helpText_warning,
helpText && helpText.className
)}
>
{helpText?.value}
</div>
</div>
</div>
</div>
);
};
FormItemBox.defaultProps = {
labelWidth: 100,
labelAlign: "right",
itemFlex: "row",
};
export default FormItemBox;
.dynamicFormItem-row {
display: flex;
align-items: center;
}
.dynamicFormItem-column {
display: flex;
flex-direction: column;
align-items: flex-start;
}
...@@ -76,14 +76,14 @@ export default function MyBorderlessSelect(props: IProps) { ...@@ -76,14 +76,14 @@ export default function MyBorderlessSelect(props: IProps) {
background: "rgba(247, 248, 250, 1)", background: "rgba(247, 248, 250, 1)",
cursor: "not-allowed", cursor: "not-allowed",
"& .MuiOutlinedInput-notchedOutline": { "& .MuiOutlinedInput-notchedOutline": {
borderWidth: '0px' borderWidth: "0px",
}, },
}, },
}, },
input: { input: {
fontSize: "14px", fontSize: "14px",
"&.Mui-focused":{ "&.Mui-focused": {
color:"#1370FF", color: "#1370FF",
}, },
"&.Mui-disabled": { "&.Mui-disabled": {
background: "rgba(247, 248, 250, 1)", background: "rgba(247, 248, 250, 1)",
...@@ -127,7 +127,7 @@ export default function MyBorderlessSelect(props: IProps) { ...@@ -127,7 +127,7 @@ export default function MyBorderlessSelect(props: IProps) {
root: { root: {
"&.Mui-focused .MuiOutlinedInput-notchedOutline": { "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
borderWidth: "0px", borderWidth: "0px",
color: '#1370FF' color: "#1370FF",
}, },
"& .MuiOutlinedInput-notchedOutline": { "& .MuiOutlinedInput-notchedOutline": {
borderColor: "#DDE1E6", borderColor: "#DDE1E6",
...@@ -213,29 +213,29 @@ export default function MyBorderlessSelect(props: IProps) { ...@@ -213,29 +213,29 @@ export default function MyBorderlessSelect(props: IProps) {
> >
{options.length {options.length
? options?.map((item: IOption, index) => { ? options?.map((item: IOption, index) => {
return ( return (
<MenuItem <MenuItem
value={item.value} value={item.value}
disabled={item?.disabled} disabled={item?.disabled}
key={index} key={index}
> >
{item.label} {item.label}
{value === item.value && ( {value === item.value && (
<img <img
style={{ style={{
width: "16px", width: "16px",
height: "16px", height: "16px",
position: "absolute", position: "absolute",
top: "10px", top: "10px",
right: "12px", right: "12px",
}} }}
src={selectActive} src={selectActive}
alt="" alt=""
/> />
)} )}
</MenuItem> </MenuItem>
); );
}) })
: null} : null}
</Select> </Select>
{helpertext && error && <FormHelperText>{helpertext}</FormHelperText>} {helpertext && error && <FormHelperText>{helpertext}</FormHelperText>}
......
...@@ -5,13 +5,14 @@ import { ...@@ -5,13 +5,14 @@ import {
DialogActions, DialogActions,
DialogContent, DialogContent,
DialogTitle, DialogTitle,
DialogProps,
} from "@mui/material"; } from "@mui/material";
import CloseIcon from "@mui/icons-material/Close"; import CloseIcon from "@mui/icons-material/Close";
import { ThemeProvider, createTheme } from "@mui/material/styles"; import { ThemeProvider, createTheme } from "@mui/material/styles";
import MyButton from "./MyButton"; import MyButton from "./MyButton";
export interface IDialogProps { export interface IDialogProps extends DialogProps {
/** 自定义类名 */ /** 自定义类名 */
className?: string; className?: string;
/** 自定义样式 */ /** 自定义样式 */
...@@ -53,12 +54,10 @@ export interface IDialogProps { ...@@ -53,12 +54,10 @@ export interface IDialogProps {
| "warning"; //按钮颜色风格 | "warning"; //按钮颜色风格
loading?: boolean; // 确认按钮是否处于loading状态 loading?: boolean; // 确认按钮是否处于loading状态
isText?: boolean; // 是否文本弹窗 isText?: boolean; // 是否文本弹窗
leftSideOfButtonContent?: React.ReactNode; // 取消确认按钮前的内容
} }
const theme = createTheme({ const theme = createTheme({
// 0px 12px 15px -7px rgb(0 0 0 / 11%), 0px 24px 38px 3px rgb(0 0 0 / 9%), 0px 9px 46px 8px rgb(0 0 0 / 9%)
// .css-1t1j96h-MuiPaper-root-MuiDialog-paper
components: { components: {
MuiPaper: { MuiPaper: {
styleOverrides: { styleOverrides: {
...@@ -70,6 +69,13 @@ const theme = createTheme({ ...@@ -70,6 +69,13 @@ const theme = createTheme({
}, },
}, },
}, },
MuiDialogActions: {
styleOverrides: {
root: {
justifyContent: "space-between",
},
},
},
}, },
}); });
...@@ -95,6 +101,8 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -95,6 +101,8 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
loading = false, loading = false,
okColor = "primary", okColor = "primary",
isText = false, isText = false,
leftSideOfButtonContent = null,
...other
} = props; } = props;
const handelClose = ( const handelClose = (
...@@ -113,26 +121,29 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -113,26 +121,29 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
footerRender() footerRender()
) : ( ) : (
<DialogActions style={{ padding: "16px 24px 16px 24px" }}> <DialogActions style={{ padding: "16px 24px 16px 24px" }}>
{showCancel ? ( <div>{leftSideOfButtonContent && leftSideOfButtonContent}</div>
<MyButton <div>
text={cancelText || "取消"} {showCancel ? (
onClick={onClose} <MyButton
variant="outlined" text={cancelText || "取消"}
color="secondary" onClick={onClose}
/> variant="outlined"
) : null} color="secondary"
{showConfirm ? ( />
<MyButton ) : null}
text={okText || "确定"} {showConfirm ? (
onClick={onConfirm} <MyButton
variant="contained" text={okText || "确认"}
color={okColor} onClick={onConfirm}
disabled={disabledConfirm} variant="contained"
isLoadingButton={true} color={okColor}
loading={loading} disabled={disabledConfirm}
style={{ marginLeft: "12px" }} isLoadingButton={true}
/> loading={loading}
) : null} style={{ marginLeft: "12px" }}
/>
) : null}
</div>
</DialogActions> </DialogActions>
); );
}, [ }, [
...@@ -147,6 +158,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -147,6 +158,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
isHideFooter, isHideFooter,
loading, loading,
showConfirm, showConfirm,
leftSideOfButtonContent,
]); ]);
const contentPadding = useMemo(() => { const contentPadding = useMemo(() => {
...@@ -174,6 +186,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => { ...@@ -174,6 +186,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
}, },
}, },
}} }}
{...other}
> >
{isHideHeader ? null : ( {isHideHeader ? null : (
<DialogTitle id="alert-dialog-title" sx={{ padding: "20px 24px" }}> <DialogTitle id="alert-dialog-title" sx={{ padding: "20px 24px" }}>
......
...@@ -121,6 +121,13 @@ const MyInput = (props: MyInputProps) => { ...@@ -121,6 +121,13 @@ const MyInput = (props: MyInputProps) => {
}, },
}, },
}, },
MuiFormHelperText: {
styleOverrides: {
root: {
marginLeft: "0px",
},
},
},
}, },
}); });
......
// 单选下拉框, 是input还是text还是其他由children决定 // 单选下拉框, 是input还是text还是其他由children决定
import * as React from "react"; import * as React from "react";
import Menu from "@mui/material/Menu"; import Menu, { MenuProps } from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import CheckIcon from "@mui/icons-material/Check"; import CheckIcon from "@mui/icons-material/Check";
import { ThemeProvider, createTheme } from "@mui/material/styles"; import { ThemeProvider, createTheme } from "@mui/material/styles";
import triangle from "@/assets/project/triangle.svg";
type IOption = { type IOption = {
label: string; label: string;
value: string; value: string;
}; };
type IMyMenuProps = { interface IMyMenuProps extends Omit<MenuProps, "open"> {
children: React.ReactNode; children: React.ReactNode;
options: Array<IOption>; options: Array<IOption>;
value: string; value: string;
setValue?: any; setValue?: any;
}; hasTriangle?: boolean;
}
const theme = createTheme({ const theme = createTheme({
components: { components: {
...@@ -63,25 +65,57 @@ const theme = createTheme({ ...@@ -63,25 +65,57 @@ const theme = createTheme({
}); });
const MyMenu = (props: IMyMenuProps) => { const MyMenu = (props: IMyMenuProps) => {
const { children, options, value, setValue } = props; const {
children,
options,
value,
setValue,
hasTriangle = false,
...other
} = props;
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null); const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const open = Boolean(anchorEl); const open = Boolean(anchorEl);
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => { const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
setAnchorEl(event.currentTarget); setAnchorEl(event.currentTarget);
event.stopPropagation();
}; };
const handleClose = (value: string) => { const handleClose = (value: string) => {
setAnchorEl(null); setAnchorEl(null);
}; };
const handleMenuClick = (value: string) => { const handleMenuClick = (
value: string,
event: React.MouseEvent<HTMLLIElement, MouseEvent>
) => {
setValue && setValue(value); setValue && setValue(value);
setAnchorEl(null); setAnchorEl(null);
event.stopPropagation();
}; };
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<div> <div>
<div onClick={handleClick}>{children}</div> <div
onClick={handleClick}
style={{
display: "flex",
justifyContent: "flex-start",
alignItems: "center",
}}
>
{children}
{hasTriangle && (
<img
style={{
width: "16px",
height: "16px",
transform: open ? "rotateX(180deg)" : "",
}}
src={triangle}
alt=""
/>
)}
</div>
<Menu <Menu
id="basic-menu" id="basic-menu"
anchorEl={anchorEl} anchorEl={anchorEl}
...@@ -90,11 +124,12 @@ const MyMenu = (props: IMyMenuProps) => { ...@@ -90,11 +124,12 @@ const MyMenu = (props: IMyMenuProps) => {
MenuListProps={{ MenuListProps={{
"aria-labelledby": "basic-button", "aria-labelledby": "basic-button",
}} }}
{...other}
> >
{options.map((option, index) => { {options.map((option, index) => {
return ( return (
<MenuItem <MenuItem
onClick={() => handleMenuClick(option.value)} onClick={(e) => handleMenuClick(option.value, e)}
selected={value === option.value} selected={value === option.value}
key={index} key={index}
> >
......
This diff is collapsed.
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2021-12-04 15:46:25 * @Date: 2021-12-04 15:46:25
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-21 18:00:58 * @LastEditTime: 2022-10-24 17:39:24
* @FilePath: /lionet-slb-pc/src/components/SearchView/components/Collapse.tsx * @FilePath: /lionet-slb-pc/src/components/SearchView/components/Collapse.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -13,6 +13,7 @@ import FormHelperText from "@mui/material/FormHelperText"; ...@@ -13,6 +13,7 @@ import FormHelperText from "@mui/material/FormHelperText";
import Select, { SelectChangeEvent, SelectProps } from "@mui/material/Select"; import Select, { SelectChangeEvent, SelectProps } from "@mui/material/Select";
import { createTheme, ThemeProvider } from "@mui/material"; import { createTheme, ThemeProvider } from "@mui/material";
import selectActive from "@/assets/project/selectActive.svg"; import selectActive from "@/assets/project/selectActive.svg";
import { useState } from "react";
export interface IOption { export interface IOption {
label: string; label: string;
...@@ -48,6 +49,8 @@ interface IProps ...@@ -48,6 +49,8 @@ interface IProps
isTitle?: boolean; isTitle?: boolean;
/** 是否显示提示文案 */ /** 是否显示提示文案 */
error?: boolean; error?: boolean;
/** 默认值 */
defaultValue?: string;
/** 提示文案 */ /** 提示文案 */
helpertext?: string; helpertext?: string;
} }
...@@ -63,6 +66,7 @@ export default function MySelect(props: IProps) { ...@@ -63,6 +66,7 @@ export default function MySelect(props: IProps) {
fullWidth, fullWidth,
error = false, error = false,
helpertext, helpertext,
defaultValue,
...other ...other
} = props; } = props;
...@@ -178,10 +182,14 @@ export default function MySelect(props: IProps) { ...@@ -178,10 +182,14 @@ export default function MySelect(props: IProps) {
styleOverrides: { styleOverrides: {
root: { root: {
boxShadow: "0px 3px 10px 0px rgba(0,24,57,0.14)", boxShadow: "0px 3px 10px 0px rgba(0,24,57,0.14)",
"&.MuiPopover-paper": {
maxHeight: "300px",
},
}, },
}, },
}, },
// .css-kdgfg8-MuiPaper-root-MuiMenu-paper-MuiPaper-root-MuiPopover-paper
// MuiFormControl: { // MuiFormControl: {
// styleOverrides: { // styleOverrides: {
// root: { // root: {
...@@ -192,7 +200,10 @@ export default function MySelect(props: IProps) { ...@@ -192,7 +200,10 @@ export default function MySelect(props: IProps) {
}, },
}); });
const [insideValue, setInsideValue] = useState<string>(defaultValue || "");
const handleChange = (e: SelectChangeEvent<unknown>) => { const handleChange = (e: SelectChangeEvent<unknown>) => {
setInsideValue(e.target.value as string);
onChange && onChange(e.target.value as string); onChange && onChange(e.target.value as string);
}; };
...@@ -200,7 +211,10 @@ export default function MySelect(props: IProps) { ...@@ -200,7 +211,10 @@ export default function MySelect(props: IProps) {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<FormControl fullWidth={fullWidth} variant={variant} error={error}> <FormControl fullWidth={fullWidth} variant={variant} error={error}>
{isTitle ? ( {isTitle ? (
<InputLabel id="demo-simple-select-label"> <InputLabel
id="demo-simple-select-label"
sx={{ color: "rgba(194, 198, 204, 1)" }}
>
{title || "请选择"} {title || "请选择"}
</InputLabel> </InputLabel>
) : null} ) : null}
...@@ -211,7 +225,7 @@ export default function MySelect(props: IProps) { ...@@ -211,7 +225,7 @@ export default function MySelect(props: IProps) {
size="small" size="small"
multiple={multiple} multiple={multiple}
{...other} {...other}
value={value || ""} value={value || insideValue || ""}
onChange={handleChange} onChange={handleChange}
> >
{options.length {options.length
......
This diff is collapsed.
.titleBox {
font-size: 18px;
padding-left: 24px;
line-height: 26px;
font-weight: 600;
color: #1e2633;
line-height: 48px;
}
.titleBoxLine {
width: 1px;
height: 20px;
background-color: rgba(221, 225, 230, 1);
margin: 0 24px;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-09-01 19:34:35 * @LastEditTime: 2022-10-17 16:16:42
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -14,6 +14,10 @@ import Tab from "@mui/material/Tab"; ...@@ -14,6 +14,10 @@ import Tab from "@mui/material/Tab";
import { ThemeProvider, createTheme } from "@mui/material/styles"; import { ThemeProvider, createTheme } from "@mui/material/styles";
import { TabContext, TabList, TabPanel } from "@mui/lab"; import { TabContext, TabList, TabPanel } from "@mui/lab";
import { Typography } from "@mui/material"; import { Typography } from "@mui/material";
import classNames from "classnames";
import { useNavigate } from "react-router-dom";
import styles from "./index.module.css";
interface ITabList { interface ITabList {
label: string; label: string;
...@@ -27,12 +31,24 @@ interface ITabList { ...@@ -27,12 +31,24 @@ interface ITabList {
} }
interface IProps { interface IProps {
/** 标题 */
title?: string;
/** title样式class */
titleClass?: any;
/** 选中值 */
value?: string; value?: string;
/** 值 */
onChange?: (val: string) => void; onChange?: (val: string) => void;
/** tab页面数组 */
tabList: ITabList[]; tabList: ITabList[];
/** 默认选中tab */
defaultValue?: string; defaultValue?: string;
/** 面板样式 */
tabPanelSx?: any; tabPanelSx?: any;
allowNullValue?: boolean; // 是否允许空值 /** 是否允许空值 */
allowNullValue?: boolean;
/** 路由地址 配合navigate和MyTabs组件的defaultValue组合使用、F5刷新也可以保存激活的tab */
navigateUrl?: string;
} }
const theme = createTheme({ const theme = createTheme({
...@@ -59,12 +75,23 @@ const theme = createTheme({ ...@@ -59,12 +75,23 @@ const theme = createTheme({
}, },
}, },
}, },
// #C2C6CC
MuiTabs: { MuiTabs: {
styleOverrides: { styleOverrides: {
indicator: { indicator: {
backgroundColor: "#1370FF", backgroundColor: "#1370FF",
}, },
flexContainer: {
alignItems: "center",
},
},
},
MuiButtonBase: {
styleOverrides: {
root: {
"&.Mui-selected .MuiTypography-root": {
fontWeight: "600",
},
},
}, },
}, },
}, },
...@@ -77,9 +104,14 @@ const Tabs = (props: IProps) => { ...@@ -77,9 +104,14 @@ const Tabs = (props: IProps) => {
defaultValue, defaultValue,
onChange, onChange,
allowNullValue = false, allowNullValue = false,
tabPanelSx = { padding: "24px 0 0 0" }, tabPanelSx = { padding: "20px 0 0 0" },
title,
titleClass,
navigateUrl,
} = props; } = props;
const navigate = useNavigate();
const [tabValue, setTabValue] = useState( const [tabValue, setTabValue] = useState(
defaultValue defaultValue
? defaultValue ? defaultValue
...@@ -93,6 +125,10 @@ const Tabs = (props: IProps) => { ...@@ -93,6 +125,10 @@ const Tabs = (props: IProps) => {
const onTabChange = (val: string) => { const onTabChange = (val: string) => {
setTabValue(val); setTabValue(val);
onChange && onChange(val); onChange && onChange(val);
navigateUrl &&
navigate(navigateUrl, {
state: { defaultTab: val },
});
}; };
const getImgSrc = useCallback( const getImgSrc = useCallback(
...@@ -148,6 +184,17 @@ const Tabs = (props: IProps) => { ...@@ -148,6 +184,17 @@ const Tabs = (props: IProps) => {
onTabChange(val); onTabChange(val);
}} }}
> >
{title ? (
<span
className={classNames({
[styles.titleBox]: true,
[titleClass]: titleClass,
})}
>
{title}
</span>
) : null}
{title ? <div className={styles.titleBoxLine}></div> : null}
{tabList {tabList
?.filter((item) => !item.hide) ?.filter((item) => !item.hide)
.map((item, key) => { .map((item, key) => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-11 11:56:58 * @Date: 2022-07-11 11:56:58
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-09-08 13:55:20 * @LastEditTime: 2022-10-28 15:27:23
* @FilePath: /bkunyun/src/components/mui/MyTooltip.tsx * @FilePath: /bkunyun/src/components/mui/MyTooltip.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -11,7 +11,7 @@ import { ThemeProvider, createTheme } from "@mui/material/styles"; ...@@ -11,7 +11,7 @@ import { ThemeProvider, createTheme } from "@mui/material/styles";
import { useMemo } from "react"; import { useMemo } from "react";
interface IMyTooltipProps extends Omit<TooltipProps, "title"> { interface IMyTooltipProps extends Omit<TooltipProps, "title"> {
title?: string | boolean; title?: string | boolean | JSX.Element | React.ReactNode;
} }
const theme = createTheme({ const theme = createTheme({
......
...@@ -86,4 +86,6 @@ declare module "tus-js-client"; ...@@ -86,4 +86,6 @@ declare module "tus-js-client";
declare module "uuid"; declare module "uuid";
declare module "kekule"; declare module "kekule";
declare module 'ngl'; declare module 'ngl';
declare module 'react-virtualized';
/* /*
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-06-24 14:32:32 * @LastEditTime: 2022-10-25 21:27:26
* @FilePath: /bkunyun/src/router/index.ts * @FilePath: /bkunyun/src/router/index.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
import { AnyMap } from "immer/dist/internal"; import { AnyMap } from "immer/dist/internal";
...@@ -13,12 +13,15 @@ import MenuLayout from "@/views/MenuLayout"; ...@@ -13,12 +13,15 @@ import MenuLayout from "@/views/MenuLayout";
import * as React from "react"; import * as React from "react";
import NotFound from "@/views/404"; import NotFound from "@/views/404";
import Demo from "@/views/demo"; import Demo from "@/views/demo";
import SeeEnv from "@/views/ResourceCenter/UserResources/UserResourcesEnvironment/SeeEnv";
import OperatorDetails from "@/views/ResourceCenter/UserResources/WorkflowOperator/components/OperatorDetails";
import ProjectSetting from "@/views/Project/ProjectSetting"; import ProjectSetting from "@/views/Project/ProjectSetting";
import ProjectData from "@/views/Project/ProjectData"; import ProjectData from "@/views/Project/ProjectData";
import ProjectWorkbench from "@/views/Project/ProjectWorkbench"; import ProjectWorkbench from "@/views/Project/ProjectWorkbench";
import ProjectSubmitWork from "@/views/Project/ProjectSubmitWork"; import ProjectSubmitWork from "@/views/Project/ProjectSubmitWork";
import ProjectJobDetail from "@/views/Project/ProjectJobDetail"; import ProjectJobDetail from "@/views/Project/ProjectJobDetail";
import ProjectOverview from "@/views/Project/ProjectOverview"; import ProjectOverview from "@/views/Project/ProjectOverview";
import UserResources from "@/views/ResourceCenter/UserResources";
export type route = { export type route = {
id?: string; id?: string;
...@@ -51,6 +54,9 @@ export const elements: { ...@@ -51,6 +54,9 @@ export const elements: {
}) => JSX.Element | any; }) => JSX.Element | any;
} = { } = {
Demo: Demo, Demo: Demo,
UserResources: UserResources,
SeeEnv: SeeEnv,
SeeFloe: OperatorDetails,
ProjectSetting: ProjectSetting, ProjectSetting: ProjectSetting,
ProjectData: ProjectData, ProjectData: ProjectData,
ProjectWorkbench: ProjectWorkbench, ProjectWorkbench: ProjectWorkbench,
...@@ -65,6 +71,11 @@ export const routes: Array<route | navigate> = [ ...@@ -65,6 +71,11 @@ export const routes: Array<route | navigate> = [
from: "/", from: "/",
to: "/home", to: "/home",
}, },
{
type: "navigate",
from: "/utility",
to: "/home",
},
{ {
type: "navigate", type: "navigate",
from: "/product", from: "/product",
...@@ -82,6 +93,13 @@ export const routes: Array<route | navigate> = [ ...@@ -82,6 +93,13 @@ export const routes: Array<route | navigate> = [
path: "/home", path: "/home",
element: Home, element: Home,
}, },
{
type: "page",
name: "Utility",
path: "/utility",
element: MenuLayout,
children: [],
},
{ {
type: "page", type: "page",
name: "Product", name: "Product",
......
This diff is collapsed.
...@@ -13,6 +13,7 @@ type projectInfo = { ...@@ -13,6 +13,7 @@ type projectInfo = {
desc?: string; desc?: string;
projectRole?: string; projectRole?: string;
filetoken?: string; filetoken?: string;
zoneId?: string;
}; };
type productInfo = { type productInfo = {
......
This diff is collapsed.
This diff is collapsed.
...@@ -90,7 +90,7 @@ export const storageUnitFromB = (b: number) => { ...@@ -90,7 +90,7 @@ export const storageUnitFromB = (b: number) => {
} else if (b < 1024 * 1024 * 1024 * 1024) { } else if (b < 1024 * 1024 * 1024 * 1024) {
return `${(b / (1024 * 1024 * 1024)).toFixed(2)}G`; return `${(b / (1024 * 1024 * 1024)).toFixed(2)}G`;
} else { } else {
return `${(b / (1024 * 1024 * 1024 * 1024)).toFixed(2)}t`; return `${(b / (1024 * 1024 * 1024 * 1024)).toFixed(2)}T`;
} }
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment