فهرست منبع

fix: 类型添加及修复

sunhongyao341504 1 سال پیش
والد
کامیت
b8d02d2b6a

+ 1 - 1
src/api/message/sysnotion-config.ts

@@ -9,7 +9,7 @@ import { RuleFormProps } from '@/views/message/sysnotion-config/type';
 //   customUserList?: number[];
 // }
 export function addSystemMessage(params: RuleFormProps) {
-  return http.request({
+  return http.request<number>({
     url: '/systemMessage/addSystemMessage',
     method: 'post',
     params,

+ 81 - 70
src/views/message/sysnotion-config/SysnotionConfig.vue

@@ -10,9 +10,9 @@
     <div class="content">
       <div class="left">
         <!-- 基本配置 -->
-        <BasicInfo ref="basicInfoRef" :data-soure="ruleForm" :is-disabled="isDisabled"/>
+        <BasicInfo ref="basicInfoRef" :data-soure="ruleForm" :is-disabled="isDisabled" />
         <!-- 内容配置区域 -->
-        <contentConfig ref="contentConfigRef" :data-soure="ruleForm" :is-disabled="isDisabled"/>
+        <ContentConfig ref="contentConfigRef" :data-soure="ruleForm" :is-disabled="isDisabled" />
         <!-- 按钮区域 -->
         <div class="btns" v-if="!isDisabled">
           <div style="position: absolute; right: 0; bottom: 0">
@@ -23,7 +23,7 @@
         </div>
       </div>
       <!-- 实时预览 -->
-      <RightCard :rule-form="ruleForm"/>
+      <RightCard :rule-form="ruleForm" />
     </div>
   </div>
 </template>
@@ -47,8 +47,8 @@
   const isDisabled = ref<boolean>(false);
   const useUser = useUserStore();
   const { info } = storeToRefs(useUser);
-  const basicInfoRef = ref<InstanceType<typeof BasicInfo>>()
-  const contentConfigRef = ref<InstanceType<typeof ContentConfig>>()
+  const basicInfoRef = ref<InstanceType<typeof BasicInfo>>();
+  const contentConfigRef = ref<InstanceType<typeof ContentConfig>>();
   const ruleForm = reactive<RuleFormProps>({
     messageType: MessageTypeEnum.BANNER,
     bannerUrl: '',
@@ -62,7 +62,7 @@
     operator: info.value.nickname,
   });
 
-   // 原始数据副本
+  // 原始数据副本
   let originalData: RuleFormProps = {
     ...ruleForm,
   };
@@ -77,7 +77,13 @@
     if (sysId) {
       isDisabled.value = true;
       viewSystemMessage(Number(sysId)).then((res) => {
+        if (!res?.status) {
+          isDisabled.value = false;
+        }
+        ruleForm.id = Number(sysId);
         ruleForm.title = res.title;
+        ruleForm.introduction = res.introduction ? res.introduction : '';
+        ruleForm.messageType = res.messageType;
         ruleForm.content = res.content ? res.content : ' ';
         ruleForm.pushChannel = res.pushChannel;
         ruleForm.recipientType.recipientType = res.recipientType;
@@ -91,69 +97,78 @@
     }
   });
 
-// 取消
-const onCancel = () => {
-   // 比对数据
-  const changes = compareData(ruleForm, originalData);
-  console.log('Object.keys(changes): ', Object.keys(changes));
+  // 取消
+  const onCancel = () => {
+    // 比对数据
+    const changes = compareData(ruleForm, originalData);
+    console.log('Object.keys(changes): ', Object.keys(changes));
+
+    // ElMessageBox.confirm(
+    //   '您对系统通知的额操作尚未保存,请问是否暂存?',
+    //   '提示',
+    //   {
+    //     confirmButtonText: '暂存',
+    //     cancelButtonText: '取消',
+    //     type: 'warning',
+    //   }
+    // )
+    //   .then(() => {
+    //     ElMessage({
+    //       type: 'success',
+    //       message: '暂存成功',
+    //     })
+    //   })
+    //   .catch(() => {
+    //     ElMessage({
+    //       type: 'info',
+    //       message: '取消暂存',
+    //     })
+    //   })
+  };
 
-  // ElMessageBox.confirm(
-  //   '您对系统通知的额操作尚未保存,请问是否暂存?',
-  //   '提示',
-  //   {
-  //     confirmButtonText: '暂存',
-  //     cancelButtonText: '取消',
-  //     type: 'warning',
-  //   }
-  // )
-  //   .then(() => {
-  //     ElMessage({
-  //       type: 'success',
-  //       message: '暂存成功',
-  //     })
-  //   })
-  //   .catch(() => {
-  //     ElMessage({
-  //       type: 'info',
-  //       message: '取消暂存',
-  //     })
-  //   })
-}
+  // 暂存
+  const onSave = async () => {
+    // to save dada
+    const baseInfoData = await basicInfoRef.value?.validate();
+    const contentConfigData = contentConfigRef.value?.buildFormdata();
+    console.log('contentConfigData: ', contentConfigData);
+    console.log('baseInfoDara: ', baseInfoData);
 
-// 暂存
-const onSave = async() => {
-  // to save dada
-  const baseInfoData = await basicInfoRef.value?.validate();
-  const contentConfigData = contentConfigRef.value?.buildFormdata();
-  console.log('contentConfigData: ', contentConfigData);
-  console.log('baseInfoDara: ', baseInfoData);
-  
-  const {messageType, title, pushChannel, expirationTime, bannerUrl, recipientType} = baseInfoData
-  const params = {
-    ...contentConfigData,
-    messageType,
-    title,
-    pushChannel,
-    expirationTime,
-    bannerUrl,
-    recipientType: recipientType.recipientType,
-    customUserList: recipientType.customUserList,
-    userGroupList: recipientType.userGroupList,
-    contentUrl: '',
-  }
-  delete params.operator
-  addSystemMessage(params).then((res) => {
-    if (res) {
+    const { messageType, title, pushChannel, expirationTime, bannerUrl, recipientType } =
+      baseInfoData;
+    const params = {
+      ...contentConfigData,
+      messageType,
+      title,
+      pushChannel,
+      expirationTime,
+      bannerUrl,
+      recipientType: recipientType.recipientType,
+      customUserList: recipientType.customUserList,
+      userGroupList: recipientType.userGroupList,
+      contentUrl: '',
+    };
+    delete params.operator;
+    addSystemMessage(params).then((res) => {
+      if (res) {
+        ruleForm.id = res;
+        ElMessage({
+          message: '暂存成功!',
+          type: 'success',
+        });
+      }
+    });
+  };
+
+  const submitForm = () => {
+    if (!ruleForm.id) {
       ElMessage({
-        message: '暂存成功!',
-        type: 'success',
+        message: '暂存后才能下发!',
+        type: 'warning',
       });
+      return;
     }
-  });
-}
-
-  const submitForm = () => {
-    confirmReportConfig(1).then(() => {
+    confirmReportConfig(ruleForm.id).then(() => {
       ElMessage({
         message: '下发成功!',
         type: 'success',
@@ -162,11 +177,9 @@ const onSave = async() => {
     });
   };
 
-    // 比对方法
+  // 比对方法
   const compareData = (newData: RuleFormProps, oldData: RuleFormProps) => {
-    const diff: Partial<
-      Omit<RuleFormProps, 'content'>
-    > = {};
+    const diff: Partial<Omit<RuleFormProps, 'content'>> = {};
     for (const key in newData) {
       if (newData[key as keyof RuleFormProps] !== oldData[key as keyof RuleFormProps]) {
         diff[key as keyof RuleFormProps] = newData[key as keyof RuleFormProps];
@@ -174,7 +187,6 @@ const onSave = async() => {
     }
     return diff;
   };
-
 </script>
 
 <style lang="scss" scoped>
@@ -234,7 +246,6 @@ const onSave = async() => {
           position: relative;
         }
       }
-      
     }
   }
 </style>

+ 43 - 55
src/views/message/sysnotion-config/compontents/BasicInfo.vue

@@ -13,18 +13,14 @@
       :label-position="labelPosition"
       class="el-form-outer"
     >
-      <el-form-item
-        label="消息样式: "
-        prop="messageType"
-      >
+      <el-form-item label="消息样式: " prop="messageType">
         <el-radio-group v-model="ruleForm.messageType" :disabled="isDisabled">
-        <el-radio :value="item.value"   v-for="item in messageTypeOptions" :key="item.value">{{ item.       label }}   </el-radio>
-  </el-radio-group>
+          <el-radio :value="item.value" v-for="item in messageTypeOptions" :key="item.value"
+            >{{ item.label }}
+          </el-radio>
+        </el-radio-group>
       </el-form-item>
-       <el-form-item
-        label="消息标题: "
-        prop="title"
-      >
+      <el-form-item label="消息标题: " prop="title">
         <el-input
           v-model="ruleForm.title"
           placeholder="请输入20字以内的消息标题"
@@ -49,10 +45,7 @@
           <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
         </el-upload>
       </el-form-item>
-      <el-form-item
-        label="推送渠道: "
-        prop="pushChannel"
-      >
+      <el-form-item label="推送渠道: " prop="pushChannel">
         <el-checkbox
           v-model="ruleForm.pushChannel"
           v-for="item in pushChannelName"
@@ -62,11 +55,8 @@
           :disabled="isDisabled"
         />
       </el-form-item>
-      <el-form-item
-        label="失效时间: "
-        prop="expirationTime"
-      >
-         <el-date-picker
+      <el-form-item label="失效时间: " prop="expirationTime">
+        <el-date-picker
           v-model="ruleForm.expirationTime"
           type="datetime"
           placeholder="请选择失效时间"
@@ -87,22 +77,22 @@
 </template>
 
 <script setup lang="ts">
-  import { ref, watch,computed } from 'vue';
+  import { ref, watch, computed } from 'vue';
   import type { FormInstance, FormProps, FormRules, UploadProps } from 'element-plus';
-  import { ElMessage } from 'element-plus'
-  import { Plus } from '@element-plus/icons-vue'
+  import { ElMessage } from 'element-plus';
+  import { Plus } from '@element-plus/icons-vue';
   import PushObject from '../../components/PushObject.vue';
-  import CardLayout from './CardLayout.vue';  
+  import CardLayout from './CardLayout.vue';
   import { RuleFormProps, MessageTypeEnum } from '../type';
   import { messageTypeOptions, pushChannelName } from '../../constant';
   import urlJoin from 'url-join';
   import { useGlobSetting } from '@/hooks/setting';
   const { urlPrefix } = useGlobSetting();
   interface Props {
-    dataSoure: RuleFormProps,
-    isDisabled: boolean,
+    dataSoure: RuleFormProps;
+    isDisabled: boolean;
   }
-  const props = defineProps<Props>()
+  const props = defineProps<Props>();
   const labelPosition = ref<FormProps['labelPosition']>('left');
   const childFromRef = ref<InstanceType<typeof PushObject>>();
   const actionUrl = computed(() => {
@@ -110,9 +100,9 @@
   });
 
   /**
-   * 表单相关操作 
+   * 表单相关操作
    */
-  type Rule = Omit<RuleFormProps, 'introduction' | 'contentType' | 'content' | 'operator' >;
+  type Rule = Omit<RuleFormProps, 'introduction' | 'contentType' | 'content' | 'operator'>;
   const formRules: FormRules<Rule> = {
     messageType: [{ required: true, trigger: 'change', message: '请选择消息样式' }],
     title: [{ required: true, trigger: 'change', message: '请输入消息标题' }],
@@ -126,66 +116,64 @@
     pushChannel: [],
     recipientType: {
       recipientType: 0,
-      userGroupList:[],
+      userGroupList: [],
       customUserList: [],
     },
     expirationTime: '',
-    bannerUrl:''
-  })
+    bannerUrl: '',
+  });
 
   watch(
     () => props.dataSoure,
     (value) => {
       if (value) {
-        ruleForm.value = {...value}
+        ruleForm.value = { ...value };
       }
-    }, {
-    immediate: true
-  })
+    },
+    {
+      immediate: true,
+      deep: true,
+    },
+  );
 
   const ruleFormRef = ref<FormInstance>();
   const isValidate = ref<boolean>();
-  const validate = async() => {
+  const validate = async () => {
     if (!ruleFormRef.value) return;
     try {
       const isSuccess = await ruleFormRef.value.validate();
       if (isSuccess) {
         const childValue = childFromRef.value!.getChildValue();
         childFromRef.value!.submitForm().then((res) => {
-          isValidate.value = res
+          isValidate.value = res;
         });
         if (childValue) {
-          ruleForm.value.recipientType = { ...childValue }
-        } 
-        return ruleForm.value
+          ruleForm.value.recipientType = { ...childValue };
+        }
+        return ruleForm.value;
       } else {
-
       }
-     
     } catch (error) {
       console.log('error: ', error);
     }
   };
 
-  const handleAvatarSuccess: UploadProps['onSuccess'] = (
-    response,
-    uploadFile
-  ) => {
-    ruleForm.value.bannerUrl = URL.createObjectURL(uploadFile.raw!)
-  }
+  const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
+    ruleForm.value.bannerUrl = URL.createObjectURL(uploadFile.raw!);
+  };
 
   const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
     if (rawFile.type !== 'image/jpeg') {
-      ElMessage.error('Avatar picture must be JPG format!')
-      return false
+      ElMessage.error('Avatar picture must be JPG format!');
+      return false;
     } else if (rawFile.size / 1024 / 1024 > 2) {
-      ElMessage.error('Avatar picture size can not exceed 2MB!')
-      return false
+      ElMessage.error('Avatar picture size can not exceed 2MB!');
+      return false;
     }
-    return true
-  }
+    return true;
+  };
 
-  defineExpose({validate})
+  defineExpose({ validate });
 </script>
 
 <style scoped lang="scss">

+ 110 - 84
src/views/message/sysnotion-config/compontents/ContentConfig.vue

@@ -5,14 +5,14 @@
 <template>
   <div class="container"></div>
   <card-layout title="内容配置" :isShowWraning="false" :mandatory="false">
-     <el-form
+    <el-form
       ref="ruleFormRef"
       label-width="auto"
       :model="ruleForm"
       :label-position="labelPosition"
       class="el-form-outer"
     >
-    <el-form-item label="简介内容" prop="introduction" class="transprant">
+      <el-form-item label="简介内容" prop="introduction" class="transprant">
         <el-input
           v-model="ruleForm.introduction"
           placeholder="请输入500字以内的简介内容"
@@ -23,37 +23,48 @@
           :disabled="isDisabled"
         />
       </el-form-item>
-   
+
       <el-form-item label="详情内容" prop="contentType" class="transprant">
         <el-radio-group v-model="ruleForm.contentType" :disabled="isDisabled">
-          <el-radio :value="item.value"   v-for="item in contentTypeOptinos" :key="item.value">{{ item.  label }}</el-radio>
+          <el-radio :value="item.value" v-for="item in contentTypeOptinos" :key="item.value">{{
+            item.label
+          }}</el-radio>
         </el-radio-group>
       </el-form-item>
-       <el-form-item label=" " prop="contentUrl" class="transprant" v-if="ruleForm.contentType === ContentTypeEnum.LINK">
+      <el-form-item
+        label=" "
+        prop="contentUrl"
+        class="transprant"
+        v-if="ruleForm.contentType === ContentTypeEnum.LINK"
+      >
         <el-input
           v-model="ruleForm.contentUrl"
           placeholder="请将链接地址粘贴到此处"
           :disabled="isDisabled"
         />
       </el-form-item>
-      <el-form-item label="  " prop="content"  v-if="ruleForm.contentType === ContentTypeEnum.RICHTEXT">
-      <div style="border: 1px solid #ccc">
-        <Toolbar
-          style="border-bottom: 1px solid #ccc"
-          :editor="editorRef"
-          :defaultConfig="toolbarConfig"
-        />
-        <Editor
-          style="height: 500px; overflow-y: hidden;"
-          v-model="valueHtml"
-          :defaultConfig="editorConfig"
-          @onCreated="handleCreated"
-          @onChange="handleChange"
-          @onDestroyed="handleDestroyed"
-          @onFocus="handleFocus"
-          @onBlur="handleBlur"
-        />
-      </div>
+      <el-form-item
+        label="  "
+        prop="content"
+        v-if="ruleForm.contentType === ContentTypeEnum.RICHTEXT"
+      >
+        <div style="border: 1px solid #ccc">
+          <Toolbar
+            style="border-bottom: 1px solid #ccc"
+            :editor="editorRef"
+            :defaultConfig="toolbarConfig"
+          />
+          <Editor
+            style="height: 500px; overflow-y: hidden"
+            v-model="valueHtml"
+            :defaultConfig="editorConfig"
+            @onCreated="handleCreated"
+            @onChange="handleChange"
+            @onDestroyed="handleDestroyed"
+            @onFocus="handleFocus"
+            @onBlur="handleBlur"
+          />
+        </div>
       </el-form-item>
       <el-form-item label="操作人" prop="operator" class="transprant">
         <el-input v-model="ruleForm.operator" :disabled="true" />
@@ -63,71 +74,84 @@
 </template>
 
 <script setup lang="ts">
-  import { onBeforeUnmount, ref, shallowRef, onMounted, watch } from 'vue'
+  import { onBeforeUnmount, ref, shallowRef, onMounted, watch } from 'vue';
   import type { FormProps } from 'element-plus';
-  import '@wangeditor/editor/dist/css/style.css' // 引入 css
-  import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
-  import { type IEditorConfig } from '@wangeditor/editor-for-vue'
+  import '@wangeditor/editor/dist/css/style.css'; // 引入 css
+  import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
+  import { type IEditorConfig } from '@wangeditor/editor-for-vue';
   import { RuleFormProps, ContentTypeEnum } from './../type';
   import { contentTypeOptinos } from '../../constant';
   import CardLayout from './CardLayout.vue';
 
   interface Props {
-    dataSoure: RuleFormProps,
-    isDisabled: boolean
+    dataSoure: RuleFormProps;
+    isDisabled: boolean;
   }
-  const props = defineProps<Props>()
+  const props = defineProps<Props>();
   const labelPosition = ref<FormProps['labelPosition']>('left');
 
-   /**
-   * 表单相关操作 
+  /**
+   * 表单相关操作
    */
-  type Rule = Pick<RuleFormProps, 'introduction' | 'contentType' | 'content' | 'operator' | 'contentUrl'>;
+  type Rule = Pick<
+    RuleFormProps,
+    'introduction' | 'contentType' | 'content' | 'operator' | 'contentUrl'
+  >;
   const ruleForm = ref<Rule>({
     introduction: '',
     contentType: 1,
     content: '',
     operator: '',
-    contentUrl: ''
-  })
+    contentUrl: '',
+  });
 
-  watch(() => props.dataSoure, (value) => {
-    if (value) {
-      const { introduction, contentType, content, operator, contentUrl } = value;
-      ruleForm.value = {
-        introduction,
-        contentType,
-        content,
-        operator,
-        contentUrl
+  watch(
+    () => props.dataSoure,
+    (value) => {
+      if (value) {
+        const { introduction, contentType, content, operator, contentUrl } = value;
+        ruleForm.value = {
+          introduction,
+          contentType,
+          content,
+          operator,
+          contentUrl,
+        };
+        if (content) {
+          valueHtml.value = content;
+        }
       }
-      console.log(' ruleForm.value: ',  ruleForm.value);
-    }
-  }, {
-  immediate: true
-  })
+    },
+    {
+      immediate: true,
+      deep: true,
+    },
+  );
 
   /********************* 富文本区域配置与方法 **********************/
   // 编辑器实例,必须用 shallowRef
-  const editorRef = shallowRef()
+  const editorRef = shallowRef();
   // 内容 HTML
-  const valueHtml = ref()
+  const valueHtml = ref();
   // 排除工具栏选项
   const toolbarConfig = {
     excludeKeys: [
-      "insertTable", // 插入表格
-      "deleteTable", // 删除表格
+      'insertTable', // 插入表格
+      'deleteTable', // 删除表格
       'insertVideo',
       'uploadVideo',
-      "codeBlock", // 代码块
-      "emotion", // 表情
-    ]
-  }   
-const editorConfig: Partial<IEditorConfig> = {
-  placeholder: '请输入内容...', MENU_CONF: {}}
+      'codeBlock', // 代码块
+      'emotion', // 表情
+    ],
+  };
+  const editorConfig: Partial<IEditorConfig> = {
+    placeholder: '请输入内容...',
+    MENU_CONF: {},
+  };
+  let picName = '';
   editorConfig.MENU_CONF['uploadImage'] = {
     // 上传图片的配置
-    server: '/skyeye-file-upload/upload', // form-data fieldName ,默认值 'wangeditor-uploaded-image'
+    server: '/eye_api_bak/api/systemMessage/uploadPicture', // form-data fieldName ,默认值 'wangeditor-uploaded-image'
     fieldName: 'file',
     // 单个文件的最大体积限制,默认为 2M
     maxFileSize: 1 * 1024 * 1024, // 1M
@@ -137,8 +161,10 @@ const editorConfig: Partial<IEditorConfig> = {
     // allowedFileTypes: ['image/*'],
     // 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。
     meta: {
-        type: 1,
-        targetId: 5
+      // type: 1,
+      // targetId: 5,
+      fileName: picName,
+      bizType: 'ALGO',
     },
     // 将 meta 拼接到 url 参数中,默认 false
     metaWithUrl: false,
@@ -155,7 +181,8 @@ const editorConfig: Partial<IEditorConfig> = {
     onBeforeUpload(file) {
       console.log('file: ', file);
       // file 选中的文件,格式如 { key: file }
-      return file
+      picName = file.name;
+      return file;
       // 可以 return
       // 1. return file 或者 new 一个 file ,接下来将上传
       // 2. return false ,不上传这个 file
@@ -163,54 +190,53 @@ const editorConfig: Partial<IEditorConfig> = {
     // 上传进度的回调函数
     onProgress(progress: number) {
       // progress 是 0-100 的数字
-      console.log('progress', progress)
+      console.log('progress', progress);
     },
     // 单个文件上传成功之后
     onSuccess(file: File, res: any) {
-      console.log(`${file.name} 上传成功`, res)
+      console.log(`${file.name} 上传成功`, res);
     },
     // 单个文件上传失败
     onFailed(file: File, res: any) {
-      console.log(`${file.name} 上传失败`, res)
+      console.log(`${file.name} 上传失败`, res);
     },
     // 上传错误,或者触发 timeout 超时
     onError(file: File, err: any, res: any) {
-      console.log(`${file.name} 上传出错`, err, res)
+      console.log(`${file.name} 上传出错`, err, res);
     },
-  }
+  };
 
   // 执行 createEditor 组件销毁时,也及时销毁编辑器
   onBeforeUnmount(() => {
-    const editor = editorRef.value
-    if (editor == null) return
-    editor.destroy()
-  })
+    const editor = editorRef.value;
+    if (editor == null) return;
+    editor.destroy();
+  });
 
   const handleCreated = (editor) => {
-    editorRef.value = editor
-  }
+    editorRef.value = editor;
+  };
   const handleChange = (editor) => {
     // console.log('change:', editor.children)
-  }
+  };
   const handleDestroyed = (editor) => {
-    console.log('destroyed', editor)
-  }
+    console.log('destroyed', editor);
+  };
   const handleFocus = (editor) => {
     // console.log('focus', editor)
-  }
+  };
   const handleBlur = (editor) => {
-    console.log('blur', editor)
-  }
+    console.log('blur', editor);
+  };
 
   const buildFormdata = () => {
     return {
       ...ruleForm.value,
       content: valueHtml.value,
-    }
-  }
-
-  defineExpose({ buildFormdata })
+    };
+  };
 
