@pisell/private-materials 6.0.2 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/workSpaceList/components/AppearanceEdit/Color.less +1 -0
- package/es/components/workSpaceList/components/AppearanceEdit/IconPanel.d.ts +1 -0
- package/es/components/workSpaceList/components/AppearanceEdit/IconPanel.js +4 -0
- package/es/components/workSpaceList/components/Card/constants.js +11 -9
- package/es/components/workSpaceList/components/Card/index.js +6 -2
- package/es/components/workSpaceList/components/SearchBar/index.js +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.js +3 -2
- package/es/components/workSpaceList/components/WorkspaceItem/index.js +7 -4
- package/es/components/workSpaceList/index.js +9 -6
- package/es/components/workSpaceList/index.less +3 -0
- package/es/components/workSpaceList/server.js +1 -1
- package/es/components/workSpaceListDetail/index.js +6 -2
- package/lib/components/workSpaceList/components/AppearanceEdit/Color.less +1 -0
- package/lib/components/workSpaceList/components/AppearanceEdit/IconPanel.d.ts +1 -0
- package/lib/components/workSpaceList/components/AppearanceEdit/IconPanel.js +1 -0
- package/lib/components/workSpaceList/components/Card/constants.js +9 -9
- package/lib/components/workSpaceList/components/Card/index.js +4 -2
- package/lib/components/workSpaceList/components/SearchBar/index.js +5 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.js +3 -3
- package/lib/components/workSpaceList/components/WorkspaceItem/index.js +8 -4
- package/lib/components/workSpaceList/index.js +11 -5
- package/lib/components/workSpaceList/index.less +3 -0
- package/lib/components/workSpaceList/server.js +1 -1
- package/lib/components/workSpaceListDetail/index.js +15 -13
- package/package.json +3 -3
@@ -15,6 +15,10 @@ import { useControllableValue } from 'ahooks';
|
|
15
15
|
import { Space } from 'antd';
|
16
16
|
import cs from 'classnames';
|
17
17
|
import { useState } from 'react';
|
18
|
+
import "./IconPanel.less";
|
19
|
+
|
20
|
+
// 面板
|
21
|
+
|
18
22
|
var IconPanel = function IconPanel(props) {
|
19
23
|
var color = props.color,
|
20
24
|
name = props.name,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { Edit03, MagicWand02
|
2
|
+
import { Edit03, MagicWand02 } from '@pisell/icon';
|
3
3
|
export var items = [{
|
4
4
|
key: 'rename',
|
5
5
|
label: 'Rename base',
|
@@ -26,7 +26,7 @@ export var items = [{
|
|
26
26
|
key: 'customize',
|
27
27
|
label: 'Customize appearance',
|
28
28
|
icon: /*#__PURE__*/React.createElement(MagicWand02, null)
|
29
|
-
}
|
29
|
+
}
|
30
30
|
// {
|
31
31
|
// type: 'divider',
|
32
32
|
// },
|
@@ -35,10 +35,12 @@ export var items = [{
|
|
35
35
|
// label: 'Settings',
|
36
36
|
// icon: <SettingOutlined />,
|
37
37
|
// },
|
38
|
-
{
|
39
|
-
|
40
|
-
},
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
// {
|
39
|
+
// type: 'divider',
|
40
|
+
// },
|
41
|
+
// {
|
42
|
+
// key: 'delete',
|
43
|
+
// label: 'Delete base',
|
44
|
+
// icon: <Trash01 />,
|
45
|
+
// },
|
46
|
+
];
|
@@ -15,6 +15,7 @@ import { antdConfirmPromise } from "./../Modal/antdConfirmPromise";
|
|
15
15
|
import { items } from "./../Card/constants";
|
16
16
|
import EditableString from "./../EditableString";
|
17
17
|
import { EllipsisOutlined } from '@ant-design/icons';
|
18
|
+
import useEngineContext from "./../../../../hooks/useEngineContext";
|
18
19
|
import { Dropdown, Input, Popover, Select, Space, Switch } from '@pisell/materials';
|
19
20
|
import { isFunction } from '@pisell/utils';
|
20
21
|
import React, { useMemo, useRef, useState } from 'react';
|
@@ -67,6 +68,8 @@ var Card = function Card(props) {
|
|
67
68
|
id = props.id,
|
68
69
|
onDeleteBase = props.onDeleteBase,
|
69
70
|
onUpdateBase = props.onUpdateBase;
|
71
|
+
var context = useEngineContext();
|
72
|
+
var pushV2AdminPage = context.appHelper.utils.getApp().history.pushV2AdminPage;
|
70
73
|
var _useState = useState(false),
|
71
74
|
_useState2 = _slicedToArray(_useState, 2),
|
72
75
|
editing = _useState2[0],
|
@@ -233,9 +236,10 @@ var Card = function Card(props) {
|
|
233
236
|
};
|
234
237
|
}();
|
235
238
|
var handleCardClick = function handleCardClick() {
|
236
|
-
|
237
|
-
window.location.reload();
|
239
|
+
pushV2AdminPage("/lowcode/".concat(id));
|
240
|
+
// window.location.reload();
|
238
241
|
};
|
242
|
+
|
239
243
|
return /*#__PURE__*/React.createElement(Popover, {
|
240
244
|
placement: "bottomLeft",
|
241
245
|
content: content,
|
@@ -75,6 +75,7 @@ var SearchBar = function SearchBar(props) {
|
|
75
75
|
var handleGoBack = function handleGoBack() {
|
76
76
|
window.history.back();
|
77
77
|
};
|
78
|
+
console.log('%c [ onDelete ]-80', 'font-size:13px; background:pink; color:#bf2c9f;', onDelete);
|
78
79
|
var onDropdownClick = /*#__PURE__*/function () {
|
79
80
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
80
81
|
var key;
|
@@ -65,6 +65,7 @@ var Search = function Search() {
|
|
65
65
|
manual: true,
|
66
66
|
debounceWait: 300
|
67
67
|
}),
|
68
|
+
run = _useRequest.run,
|
68
69
|
data = _useRequest.data;
|
69
70
|
var handleSearch = /*#__PURE__*/function () {
|
70
71
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchText) {
|
@@ -78,7 +79,7 @@ var Search = function Search() {
|
|
78
79
|
return _context.abrupt("return");
|
79
80
|
case 2:
|
80
81
|
_context.next = 4;
|
81
|
-
return
|
82
|
+
return run({
|
82
83
|
tenant_id: '0',
|
83
84
|
search: searchText
|
84
85
|
});
|
@@ -93,7 +94,7 @@ var Search = function Search() {
|
|
93
94
|
};
|
94
95
|
}();
|
95
96
|
useEffect(function () {
|
96
|
-
var _ref2 = data
|
97
|
+
var _ref2 = data || {},
|
97
98
|
workspace = _ref2.workspace,
|
98
99
|
base = _ref2.base;
|
99
100
|
if (workspace !== null && workspace !== void 0 && workspace.length || base !== null && base !== void 0 && base.length) {
|
@@ -26,7 +26,8 @@ var WorkspaceItem = function WorkspaceItem(props) {
|
|
26
26
|
data = props.data,
|
27
27
|
describe = props.describe,
|
28
28
|
isDetail = props.isDetail,
|
29
|
-
id = props.id,
|
29
|
+
_props$id = props.id,
|
30
|
+
id = _props$id === void 0 ? 0 : _props$id,
|
30
31
|
onSort = props.onSort,
|
31
32
|
onAddBase = props.onAddBase,
|
32
33
|
loading = props.loading,
|
@@ -43,16 +44,18 @@ var WorkspaceItem = function WorkspaceItem(props) {
|
|
43
44
|
_useState2 = _slicedToArray(_useState, 2),
|
44
45
|
editingTitle = _useState2[0],
|
45
46
|
setEditingTitle = _useState2[1];
|
46
|
-
var
|
47
|
-
var tenant_id = params.get('tenant_id') || '0';
|
47
|
+
var tenant_id = '0';
|
48
48
|
useEffect(function () {
|
49
49
|
if (searchParams.get('create') === 'true') {
|
50
50
|
setEditingTitle(true);
|
51
51
|
}
|
52
52
|
}, [searchParams]);
|
53
53
|
var handleDetailClick = function handleDetailClick() {
|
54
|
-
|
54
|
+
console.log('%c [ ]-56', 'font-size:13px; background:pink; color:#bf2c9f;', context.appHelper.utils.getApp());
|
55
|
+
context.appHelper.utils.getApp().history.push("/workspaces/".concat(id));
|
56
|
+
// window.location.href = `/workspaces/${tenant_id}/detail/${id}`;
|
55
57
|
};
|
58
|
+
|
56
59
|
var handleDelete = /*#__PURE__*/function () {
|
57
60
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
58
61
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -49,7 +49,7 @@ var SearchBar = function SearchBar(props) {
|
|
49
49
|
onChange: onSort
|
50
50
|
})));
|
51
51
|
};
|
52
|
-
var defaultSize =
|
52
|
+
var defaultSize = 15;
|
53
53
|
var WorkspacesList = function WorkspacesList() {
|
54
54
|
var _useState = useState(''),
|
55
55
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -95,7 +95,7 @@ var WorkspacesList = function WorkspacesList() {
|
|
95
95
|
}
|
96
96
|
_data$list = data.list, list = _data$list === void 0 ? [] : _data$list, _data$count = data.count, count = _data$count === void 0 ? 0 : _data$count;
|
97
97
|
return _context.abrupt("return", {
|
98
|
-
tenant_id:
|
98
|
+
tenant_id: 0,
|
99
99
|
list: list,
|
100
100
|
page: newParams.page + 1,
|
101
101
|
size: newParams.size,
|
@@ -141,7 +141,8 @@ var WorkspacesList = function WorkspacesList() {
|
|
141
141
|
var _useRequest2 = useRequest(addWorkspace, {
|
142
142
|
manual: true
|
143
143
|
}),
|
144
|
-
run = _useRequest2.run
|
144
|
+
run = _useRequest2.run,
|
145
|
+
runAsync = _useRequest2.runAsync;
|
145
146
|
var add = useRequest(addBase, {
|
146
147
|
manual: true
|
147
148
|
});
|
@@ -155,18 +156,20 @@ var WorkspacesList = function WorkspacesList() {
|
|
155
156
|
}, [sort, refreshKey]);
|
156
157
|
var handleAdd = /*#__PURE__*/function () {
|
157
158
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
159
|
+
var _workspace$data;
|
158
160
|
var workspace;
|
159
161
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
160
162
|
while (1) switch (_context2.prev = _context2.next) {
|
161
163
|
case 0:
|
162
164
|
_context2.next = 2;
|
163
|
-
return
|
165
|
+
return runAsync({
|
164
166
|
tenant_id: Number(tenant_id)
|
165
167
|
});
|
166
168
|
case 2:
|
167
169
|
workspace = _context2.sent;
|
168
|
-
|
169
|
-
|
170
|
+
console.log('%c [ workspace ]-143', 'font-size:13px; background:pink; color:#bf2c9f;', workspace);
|
171
|
+
window.location.href = "/workspaces/".concat((workspace === null || workspace === void 0 ? void 0 : (_workspace$data = workspace.data) === null || _workspace$data === void 0 ? void 0 : _workspace$data.id) || '0', "?create=true");
|
172
|
+
case 5:
|
170
173
|
case "end":
|
171
174
|
return _context2.stop();
|
172
175
|
}
|
@@ -89,7 +89,7 @@ export var updateWorkspace = /*#__PURE__*/function () {
|
|
89
89
|
while (1) switch (_context4.prev = _context4.next) {
|
90
90
|
case 0:
|
91
91
|
id = params.id, others = _objectWithoutProperties(params, _excluded);
|
92
|
-
return _context4.abrupt("return", request.getRequest().
|
92
|
+
return _context4.abrupt("return", request.getRequest().put("/workspace/".concat(id), others));
|
93
93
|
case 2:
|
94
94
|
case "end":
|
95
95
|
return _context4.stop();
|
@@ -15,14 +15,18 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
16
16
|
import React from 'react';
|
17
17
|
import WorkspaceItem from "./../workSpaceList/components/WorkspaceItem";
|
18
|
+
import useEngineContext from "./../../hooks/useEngineContext";
|
18
19
|
import { useRef, useState } from 'react';
|
19
20
|
import "./index.less";
|
20
21
|
import { getWorkspaceDetail, getBaseList, deleteBaseDetail, updateBaseDetail, addBase } from "./../workSpaceList/server";
|
21
22
|
import { useRequest } from 'ahooks';
|
22
23
|
var defaultSize = 50;
|
23
24
|
var workSpaceListDetail = function workSpaceListDetail() {
|
24
|
-
var
|
25
|
-
var
|
25
|
+
var context = useEngineContext();
|
26
|
+
var useParams = context.appHelper.utils.getApp().history.useParams;
|
27
|
+
var _useParams = useParams(),
|
28
|
+
_useParams$id = _useParams.id,
|
29
|
+
id = _useParams$id === void 0 ? 0 : _useParams$id;
|
26
30
|
var _useState = useState(''),
|
27
31
|
_useState2 = _slicedToArray(_useState, 2),
|
28
32
|
order_by = _useState2[0],
|
@@ -39,6 +39,7 @@ var import_ahooks = require("ahooks");
|
|
39
39
|
var import_antd = require("antd");
|
40
40
|
var import_classnames = __toESM(require("classnames"));
|
41
41
|
var import_react = require("react");
|
42
|
+
var import_IconPanel = require("./IconPanel.less");
|
42
43
|
var IconPanel = (props) => {
|
43
44
|
const { color, name, value } = props;
|
44
45
|
const [state, setState] = (0, import_ahooks.useControllableValue)(props);
|
@@ -61,7 +61,7 @@ var items = [
|
|
61
61
|
key: "customize",
|
62
62
|
label: "Customize appearance",
|
63
63
|
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.MagicWand02, null)
|
64
|
-
}
|
64
|
+
}
|
65
65
|
// {
|
66
66
|
// type: 'divider',
|
67
67
|
// },
|
@@ -70,14 +70,14 @@ var items = [
|
|
70
70
|
// label: 'Settings',
|
71
71
|
// icon: <SettingOutlined />,
|
72
72
|
// },
|
73
|
-
{
|
74
|
-
|
75
|
-
},
|
76
|
-
{
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
73
|
+
// {
|
74
|
+
// type: 'divider',
|
75
|
+
// },
|
76
|
+
// {
|
77
|
+
// key: 'delete',
|
78
|
+
// label: 'Delete base',
|
79
|
+
// icon: <Trash01 />,
|
80
|
+
// },
|
81
81
|
];
|
82
82
|
// Annotate the CommonJS export names for ESM import in node:
|
83
83
|
0 && (module.exports = {
|
@@ -39,6 +39,7 @@ var import_antdConfirmPromise = require("./../Modal/antdConfirmPromise");
|
|
39
39
|
var import_constants = require("./../Card/constants");
|
40
40
|
var import_EditableString = __toESM(require("./../EditableString"));
|
41
41
|
var import_icons = require("@ant-design/icons");
|
42
|
+
var import_useEngineContext = __toESM(require("./../../../../hooks/useEngineContext"));
|
42
43
|
var import_materials = require("@pisell/materials");
|
43
44
|
var import_utils = require("@pisell/utils");
|
44
45
|
var import_react = __toESM(require("react"));
|
@@ -82,6 +83,8 @@ var Card = (props) => {
|
|
82
83
|
onDeleteBase,
|
83
84
|
onUpdateBase
|
84
85
|
} = props;
|
86
|
+
const context = (0, import_useEngineContext.default)();
|
87
|
+
const { pushV2AdminPage } = context.appHelper.utils.getApp().history;
|
85
88
|
const [editing, setEditing] = (0, import_react.useState)(false);
|
86
89
|
const [open, setOpen] = (0, import_react.useState)(false);
|
87
90
|
const [popoverOpen, setPopoverOpen] = (0, import_react.useState)(false);
|
@@ -167,8 +170,7 @@ var Card = (props) => {
|
|
167
170
|
}
|
168
171
|
};
|
169
172
|
const handleCardClick = () => {
|
170
|
-
|
171
|
-
window.location.reload();
|
173
|
+
pushV2AdminPage(`/lowcode/${id}`);
|
172
174
|
};
|
173
175
|
return /* @__PURE__ */ import_react.default.createElement(
|
174
176
|
import_materials.Popover,
|
@@ -95,6 +95,11 @@ var SearchBar = (props) => {
|
|
95
95
|
const handleGoBack = () => {
|
96
96
|
window.history.back();
|
97
97
|
};
|
98
|
+
console.log(
|
99
|
+
"%c [ onDelete ]-80",
|
100
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
101
|
+
onDelete
|
102
|
+
);
|
98
103
|
const onDropdownClick = async ({ key }) => {
|
99
104
|
if (key === "rename") {
|
100
105
|
setEditingTitle(true);
|
@@ -67,20 +67,20 @@ var Search = () => {
|
|
67
67
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
68
68
|
const [options, setOptions] = (0, import_react2.useState)([]);
|
69
69
|
const searchParams = new URLSearchParams(window.location.search);
|
70
|
-
const { data } = (0, import_ahooks.useRequest)(import_server.searchWorkspace, {
|
70
|
+
const { run, data } = (0, import_ahooks.useRequest)(import_server.searchWorkspace, {
|
71
71
|
manual: true,
|
72
72
|
debounceWait: 300
|
73
73
|
});
|
74
74
|
const handleSearch = async (searchText) => {
|
75
75
|
if (!searchText)
|
76
76
|
return;
|
77
|
-
await
|
77
|
+
await run({
|
78
78
|
tenant_id: "0",
|
79
79
|
search: searchText
|
80
80
|
});
|
81
81
|
};
|
82
82
|
(0, import_react2.useEffect)(() => {
|
83
|
-
const { workspace, base } = data
|
83
|
+
const { workspace, base } = data || {};
|
84
84
|
if ((workspace == null ? void 0 : workspace.length) || (base == null ? void 0 : base.length)) {
|
85
85
|
const newOptions = [
|
86
86
|
{
|
@@ -51,7 +51,7 @@ var WorkspaceItem = (props) => {
|
|
51
51
|
data,
|
52
52
|
describe,
|
53
53
|
isDetail,
|
54
|
-
id,
|
54
|
+
id = 0,
|
55
55
|
onSort,
|
56
56
|
onAddBase,
|
57
57
|
loading,
|
@@ -66,15 +66,19 @@ var WorkspaceItem = (props) => {
|
|
66
66
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
67
67
|
const searchParams = new URLSearchParams(window.location.search);
|
68
68
|
const [editingTitle, setEditingTitle] = (0, import_react.useState)(false);
|
69
|
-
const
|
70
|
-
const tenant_id = params.get("tenant_id") || "0";
|
69
|
+
const tenant_id = "0";
|
71
70
|
(0, import_react.useEffect)(() => {
|
72
71
|
if (searchParams.get("create") === "true") {
|
73
72
|
setEditingTitle(true);
|
74
73
|
}
|
75
74
|
}, [searchParams]);
|
76
75
|
const handleDetailClick = () => {
|
77
|
-
|
76
|
+
console.log(
|
77
|
+
"%c [ ]-56",
|
78
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
79
|
+
context.appHelper.utils.getApp()
|
80
|
+
);
|
81
|
+
context.appHelper.utils.getApp().history.push(`/workspaces/${id}`);
|
78
82
|
};
|
79
83
|
const handleDelete = async () => {
|
80
84
|
await (0, import_server.deleteWorkspace)(id);
|
@@ -48,7 +48,7 @@ var SearchBar = (props) => {
|
|
48
48
|
const { title, onAddWorkspace, onSort } = props;
|
49
49
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "search-bar-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "line-1" }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("span", { className: "title" }, title)), /* @__PURE__ */ import_react.default.createElement(import_materials.Space, { size: 24 }, /* @__PURE__ */ import_react.default.createElement(import_SearchWorkspaceAndBase.default, null), /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { type: "primary", onClick: onAddWorkspace }, "Create a workspace"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "line-2" }, /* @__PURE__ */ import_react.default.createElement(import_Sort.default, { onChange: onSort })));
|
50
50
|
};
|
51
|
-
var defaultSize =
|
51
|
+
var defaultSize = 15;
|
52
52
|
var WorkspacesList = () => {
|
53
53
|
const [sort, setSort] = (0, import_react2.useState)("");
|
54
54
|
const [refreshKey, setRefreshKey] = (0, import_react2.useState)({});
|
@@ -77,7 +77,7 @@ var WorkspacesList = () => {
|
|
77
77
|
if (code === 200) {
|
78
78
|
const { list = [], count = 0 } = data2;
|
79
79
|
return {
|
80
|
-
tenant_id:
|
80
|
+
tenant_id: 0,
|
81
81
|
list,
|
82
82
|
page: newParams.page + 1,
|
83
83
|
size: newParams.size,
|
@@ -112,7 +112,7 @@ var WorkspacesList = () => {
|
|
112
112
|
refreshDeps: [sort, refreshKey]
|
113
113
|
}
|
114
114
|
);
|
115
|
-
const { run } = (0, import_ahooks.useRequest)(import_server.addWorkspace, {
|
115
|
+
const { run, runAsync } = (0, import_ahooks.useRequest)(import_server.addWorkspace, {
|
116
116
|
manual: true
|
117
117
|
});
|
118
118
|
const add = (0, import_ahooks.useRequest)(import_server.addBase, {
|
@@ -121,10 +121,16 @@ var WorkspacesList = () => {
|
|
121
121
|
(0, import_react2.useEffect)(() => {
|
122
122
|
}, [sort, refreshKey]);
|
123
123
|
const handleAdd = async () => {
|
124
|
-
|
124
|
+
var _a;
|
125
|
+
const workspace = await runAsync({
|
125
126
|
tenant_id: Number(tenant_id)
|
126
127
|
});
|
127
|
-
|
128
|
+
console.log(
|
129
|
+
"%c [ workspace ]-143",
|
130
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
131
|
+
workspace
|
132
|
+
);
|
133
|
+
window.location.href = `/workspaces/${((_a = workspace == null ? void 0 : workspace.data) == null ? void 0 : _a.id) || "0"}?create=true`;
|
128
134
|
};
|
129
135
|
const handleSort = (val) => {
|
130
136
|
setSort((val == null ? void 0 : val[0]) || "");
|
@@ -46,7 +46,7 @@ var addWorkspace = async (params) => {
|
|
46
46
|
};
|
47
47
|
var updateWorkspace = async (params) => {
|
48
48
|
const { id, ...others } = params;
|
49
|
-
return import_utils.request.getRequest().
|
49
|
+
return import_utils.request.getRequest().put(`/workspace/${id}`, others);
|
50
50
|
};
|
51
51
|
var getWorkspaceDetail = async (id) => {
|
52
52
|
return import_utils.request.getRequest().get(`/workspace/${id}`, {});
|
@@ -34,14 +34,16 @@ __export(workSpaceListDetail_exports, {
|
|
34
34
|
module.exports = __toCommonJS(workSpaceListDetail_exports);
|
35
35
|
var import_react = __toESM(require("react"));
|
36
36
|
var import_WorkspaceItem = __toESM(require("./../workSpaceList/components/WorkspaceItem"));
|
37
|
+
var import_useEngineContext = __toESM(require("./../../hooks/useEngineContext"));
|
37
38
|
var import_react2 = require("react");
|
38
39
|
var import_index = require("./index.less");
|
39
40
|
var import_server = require("./../workSpaceList/server");
|
40
41
|
var import_ahooks = require("ahooks");
|
41
42
|
var defaultSize = 50;
|
42
43
|
var workSpaceListDetail = () => {
|
43
|
-
const
|
44
|
-
const
|
44
|
+
const context = (0, import_useEngineContext.default)();
|
45
|
+
const { useParams } = context.appHelper.utils.getApp().history;
|
46
|
+
const { id = 0 } = useParams();
|
45
47
|
const [order_by, setOrder_by] = (0, import_react2.useState)("");
|
46
48
|
const [refreshKey, setRefreshKey] = (0, import_react2.useState)({});
|
47
49
|
const scrollRef = (0, import_react2.useRef)(null);
|
@@ -54,8 +56,8 @@ var workSpaceListDetail = () => {
|
|
54
56
|
loading,
|
55
57
|
mutate
|
56
58
|
} = (0, import_ahooks.useRequest)(
|
57
|
-
async (
|
58
|
-
const newParams =
|
59
|
+
async (params) => {
|
60
|
+
const newParams = params || {
|
59
61
|
workspace_id: Number(id),
|
60
62
|
page: 1,
|
61
63
|
size: defaultSize,
|
@@ -112,8 +114,8 @@ var workSpaceListDetail = () => {
|
|
112
114
|
const handleSort = (val) => {
|
113
115
|
setOrder_by((val == null ? void 0 : val[0]) || "");
|
114
116
|
};
|
115
|
-
const handleAddBase = async (
|
116
|
-
const { name: name2, color, icon } =
|
117
|
+
const handleAddBase = async (params) => {
|
118
|
+
const { name: name2, color, icon } = params;
|
117
119
|
await add.run({
|
118
120
|
name: name2,
|
119
121
|
color,
|
@@ -132,13 +134,13 @@ var workSpaceListDetail = () => {
|
|
132
134
|
});
|
133
135
|
await (0, import_server.deleteBaseDetail)(id2);
|
134
136
|
};
|
135
|
-
const handleUpdateBase = async (
|
137
|
+
const handleUpdateBase = async (params) => {
|
136
138
|
mutate((oldBase) => {
|
137
139
|
const newList = oldBase.list.map((item) => {
|
138
|
-
if (item.id ===
|
140
|
+
if (item.id === params.id) {
|
139
141
|
return {
|
140
142
|
...item,
|
141
|
-
...
|
143
|
+
...params
|
142
144
|
};
|
143
145
|
}
|
144
146
|
return item;
|
@@ -149,10 +151,10 @@ var workSpaceListDetail = () => {
|
|
149
151
|
};
|
150
152
|
});
|
151
153
|
await (0, import_server.updateBaseDetail)({
|
152
|
-
id:
|
153
|
-
color:
|
154
|
-
icon:
|
155
|
-
name:
|
154
|
+
id: params.id,
|
155
|
+
color: params == null ? void 0 : params.color,
|
156
|
+
icon: params == null ? void 0 : params.icon,
|
157
|
+
name: params == null ? void 0 : params.name
|
156
158
|
});
|
157
159
|
};
|
158
160
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "workspace-detail-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pisell/private-materials",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.4",
|
4
4
|
"main": "./lib/index.js",
|
5
5
|
"module": "./es/index.js",
|
6
6
|
"types": "./lib/index.d.ts",
|
@@ -59,9 +59,9 @@
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
61
61
|
"decimal.js": "^10.4.3",
|
62
|
-
"@pisell/icon": "0.0.11",
|
63
62
|
"@pisell/utils": "1.0.42",
|
64
|
-
"@pisell/materials": "6.0.
|
63
|
+
"@pisell/materials": "6.0.3",
|
64
|
+
"@pisell/icon": "0.0.11",
|
65
65
|
"@pisell/date-picker": "1.0.100"
|
66
66
|
},
|
67
67
|
"peerDependencies": {
|