@steedos-widgets/amis-object 6.3.12-beta.8 → 6.10.1-beta.8
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/dist/amis/AmisAppMenu.d.ts +1 -0
- package/dist/amis-object.cjs.css +18 -2
- package/dist/amis-object.cjs.js +548 -458
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +18 -2
- package/dist/amis-object.esm.js +579 -489
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +18 -2
- package/dist/amis-object.umd.js +1468 -1494
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets-dev.json +0 -8
- package/dist/assets.json +19 -27
- package/dist/components/Dropdown/index.d.ts +1 -1
- package/dist/components/FromNow.d.ts +2 -2
- package/dist/components/SteedosBadge.d.ts +2 -2
- package/dist/components/SteedosBadgeRibbon.d.ts +2 -2
- package/dist/components/SteedosFieldSet.d.ts +1 -1
- package/dist/components/SteedosIcon.d.ts +2 -2
- package/dist/components/SteedosLoading.d.ts +2 -2
- package/dist/components/SteedosObject.d.ts +1 -1
- package/dist/components/SteedosSkeleton.d.ts +2 -2
- package/dist/components/buttons/button.d.ts +2 -2
- package/dist/components/buttons/dropdown-button.d.ts +2 -2
- package/dist/components/fields/AmisObjectFieldLookup.d.ts +2 -2
- package/dist/meta.js +6933 -6917
- package/dist/pages/PageListView.d.ts +3 -6
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -12,159 +12,165 @@ var ReactDOM = require('react-dom');
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
14
14
|
function _interopNamespace(e) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
}
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
26
24
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n["default"] = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
33
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
34
|
var _$1__namespace = /*#__PURE__*/_interopNamespace(_$1);
|
|
34
35
|
var _$1__default = /*#__PURE__*/_interopDefaultLegacy(_$1);
|
|
35
36
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
36
37
|
|
|
37
|
-
/******************************************************************************
|
|
38
|
-
Copyright (c) Microsoft Corporation.
|
|
39
|
-
|
|
40
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
41
|
-
purpose with or without fee is hereby granted.
|
|
42
|
-
|
|
43
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
44
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
45
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
46
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
47
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
48
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
49
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
50
|
-
***************************************************************************** */
|
|
51
|
-
/* global Reflect, Promise */
|
|
52
|
-
|
|
53
|
-
var extendStatics = function(d, b) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
function __extends(d, b) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var __assign$2 = function() {
|
|
69
|
-
__assign$2 = Object.assign || function __assign(t) {
|
|
70
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
71
|
-
s = arguments[i];
|
|
72
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
73
|
-
}
|
|
74
|
-
return t;
|
|
75
|
-
};
|
|
76
|
-
return __assign$2.apply(this, arguments);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
function __rest(s, e) {
|
|
80
|
-
var t = {};
|
|
81
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
82
|
-
t[p] = s[p];
|
|
83
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
84
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
85
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
86
|
-
t[p[i]] = s[p[i]];
|
|
87
|
-
}
|
|
88
|
-
return t;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
92
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
93
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
94
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
95
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
96
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
97
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function __generator(thisArg, body) {
|
|
102
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
103
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
104
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
105
|
-
function step(op) {
|
|
106
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
107
|
-
while (_) try {
|
|
108
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
109
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
110
|
-
switch (op[0]) {
|
|
111
|
-
case 0: case 1: t = op; break;
|
|
112
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
113
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
114
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
115
|
-
default:
|
|
116
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
117
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
118
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
119
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
120
|
-
if (t[2]) _.ops.pop();
|
|
121
|
-
_.trys.pop(); continue;
|
|
122
|
-
}
|
|
123
|
-
op = body.call(thisArg, _);
|
|
124
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
125
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function __values(o) {
|
|
130
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
131
|
-
if (m) return m.call(o);
|
|
132
|
-
if (o && typeof o.length === "number") return {
|
|
133
|
-
next: function () {
|
|
134
|
-
if (o && i >= o.length) o = void 0;
|
|
135
|
-
return { value: o && o[i++], done: !o };
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function __read(o, n) {
|
|
142
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
143
|
-
if (!m) return o;
|
|
144
|
-
var i = m.call(o), r, ar = [], e;
|
|
145
|
-
try {
|
|
146
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
147
|
-
}
|
|
148
|
-
catch (error) { e = { error: error }; }
|
|
149
|
-
finally {
|
|
150
|
-
try {
|
|
151
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
152
|
-
}
|
|
153
|
-
finally { if (e) throw e.error; }
|
|
154
|
-
}
|
|
155
|
-
return ar;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function __spreadArray(to, from, pack) {
|
|
159
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
160
|
-
if (ar || !(i in from)) {
|
|
161
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
162
|
-
ar[i] = from[i];
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38
|
+
/******************************************************************************
|
|
39
|
+
Copyright (c) Microsoft Corporation.
|
|
40
|
+
|
|
41
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
42
|
+
purpose with or without fee is hereby granted.
|
|
43
|
+
|
|
44
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
45
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
46
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
47
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
48
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
49
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
50
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
51
|
+
***************************************************************************** */
|
|
52
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
53
|
+
|
|
54
|
+
var extendStatics = function(d, b) {
|
|
55
|
+
extendStatics = Object.setPrototypeOf ||
|
|
56
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
57
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
58
|
+
return extendStatics(d, b);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
function __extends(d, b) {
|
|
62
|
+
if (typeof b !== "function" && b !== null)
|
|
63
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
64
|
+
extendStatics(d, b);
|
|
65
|
+
function __() { this.constructor = d; }
|
|
66
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
166
67
|
}
|
|
167
68
|
|
|
69
|
+
var __assign$2 = function() {
|
|
70
|
+
__assign$2 = Object.assign || function __assign(t) {
|
|
71
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
72
|
+
s = arguments[i];
|
|
73
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
74
|
+
}
|
|
75
|
+
return t;
|
|
76
|
+
};
|
|
77
|
+
return __assign$2.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
function __rest(s, e) {
|
|
81
|
+
var t = {};
|
|
82
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
83
|
+
t[p] = s[p];
|
|
84
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
85
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
86
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
87
|
+
t[p[i]] = s[p[i]];
|
|
88
|
+
}
|
|
89
|
+
return t;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
93
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
94
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
95
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
96
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
97
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
98
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function __generator(thisArg, body) {
|
|
103
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
104
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
105
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
106
|
+
function step(op) {
|
|
107
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
108
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
109
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
110
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
111
|
+
switch (op[0]) {
|
|
112
|
+
case 0: case 1: t = op; break;
|
|
113
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
114
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
115
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
116
|
+
default:
|
|
117
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
118
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
119
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
120
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
121
|
+
if (t[2]) _.ops.pop();
|
|
122
|
+
_.trys.pop(); continue;
|
|
123
|
+
}
|
|
124
|
+
op = body.call(thisArg, _);
|
|
125
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
126
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function __values(o) {
|
|
131
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
132
|
+
if (m) return m.call(o);
|
|
133
|
+
if (o && typeof o.length === "number") return {
|
|
134
|
+
next: function () {
|
|
135
|
+
if (o && i >= o.length) o = void 0;
|
|
136
|
+
return { value: o && o[i++], done: !o };
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function __read(o, n) {
|
|
143
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
144
|
+
if (!m) return o;
|
|
145
|
+
var i = m.call(o), r, ar = [], e;
|
|
146
|
+
try {
|
|
147
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
148
|
+
}
|
|
149
|
+
catch (error) { e = { error: error }; }
|
|
150
|
+
finally {
|
|
151
|
+
try {
|
|
152
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
153
|
+
}
|
|
154
|
+
finally { if (e) throw e.error; }
|
|
155
|
+
}
|
|
156
|
+
return ar;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function __spreadArray(to, from, pack) {
|
|
160
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
161
|
+
if (ar || !(i in from)) {
|
|
162
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
163
|
+
ar[i] = from[i];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
170
|
+
var e = new Error(message);
|
|
171
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
172
|
+
};
|
|
173
|
+
|
|
168
174
|
function _typeof$1(obj) {
|
|
169
175
|
"@babel/helpers - typeof";
|
|
170
176
|
|
|
@@ -4412,7 +4418,7 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
|
|
|
4412
4418
|
* @Author: baozhoutao@steedos.com
|
|
4413
4419
|
* @Date: 2022-10-28 14:15:09
|
|
4414
4420
|
* @LastEditors: baozhoutao@steedos.com
|
|
4415
|
-
* @LastEditTime:
|
|
4421
|
+
* @LastEditTime: 2025-02-13 09:31:02
|
|
4416
4422
|
* @Description:
|
|
4417
4423
|
*/
|
|
4418
4424
|
|
|
@@ -4471,7 +4477,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4471
4477
|
"title": " ",
|
|
4472
4478
|
"headerClassName": "hidden",
|
|
4473
4479
|
"size": "lg",
|
|
4474
|
-
"width": "70%",
|
|
4480
|
+
"width": window.drawerWidth || "70%",
|
|
4475
4481
|
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
4476
4482
|
"closeOnEsc": true,
|
|
4477
4483
|
"closeOnOutside": true,
|
|
@@ -5067,7 +5073,6 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5067
5073
|
{
|
|
5068
5074
|
actionType: "custom",
|
|
5069
5075
|
script: `
|
|
5070
|
-
console.log("asdasd");
|
|
5071
5076
|
let items = _.cloneDeep(event.data.items);
|
|
5072
5077
|
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
5073
5078
|
if(event.data.isBatchEdit){
|
|
@@ -5564,7 +5569,7 @@ async function getColumnItemOnClick(field, options){
|
|
|
5564
5569
|
"title": " ",
|
|
5565
5570
|
"headerClassName": "hidden",
|
|
5566
5571
|
"size": "lg",
|
|
5567
|
-
"width": "70%",
|
|
5572
|
+
"width": window.drawerWidth || "70%",
|
|
5568
5573
|
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
5569
5574
|
"closeOnEsc": true,
|
|
5570
5575
|
"closeOnOutside": true,
|
|
@@ -6608,6 +6613,11 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6608
6613
|
}, 600);
|
|
6609
6614
|
}
|
|
6610
6615
|
}
|
|
6616
|
+
|
|
6617
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
6618
|
+
// lookup字段的弹出列表搜索不受这里影响,因为lookup字段的弹出列表搜索是单独的接口请求
|
|
6619
|
+
payload.data.__changedFilterFormValues = api.context.__changedFilterFormValues;
|
|
6620
|
+
payload.data.__changedSearchBoxValues = api.context.__changedSearchBoxValues;
|
|
6611
6621
|
${options.adaptor || ''}
|
|
6612
6622
|
return payload;
|
|
6613
6623
|
`;
|
|
@@ -6705,6 +6715,7 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6705
6715
|
payload.data.data = [emptyDoc];
|
|
6706
6716
|
}
|
|
6707
6717
|
else{
|
|
6718
|
+
console.log('无法找到记录', api, payload, context)
|
|
6708
6719
|
return {
|
|
6709
6720
|
status: 2,
|
|
6710
6721
|
msg: "${instance.t('frontend_no_records_found')}"
|
|
@@ -6731,13 +6742,12 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6731
6742
|
console.error(e)
|
|
6732
6743
|
}
|
|
6733
6744
|
payload.data = data;
|
|
6734
|
-
payload.data.__objectName = "${object.name}";
|
|
6735
6745
|
payload.data.record = record;
|
|
6736
6746
|
payload.data.NAME_FIELD_VALUE = ${nameLabel} || record.name;
|
|
6737
6747
|
payload.data._master = {
|
|
6738
6748
|
record: record,
|
|
6739
|
-
objectName: "
|
|
6740
|
-
recordId:
|
|
6749
|
+
objectName: "\${objectName}",
|
|
6750
|
+
recordId: "\${recordId}"
|
|
6741
6751
|
}
|
|
6742
6752
|
window.postMessage(Object.assign({type: "record.loaded"}, {record: record}), "*")
|
|
6743
6753
|
}
|
|
@@ -7646,6 +7656,11 @@ var __assign$1 = function() {
|
|
|
7646
7656
|
return t;
|
|
7647
7657
|
};
|
|
7648
7658
|
return __assign$1.apply(this, arguments);
|
|
7659
|
+
};
|
|
7660
|
+
|
|
7661
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
7662
|
+
var e = new Error(message);
|
|
7663
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7649
7664
|
};
|
|
7650
7665
|
|
|
7651
7666
|
/**
|
|
@@ -9339,15 +9354,38 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9339
9354
|
if (!ctx) {
|
|
9340
9355
|
ctx = {};
|
|
9341
9356
|
}
|
|
9357
|
+
const searchableFields = ctx.searchable_fields;
|
|
9358
|
+
const autoOpenFilter = !!ctx.auto_open_filter;
|
|
9342
9359
|
const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
|
|
9343
9360
|
const filterFormSchema = await getObjectFieldsFilterFormSchema(ctx);
|
|
9344
9361
|
const keywordsSearchBoxName = ctx.keywordsSearchBoxName || "__keywords";
|
|
9345
9362
|
const onSearchScript = `
|
|
9346
|
-
|
|
9363
|
+
let isLookup = event.data.isLookup;
|
|
9364
|
+
let __lookupField = event.data.__lookupField;
|
|
9347
9365
|
const scope = event.context.scoped;
|
|
9366
|
+
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
9348
9367
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
9349
9368
|
return n.props.type === "form";
|
|
9350
9369
|
});
|
|
9370
|
+
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取,因为本地存储中的过滤条件自动填充到表单上时filterForm.getValues()拿不到。
|
|
9371
|
+
let filterFormValues = event.data;
|
|
9372
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
9373
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
9374
|
+
// 同步__changedFilterFormValues中的值
|
|
9375
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
9376
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
9377
|
+
if(isLookup && __lookupField){
|
|
9378
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
9379
|
+
if(__lookupField.reference_to_field){
|
|
9380
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
9381
|
+
}
|
|
9382
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
9383
|
+
}
|
|
9384
|
+
if(crud){
|
|
9385
|
+
let crudData = crud.getData();
|
|
9386
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
9387
|
+
crud.setData(crudData);
|
|
9388
|
+
}
|
|
9351
9389
|
filterForm.handleFormSubmit(event);
|
|
9352
9390
|
// var filterFormValues = filterForm.getValues();
|
|
9353
9391
|
// var listView = scope.parent.parent.parent.getComponents().find(function(n){
|
|
@@ -9396,11 +9434,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9396
9434
|
}
|
|
9397
9435
|
filterService.setData({showFieldsFilter});
|
|
9398
9436
|
// resizeWindow();//已迁移到搜索栏表单提交事件中执行,因为表单项change后也会触发表单提交了
|
|
9399
|
-
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取。
|
|
9400
|
-
let filterFormValues = event.data;
|
|
9401
9437
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
9402
|
-
let
|
|
9403
|
-
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
9438
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
9404
9439
|
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter});
|
|
9405
9440
|
`;
|
|
9406
9441
|
const onCancelScript = `
|
|
@@ -9486,10 +9521,12 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9486
9521
|
|
|
9487
9522
|
// 移除搜索按钮上的红点
|
|
9488
9523
|
// let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
9489
|
-
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
9524
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
9490
9525
|
crudService && crudService.setData({isFieldsFilterEmpty: true, showFieldsFilter: false});
|
|
9491
9526
|
`;
|
|
9492
9527
|
const dataProviderInited = `
|
|
9528
|
+
const searchableFields = ${JSON.stringify(searchableFields)};
|
|
9529
|
+
const autoOpenFilter = ${autoOpenFilter};
|
|
9493
9530
|
const objectName = data.objectName;
|
|
9494
9531
|
const isLookup = data.isLookup;
|
|
9495
9532
|
const listName = data.listName;
|
|
@@ -9502,6 +9539,11 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9502
9539
|
if(defaultSearchableFields){
|
|
9503
9540
|
defaultSearchableFields = defaultSearchableFields.split(",");
|
|
9504
9541
|
}
|
|
9542
|
+
if(_.isEmpty(defaultSearchableFields) && searchableFields){
|
|
9543
|
+
if(searchableFields.length){
|
|
9544
|
+
defaultSearchableFields = _.map(searchableFields, 'field');
|
|
9545
|
+
}
|
|
9546
|
+
}
|
|
9505
9547
|
if(_.isEmpty(defaultSearchableFields) && data.uiSchema){
|
|
9506
9548
|
let listView = data.uiSchema.list_views[data.listName];
|
|
9507
9549
|
const sFields = listView && listView.searchable_fields;
|
|
@@ -9520,7 +9562,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9520
9562
|
setData({ filterFormSearchableFields: defaultSearchableFields });
|
|
9521
9563
|
if(isLookup){
|
|
9522
9564
|
// looup字段过滤器不在本地缓存记住过滤条件,所以初始始终隐藏过滤器
|
|
9523
|
-
setData({ showFieldsFilter:
|
|
9565
|
+
setData({ showFieldsFilter: autoOpenFilter });
|
|
9524
9566
|
}
|
|
9525
9567
|
else{
|
|
9526
9568
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
@@ -10785,7 +10827,7 @@ async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ct
|
|
|
10785
10827
|
* @param {*} objectSchema 对象UISchema
|
|
10786
10828
|
* @returns amisSchema
|
|
10787
10829
|
*/
|
|
10788
|
-
function getObjectListHeader
|
|
10830
|
+
function getObjectListHeader(objectSchema, listViewName, ctx) {
|
|
10789
10831
|
if (!ctx) {
|
|
10790
10832
|
ctx = {};
|
|
10791
10833
|
}
|
|
@@ -12111,10 +12153,9 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
12111
12153
|
}
|
|
12112
12154
|
|
|
12113
12155
|
const onChangeScript = `
|
|
12114
|
-
// console.log("==search=onChangeScript===");
|
|
12115
12156
|
const scope = event.context.scoped;
|
|
12116
12157
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
12117
|
-
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
12158
|
+
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
12118
12159
|
let __changedSearchBoxValues = {};
|
|
12119
12160
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
12120
12161
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
@@ -12481,10 +12522,28 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
12481
12522
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
12482
12523
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
12483
12524
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
12484
|
-
let filterFormValues = filterFormService.getData()
|
|
12525
|
+
let filterFormValues = filterFormService.getData();
|
|
12526
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
12485
12527
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
12486
12528
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
12487
|
-
|
|
12529
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
12530
|
+
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
12531
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
12532
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
12533
|
+
if(isLookup && __lookupField){
|
|
12534
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
12535
|
+
if(__lookupField.reference_to_field){
|
|
12536
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
12537
|
+
}
|
|
12538
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
12539
|
+
}
|
|
12540
|
+
if(crud){
|
|
12541
|
+
let crudData = crud.getData();
|
|
12542
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
12543
|
+
crud.setData(crudData);
|
|
12544
|
+
}
|
|
12545
|
+
|
|
12546
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
12488
12547
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
12489
12548
|
`;
|
|
12490
12549
|
let onChangeScript = `
|
|
@@ -12499,7 +12558,7 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
12499
12558
|
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
12500
12559
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
12501
12560
|
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
|
|
12502
|
-
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
12561
|
+
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
12503
12562
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
12504
12563
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
12505
12564
|
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
@@ -12855,7 +12914,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
12855
12914
|
className: crudModeClassName,
|
|
12856
12915
|
//目前crud的service层id不认用户自定义id,只支持默认规则id,许多地方的格式都写死了service_listview_${objectname}
|
|
12857
12916
|
id: `service_${id}`,
|
|
12858
|
-
name:
|
|
12917
|
+
name: "service_object_table_crud",
|
|
12859
12918
|
data: options.amisData,
|
|
12860
12919
|
body: body,
|
|
12861
12920
|
//监听广播事件,重算crud高度
|
|
@@ -13122,7 +13181,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
13122
13181
|
}
|
|
13123
13182
|
|
|
13124
13183
|
amisSchema.body[0].body = await getFormSchemaWithDataFilter(amisSchema.body[0].body, { formDataFilter, onFormDataFilter, amisData, env });
|
|
13125
|
-
// console.log('getObjectDetail=====>', amisSchema);
|
|
13184
|
+
// console.log('getObjectDetail=====>', amisSchema, objectSchema, recordId, ctx);
|
|
13126
13185
|
return amisSchema;
|
|
13127
13186
|
}
|
|
13128
13187
|
|
|
@@ -13202,8 +13261,8 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
13202
13261
|
/*
|
|
13203
13262
|
* @Author: baozhoutao@steedos.com
|
|
13204
13263
|
* @Date: 2022-07-05 15:55:39
|
|
13205
|
-
* @LastEditors:
|
|
13206
|
-
* @LastEditTime:
|
|
13264
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
13265
|
+
* @LastEditTime: 2025-01-08 13:32:51
|
|
13207
13266
|
* @Description:
|
|
13208
13267
|
*/
|
|
13209
13268
|
|
|
@@ -13277,7 +13336,7 @@ async function getObjectRelatedList(
|
|
|
13277
13336
|
|
|
13278
13337
|
// 获取单个相关表
|
|
13279
13338
|
async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObjectName, relatedKey, ctx){
|
|
13280
|
-
let { top, perPage, appId, relatedLabel, className, columns, sort, filters, visible_on } = ctx;
|
|
13339
|
+
let { top, perPage, appId, relatedLabel, className, columns, sort, filters, visible_on, enableHeaderToolbar } = ctx;
|
|
13281
13340
|
// console.log('getRecordDetailRelatedListSchema==>',objectName,recordId,relatedObjectName)
|
|
13282
13341
|
const relatedObjectUiSchema = await getUISchema(relatedObjectName);
|
|
13283
13342
|
if(!relatedObjectUiSchema){
|
|
@@ -13342,6 +13401,10 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
13342
13401
|
let headerToolbar = [];
|
|
13343
13402
|
if(!isMobile){
|
|
13344
13403
|
headerToolbar.push("bulkActions");
|
|
13404
|
+
if (enableHeaderToolbar) {
|
|
13405
|
+
// 通过 enableHeaderToolbar = true 可以控制是否显示内置的带过滤器的headerToolbar
|
|
13406
|
+
headerToolbar = undefined;
|
|
13407
|
+
}
|
|
13345
13408
|
}
|
|
13346
13409
|
const options = {
|
|
13347
13410
|
globalFilter,
|
|
@@ -13380,7 +13443,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
13380
13443
|
amisSchema: {
|
|
13381
13444
|
type: "service",
|
|
13382
13445
|
id: componentId,
|
|
13383
|
-
className: `steedos-record-related-list mb-4 last:mb-0 ${componentId} ${className}`,
|
|
13446
|
+
className: `steedos-record-related-list mb-4 last:mb-0 ${componentId} ${className} ${enableHeaderToolbar ? 'enable-header-toolbar' : ''}`,
|
|
13384
13447
|
data: {
|
|
13385
13448
|
relatedKey: relatedKey,
|
|
13386
13449
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
@@ -13482,6 +13545,7 @@ async function getRelatedListSchema(
|
|
|
13482
13545
|
listViewName,
|
|
13483
13546
|
ctx
|
|
13484
13547
|
) {
|
|
13548
|
+
const { enableHeaderToolbar } = ctx;
|
|
13485
13549
|
const uiSchema = await getUISchema(objectName);
|
|
13486
13550
|
if(!uiSchema){
|
|
13487
13551
|
return {}
|
|
@@ -13534,10 +13598,14 @@ async function getRelatedListSchema(
|
|
|
13534
13598
|
delete ctx.filters;
|
|
13535
13599
|
|
|
13536
13600
|
delete ctx.globalFilter;
|
|
13601
|
+
delete ctx.enableHeaderToolbar;
|
|
13537
13602
|
|
|
13538
13603
|
const adaptor = `
|
|
13539
13604
|
try{
|
|
13540
13605
|
if(setDataToComponentId){
|
|
13606
|
+
// 子表列表在headerToolbar过滤器中设置过过滤条件的话,始终显示子表列表,无论是否查询到数据
|
|
13607
|
+
// 改为使用css样式控制子表列表放开headerToolbar时,始终显示crud,只隐藏crud内部的表格,从而始终显示headerToolbar不受这里逻辑影响
|
|
13608
|
+
// var headerToolbarFilterChanged = context.isFieldsFilterEmpty === false;
|
|
13541
13609
|
if(payload.data.count){
|
|
13542
13610
|
setTimeout(function(){
|
|
13543
13611
|
// 设计器中获取不到window.$从而导致报错, 所以用纯js替换下。
|
|
@@ -13560,7 +13628,7 @@ async function getRelatedListSchema(
|
|
|
13560
13628
|
"filters": listviewFilter,
|
|
13561
13629
|
"filtersFunction": filtersFunction,
|
|
13562
13630
|
"sort": listViewSort,
|
|
13563
|
-
"filterVisible":
|
|
13631
|
+
"filterVisible": !!enableHeaderToolbar,
|
|
13564
13632
|
"requestAdaptor": ctx.requestAdaptor,
|
|
13565
13633
|
"adaptor": adaptor + ctx.adaptor || '',
|
|
13566
13634
|
"ctx": ctx,
|
|
@@ -13611,8 +13679,8 @@ async function getObjectRelatedListsMiniSchema(objectApiName){
|
|
|
13611
13679
|
/*
|
|
13612
13680
|
* @Author: baozhoutao@steedos.com
|
|
13613
13681
|
* @Date: 2022-07-05 15:55:39
|
|
13614
|
-
* @LastEditors:
|
|
13615
|
-
* @LastEditTime:
|
|
13682
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
13683
|
+
* @LastEditTime: 2025-02-21 13:31:43
|
|
13616
13684
|
* @Description:
|
|
13617
13685
|
*/
|
|
13618
13686
|
|
|
@@ -15055,6 +15123,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15055
15123
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
15056
15124
|
ctx.objectName = refObjectConfig.name;
|
|
15057
15125
|
|
|
15126
|
+
// 是否显示lookup字段左侧的过滤器(如果有的话),默认为true,目前只有lookup选人字段有左侧树过滤器
|
|
15127
|
+
const showLeftFilter = field.show_left_filter !== false;
|
|
15128
|
+
|
|
15058
15129
|
let tableFields = [];
|
|
15059
15130
|
const searchableFields = [];
|
|
15060
15131
|
|
|
@@ -15386,6 +15457,20 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15386
15457
|
});
|
|
15387
15458
|
payload.data.rows = updatedResult;
|
|
15388
15459
|
}
|
|
15460
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
15461
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
15462
|
+
if(__lookupField){
|
|
15463
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
15464
|
+
if(__lookupField.reference_to_field){
|
|
15465
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
15466
|
+
}
|
|
15467
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
15468
|
+
}
|
|
15469
|
+
let __changedFilterFormValues = api.context[__changedFilterFormValuesKey] || {};
|
|
15470
|
+
let __changedSearchBoxValues = api.context.__changedSearchBoxValues || {};
|
|
15471
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
15472
|
+
payload.data[__changedFilterFormValuesKey] = __changedFilterFormValues;
|
|
15473
|
+
payload.data.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
15389
15474
|
return payload;
|
|
15390
15475
|
`;
|
|
15391
15476
|
if(field.optionsFunction || field._optionsFunction){
|
|
@@ -15421,7 +15506,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15421
15506
|
|
|
15422
15507
|
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { isLookup: true, keywordsSearchBoxName });
|
|
15423
15508
|
|
|
15424
|
-
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
15509
|
+
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && showLeftFilter){
|
|
15425
15510
|
pickerSchema.headerToolbar.push(getLookupSapceUserTreeSchema(isMobile));
|
|
15426
15511
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
15427
15512
|
}
|
|
@@ -15441,7 +15526,10 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15441
15526
|
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
15442
15527
|
...ctx,
|
|
15443
15528
|
isLookup: true,
|
|
15444
|
-
keywordsSearchBoxName
|
|
15529
|
+
keywordsSearchBoxName,
|
|
15530
|
+
searchable_fields: field.searchable_fields,
|
|
15531
|
+
auto_open_filter: field.auto_open_filter,
|
|
15532
|
+
show_left_filter: field.show_left_filter
|
|
15445
15533
|
});
|
|
15446
15534
|
}
|
|
15447
15535
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
@@ -19211,7 +19299,7 @@ async function getListviewInitSchema(objectApiName, listViewName, ctx) {
|
|
|
19211
19299
|
const defaults = ctx.defaults || {};
|
|
19212
19300
|
if(!defaults.headerSchema){
|
|
19213
19301
|
//传入isListviewInit是区别于对象列表类型的微页面,即getListPageInitSchema函数中该属性为false
|
|
19214
|
-
const headerSchema = await getObjectListHeader
|
|
19302
|
+
const headerSchema = await getObjectListHeader(uiSchema, listViewName, {
|
|
19215
19303
|
onlySecordLine: true,
|
|
19216
19304
|
isListviewInit: true
|
|
19217
19305
|
});
|
|
@@ -21695,139 +21783,139 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
21695
21783
|
};
|
|
21696
21784
|
|
|
21697
21785
|
var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21711
|
-
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21730
|
-
|
|
21731
|
-
|
|
21732
|
-
|
|
21733
|
-
|
|
21734
|
-
|
|
21735
|
-
|
|
21736
|
-
|
|
21737
|
-
|
|
21738
|
-
|
|
21739
|
-
|
|
21740
|
-
|
|
21741
|
-
|
|
21742
|
-
|
|
21743
|
-
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
|
|
21749
|
-
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
|
|
21779
|
-
|
|
21780
|
-
|
|
21781
|
-
|
|
21782
|
-
|
|
21783
|
-
|
|
21784
|
-
|
|
21785
|
-
|
|
21786
|
-
|
|
21787
|
-
|
|
21788
|
-
|
|
21789
|
-
|
|
21790
|
-
|
|
21791
|
-
|
|
21792
|
-
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
|
|
21805
|
-
|
|
21806
|
-
|
|
21807
|
-
|
|
21808
|
-
|
|
21809
|
-
|
|
21810
|
-
|
|
21811
|
-
|
|
21812
|
-
|
|
21813
|
-
|
|
21814
|
-
|
|
21815
|
-
|
|
21816
|
-
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21786
|
+
__proto__: null,
|
|
21787
|
+
Field: index,
|
|
21788
|
+
Router: Router$1,
|
|
21789
|
+
absoluteUrl: absoluteUrl,
|
|
21790
|
+
amisRender: amisRender,
|
|
21791
|
+
amisRootClick: amisRootClick,
|
|
21792
|
+
cloneObject: cloneObject,
|
|
21793
|
+
conditionsToFilters: conditionsToFilters,
|
|
21794
|
+
createObject: createObject,
|
|
21795
|
+
defaultsDeep: defaultsDeep,
|
|
21796
|
+
deleteVariable: deleteVariable,
|
|
21797
|
+
execute: execute,
|
|
21798
|
+
executeButton: executeButton,
|
|
21799
|
+
extendObject: extendObject,
|
|
21800
|
+
fetchAPI: fetchAPI,
|
|
21801
|
+
filtersToConditions: filtersToConditions,
|
|
21802
|
+
getAmisInputTableSchema: getAmisInputTableSchema,
|
|
21803
|
+
getApp: getApp,
|
|
21804
|
+
getApps: getApps,
|
|
21805
|
+
getAuthToken: getAuthToken,
|
|
21806
|
+
getAuthorization: getAuthorization,
|
|
21807
|
+
getButton: getButton,
|
|
21808
|
+
getButtonVisible: getButtonVisible,
|
|
21809
|
+
getButtonVisibleOn: getButtonVisibleOn,
|
|
21810
|
+
getButtons: getButtons,
|
|
21811
|
+
getCalendarSchema: getCalendarSchema,
|
|
21812
|
+
getCreatedInfoTpl: getCreatedInfoTpl,
|
|
21813
|
+
getDateTimeTpl: getDateTimeTpl,
|
|
21814
|
+
getDateTpl: getDateTpl,
|
|
21815
|
+
getDefaultRenderData: getDefaultRenderData,
|
|
21816
|
+
getEnv: getEnv,
|
|
21817
|
+
getEnvs: getEnvs,
|
|
21818
|
+
getEvn: getEvn,
|
|
21819
|
+
getField: getField,
|
|
21820
|
+
getFieldTpl: getFieldTpl,
|
|
21821
|
+
getFileSrc: getFileSrc,
|
|
21822
|
+
getFlowFormSchema: getFlowFormSchema,
|
|
21823
|
+
getFormPageInitSchema: getFormPageInitSchema,
|
|
21824
|
+
getFormSchema: getFormSchema,
|
|
21825
|
+
getGlobalNowData: getGlobalNowData$1,
|
|
21826
|
+
getIdsPickerSchema: getIdsPickerSchema,
|
|
21827
|
+
getImageSrc: getImageSrc,
|
|
21828
|
+
getInstanceInfo: getInstanceInfo,
|
|
21829
|
+
getListPageInitSchema: getListPageInitSchema,
|
|
21830
|
+
getListSchema: getListSchema,
|
|
21831
|
+
getListViewButtons: getListViewButtons,
|
|
21832
|
+
getListViewColumns: getListViewColumns,
|
|
21833
|
+
getListViewFilter: getListViewFilter,
|
|
21834
|
+
getListViewItemButtons: getListViewItemButtons,
|
|
21835
|
+
getListViewSort: getListViewSort,
|
|
21836
|
+
getListviewInitSchema: getListviewInitSchema,
|
|
21837
|
+
getLocationTpl: getLocationTpl,
|
|
21838
|
+
getLookupSapceUserTreeSchema: getLookupSapceUserTreeSchema,
|
|
21839
|
+
getLookupTpl: getLookupTpl,
|
|
21840
|
+
getModifiedInfoTpl: getModifiedInfoTpl,
|
|
21841
|
+
getNameTpl: getNameTpl,
|
|
21842
|
+
getNameTplUrl: getNameTplUrl,
|
|
21843
|
+
getNotifications: getNotifications,
|
|
21844
|
+
getNumberTpl: getNumberTpl,
|
|
21845
|
+
getObjectDetailButtons: getObjectDetailButtons,
|
|
21846
|
+
getObjectDetailButtonsSchemas: getObjectDetailButtonsSchemas,
|
|
21847
|
+
getObjectDetailMoreButtons: getObjectDetailMoreButtons,
|
|
21848
|
+
getObjectFieldsFilterBarSchema: getObjectFieldsFilterBarSchema,
|
|
21849
|
+
getObjectFieldsFilterButtonSchema: getObjectFieldsFilterButtonSchema,
|
|
21850
|
+
getObjectFieldsFilterFormSchema: getObjectFieldsFilterFormSchema,
|
|
21851
|
+
getObjectListHeader: getObjectListHeader,
|
|
21852
|
+
getObjectListHeaderFieldsFilterBar: getObjectListHeaderFieldsFilterBar,
|
|
21853
|
+
getObjectListHeaderFirstLine: getObjectListHeaderFirstLine,
|
|
21854
|
+
getObjectListHeaderSecordLine: getObjectListHeaderSecordLine,
|
|
21855
|
+
getObjectListViewButtonsSchemas: getObjectListViewButtonsSchemas,
|
|
21856
|
+
getObjectRecordDetailHeader: getObjectRecordDetailHeader,
|
|
21857
|
+
getObjectRecordDetailRelatedListButtonsSchemas: getObjectRecordDetailRelatedListButtonsSchemas,
|
|
21858
|
+
getObjectRecordDetailRelatedListHeader: getObjectRecordDetailRelatedListHeader,
|
|
21859
|
+
getObjectRelated: getObjectRelated,
|
|
21860
|
+
getObjectRelatedList: getObjectRelatedList,
|
|
21861
|
+
getObjectRelatedListButtons: getObjectRelatedListButtons,
|
|
21862
|
+
getObjectRelatedListHeader: getObjectRelatedListHeader,
|
|
21863
|
+
getObjectRelatedListsMiniSchema: getObjectRelatedListsMiniSchema,
|
|
21864
|
+
getPage: getPage,
|
|
21865
|
+
getPasswordTpl: getPasswordTpl,
|
|
21866
|
+
getRecord: getRecord,
|
|
21867
|
+
getRecordDetailHeaderSchema: getRecordDetailHeaderSchema,
|
|
21868
|
+
getRecordDetailMiniSchema: getRecordDetailMiniSchema,
|
|
21869
|
+
getRecordDetailRelatedListSchema: getRecordDetailRelatedListSchema,
|
|
21870
|
+
getRecordDetailSchema: getRecordDetailSchema,
|
|
21871
|
+
getRecordPageInitSchema: getRecordPageInitSchema,
|
|
21872
|
+
getRecordPermissions: getRecordPermissions,
|
|
21873
|
+
getRecordServiceSchema: getRecordServiceSchema,
|
|
21874
|
+
getRefObjectNameFieldName: getRefObjectNameFieldName,
|
|
21875
|
+
getReferenceTo: getReferenceTo,
|
|
21876
|
+
getReferenceToFieldSchema: getReferenceToFieldSchema,
|
|
21877
|
+
getReferenceToSync: getReferenceToSync,
|
|
21878
|
+
getRelatedFieldTpl: getRelatedFieldTpl,
|
|
21879
|
+
getRelatedFieldValue: getRelatedFieldValue,
|
|
21880
|
+
getRelatedListSchema: getRelatedListSchema,
|
|
21881
|
+
getRelatedsCount: getRelatedsCount,
|
|
21882
|
+
getRootUrl: getRootUrl,
|
|
21883
|
+
getSelectMap: getSelectMap,
|
|
21884
|
+
getSelectTpl: getSelectTpl,
|
|
21885
|
+
getSelectUserSchema: getSelectUserSchema,
|
|
21886
|
+
getSpaceUsersPickerAmisSchema: getSpaceUsersPickerAmisSchema,
|
|
21887
|
+
getSpaceUsersPickerSchema: getSpaceUsersPickerSchema,
|
|
21888
|
+
getSteedosAuth: getSteedosAuth,
|
|
21889
|
+
getSwitchTpl: getSwitchTpl,
|
|
21890
|
+
getTableSchema: getTableSchema,
|
|
21891
|
+
getTenantId: getTenantId,
|
|
21892
|
+
getTimeTpl: getTimeTpl,
|
|
21893
|
+
getUISchema: getUISchema,
|
|
21894
|
+
getUISchemaSync: getUISchemaSync$1,
|
|
21895
|
+
getUiFieldTpl: getUiFieldTpl,
|
|
21896
|
+
getUiFileSizeTpl: getUiFileSizeTpl,
|
|
21897
|
+
getUserId: getUserId,
|
|
21898
|
+
getViewSchema: getViewSchema,
|
|
21899
|
+
isExpression: isExpression$1,
|
|
21900
|
+
isObject: isObject$8,
|
|
21901
|
+
lookupToAmis: lookupToAmis,
|
|
21902
|
+
lookupToAmisIdsPicker: lookupToAmisIdsPicker,
|
|
21903
|
+
lookupToAmisPicker: lookupToAmisPicker,
|
|
21904
|
+
lookupToAmisSelect: lookupToAmisSelect,
|
|
21905
|
+
lookupToAmisSelectUser: lookupToAmisSelectUser,
|
|
21906
|
+
markReadAll: markReadAll,
|
|
21907
|
+
parseSingleExpression: parseSingleExpression$1,
|
|
21908
|
+
registerRemoteAssets: registerRemoteAssets,
|
|
21909
|
+
registerRenders: registerRenders,
|
|
21910
|
+
setEnv: setEnv,
|
|
21911
|
+
setEnvs: setEnvs,
|
|
21912
|
+
setRootUrl: setRootUrl,
|
|
21913
|
+
setSteedosAuth: setSteedosAuth,
|
|
21914
|
+
setUISchemaFunction: setUISchemaFunction,
|
|
21915
|
+
setVariable: setVariable,
|
|
21916
|
+
standardButtonsTodo: standardButtonsTodo,
|
|
21917
|
+
uuidv4: uuidv4,
|
|
21918
|
+
i18next: instance
|
|
21831
21919
|
});
|
|
21832
21920
|
|
|
21833
21921
|
var getSchema = function (field, value, ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -24991,7 +25079,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
24991
25079
|
allData = createObject(data, defaultData);
|
|
24992
25080
|
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr, hiddenColumnOperation: hiddenColumnOperation, columns: columns, crudDataFilter: crudDataFilter, onCrudDataFilter: onCrudDataFilter, amisData: allData, env: env, requestAdaptor: requestAdaptor, adaptor: adaptor });
|
|
24993
25081
|
if (!headerSchema) {
|
|
24994
|
-
headerSchema = getObjectListHeader
|
|
25082
|
+
headerSchema = getObjectListHeader(uiSchema, listName, ctx);
|
|
24995
25083
|
}
|
|
24996
25084
|
headerSchema.className = "steedos-object-listview-header " + headerSchema.className || "";
|
|
24997
25085
|
serviceData = Object.assign({}, { showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName, isObjectListview: true });
|
|
@@ -25109,7 +25197,17 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
25109
25197
|
}
|
|
25110
25198
|
columns = getTableColumns(props.columns, includedFields, fieldsExtend) || [];
|
|
25111
25199
|
defaults = {};
|
|
25112
|
-
objectApiName =
|
|
25200
|
+
objectApiName = "space_users";
|
|
25201
|
+
if (props.$$editor) {
|
|
25202
|
+
if (props.objectApiName) {
|
|
25203
|
+
objectApiName = props.objectApiName;
|
|
25204
|
+
}
|
|
25205
|
+
}
|
|
25206
|
+
else {
|
|
25207
|
+
if (props.data.objectName) {
|
|
25208
|
+
objectApiName = props.data.objectName;
|
|
25209
|
+
}
|
|
25210
|
+
}
|
|
25113
25211
|
if (crudMode) {
|
|
25114
25212
|
// 把crudMode属性传入到crud.mode属性值中
|
|
25115
25213
|
// 如果只配置了crudMode属性,则后续内核代码会自动生成对应mode的默认属性值,比如card,listItem
|
|
@@ -25161,6 +25259,7 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
25161
25259
|
amisSchema.className = "steedos-object-table ".concat(uiSchema.enable_tree ? "is-steedos-tree-table" : "", " ").concat(amisSchema.className, " h-full flex flex-col ").concat(className);
|
|
25162
25260
|
amisSchema.objectApiName = objectApiName; //设计器中切换对象时画布中显示的列未同步变更
|
|
25163
25261
|
// console.timeEnd('AmisObjectTable')
|
|
25262
|
+
console.log("AmisObjectTable=====>", props, amisSchema);
|
|
25164
25263
|
return [2 /*return*/, amisSchema];
|
|
25165
25264
|
}
|
|
25166
25265
|
});
|
|
@@ -25280,8 +25379,8 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
25280
25379
|
if (body) {
|
|
25281
25380
|
schema.body = body;
|
|
25282
25381
|
}
|
|
25283
|
-
// console.log(`AmisRecordDetail====schema==>`, schema);
|
|
25284
25382
|
schema.data = Object.assign({}, $schema.data, schema.data);
|
|
25383
|
+
// console.log(`AmisRecordDetail====schema==>`, schema, props);
|
|
25285
25384
|
return [2 /*return*/, schema];
|
|
25286
25385
|
}
|
|
25287
25386
|
});
|
|
@@ -25290,8 +25389,8 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
25290
25389
|
/*
|
|
25291
25390
|
* @Author: baozhoutao@steedos.com
|
|
25292
25391
|
* @Date: 2022-12-08 10:32:17
|
|
25293
|
-
* @LastEditors:
|
|
25294
|
-
* @LastEditTime:
|
|
25392
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
25393
|
+
* @LastEditTime: 2025-02-21 13:59:44
|
|
25295
25394
|
* @Description:
|
|
25296
25395
|
*/
|
|
25297
25396
|
var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -25327,22 +25426,22 @@ var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void
|
|
|
25327
25426
|
formData.recordId = props.recordId;
|
|
25328
25427
|
}
|
|
25329
25428
|
schema.data = Object.assign({}, schema.data || {}, formData);
|
|
25330
|
-
if (_$1.has(props, 'objectApiName')) {
|
|
25429
|
+
if (_$1.has(props, 'objectApiName') && props.$$editor) {
|
|
25331
25430
|
schema.data.objectName = objectApiName;
|
|
25332
25431
|
}
|
|
25333
|
-
// console.log(`AmisRecordService====schema==>`, schema)
|
|
25432
|
+
// console.log(`AmisRecordService====schema==>`, schema, props)
|
|
25334
25433
|
return [2 /*return*/, schema];
|
|
25335
25434
|
}
|
|
25336
25435
|
});
|
|
25337
25436
|
}); };
|
|
25338
25437
|
|
|
25339
25438
|
var AmisRecordDetailRelatedList = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
25340
|
-
var $schema, objectApiName, recordId, relatedObjectApiName, data, relatedKey, top, perPage, hiddenEmptyTable, appId, relatedLabel, _a, className, columns, sort, filters, visible_on, requestAdaptor, adaptor, visibleOn, crud, crudDataFilter, onCrudDataFilter, env, formFactor, formData, schema;
|
|
25439
|
+
var $schema, objectApiName, recordId, relatedObjectApiName, data, relatedKey, top, perPage, hiddenEmptyTable, appId, relatedLabel, _a, className, columns, sort, filters, visible_on, requestAdaptor, adaptor, visibleOn, crud, crudDataFilter, onCrudDataFilter, env, enableHeaderToolbar, formFactor, formData, schema;
|
|
25341
25440
|
var _b;
|
|
25342
25441
|
return __generator(this, function (_c) {
|
|
25343
25442
|
switch (_c.label) {
|
|
25344
25443
|
case 0:
|
|
25345
|
-
$schema = props.$schema, objectApiName = props.objectApiName, recordId = props.recordId, relatedObjectApiName = props.relatedObjectApiName, data = props.data, relatedKey = props.relatedKey, top = props.top, perPage = props.perPage, hiddenEmptyTable = props.hiddenEmptyTable, appId = props.appId, relatedLabel = props.relatedLabel, _a = props.className, className = _a === void 0 ? '' : _a, columns = props.columns, sort = props.sort, filters = props.filters, visible_on = props.visible_on, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor, visibleOn = props.visibleOn, crud = props.crud, crudDataFilter = props.crudDataFilter, onCrudDataFilter = props.onCrudDataFilter, env = props.env;
|
|
25444
|
+
$schema = props.$schema, objectApiName = props.objectApiName, recordId = props.recordId, relatedObjectApiName = props.relatedObjectApiName, data = props.data, relatedKey = props.relatedKey, top = props.top, perPage = props.perPage, hiddenEmptyTable = props.hiddenEmptyTable, appId = props.appId, relatedLabel = props.relatedLabel, _a = props.className, className = _a === void 0 ? '' : _a, columns = props.columns, sort = props.sort, filters = props.filters, visible_on = props.visible_on, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor, visibleOn = props.visibleOn, crud = props.crud, crudDataFilter = props.crudDataFilter, onCrudDataFilter = props.onCrudDataFilter, env = props.env, enableHeaderToolbar = props.enableHeaderToolbar;
|
|
25346
25445
|
formFactor = props.formFactor;
|
|
25347
25446
|
if (!formFactor) {
|
|
25348
25447
|
formFactor = window.innerWidth < 768 ? 'SMALL' : 'LARGE';
|
|
@@ -25379,7 +25478,8 @@ var AmisRecordDetailRelatedList = function (props) { return __awaiter(void 0, vo
|
|
|
25379
25478
|
crud: crud,
|
|
25380
25479
|
crudDataFilter: crudDataFilter,
|
|
25381
25480
|
onCrudDataFilter: onCrudDataFilter,
|
|
25382
|
-
env: env
|
|
25481
|
+
env: env,
|
|
25482
|
+
enableHeaderToolbar: enableHeaderToolbar
|
|
25383
25483
|
})];
|
|
25384
25484
|
case 1:
|
|
25385
25485
|
schema = (_c.sent()).amisSchema;
|
|
@@ -25519,12 +25619,13 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
25519
25619
|
* @Author: baozhoutao@steedos.com
|
|
25520
25620
|
* @Date: 2022-09-01 14:44:57
|
|
25521
25621
|
* @LastEditors: baozhoutao@steedos.com
|
|
25522
|
-
* @LastEditTime:
|
|
25622
|
+
* @LastEditTime: 2025-02-15 11:25:39
|
|
25523
25623
|
* @Description:
|
|
25524
25624
|
*/
|
|
25525
25625
|
var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
25526
25626
|
var app, data, className, _a, showAppName, _b, appNameClassName, _c, customElements, _d, showAppIcon, isSpaceAdmin, formFactor, isMobile, on_click_script, mobile_blank_script, convertAppVisibleOnScript, pcInitApiAdaptorScript, mobileInitApiAdaptorScript, dialogSchema, badgeText, overlaySchema;
|
|
25527
25627
|
return __generator(this, function (_e) {
|
|
25628
|
+
console.log("AmisAppLauncher", props);
|
|
25528
25629
|
app = props.app, data = props.data, className = props.className, _a = props.showAppName, showAppName = _a === void 0 ? true : _a, _b = props.appNameClassName, appNameClassName = _b === void 0 ? '' : _b, _c = props.customElements, customElements = _c === void 0 ? [] : _c, _d = props.showAppIcon, showAppIcon = _d === void 0 ? true : _d;
|
|
25529
25630
|
if (!app) {
|
|
25530
25631
|
app = data.context.app;
|
|
@@ -25806,7 +25907,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
25806
25907
|
]
|
|
25807
25908
|
}
|
|
25808
25909
|
},
|
|
25809
|
-
isMobile
|
|
25910
|
+
isMobile || !isSpaceAdmin ? null : {
|
|
25810
25911
|
"type": "button",
|
|
25811
25912
|
"level": "link",
|
|
25812
25913
|
"label": "+ 新建应用",
|
|
@@ -25865,7 +25966,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
25865
25966
|
"type": "lookup",
|
|
25866
25967
|
"required": true,
|
|
25867
25968
|
"sort_no": 30,
|
|
25868
|
-
"optionsFunction": "function anonymous() { var options; options = []; _.forEach(
|
|
25969
|
+
"optionsFunction": "function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }",
|
|
25869
25970
|
"name": "icon",
|
|
25870
25971
|
"inlineHelpText": "",
|
|
25871
25972
|
"description": "",
|
|
@@ -26028,8 +26129,10 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
26028
26129
|
return __generator(this, function (_f) {
|
|
26029
26130
|
_a = props.stacked, stacked = _a === void 0 ? false : _a, overflow = props.overflow, appId = props.appId, data = props.data, _b = props.links, links = _b === void 0 ? null : _b, _c = props.showIcon, showIcon = _c === void 0 ? true : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.indentSize, indentSize = _e === void 0 ? 12 : _e, selectedId = props.selectedId;
|
|
26030
26131
|
if (!appId) {
|
|
26031
|
-
appId = data.context.appId
|
|
26132
|
+
appId = data.context.appId;
|
|
26032
26133
|
}
|
|
26134
|
+
// console.log(`AmisAppMenu appId`, appId)
|
|
26135
|
+
console.log("AmisAppMenu", appId, props);
|
|
26033
26136
|
badgeText = "${keyvalues.badge.value | pick:".concat(appId, " | toInt}");
|
|
26034
26137
|
if (appId == "approve_workflow") {
|
|
26035
26138
|
badgeText = "${keyvalues.badge.value | pick:'workflow' | toInt}";
|
|
@@ -26049,14 +26152,15 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
26049
26152
|
id: 'u:app-menu',
|
|
26050
26153
|
schemaApi: {
|
|
26051
26154
|
"method": "get",
|
|
26052
|
-
"url": "${context.rootUrl}/service/api/apps
|
|
26053
|
-
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n var usedGroupNames = [];\n let allowEditApp = false;\n if(stacked){\n if(payload.allowEditApp){\n allowEditApp = true;\n }\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n usedGroupNames.push(groupName);\n data.nav.push({\n \"label\": groupName,\n 'default_open': tabGroup && tabGroup.default_open != false,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 block no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n \"groupName\": groupName\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } slds-icon !fill-white rounded-xl mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n // let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n if(allowEditApp){\n _.each(payload.tab_groups, (group)=>{\n if(!_.includes(usedGroupNames, group.group_name)){\n data.nav.push({\n \"label\": group.group_name,\n 'default_open': group && group.default_open != false,\n \"unfolded\": group && group.default_open != false,\n \"isGroup\": true,\n \"children\": []\n })\n }\n });\n }\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"mx-3 mb-2\",\n \"columns\": [\n {\n \"md\": 10,\n \"columnClassName\": \"p-0\",\n \"body\": [\n {\n \"type\": \"search-box\",\n \"name\": \"keywords\",\n \"className\": \"!w-full\",\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"autoFocus\": false,\n \"searchImediately\": true,\n \"clearable\": true,\n \"clearAndSubmit\": true,\n \"id\": \"s01\"\n }\n ]\n },\n {\n \"md\": 2,\n \"columnClassName\": \"p0 pl-0 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"btnClassName\": \"text-gray-700\",\n \"icon\": \"fa fa-plus\",\n \"size\": \"md\",\n \"hideCaret\": true,\n \"align\": \"right\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n \n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/create_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, name: context.name, defaultOpen: context.defaultOpen}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n },\n }\n ]\n }\n ]\n }\n ]\n }]\n }\n\n let menuItems = data.nav;\n\n if(context.keywords){\n // \u5982\u679CmenuItem\u7684children, children\u662F\u6570\u7EC4\u7ED3\u6784, \u6BCF\u4E00\u9879\u7684searchKey\u5305\u542Bcontext.keywords, \u5219\u663E\u793AmenuItem\u53CA\u5176\u7B26\u5408\u6761\u4EF6\u7684children;\n menuItems = _.filter(menuItems, (menuItem)=>{\n if(menuItem.children){\n const children = _.filter(menuItem.children, (child)=>{\n return _.includes(child.searchKey, context.keywords);\n });\n\n if(children.length > 0){\n menuItem.children = children;\n }\n\n return children.length > 0;\n }\n })\n };\n\n if(!menuItems || menuItems.length == 0){\n menuItems = data.nav;\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": menuItems,\n \"keyvalues\": \"${ss:keyvalues}\",\n \"allowEditApp\": allowEditApp,\n \"tab_groups\": tab_groups\n },\n \"id\": \"appMenuService\",\n \"onEvent\": {\n \"@data.changed.steedos_keyvalues\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n \"keyvalues\": \"${event.data.keyvalues}\"\n }\n }\n }\n ]\n }\n },\n \"body\": [\n ...editAppSearch,\n {\n \"type\": \"nav\",\n \"expandPosition\": \"after\",\n \"searchable\": !allowEditApp && ").concat(stacked, ",\n \"searchConfig\": {\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"matchFunc\": \"return link.searchKey && link.searchKey.indexOf(keyword)>=0;\"\n },\n className: \"").concat(className, " text-black steedos-app-menu ").concat(stacked ? 'stacked' : '', "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"draggable\": allowEditApp,\n \"dragOnSameLevel\": true,\n \"saveOrderApi\": {\n \"url\": \"/service/api/apps/update_app_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"const menus = context.data;const tab_groups = [];const tab_items = {};_.each(menus, (menu) => { if (menu.isGroup) { tab_groups.push({ group_name: menu.label, default_open: menu.default_open, }); }else{tab_items[menu.tabApiName] = {group:''}}; if (menu.children) { _.each(menu.children, (menu2) => { tab_items[menu2.tabApiName] = { group: menu.label } }) }}); api.data={appId: context.app.id, tab_groups, tab_items}; return api;\",\n \"messages\": {}\n },\n \"itemActions\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"btnClassName\": \"!text-gray-700\",\n \"hideCaret\": true,\n \"className\": \"hidden hover-inline-flex\",\n \"visibleOn\": \"!!allowEditApp\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"name\": \"\\${event.data.label}\",\n \"oldName\": \"\\${event.data.label}\",\n \"defaultOpen\": \"\\${event.data.default_open}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/update_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.appId, name: context.name, defaultOpen: context.defaultOpen, oldName: context.oldName}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='object'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\",\n \"expression\": \"${false}\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ try{const objectId = objects[0]._id; FlowRouter.go('/app/admin/objects/view/'+objectId+'?side_object=objects&side_listview_id=all')}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='page'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + pageId +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name page page__expand { _id } }}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='url'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"if(payload.data.tabs && payload.data.tabs.length > 0){payload.data=payload.data.tabs[0]}; return payload\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id oName:name fLabel:label fUrl:url icon }}'}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5916\u90E8\u94FE\u63A5\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"&\": \"\\${event.data.responseResult}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"disabled\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/update_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u79FB\u52A8\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"event.setData({appId: event.data.app.id, groups: [{label: event.data.app.name, value: 0, children: _.map(event.data.tab_groups, (tGroup)=>{return {label: tGroup.group_name, value: tGroup.group_name}})}] , tabApiName: event.data.tabApiName, groupName: event.data.groupName})\"\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u79FB\u52A8\",\n \"data\": {\n \"appId\": \"\\${event.data.appId}\",\n \"groups\": \"\\${event.data.groups}\",\n \"tabApiName\": \"\\${event.data.tabApiName}\",\n \"groupName\": \"\\${event.data.groupName}\",\n \"oldGroupName\": \"\\${event.data.groupName}\",\n },\n \"body\": [\n {\n \"type\": \"tree-select\",\n \"label\": \"\",\n \"name\": \"groupName\",\n \"id\": \"u:26d0b458ff51\",\n \"multiple\": false,\n \"source\": \"\\${groups}\"\n }\n ],\n \"id\": \"u:d69cbb95089a\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:12261bf51dcb\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:b144775ea124\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/move_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupName: context.groupName, oldGroupName: context.oldGroupName, tabName: context.tabApiName}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, tabName: context.tabApiName};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"if(event.data.children && event.data.children.length > 0){doAction({'actionType': 'toast','args': { 'msgType': 'warning', 'msg': '\u5206\u7EC4\u4E0B\u6709\u6570\u636E,\u7981\u6B62\u5220\u9664'}});event.stopPropagation();};\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_group\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupName: context.label};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n }\n ]\n },\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-plus\",\n \"hideCaret\": true,\n \"btnClassName\": \"!text-gray-700\",\n \"visibleOn\": \"!!allowEditApp && !!this.isGroup\",\n \"className\": \"hidden hover-inline-flex\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n }\n ]\n },\n ],\n \"source\": \"${items}\",\n //\u5DE6\u5C42\u663E\u793A\u65F6\u5BA1\u6279\u5355\u663E\u793Abadge\u6570\u91CF\n \"itemBadge\": {\n \"mode\": \"text\",\n \"text\": \"").concat(badgeText, "\",\n \"visibleOn\": \"${id == 'instance_tasks'}\",\n \"overflowCount\": 99,\n \"style\": stacked?{\n \"right\": \"20%\",\n \"margin-right\": \"-23px\",\n \"height\": \"20px\",\n \"border-radius\": \"10px\",\n \"font-size\": \"16px\",\n \"line-height\": \"18px\",\n \"top\": \"50%\"\n }:{\n \"transform\": \"translate(calc(50% - 17px), calc(-50% + 10px))\",\n \"border-radius\": \"6.5px\",\n \"height\": \"15px\",\n \"line-height\": \"13px\",\n \"padding\": \"0px 4px\",\n \"font-size\": \"12px\"\n }\n },\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n ]\n };\n } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n\n setTimeout(function(){\n $(\"[name='keywords']\").focus();\n }, 300);\n\n return payload;\n "),
|
|
26155
|
+
"url": "${context.rootUrl}/service/api/apps/${appId}/menus",
|
|
26156
|
+
"sendOn": "!!appId",
|
|
26157
|
+
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n var usedGroupNames = [];\n let allowEditApp = false;\n if(stacked){\n if(payload.allowEditApp){\n allowEditApp = true;\n }\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n usedGroupNames.push(groupName);\n data.nav.push({\n \"label\": groupName,\n 'default_open': tabGroup && tabGroup.default_open != false,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 block no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n \"groupName\": groupName\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } slds-icon !fill-white rounded-xl mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n // let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n if(allowEditApp){\n _.each(payload.tab_groups, (group)=>{\n if(!_.includes(usedGroupNames, group.group_name)){\n data.nav.push({\n \"label\": group.group_name,\n 'default_open': group && group.default_open != false,\n \"unfolded\": group && group.default_open != false,\n \"isGroup\": true,\n \"children\": []\n })\n }\n });\n }\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"mx-3 mb-2\",\n \"columns\": [\n {\n \"md\": 10,\n \"columnClassName\": \"p-0\",\n \"body\": [\n {\n \"type\": \"search-box\",\n \"name\": \"keywords\",\n \"className\": \"!w-full\",\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"autoFocus\": false,\n \"searchImediately\": true,\n \"clearable\": true,\n \"clearAndSubmit\": true,\n \"id\": \"s01\"\n }\n ]\n },\n {\n \"md\": 2,\n \"columnClassName\": \"p0 pl-0 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"btnClassName\": \"text-gray-700\",\n \"icon\": \"fa fa-plus\",\n \"size\": \"md\",\n \"hideCaret\": true,\n \"align\": \"right\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n \n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/create_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, name: context.name, defaultOpen: context.defaultOpen}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n },\n }\n ]\n }\n ]\n }\n ]\n }]\n }\n\n let menuItems = data.nav;\n\n if(context.keywords){\n // \u5982\u679CmenuItem\u7684children, children\u662F\u6570\u7EC4\u7ED3\u6784, \u6BCF\u4E00\u9879\u7684searchKey\u5305\u542Bcontext.keywords, \u5219\u663E\u793AmenuItem\u53CA\u5176\u7B26\u5408\u6761\u4EF6\u7684children;\n menuItems = _.filter(menuItems, (menuItem)=>{\n if(menuItem.children){\n const children = _.filter(menuItem.children, (child)=>{\n return _.includes(child.searchKey, context.keywords);\n });\n\n if(children.length > 0){\n menuItem.children = children;\n }\n\n return children.length > 0;\n }\n })\n };\n\n if(!menuItems || menuItems.length == 0){\n menuItems = data.nav;\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": menuItems,\n \"keyvalues\": \"${ss:keyvalues}\",\n \"allowEditApp\": allowEditApp,\n \"tab_groups\": tab_groups\n },\n \"id\": \"appMenuService\",\n \"onEvent\": {\n \"@data.changed.steedos_keyvalues\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n \"keyvalues\": \"${event.data.keyvalues}\"\n }\n }\n }\n ]\n }\n },\n \"body\": [\n ...editAppSearch,\n {\n \"type\": \"nav\",\n \"expandPosition\": \"after\",\n \"searchable\": !allowEditApp && ").concat(stacked, ",\n \"searchConfig\": {\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"matchFunc\": \"return link.searchKey && link.searchKey.indexOf(keyword)>=0;\"\n },\n className: \"").concat(className, " text-black steedos-app-menu ").concat(stacked ? 'stacked' : '', "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"draggable\": allowEditApp,\n \"dragOnSameLevel\": true,\n \"saveOrderApi\": {\n \"url\": \"/service/api/apps/update_app_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"const menus = context.data;const tab_groups = [];const tab_items = {};_.each(menus, (menu) => { if (menu.isGroup) { tab_groups.push({ group_name: menu.label, default_open: menu.default_open, }); }else{tab_items[menu.tabApiName] = {group:''}}; if (menu.children) { _.each(menu.children, (menu2) => { tab_items[menu2.tabApiName] = { group: menu.label } }) }}); api.data={appId: context.app.id, tab_groups, tab_items}; return api;\",\n \"messages\": {}\n },\n \"itemActions\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"btnClassName\": \"!text-gray-700\",\n \"hideCaret\": true,\n \"className\": \"hidden hover-inline-flex\",\n \"visibleOn\": \"!!allowEditApp\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"name\": \"\\${event.data.label}\",\n \"oldName\": \"\\${event.data.label}\",\n \"defaultOpen\": \"\\${event.data.default_open}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/update_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.appId, name: context.name, defaultOpen: context.defaultOpen, oldName: context.oldName}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='object'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\",\n \"expression\": \"${false}\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ try{const objectId = objects[0]._id; FlowRouter.go('/app/admin/objects/view/'+objectId+'?side_object=objects&side_listview_id=all')}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='page'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + pageId +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name page page__expand { _id } }}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='url'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"if(payload.data.tabs && payload.data.tabs.length > 0){payload.data=payload.data.tabs[0]}; return payload\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id oName:name fLabel:label fUrl:url icon }}'}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5916\u90E8\u94FE\u63A5\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"&\": \"\\${event.data.responseResult}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"disabled\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/update_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u79FB\u52A8\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"event.setData({appId: event.data.app.id, groups: [{label: event.data.app.name, value: 0, children: _.map(event.data.tab_groups, (tGroup)=>{return {label: tGroup.group_name, value: tGroup.group_name}})}] , tabApiName: event.data.tabApiName, groupName: event.data.groupName})\"\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u79FB\u52A8\",\n \"data\": {\n \"appId\": \"\\${event.data.appId}\",\n \"groups\": \"\\${event.data.groups}\",\n \"tabApiName\": \"\\${event.data.tabApiName}\",\n \"groupName\": \"\\${event.data.groupName}\",\n \"oldGroupName\": \"\\${event.data.groupName}\",\n },\n \"body\": [\n {\n \"type\": \"tree-select\",\n \"label\": \"\",\n \"name\": \"groupName\",\n \"id\": \"u:26d0b458ff51\",\n \"multiple\": false,\n \"source\": \"\\${groups}\"\n }\n ],\n \"id\": \"u:d69cbb95089a\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:12261bf51dcb\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:b144775ea124\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/move_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupName: context.groupName, oldGroupName: context.oldGroupName, tabName: context.tabApiName}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, tabName: context.tabApiName};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"if(event.data.children && event.data.children.length > 0){doAction({'actionType': 'toast','args': { 'msgType': 'warning', 'msg': '\u5206\u7EC4\u4E0B\u6709\u6570\u636E,\u7981\u6B62\u5220\u9664'}});event.stopPropagation();};\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_group\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupName: context.label};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n }\n ]\n },\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-plus\",\n \"hideCaret\": true,\n \"btnClassName\": \"!text-gray-700\",\n \"visibleOn\": \"!!allowEditApp && !!this.isGroup\",\n \"className\": \"hidden hover-inline-flex\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n }\n ]\n },\n ],\n \"source\": \"${items}\",\n //\u5DE6\u5C42\u663E\u793A\u65F6\u5BA1\u6279\u5355\u663E\u793Abadge\u6570\u91CF\n \"itemBadge\": {\n \"mode\": \"text\",\n \"text\": \"").concat(badgeText, "\",\n \"visibleOn\": \"${id == 'instance_tasks'}\",\n \"overflowCount\": 99,\n \"style\": stacked?{\n \"right\": \"20%\",\n \"margin-right\": \"-23px\",\n \"height\": \"20px\",\n \"border-radius\": \"10px\",\n \"font-size\": \"16px\",\n \"line-height\": \"18px\",\n \"top\": \"50%\"\n }:{\n \"transform\": \"translate(calc(50% - 17px), calc(-50% + 10px))\",\n \"border-radius\": \"6.5px\",\n \"height\": \"15px\",\n \"line-height\": \"13px\",\n \"padding\": \"0px 4px\",\n \"font-size\": \"12px\"\n }\n },\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n ]\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n\n setTimeout(function(){\n $(\"[name='keywords']\").focus();\n }, 300);\n\n return payload;\n "),
|
|
26054
26158
|
"headers": {
|
|
26055
26159
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
26056
26160
|
}
|
|
26057
26161
|
}
|
|
26058
26162
|
};
|
|
26059
|
-
// console.log(`schema=====>`, schema)
|
|
26163
|
+
// console.log(`AmisAppMenu schema=====>`, schema)
|
|
26060
26164
|
return [2 /*return*/, schema];
|
|
26061
26165
|
});
|
|
26062
26166
|
}); };
|
|
@@ -26120,7 +26224,7 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
|
|
|
26120
26224
|
* @Author: baozhoutao@steedos.com
|
|
26121
26225
|
* @Date: 2022-09-01 14:44:57
|
|
26122
26226
|
* @LastEditors: baozhoutao@steedos.com
|
|
26123
|
-
* @LastEditTime:
|
|
26227
|
+
* @LastEditTime: 2025-01-13 11:17:07
|
|
26124
26228
|
* @Description:
|
|
26125
26229
|
*/
|
|
26126
26230
|
var beforeMarkReadAllScript = "\n var hasUnRead = !!db.notifications.find({'$or':[{'is_read': null},{'is_read': false}]}).count();\n // \u6CA1\u6709\u8BA2\u9605\u5230\u672A\u8BFB\u901A\u77E5\u65F6\u9700\u8981\u989D\u5916\u5355\u72EC\u89E6\u53D1\u91CD\u65B0\u8BF7\u6C42\u901A\u77E5\u5217\u8868\u53CA\u672A\u8BFB\u6570\u91CF\n // \u5982\u679C\u6709\u8BA2\u9605\u5230\u7684\u8BDD\uFF0C\u56E0\u4E3A\u76D1\u542C\u8BA2\u9605\u5230\u7684\u901A\u77E5\u8BB0\u5F55\u53D8\u5316\uFF0C\u6709\u53D8\u5316\u4F1A\u89E6\u53D1@data.changed.notifications\u4E8B\u4EF6\uFF0C\u4ECE\u800C\u4F1A\u81EA\u52A8\u89E6\u53D1\u91CD\u65B0\u8BF7\u6C42\u901A\u77E5\u5217\u8868\u53CA\u672A\u8BFB\u6570\u91CF\n event.data.needToReload = !hasUnRead;\n";
|
|
@@ -26144,7 +26248,7 @@ var getNotificationBadgeButton = function () {
|
|
|
26144
26248
|
"name": "notifications",
|
|
26145
26249
|
"items": {
|
|
26146
26250
|
"type": "tpl",
|
|
26147
|
-
"tpl": "<div class='flex items-center p-
|
|
26251
|
+
"tpl": "<div class='flex items-center p-2 hover:bg-sky-50'>\n <img src='<%=data.context.rootUrl + \"/avatar/\" + data.from%>' alt='' class='h-10 w-10 flex-none rounded-full'>\n <div class='ml-4 flex-auto'>\n <div class='font-medium'>\n <span class='text-primary'><%=data.name%></span>\n </div>\n <div class='mt-1 text-gray-700'>\n <%=data.body%>\n </div>\n <div class='mt-1 text-gray-700'>\n <%=moment(data.created).locale(data.global.user.language).fromNow()%>\n <abbr class='slds-text-link slds-m-horizontal_xxx-small <%=data.is_read ? 'hidden' : ''%>' title='unread'>\u25CF</abbr>\n </div>\n </div>\n </div>",
|
|
26148
26252
|
"id": "u:07ece657c7b7",
|
|
26149
26253
|
"onEvent": {
|
|
26150
26254
|
"click": {
|
|
@@ -26675,17 +26779,17 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
26675
26779
|
* @Author: baozhoutao@steedos.com
|
|
26676
26780
|
* @Date: 2022-09-01 14:44:57
|
|
26677
26781
|
* @LastEditors: baozhoutao@steedos.com
|
|
26678
|
-
* @LastEditTime:
|
|
26782
|
+
* @LastEditTime: 2025-02-15 14:11:21
|
|
26679
26783
|
* @Description:
|
|
26680
26784
|
*/
|
|
26681
26785
|
var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
26682
|
-
var logoSrc, customButtons, isMobile, schema;
|
|
26786
|
+
var logoSrc, customButtons, className, isMobile, schema;
|
|
26683
26787
|
return __generator(this, function (_a) {
|
|
26684
|
-
logoSrc = props.logoSrc, customButtons = props.customButtons;
|
|
26788
|
+
logoSrc = props.logoSrc, customButtons = props.customButtons, className = props.className;
|
|
26685
26789
|
isMobile = window.innerWidth <= 768;
|
|
26686
26790
|
schema = {
|
|
26687
26791
|
"type": "wrapper",
|
|
26688
|
-
"className": 'p-0',
|
|
26792
|
+
"className": 'p-0' + (className ? " ".concat(className) : ''),
|
|
26689
26793
|
body: [
|
|
26690
26794
|
{
|
|
26691
26795
|
"type": "wrapper",
|
|
@@ -26851,7 +26955,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
26851
26955
|
"actions": [
|
|
26852
26956
|
{
|
|
26853
26957
|
"actionType": "custom",
|
|
26854
|
-
"script": "console.log(event.target); if(window.innerWidth < 768){ document.body.classList.remove('sidebar-open'); }",
|
|
26958
|
+
"script": "console.log('event.target===>', event.target); if(window.innerWidth < 768){ document.body.classList.remove('sidebar-open'); }",
|
|
26855
26959
|
}
|
|
26856
26960
|
]
|
|
26857
26961
|
}
|
|
@@ -26960,7 +27064,7 @@ function getLookupLinkOnClick(field, options) {
|
|
|
26960
27064
|
"title": " ",
|
|
26961
27065
|
"headerClassName": "hidden",
|
|
26962
27066
|
"size": "lg",
|
|
26963
|
-
"width": "70%",
|
|
27067
|
+
"width": window.drawerWidth || "70%",
|
|
26964
27068
|
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
26965
27069
|
"closeOnEsc": true,
|
|
26966
27070
|
"closeOnOutside": true,
|
|
@@ -27961,6 +28065,7 @@ function generateRandomString(length) {
|
|
|
27961
28065
|
// 通用函数生成器
|
|
27962
28066
|
var createFieldFunction = function (type) {
|
|
27963
28067
|
return function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28068
|
+
var schema;
|
|
27964
28069
|
var _a;
|
|
27965
28070
|
return __generator(this, function (_b) {
|
|
27966
28071
|
switch (_b.label) {
|
|
@@ -28023,22 +28128,13 @@ var createFieldFunction = function (type) {
|
|
|
28023
28128
|
};
|
|
28024
28129
|
}
|
|
28025
28130
|
}
|
|
28026
|
-
return [4 /*yield*/, AmisSteedosField(props)
|
|
28027
|
-
|
|
28028
|
-
|
|
28029
|
-
|
|
28030
|
-
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
];
|
|
28034
|
-
case 1: return [2 /*return*/, _b.sent()
|
|
28035
|
-
// {
|
|
28036
|
-
// type: "steedos-field",
|
|
28037
|
-
// config: Object.assign({}, props.config || {}, {
|
|
28038
|
-
// type: type
|
|
28039
|
-
// })
|
|
28040
|
-
// };
|
|
28041
|
-
];
|
|
28131
|
+
return [4 /*yield*/, AmisSteedosField(props)];
|
|
28132
|
+
case 1:
|
|
28133
|
+
schema = _b.sent();
|
|
28134
|
+
if (_$1.has(props, '$$editor')) {
|
|
28135
|
+
delete schema.visibleOn;
|
|
28136
|
+
}
|
|
28137
|
+
return [2 /*return*/, schema];
|
|
28042
28138
|
}
|
|
28043
28139
|
});
|
|
28044
28140
|
}); };
|
|
@@ -28111,7 +28207,7 @@ var AmisSteedosObject = function (props) {
|
|
|
28111
28207
|
};
|
|
28112
28208
|
|
|
28113
28209
|
var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28114
|
-
var formFactor, appId, objectApiName, display, data, _display, page, listSchema;
|
|
28210
|
+
var formFactor, appId, objectApiName, display, data, _display, page, listSchema, schema;
|
|
28115
28211
|
return __generator(this, function (_b) {
|
|
28116
28212
|
switch (_b.label) {
|
|
28117
28213
|
case 0:
|
|
@@ -28138,41 +28234,27 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
28138
28234
|
// "formFactor": formFactor,
|
|
28139
28235
|
// "className": (displayAs === 'split')? 'w-full': 'p-0 flex-1 m-0 sm:border sm:shadow sm:rounded border-gray-300 border-solid bg-gray-100'
|
|
28140
28236
|
};
|
|
28141
|
-
|
|
28142
|
-
|
|
28143
|
-
|
|
28144
|
-
|
|
28145
|
-
|
|
28146
|
-
|
|
28147
|
-
|
|
28148
|
-
|
|
28149
|
-
|
|
28150
|
-
|
|
28151
|
-
|
|
28152
|
-
// }
|
|
28153
|
-
// console.log("defData====>", defData)
|
|
28154
|
-
// console.timeEnd('PageListView')
|
|
28155
|
-
// const pageGridClassName = listSchema.pageGridClassName || 'h-full sm:p-3'
|
|
28156
|
-
// const pageSplitClassName = listSchema.pageSplitClassName || 'p-0 flex flex-1 overflow-hidden h-full'
|
|
28157
|
-
return [2 /*return*/, {
|
|
28158
|
-
type: 'service',
|
|
28159
|
-
className: {
|
|
28160
|
-
"h-full": "true",
|
|
28161
|
-
"page-list-grid": "${display != 'split'}",
|
|
28162
|
-
"page-list-split": "${display == 'split'}"
|
|
28163
|
-
},
|
|
28164
|
-
body: listSchema
|
|
28165
|
-
}];
|
|
28237
|
+
schema = {
|
|
28238
|
+
type: 'service',
|
|
28239
|
+
className: {
|
|
28240
|
+
"h-full": "true",
|
|
28241
|
+
"page-list-grid": "${display != 'split'}",
|
|
28242
|
+
"page-list-split": "${display == 'split'}"
|
|
28243
|
+
},
|
|
28244
|
+
body: listSchema
|
|
28245
|
+
};
|
|
28246
|
+
console.log("PageListView=====>", props, schema);
|
|
28247
|
+
return [2 /*return*/, schema];
|
|
28166
28248
|
}
|
|
28167
28249
|
});
|
|
28168
28250
|
}); };
|
|
28169
28251
|
|
|
28170
28252
|
var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28171
|
-
var defaultFormFactor, appId, objectApiName, display, data, _display, recordSchema, recordPage;
|
|
28253
|
+
var defaultFormFactor, appId, objectApiName, recordId, display, data, _display, recordSchema, recordPage, schema;
|
|
28172
28254
|
return __generator(this, function (_a) {
|
|
28173
28255
|
switch (_a.label) {
|
|
28174
28256
|
case 0:
|
|
28175
|
-
defaultFormFactor = props.formFactor, appId = props.appId, objectApiName = props.objectApiName, props.recordId, display = props.display, data = props.data;
|
|
28257
|
+
defaultFormFactor = props.formFactor, appId = props.appId, objectApiName = props.objectApiName, recordId = props.recordId, display = props.display, data = props.data;
|
|
28176
28258
|
_display = data.display || display;
|
|
28177
28259
|
if (_display) {
|
|
28178
28260
|
Router$1.setTabDisplayAs(objectApiName, _display);
|
|
@@ -28188,15 +28270,16 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
28188
28270
|
"body": [
|
|
28189
28271
|
{
|
|
28190
28272
|
"type": "steedos-record-detail",
|
|
28191
|
-
|
|
28192
|
-
"objectApiName":
|
|
28273
|
+
"recordId": _$1.has(props, 'recordId') ? recordId : data.recordId,
|
|
28274
|
+
"objectApiName": objectApiName,
|
|
28193
28275
|
// className: "sm:m-3",
|
|
28194
28276
|
appId: appId,
|
|
28195
28277
|
}
|
|
28196
28278
|
],
|
|
28197
28279
|
};
|
|
28198
28280
|
_a.label = 2;
|
|
28199
|
-
case 2:
|
|
28281
|
+
case 2:
|
|
28282
|
+
schema = {
|
|
28200
28283
|
type: 'service',
|
|
28201
28284
|
"className": 'h-full',
|
|
28202
28285
|
body: recordSchema,
|
|
@@ -28210,106 +28293,113 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
28210
28293
|
]
|
|
28211
28294
|
}
|
|
28212
28295
|
}
|
|
28213
|
-
}
|
|
28296
|
+
};
|
|
28297
|
+
// console.log(`PageRecordDetail===>`, schema, props)
|
|
28298
|
+
return [2 /*return*/, schema];
|
|
28214
28299
|
}
|
|
28215
28300
|
});
|
|
28216
28301
|
}); };
|
|
28217
28302
|
|
|
28218
28303
|
var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28219
|
-
var data, _a, $schema, uiSchema;
|
|
28304
|
+
var data, _a, $schema, objectName, uiSchema, schema;
|
|
28220
28305
|
return __generator(this, function (_b) {
|
|
28221
28306
|
switch (_b.label) {
|
|
28222
28307
|
case 0:
|
|
28223
28308
|
data = props.data, _a = props.$schema, $schema = _a === void 0 ? {} : _a;
|
|
28224
|
-
|
|
28309
|
+
objectName = $schema.data.objectName;
|
|
28310
|
+
if (objectName.startsWith('$')) {
|
|
28311
|
+
objectName = data.objectName;
|
|
28312
|
+
}
|
|
28313
|
+
return [4 /*yield*/, getUISchema(objectName, false)];
|
|
28225
28314
|
case 1:
|
|
28226
28315
|
uiSchema = _b.sent();
|
|
28227
28316
|
delete $schema.data.recordId;
|
|
28228
28317
|
window.Steedos && window.Steedos.setDocumentTitle && window.Steedos.setDocumentTitle({ tabName: uiSchema.label || uiSchema.name });
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28318
|
+
schema = {
|
|
28319
|
+
type: "service",
|
|
28320
|
+
data: $schema.data,
|
|
28321
|
+
className: "h-full",
|
|
28322
|
+
body: {
|
|
28323
|
+
type: 'service',
|
|
28324
|
+
className: {
|
|
28325
|
+
'h-full': "${display != 'split'}",
|
|
28326
|
+
'flex flex-1 overflow-hidden h-full': "${display == 'split'}"
|
|
28327
|
+
},
|
|
28328
|
+
data: {
|
|
28329
|
+
uiSchema: uiSchema
|
|
28330
|
+
},
|
|
28331
|
+
body: [
|
|
28332
|
+
{
|
|
28333
|
+
"type": "wrapper",
|
|
28334
|
+
"size": "none",
|
|
28335
|
+
"className": {
|
|
28336
|
+
"p-0 flex-shrink-0 min-w-[388px] w-fit lg:order-first lg:flex lg:flex-col": "${display == 'split'}",
|
|
28337
|
+
'h-full': "${display != 'split'}",
|
|
28338
|
+
},
|
|
28339
|
+
"body": {
|
|
28340
|
+
"name": "".concat(data.objectName, "-listview-").concat(data.listViewId),
|
|
28341
|
+
"type": "steedos-page-listview",
|
|
28342
|
+
"showHeader": true,
|
|
28343
|
+
"objectApiName": data.objectName,
|
|
28344
|
+
"appId": data.appId,
|
|
28345
|
+
"display": data.display,
|
|
28346
|
+
"columnsTogglable": false
|
|
28347
|
+
},
|
|
28348
|
+
"visibleOn": "${pageType === 'list' || (pageType === 'record' && display == 'split')}"
|
|
28242
28349
|
},
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
"
|
|
28248
|
-
|
|
28249
|
-
'h-full': "${display != 'split'}",
|
|
28250
|
-
},
|
|
28251
|
-
"body": {
|
|
28252
|
-
"name": "".concat(data.objectName, "-listview-").concat(data.listViewId),
|
|
28253
|
-
"type": "steedos-page-listview",
|
|
28254
|
-
"showHeader": true,
|
|
28255
|
-
"objectApiName": data.objectName,
|
|
28256
|
-
"appId": data.appId,
|
|
28257
|
-
"display": data.display,
|
|
28258
|
-
"columnsTogglable": false
|
|
28259
|
-
},
|
|
28260
|
-
"visibleOn": "${pageType === 'list' || (pageType === 'record' && display == 'split')}"
|
|
28350
|
+
{
|
|
28351
|
+
"type": "wrapper",
|
|
28352
|
+
"size": "none",
|
|
28353
|
+
"className": {
|
|
28354
|
+
"overflow-y-auto p-0 flex-1 focus:outline-none lg:order-last h-full": "${display == 'split'}",
|
|
28355
|
+
'h-full': "${display != 'split'}",
|
|
28261
28356
|
},
|
|
28262
|
-
{
|
|
28263
|
-
"
|
|
28264
|
-
"
|
|
28265
|
-
"
|
|
28266
|
-
|
|
28267
|
-
|
|
28268
|
-
|
|
28269
|
-
"
|
|
28270
|
-
|
|
28271
|
-
"type": "steedos-page-record-detail",
|
|
28272
|
-
"objectApiName": data.objectName,
|
|
28273
|
-
"sideObject": data.sideObject,
|
|
28274
|
-
"sideListviewId": data.sideListviewId,
|
|
28275
|
-
// "recordId": recordId,
|
|
28276
|
-
"display": data.display,
|
|
28277
|
-
"appId": data.appId
|
|
28278
|
-
},
|
|
28279
|
-
"visibleOn": "${pageType === 'record'}"
|
|
28357
|
+
"body": {
|
|
28358
|
+
"name": "".concat(data.objectName, "-recordDetail-").concat(data.recordId),
|
|
28359
|
+
"type": "steedos-page-record-detail",
|
|
28360
|
+
"objectApiName": data.objectName,
|
|
28361
|
+
"sideObject": data.sideObject,
|
|
28362
|
+
"sideListviewId": data.sideListviewId,
|
|
28363
|
+
// "recordId": recordId,
|
|
28364
|
+
"display": data.display,
|
|
28365
|
+
"appId": data.appId
|
|
28280
28366
|
},
|
|
28281
|
-
{
|
|
28282
|
-
|
|
28283
|
-
|
|
28284
|
-
|
|
28285
|
-
}
|
|
28286
|
-
|
|
28287
|
-
|
|
28288
|
-
|
|
28289
|
-
|
|
28290
|
-
|
|
28291
|
-
|
|
28292
|
-
|
|
28293
|
-
|
|
28294
|
-
|
|
28295
|
-
|
|
28296
|
-
|
|
28297
|
-
|
|
28298
|
-
|
|
28299
|
-
|
|
28300
|
-
|
|
28301
|
-
|
|
28302
|
-
}
|
|
28367
|
+
"visibleOn": "${pageType === 'record'}"
|
|
28368
|
+
},
|
|
28369
|
+
{
|
|
28370
|
+
"type": "tpl",
|
|
28371
|
+
"tpl": "无效的页面类型: ${pageType}",
|
|
28372
|
+
"visibleOn": "${pageType !== 'record' && pageType !== 'list'}"
|
|
28373
|
+
}
|
|
28374
|
+
]
|
|
28375
|
+
},
|
|
28376
|
+
// onEvent: {
|
|
28377
|
+
// "recordLoaded": {
|
|
28378
|
+
// "actions": [
|
|
28379
|
+
// {
|
|
28380
|
+
// "actionType": "setValue",
|
|
28381
|
+
// "args": {
|
|
28382
|
+
// "value": {
|
|
28383
|
+
// "steedos_selected_recordId": "${event.data.record._id}"
|
|
28384
|
+
// }
|
|
28385
|
+
// }
|
|
28386
|
+
// }
|
|
28387
|
+
// ]
|
|
28388
|
+
// }
|
|
28389
|
+
// }
|
|
28390
|
+
};
|
|
28391
|
+
console.log("PageObject=====>", props, schema);
|
|
28392
|
+
return [2 /*return*/, schema];
|
|
28303
28393
|
}
|
|
28304
28394
|
});
|
|
28305
28395
|
}); };
|
|
28306
28396
|
|
|
28307
|
-
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var n=this.object;if(r)return r.allowCreate&&n.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var a=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],n={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){a=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(a={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),a}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=React.useState(!0);var n=()=>{r(!1);};return _$1.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:n}),React__default["default"].createElement(o,_extends({visible:t,onCancel:n,onClose:n},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,n)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React__default["default"].createElement(newFunctionComponent(n),e);ReactDOM.createRoot(t).render(e);},Modal=_$1.assign(newComponentRender("modal",antd.Modal),{info:antd.Modal.info,success:antd.Modal.success,error:antd.Modal.error,warning:antd.Modal.warning,confirm:antd.Modal.confirm}),Drawer=newComponentRender("drawer",antd.Drawer),getGraphqlFieldsQuery=e=>{const t=["_id"];return e.push("record_permissions"),_$1.each(e,e=>{-1<e.indexOf(".")&&(e=e.split(".")[0]),t.push(""+e);}),""+t.join(" ")},getFindOneQuery=(e,t,r)=>{e=e.replace(/\./g,"_");r=getGraphqlFieldsQuery(r);let n="";t=[`id: "${t}"`];return `{record:${e}__findOne${n=0<t.length?`(${t.join(",")})`:n}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t);r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):_$1.isEmpty(t)?e.filters:[e.filters,"and",t]},getFirstListView:async e=>{e=await window.getUISchema(e);return _.first(_.sortBy(_.values(e.list_views),"sort_no"))}},Router={getAppPath({appId:e}){return "/app/"+e},getPagePath(){},getObjectListViewPath({appId:e,objectName:t,listViewName:r}){return `/app/${e}/${t}/grid/`+r},getObjectDetailPath({appId:e,objectName:t,recordId:r}){return `/app/${e}/${t}/view/`+r},getObjectRelatedViewPath({appId:e,masterObjectName:t,masterRecordId:r,objectName:n,foreignKey:o}){return `/app/${e}/${t}/${r}/${n}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return React.createElement(t,e)}},render=function(e,t,r,n){e=withModalWrap(e),e=React.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,n,o)=>{try{var a=window.Creator;if(!!(!a||!a.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return _$1.isNil(r)||(e=_$1.isArray(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),n}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,getGlobalNowData=()=>{var e=new Date,t=getMoment();let r=t().utc(),n=(r.set("hours",0),r.set("minutes",0),r.set("seconds",0),r.set("milliseconds",0),r=r.toDate(),t());return n.set("year",1970),n.set("month",0),n.set("date",1),n.set("hours",n.hours()+n.utcOffset()/60),n.set("seconds",0),n.set("milliseconds",0),n=n.toDate(),{now:e,today:r,timeNow:n}},parseSingleExpression=function(t,e,r,n){var o,a;if(n&&Object.assign(n,getGlobalNowData()),a=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{},"string"!=typeof t)return t;o="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,o)).replace(/\bglobal\b/g,JSON.stringify(n)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(a));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,getGlobalNowData:getGlobalNowData,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")||-1<express.indexOf("today")||-1<express.indexOf("timeNow")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},getFieldDefaultValue=(e,t)=>{if(!e)return null;let r=e.defaultValue;e._defaultValue&&(r=safeEval(`(${e._defaultValue})`)),_$1.isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),_$1.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var n=isExpression(r);switch(n&&("date"===e.type?r=r.replace(/\bglobal.now\b/g,"global.today"):"time"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.timeNow")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var o=e.data_type||"text";!r||n||e.multiple||("text"!==o||_$1.isString(r)?"number"===o&&_$1.isString(r)?r=Number(r):"boolean"===o&&_$1.isString(r)&&(r="true"===r.toLowerCase()||"1"===r):r=String(r));break;case"number":_$1.isString(r)&&(r=Number(r));break;case"boolean":_$1.isString(r)?r="true"===r.toLowerCase()||"1"===r:_$1.isBoolean(r)||(r=!1);break;case"time":if(_$1.isDate(r))return moment(r).format("1970-01-01THH:mm:00.000[Z]");case"date":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDT00:00:00.000[Z]");case"datetime":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDTHH:mm:00.000Z")}return r};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const r=e?.unfoldedNum||1,n=[],a=(e,t,r,n)=>{return e.children&&"object"==typeof e.children[0]?e.children:r?(e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=n?(e.unfolded=!0,e.children&&(e.children=a(e,t,e.children,n-1))):e.children&&(e.children=a(e,t,e.children,n));}),e):void 0};for(var s=t,i=0;i<s.length;i++)if(s[i].noParent=0,s[i].unfolded=!1,s[i].parent){let e=1;for(var l=0;l<s.length;l++)s[i].parent==s[l][o]&&(e=0);1==e&&(s[i].noParent=1);}else s[i].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:a(e,t,e.children,r-1)}))):n.push(Object.assign({},e,{children:a(e,t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let a=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(a)return a;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(a=getClosestAmisComponentByType(t.children[e],r,n));e++);return a}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:antd.message,notification:antd.notification,components:{Button:antd.Button,Space:antd.Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var a;return e&&t&&(a=e.split(/\s+/),a=_$1.compact(a),t.forEach(function(r,e){let n=[];1==a.length?n=[r,"contains",a[0]]:a.forEach(function(e,t){n.push([r,"contains",e]),t<a.length-1&&n.push("or");}),n.length&&(o.push(n),e<t.length-1&&o.push("or"));})),o},getFormulaVariables:(e,t=!0)=>{const r=[];return _$1.isEmpty(e)||(r.push({label:"表单字段",children:[]}),lodash.forEach(e,function(e){r[0].children.push({label:e.label,value:e.value});})),t&&r.push({label:"全局变量",children:[{label:"用户ID",value:"global['userId']"},{label:"工作区ID",value:"global['spaceId']"},{label:"用户",children:[{label:"姓名",value:"global['user']['name']"},{label:"邮件",value:"global['user']['email']"},{label:"语言",value:"global['user']['language']"},{label:"简档",value:"global['user']['profile']"},{label:"权限集",value:"global['user']['roles']"},{label:"主部门ID",value:"global['user']['organization']['_id']"},{label:"部门(含上级)",value:"global['user']['organizations_parents']"},{label:"主分部ID",value:"global['user']['company_id']"},{label:"分部(多选)",value:"global['user']['company_ids']"},{label:"人员ID",value:"global['user']['spaceUserId']"},{label:"是否是工作区管理员",value:"global['user']['is_space_admin']"}]}]}),r}});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
28397
|
+
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var o=this.object;if(r)return r.allowCreate&&o.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var n=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],o={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){n=e;},error:function(e,t,r){var o,a;e.responseJSON&&e.responseJSON.error?(o=e.responseJSON.error,a=void(n={error:o}),a=o.reason||o.message||o,console.error(a)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},o,t)),n}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,o=arguments[t];for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);}return e}).apply(this,arguments)}const newFunctionComponent=a=>e=>{const[t,r]=React.useState(!0);var o=()=>{r(!1);};return _$1.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:o}),React__default["default"].createElement(a,_extends({visible:t,onCancel:o,onClose:o},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,o)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React__default["default"].createElement(newFunctionComponent(o),e);ReactDOM.createRoot(t).render(e);},Modal=_$1.assign(newComponentRender("modal",antd.Modal),{info:antd.Modal.info,success:antd.Modal.success,error:antd.Modal.error,warning:antd.Modal.warning,confirm:antd.Modal.confirm}),Drawer=newComponentRender("drawer",antd.Drawer),getGraphqlFieldsQuery=e=>{const t=["_id"];return e.push("record_permissions"),_$1.each(e,e=>{-1<e.indexOf(".")&&(e=e.split(".")[0]),t.push(""+e);}),""+t.join(" ")},getFindOneQuery=(e,t,r)=>{e=e.replace(/\./g,"_");r=getGraphqlFieldsQuery(r);let o="";t=[`id: "${t}"`];return `{record:${e}__findOne${o=0<t.length?`(${t.join(",")})`:o}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t),r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):_$1.isEmpty(t)?e.filters:[e.filters,"and",t]},getFirstListView:async e=>{e=await window.getUISchema(e);return _.first(_.sortBy(_.values(e.list_views),"sort_no"))}},Router={getAppPath({appId:e}){return "/app/"+e},getPagePath(){},getObjectListViewPath({appId:e,objectName:t,listViewName:r}){return `/app/${e}/${t}/grid/`+r},getObjectDetailPath({appId:e,objectName:t,recordId:r}){return `/app/${e}/${t}/view/`+r},getObjectRelatedViewPath({appId:e,masterObjectName:t,masterRecordId:r,objectName:o,foreignKey:a}){return `/app/${e}/${t}/${r}/${o}/grid?related_field_name=`+a}};var withModalWrap=function(t,e){return function(e){return React__namespace.createElement(t,e)}},render=function(e,t,r,o){e=withModalWrap(e),e=React__namespace.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,o,a)=>{try{let e=[];return _$1.isNil(r)||(e=_$1.isArray(r)?r:[r]),t.bind(a||{})(...e)}catch(e){return console.log(e),o}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,getGlobalNowData=()=>{var e=new Date,t=getMoment();let r=t().utc(),o=(r.set("hours",0),r.set("minutes",0),r.set("seconds",0),r.set("milliseconds",0),r=r.toDate(),t());return o.set("year",1970),o.set("month",0),o.set("date",1),o.set("hours",o.hours()+o.utcOffset()/60),o.set("seconds",0),o.set("milliseconds",0),o=o.toDate(),{now:e,today:r,timeNow:o}},parseSingleExpression=function(t,e,r,o){var a,n;if(o&&Object.assign(o,getGlobalNowData()),n=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{},"string"!=typeof t)return t;a="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,a)).replace(/\bglobal\b/g,JSON.stringify(o)).replace(new RegExp("\\b"+a+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(n));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,getGlobalNowData:getGlobalNowData,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")||-1<express.indexOf("today")||-1<express.indexOf("timeNow")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},getFieldDefaultValue=(e,t)=>{if(!e)return null;let r=e.defaultValue;e._defaultValue&&(r=safeEval(`(${e._defaultValue})`)),_$1.isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),_$1__namespace.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var o=isExpression(r);switch(o&&("date"===e.type?r=r.replace(/\bglobal.now\b/g,"global.today"):"time"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.timeNow")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var a=e.data_type||"text";!r||o||e.multiple||("text"!==a||_$1.isString(r)?"number"===a&&_$1.isString(r)?r=Number(r):"boolean"===a&&_$1.isString(r)&&(r="true"===r.toLowerCase()||"1"===r):r=String(r));break;case"number":_$1.isString(r)&&(r=Number(r));break;case"boolean":_$1.isString(r)?r="true"===r.toLowerCase()||"1"===r:_$1.isBoolean(r)||(r=!1);break;case"time":if(_$1.isDate(r))return moment(r).format("1970-01-01THH:mm:00.000[Z]");case"date":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDT00:00:00.000[Z]");case"datetime":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDTHH:mm:00.000Z")}return r};function getTreeOptions(t,e){const a=e?.valueField||"value",r=(e?.labelField,e?.unfoldedNum||1),o=[],n=(e,t,r,o)=>{return e.children&&"object"==typeof e.children[0]?e.children:r?(e=_.filter(t,e=>_.includes(r,e[a])),_.each(e,e=>{1<=o?(e.unfolded=!0,e.children&&(e.children=n(e,t,e.children,o-1))):e.children&&(e.children=n(e,t,e.children,o));}),e):void 0};for(var s=t,i=0;i<s.length;i++)if(s[i].noParent=0,s[i].unfolded=!1,s[i].parent){let e=1;for(var l=0;l<s.length;l++)s[i].parent==s[l][a]&&(e=0);1==e&&(s[i].noParent=1);}else s[i].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,o.push(Object.assign({},e,{children:n(e,t,e.children,r-1)}))):o.push(Object.assign({},e,{children:n(e,t,e.children,r)})));}),o}function getClosestAmisComponentByType(t,r,o){let a=(o=o||{}).name;var e=o.direction||"up";let n=t.getComponents().find(function(e){return e.props.type===r&&(!a||e.props.name===a)});if(n)return n;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(n=getClosestAmisComponentByType(t.children[e],r,o));e++);return n}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,o)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:antd.message,notification:antd.notification,components:{Button:antd.Button,Space:antd.Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var a=[];return _.each(e,(e,t)=>{var r,o;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?a.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?a.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(o=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&o.push([r+"/ids","=",e.ids]),a.push(o)):a.push([""+t.replace("__searchable__",""),"=",e])));}),a},getKeywordsSearchFilter:(e,t)=>{const a=[];var n;return e&&t&&(n=e.split(/\s+/),n=_$1.compact(n),t.forEach(function(r,e){let o=[];1==n.length?o=[r,"contains",n[0]]:n.forEach(function(e,t){o.push([r,"contains",e]),t<n.length-1&&o.push("or");}),o.length&&(a.push(o),e<t.length-1&&a.push("or"));})),a},getFormulaVariables:(e,t=!0)=>{const r=[];return _$1.isEmpty(e)||(r.push({label:"表单字段",children:[]}),lodash.forEach(e,function(e){r[0].children.push({label:e.label,value:e.value});})),t&&r.push({label:"全局变量",children:[{label:"用户ID",value:"global['userId']"},{label:"工作区ID",value:"global['spaceId']"},{label:"用户",children:[{label:"姓名",value:"global['user']['name']"},{label:"邮件",value:"global['user']['email']"},{label:"语言",value:"global['user']['language']"},{label:"简档",value:"global['user']['profile']"},{label:"权限集",value:"global['user']['roles']"},{label:"主部门ID",value:"global['user']['organization']['_id']"},{label:"部门(含上级)",value:"global['user']['organizations_parents']"},{label:"主分部ID",value:"global['user']['company_id']"},{label:"分部(多选)",value:"global['user']['company_ids']"},{label:"人员ID",value:"global['user']['spaceUserId']"},{label:"是否是工作区管理员",value:"global['user']['is_space_admin']"}]}]}),r}});var _STANDARD_SPRITE_IDS="account,account_info,action_list_component,actions_and_buttons,activation_target,activations,address,agent_home,agent_session,aggregation_policy,all,announcement,answer_best,answer_private,answer_public,apex,apex_plugin,app,approval,apps,apps_admin,article,asset_action,asset_action_source,asset_audit,asset_downtime_period,asset_object,asset_relationship,asset_state_period,asset_warranty,assigned_resource,assignment,attach,avatar,avatar_loading,bot,bot_training,branch_merge,brand,budget,budget_allocation,bundle_config,bundle_policy,business_hours,buyer_account,buyer_group,calculated_insights,calibration,call,call_coaching,call_history,campaign,campaign_members,cancel_checkout,canvas,capacity_plan,care_request_reviewer,carousel,case,case_change_status,case_comment,case_email,case_log_a_call,case_milestone,case_transcript,case_wrap_up,catalog,category,change_request,channel_program_history,channel_program_levels,channel_program_members,channel_programs,chart,checkout,choice,client,cms,coaching,code_playground,code_set,code_set_bundle,collection,collection_variable,connected_apps,constant,contact,contact_list,contact_request,contract,contract_line_item,contract_payment,coupon_codes,currency,currency_input,custom,custom_component_task,custom_notification,customer_360,customer_lifecycle_analytics,customer_portal_users,customers,dashboard,dashboard_component,dashboard_ea,data_integration_hub,data_mapping,data_model,data_streams,datadotcom,dataset,date_input,date_time,decision,default,delegated_account,device,discounts,display_rich_text,display_text,document,document_reference,drafts,duration_downscale,dynamic_record_choice,education,einstein_replies,email,email_chatter,employee,employee_asset,employee_contact,employee_job,employee_job_position,employee_organization,empty,endorsement,entitlement,entitlement_policy,entitlement_process,entitlement_template,entity,entity_milestone,environment_hub,event,events,expense,expense_report,expense_report_entry,feed,feedback,field_sales,file,filter,filter_criteria,filter_criteria_rule,first_non_empty,flow,folder,forecasts,form,formula,fulfillment_order,generic_loading,global_constant,goals,group_loading,groups,guidance_center,hierarchy,high_velocity_sales,historical_adherence,holiday_operating_hours,home,household,identifier,immunization,incident,individual,insights,instore_locations,investment_account,invocable_action,iot_context,iot_orchestrations,javascript_button,job_family,job_position,job_profile,kanban,key_dates,knowledge,lead,lead_insights,lead_list,letterhead,lightning_component,lightning_usage,link,list_email,live_chat,live_chat_visitor,location,location_permit,log_a_call,logging,loop,macros,maintenance_asset,maintenance_plan,maintenance_work_rule,marketing_actions,med_rec_recommendation,med_rec_statement_recommendation,medication,medication_dispense,medication_ingredient,medication_reconciliation,medication_statement,merge,messaging_conversation,messaging_session,messaging_user,metrics,multi_picklist,multi_select_checkbox,network_contract,news,note,number_input,observation_component,omni_supervisor,operating_hours,opportunity,opportunity_contact_role,opportunity_splits,orchestrator,order_item,orders,outcome,output,partner_fund_allocation,partner_fund_claim,partner_fund_request,partner_marketing_budget,partners,password,past_chat,patient_medication_dosage,payment_gateway,people,performance,person_account,person_language,person_name,photo,picklist_choice,picklist_type,planogram,poll,portal,portal_roles,portal_roles_and_subordinates,post,practitioner_role,price_book_entries,price_books,pricebook,pricing_workspace,problem,procedure,procedure_detail,process,process_exception,product,product_consumed,product_consumed_state,product_item,product_item_transaction,product_quantity_rules,product_request,product_request_line_item,product_required,product_service_campaign,product_service_campaign_item,product_transfer,product_transfer_state,product_warranty_term,product_workspace,products,promotion_segments,promotions,promotions_workspace,propagation_policy,proposition,qualifications,question_best,question_feed,queue,quick_text,quip,quip_sheet,quotes,radio_button,read_receipts,recent,recipe,record,record_create,record_delete,record_lookup,record_signature_task,record_update,recycle_bin,related_list,relationship,reply_text,report,report_type,resource_absence,resource_capacity,resource_preference,resource_skill,restriction_policy,return_order,return_order_line_item,reward,rtc_presence,sales_cadence,sales_cadence_target,sales_channel,sales_path,sales_value,salesforce_cms,scan_card,schedule_objective,scheduling_constraint,scheduling_policy,screen,search,section,segments,selling_model,serialized_product,serialized_product_transaction,service_appointment,service_appointment_capacity_usage,service_contract,service_crew,service_crew_member,service_report,service_request,service_request_detail,service_resource,service_territory,service_territory_location,service_territory_member,service_territory_policy,settings,shift,shift_pattern,shift_pattern_entry,shift_preference,shift_scheduling_operation,shift_template,shift_type,shipment,skill,skill_entity,skill_requirement,slack,slider,sms,snippet,snippets,sobject,sobject_collection,social,solution,sort,sort_policy,sossession,stage,stage_collection,steps,store,store_group,story,strategy,survey,swarm_request,swarm_session,system_and_global_variable,tableau,task,task2,team_member,template,text,text_template,textarea,textbox,thanks,thanks_loading,timesheet,timesheet_entry,timeslot,today,toggle,topic,topic2,tour,tour_check,trailhead,trailhead_alt,travel_mode,unified_health_score,unmatched,user,user_role,variable,variation_attribute_setup,variation_products,video,visit_templates,visits,visualforce_page,voice_call,waits,warranty_term,webcart,work_capacity_limit,work_capacity_usage,work_contract,work_forecast,work_order,work_order_item,work_plan,work_plan_rule,work_plan_template,work_plan_template_entry,work_queue,work_step,work_step_template,work_type,work_type_group,workforce_engagement";const sldsIcons={standard:_STANDARD_SPRITE_IDS.split(",")};var organizationsTree={getSearchableFields:function(e){var a=["text","textarea","autonumber","url","email"];var n=[],s=e.context.uiSchema;return s&&_$1__namespace.each(s.fields,function(e){var t,r,o;t=e,r=s.NAME_FIELD_KEY,(o=!1!==(o=t.searchable)&&t.name===r?!0:o)&&-1<a.indexOf(t.type)&&n.push(e.name);}),n},getApiRequestAdaptor:function(e,t,r){var o="__keywords";if((r=void 0===r?{}:r).isLookup){if("loadOptions"===t.op)return a=[["_id","=",t.value]],Object.assign({},e,{method:"post",url:"/graphql",data:{query:"{rows:organizations(filters: "+JSON.stringify(a)+', top: 5000, skip: 0, sort: "sort_no desc"){_id,fullname,name,sort_no,_display:_ui{sort_no},parent,children}}'}});(r=t.__lookupField)?o="__keywords_lookup__".concat(r.name.replace(/\./g,"_"),"__to__").concat(r.reference_to):(o="",console.error("lookup字段快速搜索异常,作用域中未找到变量__lookupField"));}var t=this.getSearchableFields(e),a=[],n=JSON.parse(JSON.stringify(e.context)),r=SteedosUI$1.getSearchFilter(n)||[],r=(0<r.length&&(a=0<a.length?[a,"and",r]:r),t&&t.forEach(function(e){var t=n[e];_$1__namespace.isString(t)?a.push([e,"contains",t]):(_$1__namespace.isArray(t)||_$1__namespace.isBoolean(t)||t)&&a.push([e,"=",t]);}),SteedosUI$1.getKeywordsSearchFilter(n[o],t)),o=(r&&0<r.length&&a.push(r),e.data={},0<a.length&&Object.assign(e.data,{filters:JSON.stringify(a)}),e.body&&e.body.queryFields);return o&&Object.assign(e.data,{fields:o}),e.body.$self&&(e.body.$self.context&&e.body.$self.context.rootUrl,e.url="/service/api/organizations/root"),e},getApiAdaptor:function(e,t,r,o,a){return (a=void 0===a?{}:a).isLookup&&"loadOptions"===o.op?(a=_$1__namespace.map(e.data.rows,function(e){return delete e.children,delete e.parent,e}),e.data.rows=a):(o=r.data&&r.data.filters,e.data=__assign(__assign({},e.data),{isFilter:!!o}),e.data.__rootQueryFields=r.data&&r.data.fields,(e.data.rows||[]).forEach(function(e){e.__rootQueryFields=r.data&&r.data.fields;})),e},getDeferApiRequestAdaptor:function(e,t,r){var o=[],a=JSON.parse(JSON.stringify(e.context))._id,a=(a&&(o=[["parent","=",a]]),t&&t.__rootQueryFields||"_id,fullname,name,sort_no,hidden,_display:_ui{sort_no,hidden},parent,children");return Object.assign({},e,{data:{query:"{rows:organizations(filters: "+JSON.stringify(o)+', top: 5000, skip: 0, sort: "sort_no desc"){'+a+"}}"}})},getDeferApiAdaptor:function(e,t,r,o,a){var n=e.data;return n.children||(n.rows=n.rows.map(function(e){return e.defer=!(!e.children||!e.children.length),delete e.children,e}),n.children=n.rows,delete n.rows,delete n.count),e}},getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({resources:{sldsIcons:sldsIcons},organizationsTree:organizationsTree,getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"!=typeof window&&(window.Steedos?window.Steedos=Object.assign(Steedos$1,window.Steedos):window.Steedos=Steedos$1),"undefined"!=typeof window&&(window.SteedosUI?window.SteedosUI=Object.assign(SteedosUI$1,window.SteedosUI):window.SteedosUI=SteedosUI$1);
|
|
28308
28398
|
|
|
28309
28399
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
28310
|
-
|
|
28311
|
-
|
|
28312
|
-
|
|
28400
|
+
__proto__: null,
|
|
28401
|
+
Steedos: Steedos$1,
|
|
28402
|
+
SteedosUI: SteedosUI$1
|
|
28313
28403
|
});
|
|
28314
28404
|
|
|
28315
28405
|
exports.AmisAppLauncher = AmisAppLauncher;
|