+  defineExpose({ buildFormdata });
 </script>
 
 <style scoped lang="scss"></style>

+ 16 - 15
src/views/message/sysnotion-config/type.ts

@@ -1,26 +1,27 @@
 export interface UserList {
-    userId: number;
-    userLoginName: string;
-    userNickname: string;
-    userNumber: string;
+  userId: number;
+  userLoginName: string;
+  userNickname: string;
+  userNumber: string;
 }
 
 export interface GroupList {
-    userGroupId: number;
-    total: number;
-    operatorName: string;
-    operationTime: string;
-    name: string;
-    description: string;
+  userGroupId: number;
+  total: number;
+  operatorName: string;
+  operationTime: string;
+  name: string;
+  description: string;
 }
 
 export interface ObjectFrom {
-    recipientType?: number;
-    userGroupList?: GroupList[];
-    customUserList?: UserList[];
+  recipientType?: number;
+  userGroupList?: GroupList[];
+  customUserList?: UserList[];
 }
 
 export interface RuleFormProps {
+  id?: number;
   messageType: number;
   title: string;
   pushChannel: number[];
@@ -41,5 +42,5 @@ export enum ContentTypeEnum {
 
 export enum MessageTypeEnum {
   BANNER = 1,
-  TEXT = 2
-}
+  TEXT = 2,
+}

+ 4 - 0
src/views/message/systemNotifications/type.ts

@@ -15,11 +15,15 @@ export interface systemTableData {
 export enum pushChannelEnum {
   platform = 2,
   lanxin = 1,
+  app = 4,
+  pc = 5,
 }
 
 export const pushChannelMapping = {
   [pushChannelEnum.platform]: '平台',
   [pushChannelEnum.lanxin]: '蓝信',
+  [pushChannelEnum.app]: 'APP主页',
+  [pushChannelEnum.pc]: 'PC主页',
 };
 
 export enum recipientTypeEnum {

+ 1 - 1
utils/devProxy/local/proxy.ts

@@ -3,7 +3,7 @@ import path from 'path';
 
 // 连后端本机时的代理staff环境
 const proxyStaff: PROXY_TYPE = {
-  serverHost: 'http://192.168.13.68/eye_api_bak/',
+  serverHost: 'http://192.168.22.233:8800/',
   loginHost: 'http://192.168.13.68/skyeye-login/',
   skyeyeFileUploadHost: 'http://192.168.13.68/skyeye-file-upload',
   nvrDownload: 'http://192.168.13.68/nvr_download',