ソースを参照

查询条件修改

zhongxiaoyu 2 年 前
コミット
4c7b4a30ea
4 ファイル変更159 行追加75 行削除
  1. 1 0
      public/config.js
  2. 154 72
      src/layout/index.vue
  3. 1 1
      src/views/newQuery/index.vue
  4. 3 2
      src/views/table/index.vue

+ 1 - 0
public/config.js

@@ -18,6 +18,7 @@ window.SERVICE_ID = {
   bagTableId: 20030, //行李详情-表头
   bagDetailId: 20027, //行李详情-表格
   bagViewId: 20036, //航班视图-基础信息
+  changePwd: 20045, // 修改密码
   
   /***-----高级查询------***/
   baggageTypeId: 86, //高级查询-特殊行李类型下拉选项查询-id

+ 154 - 72
src/layout/index.vue

@@ -1,32 +1,82 @@
 <template>
   <div class="app-wrapper">
-    <sidebar class="sidebar-container" id="sidebar-containers" />
+    <sidebar
+      class="sidebar-container"
+      id="sidebar-containers"
+    />
     <div class="main-container">
       <navbar />
       <app-main id="main-containers" />
     </div>
     <!--修改密码弹框-->
-    <Dialog width="496px" customClass="dataStoreInfoDialog" :flag="pwdflag">
+    <Dialog
+      width="496px"
+      customClass="dataStoreInfoDialog"
+      :flag="pwdflag"
+    >
       <div class="dialog-public-background">
         <div class="title">修改密码</div>
         <div class="content">
-          <div class="ruleZf">特殊字符:`、!、@、#、$、%、^、&、*、(、)、_、+、{、}、"、:、?、>、&lt;、`、,、.、/、'、;、[、]、=、-、\、|</div>
-          <div class="ruleZf">密码规则:长度为8-20个字符,并且必须包含数字、大写字母、小写字母、特殊字符</div>
-          <el-form :model="dataForm" :rules="dataRules" ref="dataForm" class="demo-dataForm">
-            <el-form-item label="旧密码" prop="old">
-              <el-input size="medium" placeholder="请输入旧密码" show-password v-model="dataForm.old"></el-input>
+          <div class="ruleZf">
+            特殊字符:`、!、@、#、$、%、^、&、*、(、)、_、+、{、}、"、:、?、>、&lt;、`、,、.、/、'、;、[、]、=、-、\、|
+          </div>
+          <div class="ruleZf">
+            密码规则:长度为8-20个字符,并且必须包含数字、大写字母、小写字母、特殊字符
+          </div>
+          <el-form
+            :model="dataForm"
+            :rules="dataRules"
+            ref="dataForm"
+            class="demo-dataForm"
+          >
+            <el-form-item
+              label="旧密码"
+              prop="old"
+            >
+              <el-input
+                size="medium"
+                placeholder="请输入旧密码"
+                show-password
+                v-model="dataForm.old"
+              ></el-input>
             </el-form-item>
-            <el-form-item label="新密码" prop="new">
-              <el-input size="medium" placeholder="请输入新密码" show-password v-model="dataForm.new"></el-input>
+            <el-form-item
+              label="新密码"
+              prop="new"
+            >
+              <el-input
+                size="medium"
+                placeholder="请输入新密码"
+                show-password
+                v-model="dataForm.new"
+              ></el-input>
             </el-form-item>
-            <el-form-item label="再次确认新密码" prop="again">
-              <el-input size="medium" placeholder="请再次确认新密码" show-password v-model="dataForm.again"></el-input>
+            <el-form-item
+              label="再次确认新密码"
+              prop="again"
+            >
+              <el-input
+                size="medium"
+                placeholder="请再次确认新密码"
+                show-password
+                v-model="dataForm.again"
+              ></el-input>
             </el-form-item>
           </el-form>
         </div>
         <div class="foot center t30">
-          <el-button size="medium" type="primary" @click="addSubmit('dataForm')" class="r24">保存</el-button>
-          <el-button size="medium" @click="resetForm('dataForm')">取消</el-button>
+          <el-button
+            size="medium"
+            type="primary"
+            @click="addSubmit('dataForm')"
+            class="r24"
+            >保存</el-button
+          >
+          <el-button
+            size="medium"
+            @click="resetForm('dataForm')"
+            >取消</el-button
+          >
         </div>
       </div>
     </Dialog>
@@ -35,9 +85,23 @@
       <div class="airportInfoDialog">
         <div class="flx">退出系统</div>
         <div class="content">是否确认退出系统?</div>
-        <div class="foot right t30" style="margin-top: 24px">
-          <el-button size="medium" class="r25 r26" @click="outQd" type="primary">确定</el-button>
-          <el-button size="medium" @click="outQx" class="r26">取消</el-button>
+        <div
+          class="foot right t30"
+          style="margin-top: 24px"
+        >
+          <el-button
+            size="medium"
+            class="r25 r26"
+            @click="outQd"
+            type="primary"
+            >确定</el-button
+          >
+          <el-button
+            size="medium"
+            @click="outQx"
+            class="r26"
+            >取消</el-button
+          >
         </div>
       </div>
     </Dialog>
@@ -47,123 +111,141 @@
 </template>
 
 <script>
-import { Navbar, Sidebar, AppMain } from "./components";
-import ResizeMixin from "./mixin/ResizeHandler";
-import { mapGetters } from "vuex";
-import { changePassword } from "@/api/newLogin";
-import { removeToken } from "@/utils/auth";
-import Dialog from "@/layout/components/Dialog";
+import { Navbar, Sidebar, AppMain } from './components'
+import ResizeMixin from './mixin/ResizeHandler'
+import { mapGetters } from 'vuex'
+// import { changePassword } from "@/api/newLogin";
+// import { removeToken } from "@/utils/auth";
+import { modifyData } from '@/api/webApi'
+import Dialog from '@/layout/components/Dialog'
 import MD5 from 'blueimp-md5'
 import PassengerDialog from '@/components/PassengerDialog'
 import AbnormalBaggageDialog from '@/components/AbnormalBaggageDialog'
 export default {
-  name: "Layout",
+  name: 'Layout',
   components: {
     Navbar,
     Sidebar,
     AppMain,
     Dialog,
     PassengerDialog,
-    AbnormalBaggageDialog
+    AbnormalBaggageDialog,
   },
   mixins: [ResizeMixin],
-  data () {
+  data() {
     return {
       dataForm: {
         //数据项表单
-        old: "",
-        new: "",
-        again: "",
+        old: '',
+        new: '',
+        again: '',
       },
       // leup: true,
       dataRules: {
         //数据项表单验证
-        old: [{ required: true, message: "请输入旧密码", trigger: "blur" }],
-        new: [{ required: true, message: "请输入新密码", trigger: "blur" }],
+        old: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
+        new: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
         again: [
-          { required: true, message: "请再次确认新密码", trigger: "blur" },
+          { required: true, message: '请再次确认新密码', trigger: 'blur' },
         ],
       },
-    };
+    }
   },
   computed: {
-    ...mapGetters(["pwdflag", "outflag", "name"]),
+    ...mapGetters(['pwdflag', 'outflag', 'name']),
   },
   methods: {
     //存储数据项-提交
-    addSubmit (formName) {
-      this.$refs[formName].validate((valid) => {
+    addSubmit(formName) {
+      this.$refs[formName].validate(valid => {
         if (valid) {
           if (this.dataForm.new !== this.dataForm.again) {
-            this.$message.error("两次输入的密码不一致,请重新输入");
-            return false;
+            this.$message.error('两次输入的密码不一致,请重新输入')
+            return false
           }
-          this.editPwd();
+          this.editPwd()
         } else {
-
-          return false;
+          return false
         }
-      });
+      })
     },
     //存储数据项-取消
-    resetForm (formName) {
-      this.$store.dispatch("app/togglePwdflag", false);
-      this.$refs[formName].resetFields();
+    resetForm(formName) {
+      this.$store.dispatch('app/togglePwdflag', false)
+      this.$refs[formName].resetFields()
     },
     //退出系统-取消
-    outQx () {
-      this.$store.dispatch("app/toggleOutflag", false);
+    outQx() {
+      this.$store.dispatch('app/toggleOutflag', false)
     },
     //退出系统-确定
-    async outQd () {
-      const res = await this.$store.dispatch("user/logout");
+    async outQd() {
+      const res = await this.$store.dispatch('user/logout')
       const that = this
       if (res) {
-        that.$store.dispatch("app/toggleOutflag", false);
+        that.$store.dispatch('app/toggleOutflag', false)
         this.$message({
           type: 'success',
           message: '退出登录成功',
           duration: 1000,
           onClose: () => {
-            sessionStorage.removeItem("userName");
-            that.$router.push(`/login`);
-          }
+            sessionStorage.removeItem('userName')
+            that.$router.push(`/login`)
+          },
         })
       } else {
         this.$message.error('退出登录失败')
       }
     },
-    //修改密码
-    async editPwd () {
+    // 修改密码
+    async editPwd() {
       try {
-        const res = await changePassword({
-          username: this.name,
-          userId: sessionStorage.getItem('User_Id'),
-          originPassword: MD5(this.dataForm.old),
-          // passwd: MD5(this.dataForm.again),
-          newPassword: this.dataForm.again,
-          // newPassword: MD5(this.dataForm.again),
-        });
-        if (res.code == 0) {
-          this.$message.success(res.message);
-          this.$store.dispatch("app/togglePwdflag", false);
+        const res = await modifyData({
+          serviceId: SERVICE_ID.changePwd,
+          dataContent: {
+            filter: [
+              {
+                left: '(',
+                column: 'user_id',
+                comparator: '=',
+                value: sessionStorage.getItem('User_Id'),
+                right: ')',
+                connector: 'and',
+              },
+              {
+                left: '(',
+                column: 'user_pwd',
+                comparator: '=',
+                value: MD5(this.dataForm.old),
+                right: ')',
+                connector: 'and',
+              },
+            ],
+            Value: {
+              user_pwd: MD5(this.dataForm.again),
+            },
+          },
+        })
+        if (res.code == 0 && res.sql.includes('update')) {
+          this.$message.success(res.message ?? '成功')
+          this.$store.dispatch('app/togglePwdflag', false)
           setTimeout(() => {
-            this.outQd();
-          }, 2000);
+            this.outQd()
+          }, 2000)
         } else {
-          this.$message.error(res.message);
+          this.$message.error(res.message ?? '失败')
         }
       } catch (error) {
-        this.$message.error("失败");
+        this.$message.error('失败')
       }
     },
   },
-};
+}
 </script>
 
 <style lang="scss" scoped>
-@import "~@/styles/mixin.scss";
-@import "~@/styles/variables.scss";
+@import '~@/styles/mixin.scss';
+@import '~@/styles/variables.scss';
 
 .app-wrapper {
   @include clearfix;

+ 1 - 1
src/views/newQuery/index.vue

@@ -200,7 +200,7 @@ export default {
     //查询
     handleSearch () {
       this.queryType = 'query'
-      this.$refs.searchTable.advancedQueryHandler()
+      this.$refs.searchTable?.advancedQueryHandler()
     },
     //确定-保存条件
     handleOk () {

+ 3 - 2
src/views/table/index.vue

@@ -518,7 +518,7 @@ export default {
         })
       }
       this.resetTable()
-      this.getQuery(this.queryId, arr);
+      this.getQuery(this.queryId, { filter: arr });
     },
     //获取表格数据
     async getQuery (id, dataContent = this.dataContent) {
@@ -529,7 +529,8 @@ export default {
           page: ++this.page,
           pageSize: this.pageSize,
           dataContent,
-          authId: this.authId
+          authId: this.authId,
+          event: '0'
         });
         if (code == 0) {
           if (returnData.length === 0) {