Explorar o código

fix: bug#5587

xieyonghong %!s(int64=3) %!d(string=hai) anos
pai
achega
f8d87b3fd7
Modificáronse 29 ficheiros con 48 adicións e 6 borrados
  1. 2 0
      src/components/DashBoard/echarts.tsx
  2. 1 0
      src/components/GeoPoint/AMap.tsx
  3. 1 0
      src/components/Metadata/ArrayParam/index.tsx
  4. 1 0
      src/components/Metadata/JsonParam/index.tsx
  5. 6 1
      src/components/SearchComponent/index.tsx
  6. 2 0
      src/components/SipSelectComponent/index.tsx
  7. 4 0
      src/pages/Northbound/AliCloud/Detail/index.tsx
  8. 2 0
      src/pages/Northbound/DuerOS/Detail/index.tsx
  9. 1 0
      src/pages/demo/AMap/index.tsx
  10. 1 0
      src/pages/device/Instance/Detail/Reation/Edit.tsx
  11. 1 0
      src/pages/device/Instance/Detail/Tags/location/AMap.tsx
  12. 1 0
      src/pages/device/Instance/Export/index.tsx
  13. 1 0
      src/pages/device/Instance/Import/index.tsx
  14. 1 0
      src/pages/device/Instance/Save/index.tsx
  15. 1 0
      src/pages/device/components/Metadata/Base/Edit/index.tsx
  16. 1 0
      src/pages/device/components/Metadata/Base/index.tsx
  17. 1 0
      src/pages/device/components/Metadata/Import/index.tsx
  18. 1 0
      src/pages/home/components/ProductChoose.tsx
  19. 2 0
      src/pages/link/AccessConfig/Detail/Media/SipSelectComponent/index.tsx
  20. 2 2
      src/pages/link/DashBoard/index.tsx
  21. 1 0
      src/pages/media/Device/Save/index.tsx
  22. 1 0
      src/pages/notice/Config/BindUser/index.tsx
  23. 2 2
      src/pages/notice/Config/Detail/index.tsx
  24. 1 1
      src/pages/notice/Template/Detail/index.tsx
  25. 1 0
      src/pages/rule-engine/Alarm/Configuration/Save/index.tsx
  26. 4 0
      src/pages/rule-engine/Scene/Save/action/VariableItems/user.tsx
  27. 2 0
      src/pages/rule-engine/Scene/Save/action/device/index.tsx
  28. 2 0
      src/pages/rule-engine/Scene/Save/trigger/index.tsx
  29. 1 0
      src/pages/system/Role/Detail/Permission/Allocate/MenuPermission.tsx

+ 2 - 0
src/components/DashBoard/echarts.tsx

