代码格式化问题

This commit is contained in:
周建 2023-06-16 16:31:53 +08:00
parent 6ff7a3c9a9
commit 0e15d393a6
8 changed files with 523 additions and 146 deletions

View File

@ -3,14 +3,24 @@
<div class="flex">
<el-card class="w-1/4" :gutter="12" shadow="hover">
<el-scrollbar height="calc(100vh - 88px - 40px - 50px)">
<el-tree ref="treeRef" node-key="id" :data="preview.fileTree" :expand-on-click-node="false" highlight-current
@node-click="handleNodeClick" />
<el-tree
ref="treeRef"
node-key="id"
:data="preview.fileTree"
:expand-on-click-node="false"
highlight-current
@node-click="handleNodeClick"
/>
</el-scrollbar>
</el-card>
<el-card class="w-3/4 ml-3" :gutter="12" shadow="hover">
<el-tabs v-model="preview.activeName">
<el-tab-pane v-for="item in previewCodegen" :label="item.filePath.substring(item.filePath.lastIndexOf('/') + 1)"
:name="item.filePath" :key="item.filePath">
<el-tab-pane
v-for="item in previewCodegen"
:label="item.filePath.substring(item.filePath.lastIndexOf('/') + 1)"
:name="item.filePath"
:key="item.filePath"
>
<XTextButton style="float: right" :title="t('common.copy')" @click="copy(item.code)" />
<pre>{{ item.code }}</pre>
</el-tab-pane>

View File

@ -12,29 +12,61 @@
<XTable @register="registerTable">
<template #toolbar_buttons>
<!-- 操作新增 -->
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')" v-hasPermi="['pay:order:create']"
@click="handleCreate()" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['pay:order:create']"
@click="handleCreate()"
/>
<!-- 操作导出 -->
<XButton type="warning" preIcon="ep:download" :title="t('action.export')" v-hasPermi="['pay:order:export']"
@click="exportList('订单数据.xls')" />
<XButton
type="warning"
preIcon="ep:download"
:title="t('action.export')"
v-hasPermi="['pay:order:export']"
@click="exportList('订单数据.xls')"
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['pay:order:query']"
@click="handleDetail(row.id)" />
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['pay:order:query']"
@click="handleDetail(row.id)"
/>
</template>
</XTable>
</ContentWrap>
<XModal v-model="dialogVisible" :title="dialogTitle" :height="['create', 'update'].includes(actionType) ? '99%' : ''">
<XModal
v-model="dialogVisible"
:title="dialogTitle"
:height="['create', 'update'].includes(actionType) ? '99%' : ''"
>
<!-- 对话框(添加 / 修改) -->
<Form v-if="['create', 'update'].includes(actionType)" :schema="allSchemas.formSchema" :rules="rules" ref="formRef" />
<Form
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
ref="formRef"
/>
<!-- 对话框(详情) -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData" />
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
/>
<!-- 操作按钮 -->
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="actionLoading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>

View File

