style: 更多按钮

This commit is contained in:
xingyu4j 2022-11-29 14:47:15 +08:00
parent 58ef8a6b1d
commit 8cadd6abc8
4 changed files with 77 additions and 52 deletions

View File

@ -35,21 +35,11 @@
v-hasPermi="['infra:job:update']"
@click="handleUpdate(row.id)"
/>
<el-button
link
type="primary"
<XTextButton
preIcon="ep:edit"
:title="row.status === InfraJobStatusEnum.STOP ? '开启' : '暂停'"
v-hasPermi="['infra:job:update']"
@click="handleChangeStatus(row)"
>
<Icon icon="ep:edit" class="mr-1px" />
{{ row.status === InfraJobStatusEnum.STOP ? '开启' : '暂停' }}
</el-button>
<!-- 操作详情 -->
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['infra:job:query']"
@click="handleDetail(row.id)"
/>
<!-- 操作删除 -->
<XTextButton
@ -58,21 +48,40 @@
v-hasPermi="['infra:job:delete']"
@click="handleDelete(row.id)"
/>
<!-- 操作执行 -->
<XTextButton
preIcon="ep:view"
title="执行一次"
v-hasPermi="['infra:job:trigger']"
@click="handleRun(row)"
/>
<!-- 操作日志 -->
<XTextButton
preIcon="ep:view"
title="调度日志"
v-hasPermi="['infra:job:query']"
@click="handleJobLog(row.id)"
/>
<!-- TODO @星语执行一次任务详情调度日志可以收成更多 -->
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
<XTextButton title="更多" postIcon="ep:arrow-down" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<!-- 操作执行 -->
<XTextButton
preIcon="ep:view"
title="执行一次"
v-hasPermi="['infra:job:trigger']"
@click="handleRun(row)"
/>
</el-dropdown-item>
<el-dropdown-item>
<!-- 操作详情 -->
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['infra:job:query']"
@click="handleDetail(row.id)"
/>
</el-dropdown-item>
<el-dropdown-item>
<!-- 操作日志 -->
<XTextButton
preIcon="ep:view"
title="调度日志"
v-hasPermi="['infra:job:query']"
@click="handleJobLog(row.id)"
/>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</vxe-grid>
</ContentWrap>
@ -122,6 +131,7 @@
<script setup lang="ts" name="Job">
import { ref, unref } from 'vue'
import { useRouter } from 'vue-router'
import { ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useVxeGrid } from '@/hooks/web/useVxeGrid'

View File

@ -18,7 +18,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
primaryType: 'seq',
primaryTitle: '任务编号',
action: true,
actionWidth: '500px',
actionWidth: '280px',
columns: [
{
title: '任务名称',

View File

@ -77,28 +77,40 @@
v-hasPermi="['system:user:update']"
@click="handleDetail(row.id)"
/>
<!-- TODO 芋艿可以重置角色密码收起来么形成更多 -->
<!-- 操作重置密码 -->
<XTextButton
preIcon="ep:key"
title="重置密码"
v-hasPermi="['system:user:update-password']"
@click="handleResetPwd(row)"
/>
<!-- 操作分配角色 -->
<XTextButton
preIcon="ep:key"
title="分配角色"
v-hasPermi="['system:permission:assign-user-role']"
@click="handleRole(row)"
/>
<!-- 操作删除 -->
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:user:delete']"
@click="handleDelete(row.id)"
/>
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
<XTextButton title="更多" 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)"
/>
</el-dropdown-item>
<el-dropdown-item>
<!-- 操作分配角色 -->
<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="handleDelete(row.id)"
/>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</vxe-grid>
</el-card>
@ -260,6 +272,9 @@ import {
ElUpload,
ElSwitch,
ElCheckbox,
ElDropdown,
ElDropdownMenu,
ElDropdownItem,
UploadInstance,
UploadRawFile
} from 'element-plus'

View File

@ -26,7 +26,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
primaryType: 'seq',
primaryTitle: '用户编号',
action: true,
actionWidth: '400px',
actionWidth: '200px',
columns: [
{
title: '用户账号',