刘洋 há 9 meses atrás
pai
commit
7d9961792b

+ 5 - 2
src/render/components/MyModal/index.vue

@@ -5,7 +5,9 @@
     :class="{ fullscreen: fullscreenModel }"
   >
     <Modal
-      v-bind="omit(props, ['open', 'onCancel', 'onOk', 'onUpdate:open'])"
+      v-bind="
+        omit(props, ['open', 'onCancel', 'onOk', 'onUpdate:open', 'visible'])
+      "
       v-model:open="openModel"
       :mask-closable="false"
       :get-container="() => modalWrapRef"
@@ -46,7 +48,6 @@
 
 <script lang="ts" name="QmModal" setup>
 import { ref, watch, nextTick, onMounted } from "vue";
-import { modalProps } from "ant-design-vue/es/modal/Modal";
 import { ModalProps } from "@qmth/ui";
 import {
   CloseOutlined,
@@ -421,6 +422,8 @@ onMounted(() => {
         flex: auto;
         height: 100%;
         overflow: auto;
+        padding-top: 20px;
+        padding-right: 20px;
       }
     }
   }

+ 27 - 0
src/render/views/BaseDataConfig/ResetPasswordDialog.vue

@@ -0,0 +1,27 @@
+<template>
+  <my-modal v-model:open="visible" title="重置密码" :width="450">
+    <qm-low-form :params="params" :fields="fields" :label-width="80">
+    </qm-low-form>
+  </my-modal>
+</template>
+<script name="ResetPasswordDialog" lang="ts" setup>
+import { ref } from "vue";
+import { setValueFromObj } from "@/utils/tool";
+const visible = defineModel();
+
+const props = defineProps<{ curRow: any }>();
+//todo 入参名
+const params = ref({
+  a: "",
+});
+params.value = setValueFromObj(params.value, props.curRow);
+const fields = ref([
+  {
+    prop: "a",
+    label: "新密码",
+    colSpan: 24,
+    type: "password",
+  },
+]);
+</script>
+<style lang="less" scoped></style>

+ 14 - 2
src/render/views/BaseDataConfig/UserManage.vue

@@ -2,20 +2,26 @@
   <div class="user-manage">
     <qm-low-form :params="searchParams" :fields="searchFields"></qm-low-form>
     <a-table :data-source="tableData" :columns="columns" size="middle" bordered>
-      <template #bodyCell="{ column }">
+      <template #bodyCell="{ column, record }">
         <template v-if="column.key === 'operation'">
           <qm-button type="link">启用</qm-button>
           <qm-button type="link">禁用</qm-button>
-          <qm-button type="link">重置密码</qm-button>
+          <qm-button type="link" @click="resetPwd(record)">重置密码</qm-button>
         </template>
       </template>
     </a-table>
     <AddUserDialog v-model="showAddDialog" v-if="showAddDialog"></AddUserDialog>
+    <ResetPasswordDialog
+      v-model="showResetPwdDialog"
+      v-if="showResetPwdDialog"
+      :cur-row="curRow"
+    ></ResetPasswordDialog>
   </div>
 </template>
 <script name="UserManage" lang="ts" setup>
 import { ref } from "vue";
 import AddUserDialog from "./AddUserDialog.vue";
+import ResetPasswordDialog from "./ResetPasswordDialog.vue";
 import type { TableColumnsType } from "@qmth/ui";
 //todo 入参名
 const searchParams = ref({
@@ -77,6 +83,12 @@ const columns: TableColumnsType = [
 ];
 
 const showAddDialog = ref(false);
+const curRow = ref();
+const showResetPwdDialog = ref(false);
+const resetPwd = (record: any) => {
+  curRow.value = record;
+  showResetPwdDialog.value = true;
+};
 </script>
 <style lang="less" scoped>
 .user-manage {