lu-lowcode-package-form 0.11.19 → 0.11.20
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/index.cjs.js +202 -202
- package/dist/index.es.js +14979 -14981
- package/package.json +1 -1
- package/src/App.jsx +24 -0
- package/src/utils/formula.js +9 -0
package/package.json
CHANGED
package/src/App.jsx
CHANGED
@@ -197,6 +197,30 @@ function App() {
|
|
197
197
|
option_label="label"
|
198
198
|
option_value="value"
|
199
199
|
option_search="label" label="测试填充2" __id="fill_tianchong1_test" />
|
200
|
+
|
201
|
+
<Field.WithSingleSelect label="测试关联填充啥地方都是粉丝的" __id="fill_tianchong1_test2"
|
202
|
+
withIds={["fill_tianchong1_test"]}
|
203
|
+
withFill={{
|
204
|
+
"value": [
|
205
|
+
{
|
206
|
+
"insert": {
|
207
|
+
"span": true
|
208
|
+
},
|
209
|
+
"attributes": {
|
210
|
+
"id": "fill_tianchong1_test",
|
211
|
+
"color": "blue",
|
212
|
+
"tagKey": "fieldsValue",
|
213
|
+
"content": "当前表单.测试被填充2"
|
214
|
+
}
|
215
|
+
},
|
216
|
+
|
217
|
+
],
|
218
|
+
"version": 1719296886283,
|
219
|
+
"withData": [
|
220
|
+
|
221
|
+
]
|
222
|
+
}}
|
223
|
+
/>
|
200
224
|
<Field.RadioGroup
|
201
225
|
buttonStyle="solid"
|
202
226
|
label="菜单类型"
|
package/src/utils/formula.js
CHANGED
@@ -9,6 +9,7 @@ const evalFormula =(formula) => {
|
|
9
9
|
const func = new Function(funcCode);
|
10
10
|
result = func()
|
11
11
|
// result = eval(formula.join(""));
|
12
|
+
if (!(typeof result === "object" && result !== null))
|
12
13
|
result = result.toString();
|
13
14
|
} catch (error) {
|
14
15
|
console.error(`formula (${funcCode}) error`, error);
|
@@ -17,4 +18,12 @@ const evalFormula =(formula) => {
|
|
17
18
|
return result
|
18
19
|
};
|
19
20
|
|
21
|
+
|
22
|
+
// let demo = ["JSON.parse(`","{\"label\":\"1111\",\"value\":1}","`)\n\n"]
|
23
|
+
|
24
|
+
// let demo_result = evalFormula(demo)
|
25
|
+
|
26
|
+
// demo_result = JSON.stringify({value:demo_result?.value,label:demo_result?.label})
|
27
|
+
|
28
|
+
// console.log("demo_result",demo_result)
|
20
29
|
export {evalFormula};
|