@ -5,51 +5,101 @@
<template #accountId_search>
<el-select v-model="queryParams.accountId">
<el-option :key="undefined" label="全部" :value="undefined" />
<el-option v-for="item in accountOptions" :key="item.id" :label="item.mail" :value="item.id" />
<el-option
v-for="item in accountOptions"
:key="item.id"
:label="item.mail"
:value="item.id"
/>
</el-select>
</template>
<template #toolbar_buttons>
<!-- 操作新增 -->
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')" v-hasPermi="['system:mail-template:create']"
@click="handleCreate()" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:mail-template:create']"
@click="handleCreate()"
/>
</template>
<template #accountId_default="{ row }">
<span>{{ accountOptions.find((account) => account.id === row.accountId)?.mail }}</span>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作测试短信 -->
<XTextButton preIcon="ep:cpu" :title="t('action.test')" v-hasPermi="['system:mail-template:send-mail']"
@click="handleSendMail(row)" />
<XTextButton
preIcon="ep:cpu"
:title="t('action.test')"
v-hasPermi="['system:mail-template:send-mail']"
@click="handleSendMail(row)"
/>
<!-- 操作修改 -->
<XTextButton preIcon="ep:edit" :title="t('action.edit')" v-hasPermi="['system:mail-template:update']"
@click="handleUpdate(row.id)" />
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:mail-template:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['system:mail-template:query']"
@click="handleDetail(row.id)" />
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:mail-template:query']"
@click="handleDetail(row.id)"
/>
<!-- 操作删除 -->
<XTextButton preIcon="ep:delete" :title="t('action.del')" v-hasPermi="['system:mail-template:delete']"
@click="deleteData(row.id)" />
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:mail-template:delete']"
@click="deleteData(row.id)"
/>
</template>
</XTable>
</ContentWrap>
<!-- 添加/修改/详情的弹窗 -->
<XModal id="mailTemplateModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"
:height="['create', 'update'].includes(actionType) ? '99%' : ''">
<XModal
id="mailTemplateModel"
:loading="modelLoading"
v-model="modelVisible"
:title="modelTitle"
:height="['create', 'update'].includes(actionType) ? '99%' : ''"
>
<!-- 表单添加/修改 -->
<Form ref="formRef" v-if="['create', 'update'].includes(actionType)" :schema="allSchemas.formSchema" :rules="rules">
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
>
<template #accountId="form">
<el-select v-model="form.accountId">
<el-option v-for="item in accountOptions" :key="item.id" :label="item.mail" :value="item.id" />
<el-option
v-for="item in accountOptions"
:key="item.id"
:label="item.mail"
:value="item.id"
/>
</el-select>
</template>
</Form>
<!-- 表单详情 -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData" />
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
/>
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="actionLoading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" />
</template>
@ -64,14 +114,26 @@
<el-form-item label="收件邮箱" prop="mail">
<el-input v-model="sendForm.mail" placeholder="请输入收件邮箱" />
</el-form-item>
<el-form-item v-for="param in sendForm.params" :key="param" :label="'参数 {' + param + '}'"
:prop="'templateParams.' + param">
<el-input v-model="sendForm.templateParams[param]" :placeholder="'请输入 ' + param + ' 参数'" />
<el-form-item
v-for="param in sendForm.params"
:key="param"
:label="'参数 {' + param + '}'"
:prop="'templateParams.' + param"
>
<el-input
v-model="sendForm.templateParams[param]"
:placeholder="'请输入 ' + param + ' 参数'"
/>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<template #footer>
<XButton type="primary" :title="t('action.test')" :loading="actionLoading" @click="sendTest()" />
<XButton
type="primary"
:title="t('action.test')"
:loading="actionLoading"
@click="sendTest()"
/>
<XButton :title="t('dialog.close')" @click="sendVisible = false" />
</template>
</XModal>

View File

@ -4,36 +4,67 @@
<XTable @register="registerTable">
<!-- 操作新增 -->
<template #toolbar_buttons>
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')" v-hasPermi="['system:notice:create']"
@click="handleCreate()" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:notice:create']"
@click="handleCreate()"
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作修改 -->
<XTextButton preIcon="ep:edit" :title="t('action.edit')" v-hasPermi="['system:notice:update']"
@click="handleUpdate(row.id)" />
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:notice:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['system:notice:query']"
@click="handleDetail(row.id)" />
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:notice:query']"
@click="handleDetail(row.id)"
/>
<!-- 操作删除 -->
<XTextButton preIcon="ep:delete" :title="t('action.del')" v-hasPermi="['system:notice:delete']"
@click="deleteData(row.id)" />
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:notice:delete']"
@click="deleteData(row.id)"
/>
</template>
</XTable>
</ContentWrap>
<!-- 弹窗 -->
<XModal id="noticeModel" v-model="dialogVisible" :title="dialogTitle" height="99%">
<!-- 对话框(添加 / 修改) -->
<Form ref="formRef" v-if="['create', 'update'].includes(actionType)" :schema="allSchemas.formSchema" :rules="rules" />
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 对话框(详情) -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData">
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
>
<template #content="{ row }">
<Editor :model-value="row.content" :readonly="true" />
</template>
</Descriptions>
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="actionLoading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>

