exampleCustom.data.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. import { FormSchema } from '/@/components/Form';
  2. import { defHttp } from '/@/utils/http/axios';
  3. export const schemas: FormSchema[] = [
  4. {
  5. label: '验证码',
  6. field: 'code',
  7. component: 'InputCountDown',
  8. componentProps: {
  9. //'default': 默认, 'large': 最大, 'small': 最小
  10. size:'default',
  11. //倒计时
  12. count: 120,
  13. },
  14. },
  15. {
  16. label: 'Api下拉选择',
  17. field: 'apiSelect',
  18. component: 'ApiSelect',
  19. componentProps: {
  20. //multiple: 多选;不填写为单选
  21. mode: 'multiple',
  22. //请求api,返回结果{ result: { records:[{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
  23. api: () => defHttp.get({ url: '/test/jeecgDemo/list' }),
  24. //数值转成String
  25. numberToString: false,
  26. //标题字段
  27. labelField: 'name',
  28. //值字段
  29. valueField: 'id',
  30. //请求参数
  31. params: {},
  32. //返回结果字段
  33. resultField: 'records',
  34. },
  35. },
  36. {
  37. label: 'Api树选择',
  38. field: 'apiSelect',
  39. component: 'ApiTreeSelect',
  40. componentProps: {
  41. /* 请求api,返回结果
  42. { result: { list: [{ title:'选项0',value:'0',key:'0',
  43. children: [ {"title": "选项0-0","value": "0-0","key": "0-0"},...]
  44. }, ...]
  45. }} */
  46. api: () => defHttp.get({ url: '/mock/tree/getDemoOptions' }),
  47. //请求参数
  48. params: {},
  49. //返回结果字段
  50. resultField: 'list',
  51. },
  52. },
  53. {
  54. label: '校验密码强度',
  55. field: 'pwd',
  56. component: 'StrengthMeter',
  57. componentProps: {
  58. //是否显示密码文本框
  59. showInput: true,
  60. //是否禁用
  61. disabled: false,
  62. },
  63. },
  64. {
  65. label: '省市县联动',
  66. field: 'province',
  67. component: 'JAreaLinkage',
  68. componentProps: {
  69. //是否显示区县,默认true,否则只显示省
  70. showArea: true,
  71. //是否是全部文本,默认false
  72. showAll: true,
  73. },
  74. },
  75. {
  76. label: '岗位选择',
  77. field: 'post',
  78. component: 'JSelectPosition',
  79. componentProps: {
  80. //是否右侧显示选中列表
  81. showSelected: true,
  82. //最大选择数量
  83. maxSelectCount: 1,
  84. //岗位标题
  85. modalTitle: '岗位',
  86. },
  87. },
  88. {
  89. label: '角色选择',
  90. field: 'role',
  91. component: 'JSelectRole',
  92. componentProps: {
  93. //请求参数 如params:{"code":"001"}
  94. params: {},
  95. //是否单选,默认false
  96. isRadioSelection: true,
  97. //角色标题
  98. modalTitle: '角色',
  99. },
  100. },
  101. {
  102. label: '用户选择',
  103. field: 'user',
  104. component: 'JSelectUser',
  105. componentProps: {
  106. //取值字段配置,一般为主键字段
  107. rowKey: 'username',
  108. //显示字段配置
  109. labelKey: 'realname',
  110. //是否显示选择按钮
  111. showButton: false,
  112. //用户标题
  113. modalTitle: '用户',
  114. },
  115. },
  116. {
  117. label: '图片上传',
  118. field: 'uploadImage',
  119. component: 'JImageUpload',
  120. componentProps: {
  121. //按钮显示文字
  122. text:'图片上传',
  123. //支持两种基本样式picture和picture-card
  124. listType:'picture-card',
  125. //用于控制文件上传的业务路径,默认temp
  126. bizPath:'temp',
  127. //是否禁用
  128. disabled:false,
  129. //最大上传数量
  130. fileMax:1,
  131. },
  132. },
  133. {
  134. label: '字典标签',
  135. field: 'dictTags',
  136. component: 'JDictSelectTag',
  137. componentProps: {
  138. //字典code配置,比如通过性别字典编码:sex,也可以使用demo,name,id 表名,名称,值的方式
  139. dictCode:'sex',
  140. //支持radio(单选按钮)、radioButton(单选按钮 btn风格)、select(下拉框)
  141. type:'radioButton'
  142. },
  143. },
  144. {
  145. label: '部门选择',
  146. field: 'dept',
  147. component: 'JSelectDept',
  148. componentProps: {
  149. //是否开启异步加载
  150. sync: false,
  151. //是否显示复选框
  152. checkable: true,
  153. //是否显示选择按钮
  154. showButton: false,
  155. //父子节点选中状态不再关联
  156. checkStrictly: true,
  157. //选择框标题
  158. modalTitle: '部门选择',
  159. },
  160. },
  161. {
  162. label: '省市县级联动',
  163. field: 'provinceArea',
  164. component: 'JAreaSelect',
  165. componentProps: {
  166. //级别 1 只显示省 2 省市 3 省市区
  167. level:3
  168. },
  169. },
  170. {
  171. label: '富文本',
  172. field: 'editor',
  173. component: 'JEditor',
  174. componentProps: {
  175. //是否禁用
  176. disabled: false
  177. },
  178. },
  179. {
  180. label: 'markdown',
  181. field: 'markdown',
  182. component: 'JMarkdownEditor',
  183. componentProps: {
  184. //是否禁用
  185. disabled: false
  186. },
  187. },
  188. {
  189. label: '可输入下拉框',
  190. field: 'inputSelect',
  191. component: 'JSelectInput',
  192. componentProps: {
  193. options: [
  194. { label: 'Default', value: 'default' },
  195. { label: 'IFrame', value: 'iframe' },
  196. ],
  197. //是否为搜索模式
  198. showSearch: true,
  199. //是否禁用
  200. disabled: false
  201. },
  202. },
  203. {
  204. label: '代码编辑器组件',
  205. field: 'jCode',
  206. component: 'JCodeEditor',
  207. componentProps: {
  208. //高度,默认auto
  209. height:'150px',
  210. //是否禁用
  211. disabled:false,
  212. //是否全屏
  213. fullScreen:false,
  214. //全屏之后的坐标
  215. zIndex: 999,
  216. //代码主题,目前只支持idea,可在组件自行扩展
  217. theme:'idea',
  218. //代码提示
  219. keywords:['console'],
  220. //语言如(javascript,vue,markdown)可在组件自行扩展
  221. language:'javascript'
  222. },
  223. },
  224. {
  225. label: '分类字典树',
  226. field: 'dictTree',
  227. component: 'JCategorySelect',
  228. componentProps: {
  229. //占位内容
  230. placeholder:'请选择分类字典树',
  231. //查询条件,如“{'name':'笔记本'}”
  232. condition:"",
  233. //是否多选
  234. multiple: false,
  235. //起始选择code,见配置的分类字典的类型编码
  236. pcode: 'A04',
  237. //父级id
  238. pid:'',
  239. //返回key
  240. back:'id',
  241. },
  242. },
  243. {
  244. label: '下拉多选',
  245. field: 'selectMultiple',
  246. component: 'JSelectMultiple',
  247. componentProps: {
  248. //字典code配置,比如通过性别字典编码:sex,也可以使用demo,name,id 表名,名称,值的方式
  249. dictCode:'company_rank',
  250. //是否只读
  251. readOnly:false,
  252. },
  253. },
  254. {
  255. label: 'popup',
  256. field: 'popup',
  257. component: 'JPopup',
  258. componentProps: ({ formActionType }) => {
  259. const {setFieldsValue} = formActionType;
  260. return{
  261. setFieldsValue:setFieldsValue,
  262. //online报表编码
  263. code:"demo",
  264. //是否为多选
  265. multi:false,
  266. //字段配置
  267. fieldConfig: [
  268. { source: 'name', target: 'popup' },
  269. ],
  270. }
  271. },
  272. },
  273. {
  274. label: '开关自定义',
  275. field: 'switch',
  276. component: 'JSwitch',
  277. componentProps:{
  278. //取值 options
  279. options:['Y','N'],
  280. //文本option
  281. labelOptions:['是', '否'],
  282. //是否启用下拉
  283. query: false,
  284. //是否禁用
  285. disabled: false,
  286. },
  287. },
  288. {
  289. label: '定时表达式选择',
  290. field: 'timing',
  291. component: 'JEasyCron',
  292. componentProps:{
  293. //是否隐藏参数秒和年设置,如果隐藏,那么参数秒和年将会全部忽略掉。
  294. hideSecond: false,
  295. //是否隐藏参数年设置,如果隐藏,那么参数年将会全部忽略掉
  296. hideYear: false,
  297. //是否禁用
  298. disabled: false,
  299. //获取预览执行时间列表的函数,格式为:remote (cron值, time时间戳, cb回调函数)
  300. remote:(cron,time,cb)=>{}
  301. },
  302. },
  303. {
  304. label: '分类字典树',
  305. field: 'treeDict',
  306. component: 'JTreeDict',
  307. componentProps:{
  308. //指定当前组件需要存储的字段 可选: id(主键)和code(编码)
  309. field:'id',
  310. //是否为异步
  311. async: true,
  312. //是否禁用
  313. disabled: false,
  314. //指定一个节点的编码,加载该节点下的所有字典数据,若不指定,默认加载所有数据
  315. parentCode:'A04'
  316. },
  317. },
  318. {
  319. label: '多行输入窗口',
  320. field: 'inputPop',
  321. component: 'JInputPop',
  322. componentProps:{
  323. //标题
  324. title:'多行输入窗口',
  325. //弹窗显示位置
  326. position:'bottom',
  327. },
  328. },
  329. {
  330. label: '多选',
  331. field: 'multipleChoice',
  332. component: 'JCheckbox',
  333. componentProps:{
  334. //字典code配置,比如通过职位字典编码:company_rank,也可以使用demo,name,id 表名,名称,值的方式
  335. dictCode:'company_rank',
  336. //是否禁用
  337. disabled: false,
  338. //没有字典code可以使用option来定义
  339. // options:[
  340. // {label:'CE0',value:'1'}
  341. // ]
  342. },
  343. },
  344. {
  345. label: '下拉树选择',
  346. field: 'treeCusSelect',
  347. component: 'JTreeSelect',
  348. componentProps: {
  349. //字典code配置,比如通过性别字典编码:sex,也可以使用sys_permission,name,id 表名,名称,值的方式
  350. dict: 'sys_permission,name,id',
  351. //父级id字段
  352. pidField: 'parent_id',
  353. },
  354. },
  355. {
  356. label: '根据部门选择用户组件',
  357. field: 'userByDept',
  358. component: 'JSelectUserByDept',
  359. componentProps: {
  360. //是否显示选择按钮
  361. showButton: true,
  362. //选择框标题
  363. modalTitle: '部门用户选择'
  364. },
  365. },
  366. {
  367. label: '文件上传',
  368. field: 'uploadFile',
  369. component: 'JUpload',
  370. componentProps: {
  371. //是否显示选择按钮
  372. text: '文件上传',
  373. //最大上传数
  374. maxCount: 2,
  375. //是否显示下载按钮
  376. download: true,
  377. },
  378. },
  379. {
  380. label: '字典表搜索',
  381. field: 'dictSearchSelect',
  382. component: 'JSearchSelect',
  383. componentProps: {
  384. //字典code配置,通过 demo,name,id 表名,名称,值的方式
  385. dict: 'demo,name,id',
  386. //是否异步加载
  387. async: true,
  388. //当async设置为true时有效,表示异步查询时,每次获取数据的数量,默认10
  389. pageSize:3
  390. },
  391. },
  392. {
  393. label: '动态创建input框',
  394. field: 'jAddInput',
  395. component: 'JAddInput',
  396. componentProps: {
  397. //自定义超过多少行才会显示删除按钮,默认为1
  398. min:1
  399. },
  400. },
  401. {
  402. label: '用户选择组件',
  403. field: 'userCusSelect',
  404. component: 'UserSelect',
  405. componentProps: {
  406. //是否多选
  407. multi: true,
  408. //从用户表中选择一列,其值作为该控件的存储值,默认id列
  409. store: 'id',
  410. //是否排除我自己(当前登录用户)
  411. izExcludeMy: false,
  412. //是否禁用
  413. disabled: false,
  414. },
  415. },
  416. {
  417. label: '选择角色组件',
  418. field: 'roleSelect',
  419. component: 'RoleSelect',
  420. componentProps: {
  421. //最大选择数量
  422. maxSelectCount: 4,
  423. //是否单选
  424. multi: true
  425. },
  426. },
  427. {
  428. label: '数值范围输入框',
  429. field: 'rangeNumber',
  430. component: 'JRangeNumber',
  431. },
  432. {
  433. label: '远程Api单选框组',
  434. field: 'apiRadioGroup',
  435. component: 'ApiRadioGroup',
  436. componentProps:{
  437. //请求接口返回结果{ result:{ list: [ name: '选项0',id: '1' ] }}
  438. api:()=> defHttp.get({ url: '/mock/select/getDemoOptions' }),
  439. //请求参数
  440. params:{},
  441. //是否为按钮风格类型,默认false
  442. isBtn: false,
  443. //返回集合名称
  444. resultField: 'list',
  445. //标题字段名称
  446. labelField: 'name',
  447. //值字段名称
  448. valueField: 'id',
  449. }
  450. },
  451. ];