Browse Source

fix: 指标及通知配置

wzyyy 2 years atrás
parent
commit
b7fe279d3b

+ 4 - 4
config/proxy.ts

@@ -15,10 +15,10 @@ export default {
       // target: 'http://120.79.18.123:8844/',
       // ws: 'ws://120.79.18.123:8844/',
       // 测试环境
-      // target: 'http://120.77.179.54:8844/',
-      // ws: 'ws://120.77.179.54:8844/',
-      target: 'http://192.168.32.65:8844/',
-      ws: 'ws://192.168.32.65:8844/',
+      target: 'http://120.77.179.54:8844/',
+      ws: 'ws://120.77.179.54:8844/',
+      // target: 'http://192.168.32.65:8844/',
+      // ws: 'ws://192.168.32.65:8844/',
       //v2环境
       // ws: 'ws://47.109.52.230:8844',
       // target: 'http://47.109.52.230:8844',

+ 3 - 1
src/components/FUpload/index.tsx

@@ -43,7 +43,9 @@ const FUpload = connect((props: Props) => {
       }}
       multiple={false}
       onChange={handleChange}
-      progress={{}}
+      progress={{
+        format: (percent) => percent && `${parseFloat(percent.toFixed(2))}%`,
+      }}
       showUploadList={{
         removeIcon: (
           <DeleteOutlined

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

@@ -177,6 +177,7 @@ const Config = observer(() => {
         <PermissionButton
           style={{ padding: 0 }}
           type="link"
+          isPermission={configPermission.delete}
           popConfirm={{
             onConfirm: async () => {
               await service.remove(record.id);

+ 13 - 8
src/pages/rule-engine/Scene/Save/terms/paramsItem.tsx

@@ -177,7 +177,11 @@ const ParamsItem = observer((props: ParamsItemProps) => {
   useEffect(() => {
     setTermType(props.data.termType || '');
     setValue(props.data.value);
+    // console.log(props.data.value,'-----')
     setColumn(props.data.column || '');
+    // if(props.data.value?.source === 'metric'){
+    //   setIsRange(true)
+    // }
     ValueRef.current = props.data || {};
     convertLabelValue(props.data.column);
     if (!firstLockRef.current) {
@@ -195,14 +199,15 @@ const ParamsItem = observer((props: ParamsItemProps) => {
     labelCache.current = props.label || [undefined, undefined, {}, 'and'];
   }, [props.label]);
 
-  // useEffect(()=>{
-  //   if(props.data.value?.source && metricsOptions.length!==0){
-  //     const arr = metricsOptions.filter((item:any)=>item.range)
-  //     if(arr.length!==0){
-  //       setIsRange(true)
-  //     }
-  //   }
-  // },[metricsOptions])
+  useEffect(() => {
+    if (props.data.value?.source === 'metric') {
+      const arr = metricsOptions.filter((item: any) => item.range);
+      // console.log(arr)
+      if (arr.length !== 0) {
+        setIsRange(true);
+      }
+    }
+  }, [metricsOptions]);
 
   return (
     <div className="terms-params-item">