View File

@ -4,22 +4,43 @@
<XTable @register="registerTable">
<template #toolbar_buttons>
<!-- 操作新增 -->
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')"
v-hasPermi="['system:notify-template:create']" @click="handleCreate()" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:notify-template:create']"
@click="handleCreate()"
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作测试站内信 -->
<XTextButton preIcon="ep:cpu" :title="t('action.test')" v-hasPermi="['system:notify-template:send-notify']"
@click="handleSendNotify(row)" />
<XTextButton
preIcon="ep:cpu"
:title="t('action.test')"
v-hasPermi="['system:notify-template:send-notify']"
@click="handleSendNotify(row)"
/>
<!-- 操作修改 -->
<XTextButton preIcon="ep:edit" :title="t('action.edit')" v-hasPermi="['system:notify-template:update']"
@click="handleUpdate(row.id)" />
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:notify-template:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['system:notify-template:query']"
@click="handleDetail(row.id)" />
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:notify-template:query']"
@click="handleDetail(row.id)"
/>
<!-- 操作删除 -->
<XTextButton preIcon="ep:delete" :title="t('action.del')" v-hasPermi="['system:notify-template:delete']"
@click="deleteData(row.id)" />
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:notify-template:delete']"
@click="deleteData(row.id)"
/>
</template>
</XTable>
</ContentWrap>
@ -27,13 +48,27 @@
<!-- 添加/修改的弹窗 -->
<XModal id="templateModel" :loading="modelLoading" v-model="dialogVisible" :title="dialogTitle">
<!-- 表单添加/修改 -->
<Form ref="formRef" v-if="['create', 'update'].includes(actionType)" :schema="allSchemas.formSchema" :rules="rules" />
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 表单详情 -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData" />
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
/>
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="actionLoading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
@ -47,17 +82,34 @@
</el-form-item>
<el-form-item label="接收人" prop="userId">
<el-select v-model="sendForm.userId" placeholder="请选择接收人">
<el-option v-for="item in userOption" :key="item.id" :label="item.nickname" :value="item.id" />
<el-option
v-for="item in userOption"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item v-for="param in sendForm.params" :key="param" :label="'参数 {' + param + '}'"
:prop="'templateParams.' + param">
<el-input v-model="sendForm.templateParams[param]" :placeholder="'请输入 ' + param + ' 参数'" />
<el-form-item
v-for="param in sendForm.params"
:key="param"
:label="'参数 {' + param + '}'"
:prop="'templateParams.' + param"
>
<el-input
v-model="sendForm.templateParams[param]"
:placeholder="'请输入 ' + param + ' 参数'"
/>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<template #footer>
<XButton type="primary" :title="t('action.test')" :loading="actionLoading" @click="sendTest()" />
<XButton
type="primary"
:title="t('action.test')"
:loading="actionLoading"
@click="sendTest()"
/>
<XButton :title="t('dialog.close')" @click="sendVisible = false" />
</template>
</XModal>

View File