@@ -59,6 +59,7 @@ export default (props: EchartsProps) => {
   const chartsRef = useRef<any>(null);
 
   const initEcharts = (dom: HTMLDivElement) => {
+    debugger;
     if (!chartsRef.current) {
       chartsRef.current = echarts.init(dom);
       if (props.options) {
@@ -84,6 +85,7 @@ export default (props: EchartsProps) => {
   }, []);
 
   useEffect(() => {
+    debugger;
     if (chartsRef.current && props.options) {
       chartsRef.current.setOption(props.options);
     }

+ 1 - 0
src/components/GeoPoint/AMap.tsx

@@ -55,6 +55,7 @@ export default (props: Props) => {
         <div className={'map-search-select'}>
           <Select
             showSearch
+            allowClear
             options={data}
             filterOption={false}
             onSearch={debounce(onSearch, 300)}

+ 1 - 0
src/components/Metadata/ArrayParam/index.tsx

@@ -69,6 +69,7 @@ const ArrayParam = () => {
             'x-visible': false,
             'x-component-props': {
               showSearch: true,
+              allowClear: true,
               showArrow: true,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 1 - 0
src/components/Metadata/JsonParam/index.tsx

@@ -116,6 +116,7 @@ const JsonParam = (props: Props) => {
                       'x-visible': false,
                       'x-component-props': {
                         showSearch: true,
+                        allowClear: true,
                         showArrow: true,
                         filterOption: (input: string, option: any) =>
                           option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 6 - 1
src/components/SearchComponent/index.tsx

@@ -208,6 +208,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
               });
               f.setFieldState(typeFiled.query('.value'), async (state) => {
                 state.componentType = 'Input';
+                state.componentProps = { allowClear: true };
               });
             } else {
               switch (_field?.valueType) {
@@ -228,6 +229,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
                     console.log(state.value);
                     state.componentType = 'Select';
                     state.dataSource = __option;
+                    state.componentProps = { allowClear: true };
                   });
                   break;
                 case 'treeSelect':
@@ -248,6 +250,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
                     state.dataSource = _option;
                     state.componentProps = {
                       ..._field.fieldProps,
+                      allowClear: true,
                       treeNodeFilterProp: 'name',
                     };
                   });
@@ -255,6 +258,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
                 case 'digit':
                   f.setFieldState(typeFiled.query('.value'), async (state) => {
                     state.componentType = 'NumberPicker';
+                    state.componentProps = { allowClear: true };
                   });
                   f.setFieldState(typeFiled.query('.termType'), async (state) => {
                     state.value = 'eq';
@@ -263,7 +267,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
                 case 'dateTime':
                   f.setFieldState(typeFiled.query('.value'), async (state) => {
                     state.componentType = 'DatePicker';
-                    state.componentProps = { showTime: true };
+                    state.componentProps = { showTime: true, allowClear: true };
                   });
                   f.setFieldState(typeFiled.query('.termType'), async (state) => {
                     state.value = 'gte';
@@ -275,6 +279,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
                   });
                   f.setFieldState(typeFiled.query('.value'), async (state) => {
                     state.componentType = 'Input';
+                    state.componentProps = { allowClear: true };
                   });
                   break;
               }

+ 2 - 0
src/components/SipSelectComponent/index.tsx

@@ -28,6 +28,7 @@ const SipSelectComponent = (props: SipSelectComponentProps) => {
     <div style={{ display: 'flex', alignItems: 'center' }}>
       <Select
         showSearch
+        allowClear
         value={data?.host}
         style={{ marginRight: 10 }}
         placeholder="请选择IP地址"
@@ -56,6 +57,7 @@ const SipSelectComponent = (props: SipSelectComponentProps) => {
       </Select>
       <Select
         showSearch
+        allowClear
         style={{ maxWidth: 100 }}
         value={data?.port}
         placeholder="请选择端口"

+ 4 - 0
src/pages/Northbound/AliCloud/Detail/index.tsx

@@ -195,6 +195,7 @@ const Detail = observer(() => {
             'x-component-props': {
               placeholder: '请选择服务地址',
               showSearch: true,
+              allowClear: true,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
             },
@@ -278,6 +279,7 @@ const Detail = observer(() => {
         'x-component-props': {
           placeholder: '请选择网桥产品',
           showSearch: true,
+          allowClear: true,
           filterOption: (input: string, option: any) =>
             option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
         },
@@ -327,6 +329,7 @@ const Detail = observer(() => {
                   'x-component-props': {
                     placeholder: '请选择阿里云产品',
                     showSearch: true,
+                    allowClear: true,
                     filterOption: (input: string, option: any) =>
                       option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
                   },
@@ -356,6 +359,7 @@ const Detail = observer(() => {
                   'x-component-props': {
                     placeholder: '请选择平台产品',
                     showSearch: true,
+                    allowClear: true,
                     filterOption: (input: string, option: any) =>
                       option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
                   },

+ 2 - 0
src/pages/Northbound/DuerOS/Detail/index.tsx

@@ -277,6 +277,7 @@ const Save = () => {
               // },
               showSearch: true,
               showArrow: true,
+              allowClear: true,
               disabled: id !== ':id',
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
@@ -300,6 +301,7 @@ const Save = () => {
                 value: 'id',
               },
               showSearch: true,
+              allowClear: true,
               showArrow: true,
               filterOption: (input: string, option: any) =>
                 option.name.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 1 - 0
src/pages/demo/AMap/index.tsx

@@ -91,6 +91,7 @@ export default () => {
       <div style={{ position: 'absolute', top: 0 }}>
         <Select
           showSearch
+          allowClear
           options={data}
           filterOption={false}
           onSearch={debounce(onSearch, 300)}

+ 1 - 0
src/pages/device/Instance/Detail/Reation/Edit.tsx

@@ -69,6 +69,7 @@ const Edit = (props: Props) => {
         'x-component-props': {
           placeholder: `请选择${item.relationName}`,
           showSearch: true,
+          allowClear: true,
           showArrow: true,
           mode: 'multiple',
           filterOption: (input: string, option: any) =>

+ 1 - 0
src/pages/device/Instance/Detail/Tags/location/AMap.tsx

@@ -57,6 +57,7 @@ export default (props: Props) => {
         >
           <Select
             showSearch
+            allowClear
             options={data}
             filterOption={false}
             onSearch={debounce(onSearch, 300)}

+ 1 - 0
src/pages/device/Instance/Export/index.tsx

@@ -65,6 +65,7 @@ const Export = (props: Props) => {
             'x-component-props': {
               allowClear: true,
               showSearch: true,
+              allowClear: true,
               showArrow: true,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 1 - 0
src/pages/device/Instance/Import/index.tsx

@@ -238,6 +238,7 @@ const Import = (props: Props) => {
             enum: [...productList],
             'x-component-props': {
               showSearch: true,
+              allowClear: true,
               showArrow: true,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 1 - 0
src/pages/device/Instance/Save/index.tsx

@@ -225,6 +225,7 @@ const Save = (props: Props) => {
             >
               <Select
                 showSearch
+                allowClear
                 options={productList}
                 disabled={props.model === 'edit'}
                 onSelect={(_: any, node: any) => {

+ 1 - 0
src/pages/device/components/Metadata/Base/Edit/index.tsx

@@ -229,6 +229,7 @@ const Edit = observer((props: Props) => {
         'x-component-props': {
           showSearch: true,
           showArrow: true,
+          allowClear: true,
           filterOption: (input: string, option: any) =>
             option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
         },

+ 1 - 0
src/pages/device/components/Metadata/Base/index.tsx

@@ -173,6 +173,7 @@ const BaseMetadata = observer((props: Props) => {
         toolbar={{
           search: {
             placeholder: '请输入标识',
+            allowClear: true,
             onSearch: handleSearch,
           },
         }}

+ 1 - 0
src/pages/device/components/Metadata/Import/index.tsx

@@ -73,6 +73,7 @@ const Import = (props: Props) => {
         'x-component-props': {
           showSearch: true,
           showArrow: true,
+          allowClear: true,
           filterOption: (input: string, option: any) =>
             option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
         },

+ 1 - 0
src/pages/home/components/ProductChoose.tsx

@@ -62,6 +62,7 @@ const ProductChoose = (props: Props) => {
             enum: [...productList],
             'x-component-props': {
               showSearch: true,
+              allowClear: true,
               showArrow: true,
               filterOption: (input: string, option: any) =>
                 option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 2 - 0
src/pages/link/AccessConfig/Detail/Media/SipSelectComponent/index.tsx

@@ -37,6 +37,7 @@ const SipSelectComponent = (props: SipSelectComponentProps) => {
     <div style={{ display: 'flex', alignItems: 'center' }}>
       <Select
         showSearch
+        allowClear
         value={data?.host}
         style={{ marginRight: 10 }}
         placeholder="请选择IP地址"
@@ -64,6 +65,7 @@ const SipSelectComponent = (props: SipSelectComponentProps) => {
       </Select>
       <Select
         showSearch
+        allowClear
         style={{ minWidth: 100 }}
         value={data?.port}
         placeholder="请选择端口"

+ 2 - 2
src/pages/link/DashBoard/index.tsx

@@ -453,7 +453,7 @@ export default () => {
               if (item.group === 'network') {
                 const _data: any[] = [];
                 value.forEach((networkItem: any) => {
-                  _data.push(Number(networkItem.value).toFixed(2));
+                  _data.push(networkItem.value);
                   _networkXAxis.add(networkItem.timeString);
                 });
                 _networkOptions[nodeID] = {
@@ -519,7 +519,7 @@ export default () => {
                 const _data: any[] = [];
                 const nodeID = item.data.clusterNodeId;
                 value.forEach((networkItem: any) => {
-                  _data.push(Number(networkItem.value).toFixed(2));
+                  _data.push(networkItem.value);
                   _networkXAxis.add(networkItem.timeString);
                 });
 

+ 1 - 0
src/pages/media/Device/Save/index.tsx

@@ -241,6 +241,7 @@ const Save = () => {
                       <Form.Item name={'productId'} noStyle>
                         <Select
                           showSearch
+                          allowClear
                           fieldNames={{
                             label: 'name',
                             value: 'id',

+ 1 - 0
src/pages/notice/Config/BindUser/index.tsx

@@ -61,6 +61,7 @@ const BindUser = (props: Props) => {
         'x-component-props': {
           placeholder: '请选择用户',
           showSearch: true,
+          allowClear: true,
           showArrow: true,
           filterOption: (input: string, option: any) =>
             option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 2 - 2
src/pages/notice/Config/Detail/index.tsx

@@ -160,7 +160,7 @@ const Detail = observer(() => {
         required: true,
         'x-visible': typeList[id]?.length > 0,
         'x-hidden': id === 'email' || id === 'webhook',
-        'x-value': typeList[id][0]?.value,
+        'x-value': typeList[id]?.[0]?.value,
         enum: typeList[id] || [],
       },
       configuration: {
@@ -602,7 +602,7 @@ const Detail = observer(() => {
             </Form>
           </Col>
           <Col span={12} push={2}>
-            {docMap[id][provider]}
+            {docMap?.[id]?.[provider]}
           </Col>
         </Row>
       </Card>

+ 1 - 1
src/pages/notice/Template/Detail/index.tsx

@@ -518,7 +518,7 @@ const Detail = observer(() => {
         required: true,
         'x-visible': typeList[id]?.length > 0,
         'x-hidden': id === 'email' || id === 'webhook',
-        'x-value': typeList[id][0]?.value,
+        'x-value': typeList[id]?.[0]?.value,
         enum: typeList[id] || [],
       },
       configId: {

+ 1 - 0
src/pages/rule-engine/Alarm/Configuration/Save/index.tsx

@@ -226,6 +226,7 @@ const Save = (props: Props) => {
         'x-component-props': {
           placeholder: '请选择关联触发场景',
           showSearch: true,
+          allowClear: true,
           showArrow: true,
           filterOption: (input: string, option: any) =>
             option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,

+ 4 - 0
src/pages/rule-engine/Scene/Save/action/VariableItems/user.tsx

@@ -222,6 +222,7 @@ export default (props: UserProps) => {
     source === 'relation' ? (
       <TreeSelect
         showSearch
+        allowClear
         value={value}
         dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
         placeholder={'请选择收信人'}
@@ -236,6 +237,7 @@ export default (props: UserProps) => {
     ) : (
       <Select
         showSearch
+        allowClear
         value={value}
         options={relationList}
         listHeight={200}
@@ -255,6 +257,7 @@ export default (props: UserProps) => {
     source === 'relation' ? (
       <TreeSelect
         showSearch
+        allowClear
         value={value}
         dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
         placeholder={'请选择收信人'}
@@ -280,6 +283,7 @@ export default (props: UserProps) => {
     source === 'relation' ? (
       <TreeSelect
         showSearch
+        allowClear
         value={value}
         dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
         placeholder={'请选择收信人'}

+ 2 - 0
src/pages/rule-engine/Scene/Save/action/device/index.tsx

@@ -173,6 +173,7 @@ export default (props: DeviceProps) => {
         >
           <Select
             showSearch
+            allowClear
             options={productList}
             placeholder={'请选择产品'}
             style={{ width: '100%' }}
@@ -266,6 +267,7 @@ export default (props: DeviceProps) => {
           >
             <Select
               showSearch
+              allowClear
               options={functionList}
               fieldNames={{ label: 'name', value: 'id' }}
               style={{ width: '100%' }}

+ 2 - 0
src/pages/rule-engine/Scene/Save/trigger/index.tsx

@@ -145,6 +145,7 @@ export default observer((props: TriggerProps) => {
           >
             <Select
               showSearch
+              allowClear
               options={productList}
               placeholder={'请选择产品'}
               style={{ width: '100%' }}
@@ -302,6 +303,7 @@ export default observer((props: TriggerProps) => {
               >
                 <Select
                   showSearch
+                  allowClear
                   options={functions}
                   fieldNames={{
                     label: 'name',

+ 1 - 0
src/pages/system/Role/Detail/Permission/Allocate/MenuPermission.tsx

@@ -249,6 +249,7 @@ const MenuPermission = (props: Props) => {
               {checkbox && (
                 <Select
                   showSearch
+                  allowClear
                   placeholder="请选择"
                   optionFilterProp="children"
                   style={{ width: 200 }}