From 70cbc98f43406e143e8ef2fe4cf8b4be06a19c22 Mon Sep 17 00:00:00 2001 From: autosubmit Date: Wed, 17 May 2023 18:29:54 +0800 Subject: [PATCH] Auto Submit --- color.less | 34 +- knowledgegraph/graph.html | 104 +++- knowledgegraph/zoomslider.js | 468 ++++++++++++++++++ p__Competitions__Index__index.async.js | 11 +- p__Demo__index.async.js | 77 ++- ...om__ExchangeFromProblemSet__index.async.js | 12 +- p__index.async.js | 2 +- p__tasks__index.async.js | 77 ++- umi.js | 2 +- 9 files changed, 746 insertions(+), 41 deletions(-) create mode 100644 knowledgegraph/zoomslider.js diff --git a/color.less b/color.less index 5d1eebc932..1debf036e0 100644 --- a/color.less +++ b/color.less @@ -563,10 +563,10 @@ a.ant-btn-disabled:active > a:only-child::after {background: transparent;} .ant-comment-actions > li > span {color: @text-color-secondary;} .ant-comment-actions > li > span:hover {color: #595959;} .ant-picker-status-error.ant-picker, .ant-picker-status-error.ant-picker:not([disabled]):hover {background-color: #fff;border-color: @error-color;} -.ant-picker-status-error.ant-picker-focused, .ant-picker-status-error.ant-picker:focus {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-picker-status-error.ant-picker-focused, .ant-picker-status-error.ant-picker:focus {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-picker-status-error.ant-picker .ant-picker-active-bar {background: color(~`colorPalette("@{error-color}", 5)`);} .ant-picker-status-warning.ant-picker, .ant-picker-status-warning.ant-picker:not([disabled]):hover {background-color: #fff;border-color: @warning-color;} -.ant-picker-status-warning.ant-picker-focused, .ant-picker-status-warning.ant-picker:focus {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-picker-status-warning.ant-picker-focused, .ant-picker-status-warning.ant-picker:focus {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-picker-status-warning.ant-picker .ant-picker-active-bar {background: color(~`colorPalette("@{warning-color}", 5)`);} .ant-picker {color: @text-color;background: #fff;border: 1px solid @border-color-base;border-radius: 2px;} .ant-picker:hover, .ant-picker-focused {border-color: color(~`colorPalette("@{primary-color}", 5)`);border-right-width: 1px;} @@ -788,16 +788,16 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .anticon.ant-input-clear-icon:hover, .ant-input-clear-icon:hover {color: @text-color-secondary;} .anticon.ant-input-clear-icon:active, .ant-input-clear-icon:active {color: @text-color;} .ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input, .ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover {background: #fff;border-color: @error-color;} -.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus, .ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus, .ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-input-status-error .ant-input-prefix {color: @error-color;} .ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input, .ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover {background: #fff;border-color: @warning-color;} -.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus, .ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus, .ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-input-status-warning .ant-input-prefix {color: @warning-color;} .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper, .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover {background: #fff;border-color: @error-color;} -.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus, .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus, .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-input-affix-wrapper-status-error .ant-input-prefix {color: @error-color;} .ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper, .ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover {background: #fff;border-color: @warning-color;} -.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus, .ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus, .ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-input-affix-wrapper-status-warning .ant-input-prefix {color: @warning-color;} .ant-input-group-wrapper-status-error .ant-input-group-addon {color: @error-color;border-color: @error-color;} .ant-input-group-wrapper-status-warning .ant-input-group-addon {color: @warning-color;border-color: @warning-color;} @@ -894,16 +894,16 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-input-number-affix-wrapper > div.ant-input-number {border: none;} .ant-input-number-affix-wrapper > div.ant-input-number.ant-input-number-focused {box-shadow: none !important;} .ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number, .ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:hover {background: #fff;border-color: @error-color;} -.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus, .ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus, .ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-input-number-status-error .ant-input-number-prefix {color: @error-color;} .ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number, .ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:hover {background: #fff;border-color: @warning-color;} -.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus, .ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus, .ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-input-number-status-warning .ant-input-number-prefix {color: @warning-color;} .ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper, .ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover {background: #fff;border-color: @error-color;} -.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus, .ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus, .ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-input-number-affix-wrapper-status-error .ant-input-number-prefix {color: @error-color;} .ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper, .ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover {background: #fff;border-color: @warning-color;} -.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus, .ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus, .ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-input-number-affix-wrapper-status-warning .ant-input-number-prefix {color: @warning-color;} .ant-input-number-group-wrapper-status-error .ant-input-number-group-addon {color: @error-color;border-color: @error-color;} .ant-input-number-group-wrapper-status-warning .ant-input-number-group-addon {color: @warning-color;border-color: @warning-color;} @@ -1024,10 +1024,10 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-list-grid .ant-col > .ant-list-item {border-bottom: none;} .ant-list-bordered {border: 1px solid @border-color-base;border-radius: 2px;} .ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions, .ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:hover {background: #fff;border-color: @error-color;} -.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus, .ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus, .ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-mentions-status-error .ant-input-prefix {color: @error-color;} .ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions, .ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:hover {background: #fff;border-color: @warning-color;} -.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus, .ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus, .ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-mentions-status-warning .ant-input-prefix {color: @warning-color;} .ant-mentions {color: @text-color;background-color: #fff;background-image: none;border: 1px solid @border-color-base;border-radius: 2px;} .ant-mentions::placeholder {color: #bfbfbf;} @@ -1360,9 +1360,9 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-select-multiple .ant-select-selection-item-remove {color: inherit;color: @text-color-secondary;} .ant-select-multiple .ant-select-selection-item-remove:hover {color: rgba(0, 0, 0, 0.75);} .ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-selector {background-color: #fff;border-color: @error-color !important;} -.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-open .ant-select-selector, .ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(35, 200, 81, 0.2);border-right-width: 1px;} +.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-open .ant-select-selector, .ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{error-color}", 5)`);box-shadow: 0 0 0 2px rgba(190, 121, 130, 0.2);border-right-width: 1px;} .ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-selector {background-color: #fff;border-color: @warning-color !important;} -.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-open .ant-select-selector, .ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(145, 207, 181, 0.2);border-right-width: 1px;} +.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-open .ant-select-selector, .ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{warning-color}", 5)`);box-shadow: 0 0 0 2px rgba(183, 139, 245, 0.2);border-right-width: 1px;} .ant-select {color: @text-color;} .ant-select:not(.ant-select-customize-input) .ant-select-selector {background-color: #fff;border: 1px solid @border-color-base;border-radius: 2px;} .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {border-color: color(~`colorPalette("@{primary-color}", 5)`);box-shadow: 0 0 0 2px fade(@primary-color, 20%);border-right-width: 1px;} @@ -1636,9 +1636,9 @@ tr.ant-table-expanded-row:hover > td {background: #fbfbfb;} .ant-tag-checkable:active, .ant-tag-checkable-checked {color: #fff;} .ant-tag-checkable-checked {background-color: @primary-color;} .ant-tag-checkable:active {background-color: color(~`colorPalette("@{primary-color}", 7)`);} -.ant-tag-pink {color: #c41d7f;background: color(~`colorPalette("@{modal-header-border-color-split}", 1)`);border-color: #ffadd2;} +.ant-tag-pink {color: #c41d7f;background: #fff0f6;border-color: #ffadd2;} .ant-tag-pink-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} -.ant-tag-magenta {color: #c41d7f;background: color(~`colorPalette("@{modal-header-border-color-split}", 1)`);border-color: #ffadd2;} +.ant-tag-magenta {color: #c41d7f;background: #fff0f6;border-color: #ffadd2;} .ant-tag-magenta-inverse {color: #fff;background: #eb2f96;border-color: #eb2f96;} .ant-tag-red {color: #cf1322;background: #fff1f0;border-color: #ffa39e;} .ant-tag-red-inverse {color: #fff;background: #f5222d;border-color: #f5222d;} @@ -1660,7 +1660,7 @@ tr.ant-table-expanded-row:hover > td {background: #fbfbfb;} .ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} .ant-tag-geekblue {color: #1d39c4;background: #f0f5ff;border-color: #adc6ff;} .ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} -.ant-tag-purple {color: #531dab;background: #f9f0ff;border-color: #d3adf7;} +.ant-tag-purple {color: #531dab;background: color(~`colorPalette("@{warning-color}", 1)`);border-color: #d3adf7;} .ant-tag-purple-inverse {color: #fff;background: #722ed1;border-color: #722ed1;} .ant-tag-success {color: @success-color;background: color(~`colorPalette("@{success-color}", 1)`);border-color: color(~`colorPalette("@{success-color}", 3)`);} .ant-tag-processing {color: @primary-color;background: color(~`colorPalette("@{primary-color}", 1)`);border-color: color(~`colorPalette("@{primary-color}", 3)`);} diff --git a/knowledgegraph/graph.html b/knowledgegraph/graph.html index c22a935487..0c699f76e3 100644 --- a/knowledgegraph/graph.html +++ b/knowledgegraph/graph.html @@ -77,10 +77,104 @@ color: red; } + +
知识图谱
@@ -125,6 +219,7 @@
+ @@ -284,7 +379,8 @@ editable: false, })) init(nodeDataList) - myDiagram.zoomToFit() + // myDiagram.zoomToFit() + setTimeout(function(){myDiagram.zoomToFit()},500) } } catch (error) { console.log(error); @@ -633,6 +729,12 @@ } + + + zoomSlider = new ZoomSlider(myDiagram); + + + diff --git a/knowledgegraph/zoomslider.js b/knowledgegraph/zoomslider.js new file mode 100644 index 0000000000..756c5b0ab7 --- /dev/null +++ b/knowledgegraph/zoomslider.js @@ -0,0 +1,468 @@ +'use strict'; +/* +* Copyright (C) 1998-2023 by Northwoods Software Corporation. All Rights Reserved. +*/ + +/** + * This class implements a zoom slider for GoJS diagrams. + * The constructor takes two arguments: + * - `diagram` ***Diagram*** a reference to a GoJS Diagram + * - `options` ***Object*** an optional JS Object describing options for the slider + * + * Options: + * - `alignment` ***Spot*** see {@link #alignment} + * - `alignmentFocus` ***Spot*** see {@link #alignmentFocus} + * - `size` ***number*** see {@link #size} + * - `buttonSize` ***number*** see {@link #buttonSize} + * - `orientation` ***string*** see {@link #orientation} + * - `opacity` ***number*** see {@link #opacity} + * + * Example usage of ZoomSlider: + * ```js + * var zoomSlider = new ZoomSlider(myDiagram, + * { + * alignment: go.Spot.TopRight, alignmentFocus: go.Spot.TopRight, + * size: 150, buttonSize: 30, orientation: 'horizontal' + * }); + * ``` + * + * This is the basic HTML Structure that the ZoomSlider creates as a sibling div of the diagram: + * ```html + *
+ * + *
+ * + *
+ * + *
+ * ``` + * + *

+ * The diagram div's parent element should use `position: relative` to ensure the slider gets positioned properly. + * + * @constructor + * @class + * @param {Diagram} diagram the Diagram which the slider zooms in/out + * @param {Object} options the options for the slider + */ +function ZoomSlider(diagram, options) { + this._diagram = diagram; + this._initialScale = diagram.scale; + this._diagramDiv = diagram.div; + this._sliderDiv = null; + + // Options defaults: + this._size = 125; + this._buttonSize = 25; + this._alignment = go.Spot.BottomRight; + this._alignmentFocus = go.Spot.BottomRight; + this._orientation = 'vertical'; + this._opacity = .75; + + // Set properties based on options + if (options !== undefined) { + if (options['size'] !== undefined) this._size = options['size']; + if (options['buttonSize'] !== undefined) this._buttonSize = options['buttonSize']; + if (options['alignment'] !== undefined) this._alignment = options['alignment']; + if (options['alignmentFocus'] !== undefined) this._alignmentFocus = options['alignmentFocus']; + if (options['orientation'] !== undefined) this._orientation = options['orientation']; + if (options['opacity'] !== undefined) this._opacity = options['opacity']; + } + + // Prepare change listeners + var self = this; + this.updateOnViewportBoundsChanged = function (e) { self.scaleToValue(); }; + + this.init(); +} + +// Public properties + +/** + * This read-only property returns the diagram for which the slider is handling zoom. + * @name ZoomSlider#diagram + + * @return {Diagram} + */ +Object.defineProperty(ZoomSlider.prototype, 'diagram', { + get: function() { return this._diagram; } +}); + +/** + * Gets or sets the overall length, in pixels, that the slider will occupy. + * The default value is 125. + * @name ZoomSlider#size + + * @return {number} + */ +Object.defineProperty(ZoomSlider.prototype, 'size', { + get: function() { return this._size; }, + set: function(val) { + var old = this._size; + if (old !== val) { + this._size = val; + this.resize(); + } + } +}); + +/** + * Gets or sets the height/width of the buttons at each end of the slider. + * The default value is 25. + * @name ZoomSlider#buttonSize + + * @return {number} + */ +Object.defineProperty(ZoomSlider.prototype, 'buttonSize', { + get: function() { return this._buttonSize; }, + set: function(val) { + var old = this._buttonSize; + if (old !== val) { + this._buttonSize = val; + this.resize(); + } + } +}); + +/** + * Gets or sets the alignment Spot of this slider to determine where it should be placed relative to the diagram. + * The default value is Spot.BottomRight. + * @name ZoomSlider#alignment + + * @return {Spot} + */ +Object.defineProperty(ZoomSlider.prototype, 'alignment', { + get: function() { return this._alignment; }, + set: function(val) { + var old = this._alignment; + if (old !== val) { + this._alignment = val; + this.realign(); + } + } +}); + +/** + * Gets or sets the Spot on this slider to be used as the alignment point when placing it relative to the diagram. + * The default value is Spot.BottomRight. + * @name ZoomSlider#alignmentFocus + + * @return {Spot} + */ +Object.defineProperty(ZoomSlider.prototype, 'alignmentFocus', { + get: function() { return this._alignmentFocus; }, + set: function(val) { + var old = this._alignmentFocus; + if (old !== val) { + this._alignmentFocus = val; + this.realign(); + } + } +}); + +/** + * Gets or sets whether the slider is oriented vertically or horizontally. + * Must be either 'horizontal' or 'vertical' and is case-sensitive. + * The default value is `'vertical'`. + * @name ZoomSlider#orientation + + * @return {string} + */ +Object.defineProperty(ZoomSlider.prototype, 'orientation', { + get: function() { return this._orientation; }, + set: function(val) { + if (val !== 'horizontal' && val !== 'vertical') { + throw new Error('Orientation must be "horizontal" or "vertical"'); + } + var old = this._orientation; + if (old !== val) { + this._orientation = val; + this.resize(true); + } + } +}); + +/** + * Gets or sets the opacity of the slider. + * The default value is 0.75. + * @name ZoomSlider#opacity + + * @return {Spot} + */ +Object.defineProperty(ZoomSlider.prototype, 'opacity', { + get: function() { return this._opacity; }, + set: function(val) { + var old = this._opacity; + if (old !== val) { + this._opacity = val; + this._sliderDiv.style.opacity = val; + } + } +}); + +/** + * @ignore + * Initialize the slider. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.init = function() { + // Sets up the slider div and inner div's basic attributes and ids + this.sliderDivSetup(); + this.resize(true); + + // Set up the runtime code + this.sliderListenerSetup(); +}; + +/** + * @ignore + * Create the necessary divs for the slider and add the slider as a sibling of the diagram. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.sliderDivSetup = function() { + this._sliderDiv = document.createElement('div'); + this._sliderDiv.className = 'zoomSlider'; + + // Initialize buttons and range input + var zoomOutBtn = document.createElement('button'); + this.zoomSliderOut = zoomOutBtn; + zoomOutBtn.className = 'zoomButton'; + zoomOutBtn.innerHTML = '-'; + zoomOutBtn.type = 'button'; + this._sliderDiv.appendChild(zoomOutBtn); + + var zoomRangeContainer = document.createElement('div'); + this.zoomSliderRangeCtn = zoomRangeContainer; + zoomRangeContainer.className = 'zoomRangeContainer'; + this._sliderDiv.appendChild(zoomRangeContainer); + + var zoomRangeInput = document.createElement('input'); + this.zoomSliderRange = zoomRangeInput; + zoomRangeInput.className = 'zoomRangeInput'; + zoomRangeInput.type = 'range'; + zoomRangeInput.min = -50; + zoomRangeInput.max = 100; + zoomRangeContainer.appendChild(zoomRangeInput); + + var zoomInBtn = document.createElement('button'); + this.zoomSliderIn = zoomInBtn; + zoomInBtn.className = 'zoomButton'; + zoomInBtn.innerHTML = '+'; + zoomInBtn.type = 'button'; + this._sliderDiv.appendChild(zoomInBtn); + + // Adds the slider as a sibling of the diagram + // IMPORTANT: the diagram div's parent element should use position: relative + if (this._diagramDiv !== null) { + var diagramParent = this._diagramDiv.parentElement; + if (diagramParent !== null) { + diagramParent.appendChild(this._sliderDiv); + } + } +}; + +/** + * @ignore + * Add listeners to the buttons and range input. + * Add a diagram listener + * @this {ZoomSlider} + */ +ZoomSlider.prototype.sliderListenerSetup = function() { + var zoomOutBtn = this.zoomSliderOut; + var zoomInBtn = this.zoomSliderIn; + var zoomRangeInput = this.zoomSliderRange; + + if (zoomOutBtn === null || zoomInBtn === null || zoomRangeInput === null) return; + + // Set up diagram listener so the slider can be kept in sync with the diagram's scale + this.diagram.addDiagramListener('ViewportBoundsChanged', this.updateOnViewportBoundsChanged); + + // Set up event handlers for buttons and input range slider + var self = this; + zoomOutBtn.onclick = function() { + zoomRangeInput.stepDown(); + self.valueToScale(); + }; + + zoomInBtn.onclick = function() { + zoomRangeInput.stepUp(); + self.valueToScale(); + }; + + var valChanged = function() { + self.valueToScale(); + }; + zoomRangeInput.oninput = valChanged; + zoomRangeInput.onchange = valChanged; +}; + +/** + * @ignore + * Resize the slider. + * @this {ZoomSlider} + * @param {boolean} reorient whether or not to reorient the slider/buttons + */ +ZoomSlider.prototype.resize = function(reorient) { + var sliderWidth = 0; + var sliderHeight = 0; + + var zoomOutBtn = this.zoomSliderOut; + var zoomInBtn = this.zoomSliderIn; + var zoomRangeContainer = this.zoomSliderRangeCtn; + var zoomRangeInput = this.zoomSliderRange; + + if (this._sliderDiv === null || zoomOutBtn === null || zoomInBtn === null || + zoomRangeContainer === null || zoomRangeInput === null) return; + + if (this.orientation === 'horizontal') { + sliderWidth = this.size; + sliderHeight = this.buttonSize; + var rangeWidth = sliderWidth - sliderHeight * 2; + + zoomOutBtn.style.width = sliderHeight + 'px'; + zoomOutBtn.style.height = sliderHeight + 'px'; + + zoomRangeContainer.style.width = rangeWidth + 'px'; + zoomRangeContainer.style.height = sliderHeight + 'px'; + + zoomRangeInput.style.width = rangeWidth + 'px'; + zoomRangeInput.style.height = sliderHeight + 'px'; + zoomRangeInput.style.transformOrigin = null; + + zoomInBtn.style.width = sliderHeight + 'px'; + zoomInBtn.style.height = sliderHeight + 'px'; + } else { + sliderHeight = this.size; + sliderWidth = this.buttonSize; + var rangeHeight = sliderHeight - sliderWidth * 2; + + zoomInBtn.style.width = sliderWidth + 'px'; + zoomInBtn.style.height = sliderWidth + 'px'; + + zoomRangeContainer.style.width = sliderWidth + 'px'; + zoomRangeContainer.style.height = rangeHeight + 'px'; + + zoomRangeInput.style.width = rangeHeight + 'px'; + zoomRangeInput.style.height = sliderWidth + 'px'; + zoomRangeInput.style.transformOrigin = rangeHeight / 2 + 'px ' + rangeHeight / 2 + 'px'; + + zoomOutBtn.style.width = sliderWidth + 'px'; + zoomOutBtn.style.height = sliderWidth + 'px'; + } + this._sliderDiv.style.width = sliderWidth + 'px'; + this._sliderDiv.style.height = sliderHeight + 'px'; + + // Reorient the slider, if necessary + if (reorient) { + this.reorient(); + } + + // Realign based on new size + this.realign(); +} + +/** + * @ignore + * Reorient the slider, changing the transform and the order of the buttons within the div. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.reorient = function() { + var zoomOutBtn = this.zoomSliderOut; + var zoomInBtn = this.zoomSliderIn; + var zoomRangeInput = this.zoomSliderRange; + + if (this._sliderDiv === null || zoomOutBtn === null || zoomInBtn === null || zoomRangeInput === null) return; + + // Need to set the transform of the range input and move the buttons to the correct sides + if (this.orientation === 'horizontal') { + zoomRangeInput.style.transform = null; + this._sliderDiv.insertBefore(zoomOutBtn, this._sliderDiv.firstChild); + this._sliderDiv.appendChild(zoomInBtn); + } else { + zoomRangeInput.style.transform = 'rotate(-90deg)'; + this._sliderDiv.insertBefore(zoomInBtn, this._sliderDiv.firstChild); + this._sliderDiv.appendChild(zoomOutBtn); + } +} + +/** + * @ignore + * Realigns to slider relative to the diagram. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.realign = function() { + if (this._diagramDiv === null || this._sliderDiv === null) return; + + var sliderWidth = 0; + var sliderHeight = 0; + if (this.orientation === 'horizontal') { + sliderWidth = this.size; + sliderHeight = this.buttonSize; + } else { + sliderHeight = this.size; + sliderWidth = this.buttonSize; + } + + // Finds the diagram and diagram's parent in the page + var diagramParent = this._diagramDiv.parentElement; + var diagramLoc = this._diagramDiv.getBoundingClientRect(); + if (diagramParent !== null) { + var parentLoc = diagramParent.getBoundingClientRect(); + + var top = diagramLoc.top - parentLoc.top + + this.alignment.y * this._diagramDiv.clientHeight + this.alignment.offsetY - + this.alignmentFocus.y * sliderHeight + this.alignmentFocus.offsetY; + + var left = diagramLoc.left - parentLoc.left + + this.alignment.x * this._diagramDiv.clientWidth + this.alignment.offsetX - + this.alignmentFocus.x * sliderWidth + this.alignmentFocus.offsetX; + + this._sliderDiv.style.top = top + 'px'; + this._sliderDiv.style.left = left + 'px'; + } +} + +/** + * @ignore + * Update the value of the slider input to match the diagram's scale. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.scaleToValue = function() { + var slider = this.zoomSliderRange; + var diagram = this.diagram; + var A = this._initialScale; + var B = diagram.commandHandler.zoomFactor; + var y1 = diagram.scale; + slider.value = Math.round(Math.log(y1/A) / Math.log(B)).toString(); +} + +/** + * @ignore + * Update the diagram's scale to match the value of the slider input. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.valueToScale = function() { + var slider = this.zoomSliderRange; + var diagram = this.diagram; + var x = parseFloat(slider.value); + var A = this._initialScale; + var B = diagram.commandHandler.zoomFactor; + diagram.scale = A * Math.pow(B, x); +} + +/** + * Remove the slider from the page. + * @this {ZoomSlider} + */ +ZoomSlider.prototype.remove = function() { + // Remove the listener attached to diagram + this.diagram.removeDiagramListener('ViewportBoundsChanged', this.updateOnViewportBoundsChanged); + + if (this._sliderDiv !== null) { + this._sliderDiv.innerHTML = ''; + if (this._sliderDiv.parentElement) { + this._sliderDiv.parentElement.removeChild(this._sliderDiv); + } + this._sliderDiv = null; + } +}; \ No newline at end of file diff --git a/p__Competitions__Index__index.async.js b/p__Competitions__Index__index.async.js index d46c385f6f..5c9271c7f2 100644 --- a/p__Competitions__Index__index.async.js +++ b/p__Competitions__Index__index.async.js @@ -1185,7 +1185,7 @@ var Index_competitionsPage = function competitionsPage(_ref) { } function _gotocourse() { _gotocourse = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(e, item, url) { - var _user$userInfo3; + var _user$userInfo4; var result; return regeneratorRuntime_default()().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { @@ -1197,7 +1197,7 @@ var Index_competitionsPage = function competitionsPage(_ref) { } return _context2.abrupt("return"); case 3: - if (!(item !== null && item !== void 0 && item.is_authentication && !(user !== null && user !== void 0 && (_user$userInfo3 = user.userInfo) !== null && _user$userInfo3 !== void 0 && _user$userInfo3.authentication))) { + if (!(item !== null && item !== void 0 && item.is_authentication && !(user !== null && user !== void 0 && (_user$userInfo4 = user.userInfo) !== null && _user$userInfo4 !== void 0 && _user$userInfo4.authentication))) { _context2.next = 6; break; } @@ -1435,7 +1435,8 @@ var Index_competitionsPage = function competitionsPage(_ref) { } var onListClick = function onListClick(item) { if (item.external_url) { - tourl(item.external_url); + var _user$userInfo3; + tourl("".concat(item.external_url) + "?login=" + (user === null || user === void 0 ? void 0 : (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login) + "&websiteName=educoder"); } else { tourl(item.competition_status === 'ended' ? "/competitions/".concat(item.identifier) : item.competition_status === 'nearly_published' ? item.permission.editable == true ? "/competitions/".concat(item.identifier) : null : item.competition_status === 'progressing' ? "/competitions/".concat(item.identifier) : null); } @@ -1504,8 +1505,8 @@ var Index_competitionsPage = function competitionsPage(_ref) { width: "100%" }, children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* Banner */.jL, { - title: competitions.competition_title || '竞赛组织', - sunTitle: competitions.listParams.url_suffix_name && competitions.competition_title ? '' : '激发创新活力,培养创新人才', + title: competitions.listParams.url_suffix_name ? competitions.competition_title : "竞赛组织", + sunTitle: competitions.listParams.url_suffix_name ? '' : '激发创新活力,培养软件人才', img: competitions.listParams.url_suffix_name && competitions.banner ? '' : competition_banner_namespaceObject, imgWidth: 438, bannerExtraContent: /*#__PURE__*/(0,jsx_runtime.jsx)("div", { diff --git a/p__Demo__index.async.js b/p__Demo__index.async.js index 2f4fbc375a..146c3862d5 100644 --- a/p__Demo__index.async.js +++ b/p__Demo__index.async.js @@ -918,10 +918,16 @@ var row = __webpack_require__(71230); var col_style = __webpack_require__(89032); // EXTERNAL MODULE: ./node_modules/antd/es/col/index.js var col = __webpack_require__(15746); +// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules +var button_style = __webpack_require__(29913); +// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js +var es_button = __webpack_require__(71577); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(67294); // EXTERNAL MODULE: ./src/utils/fullscreen.ts var fullscreen = __webpack_require__(15994); +// EXTERNAL MODULE: ./src/utils/fetch.ts +var fetch = __webpack_require__(84519); // EXTERNAL MODULE: ./src/utils/util.tsx var util = __webpack_require__(29427); ;// CONCATENATED MODULE: ./src/pages/Demo/index.less?modules @@ -931,10 +937,6 @@ var util = __webpack_require__(29427); var modal_style = __webpack_require__(35611); // EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules var modal = __webpack_require__(85402); -// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules -var button_style = __webpack_require__(29913); -// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js -var es_button = __webpack_require__(71577); // EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules var spin_style = __webpack_require__(22536); // EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js @@ -3885,6 +3887,8 @@ var Warehouse = function Warehouse(_ref) { + + // let output = 'item\tgraph\nmyserver1.cpu.load5\tmyserver1.cpu.load\nmyserver1.cpu.load15\tmyserver1.cpu.load' // let actual_output = 'item\tgraph\r\nmyserver1.cpu.load5\tmyserver1.cpu.load\r\nmyserver1.cpu.load15\tmyserver1.cpu.load\r\n' @@ -3893,6 +3897,7 @@ var Warehouse = function Warehouse(_ref) { + /* harmony default export */ var Demo = (function (_ref) { var taskId = _ref.taskId, taskData = _ref.taskData, @@ -3906,12 +3911,74 @@ var Warehouse = function Warehouse(_ref) { return "https://latexjs.educoder.net/index.html?id=".concat(taskData === null || taskData === void 0 ? void 0 : (_taskData$shixun = taskData.shixun) === null || _taskData$shixun === void 0 ? void 0 : _taskData$shixun.identifier, "&path=").concat(path, "&taskId=").concat(taskId, "&myshixunId=").concat(taskData === null || taskData === void 0 ? void 0 : (_taskData$myshixun = taskData.myshixun) === null || _taskData$myshixun === void 0 ? void 0 : _taskData$myshixun.identifier, "&token=").concat((0,util/* getCookie */.ej)("_educoder_session")); } }, [taskData]); + var test1 = function test1() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "get", + params: { + id: 1, + name: undefined, + age: null, + c: { + a: 112 + }, + aa: [], + test: "12321313", + b: "" + } + }); + }; + var test2 = function test2() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "get", + params: {} + }); + }; + var test3 = function test3() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "post", + body: { + id: 1, + name: undefined, + age: null, + c: {}, + cc: { + n: 1, + p: 22 + }, + aa: [], + dd: ["SDafadsf", "&&"], + test: "12321313", + b: "sadfjsdfjdkljflsajflasf&&&fdsahfasfasfasdfsadf" + } + }); + }; + var test4 = function test4() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "post" + // body:{ + + // } + }); + }; + return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { style: { height: "100vh" }, ref: codeAreaContainerRef, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, { + children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test1, + children: "get\u6D4B\u8BD51" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test2, + children: "get\u6D4B\u8BD52" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test3, + children: "post1" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test4, + children: "post2" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, { flex: "1", children: (taskData === null || taskData === void 0 ? void 0 : taskData.shixun) && /*#__PURE__*/(0,jsx_runtime.jsx)(Demo_Warehouse, { taskId: taskId, diff --git a/p__Paperlibrary__Random__ExchangeFromProblemSet__index.async.js b/p__Paperlibrary__Random__ExchangeFromProblemSet__index.async.js index 710e96a452..37ad1e8f3c 100644 --- a/p__Paperlibrary__Random__ExchangeFromProblemSet__index.async.js +++ b/p__Paperlibrary__Random__ExchangeFromProblemSet__index.async.js @@ -136,7 +136,7 @@ var TabType; TabType["TeachGroupShare"] = "3"; })(TabType || (TabType = {})); var ProblemsetPage = function ProblemsetPage(_ref) { - var _match$params, _match$params2, _problemset$teachGrou, _problemset$teachGrou2, _problemset$disciplin, _problemset$teachGrou3; + var _problemset$teachGrou, _problemset$teachGrou2, _problemset$disciplin, _problemset$teachGrou3; var classroomList = _ref.classroomList, problemset = _ref.problemset, user = _ref.user, @@ -146,6 +146,7 @@ var ProblemsetPage = function ProblemsetPage(_ref) { match = _ref.match, shixunHomeworks = _ref.shixunHomeworks, props = objectWithoutProperties_default()(_ref, _excluded); + var pathParams = (0,_umi_production_exports.useParams)(); var _useSearchParams = (0,_umi_production_exports.useSearchParams)(), _useSearchParams2 = slicedToArray_default()(_useSearchParams, 1), searchParams = _useSearchParams2[0]; @@ -163,9 +164,9 @@ var ProblemsetPage = function ProblemsetPage(_ref) { per_page: 20, sort_by: 'updated_at', sort_direction: 'desc', - id: props.searchParams.get("id") || null, - exam_id: (match === null || match === void 0 ? void 0 : (_match$params = match.params) === null || _match$params === void 0 ? void 0 : _match$params.id) || null, - exercise_id: (match === null || match === void 0 ? void 0 : (_match$params2 = match.params) === null || _match$params2 === void 0 ? void 0 : _match$params2.categoryId) || null + id: searchParams.get("id") || null, + exam_id: pathParams.id || null, + exercise_id: pathParams.categoryId || null }), _useState2 = slicedToArray_default()(_useState, 2), params = _useState2[0], @@ -244,14 +245,13 @@ var ProblemsetPage = function ProblemsetPage(_ref) { }; }, []); (0,react.useEffect)(function () { - var _query; dispatch({ type: 'problemset/getDisciplines', payload: { source: 'question' } }); - var group_id = ((_query = props.location.query) === null || _query === void 0 ? void 0 : _query.group_id) || 0; + var group_id = searchParams.get("group_id") || 0; params.group_id = Number(group_id); setParams(params); getItemBanks(params).then(function (res) { diff --git a/p__index.async.js b/p__index.async.js index fe5689bb66..9735af81c6 100644 --- a/p__index.async.js +++ b/p__index.async.js @@ -2874,7 +2874,7 @@ var MainSite = function MainSite(_ref) { }; return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: MainSitemodules.mainSiteContent, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", { + children: [window.location.host != "saia.educoder.net" && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", { className: MainSitemodules.ContentWarp, children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: MainSitemodules.operatingEnvironment, diff --git a/p__tasks__index.async.js b/p__tasks__index.async.js index afe0f4eff1..4221d30be1 100644 --- a/p__tasks__index.async.js +++ b/p__tasks__index.async.js @@ -3666,10 +3666,16 @@ var row = __webpack_require__(71230); var col_style = __webpack_require__(89032); // EXTERNAL MODULE: ./node_modules/antd/es/col/index.js var col = __webpack_require__(15746); +// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules +var button_style = __webpack_require__(29913); +// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js +var es_button = __webpack_require__(71577); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(67294); // EXTERNAL MODULE: ./src/utils/fullscreen.ts var fullscreen = __webpack_require__(15994); +// EXTERNAL MODULE: ./src/utils/fetch.ts +var fetch = __webpack_require__(84519); // EXTERNAL MODULE: ./src/utils/util.tsx var util = __webpack_require__(29427); ;// CONCATENATED MODULE: ./src/pages/Demo/index.less?modules @@ -3679,10 +3685,6 @@ var util = __webpack_require__(29427); var modal_style = __webpack_require__(35611); // EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules var modal = __webpack_require__(85402); -// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules -var button_style = __webpack_require__(29913); -// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js -var es_button = __webpack_require__(71577); // EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules var spin_style = __webpack_require__(22536); // EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js @@ -6633,6 +6635,8 @@ var Warehouse = function Warehouse(_ref) { + + // let output = 'item\tgraph\nmyserver1.cpu.load5\tmyserver1.cpu.load\nmyserver1.cpu.load15\tmyserver1.cpu.load' // let actual_output = 'item\tgraph\r\nmyserver1.cpu.load5\tmyserver1.cpu.load\r\nmyserver1.cpu.load15\tmyserver1.cpu.load\r\n' @@ -6641,6 +6645,7 @@ var Warehouse = function Warehouse(_ref) { + /* harmony default export */ var Demo = (function (_ref) { var taskId = _ref.taskId, taskData = _ref.taskData, @@ -6654,12 +6659,74 @@ var Warehouse = function Warehouse(_ref) { return "https://latexjs.educoder.net/index.html?id=".concat(taskData === null || taskData === void 0 ? void 0 : (_taskData$shixun = taskData.shixun) === null || _taskData$shixun === void 0 ? void 0 : _taskData$shixun.identifier, "&path=").concat(path, "&taskId=").concat(taskId, "&myshixunId=").concat(taskData === null || taskData === void 0 ? void 0 : (_taskData$myshixun = taskData.myshixun) === null || _taskData$myshixun === void 0 ? void 0 : _taskData$myshixun.identifier, "&token=").concat((0,util/* getCookie */.ej)("_educoder_session")); } }, [taskData]); + var test1 = function test1() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "get", + params: { + id: 1, + name: undefined, + age: null, + c: { + a: 112 + }, + aa: [], + test: "12321313", + b: "" + } + }); + }; + var test2 = function test2() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "get", + params: {} + }); + }; + var test3 = function test3() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "post", + body: { + id: 1, + name: undefined, + age: null, + c: {}, + cc: { + n: 1, + p: 22 + }, + aa: [], + dd: ["SDafadsf", "&&"], + test: "12321313", + b: "sadfjsdfjdkljflsajflasf&&&fdsahfasfasfasdfsadf" + } + }); + }; + var test4 = function test4() { + (0,fetch/* default */.ZP)("/api/home/test_sign.json", { + method: "post" + // body:{ + + // } + }); + }; + return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, { style: { height: "100vh" }, ref: codeAreaContainerRef, - children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, { + children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test1, + children: "get\u6D4B\u8BD51" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test2, + children: "get\u6D4B\u8BD52" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test3, + children: "post1" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, { + onClick: test4, + children: "post2" + }), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, { flex: "1", children: (taskData === null || taskData === void 0 ? void 0 : taskData.shixun) && /*#__PURE__*/(0,jsx_runtime.jsx)(Demo_Warehouse, { taskId: taskId, diff --git a/umi.js b/umi.js index 9cda8a13b1..6cb5440aa5 100644 --- a/umi.js +++ b/umi.js @@ -39906,7 +39906,7 @@ var CompetitionsModel = { per_page: 20, category: "" }, - competition_title: '竞赛组织', + competition_title: '', banner: '', competitions: [], count: ''