@ -4,8 +4,13 @@
<XTable @register="registerTable">
<template #toolbar_buttons>
<!-- 操作新增 -->
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')" v-hasPermi="['system:oauth2-client:create']"
@click="handleCreate()" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:oauth2-client:create']"
@click="handleCreate()"
/>
</template>
<template #accessTokenValiditySeconds_default="{ row }">
{{ row.accessTokenValiditySeconds + '秒' }}
@ -14,31 +19,60 @@
{{ row.refreshTokenValiditySeconds + '秒' }}
</template>
<template #authorizedGrantTypes_default="{ row }">
<el-tag :disable-transitions="true" :key="index" v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index"
>
{{ authorizedGrantType }}
</el-tag>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作修改 -->
<XTextButton preIcon="ep:edit" :title="t('action.edit')" v-hasPermi="['system:oauth2-client:update']"
@click="handleUpdate(row.id)" />
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:oauth2-client:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['system:oauth2-client:query']"
@click="handleDetail(row.id)" />
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:oauth2-client:query']"
@click="handleDetail(row.id)"
/>
<!-- 操作删除 -->
<XTextButton preIcon="ep:delete" :title="t('action.del')" v-hasPermi="['system:oauth2-client:delete']"
@click="deleteData(row.id)" />
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:oauth2-client:delete']"
@click="deleteData(row.id)"
/>
</template>
</XTable>
</ContentWrap>
<!-- 弹窗 -->
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle"
:height="['create', 'update'].includes(actionType) ? '99%' : ''">
<XModal
id="postModel"
v-model="dialogVisible"
:title="dialogTitle"
:height="['create', 'update'].includes(actionType) ? '99%' : ''"
>
<!-- 表单添加/修改 -->
<Form ref="formRef" v-if="['create', 'update'].includes(actionType)" :schema="allSchemas.formSchema" :rules="rules" />
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 表单详情 -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData">
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
>
<template #accessTokenValiditySeconds="{ row }">
{{ row.accessTokenValiditySeconds + '秒' }}
</template>
@ -46,32 +80,55 @@
{{ row.refreshTokenValiditySeconds + '秒' }}
</template>
<template #authorizedGrantTypes="{ row }">
<el-tag :disable-transitions="true" :key="index" v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index"
>
{{ authorizedGrantType }}
</el-tag>
</template>
<template #scopes="{ row }">
<el-tag :disable-transitions="true" :key="index" v-for="(scopes, index) in row.scopes" :index="index">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(scopes, index) in row.scopes"
:index="index"
>
{{ scopes }}
</el-tag>
</template>
<template #autoApproveScopes="{ row }">
<el-tag :disable-transitions="true" :key="index" v-for="(autoApproveScopes, index) in row.autoApproveScopes"
:index="index">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(autoApproveScopes, index) in row.autoApproveScopes"
:index="index"
>
{{ autoApproveScopes }}
</el-tag>
</template>
<template #redirectUris="{ row }">
<el-tag :disable-transitions="true" :key="index" v-for="(redirectUris, index) in row.redirectUris" :index="index">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(redirectUris, index) in row.redirectUris"
:index="index"
>
{{ redirectUris }}
</el-tag>
</template>
</Descriptions>
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="actionLoading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>

View File

@ -4,35 +4,72 @@
<XTable @register="registerTable">
<template #toolbar_buttons>
<!-- 操作新增 -->
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')" v-hasPermi="['system:post:create']"
@click="openModel('create')" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:post:create']"
@click="openModel('create')"
/>
<!-- 操作导出 -->
<XButton type="primary" plain preIcon="ep:download" :title="t('action.export')"
v-hasPermi="['system:post:export']" @click="exportList('岗位列表.xls')" />
<XButton
type="primary"
plain
preIcon="ep:download"
:title="t('action.export')"
v-hasPermi="['system:post:export']"
@click="exportList('岗位列表.xls')"
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作修改 -->
<XTextButton preIcon="ep:edit" :title="t('action.edit')" v-hasPermi="['system:post:update']"
@click="openModel('update', row?.id)" />
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:post:update']"
@click="openModel('update', row?.id)"
/>
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['system:post:query']"
@click="openModel('detail', row?.id)" />
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:post:query']"
@click="openModel('detail', row?.id)"
/>
<!-- 操作删除 -->
<XTextButton preIcon="ep:delete" :title="t('action.delete')" v-hasPermi="['system:post:delete']"
@click="deleteData(row?.id)" />
<XTextButton
preIcon="ep:delete"
:title="t('action.delete')"
v-hasPermi="['system:post:delete']"
@click="deleteData(row?.id)"
/>
</template>
</XTable>
</ContentWrap>
<!-- 弹窗 -->
<XModal id="postModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
<!-- 表单添加/修改 -->
<Form ref="formRef" v-if="['create', 'update'].includes(actionType)" :schema="allSchemas.formSchema" :rules="rules" />
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 表单详情 -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData" />
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
/>
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="actionLoading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" />
</template>

