Преглед изворни кода

Merge branch 'dev' into sit

戴艳蓉 пре 3 година
родитељ
комит
1cb9d649a3

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-fba20844.7228b107.css → dist/static/css/chunk-32b89fd5.767b0578.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.7bfcaa52.js


BIN
dist/static/js/app.7bfcaa52.js.gz


BIN
dist/static/js/app.caf18e90.js.gz


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/chunk-32b89fd5.44f1a0f6.js


BIN
dist/static/js/chunk-32b89fd5.44f1a0f6.js.gz


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/chunk-fba20844.be9479c2.js


BIN
dist/static/js/chunk-fba20844.be9479c2.js.gz


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/chunk-libs.41a8b6ca.js


BIN
dist/static/js/chunk-libs.41a8b6ca.js.gz


BIN
dist/static/js/chunk-libs.d88a4fb1.js.gz


+ 2 - 1
src/apis/service/mobile/park/index.js

@@ -13,5 +13,6 @@ export default {
   add: (data, params) => http(api + 'accountadd', data, 'post', params),
   // 视频列表
   videoList:(data, params) => http(api + 'video', data, 'post', params),
-  
+  // 重置密码
+  setpwd: (data, params) => http(api + 'checkpwd', data, 'post', params),
 }

+ 23 - 3
src/views/mobile/park/index.vue

@@ -140,6 +140,17 @@
           <span>{{ scope.row.starttime }}~{{ scope.row.expiretime }}</span>
         </template>
         <template #operation="{ scope }">
+          <el-tooltip
+            v-if="roles === 'admin'"
+            effect="dark"
+            content="重置密码"
+            placement="top"
+          >
+            <i
+              class="el-icon-refresh-left tb-icon"
+              @click="openPasswordModal(scope.row.id, false)"
+            ></i>
+          </el-tooltip>
           <el-tooltip
             v-if="powers.some((item) => item == '007')"
             class="item"
@@ -194,16 +205,18 @@ import asyncRequest from "@/apis/service/mobile/park";
 import ExTable from "@/components/ExTableNew.vue";
 import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
+import resetPassword from "./resetPassword";
 import resToken from "@/mixins/resToken";
 export default {
   name: "park",
   components: {
     addEdit,
     ExTable,
+    resetPassword,
   },
   mixins: [mixinPage, resToken],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    ...mapGetters(["tablebtnSize", "searchSize", "size", "roles"]),
     powers() {
       let tran =
         this.$store.getters.btnList.find((item) => item.menu_route == "park") ||
@@ -244,7 +257,9 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
-      tableData: [],
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -305,7 +320,7 @@ export default {
           label: "操作",
           fixed: "right",
           _noset_: true,
-          width: "90px",
+          width: "120px",
           _slot_: "operation",
         },
       ],
@@ -340,6 +355,11 @@ export default {
       this.isDetail = isDetail;
       this.sitem = sitem;
     },
+    openPasswordModal(id, isDetail) {
+      this.passwordModel = true;
+      this.passwordModelId = id;
+      this.isPasswordDetail = isDetail;
+    },
     async searchList() {
       this.loading = true;
       this.parmValue.username = this.select === "1" ? this.input : "";

+ 197 - 0
src/views/mobile/park/resetPassword.vue

@@ -0,0 +1,197 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="25vh"
+    width="600px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="closeModel"
+  >
+    <el-card style="margin-top:-20px">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            label-width="110px"
+            class="demo-ruleForm"
+          >
+            <el-form-item prop="password" label="新密码:">
+              <el-input
+                ref="password"
+                v-model="ruleForm.password"
+                placeholder="新密码"
+                name="password"
+                type="password"
+                maxlength="6"
+                tabindex="1"
+                autocomplete="on"
+              />
+            </el-form-item>
+            <el-form-item prop="confirmPassword" label="确认密码:">
+              <el-input
+                ref="confirmPassword"
+                v-model="ruleForm.confirmPassword"
+                placeholder="确认密码"
+                name="confirmPassword"
+                type="password"
+                tabindex="1"
+                maxlength="6"
+                autocomplete="on"
+              />
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="24" style="text-align: right">
+          <el-button type="primary" @click="submitForm">保 存 </el-button>
+          <el-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from "@/apis/service/mobile/park";
+import { isnumber, isAlphanumeric, validAlphabets } from "@/utils/validate";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "Account",
+  props: ["showModel", "id", "isDetail"],
+  mixins: [resToken],
+  data() {
+    const validateNewPassword = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("新密码不能为空!"));
+      } else {
+        if (value.length !== 6) {
+          callback(new Error("密码为2位字母+4位数字!"));
+        } else {
+          let a = value.slice(0, 2);
+          let b = value.slice(2, 4);
+          if (!isnumber(b)) {
+            callback(new Error("密码为2位字母+4位数字!"));
+          } else if (!validAlphabets(a)) {
+            callback(new Error("密码为2位字母+4位数字!"));
+          } else {
+            callback();
+          }
+        }
+      }
+    };
+    const validateConfirmPassword = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("确认密码不能为空!"));
+      } else {
+        if (this.ruleForm.password !== value) {
+          callback(new Error("确认密码与新密码不一致!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    return {
+      roleList: [],
+      loading: false,
+      title: "重置密码",
+      showModelThis: this.showModel,
+      ruleForm: {
+        id: this.id,
+        password: "",
+        confirmPassword: "",
+      },
+      rulesThis: this.rules,
+      rules: {
+        password: [
+          { required: true, trigger: "blur", validator: validateNewPassword },
+        ],
+        confirmPassword: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validateConfirmPassword,
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    closeModel() {
+      console.log("closeModel!!");
+    },
+    async initForm() {
+      this.rulesThis = this.rules;
+      await this.resetForm();
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            id: this.id,
+            password: "",
+            confirmPassword: "",
+          };
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          let obj = JSON.parse(JSON.stringify(this.ruleForm));
+          delete obj["confirmPassword"];
+          const res = await asyncRequest.setpwd(obj);
+          this.loading = false;
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "密码修改成功!",
+              message: "",
+            });
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+   <style lang="scss" scoped>
+.account {
+}
+</style>

Неке датотеке нису приказане због велике количине промена