diff --git a/src/pages/OutRoadMgm/OutDeviceMgm/OutNvrMgm/loadable.jsx b/src/pages/OutRoadMgm/OutDeviceMgm/OutNvrMgm/loadable.jsx index 30c5889..c336994 100644 --- a/src/pages/OutRoadMgm/OutDeviceMgm/OutNvrMgm/loadable.jsx +++ b/src/pages/OutRoadMgm/OutDeviceMgm/OutNvrMgm/loadable.jsx @@ -431,7 +431,7 @@ function OutNvrMgm(props) { let pattern = /^([0-9]{1,3}\.){3}[0-9]{1,3}$/; let duankou = /^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/; let shiping_duan_kou = /^\+?[1-9][0-9]*$/ - if(values.nvr_type == 1){ + if (values.nvr_type == 1) { if (!pattern.test(values.ip_address)) { message.warning("请输入合理格式的ip地址") return false @@ -444,8 +444,8 @@ function OutNvrMgm(props) { return false } } - let reg=/^[1-9]\d*$/ - if(!reg.test(values.standard_code)&&values.standard_code){ + let reg = /^[1-9]\d*$/ + if (!reg.test(values.standard_code) && values.standard_code) { message.warning("国标编号为纯数字") return false } @@ -471,7 +471,21 @@ function OutNvrMgm(props) { // 添加按钮 const handleAdd = () => { setRowData(defRowData); - form.setFieldsValue({ nvr_type: "", standard_code: '' }); + form.setFieldsValue({ + nvr_type: "", + standard_code: '', + name: "", + operator_id: "", + road_id: "", + ip_address: "", + port: "", + video_port: "", + network_mode: "", + user_name: "", + password: "", + lng_lat: "", + address: "", + }); // form.resetFields(); setVisible(true); }; @@ -629,7 +643,7 @@ function OutNvrMgm(props) { className="form-con" placeholder="请选择" allowClear={false} - options={[{label: '全部',value: 0},{label: '非国标',value: 1},{label: '国标',value: 2}]} + options={[{ label: '全部', value: 0 }, { label: '非国标', value: 1 }, { label: '国标', value: 2 }]} value={formData?.nvr_type || 0} onChange={(v) => { setFormData({ ...formData, nvr_type: v }); @@ -764,7 +778,7 @@ function OutNvrMgm(props) { > + - + ) : null; }} @@ -796,59 +810,59 @@ function OutNvrMgm(props) { } > {({ getFieldValue }) => { - return getFieldValue("nvr_type") == 1 ? ( + return getFieldValue("nvr_type") == 1 ? ( <> -
- - - - - - +
+ + + + + + -
-
+
+
- - - - - - -
-
- + + + + + + +
+
- - - -
+ + + + +
- + ) : null; }} - +