---告警帮助文档中英文

This commit is contained in:
lai
2023-11-24 19:36:40 +08:00
parent 44ee479b32
commit 9f5f35c79d
38 changed files with 58 additions and 34 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -735,7 +735,7 @@ export default {
ackTime:'Ack Time', ackTime:'Ack Time',
ackError:'Please do not confirm again', ackError:'Please do not confirm again',
syncMyself:'Manual Synchronization', syncMyself:'Manual Synchronization',
realTitle:'Title', realTitle:'English Title',
objectNf:'Object NE', objectNf:'Object NE',
helpFile:'Help Documentation', helpFile:'Help Documentation',
set:'Set', set:'Set',

View File

@@ -19,8 +19,8 @@ export const xlsxUrl = `${
* console.log(res) * console.log(res)
* }); * });
*/ */
export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> { export async function readLoalXlsx(lang:string,id: string): Promise<Record<string, any>[]> {
let result = await fetch(`${xlsxUrl}/${id}.xlsx`); let result = await fetch(`${xlsxUrl}/${lang}/${id}.xlsx`);
let fileBuffer = await result.arrayBuffer(); let fileBuffer = await result.arrayBuffer();
// 判断是否xlsx文件 // 判断是否xlsx文件
const data = new Uint8Array(fileBuffer); const data = new Uint8Array(fileBuffer);
@@ -30,7 +30,7 @@ export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> {
data[2] === 0x03 && data[2] === 0x03 &&
data[3] === 0x04; data[3] === 0x04;
if (!isXlsxFile) { if (!isXlsxFile) {
result = await fetch(`${xlsxUrl}/all.xlsx`); result = await fetch(`${xlsxUrl}/${lang}/all.xlsx`);
fileBuffer = await result.arrayBuffer(); fileBuffer = await result.arrayBuffer();
} }
return readSheet(fileBuffer, 0); return readSheet(fileBuffer, 0);

View File

@@ -22,7 +22,7 @@ import { writeSheet } from '@/utils/execl-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { readLoalXlsx } from '@/utils/execl-utils'; import { readLoalXlsx } from '@/utils/execl-utils';
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const { t } = useI18n(); const { t,currentLocale } = useI18n();
/**字典数据 */ /**字典数据 */
let dict: { let dict: {
@@ -233,65 +233,68 @@ let tableColumns: ColumnsType = [
}, },
]; ];
/**帮助文档表格字段列 */ /**帮助文档表格字段列 */
let alarmTableColumns: ColumnsType = [ let alarmTableColumns: ColumnsType = [
{ {
title: t('views.faultManage.activeAlarm.alarmTitle'), title: t('views.faultManage.activeAlarm.alarmTitle'),
dataIndex: '告警名称', dataIndex: 'alarmName',
align: 'center', align: 'center',
width: 3, width: 3,
}, },
{ {
title: t('views.faultManage.activeAlarm.locationInfo'), title: t('views.faultManage.activeAlarm.locationInfo'),
dataIndex: '告警定位信息', dataIndex: 'alarmInfo',
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{ {
title: t('views.faultManage.activeAlarm.addInfo'), title: t('views.faultManage.activeAlarm.addInfo'),
dataIndex: '告警帮助信息', dataIndex:'helpInfo',
align: 'center', align: 'center',
width: 8, width: 8,
}, },
{ {
title: t('views.faultManage.activeAlarm.alarmType'), title: t('views.faultManage.activeAlarm.alarmType'),
dataIndex: '告警类型', dataIndex: 'alarmType',
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{ {
title: t('views.faultManage.activeAlarm.origLevel'), title: t('views.faultManage.activeAlarm.origLevel'),
dataIndex: '告警级别', dataIndex: 'alarmLevel',
align: 'center', align: 'center',
width: 3, width: 3,
}, },
{ {
title: t('views.faultManage.activeAlarm.alarmCode'), title: t('views.faultManage.activeAlarm.alarmCode'),
dataIndex: '告警编号', dataIndex: 'alarmCode',
align: 'center', align: 'center',
width: 3, width: 3,
}, },
{ {
title: t('views.faultManage.activeAlarm.specificProblem'), title: t('views.faultManage.activeAlarm.specificProblem'),
dataIndex: '告警问题原因', dataIndex: 'cause',
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{ {
title: t('views.faultManage.activeAlarm.clearType'), title: t('views.faultManage.activeAlarm.clearType'),
dataIndex: '清除类型', dataIndex: 'clearType',
align: 'center', align: 'center',
width: 3, width: 3,
}, },
{ {
title: t('views.faultManage.activeAlarm.realTitle'), title: t('views.faultManage.activeAlarm.realTitle'),
dataIndex: '英文标题', dataIndex: 'enTitle',
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{ {
title: t('views.faultManage.activeAlarm.objectNf'), title: t('views.faultManage.activeAlarm.objectNf'),
dataIndex: '适用网元', dataIndex:'objNf',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
@@ -338,6 +341,8 @@ type ModalStateType = {
visibleByEdit: boolean; visibleByEdit: boolean;
/**显示过滤设置是否显示 */ /**显示过滤设置是否显示 */
visibleByShowSet: boolean; visibleByShowSet: boolean;
/**告警帮助文档是否显示 */
helpShowView: boolean;
/**个性化设置置是否显示 */ /**个性化设置置是否显示 */
visibleByMyselfSet: boolean; visibleByMyselfSet: boolean;
/**标题 */ /**标题 */
@@ -355,6 +360,7 @@ let modalState: ModalStateType = reactive({
visibleByView: false, visibleByView: false,
visibleByEdit: false, visibleByEdit: false,
visibleByShowSet: false, visibleByShowSet: false,
helpShowView: false,
visibleByMyselfSet: false, visibleByMyselfSet: false,
title: '全部信息', title: '全部信息',
from: { from: {
@@ -410,22 +416,17 @@ function fnModalVisibleByVive(row: Record<string, any>) {
modalState.visibleByView = true; modalState.visibleByView = true;
} }
/**告警帮助文档抽屉 初始设置 */
const visible = ref(false);
const closeDrawer = () => {
visible.value = false;
};
/**抽屉 告警帮助文档详细信息 */
/** 告警帮助文档详细信息 */
function fnModalVisibleBy(code: string) { function fnModalVisibleBy(code: string) {
readLoalXlsx(code) modalState.helpShowView = false;
const lang=currentLocale.value.split('_')[0];
modalState.title=t('views.faultManage.activeAlarm.helpFile');
readLoalXlsx(lang,code)
.then(res => { .then(res => {
if (!res.length) {
visible.value = false;
}
alarmTableState.data = res; alarmTableState.data = res;
visible.value = true; modalState.helpShowView = true;
tableState.loading = false; tableState.loading = false;
}) })
.catch(error => console.error(error)); .catch(error => console.error(error));
@@ -660,6 +661,7 @@ function fnModalCancel() {
modalState.visibleByEdit = false; modalState.visibleByEdit = false;
modalState.visibleByView = false; modalState.visibleByView = false;
modalState.visibleByShowSet = false; modalState.visibleByShowSet = false;
modalState.helpShowView=false;
} }
/**查询列表, pageNum初始页数 */ /**查询列表, pageNum初始页数 */
@@ -1004,12 +1006,18 @@ onMounted(() => {
</a-table> </a-table>
</a-card> </a-card>
<!-- 帮助文档 --> <!-- 帮助文档 -->
<a-drawer <a-modal
:visible="visible" width="100%"
@close="closeDrawer" wrap-class-name="full-modal"
:height="700" :keyboard="false"
placement="bottom" :mask-closable="false"
:visible="modalState.helpShowView"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
:footer="null"
@cancel="fnModalCancel"
> >
<a-table <a-table
class="table" class="table"
@@ -1019,10 +1027,10 @@ onMounted(() => {
:data-source="alarmTableState.data" :data-source="alarmTableState.data"
:size="alarmTableState.size" :size="alarmTableState.size"
:pagination="false" :pagination="false"
:scroll="{ x: 2000, y: 560 }" :scroll="{ x: 1700, y: 560 }"
> >
</a-table> </a-table>
</a-drawer> </a-modal>
<!-- 详情框 --> <!-- 详情框 -->
<a-modal <a-modal
@@ -1565,4 +1573,20 @@ onMounted(() => {
.table :deep(.ant-pagination) { .table :deep(.ant-pagination) {
padding: 0 24px; padding: 0 24px;
} }
.full-modal {
.ant-modal {
max-width: 100%;
top: 0;
padding-bottom: 0;
margin: 0;
}
.ant-modal-content {
display: flex;
flex-direction: column;
height: calc(100vh);
}
.ant-modal-body {
flex: 1;
}
}
</style> </style>