Quellcode durchsuchen

提交风险判断代码

林倩 vor 2 Jahren
Ursprung
Commit
f895046e33

+ 9 - 0
src/api/permission-selfhelp-manage.js

@@ -135,3 +135,12 @@ export function checkAppFunRepeat(params) {
      params
   })
 }
+
+// 判断是否存在红白名单内容
+export function rediListCheck(data) {
+  return request({
+     url: `${baseUrl}/redListCheck `,
+     method: "POST",
+     data
+  })
+}

+ 27 - 4
src/pages/permission-selfhelp-manage/component/basic-form.vue

@@ -119,7 +119,13 @@
           <!-- <component :is="approveComponent"></component> -->
           <el-form-item label="审批内容:" class="self-form-item" prop="flowContent">
             <div style="display: flex" v-if="!isDetail">
-              <el-input type="textarea" :autosize="{ minRows: 5 }" :value="flowContentStr" :disabled="true" placeholder="请选择审批内容"></el-input>
+              <el-input
+                type="textarea"
+                :autosize="{ minRows: 5 }"
+                :value="flowContentStr"
+                :disabled="true"
+                placeholder="请选择审批内容"
+              ></el-input>
               <dg-button style="margin-left: 10px" @click="handleChoice" v-if="sizeForm.applyType && !this.repeatApply"
                 >选择</dg-button
               >
@@ -348,7 +354,7 @@ export default {
           code: '02'
         }
       ],
-      dateRange: "",
+      dateRange: '',
       pickerOptions: {
         disabledDate(currentDate) {
           return currentDate.getTime() < Date.now() - 8.64e7;
@@ -477,7 +483,24 @@ export default {
         this.$refs.ruleForm.validate((valid) => {
           if (valid) {
             this.sizeForm.operateType = '2';
-            this.save();
+            Api.rediListCheck(this.sizeForm.resourceInfos).then((res) => {
+              const { result, content, msg } = res.data;
+              if (result == '200') {
+                if (content === true) {
+                  // 说明存在风险
+                  this.$dgConfirm(`您申请的内容命中功能红名单风险,请确定是否继续申请?`, '风险提示', {}).then(
+                    () => {
+                      this.save();
+                    }
+                  );
+                } else {
+                  // 没有命中直接保存
+                  this.save();
+                }
+              } else {
+                this.$message.warning(msg);
+              }
+            });
           }
         });
       }
@@ -622,7 +645,7 @@ export default {
           ...otherInfo
         };
         if (this.sizeForm.permissionValidType == '01') {
-           this.dateRange = [this.sizeForm.startTime, this.sizeForm.endTime];
+          this.dateRange = [this.sizeForm.startTime, this.sizeForm.endTime];
         }
         const delResourceInfoIds = delResourceInfos.map((item) => item.funId);
         // 默认选中节点 = 新增节点 + ( 已有节点 - 欲撤销节点 )