From 8afe4acaafb4b42649155f300e24c0fb082ba971 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 09 八月 2022 16:06:52 +0800
Subject: [PATCH] 2022-08-09

---
 src/templates/zshare/modalform/index.jsx |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx
index 4c16e8a..fc1cc3c 100644
--- a/src/templates/zshare/modalform/index.jsx
+++ b/src/templates/zshare/modalform/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Row, Col, Input, Select, Radio, notification, InputNumber, Tooltip } from 'antd'
+import { Form, Row, Col, Input, Select, Radio, notification, InputNumber, Tooltip, Checkbox } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import { formRule } from '@/utils/option.js'
@@ -27,7 +27,7 @@
   checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'width', 'multiple', 'splitline', 'marginTop', 'marginBottom'],
   multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'],
   link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom'],
-  fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'splitline', 'marginTop', 'marginBottom'],
+  fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom'],
   switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'],
   date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'],
   datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline', 'marginTop', 'marginBottom'],
@@ -232,6 +232,19 @@
         shows.push('limit', 'rduri', 'proRduri')
       } else {
         shows.push('suffix')
+      }
+      if (this.record.miniSet === 'custom') {
+        shows.push('mediaType', 'sourceType')
+
+        if (this.record.sourceType.includes('camera') && this.record.mediaType.includes('video')) {
+          shows.push('maxDuration')
+        }
+        if (this.record.mediaType.includes('image')) {
+          shows.push('sizeType')
+        }
+        if (this.record.sourceType.includes('camera')) {
+          shows.push('camera')
+        }
       }
     } else if (type === 'textarea') {
       if (this.record.encryption === 'false') {
@@ -638,6 +651,15 @@
             )
           })}
         </Radio.Group>
+      } else if (item.type === 'checkbox') {
+        rules = [
+          { required: item.required, message: dict['form.required.select'] + item.label + '!' }
+        ]
+        initVal = item.initVal
+
+        content = <Checkbox.Group onChange={(values) => {this.optionChange(item.key, values)}}>
+          {item.options.map(option => <Checkbox key={option.value} value={option.value}>{option.text}</Checkbox>)}
+        </Checkbox.Group>
       } else if (item.type === 'codemirror') {
         rules = [
           { required: item.required, message: dict['form.required.input'] + item.label + '!' }

--
Gitblit v1.8.0