ronds-metadata 1.0.77 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +97 -43
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +4 -4
- package/es/comps/MetadataEdit/index.js +1 -1
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +1 -1
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +4 -4
- package/es/comps/MetadataForm/DataCell/Array.js +3 -3
- package/es/comps/MetadataForm/DataCell/Ref.js +4 -4
- package/es/comps/MetadataForm/index.js +14 -4
- package/es/comps/MetadataForm/utils.d.ts +1 -1
- package/es/comps/MetadataForm/utils.js +2 -2
- package/es/config.d.ts +4 -1
- package/es/config.js +22 -2
- package/es/framework/libs/jquery.min.js +4022 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -2
- package/es/theme.css +10 -0
- package/package.json +2 -2
@@ -61,28 +61,27 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
61
61
|
while (1) {
|
62
62
|
switch (_context.prev = _context.next) {
|
63
63
|
case 0:
|
64
|
-
if (!(_refId.indexOf('Rule.Form') > -1)) {
|
65
|
-
_context.next = 12;
|
66
|
-
break;
|
67
|
-
}
|
68
|
-
|
69
64
|
server = new MetadataService();
|
70
|
-
_context.next =
|
65
|
+
_context.next = 3;
|
71
66
|
return server.GetMetadataDetailById(_refId);
|
72
67
|
|
73
|
-
case
|
68
|
+
case 3:
|
74
69
|
res = _context.sent;
|
75
70
|
_schema = JSON.parse(res.schema);
|
76
71
|
_properties = _schema[0].properties;
|
77
|
-
|
78
|
-
|
79
|
-
|
72
|
+
|
73
|
+
if (_refId === 'com.ronds.schema.default.Rule.Form') {
|
74
|
+
_properties = _properties.filter(function (it) {
|
75
|
+
return it.id === 'common' || it.id === type;
|
76
|
+
});
|
77
|
+
}
|
78
|
+
|
80
79
|
_schema[0].properties = _properties;
|
81
80
|
_refSchema = refSchema;
|
82
81
|
_refSchema[idx] = _schema;
|
83
82
|
setRefSchema(_objectSpread({}, _refSchema));
|
84
83
|
|
85
|
-
case
|
84
|
+
case 11:
|
86
85
|
case "end":
|
87
86
|
return _context.stop();
|
88
87
|
}
|
@@ -97,22 +96,32 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
97
96
|
|
98
97
|
var onRefSelectChange = React.useCallback( /*#__PURE__*/function () {
|
99
98
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, index) {
|
100
|
-
var _refIds, newData;
|
99
|
+
var _refIds, _refSchema, newData;
|
101
100
|
|
102
101
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
103
102
|
while (1) {
|
104
103
|
switch (_context2.prev = _context2.next) {
|
105
104
|
case 0:
|
106
|
-
|
107
|
-
|
105
|
+
_refIds = refIds;
|
106
|
+
|
107
|
+
if (!(value && value.indexOf('Rule.Form') > -1)) {
|
108
|
+
_context2.next = 6;
|
108
109
|
break;
|
109
110
|
}
|
110
111
|
|
111
|
-
_context2.next =
|
112
|
+
_context2.next = 4;
|
112
113
|
return processSpecialRuleData(value, index);
|
113
114
|
|
114
|
-
case
|
115
|
-
|
115
|
+
case 4:
|
116
|
+
_context2.next = 9;
|
117
|
+
break;
|
118
|
+
|
119
|
+
case 6:
|
120
|
+
_refSchema = refSchema;
|
121
|
+
_refSchema[index] = undefined;
|
122
|
+
setRefSchema(_objectSpread({}, _refSchema));
|
123
|
+
|
124
|
+
case 9:
|
116
125
|
_refIds[index] = value;
|
117
126
|
setRefIds(_objectSpread({}, _refIds));
|
118
127
|
newData = form.getFieldValue('fields');
|
@@ -121,7 +130,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
121
130
|
fields: newData
|
122
131
|
});
|
123
132
|
|
124
|
-
case
|
133
|
+
case 14:
|
125
134
|
case "end":
|
126
135
|
return _context2.stop();
|
127
136
|
}
|
@@ -148,47 +157,92 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
148
157
|
}];
|
149
158
|
_refIds = refIds;
|
150
159
|
_ruleTypes = ruleTypes;
|
151
|
-
|
160
|
+
|
161
|
+
if (!(_defaultValues[0].refId.indexOf('Rule.Form') > -1)) {
|
162
|
+
_context3.next = 6;
|
163
|
+
break;
|
164
|
+
}
|
165
|
+
|
166
|
+
_context3.next = 6;
|
152
167
|
return processSpecialRuleData(_defaultValues[0].refId, 0);
|
153
168
|
|
154
|
-
case
|
169
|
+
case 6:
|
155
170
|
_refIds[0] = _defaultValues[0].refId;
|
156
|
-
_ruleTypes[0] = 'ref';
|
157
171
|
setRefIds(_objectSpread({}, _refIds));
|
172
|
+
_ruleTypes[0] = 'ref';
|
158
173
|
setRuleTypes(_objectSpread({}, _ruleTypes));
|
159
174
|
form.setFieldsValue({
|
160
175
|
fields: _defaultValues
|
161
176
|
});
|
162
177
|
|
163
|
-
case
|
178
|
+
case 11:
|
164
179
|
case "end":
|
165
180
|
return _context3.stop();
|
166
181
|
}
|
167
182
|
}
|
168
183
|
}, _callee3);
|
169
|
-
})), []);
|
170
|
-
React.
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
184
|
+
})), [form]);
|
185
|
+
var processDefaultValues = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
186
|
+
var _ruleTypes, _refIds, i;
|
187
|
+
|
188
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
189
|
+
while (1) {
|
190
|
+
switch (_context4.prev = _context4.next) {
|
191
|
+
case 0:
|
192
|
+
_ruleTypes = ruleTypes;
|
193
|
+
_refIds = refIds;
|
194
|
+
form.setFieldsValue({
|
195
|
+
fields: defaultValues
|
196
|
+
});
|
197
|
+
i = 0;
|
198
|
+
|
199
|
+
case 4:
|
200
|
+
if (!(i < defaultValues.length)) {
|
201
|
+
_context4.next = 14;
|
202
|
+
break;
|
203
|
+
}
|
204
|
+
|
205
|
+
_ruleTypes[i] = defaultValues[i].type;
|
177
206
|
|
178
|
-
|
179
|
-
|
207
|
+
if (!(defaultValues[i].type === 'ref')) {
|
208
|
+
_context4.next = 11;
|
209
|
+
break;
|
210
|
+
}
|
180
211
|
|
181
|
-
|
182
|
-
|
212
|
+
if (!(defaultValues[i].refId.indexOf('Rule.Form') > -1)) {
|
213
|
+
_context4.next = 10;
|
214
|
+
break;
|
215
|
+
}
|
216
|
+
|
217
|
+
_context4.next = 10;
|
218
|
+
return processSpecialRuleData(defaultValues[i].refId, i);
|
219
|
+
|
220
|
+
case 10:
|
221
|
+
_refIds[i] = defaultValues[i].refId;
|
222
|
+
|
223
|
+
case 11:
|
224
|
+
i++;
|
225
|
+
_context4.next = 4;
|
226
|
+
break;
|
227
|
+
|
228
|
+
case 14:
|
229
|
+
setRefIds(_objectSpread({}, _refIds));
|
230
|
+
setRuleTypes(_objectSpread({}, _ruleTypes));
|
231
|
+
|
232
|
+
case 16:
|
233
|
+
case "end":
|
234
|
+
return _context4.stop();
|
183
235
|
}
|
184
236
|
}
|
185
|
-
|
186
|
-
|
187
|
-
|
237
|
+
}, _callee4);
|
238
|
+
})), [form]);
|
239
|
+
React.useEffect(function () {
|
240
|
+
if (defaultValues) {
|
241
|
+
processDefaultValues();
|
188
242
|
} else {
|
189
243
|
processInitRule();
|
190
244
|
}
|
191
|
-
}, [defaultValues,
|
245
|
+
}, [defaultValues, processInitRule, processDefaultValues]);
|
192
246
|
|
193
247
|
var onFinish = function onFinish(values) {
|
194
248
|
var _fields = values.fields;
|
@@ -222,9 +276,9 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
222
276
|
}
|
223
277
|
}, /*#__PURE__*/React.createElement(_Form.List, {
|
224
278
|
name: "fields"
|
225
|
-
}, function (fields,
|
226
|
-
var add =
|
227
|
-
remove =
|
279
|
+
}, function (fields, _ref5) {
|
280
|
+
var add = _ref5.add,
|
281
|
+
remove = _ref5.remove;
|
228
282
|
return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
|
229
283
|
var _defaultValues$index;
|
230
284
|
|
@@ -327,9 +381,9 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
327
381
|
onClick: function onClick() {
|
328
382
|
return remove(field.name);
|
329
383
|
}
|
330
|
-
}))), refIds[index] && /*#__PURE__*/React.createElement("div", {
|
384
|
+
}))), (refIds[index] || refSchema[index]) && /*#__PURE__*/React.createElement("div", {
|
331
385
|
style: {
|
332
|
-
border: '
|
386
|
+
border: 'var(--color-border-1)',
|
333
387
|
padding: '10px',
|
334
388
|
marginBottom: '10px'
|
335
389
|
}
|
@@ -130,7 +130,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
130
130
|
case 'number':
|
131
131
|
return /*#__PURE__*/React.createElement("div", {
|
132
132
|
style: {
|
133
|
-
border: '
|
133
|
+
border: 'var(--color-border-1)',
|
134
134
|
padding: '10px',
|
135
135
|
marginBottom: '10px'
|
136
136
|
}
|
@@ -154,7 +154,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
154
154
|
case 'ref':
|
155
155
|
return /*#__PURE__*/React.createElement("div", {
|
156
156
|
style: {
|
157
|
-
border: '1px solid
|
157
|
+
border: '1px solid var(--color-border-1)',
|
158
158
|
padding: '10px',
|
159
159
|
display: 'flex',
|
160
160
|
alignItems: 'center',
|
@@ -214,7 +214,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
214
214
|
case 'array':
|
215
215
|
return /*#__PURE__*/React.createElement("div", {
|
216
216
|
style: {
|
217
|
-
border: '1px solid
|
217
|
+
border: '1px solid var(--color-border-1)',
|
218
218
|
borderRadius: '5px',
|
219
219
|
padding: '10px',
|
220
220
|
marginBottom: '10px',
|
@@ -301,7 +301,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
301
301
|
case 'enum':
|
302
302
|
return /*#__PURE__*/React.createElement("div", {
|
303
303
|
style: {
|
304
|
-
border: '1px solid
|
304
|
+
border: '1px solid var(--color-border-1)',
|
305
305
|
padding: '10px',
|
306
306
|
marginBottom: '10px'
|
307
307
|
}
|
@@ -128,7 +128,7 @@ var MetadataEdit = function MetadataEdit(props) {
|
|
128
128
|
|
129
129
|
var _properties_ref = metaSchemaRef.current.properties || [];
|
130
130
|
|
131
|
-
var _properties = _properties_from.length
|
131
|
+
var _properties = _properties_from.length >= _properties_ref.length ? _properties_from : _properties_ref;
|
132
132
|
|
133
133
|
var _curFields = _properties[index];
|
134
134
|
|
@@ -208,7 +208,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
208
208
|
}
|
209
209
|
}))), refIds[index] && /*#__PURE__*/React.createElement("div", {
|
210
210
|
style: {
|
211
|
-
border: '1px solid
|
211
|
+
border: '1px solid var(--color-border-1)',
|
212
212
|
padding: '10px',
|
213
213
|
marginBottom: '10px'
|
214
214
|
}
|
@@ -158,7 +158,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
158
158
|
case 'number':
|
159
159
|
return /*#__PURE__*/React.createElement("div", {
|
160
160
|
style: {
|
161
|
-
border: '1px solid
|
161
|
+
border: '1px solid var(--color-border-1)',
|
162
162
|
padding: '10px',
|
163
163
|
marginBottom: '10px'
|
164
164
|
}
|
@@ -179,7 +179,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
179
179
|
case 'ref':
|
180
180
|
return /*#__PURE__*/React.createElement("div", {
|
181
181
|
style: {
|
182
|
-
border: '1px solid
|
182
|
+
border: '1px solid var(--color-border-1)',
|
183
183
|
padding: '10px',
|
184
184
|
display: 'flex',
|
185
185
|
alignItems: 'center',
|
@@ -231,7 +231,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
231
231
|
case 'array':
|
232
232
|
return /*#__PURE__*/React.createElement("div", {
|
233
233
|
style: {
|
234
|
-
border: '1px solid
|
234
|
+
border: '1px solid var(--color-border-1)',
|
235
235
|
borderRadius: '5px',
|
236
236
|
padding: '10px',
|
237
237
|
marginBottom: '10px',
|
@@ -309,7 +309,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
309
309
|
case 'enum':
|
310
310
|
return /*#__PURE__*/React.createElement("div", {
|
311
311
|
style: {
|
312
|
-
border: '1px solid
|
312
|
+
border: '1px solid var(--color-border-1)',
|
313
313
|
padding: '10px',
|
314
314
|
marginBottom: '10px'
|
315
315
|
}
|
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
/*
|
9
9
|
* @Author: wangxian
|
10
10
|
* @Date: 2021-09-18 14:15:04
|
11
|
-
* @LastEditTime: 2022-05-
|
11
|
+
* @LastEditTime: 2022-05-07 10:48:55
|
12
12
|
*/
|
13
13
|
import React from 'react';
|
14
14
|
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
@@ -49,7 +49,7 @@ function Index(props) {
|
|
49
49
|
}, [name, id]);
|
50
50
|
React.useEffect(function () {
|
51
51
|
if (items && items.refId) {
|
52
|
-
var arr = items.refId.split('
|
52
|
+
var arr = items.refId.split('.');
|
53
53
|
setHelp(arr[arr.length - 1]);
|
54
54
|
}
|
55
55
|
}, [items]);
|
@@ -73,7 +73,7 @@ function Index(props) {
|
|
73
73
|
}, help || (items === null || items === void 0 ? void 0 : items.type))), /*#__PURE__*/React.createElement("div", {
|
74
74
|
style: {
|
75
75
|
padding: '10px',
|
76
|
-
border: '1px solid
|
76
|
+
border: '1px solid var(--color-border-1)',
|
77
77
|
width: '100%',
|
78
78
|
borderRadius: '4px'
|
79
79
|
}
|
@@ -161,7 +161,7 @@ function Index(props) {
|
|
161
161
|
}, extraInfo.label || id)), /*#__PURE__*/React.createElement("div", {
|
162
162
|
style: {
|
163
163
|
padding: '10px',
|
164
|
-
border: '1px solid
|
164
|
+
border: '1px solid var(--color-border-1)',
|
165
165
|
width: '100%',
|
166
166
|
borderRadius: '4px'
|
167
167
|
}
|
@@ -169,14 +169,14 @@ function Index(props) {
|
|
169
169
|
value: {
|
170
170
|
fields: refFieldsRef.current
|
171
171
|
}
|
172
|
-
}, renderForm(schema, formOptions))));
|
172
|
+
}, renderForm(schema, formOptions, formContext.stream$))));
|
173
173
|
}
|
174
174
|
|
175
175
|
if (isRefForm && field && schema.length > 0) {
|
176
176
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
177
177
|
style: {
|
178
178
|
padding: '10px',
|
179
|
-
border: '1px solid
|
179
|
+
border: '1px solid var(--color-border-1)',
|
180
180
|
width: '100%',
|
181
181
|
borderRadius: '4px'
|
182
182
|
}
|
@@ -184,7 +184,7 @@ function Index(props) {
|
|
184
184
|
value: {
|
185
185
|
fields: refFieldsRef.current
|
186
186
|
}
|
187
|
-
}, renderForm(schema, formOptions))));
|
187
|
+
}, renderForm(schema, formOptions, formContext.stream$))));
|
188
188
|
}
|
189
189
|
|
190
190
|
return !field ? /*#__PURE__*/React.createElement(_Form.Item, {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
3
|
import "antd/es/form/style";
|
3
4
|
import _Form from "antd/es/form";
|
@@ -46,6 +47,8 @@ var MetadataForm = function MetadataForm(props) {
|
|
46
47
|
if ((p === null || p === void 0 ? void 0 : p.type) === 'onSelectChange') {
|
47
48
|
onSelectChange && onSelectChange(p.payload);
|
48
49
|
}
|
50
|
+
|
51
|
+
if ((p === null || p === void 0 ? void 0 : p.type) === 'onRenderAfter') {}
|
49
52
|
}, [stream$]);
|
50
53
|
var options = React.useMemo(function () {
|
51
54
|
return {
|
@@ -73,7 +76,7 @@ var MetadataForm = function MetadataForm(props) {
|
|
73
76
|
if (refId && !schema) {
|
74
77
|
var server = new MetadataService();
|
75
78
|
server.GetMetadataDetailById(refId).then(function (res) {
|
76
|
-
var _schema = JSON.parse(res.schema);
|
79
|
+
var _schema = JSON.parse(res.schema) || [];
|
77
80
|
|
78
81
|
setMySchema(_toConsumableArray(_schema));
|
79
82
|
});
|
@@ -94,6 +97,13 @@ var MetadataForm = function MetadataForm(props) {
|
|
94
97
|
|
95
98
|
return function () {};
|
96
99
|
}, [mySchma]);
|
100
|
+
React.useEffect(function () {
|
101
|
+
if (initialValues) {
|
102
|
+
setTimeout(function () {
|
103
|
+
form.setFieldsValue(_objectSpread({}, initialValues));
|
104
|
+
}, 500);
|
105
|
+
}
|
106
|
+
}, [initialValues]);
|
97
107
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetadataFormContext.Provider, {
|
98
108
|
value: {
|
99
109
|
fields: fields,
|
@@ -110,11 +120,11 @@ var MetadataForm = function MetadataForm(props) {
|
|
110
120
|
},
|
111
121
|
layout: "horizontal",
|
112
122
|
form: form,
|
113
|
-
name: "control-hooks"
|
114
|
-
|
123
|
+
name: "control-hooks" // initialValues={initialValues}
|
124
|
+
,
|
115
125
|
onFinish: onFinish,
|
116
126
|
onValuesChange: onValuesChange
|
117
|
-
}, renderForm(mySchma, options))));
|
127
|
+
}, renderForm(mySchma, options, stream$))));
|
118
128
|
};
|
119
129
|
|
120
130
|
export default MetadataForm;
|
@@ -11,4 +11,4 @@ export declare function getDataCell(item: any, options: IFormOptions): JSX.Eleme
|
|
11
11
|
* @param isObj 是否是个对象
|
12
12
|
* @returns
|
13
13
|
*/
|
14
|
-
export declare function renderForm(schemaRef: any[], options: IFormOptions): JSX.Element;
|
14
|
+
export declare function renderForm(schemaRef: any[], options: IFormOptions, stream$?: any): JSX.Element;
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
/*
|
6
6
|
* @Author: wangxian
|
7
7
|
* @Date: 2021-09-18 14:15:04
|
8
|
-
* @LastEditTime: 2022-
|
8
|
+
* @LastEditTime: 2022-05-06 13:43:47
|
9
9
|
*/
|
10
10
|
import React from 'react';
|
11
11
|
import Input from './DataCell/Input';
|
@@ -53,7 +53,7 @@ export function getDataCell(item, options) {
|
|
53
53
|
* @returns
|
54
54
|
*/
|
55
55
|
|
56
|
-
export function renderForm(schemaRef, options) {
|
56
|
+
export function renderForm(schemaRef, options, stream$) {
|
57
57
|
if (schemaRef.length === 0) return /*#__PURE__*/React.createElement(_Spin, null);
|
58
58
|
var _schema = schemaRef[0];
|
59
59
|
var _properties = _schema.properties;
|
package/es/config.d.ts
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
1
2
|
export interface IConfig {
|
2
3
|
/** 多语言 */
|
3
4
|
locale: 'zh-CN' | 'en-US';
|
5
|
+
theme: 'normal' | 'dark';
|
4
6
|
msgpack: boolean;
|
5
7
|
openLoading: boolean;
|
6
8
|
baseUrl: string;
|
7
9
|
}
|
10
|
+
export declare const cssPrefix = "ronds-metadata";
|
11
|
+
export declare const globalSettingStream: BehaviorSubject<IConfig>;
|
8
12
|
/** 设置配置 */
|
9
13
|
export declare const setConfig: (opts: Partial<IConfig>) => void;
|
10
14
|
/** 获取单个配置 */
|
11
15
|
export declare function getConfigByKey<K extends keyof IConfig>(key: K): IConfig[K];
|
12
16
|
/** 获取全部配置 */
|
13
17
|
export declare const getConfig: () => IConfig;
|
14
|
-
export declare const cssPrefix = "ronds-base-chart";
|
package/es/config.js
CHANGED
@@ -1,10 +1,31 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
3
|
+
import { distinctUntilChanged } from 'rxjs/internal/operators/distinctUntilChanged';
|
4
|
+
import { map } from 'rxjs/internal/operators/map';
|
5
|
+
import * as jq from './framework/libs/jquery.min.js';
|
6
|
+
window.jQuery = window.jQuery || jq;
|
2
7
|
var defaultConfig = {
|
3
8
|
locale: 'zh-CN',
|
9
|
+
theme: 'normal',
|
4
10
|
msgpack: false,
|
5
11
|
openLoading: true,
|
6
12
|
baseUrl: '/phm'
|
7
13
|
};
|
14
|
+
export var cssPrefix = 'ronds-metadata';
|
15
|
+
export var globalSettingStream = new BehaviorSubject({
|
16
|
+
locale: 'zh-CN',
|
17
|
+
theme: 'normal',
|
18
|
+
msgpack: false,
|
19
|
+
openLoading: true,
|
20
|
+
baseUrl: '/phm'
|
21
|
+
});
|
22
|
+
globalSettingStream.pipe(map(function (p) {
|
23
|
+
return p.theme;
|
24
|
+
}), distinctUntilChanged()).subscribe(function (p) {
|
25
|
+
window.jQuery('body').removeClass("".concat(cssPrefix, "-dark"));
|
26
|
+
window.jQuery('body').removeClass("".concat(cssPrefix, "-normal"));
|
27
|
+
window.jQuery('body').addClass("".concat(cssPrefix, "-").concat(p));
|
28
|
+
});
|
8
29
|
var config = defaultConfig;
|
9
30
|
/** 设置配置 */
|
10
31
|
|
@@ -20,5 +41,4 @@ export function getConfigByKey(key) {
|
|
20
41
|
|
21
42
|
export var getConfig = function getConfig() {
|
22
43
|
return config;
|
23
|
-
};
|
24
|
-
export var cssPrefix = 'ronds-base-chart';
|
44
|
+
};
|