xm-attachment-ex.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div>
  3. <a-form-model-item label="最大上传数量">
  4. <sd-ugly-number v-model="component.attr.maxLength" :min="1" />
  5. </a-form-model-item>
  6. <a-form-model-item label="单个文件大小不超过(MB)">
  7. <sd-ugly-number v-model="component.attr.maxFileSize" :min="1" />
  8. </a-form-model-item>
  9. <a-form-model-item
  10. prop="attr.allowType"
  11. :rules="[
  12. { pattern: /^\.[a-z|0-9]+(,\.[a-z|0-9]+)*$/, message: '请参考提示输入正确的文件后缀' },
  13. ]"
  14. >
  15. <div slot="label">
  16. 上传文件类型
  17. <a-tooltip title="请输入【.文件后缀】例如:.doc多个类型用逗号分隔">
  18. <a-icon type="question-circle" />
  19. </a-tooltip>
  20. </div>
  21. <a-input v-model="component.attr.allowType" />
  22. </a-form-model-item>
  23. </div>
  24. </template>
  25. <script>
  26. import xmAttachmentEx from '@product/iam/components/xm-attachment-ex'
  27. import components from './_import-components/xm-attachment-ex-import'
  28. export const metaInfo = {
  29. caption: '项目模板控件',
  30. component: {
  31. props: ['designerData'],
  32. render() {
  33. return (
  34. <xmAttachmentEx groupId='-1' zwUploadable={true} value={[]} enableAttachmentExTab={false} />
  35. )
  36. },
  37. },
  38. icon: 'upload',
  39. order: 1100,
  40. excludeFormTypes: [2, 3],
  41. }
  42. export const fieldProps = {
  43. dataType: 'attachment',
  44. attrFD: { columns: 4, formItemProps: { inputProps: { listType: '' } } },
  45. attr: { maxLength: '', allowType: '', zwUploadable: 'true' },
  46. }
  47. export function updateOnPreview(component) {
  48. // 预览时用一个固定的groupId
  49. component.value = '{"value":"-1"}'
  50. }
  51. export default {
  52. name: 'XmAttachmentEx',
  53. components,
  54. data() {
  55. return {}
  56. },
  57. methods: {},
  58. }
  59. </script>
  60. <style module lang="scss">
  61. @use '@/common/design' as *;
  62. </style>