Selaa lähdekoodia

Merge remote-tracking branch 'origin/v0.1.0' into v0.1.0

jingyuanchao 1 vuosi sitten
vanhempi
commit
e7cc1765b3

+ 19 - 0
src/api/system/sqlEncryptionAndDecryption.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// sql 加密
+export function encrySql(query) {
+  return request({
+    url: '/system/sql/encry',
+    method: 'post',
+    data: query
+  })
+}
+
+// sql 解密
+export function decrySql(query) {
+  return request({
+    url: '/system/sql/decry',
+    method: 'post',
+    data: query
+  })
+}

+ 5 - 0
src/router/index.js

@@ -89,6 +89,11 @@ export const constantRoutes = [
     hidden: true,
   },
   {
+    path: "/sql/encryptionanddecryption/",
+    component: () => import("@/views/system/sqlEncryptionAndDecryption"),
+    hidden: true,
+  },
+  {
     path: "",
     component: Layout,
     redirect: "home",

+ 11 - 0
src/views/resumption/plan/dialog.edit.vue

@@ -844,6 +844,17 @@ export default {
         this.tableData = [];
       }
       let selectedIds = selectList.map((i) => i.id);
+
+      //禁止删除的 要点不能取消
+      let tempList= this.tableData.filter((d) => !this.getshenglianshe(d));
+      for (let i = 0; i < tempList.length; i++) {
+        if(!selectedIds.includes(tempList[i].id))
+        {
+          selectedIds.push(tempList[i].id);
+        }
+      }
+      
+
       this.tableData = this.tableData.filter((d) => selectedIds.includes(d.id));
       for (let i = 0; i < selectList.length; i++) {
         let item = selectList[i];

+ 35 - 17
src/views/safetycheck/plan/dialog.edit.vue

@@ -842,24 +842,42 @@ export default {
     },
     onSelect(selectList) {
       console.log(selectList, "selectList");
-      for (let i = 0; i < selectList.length; i++) {
-        let tem = {
-          ofOrgId: this.orgId,
-          pointScan: selectList[i].pointScan,
-          required: !selectList[i].required,
-          ruleName: selectList[i].ruleName,
-          itemName: selectList[i].itemName,
-          pointName: selectList[i].pointName,
-          areaName: selectList[i].areaName,
-          itemId: selectList[i].itemId,
-          id: selectList[i].id,
-          businessType: selectList[i].businessType,
-        };
-        if (this.tableData == null) {
-          this.tableData = [];
+      if (this.tableData == null) {
+        this.tableData = [];
+      }
+      let selectedIds = selectList.map((i) => i.id);
+
+
+      //省联社要点禁止删除
+      let tempList= this.tableData.filter((d) => !this.getshenglianshe(d));
+      for (let i = 0; i < tempList.length; i++) {
+        if(!selectedIds.includes(tempList[i].id))
+        {
+          selectedIds.push(tempList[i].id);
         }
-        if (tem.itemName != null && tem.itemName != undefined) {
-          this.tableData.push(tem);
+      }
+      this.tableData = this.tableData.filter((d) => selectedIds.includes(d.id));
+
+      for (let i = 0; i < selectList.length; i++) {
+        let item = selectList[i];
+        let exist = this.tableData.find((d) => d.id == item.id);
+        if (!exist) {
+          let tem = {
+            ofOrgId: this.orgId,
+            pointScan: selectList[i].pointScan,
+            required: !selectList[i].required,
+            ruleName: selectList[i].ruleName,
+            itemName: selectList[i].itemName,
+            pointName: selectList[i].pointName,
+            areaName: selectList[i].areaName,
+            itemId: selectList[i].itemId,
+            id: selectList[i].id,
+            businessType: selectList[i].businessType,
+          };
+          
+          if (tem.itemName != null && tem.itemName != undefined) {
+            this.tableData.push(tem);
+          }
         }
       }
     },

+ 1 - 1
src/views/safetycheck/ruleManager/dialog.editPoint.vue

@@ -146,7 +146,7 @@ export default {
         areaName: null,
         businessType: null,
         remark: null,
-        sort: null
+        sort: undefined
       };
     },
     async show(index, data, isUpdate) {

+ 157 - 0
src/views/system/sqlEncryptionAndDecryption/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="app-container">
+        <el-col :span="11">
+          <el-card class="box-card" :body-style="{ height: '100%' }">
+            <el-form
+              ref="formleft"
+              label-width="120px"
+              size="mini"
+              style="width: 95%"
+            >
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="明文SQL:">
+                    <el-input
+                      v-model="leftClearSQL"
+                      clearable
+                      type="textarea" 
+                      :autosize="{ minRows: 12, maxRows: 12}"                
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="12" :offset="12" style="margin-bottom:20px;">
+                  <el-button type="primary" @click="handleEncryption">加密</el-button>
+                </el-col>
+              </el-row>
+            
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="密文SQL:">
+                    <el-input
+                      v-model="leftCipherSQL"
+                      type="textarea" 
+                      :autosize="{ minRows: 12, maxRows: 12}"
+                      clearable
+                     
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form>
+          </el-card>
+        </el-col>
+        <el-col :span="11" :offset="2">
+          <el-card class="box-card" :body-style="{ height: '100%' }">
+            <el-form
+              ref="formleft"
+              label-width="120px"
+              size="mini"
+              style="width: 95%"
+            >
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="密文SQL">
+                    <el-input
+                      v-model="rightCipherSQL"
+                      clearable
+                      type="textarea" 
+                      :autosize="{ minRows: 12, maxRows: 12}"
+                      
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="12" :offset="12" style="margin-bottom:20px;">
+                  <el-button type="primary" @click="handleDecry">解密</el-button>
+                </el-col>
+              </el-row>
+            
+              <el-row>
+                <el-col :span="24">
+                  <el-form-item label="明文SQL:">
+                    <el-input
+                      v-model="rightClearSQL"
+                      clearable
+                      type="textarea" 
+                      :autosize="{ minRows: 12, maxRows: 12}"
+                      
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form>
+          </el-card>
+        </el-col>
+  </div>
+</template>
+
+<script>
+import { decrySql,encrySql} from "@/api/system/sqlEncryptionAndDecryption";
+
+export default {
+  name: "SqlEncryAndDecry",
+  dicts: [],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      leftClearSQL:null,
+      leftCipherSQL:null,
+      rightClearSQL:null,
+      rightCipherSQL:null
+    };
+  },
+  created() {
+  },
+  methods: {
+    
+    /** 加密按钮操作 */
+    handleEncryption() {
+      if(!this.$store.getters.isAdmin)
+      {
+        this.$modal.msgError("仅超级管理员可用此工程");
+        return;
+      }
+      if(!this.leftClearSQL){
+        this.$modal.msgError("请输入需加密SQL明文");
+        return;
+      }
+
+      this.leftCipherSQL=null;
+      encrySql({sql:this.leftClearSQL.trim()}).then((result)=>{
+        this.$modal.msgSuccess("加密成功");
+        this.leftCipherSQL=result;
+      })
+      .catch((error) => {
+        this.$modal.msgError("加密失败:"+error.msg)
+      });
+        
+    },
+    /** 解密按钮操作 */
+    handleDecry() {
+      if(!this.$store.getters.isAdmin)
+      {
+        this.$modal.msgError("仅超级管理员可用此功能");
+        return;
+      }
+      if(!this.rightCipherSQL){
+        this.$modal.msgError("请输入需解密SQL密文");
+        return;
+      }
+      
+      this.rightClearSQL=null;
+      decrySql({sql:this.rightCipherSQL.trim()}).then((result)=>{
+        this.$modal.msgSuccess("解密成功");
+        this.rightClearSQL=result;
+      })
+      .catch((error) => {
+        this.$modal.msgError("解密失败:"+error)
+      });
+    },  
+  },
+};
+</script>
+

+ 9 - 1
src/views/system/workTimeBankingOffice/index.vue

@@ -404,7 +404,7 @@ export default {
         dayjs(calendarDate).subtract(1, "month").startOf("month")
       );
       let eDate = new Date(dayjs(calendarDate).add(1, "month").endOf("month"));
-      this.queryParams.range = [sDate, eDate];     
+      this.queryParams.range = [sDate, eDate];
       this.isNeedLoadedCalendarDate=true; 
       this.changeMonthText();
       this.getList();
@@ -535,6 +535,12 @@ export default {
       // console.log(this.queryParams, "pages");      
       tableList(this.queryParams)
         .then((response) => {
+          if(response.rows)
+          {
+            response.rows.forEach(x => {
+              if(x.isDuty==null) x.isDuty="0"
+            });
+          }
           this.tableList = response.rows;
           this.total = response.total;
           this.loading = false;
@@ -585,6 +591,7 @@ export default {
         }
         editWorkTime(this.formData).then((res) => {
           this.$message.success("保存成功");
+          this.isNeedLoadedCalendarDate=true;
           this.getList();
         });
       });
@@ -647,6 +654,7 @@ export default {
       console.log("submitCopyMouth", data);
       addWorkTimeDay(data).then((res) => {
         this.$message.success("保存成功");
+        this.isNeedLoadedCalendarDate=true;
         this.getList();
       });
     },