View File

@ -9,9 +9,17 @@
</template>
<el-input v-model="filterText" placeholder="搜索部门" />
<el-scrollbar height="650">
<el-tree ref="treeRef" node-key="id" default-expand-all :data="deptOptions" :props="defaultProps"
:highlight-current="true" :filter-node-method="filterNode" :expand-on-click-node="false"
@node-click="handleDeptNodeClick" />
<el-tree
ref="treeRef"
node-key="id"
default-expand-all
:data="deptOptions"
:props="defaultProps"
:highlight-current="true"
:filter-node-method="filterNode"
:expand-on-click-node="false"
@node-click="handleDeptNodeClick"
/>
</el-scrollbar>
</el-card>
<el-card class="w-4/5 user" style="margin-left: 10px" :gutter="12" shadow="hover">
@ -24,47 +32,90 @@
<XTable @register="registerTable">
<template #toolbar_buttons>
<!-- 操作新增 -->
<XButton type="primary" preIcon="ep:zoom-in" :title="t('action.add')" v-hasPermi="['system:user:create']"
@click="handleCreate()" />
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:user:create']"
@click="handleCreate()"
/>
<!-- 操作导入用户 -->
<XButton type="warning" preIcon="ep:upload" :title="t('action.import')" v-hasPermi="['system:user:import']"
@click="importClick" />
<XButton
type="warning"
preIcon="ep:upload"
:title="t('action.import')"
v-hasPermi="['system:user:import']"
@click="importClick"
/>
<!-- 操作导出用户 -->
<XButton type="warning" preIcon="ep:download" :title="t('action.export')" v-hasPermi="['system:user:export']"
@click="exportList('用户数据.xls')" />
<XButton
type="warning"
preIcon="ep:download"
:title="t('action.export')"
v-hasPermi="['system:user:export']"
@click="exportList('用户数据.xls')"
/>
</template>
<template #status_default="{ row }">
<el-switch v-model="row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(row)" />
<el-switch
v-model="row.status"
:active-value="0"
:inactive-value="1"
@change="handleStatusChange(row)"
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作编辑 -->
<XTextButton preIcon="ep:edit" :title="t('action.edit')" v-hasPermi="['system:user:update']"
@click="handleUpdate(row.id)" />
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:user:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton preIcon="ep:view" :title="t('action.detail')" v-hasPermi="['system:user:update']"
@click="handleDetail(row.id)" />
<el-dropdown class="p-0.5" v-hasPermi="[
'system:user:update-password',
'system:permission:assign-user-role',
'system:user:delete'
]">
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:user:update']"
@click="handleDetail(row.id)"
/>
<el-dropdown
class="p-0.5"
v-hasPermi="[
'system:user:update-password',
'system:permission:assign-user-role',
'system:user:delete'
]"
>
<XTextButton :title="t('action.more')" postIcon="ep:arrow-down" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<!-- 操作重置密码 -->
<XTextButton preIcon="ep:key" title="重置密码" v-hasPermi="['system:user:update-password']"
@click="handleResetPwd(row)" />
<XTextButton
preIcon="ep:key"
title="重置密码"
v-hasPermi="['system:user:update-password']"
@click="handleResetPwd(row)"
/>
</el-dropdown-item>
<el-dropdown-item>
<!-- 操作分配角色 -->
<XTextButton preIcon="ep:key" title="分配角色" v-hasPermi="['system:permission:assign-user-role']"
@click="handleRole(row)" />
<XTextButton
preIcon="ep:key"
title="分配角色"
v-hasPermi="['system:permission:assign-user-role']"
@click="handleRole(row)"
/>
</el-dropdown-item>
<el-dropdown-item>
<!-- 操作删除 -->
<XTextButton preIcon="ep:delete" :title="t('action.del')" v-hasPermi="['system:user:delete']"
@click="deleteData(row.id)" />
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:user:delete']"
@click="deleteData(row.id)"
/>
</el-dropdown-item>
</el-dropdown-menu>
</template>
@ -75,19 +126,38 @@
</div>
<XModal v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(添加 / 修改) -->
<Form v-if="['create', 'update'].includes(actionType)" :rules="rules" :schema="allSchemas.formSchema" ref="formRef">
<Form
v-if="['create', 'update'].includes(actionType)"
:rules="rules"
:schema="allSchemas.formSchema"
ref="formRef"
>
<template #deptId="form">
<el-tree-select node-key="id" v-model="form['deptId']" :props="defaultProps" :data="deptOptions" check-strictly />
<el-tree-select
node-key="id"
v-model="form['deptId']"
:props="defaultProps"
:data="deptOptions"
check-strictly
/>
</template>
<template #postIds="form">
<el-select v-model="form['postIds']" multiple :placeholder="t('common.selectText')">
<el-option v-for="item in postOptions" :key="item.id" :label="item.name"
:value="(item.id as unknown as number)" />
<el-option
v-for="item in postOptions"
:key="item.id"
:label="item.name"
:value="(item.id as unknown as number)"
/>
</el-select>
</template>
</Form>
<!-- 对话框(详情) -->
<Descriptions v-if="actionType === 'detail'" :schema="allSchemas.detailSchema" :data="detailData">
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
>
<template #deptId="{ row }">
<el-tag>{{ dataFormater(row.deptId) }}</el-tag>
</template>
@ -105,8 +175,13 @@
<!-- 操作按钮 -->
<template #footer>
<!-- 按钮保存 -->
<XButton v-if="['create', 'update'].includes(actionType)" type="primary" :title="t('action.save')"
:loading="loading" @click="submitForm()" />
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="loading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
@ -121,10 +196,15 @@
<el-tag>{{ userRole.nickname }}</el-tag>
</el-form-item>
<el-form-item label="角色">
<el-transfer v-model="userRole.roleIds" :titles="['角色列表', '已选择']" :props="{
key: 'id',
label: 'name'
}" :data="roleOptions" />
<el-transfer
v-model="userRole.roleIds"
:titles="['角色列表', '已选择']"
:props="{
key: 'id',
label: 'name'
}"
:data="roleOptions"
/>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
@ -142,11 +222,22 @@
<XButton type="primary" prefix="ep:download" title="点击下载" @click="handleImportTemp()" />
</el-form-item>
<el-form-item label="文件上传 :">
<el-upload ref="uploadRef" :action="updateUrl + '?updateSupport=' + updateSupport" :headers="uploadHeaders"
:drag="true" :limit="1" :multiple="true" :show-file-list="true" :disabled="uploadDisabled"
:before-upload="beforeExcelUpload" :on-exceed="handleExceed" :on-success="handleFileSuccess"
:on-error="excelUploadError" :auto-upload="false"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<el-upload
ref="uploadRef"
:action="updateUrl + '?updateSupport=' + updateSupport"
:headers="uploadHeaders"
:drag="true"
:limit="1"
:multiple="true"
:show-file-list="true"
:disabled="uploadDisabled"
:before-upload="beforeExcelUpload"
:on-exceed="handleExceed"
:on-success="handleFileSuccess"
:on-error="excelUploadError"
:auto-upload="false"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
>
<Icon icon="ep:upload-filled" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip>
@ -160,7 +251,12 @@
</el-form>
<template #footer>
<!-- 按钮保存 -->
<XButton type="warning" preIcon="ep:upload-filled" :title="t('action.save')" @click="submitFileForm()" />
<XButton
type="warning"
preIcon="ep:upload-filled"
:title="t('action.save')"
@click="submitFileForm()"
/>
<!-- 按钮关闭 -->
<XButton :title="t('dialog.close')" @click="importDialogVisible = false" />
</template>