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地址', title: 'IP地址',
dataIndex: 'ip', dataIndex: 'ip',
align: 'center', align: 'center',
}, },
{
title: '网元地址',
dataIndex: 'neAddress',
align: 'center',
},
{ {
title: '端口', title: '端口',
dataIndex: 'port', dataIndex: 'port',
@@ -564,6 +559,11 @@ function fnRecordStop(row: Record<string, any>) {
* 记录多项选择 * 记录多项选择
*/ */
function fnRecordMore(type: string | number, row: Record<string, any>) { function fnRecordMore(type: string | number, row: Record<string, any>) {
if (type === 'delete') {
fnRecordDelete(row);
return
}
if (type === 'export') { if (type === 'export') {
fnRecordExport(row); fnRecordExport(row);
} }
@@ -764,9 +764,9 @@ onMounted(() => {
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.deleteText') }}</template> <template #title>{{ t('views.configManage.neManage.restart') }}</template>
<a-button type="link" @click.prevent="fnRecordDelete(record)"> <a-button type="link" @click.prevent="fnRecordMore('restart', record)">
<template #icon><DeleteOutlined /></template> <template #icon><UndoOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip> <a-tooltip>
@@ -792,14 +792,14 @@ onMounted(() => {
<thunderbolt-outlined /> <thunderbolt-outlined />
{{ t('views.configManage.neManage.start') }} {{ t('views.configManage.neManage.start') }}
</a-menu-item> </a-menu-item>
<a-menu-item key="restart">
<UndoOutlined />
{{ t('views.configManage.neManage.restart') }}
</a-menu-item>
<a-menu-item key="stop"> <a-menu-item key="stop">
<pause-outlined /> <pause-outlined />
{{ t('views.configManage.neManage.stop') }} {{ t('views.configManage.neManage.stop') }}
</a-menu-item> </a-menu-item>
<a-menu-item key="delete">
<DeleteOutlined />
{{ t('common.deleteText') }}
</a-menu-item>
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </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 { ColumnsType } from 'ant-design-vue/lib/table';
import { listNeVersion } from '@/api/configManage/softwareManage'; import { listNeVersion } from '@/api/configManage/softwareManage';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useDictStore from '@/store/modules/dict';
import useNeInfoStore from '@/store/modules/neinfo'; import useNeInfoStore from '@/store/modules/neinfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
const { t } = useI18n(); const { t } = useI18n();
const { getDict } = useDictStore();
const emit = defineEmits(['ok', 'cancel', 'update:visible']); const emit = defineEmits(['ok', 'cancel', 'update:visible']);
const props = defineProps({ const props = defineProps({
title: { title: {
@@ -22,14 +20,6 @@ const props = defineProps({
}, },
}); });
/**字典数据 */
let dict: {
/**状态 */
neVersionStatus: DictType[];
} = reactive({
neVersionStatus: [],
});
/**开始结束时间 */ /**开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']); let queryRangePicker = ref<[string, string]>(['', '']);
@@ -184,12 +174,6 @@ function fnModalCancel() {
/**显示弹框时初始数据 */ /**显示弹框时初始数据 */
function init() { function init() {
// 初始字典数据
Promise.allSettled([getDict('ne_version_status')]).then(resArr => {
if (resArr[0].status === 'fulfilled') {
dict.neVersionStatus = resArr[0].value;
}
});
// 查询参数重置 // 查询参数重置
fnQueryReset(); fnQueryReset();
} }
@@ -246,17 +230,6 @@ watch(
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>
</a-col> </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-col :lg="12" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
@@ -284,11 +257,6 @@ watch(
:scroll="{ y: 400, x: true }" :scroll="{ y: 400, x: true }"
:pagination="tablePagination" :pagination="tablePagination"
> >
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<DictTag :options="dict.neVersionStatus" :value="record.status" />
</template>
</template>
</a-table> </a-table>
</a-modal> </a-modal>
</template> </template>

View File

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