style: 更多下拉按钮放出

This commit is contained in:
TsMask
2023-10-26 16:59:04 +08:00
parent d3399e5b4f
commit 5a72287fca
3 changed files with 43 additions and 57 deletions

View File

@@ -106,12 +106,7 @@ let tableColumns: ColumnsType = [
title: 'IP地址',
dataIndex: 'ip',
align: 'center',
},
{
title: '网元地址',
dataIndex: 'neAddress',
align: 'center',
},
},
{
title: '端口',
dataIndex: 'port',
@@ -564,6 +559,11 @@ function fnRecordStop(row: Record<string, any>) {
* 记录多项选择
*/
function fnRecordMore(type: string | number, row: Record<string, any>) {
if (type === 'delete') {
fnRecordDelete(row);
return
}
if (type === 'export') {
fnRecordExport(row);
}
@@ -764,9 +764,9 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.deleteText') }}</template>
<a-button type="link" @click.prevent="fnRecordDelete(record)">
<template #icon><DeleteOutlined /></template>
<template #title>{{ t('views.configManage.neManage.restart') }}</template>
<a-button type="link" @click.prevent="fnRecordMore('restart', record)">
<template #icon><UndoOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
@@ -792,14 +792,14 @@ onMounted(() => {
<thunderbolt-outlined />
{{ t('views.configManage.neManage.start') }}
</a-menu-item>
<a-menu-item key="restart">
<UndoOutlined />
{{ t('views.configManage.neManage.restart') }}
</a-menu-item>
<a-menu-item key="stop">
<pause-outlined />
{{ t('views.configManage.neManage.stop') }}
</a-menu-item>
<a-menu-item key="delete">
<DeleteOutlined />
{{ t('common.deleteText') }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>

View File

@@ -4,12 +4,10 @@ import { SizeType } from 'ant-design-vue/lib/config-provider';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { listNeVersion } from '@/api/configManage/softwareManage';
import { parseDateToStr } from '@/utils/date-utils';
import useDictStore from '@/store/modules/dict';
import useNeInfoStore from '@/store/modules/neinfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
const { getDict } = useDictStore();
const emit = defineEmits(['ok', 'cancel', 'update:visible']);
const props = defineProps({
title: {
@@ -22,14 +20,6 @@ const props = defineProps({
},
});
/**字典数据 */
let dict: {
/**状态 */
neVersionStatus: DictType[];
} = reactive({
neVersionStatus: [],
});
/**开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']);
@@ -184,12 +174,6 @@ function fnModalCancel() {
/**显示弹框时初始数据 */
function init() {
// 初始字典数据
Promise.allSettled([getDict('ne_version_status')]).then(resArr => {
if (resArr[0].status === 'fulfilled') {
dict.neVersionStatus = resArr[0].value;
}
});
// 查询参数重置
fnQueryReset();
}
@@ -246,17 +230,6 @@ watch(
></a-range-picker>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="状态" name="status">
<a-select
v-model:value="queryParams.status"
allow-clear
placeholder="请选择状态"
:options="dict.neVersionStatus"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
@@ -284,11 +257,6 @@ watch(
:scroll="{ y: 400, x: true }"
:pagination="tablePagination"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<DictTag :options="dict.neVersionStatus" :value="record.status" />
</template>
</template>
</a-table>
</a-modal>
</template>

View File

@@ -189,6 +189,14 @@ const fileModalStateFrom = Form.useForm(
* 文件对话框弹出显示为 下发或激活
*/
function fnFileModalVisible(type: string | number, row: Record<string, any>) {
if (type === 'download') {
fnDownloadFile(row);
return;
}
if (type === 'delete') {
fnRecordDelete(row);
return;
}
if (type === 'send') {
fileModalState.title = t('views.configManage.softwareManage.sendTitle');
fileModalState.content = t(
@@ -689,15 +697,25 @@ onMounted(() => {
<template v-if="column.key === 'id'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>{{ t('common.downloadText') }}</template>
<a-button type="link" @click.prevent="fnDownloadFile(record)">
<template #icon><DownloadOutlined /></template>
<template #title>
{{ t('views.configManage.softwareManage.sendBtn') }}
</template>
<a-button
type="link"
@click.prevent="fnFileModalVisible('send', record)"
>
<template #icon><SendOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.deleteText') }}</template>
<a-button type="link" @click.prevent="fnRecordDelete(record)">
<template #icon><DeleteOutlined /></template>
<template #title>
{{ t('views.configManage.softwareManage.runBtn') }}
</template>
<a-button
type="link"
@click.prevent="fnFileModalVisible('run', record)"
>
<template #icon><ThunderboltOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
@@ -713,13 +731,13 @@ onMounted(() => {
<a-menu
@click="({ key }:any) => fnFileModalVisible(key, record)"
>
<a-menu-item key="send">
<SendOutlined />
{{ t('views.configManage.softwareManage.sendBtn') }}
<a-menu-item key="download">
<DownloadOutlined />
{{ t('common.downloadText') }}
</a-menu-item>
<a-menu-item key="run">
<ThunderboltOutlined />
{{ t('views.configManage.softwareManage.runBtn') }}
<a-menu-item key="delete">
<DeleteOutlined />
{{ t('common.deleteText') }}
</a-menu-item>
<a-menu-item key="back">
<UndoOutlined />