|
|
@@ -7,17 +7,27 @@ import type { VxeGridListeners, VxeGridProps } from '#/adapter/vxe-table';
|
|
|
import { h, onMounted, ref } from 'vue';
|
|
|
|
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
|
-import { MdiDelete, MdiDetail, MdiEdit } from '@vben/icons';
|
|
|
+import {
|
|
|
+ MdiDelete,
|
|
|
+ MdiDetail,
|
|
|
+ MdiEdit,
|
|
|
+ MdiPasswordVerified,
|
|
|
+} from '@vben/icons';
|
|
|
|
|
|
import { ElMessage, ElMessageBox, ElTag } from 'element-plus';
|
|
|
|
|
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
|
-import { deleteAccountApi, getAccountListApi } from '#/api/account';
|
|
|
+import { deleteAccountApi, getAccountWorkerListApi } from '#/api/account';
|
|
|
import { getRoleListApi } from '#/api/role';
|
|
|
import { $t } from '#/locales';
|
|
|
|
|
|
+import ChangePasswordForm from './change-password-form.vue';
|
|
|
import AccountForm from './form.vue';
|
|
|
|
|
|
+const changePasswordFormRef = ref<InstanceType<
|
|
|
+ typeof ChangePasswordForm
|
|
|
+> | null>(null);
|
|
|
+
|
|
|
const formOptions: VbenFormProps = {
|
|
|
// 默认展开
|
|
|
collapsed: true,
|
|
|
@@ -74,7 +84,7 @@ const gridOptions: VxeGridProps<any> = {
|
|
|
},
|
|
|
ajax: {
|
|
|
query: async ({ page }, formValues) => {
|
|
|
- return await getAccountListApi({
|
|
|
+ return await getAccountWorkerListApi({
|
|
|
pageindex: page.currentPage,
|
|
|
rows: page.pageSize,
|
|
|
...formValues,
|
|
|
@@ -120,13 +130,13 @@ const gridOptions: VxeGridProps<any> = {
|
|
|
// { title: '到期时间', field: 'accountenddate' },
|
|
|
// { title: '更新时间', field: 'accountupdate' },
|
|
|
// { title: '更新人', field: 'accountupuser' },
|
|
|
- { title: '关联职员id', field: 'accountworkerid', sortable: true },
|
|
|
+ { title: '关联职员', field: 'worker_xm', sortable: true },
|
|
|
{
|
|
|
title: '操作',
|
|
|
field: 'action',
|
|
|
fixed: 'right',
|
|
|
slots: { default: 'action' },
|
|
|
- width: 150,
|
|
|
+ width: 180,
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
@@ -202,6 +212,11 @@ function handleEdit(row: any) {
|
|
|
modalApi.setData({ formType: 'edit', row }).open();
|
|
|
}
|
|
|
|
|
|
+/* 修改密码 */
|
|
|
+function handleChangePassword(row: any) {
|
|
|
+ changePasswordFormRef.value?.openModal(row);
|
|
|
+}
|
|
|
+
|
|
|
/* 详情 */
|
|
|
function handleDetail(row: any) {
|
|
|
modalApi.setState({ showCancelButton: false });
|
|
|
@@ -265,6 +280,19 @@ function handleFinish() {
|
|
|
<el-tooltip
|
|
|
class="box-item"
|
|
|
effect="dark"
|
|
|
+ content="修改密码"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ round
|
|
|
+ @click="() => handleChangePassword(row)"
|
|
|
+ :icon="MdiPasswordVerified"
|
|
|
+ class="!p-2"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ class="box-item"
|
|
|
+ effect="dark"
|
|
|
content="删除"
|
|
|
placement="top"
|
|
|
>
|
|
|
@@ -278,5 +306,6 @@ function handleFinish() {
|
|
|
</template>
|
|
|
</Grid>
|
|
|
<Modal @finish="handleFinish" />
|
|
|
+ <ChangePasswordForm ref="changePasswordFormRef" @finish="handleFinish" />
|
|
|
</Page>
|
|
|
</template>
|