json5.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. export default {
  2. "list": [
  3. {
  4. "type": "divider",
  5. "icon": "icon-fengexian",
  6. "options": {
  7. "hidden": false,
  8. "contentPosition": "left",
  9. "remoteFunc": "func_8hwswegx",
  10. "remoteOption": "option_8hwswegx"
  11. },
  12. "name": "主表省市区联动",
  13. "key": "8hwswegx",
  14. "model": "divider_8hwswegx",
  15. "rules": []
  16. },
  17. {
  18. "type": "select",
  19. "icon": "icon-select",
  20. "options": {
  21. "defaultValue": "",
  22. "multiple": false,
  23. "disabled": false,
  24. "clearable": false,
  25. "placeholder": "",
  26. "required": false,
  27. "requiredMessage": "",
  28. "validatorCheck": false,
  29. "validator": "",
  30. "showLabel": false,
  31. "width": "",
  32. "options": [
  33. {
  34. "value": "1111"
  35. },
  36. {
  37. "value": "2222"
  38. },
  39. {
  40. "value": "3333"
  41. }
  42. ],
  43. "remote": true,
  44. "remoteType": "datasource",
  45. "remoteOption": "option_fsorqbls",
  46. "filterable": false,
  47. "remoteOptions": [],
  48. "props": {
  49. "value": "id",
  50. "label": "name"
  51. },
  52. "remoteFunc": "func_fsorqbls",
  53. "customClass": "",
  54. "labelWidth": 100,
  55. "isLabelWidth": false,
  56. "hidden": false,
  57. "dataBind": true,
  58. "tableColumn": false,
  59. "remoteDataSource": "8dl33dn7",
  60. "remoteArgs": {
  61. "fid": ""
  62. }
  63. },
  64. "events": {
  65. "onChange": "99wd1n9f",
  66. "onFocus": "",
  67. "onBlur": "",
  68. "onMounted": ""
  69. },
  70. "name": "省",
  71. "key": "fsorqbls",
  72. "model": "province",
  73. "rules": []
  74. },
  75. {
  76. "type": "select",
  77. "icon": "icon-select",
  78. "options": {
  79. "defaultValue": "",
  80. "multiple": false,
  81. "disabled": false,
  82. "clearable": false,
  83. "placeholder": "",
  84. "required": false,
  85. "requiredMessage": "",
  86. "validatorCheck": false,
  87. "validator": "",
  88. "showLabel": false,
  89. "width": "",
  90. "options": [
  91. {
  92. "value": "1111"
  93. },
  94. {
  95. "value": "2222"
  96. },
  97. {
  98. "value": "3333"
  99. }
  100. ],
  101. "remote": true,
  102. "remoteType": "datasource",
  103. "remoteOption": "option_ilx7spgg",
  104. "filterable": false,
  105. "remoteOptions": [],
  106. "props": {
  107. "value": "id",
  108. "label": "name"
  109. },
  110. "remoteFunc": "func_ilx7spgg",
  111. "customClass": "",
  112. "labelWidth": 100,
  113. "isLabelWidth": false,
  114. "hidden": false,
  115. "dataBind": true,
  116. "tableColumn": false,
  117. "remoteDataSource": "8dl33dn7",
  118. "remoteArgs": {
  119. "fid": "{{ this.getValue(\"province\")}}"
  120. }
  121. },
  122. "events": {
  123. "onChange": "x3ctac19",
  124. "onFocus": "",
  125. "onBlur": "",
  126. "onMounted": ""
  127. },
  128. "name": "市",
  129. "key": "ilx7spgg",
  130. "model": "city",
  131. "rules": []
  132. },
  133. {
  134. "type": "select",
  135. "icon": "icon-select",
  136. "options": {
  137. "defaultValue": "",
  138. "multiple": false,
  139. "disabled": false,
  140. "clearable": false,
  141. "placeholder": "",
  142. "required": false,
  143. "requiredMessage": "",
  144. "validatorCheck": false,
  145. "validator": "",
  146. "showLabel": false,
  147. "width": "",
  148. "options": [
  149. {
  150. "value": "1111"
  151. },
  152. {
  153. "value": "2222"
  154. },
  155. {
  156. "value": "3333"
  157. }
  158. ],
  159. "remote": true,
  160. "remoteType": "datasource",
  161. "remoteOption": "option_w0k4bvqu",
  162. "filterable": false,
  163. "remoteOptions": [],
  164. "props": {
  165. "value": "id",
  166. "label": "name"
  167. },
  168. "remoteFunc": "func_w0k4bvqu",
  169. "customClass": "",
  170. "labelWidth": 100,
  171. "isLabelWidth": false,
  172. "hidden": false,
  173. "dataBind": true,
  174. "tableColumn": false,
  175. "remoteDataSource": "8dl33dn7",
  176. "remoteArgs": {
  177. "fid": "{{ this.getValue(\"city\")}}"
  178. }
  179. },
  180. "events": {
  181. "onChange": "",
  182. "onFocus": "",
  183. "onBlur": "",
  184. "onMounted": ""
  185. },
  186. "name": "区",
  187. "key": "w0k4bvqu",
  188. "model": "district",
  189. "rules": []
  190. },
  191. {
  192. "type": "divider",
  193. "icon": "icon-fengexian",
  194. "options": {
  195. "hidden": false,
  196. "contentPosition": "left",
  197. "remoteFunc": "func_p7dp4c6l",
  198. "remoteOption": "option_p7dp4c6l",
  199. "tableColumn": false
  200. },
  201. "name": "子表省市区联动",
  202. "key": "p7dp4c6l",
  203. "model": "divider_p7dp4c6l",
  204. "rules": []
  205. },
  206. {
  207. "type": "table",
  208. "icon": "icon-kebianjibiaoge",
  209. "options": {
  210. "defaultValue": [],
  211. "customClass": "",
  212. "labelWidth": 100,
  213. "isLabelWidth": false,
  214. "hidden": false,
  215. "dataBind": true,
  216. "disabled": false,
  217. "required": false,
  218. "validatorCheck": false,
  219. "validator": "",
  220. "paging": true,
  221. "pageSize": 5,
  222. "isAdd": true,
  223. "isDelete": true,
  224. "showControl": true,
  225. "virtualTable": false,
  226. "tip": "",
  227. "remoteFunc": "func_31f7e1hl",
  228. "remoteOption": "option_31f7e1hl",
  229. "tableColumn": false,
  230. "subform": false
  231. },
  232. "events": {
  233. "onMounted": "",
  234. "onChange": "",
  235. "onRowAdd": "",
  236. "onRowRemove": "",
  237. "onPageChange": ""
  238. },
  239. "tableColumns": [
  240. {
  241. "type": "select",
  242. "icon": "icon-select",
  243. "options": {
  244. "defaultValue": "",
  245. "multiple": false,
  246. "disabled": false,
  247. "clearable": false,
  248. "placeholder": "",
  249. "required": false,
  250. "requiredMessage": "",
  251. "validatorCheck": false,
  252. "validator": "",
  253. "showLabel": false,
  254. "width": "",
  255. "options": [
  256. {
  257. "value": "1111"
  258. },
  259. {
  260. "value": "2222"
  261. },
  262. {
  263. "value": "3333"
  264. }
  265. ],
  266. "remote": true,
  267. "remoteType": "datasource",
  268. "remoteOption": "option_7jischqs",
  269. "filterable": false,
  270. "remoteOptions": [],
  271. "props": {
  272. "value": "id",
  273. "label": "name"
  274. },
  275. "remoteFunc": "func_7jischqs",
  276. "customClass": "",
  277. "labelWidth": 100,
  278. "isLabelWidth": false,
  279. "hidden": false,
  280. "dataBind": true,
  281. "customProps": {},
  282. "tip": "",
  283. "extendProps": {},
  284. "tableColumn": true,
  285. "subform": false,
  286. "remoteDataSource": "8dl33dn7",
  287. "remoteArgs": {
  288. "fid": ""
  289. }
  290. },
  291. "events": {
  292. "onMounted": "",
  293. "onChange": "emw05xs6",
  294. "onFocus": "",
  295. "onBlur": ""
  296. },
  297. "name": "省",
  298. "novalid": {},
  299. "key": "7jischqs",
  300. "model": "province",
  301. "rules": []
  302. },
  303. {
  304. "type": "select",
  305. "icon": "icon-select",
  306. "options": {
  307. "defaultValue": "",
  308. "multiple": false,
  309. "disabled": false,
  310. "clearable": false,
  311. "placeholder": "",
  312. "required": false,
  313. "requiredMessage": "",
  314. "validatorCheck": false,
  315. "validator": "",
  316. "showLabel": false,
  317. "width": "",
  318. "options": [
  319. {
  320. "value": "1111"
  321. },
  322. {
  323. "value": "2222"
  324. },
  325. {
  326. "value": "3333"
  327. }
  328. ],
  329. "remote": true,
  330. "remoteType": "datasource",
  331. "remoteOption": "option_7jischqs",
  332. "filterable": false,
  333. "remoteOptions": [],
  334. "props": {
  335. "value": "id",
  336. "label": "name"
  337. },
  338. "remoteFunc": "func_7jischqs",
  339. "customClass": "",
  340. "labelWidth": 100,
  341. "isLabelWidth": false,
  342. "hidden": false,
  343. "dataBind": true,
  344. "customProps": {},
  345. "tip": "",
  346. "extendProps": {},
  347. "tableColumn": true,
  348. "subform": false,
  349. "remoteDataSource": "8dl33dn7",
  350. "remoteArgs": {
  351. "fid": "{{ arguments[0].row?.province ?? ''}}"
  352. }
  353. },
  354. "events": {
  355. "onMounted": "ib6gddzf",
  356. "onChange": "orm0adyu",
  357. "onFocus": "",
  358. "onBlur": ""
  359. },
  360. "name": "市",
  361. "novalid": {},
  362. "key": "g1pgr8c7",
  363. "model": "city",
  364. "rules": []
  365. },
  366. {
  367. "type": "select",
  368. "icon": "icon-select",
  369. "options": {
  370. "defaultValue": "",
  371. "multiple": false,
  372. "disabled": false,
  373. "clearable": false,
  374. "placeholder": "",
  375. "required": false,
  376. "requiredMessage": "",
  377. "validatorCheck": false,
  378. "validator": "",
  379. "showLabel": false,
  380. "width": "",
  381. "options": [
  382. {
  383. "value": "1111"
  384. },
  385. {
  386. "value": "2222"
  387. },
  388. {
  389. "value": "3333"
  390. }
  391. ],
  392. "remote": true,
  393. "remoteType": "datasource",
  394. "remoteOption": "option_7jischqs",
  395. "filterable": false,
  396. "remoteOptions": [],
  397. "props": {
  398. "value": "id",
  399. "label": "name"
  400. },
  401. "remoteFunc": "func_7jischqs",
  402. "customClass": "",
  403. "labelWidth": 100,
  404. "isLabelWidth": false,
  405. "hidden": false,
  406. "dataBind": true,
  407. "customProps": {},
  408. "tip": "",
  409. "extendProps": {},
  410. "tableColumn": true,
  411. "subform": false,
  412. "remoteDataSource": "8dl33dn7",
  413. "remoteArgs": {
  414. "fid": "{{ arguments[0].row?.city ?? ''}}"
  415. }
  416. },
  417. "events": {
  418. "onMounted": "spfn383m",
  419. "onChange": "",
  420. "onFocus": "",
  421. "onBlur": ""
  422. },
  423. "name": "区",
  424. "novalid": {},
  425. "key": "hnklmyew",
  426. "model": "district",
  427. "rules": []
  428. }
  429. ],
  430. "name": "地区列表",
  431. "key": "31f7e1hl",
  432. "model": "areas",
  433. "rules": []
  434. }
  435. ],
  436. "config": {
  437. "labelWidth": 100,
  438. "labelPosition": "right",
  439. "size": "default",
  440. "customClass": "",
  441. "ui": "element",
  442. "layout": "horizontal",
  443. "width": "100%",
  444. "hideLabel": false,
  445. "hideErrorMessage": false,
  446. "eventScript": [
  447. {
  448. "key": "refresh",
  449. "name": "refresh",
  450. "func": "",
  451. "type": "js"
  452. },
  453. {
  454. "key": "onFormChange",
  455. "name": "onFormChange",
  456. "type": "rule"
  457. },
  458. {
  459. "key": "mounted",
  460. "name": "mounted",
  461. "func": "// 调用对应字段的数据源请求\nthis.refreshFieldDataSource('province')\n\nthis.refreshFieldDataSource('areas.province')",
  462. "type": "rule",
  463. "rules": []
  464. },
  465. {
  466. "key": "99wd1n9f",
  467. "name": "onChange_99wd1n9f",
  468. "func": "const {value} = arguments[0]\n\nthis.refreshFieldDataSource('city', {fid: value})\n\nthis.setData({\n city: '',\n district: ''\n})",
  469. "type": "rule",
  470. "rules": [
  471. {
  472. "key": "4rr7s0hg",
  473. "action": "refreshFieldOptionData",
  474. "options": {
  475. "condition": " this.getValue(\"province\")",
  476. "isCondition": false,
  477. "field": "city",
  478. "valueTypes": {
  479. "fid": "fx"
  480. },
  481. "dataSource": {
  482. "args": {
  483. "fid": " this.getValue(\"province\")"
  484. }
  485. }
  486. }
  487. },
  488. {
  489. "key": "e06e26jt",
  490. "action": "setData",
  491. "options": {
  492. "condition": "",
  493. "isCondition": false,
  494. "fields": [
  495. "city",
  496. "district"
  497. ],
  498. "values": {},
  499. "valueTypes": {}
  500. }
  501. }
  502. ]
  503. },
  504. {
  505. "key": "x3ctac19",
  506. "name": "onChange_x3ctac19",
  507. "func": "const {value} = arguments[0]\n\nif (value) {\n this.refreshFieldDataSource('district', {fid: value})\n \n this.setData({\n district: ''\n })\n}",
  508. "type": "rule",
  509. "rules": [
  510. {
  511. "key": "nw74re4b",
  512. "action": "refreshFieldOptionData",
  513. "options": {
  514. "condition": " this.getValue(\"city\")",
  515. "isCondition": true,
  516. "field": "district",
  517. "valueTypes": {
  518. "fid": "fx"
  519. },
  520. "dataSource": {
  521. "args": {
  522. "fid": " this.getValue(\"city\")"
  523. }
  524. }
  525. }
  526. },
  527. {
  528. "key": "nu3spbj5",
  529. "action": "setData",
  530. "options": {
  531. "condition": "",
  532. "isCondition": false,
  533. "fields": [
  534. "district"
  535. ],
  536. "values": {},
  537. "valueTypes": {}
  538. }
  539. }
  540. ]
  541. },
  542. {
  543. "key": "emw05xs6",
  544. "name": "onChange_emw05xs6",
  545. "func": "const {value, rowIndex, row} = arguments[0]\n\n// 此处需要对每行的数据进行单独联动\nthis.refreshFieldOptionData(`areas.${rowIndex}.city`).then(([data]) => {\n // 用于判断是主动改变值还是删除行导致的\n if (!data.map(item => item.id).includes(row.city)) {\n this.setData({\n [`areas.${rowIndex}.city`]: '',\n [`areas.${rowIndex}.district`]: ''\n })\n }\n})\n\n\n/*. or \n// 我们采用获取到选项数据后,通过 setOptionData 方法单独给选项赋值\nthis.sendRequest('getCityData', {fid: value}).then(data => {\n this.setOptionData([`areas.${rowIndex}.city`], data)\n\n // 用于判断是主动改变值还是删除行导致的\n let city = this.getValue(`areas.${rowIndex}.city`)\n if (!data.map(item => item.id).includes(city)) {\n this.setData({\n [`areas.${rowIndex}.city`]: '',\n [`areas.${rowIndex}.district`]: ''\n })\n }\n})\n*/",
  546. "type": "js",
  547. "rules": [
  548. {
  549. "key": "5nfz2tea",
  550. "action": "refreshFieldOptionData",
  551. "options": {
  552. "condition": "",
  553. "isCondition": false,
  554. "field": "areas.city",
  555. "valueTypes": {},
  556. "dataSource": {
  557. "args": {}
  558. }
  559. }
  560. }
  561. ]
  562. },
  563. {
  564. "key": "orm0adyu",
  565. "name": "onChange_orm0adyu",
  566. "func": "const {value, rowIndex, row} = arguments[0]\n\nthis.refreshFieldOptionData(`areas.${rowIndex}.district`).then(([data]) => {\n if (!data.map(item => item.id).includes(row.district)) {\n this.setData({\n [`areas.${rowIndex}.district`]: ''\n })\n }\n})\n\n// or\n// this.sendRequest('getCityData', {fid: value}).then(data => {\n// this.setOptionData([`areas.${rowIndex}.district`], data)\n \n// let district = this.getValue(`areas.${rowIndex}.district`)\n// if (!data.map(item => item.id).includes(district)) {\n// this.setData({\n// [`areas.${rowIndex}.district`]: ''\n// })\n// }\n// })",
  567. "type": "js"
  568. },
  569. {
  570. "key": "ib6gddzf",
  571. "name": "onMounted_ib6gddzf",
  572. "func": "const {rowIndex, row} = arguments[0]\n\nif (row.province) {\n this.refreshFieldOptionData(`areas.${rowIndex}.city`)\n}",
  573. "type": "js",
  574. "rules": [
  575. {
  576. "key": "x2z5f3yq",
  577. "action": "refreshFieldOptionData",
  578. "options": {
  579. "condition": "",
  580. "isCondition": false,
  581. "field": "areas.city",
  582. "valueTypes": {},
  583. "dataSource": {
  584. "args": {}
  585. }
  586. }
  587. }
  588. ]
  589. },
  590. {
  591. "key": "spfn383m",
  592. "name": "onMounted_spfn383m",
  593. "func": "const {rowIndex, row} = arguments[0]\n\nif (row.city) {\n this.refreshFieldOptionData(`areas.${rowIndex}.district`)\n}",
  594. "type": "js"
  595. }
  596. ],
  597. "dataSource": [
  598. {
  599. "key": "8dl33dn7",
  600. "name": "getCityData",
  601. "url": "https://tools-server.making.link/api/new/address",
  602. "method": "GET",
  603. "auto": true,
  604. "params": {
  605. "fid": "{{args.fid}}"
  606. },
  607. "headers": {},
  608. "responseFunc": "return res.data;",
  609. "requestFunc": "return config;",
  610. "args": [
  611. "fid"
  612. ]
  613. }
  614. ],
  615. "platform": "pad"
  616. }
  617. }