fix: 页面字段/接口调整

This commit is contained in:
TsMask
2025-02-20 10:47:23 +08:00
parent 814bae0b94
commit 485fa89833
85 changed files with 1133 additions and 1792 deletions

View File

@@ -3,12 +3,13 @@ import { Modal, message } from 'ant-design-vue/es';
import { FileType } from 'ant-design-vue/es/upload/interface'; import { FileType } from 'ant-design-vue/es/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface'; import { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
import { onMounted, reactive, ref, toRaw } from 'vue'; import { onMounted, reactive, ref, toRaw } from 'vue';
import { updateUserProfile, uploadAvatar } from '@/api/profile'; import { updateUserProfile } from '@/api/profile';
import { regExpEmail, regExpMobile, regExpNick } from '@/utils/regular-utils'; import { regExpEmail, regExpMobile, regExpNick } from '@/utils/regular-utils';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
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';
import { uploadFile } from '@/api/tool/file';
const { t } = useI18n(); const { t } = useI18n();
const uerStore = useUserStore(); const uerStore = useUserStore();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
@@ -26,8 +27,9 @@ let stateForm = reactive({
form: { form: {
nickName: '', nickName: '',
email: '', email: '',
phonenumber: '', phone: '',
sex: '0', sex: undefined,
avatar: '',
}, },
/**表单提交点击状态 */ /**表单提交点击状态 */
formClick: false, formClick: false,
@@ -96,20 +98,37 @@ function fnUpload(up: UploadRequestOption) {
content: t('views.account.settings.uploadTip'), content: t('views.account.settings.uploadTip'),
onOk() { onOk() {
// 发送请求 // 发送请求
const hide = message.loading(t('common.loading'), 0); const hide = message.loading('请稍等...', 0);
upState.value = true; upState.value = true;
let formData = new FormData(); let formData = new FormData();
formData.append('file', up.file); formData.append('file', up.file);
uploadAvatar(formData).then(res => { formData.append('subPath', 'avatar');
upState.value = false; uploadFile(formData)
hide(); .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.account.settings.uploadOk'), 3); return res.data.filePath;
uerStore.setAvatar(res.data); }
} else { return '';
message.error(res.msg, 3); })
} .then(filePath => {
}); if (filePath === '') return undefined;
const form = toRaw(stateForm.form);
form.avatar = filePath;
return updateUserProfile(form);
})
.then(res => {
if (res === undefined) return;
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.account.settings.uploadOk'), 3);
uerStore.setAvatar(res.data);
} else {
message.error(res.msg, 3);
}
})
.finally(() => {
hide();
upState.value = false;
});
}, },
}); });
} }
@@ -156,21 +175,21 @@ onMounted(() => {
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="t('views.account.settings.phonenumber')" :label="t('views.account.settings.phone')"
name="phonenumber" name="phone"
:rules="[ :rules="[
{ {
required: false, required: false,
pattern: regExpMobile, pattern: regExpMobile,
message: t('views.account.settings.phonenumberPleace'), message: t('views.account.settings.phonePleace'),
}, },
]" ]"
> >
<IntlTelInput <IntlTelInput
v-model:value="stateForm.form.phonenumber" v-model:value="stateForm.form.phone"
allow-clear allow-clear
:maxlength="20" :maxlength="20"
:placeholder="t('views.account.settings.phonenumberPleace')" :placeholder="t('views.account.settings.phonePleace')"
></IntlTelInput> ></IntlTelInput>
</a-form-item> </a-form-item>

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Modal, message } from 'ant-design-vue/es'; import { Modal, message } from 'ant-design-vue/es';
import { reactive } from 'vue'; import { reactive } from 'vue';
import { updateUserPwd } from '@/api/profile'; import { updateUserPassword } from '@/api/profile';
import { regExpPasswd } from '@/utils/regular-utils'; import { regExpPasswd } from '@/utils/regular-utils';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@@ -49,7 +49,7 @@ function fnFinish() {
state.formClick = true; state.formClick = true;
// 发送请求 // 发送请求
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
updateUserPwd(state.form.oldPassword, state.form.confirmPassword) updateUserPassword(state.form.oldPassword, state.form.confirmPassword)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
Modal.success({ Modal.success({

View File

@@ -119,9 +119,9 @@ onMounted(() => {
:column="1" :column="1"
> >
<a-descriptions-item <a-descriptions-item
:label="t('views.account.profile.phonenumber')" :label="t('views.account.profile.phone')"
> >
{{ state.user.phonenumber || '-' }} {{ state.user.phone || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item :label="t('views.account.profile.email')"> <a-descriptions-item :label="t('views.account.profile.email')">
{{ state.user.email || '-' }} {{ state.user.email || '-' }}
@@ -144,9 +144,9 @@ onMounted(() => {
<a-descriptions-item :label="t('views.account.profile.loginIp')"> <a-descriptions-item :label="t('views.account.profile.loginIp')">
{{ state.user.loginIp || '-' }} {{ state.user.loginIp || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item :label="t('views.account.profile.loginDate')"> <a-descriptions-item :label="t('views.account.profile.loginTime')">
<span v-if="+state.user.loginDate > 0"> <span v-if="+state.user.loginTime > 0">
{{ parseDateToStr(+state.user.loginDate) }} {{ parseDateToStr(+state.user.loginTime) }}
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</a-descriptions-item> </a-descriptions-item>

View File

@@ -46,6 +46,21 @@ let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([
dayjs().startOf('hour'), dayjs().startOf('hour'),
dayjs().endOf('hour'), dayjs().endOf('hour'),
]); ]);
/**时间范围 */
let rangePickerPresets = ref([
{
label: 'Now hour',
value: [dayjs().startOf('hour'), dayjs().endOf('hour')],
},
{ label: 'Today', value: [dayjs().startOf('day'), dayjs().endOf('day')] },
{
label: 'Yesterday',
value: [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
},
]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
@@ -57,7 +72,7 @@ let queryParams = reactive({
sortField: 'timestamp', sortField: 'timestamp',
sortOrder: 'desc', sortOrder: 'desc',
/**开始时间 */ /**开始时间 */
startTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**当前页数 */ /**当前页数 */
@@ -72,8 +87,8 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
eventType: '', eventType: '',
imsi: '', imsi: '',
startTime: '', beginTime: undefined,
endTime: '', endTime: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
@@ -274,22 +289,23 @@ function fnGetList(pageNum?: number) {
Array.isArray(queryRangePicker.value) && Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0 queryRangePicker.value.length > 0
) { ) {
queryParams.startTime = queryRangePicker.value[0].valueOf(); queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf();
} else { } else {
queryParams.startTime = undefined; queryParams.beginTime = undefined;
queryParams.endTime = undefined; queryParams.endTime = undefined;
} }
listAMFDataUE(toRaw(queryParams)).then(res => { listAMFDataUE(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
tableState.data = res.rows.map(item => { tableState.data = rows.map((item: any) => {
let eventJSON = item.eventJSON; let eventJSON = item.eventJSON;
if (!eventJSON) { if (!eventJSON) {
Reflect.set(item, 'eventJSON', {}); Reflect.set(item, 'eventJSON', {});
@@ -450,12 +466,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v:any) => {
if (i.neType === 'AMF') { if (v.neType === 'AMF') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;
@@ -545,14 +561,14 @@ onBeforeUnmount(() => {
:label="t('views.dashboard.cdr.time')" :label="t('views.dashboard.cdr.time')"
name="queryRangePicker" name="queryRangePicker"
> >
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
allow-clear :presets="rangePickerPresets"
bordered :bordered="true"
:allow-clear="false"
style="width: 100%"
:show-time="{ format: 'HH:mm:ss' }" :show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>

View File

@@ -22,6 +22,7 @@ import { OptionsType, WS } from '@/plugins/ws-websocket';
import saveAs from 'file-saver'; import saveAs from 'file-saver';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import { useClipboard } from '@vueuse/core'; import { useClipboard } from '@vueuse/core';
import dayjs, { type Dayjs } from 'dayjs';
const { copy } = useClipboard({ legacy: true }); const { copy } = useClipboard({ legacy: true });
const { t } = useI18n(); const { t } = useI18n();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
@@ -43,7 +44,25 @@ let dict: {
let neOtions = ref<Record<string, any>[]>([]); let neOtions = ref<Record<string, any>[]>([]);
/**开始结束时间 */ /**开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']); let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([
dayjs().startOf('hour'),
dayjs().endOf('hour'),
]);
/**时间范围 */
let rangePickerPresets = ref([
{
label: 'Now hour',
value: [dayjs().startOf('hour'), dayjs().endOf('hour')],
},
{ label: 'Today', value: [dayjs().startOf('day'), dayjs().endOf('day')] },
{
label: 'Yesterday',
value: [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
},
]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
@@ -56,9 +75,9 @@ let queryParams = reactive({
sortField: 'timestamp', sortField: 'timestamp',
sortOrder: 'desc', sortOrder: 'desc',
/**开始时间 */ /**开始时间 */
startTime: '', beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: '', endTime: undefined as undefined | number,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -72,12 +91,12 @@ function fnQueryReset() {
recordType: '', recordType: '',
callerParty: '', callerParty: '',
calledParty: '', calledParty: '',
startTime: '', beginTime: undefined,
endTime: '', endTime: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
queryRangePicker.value = ['', '']; queryRangePicker.value = [dayjs().startOf('hour'), dayjs().endOf('hour')];
tablePagination.current = 1; tablePagination.current = 1;
tablePagination.pageSize = 20; tablePagination.pageSize = 20;
fnGetList(); fnGetList();
@@ -328,20 +347,30 @@ function fnGetList(pageNum?: number) {
if (pageNum) { if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
if (!queryRangePicker.value) {
queryRangePicker.value = ['', '']; // 时间范围
if (
Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0
) {
queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf();
} else {
queryParams.beginTime = undefined;
queryParams.endTime = undefined;
} }
queryParams.startTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1];
listIMSDataCDR(toRaw(queryParams)).then(res => { listIMSDataCDR(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
tableState.data = res.rows.map(item => { tableState.data = rows.map((item: any) => {
let cdrJSON = item.cdrJSON; let cdrJSON = item.cdrJSON;
if (!cdrJSON) { if (!cdrJSON) {
Reflect.set(item, 'cdrJSON', {}); Reflect.set(item, 'cdrJSON', {});
@@ -483,12 +512,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'IMS') { if (v.neType === 'IMS') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;
@@ -595,12 +624,12 @@ onBeforeUnmount(() => {
> >
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
allow-clear :presets="rangePickerPresets"
bordered :bordered="true"
:allow-clear="false"
style="width: 100%"
:show-time="{ format: 'HH:mm:ss' }" :show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>

View File

@@ -47,6 +47,21 @@ let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([
dayjs().startOf('hour'), dayjs().startOf('hour'),
dayjs().endOf('hour'), dayjs().endOf('hour'),
]); ]);
/**时间范围 */
let rangePickerPresets = ref([
{
label: 'Now hour',
value: [dayjs().startOf('hour'), dayjs().endOf('hour')],
},
{ label: 'Today', value: [dayjs().startOf('day'), dayjs().endOf('day')] },
{
label: 'Yesterday',
value: [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
},
]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
@@ -58,7 +73,7 @@ let queryParams = reactive({
sortField: 'timestamp', sortField: 'timestamp',
sortOrder: 'desc', sortOrder: 'desc',
/**开始时间 */ /**开始时间 */
startTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**当前页数 */ /**当前页数 */
@@ -73,8 +88,8 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
eventType: '', eventType: '',
imsi: '', imsi: '',
startTime: '', beginTime: undefined,
endTime: '', endTime: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
@@ -275,22 +290,24 @@ function fnGetList(pageNum?: number) {
Array.isArray(queryRangePicker.value) && Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0 queryRangePicker.value.length > 0
) { ) {
queryParams.startTime = queryRangePicker.value[0].valueOf(); queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf();
} else { } else {
queryParams.startTime = undefined; queryParams.beginTime = undefined;
queryParams.endTime = undefined; queryParams.endTime = undefined;
} }
listMMEDataUE(toRaw(queryParams)).then(res => { listMMEDataUE(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
// tableState.data = rows;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
tableState.data = res.rows.map(item => { tableState.data = rows.map((item: any) => {
let eventJSON = item.eventJSON; let eventJSON = item.eventJSON;
if (!eventJSON) { if (!eventJSON) {
Reflect.set(item, 'eventJSON', {}); Reflect.set(item, 'eventJSON', {});
@@ -457,12 +474,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'MME') { if (v.neType === 'MME') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;
@@ -552,14 +569,14 @@ onBeforeUnmount(() => {
:label="t('views.dashboard.cdr.time')" :label="t('views.dashboard.cdr.time')"
name="queryRangePicker" name="queryRangePicker"
> >
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
allow-clear :presets="rangePickerPresets"
bordered :bordered="true"
:allow-clear="false"
style="width: 100%"
:show-time="{ format: 'HH:mm:ss' }" :show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>

View File

@@ -1,202 +0,0 @@
<script setup lang="ts">
import * as echarts from 'echarts/core';
import {
TitleComponent,
TitleComponentOption,
TooltipComponent,
TooltipComponentOption,
GridComponent,
GridComponentOption,
LegendComponent,
LegendComponentOption,
} from 'echarts/components';
import {
PieChart,
PieSeriesOption,
BarChart,
BarSeriesOption,
} from 'echarts/charts';
import { LabelLayout } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';
import { markRaw, onMounted, ref } from 'vue';
import { origGet, top3Sel } from '@/api/faultManage/actAlarm';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { t } = useI18n();
echarts.use([
TitleComponent,
TooltipComponent,
GridComponent,
LegendComponent,
PieChart,
BarChart,
CanvasRenderer,
LabelLayout,
]);
type EChartsOption = echarts.ComposeOption<
| TitleComponentOption
| TooltipComponentOption
| GridComponentOption
| LegendComponentOption
| PieSeriesOption
| BarSeriesOption
>;
/**图DOM节点实例对象 */
const alarmTypeBar = ref<HTMLElement | undefined>(undefined);
/**图实例对象 */
const alarmTypeBarChart = ref<any>(null);
/**告警类型数据 */
const alarmTypeType = ref<any>([
{
value: 0,
name: t('views.index.Critical'),
},
{
value: 0,
name: t('views.index.Major'),
},
{
value: 0,
name: t('views.index.Minor'),
},
{
value: 0,
name: t('views.index.Warning'),
},
{
value: 0,
name: t('views.index.Event'),
},
]);
//
function initPicture() {
Promise.allSettled([origGet()])
.then(resArr => {
if (resArr[0].status === 'fulfilled') {
const res0 = resArr[0].value;
if (res0.code === RESULT_CODE_SUCCESS && Array.isArray(res0.data)) {
for (const item of res0.data) {
let index = 0;
switch (item.name) {
case 'Critical':
index = 0;
break;
case 'Major':
index = 1;
break;
case 'Minor':
index = 2;
break;
case 'Warning':
index = 3;
break;
case 'Event':
index = 4;
break;
}
alarmTypeType.value[index].value = Number(item.value);
}
}
}
})
.then(() => {
const optionData: EChartsOption = {
title: [
{
show: false,
},
],
tooltip: {
trigger: 'item',
formatter: '{b} : {c}',
},
legend: {
orient: 'vertical',
right: '2%',
top: '10%',
data: alarmTypeType.value.map((item: any) => item.name), //label数组
textStyle: {
color: '#A7D6F4', // 设置图例文字颜色
},
},
grid: [
{
top: '60%',
left: '15%',
right: '25%',
bottom: '10%',
},
],
series: [
//饼图:
{
type: 'pie',
radius: '60%',
color: ['#f5222d', '#fa8c16', '#fadb14', '#1677ff', '#13c2c2'],
label: {
show: true,
position: 'inner',
formatter: (params: any) => {
if (!params.value) return '';
return `${params.value}`;
},
},
labelLine: {
show: false,
},
center: ['30%', '40%'],
data: alarmTypeType.value,
zlevel: 2, // 设置zlevel为1使得柱状图在下层显示
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
],
};
fnDesign(alarmTypeBar.value, optionData);
});
}
function fnDesign(container: HTMLElement | undefined, option: any) {
if (!container) return;
alarmTypeBarChart.value = markRaw(echarts.init(container, 'light'));
option && alarmTypeBarChart.value.setOption(option);
// 创建 ResizeObserver 实例
var observer = new ResizeObserver(entries => {
if (alarmTypeBarChart.value) {
alarmTypeBarChart.value.resize();
}
});
// 监听元素大小变化
observer.observe(container);
}
onMounted(() => {
initPicture();
});
</script>
<template>
<div ref="alarmTypeBar" class="chart-container"></div>
</template>
<style lang="less" scoped>
.chart-container {
/* 设置图表容器大小和位置 */
width: 100%;
height: 100%;
}
</style>

View File

@@ -1,92 +0,0 @@
<script setup lang="ts">
import { reactive, toRaw, watch } from 'vue';
import { ProModal } from 'antdv-pro-modal';
import { dbGetJSON, dbSetJSON } from '@/utils/cache-db-utils';
const emit = defineEmits(['ok', 'cancel', 'update:open']);
const props = defineProps({
title: {
type: String,
default: '标题',
},
open: {
type: Boolean,
default: false,
},
});
/**数据参数 */
let dataState = reactive({
/**基站数 */
baseNum: 0,
/**核心网数 */
coreNetNum: 0,
/**在线用户数 */
onlineUserNum: 0,
});
/**弹框取消按钮事件 */
function fnModalOk() {
dbSetJSON('tbl_mocn', `tmp`, toRaw(dataState));
emit('ok');
emit('update:open', false);
}
/**弹框取消按钮事件 */
function fnModalCancel() {
emit('cancel');
emit('update:open', false);
}
/**显示弹框时初始数据 */
function init() {
// 读取数据
dbGetJSON('tbl_mocn', `tmp`).then(data => {
if (data) {
Object.assign(dataState, data);
}
});
}
/**监听是否显示,初始数据 */
watch(
() => props.open,
val => {
if (val) init();
}
);
</script>
<template>
<ProModal
:drag="true"
:width="800"
:title="props.title"
:open="props.open"
:keyboard="false"
:mask-closable="false"
@cancel="fnModalCancel"
@ok="fnModalOk"
>
<a-form
name="dataState"
layout="horizontal"
:label-col="{ span: 6 }"
:labelWrap="true"
>
<a-form-item label="baseNum" name="baseNum">
<a-input-number v-model:value="dataState.baseNum"> </a-input-number>
</a-form-item>
<a-form-item label="coreNetNum" name="coreNetNum">
<a-input-number v-model:value="dataState.coreNetNum"> </a-input-number>
</a-form-item>
<a-form-item label="onlineUserNum" name="onlineUserNum">
<a-input-number v-model:value="dataState.onlineUserNum">
</a-input-number>
</a-form-item>
</a-form>
</ProModal>
</template>
<style lang="less" scoped></style>
<style lang="less" scoped></style>

View File

@@ -1,570 +0,0 @@
<script setup lang="ts">
import { onBeforeUnmount, onMounted, reactive, ref } from 'vue';
import svgBase from '@/assets/svg/base.svg';
import svgUserIMS from '@/assets/svg/userIMS.svg';
import svgUserSMF from '@/assets/svg/userSMF.svg';
import useI18n from '@/hooks/useI18n';
import Topology from '../overview/components/Topology/index.vue';
import NeResources from '../overview/components/NeResources/index.vue';
import UserActivity from '../overview/components/UserActivity/index.vue';
import AlarnTypeBar from './components/AlarnTypeBar/index.vue';
import Setting from './components/setting.vue';
import UPFFlow from '../overview/components/UPFFlow/index.vue';
import { listUDMSub } from '@/api/neData/udm_sub';
import { listUENumBySMF } from '@/api/neUser/smf';
import { listUENumByIMS } from '@/api/neUser/ims';
import { listBase5G } from '@/api/neUser/base5G';
import {
graphNodeClickID,
graphState,
notNeNodes,
graphNodeStateNum,
neStateRequestMap,
} from '../overview/hooks/useTopology';
import { upfTotalFlow, upfTFActive } from '../overview/hooks/useUPFTotalFlow';
import { useFullscreen } from '@vueuse/core';
import useWS from '../overview/hooks/useWS';
import useAppStore from '@/store/modules/app';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { useRouter } from 'vue-router';
import { dbGetJSON } from '@/utils/cache-db-utils';
const router = useRouter();
const appStore = useAppStore();
const { t } = useI18n();
const { wsSend, userActivitySend, upfTFSend } = useWS();
/**概览状态类型 */
type SkimStateType = {
/**UDM签约用户数量 */
udmSubNum: number;
/**SMF在线用户数 */
smfUeNum: number;
/**IMS在线用户数 */
imsUeNum: number;
/**5G基站数量 */
gnbNum: number;
/**5G在线用户数量 */
gnbUeNum: number;
/**4G基站数量 */
enbNum: number;
/**4G在线用户数量 */
enbUeNum: number;
};
/**概览状态信息 */
let skimState: SkimStateType = reactive({
udmSubNum: 0,
smfUeNum: 0,
imsUeNum: 0,
gnbNum: 0,
gnbUeNum: 0,
enbNum: 0,
enbUeNum: 0,
});
/**总览节点 */
const viewportDom = ref<HTMLElement | null>(null);
const { isFullscreen, toggle } = useFullscreen(viewportDom);
/**10s调度器 */
const interval10s = ref<any>(null);
/**5s调度器 */
const interval5s = ref<any>(null);
/**查询网元状态 */
function fnGetNeState() {
// 获取节点状态
for (const node of graphState.data.nodes) {
if (notNeNodes.includes(node.id)) continue;
const { neType, neId } = node.neInfo;
if (!neType || !neId) continue;
// 请求标记检查避免重复发送
if (neStateRequestMap.value.get(neType)) continue;
neStateRequestMap.value.set(neType, true);
wsSend({
requestId: `neState_${neType}_${neId}`,
type: 'ne_state',
data: {
neType: neType,
neId: neId,
},
});
}
}
/**获取概览信息 */
async function fnGetSkim() {
const resArr = await Promise.allSettled([
listUDMSub({
neid: '001',
pageNum: 1,
pageSize: 1,
}),
listUENumBySMF('001'),
listUENumByIMS('001'),
listBase5G({
neType: 'AMF',
neId: '001',
}),
listBase5G({
neType: 'MME',
neId: '001',
}),
]);
if (resArr[0].status === 'fulfilled') {
const res0 = resArr[0].value;
if (res0.code === RESULT_CODE_SUCCESS) {
skimState.udmSubNum = res0.total;
}
}
if (resArr[1].status === 'fulfilled') {
const res1 = resArr[1].value;
if (res1.code === RESULT_CODE_SUCCESS) {
skimState.smfUeNum = res1.data;
}
}
if (resArr[2].status === 'fulfilled') {
const res2 = resArr[2].value;
if (res2.code === RESULT_CODE_SUCCESS) {
skimState.imsUeNum = res2.data;
}
}
if (resArr[3].status === 'fulfilled') {
const res3 = resArr[3].value;
if (res3.code === RESULT_CODE_SUCCESS) {
skimState.gnbNum = res3.total;
skimState.gnbUeNum = 0;
res3.rows.map((item: any) => {
skimState.gnbUeNum += item.ueNum;
});
}
}
if (resArr[4].status === 'fulfilled') {
const res4 = resArr[4].value;
if (res4.code === RESULT_CODE_SUCCESS) {
skimState.enbNum = res4.total;
skimState.enbUeNum = 0;
res4.rows.map((item: any) => {
skimState.enbUeNum += item.ueNum;
});
}
}
}
/**初始数据函数 */
function loadData() {
fnGetNeState(); // 获取网元状态
userActivitySend();
upfTFSend('0');
upfTFSend('7');
upfTFSend('30');
clearInterval(interval10s.value);
interval10s.value = setInterval(() => {
if (upfTFActive.value === '0') {
upfTFSend('7');
upfTFActive.value = '7';
} else if (upfTFActive.value === '7') {
upfTFSend('30');
upfTFActive.value = '30';
} else if (upfTFActive.value === '30') {
upfTFSend('0');
upfTFActive.value = '0';
}
}, 10_000);
clearInterval(interval5s.value);
interval5s.value = setInterval(() => {
fnGetSkim(); // 获取概览信息
fnGetNeState(); // 获取网元状态
}, 5_000);
}
/**栏目信息跳转 */
function fnToRouter(name: string, query?: any) {
router.push({ name, query });
}
onMounted(() => {
fnGetSkim().then(() => {
loadData();
});
// 读取数据
dbGetJSON('tbl_mocn', `tmp`).then(data => {
if (data) {
Object.assign(mocnState.data, data);
}
});
});
onBeforeUnmount(() => {
clearInterval(interval10s.value);
clearInterval(interval5s.value);
});
/**MOCN状态 */
const mocnState = reactive({
title: 'Set MOCN Data',
open: false,
data: {
/**基站数 */
baseNum: 0,
/**核心网数 */
coreNetNum: 0,
/**在线用户数 */
onlineUserNum: 0,
},
});
/**MOCN 右击设置 */
function fnRightClick() {
mocnState.open = true;
}
</script>
<template>
<div class="viewport" ref="viewportDom">
<div class="brand">
<div
class="brand-title"
@click="toggle"
:title="t('views.dashboard.overview.fullscreen')"
>
{{ t('views.dashboard.overview.title') }}
<FullscreenExitOutlined v-if="isFullscreen" />
<FullscreenOutlined v-else />
</div>
<div class="brand-desc">{{ appStore.appName }}</div>
</div>
<div class="column">
<!--概览-->
<div class="skim panel">
<div class="inner">
<h3>
<IdcardOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.skim.userTitle') }}
</h3>
<div class="data">
<div
class="item toRouter"
@click="fnToRouter('Sub_2010')"
:title="t('views.dashboard.overview.toRouter')"
>
<div>
<UserOutlined
style="color: #4096ff; margin-right: 8px; font-size: 1.1rem"
/>
{{ skimState.udmSubNum }}
</div>
<span>
{{ t('views.dashboard.overview.skim.users') }}
</span>
</div>
<div
class="item toRouter"
@click="fnToRouter('Ims_2080')"
:title="t('views.dashboard.overview.toRouter')"
style="margin: 0 12px"
>
<div>
<img :src="svgUserIMS" style="width: 18px; margin-right: 8px" />
{{ skimState.imsUeNum }}
</div>
<span>
{{ t('views.dashboard.overview.skim.imsUeNum') }}
</span>
</div>
<div
class="item toRouter"
@click="fnToRouter('Ue_2081')"
:title="t('views.dashboard.overview.toRouter')"
>
<div>
<img :src="svgUserSMF" style="width: 18px; margin-right: 8px" />
{{ skimState.smfUeNum }}
</div>
<span>
{{ t('views.dashboard.overview.skim.smfUeNum') }}
</span>
</div>
</div>
</div>
</div>
<div class="skim panel base">
<div class="inner">
<h3>
<GlobalOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.skim.baseTitle') }}
</h3>
<div class="data">
<div
class="item toRouter"
@click="fnToRouter('Base5G_2082', { neType: 'AMF' })"
:title="t('views.dashboard.overview.toRouter')"
>
<div style="align-items: flex-start">
<img
:src="svgBase"
style="width: 18px; margin-right: 8px; height: 2rem"
/>
{{ skimState.gnbNum }}
</div>
<span>{{ t('views.dashboard.overview.skim.gnbBase') }}</span>
</div>
<div
class="item toRouter"
@click="fnToRouter('Base5G_2082', { neType: 'AMF' })"
:title="t('views.dashboard.overview.toRouter')"
>
<div style="align-items: flex-start">
<UserOutlined
style="color: #4096ff; margin-right: 8px; font-size: 1.1rem"
/>
{{ skimState.gnbUeNum }}
</div>
<span>{{ t('views.dashboard.overview.skim.gnbUeNum') }}</span>
</div>
</div>
<div class="data">
<div
class="item toRouter"
@click="fnToRouter('Base5G_2082', { neType: 'MME' })"
:title="t('views.dashboard.overview.toRouter')"
>
<div style="align-items: flex-start">
<img
:src="svgBase"
style="width: 18px; margin-right: 8px; height: 2rem"
/>
{{ skimState.enbNum }}
</div>
<span>{{ t('views.dashboard.overview.skim.enbBase') }}</span>
</div>
<div
class="item toRouter"
@click="fnToRouter('Base5G_2082', { neType: 'MME' })"
:title="t('views.dashboard.overview.toRouter')"
>
<div style="align-items: flex-start">
<UserOutlined
style="color: #4096ff; margin-right: 8px; font-size: 1.1rem"
/>
{{ skimState.enbUeNum }}
</div>
<span>{{ t('views.dashboard.overview.skim.enbUeNum') }}</span>
</div>
</div>
</div>
</div>
<!-- 用户行为 -->
<div class="userActivity panel">
<div class="inner">
<h3>
<WhatsAppOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.userActivity.title') }}
</h3>
<div class="chart">
<UserActivity />
</div>
</div>
</div>
</div>
<div class="column" style="flex: 4; margin: 1.333rem 0.833rem 0">
<!-- 实时流量 -->
<div class="upfFlow panel">
<div class="inner">
<h3
class="toRouter"
@click="fnToRouter('GoldTarget_2104')"
:title="t('views.dashboard.overview.toRouter')"
>
<AreaChartOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.upfFlow.title') }}
</h3>
<div class="chart">
<UPFFlow />
</div>
</div>
</div>
<!-- 网络拓扑 -->
<div class="topology panel">
<div class="inner">
<h3
class="toRouter"
@click="fnToRouter('TopologyArchitecture_2128')"
:title="t('views.dashboard.overview.toRouter')"
>
<span>
<ApartmentOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.topology.title') }}
</span>
<span>
{{ t('views.dashboard.overview.topology.normal') }}:
<span class="normal"> {{ graphNodeStateNum[0] }} </span>
{{ t('views.dashboard.overview.topology.abnormal') }}:
<span class="abnormal"> {{ graphNodeStateNum[1] }} </span>
</span>
</h3>
<div class="chart">
<Topology />
</div>
</div>
</div>
</div>
<div class="column">
<!-- 流量统计 -->
<div class="upfFlowTotal panel">
<div class="inner">
<h3>
<span>
<SwapOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.upfFlowTotal.title') }}
</span>
<!-- 筛选 -->
<div class="filter">
<span
:data-key="v"
:class="{ active: upfTFActive === v }"
v-for="v in ['0', '7', '30']"
:key="v"
@click="
() => {
upfTFActive = v;
}
"
>
{{
v === '0'
? '24' + t('common.units.hour')
: v + t('common.units.day')
}}
</span>
</div>
</h3>
<div class="chart">
<!-- 数据 -->
<div class="data">
<div class="item">
<span>
<ArrowUpOutlined style="color: #597ef7" />
{{ t('views.dashboard.overview.upfFlowTotal.up') }}
</span>
<h4>{{ upfTotalFlow[upfTFActive].upFrom }}</h4>
</div>
<div class="item">
<span>
<ArrowDownOutlined style="color: #52c41a" />
{{ t('views.dashboard.overview.upfFlowTotal.down') }}
</span>
<h4>{{ upfTotalFlow[upfTFActive].downFrom }}</h4>
</div>
</div>
</div>
</div>
</div>
<!-- MOCN -->
<div class="skim panel mocn">
<div class="inner">
<h3
class="toRouter"
@contextmenu.prevent="fnRightClick()"
@click="fnToRouter('GoldTarget_2104', { neType: 'MOCNGW' })"
:title="t('views.dashboard.overview.toRouter')"
>
<PieChartOutlined style="color: #68d8fe" />&nbsp;&nbsp; MOCN
Information
</h3>
<div class="chart">
<div class="data">
<div class="item" title="NodeB">
<div>
<img :src="svgBase" style="width: 18px; margin-right: 8px" />
{{ mocnState.data.baseNum }}
</div>
<span> NodeB </span>
</div>
<div class="item" title="CoreNet">
<div>
<img
:src="svgUserSMF"
style="width: 18px; margin-right: 8px"
/>
{{ mocnState.data.coreNetNum }}
</div>
<span> CoreNet </span>
</div>
</div>
<div class="data">
<div class="item" title="OnlineUser">
<div>
<UserOutlined
style="color: #4096ff; margin-right: 8px; font-size: 1.1rem"
/>
{{ mocnState.data.onlineUserNum }}
</div>
<span> OnlineUser </span>
</div>
</div>
</div>
</div>
</div>
<!-- 告警统计 -->
<div class="alarmType panel">
<div class="inner">
<h3
class="toRouter"
@click="fnToRouter('HistoryAlarm_2097')"
:title="t('views.dashboard.overview.toRouter')"
>
<PieChartOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.alarmTypeBar.alarmSum') }}
</h3>
<div class="chart">
<AlarnTypeBar />
</div>
</div>
</div>
<!-- 资源情况 -->
<div class="resources panel">
<div class="inner">
<h3>
<DashboardOutlined style="color: #68d8fe" />&nbsp;&nbsp;
{{ t('views.dashboard.overview.resources.title') }}
{{ graphNodeClickID }}
</h3>
<div class="chart">
<NeResources />
</div>
</div>
</div>
</div>
<Setting
:title="mocnState.title"
v-model:open="mocnState.open"
></setting>
</div>
</template>
<style lang="less" scoped>
@import url('../overview/css/index.css');
.mocn {
height: 20.6%;
}
.mocn .inner .chart .data {
height: unset;
}
.mocn .inner .chart .data .item {
width: 50%;
}
.alarmType {
height: 24.4%;
}
</style>

View File

@@ -216,7 +216,7 @@ function fnGetInitData() {
sortOrder: 'asc', sortOrder: 'asc',
}) })
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
for (const item of res.data) { for (const item of res.data) {
upfFlowParse(item); upfFlowParse(item);
} }

View File

@@ -10,9 +10,10 @@ import UserActivity from './components/UserActivity/index.vue';
import AlarnTypeBar from './components/AlarnTypeBar/index.vue'; import AlarnTypeBar from './components/AlarnTypeBar/index.vue';
import UPFFlow from './components/UPFFlow/index.vue'; import UPFFlow from './components/UPFFlow/index.vue';
import { listUDMSub } from '@/api/neData/udm_sub'; import { listUDMSub } from '@/api/neData/udm_sub';
import { listUENumBySMF } from '@/api/neUser/smf'; import { listIMSSessionNum } from '@/api/neData/ims';
import { listUENumByIMS } from '@/api/neUser/ims'; import { listAMFNblist } from '@/api/neData/amf';
import { listBase5G } from '@/api/neUser/base5G'; import { listMMENblist } from '@/api/neData/mme';
import { listSMFSubNum } from '@/api/neData/smf';
import { import {
graphNodeClickID, graphNodeClickID,
graphState, graphState,
@@ -110,13 +111,13 @@ async function fnGetSkim() {
listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }), listUDMSub({ neId: neId, pageNum: 1, pageSize: 1 }),
process: (res: any) => process: (res: any) =>
res.code === RESULT_CODE_SUCCESS && res.code === RESULT_CODE_SUCCESS &&
(skimState.udmSubNum += res.total), (skimState.udmSubNum += res.data.total),
}, },
], ],
[ [
'SMF', 'SMF',
{ {
request: (neId: string) => listUENumBySMF(neId), request: (neId: string) => listSMFSubNum(neId),
process: (res: any) => process: (res: any) =>
res.code === RESULT_CODE_SUCCESS && (skimState.smfUeNum += res.data), res.code === RESULT_CODE_SUCCESS && (skimState.smfUeNum += res.data),
}, },
@@ -124,7 +125,7 @@ async function fnGetSkim() {
[ [
'IMS', 'IMS',
{ {
request: (neId: string) => listUENumByIMS(neId), request: (neId: string) => listIMSSessionNum(neId),
process: (res: any) => process: (res: any) =>
res.code === RESULT_CODE_SUCCESS && (skimState.imsUeNum += res.data), res.code === RESULT_CODE_SUCCESS && (skimState.imsUeNum += res.data),
}, },
@@ -132,11 +133,11 @@ async function fnGetSkim() {
[ [
'AMF', 'AMF',
{ {
request: (neId: string) => listBase5G({ neType: 'AMF', neId }), request: (neId: string) => listAMFNblist({ neId }),
process: (res: any) => { process: (res: any) => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
skimState.gnbNum += res.total; skimState.gnbNum += res.data.length;
skimState.gnbUeNum += res.rows.reduce( skimState.gnbUeNum += res.data.reduce(
(sum: number, item: any) => sum + item.ueNum, (sum: number, item: any) => sum + item.ueNum,
0 0
); );
@@ -147,11 +148,11 @@ async function fnGetSkim() {
[ [
'MME', 'MME',
{ {
request: (neId: string) => listBase5G({ neType: 'MME', neId }), request: (neId: string) => listMMENblist({ neId }),
process: (res: any) => { process: (res: any) => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
skimState.enbNum += res.total; skimState.enbNum += res.data.length;
skimState.enbUeNum += res.rows.reduce( skimState.enbUeNum += res.data.reduce(
(sum: number, item: any) => sum + item.ueNum, (sum: number, item: any) => sum + item.ueNum,
0 0
); );
@@ -267,12 +268,12 @@ onMounted(() => {
neInfoStore neInfoStore
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'UPF') { if (v.neType === 'UPF') {
arr.push({ value: i.neId, label: i.neName, rmUid: i.rmUid }); arr.push({ value: v.neId, label: v.neName, rmUid: v.rmUid });
} }
}); });

View File

@@ -17,6 +17,7 @@ import {
listSGWCDataCDR, listSGWCDataCDR,
} from '@/api/neData/sgwc'; } from '@/api/neData/sgwc';
import { OptionsType, WS } from '@/plugins/ws-websocket'; import { OptionsType, WS } from '@/plugins/ws-websocket';
import dayjs, { type Dayjs } from 'dayjs';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import saveAs from 'file-saver'; import saveAs from 'file-saver';
import { useClipboard } from '@vueuse/core'; import { useClipboard } from '@vueuse/core';
@@ -29,7 +30,25 @@ const queue = new PQueue({ concurrency: 1, autoStart: true });
let neOtions = ref<Record<string, any>[]>([]); let neOtions = ref<Record<string, any>[]>([]);
/**开始结束时间 */ /**开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']); let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([
dayjs().startOf('hour'),
dayjs().endOf('hour'),
]);
/**时间范围 */
let rangePickerPresets = ref([
{
label: 'Now hour',
value: [dayjs().startOf('hour'), dayjs().endOf('hour')],
},
{ label: 'Today', value: [dayjs().startOf('day'), dayjs().endOf('day')] },
{
label: 'Yesterday',
value: [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
},
]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
@@ -41,9 +60,9 @@ let queryParams = reactive({
sortField: 'timestamp', sortField: 'timestamp',
sortOrder: 'desc', sortOrder: 'desc',
/**开始时间 */ /**开始时间 */
startTime: '', beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: '', endTime: undefined as undefined | number,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -55,12 +74,12 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
imsi: '', imsi: '',
msisdn: '', msisdn: '',
startTime: '', beginTime: undefined,
endTime: '', endTime: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
queryRangePicker.value = ['', '']; queryRangePicker.value = [dayjs().startOf('hour'), dayjs().endOf('hour')];
tablePagination.current = 1; tablePagination.current = 1;
tablePagination.pageSize = 20; tablePagination.pageSize = 20;
fnGetList(); fnGetList();
@@ -310,20 +329,30 @@ function fnGetList(pageNum?: number) {
if (pageNum) { if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
if (!queryRangePicker.value) {
queryRangePicker.value = ['', '']; // 时间范围
if (
Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0
) {
queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf();
} else {
queryParams.beginTime = undefined;
queryParams.endTime = undefined;
} }
queryParams.startTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1];
listSGWCDataCDR(toRaw(queryParams)).then(res => { listSGWCDataCDR(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
// tableState.data = rows;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
tableState.data = res.rows.map(item => { tableState.data = rows.map((item: any) => {
let cdrJSON = item.cdrJSON; let cdrJSON = item.cdrJSON;
if (!cdrJSON) { if (!cdrJSON) {
Reflect.set(item, 'cdrJSON', {}); Reflect.set(item, 'cdrJSON', {});
@@ -454,12 +483,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'SGWC') { if (v.neType === 'SGWC') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;
@@ -554,12 +583,12 @@ onBeforeUnmount(() => {
> >
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
allow-clear :presets="rangePickerPresets"
bordered :bordered="true"
:allow-clear="false"
style="width: 100%"
:show-time="{ format: 'HH:mm:ss' }" :show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -768,12 +797,18 @@ onBeforeUnmount(() => {
<span> {{ record.cdrJSON.servedMSISDN }} </span> <span> {{ record.cdrJSON.servedMSISDN }} </span>
</div> </div>
<div> <div>
<span>PGW Address Used: </span> <span>GGSN Address: </span>
<span> {{ record.cdrJSON.pGWAddressUsed }} </span> <span>
{{
record.cdrJSON.pGWAddressUsed || record.cdrJSON.GGSNAddress
}}
</span>
</div> </div>
<div> <div>
<span>SGW Address: </span> <span>SGSN Address: </span>
<span> {{ record.cdrJSON.sGWAddress }} </span> <span>
{{ record.cdrJSON.sGWAddress || record.cdrJSON.SGSNAddress }}
</span>
</div> </div>
<div> <div>
<span>RAT Type: </span> <span>RAT Type: </span>

View File

@@ -19,7 +19,7 @@ import {
import { OptionsType, WS } from '@/plugins/ws-websocket'; import { OptionsType, WS } from '@/plugins/ws-websocket';
import PQueue from 'p-queue'; import PQueue from 'p-queue';
import saveAs from 'file-saver'; import saveAs from 'file-saver';
import dayjs, { Dayjs } from 'dayjs'; import dayjs, { type Dayjs } from 'dayjs';
import { useClipboard } from '@vueuse/core'; import { useClipboard } from '@vueuse/core';
const { copy } = useClipboard({ legacy: true }); const { copy } = useClipboard({ legacy: true });
const { t } = useI18n(); const { t } = useI18n();
@@ -59,7 +59,7 @@ let queryParams = reactive({
sortField: 'timestamp', sortField: 'timestamp',
sortOrder: 'desc', sortOrder: 'desc',
/**开始时间 */ /**开始时间 */
startTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**当前页数 */ /**当前页数 */
@@ -362,22 +362,24 @@ function fnGetList(pageNum?: number) {
Array.isArray(queryRangePicker.value) && Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0 queryRangePicker.value.length > 0
) { ) {
queryParams.startTime = queryRangePicker.value[0].valueOf(); queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf();
} else { } else {
queryParams.startTime = undefined; queryParams.beginTime = undefined;
queryParams.endTime = undefined; queryParams.endTime = undefined;
} }
listSMFDataCDR(toRaw(queryParams)).then(res => { listSMFDataCDR(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
// tableState.data = rows;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
tableState.data = res.rows.map(item => { tableState.data = rows.map((item: any) => {
let cdrJSON = item.cdrJSON; let cdrJSON = item.cdrJSON;
if (!cdrJSON) { if (!cdrJSON) {
Reflect.set(item, 'cdrJSON', {}); Reflect.set(item, 'cdrJSON', {});
@@ -508,12 +510,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'SMF') { if (v.neType === 'SMF') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -229,7 +229,7 @@ function fnRanderChart() {
// 创建 ResizeObserver 实例 监听图表容器大小变化,并在变化时调整图表大小 // 创建 ResizeObserver 实例 监听图表容器大小变化,并在变化时调整图表大小
var observer = new ResizeObserver(entries => { var observer = new ResizeObserver(entries => {
if (cdrChart) { if (cdrChart && !cdrChart.isDisposed) {
cdrChart.resize(); cdrChart.resize();
} }
}); });
@@ -271,7 +271,7 @@ let queryParams = reactive({
sortField: 'timestamp', sortField: 'timestamp',
sortOrder: 'desc', sortOrder: 'desc',
/**开始时间 */ /**开始时间 */
startTime: undefined as undefined | number, beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: undefined as undefined | number, endTime: undefined as undefined | number,
/**当前页数 */ /**当前页数 */
@@ -321,20 +321,20 @@ function fnGetList(pageNum?: number) {
Array.isArray(queryRangePicker.value) && Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0 queryRangePicker.value.length > 0
) { ) {
queryParams.startTime = queryRangePicker.value[0].valueOf(); queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf(); queryParams.endTime = queryRangePicker.value[1].valueOf();
} else { } else {
queryParams.startTime = undefined; queryParams.beginTime = undefined;
queryParams.endTime = undefined; queryParams.endTime = undefined;
} }
listSMFDataCDR(toRaw(queryParams)) listSMFDataCDR(toRaw(queryParams))
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
state.total = res.total; state.total = res.total;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
state.data = res.rows state.data = res.rows
.map(item => { .map((item: any) => {
let cdrJSON = item.cdrJSON; let cdrJSON = item.cdrJSON;
if (!cdrJSON) { if (!cdrJSON) {
Reflect.set(item, 'cdrJSON', {}); Reflect.set(item, 'cdrJSON', {});
@@ -546,12 +546,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'SMF') { if (v.neType === 'SMF') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -310,14 +310,16 @@ function fnGetList(pageNum?: number) {
queryParams.startTime = queryRangePicker.value[0]; queryParams.startTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listSMSCDataCDR(toRaw(queryParams)).then(res => { listSMSCDataCDR(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
// tableState.data = rows;
// 遍历处理cdr字符串数据 // 遍历处理cdr字符串数据
tableState.data = res.rows.map(item => { tableState.data = rows.map((item:any) => {
let cdrJSON = item.cdrJSON; let cdrJSON = item.cdrJSON;
if (!cdrJSON) { if (!cdrJSON) {
Reflect.set(item, 'cdrJSON', {}); Reflect.set(item, 'cdrJSON', {});
@@ -454,12 +456,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v:any) => {
if (i.neType === 'SMSC') { if (v.neType === 'SMSC') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -24,6 +24,7 @@ import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
import { writeSheet } from '@/utils/execl-utils'; 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';
import { parseDateToStr } from '@/utils/date-utils';
const neInfoStore = useNeInfoStore(); const neInfoStore = useNeInfoStore();
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const { t, currentLocale } = useI18n(); const { t, currentLocale } = useI18n();
@@ -168,6 +169,12 @@ let tableColumns: ColumnsType = [
align: 'center', align: 'center',
sorter: (a: any, b: any) => 1, sorter: (a: any, b: any) => 1,
width: 5, width: 5,
customRender(opt) {
if (typeof opt.value === 'number') {
return parseDateToStr(+opt.value);
}
return opt.value;
},
}, },
{ {
title: t('views.faultManage.activeAlarm.alarmCode'), title: t('views.faultManage.activeAlarm.alarmCode'),
@@ -734,14 +741,14 @@ function fnGetList(pageNum?: number) {
filterState.sql = sql; filterState.sql = sql;
} }
listAct(toRaw(queryParams), filterState.sql).then((res: any) => { listAct(toRaw(queryParams), filterState.sql).then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (state.selectedRowKeys.length > 0) { if (state.selectedRowKeys.length > 0) {
state.selectedRowKeys = []; state.selectedRowKeys = [];
} }
//// const { total, rows } = res.data;
tablePagination.total = res.total; tablePagination.total = total;
tableState.data = res.rows; tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -1199,7 +1206,7 @@ onMounted(() => {
:label="t('views.faultManage.activeAlarm.eventTime')" :label="t('views.faultManage.activeAlarm.eventTime')"
name="eventTime" name="eventTime"
> >
{{ modalState.from.eventTime }} {{ parseDateToStr(modalState.from.eventTime) }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -1210,7 +1217,10 @@ onMounted(() => {
:label="t('views.faultManage.activeAlarm.alarmType')" :label="t('views.faultManage.activeAlarm.alarmType')"
name="alarmType" name="alarmType"
> >
{{ modalState.from.alarmType }} <DictTag
:options="dict.activeAlarmType"
:value="modalState.from.alarmType"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
@@ -1247,7 +1257,10 @@ onMounted(() => {
:label="t('views.faultManage.activeAlarm.origLevel')" :label="t('views.faultManage.activeAlarm.origLevel')"
name="origSeverity" name="origSeverity"
> >
{{ modalState.from.origSeverity }} <DictTag
:options="dict.activeAlarmSeverity"
:value="modalState.from.origSeverity"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>

View File

@@ -130,12 +130,6 @@ let tableColumns: ColumnsType = [
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{
title: t('views.faultManage.activeAlarm.neName'),
dataIndex: 'neName',
align: 'center',
width: 5,
},
{ {
title: t('views.faultManage.activeAlarm.neType'), title: t('views.faultManage.activeAlarm.neType'),
dataIndex: 'neType', dataIndex: 'neType',
@@ -161,12 +155,6 @@ let tableColumns: ColumnsType = [
sorter: (a: any, b: any) => 1, sorter: (a: any, b: any) => 1,
width: 5, width: 5,
}, },
{
title: t('views.faultManage.activeAlarm.pvFlag'),
dataIndex: 'pvFlag',
align: 'center',
width: 5,
},
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'alarm_id', key: 'alarm_id',
@@ -403,14 +391,15 @@ function fnGetList(pageNum?: number) {
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listAct(toRaw(queryParams)).then((res: any) => { listAct(toRaw(queryParams)).then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (state.selectedRowKeys.length > 0) { if (state.selectedRowKeys.length > 0) {
state.selectedRowKeys = []; state.selectedRowKeys = [];
} }
//// ////
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -735,14 +724,6 @@ onMounted(() => {
{{ modalState.from.neId }} {{ modalState.from.neId }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.neName')"
name="neName"
>
{{ modalState.from.neName }}
</a-form-item>
</a-col>
</a-row> </a-row>
<a-row> <a-row>
@@ -791,25 +772,6 @@ onMounted(() => {
{{ modalState.from.locationInfo }} {{ modalState.from.locationInfo }}
</a-form-item> </a-form-item>
<a-row>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.province')"
name="province"
>
{{ modalState.from.province }}
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.faultManage.activeAlarm.alarmType')"
name="alarmType"
>
{{ modalState.from.alarmType }}
</a-form-item>
</a-col>
</a-row>
<a-form-item <a-form-item
:label="t('views.faultManage.activeAlarm.addInfo')" :label="t('views.faultManage.activeAlarm.addInfo')"
name="addInfo" name="addInfo"

View File

@@ -540,13 +540,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listAct(toRaw(queryParams)).then(res => { listAct(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (state.selectedRowKeys.length > 0) { if (state.selectedRowKeys.length > 0) {
state.selectedRowKeys = []; state.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -179,9 +179,10 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listAlarm(toRaw(queryParams)).then(res => { listAlarm(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
tableState.loading = false; tableState.loading = false;
fnGetList(queryParams.pageNum - 1); fnGetList(queryParams.pageNum - 1);

View File

@@ -238,9 +238,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
getBakFileList(toRaw(queryParams)).then(res => { getBakFileList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.data; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -260,7 +261,7 @@ function fnGetList(pageNum?: number) {
onMounted(() => { onMounted(() => {
getBakFile().then(res => { getBakFile().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
fileList.value.push({ fileList.value.push({
value: item.tableName, value: item.tableName,

View File

@@ -82,19 +82,19 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.logManage.forwarding.alarmInter'), title: t('views.logManage.forwarding.alarmInter'),
dataIndex: 'interface', dataIndex: 'type',
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{ {
title: t('views.logManage.forwarding.alarmObj'), title: t('views.logManage.forwarding.alarmObj'),
dataIndex: 'toUser', dataIndex: 'target',
align: 'center', align: 'center',
width: 5, width: 5,
}, },
{ {
title: t('views.logManage.forwarding.alarmInfo'), title: t('views.logManage.forwarding.alarmInfo'),
dataIndex: 'operResult', dataIndex: 'result',
align: 'center', align: 'center',
width: 6, width: 6,
}, },
@@ -140,7 +140,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.logManage.forwarding.logTime'), title: t('views.logManage.forwarding.logTime'),
dataIndex: 'logTime', dataIndex: 'createdAt',
align: 'center', align: 'center',
customRender(opt) { customRender(opt) {
if (!opt.value) return ''; if (!opt.value) return '';
@@ -196,9 +196,10 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listForwarding(toRaw(queryParams)).then(res => { listForwarding(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
tableState.loading = false; tableState.loading = false;
fnGetList(queryParams.pageNum - 1); fnGetList(queryParams.pageNum - 1);

View File

@@ -158,9 +158,10 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listMML(toRaw(queryParams)).then(res => { listMML(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -238,9 +238,10 @@ function fnGetList(pageNum?: number) {
} }
queryParams.path = nePathArr.value.join('/'); queryParams.path = nePathArr.value.join('/');
listNeFiles(toRaw(queryParams)).then(res => { listNeFiles(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -280,7 +281,7 @@ function fnDrawerOpen(row: Record<string, any>) {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length === 0) { if (res.data.length === 0) {
message.warning({ message.warning({
content: t('common.noData'), content: t('common.noData'),

View File

@@ -354,7 +354,7 @@ function fnGetList() {
const neType = state.neType[0]; const neType = state.neType[0];
state.mmlNeType = neType; state.mmlNeType = neType;
getMMLByNE(neType).then(res => { getMMLByNE(neType).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 构建自动完成筛选结构 // 构建自动完成筛选结构
const autoCompleteArr: Record<string, any>[] = []; const autoCompleteArr: Record<string, any>[] = [];
// 构建树结构 // 构建树结构
@@ -539,7 +539,7 @@ function fnAutoCompleteKeydown(evt: any) {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter(

View File

@@ -342,7 +342,7 @@ function ruleVerification(
/**查询可选命令列表 */ /**查询可选命令列表 */
function fnGetList() { function fnGetList() {
getMMLByOMC().then(res => { getMMLByOMC().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 构建自动完成筛选结构 // 构建自动完成筛选结构
const autoCompleteArr: Record<string, any>[] = []; const autoCompleteArr: Record<string, any>[] = [];
// 构建树结构 // 构建树结构
@@ -508,7 +508,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 获取可用OMC // 获取可用OMC
const omcArr = useNeInfoStore().getNeSelectOtions.find( const omcArr = useNeInfoStore().getNeSelectOtions.find(

View File

@@ -342,7 +342,7 @@ function ruleVerification(
/**查询可选命令列表 */ /**查询可选命令列表 */
function fnGetList() { function fnGetList() {
getMMLByUDM().then(res => { getMMLByUDM().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 构建自动完成筛选结构 // 构建自动完成筛选结构
const autoCompleteArr: Record<string, any>[] = []; const autoCompleteArr: Record<string, any>[] = [];
// 构建树结构 // 构建树结构
@@ -508,7 +508,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 获取可用UDM // 获取可用UDM
const udmArr = useNeInfoStore().getNeSelectOtions.find( const udmArr = useNeInfoStore().getNeSelectOtions.find(

View File

@@ -550,8 +550,9 @@ function fnGetList(pageNum?: number) {
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -372,8 +372,9 @@ function fnGetList(pageNum?: number) {
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -64,22 +64,22 @@ let rangePicker = reactive<RangePickerType>({
/**查询全部资源数据列表 */ /**查询全部资源数据列表 */
function fnGetList() { function fnGetList() {
let startTime = null; let beginTime = null;
let endTime = null; let endTime = null;
const dateNumber = rangePicker.all; const dateNumber = rangePicker.all;
if (dateNumber[0]) { if (dateNumber[0]) {
startTime = dateNumber[0]; beginTime = dateNumber[0];
endTime = dateNumber[1]; endTime = dateNumber[1];
} else { } else {
const now = new Date(); const now = new Date();
now.setHours(0, 0, 0, 0); now.setHours(0, 0, 0, 0);
startTime = `${now.getTime()}`; beginTime = `${now.getTime()}`;
endTime = `${new Date().getTime()}`; endTime = `${new Date().getTime()}`;
} }
getLoad({ getLoad({
type: 'all', type: 'all',
startTime: startTime, beginTime: beginTime,
endTime: endTime, endTime: endTime,
neType: '#', neType: '#',
neId: '#', neId: '#',
@@ -94,7 +94,7 @@ function fnGetList() {
}); });
// 设置初始时间段 // 设置初始时间段
const initRangePicker: [string, string] = [startTime, endTime]; const initRangePicker: [string, string] = [beginTime, endTime];
rangePicker.all = initRangePicker; rangePicker.all = initRangePicker;
rangePicker.load = initRangePicker; rangePicker.load = initRangePicker;
rangePicker.cpu = initRangePicker; rangePicker.cpu = initRangePicker;
@@ -357,11 +357,11 @@ function fnGetQuery(
if (!dateString[0]) { if (!dateString[0]) {
return; return;
} }
const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS); const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
getLoad({ getLoad({
type: type, type: type,
startTime: startTime.getTime(), beginTime: beginTime.getTime(),
endTime: endTime.getTime(), endTime: endTime.getTime(),
neType: '#', neType: '#',
neId: '#', neId: '#',
@@ -385,11 +385,11 @@ function fnGetQueryIO(v: any, dateString: [string, string]) {
if (!v) { if (!v) {
return; return;
} }
const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS); const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
getLoad({ getLoad({
type: 'io', type: 'io',
startTime: startTime.getTime(), beginTime: beginTime.getTime(),
endTime: endTime.getTime(), endTime: endTime.getTime(),
neType: '#', neType: '#',
neId: '#', neId: '#',
@@ -405,11 +405,11 @@ function fnGetQueryNetwork(v: any, dateString: [string, string]) {
if (!v) { if (!v) {
return; return;
} }
const startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS); const beginTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS); const endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
getLoad({ getLoad({
type: 'network', type: 'network',
startTime: startTime.getTime(), beginTime: beginTime.getTime(),
endTime: endTime.getTime(), endTime: endTime.getTime(),
neType: '#', neType: '#',
neId: '#', neId: '#',

View File

@@ -14,7 +14,7 @@ const { t } = useI18n();
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**登录主机 */ /**登录主机 */
ipaddr: '', loginIp: '',
/**登录账号 */ /**登录账号 */
userName: '', userName: '',
}); });
@@ -63,7 +63,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.monitor.online.host'), title: t('views.monitor.online.host'),
dataIndex: 'ipaddr', dataIndex: 'loginIp',
align: 'left', align: 'left',
}, },
// { // {
@@ -129,7 +129,7 @@ function fnTableSize({ key }: MenuInfo) {
/**查询参数重置 */ /**查询参数重置 */
function fnQueryReset() { function fnQueryReset() {
queryParams.ipaddr = ''; queryParams.loginIp = '';
queryParams.userName = ''; queryParams.userName = '';
tablePagination.current = 1; tablePagination.current = 1;
tablePagination.pageSize = 20; tablePagination.pageSize = 20;
@@ -141,8 +141,10 @@ function fnGetList() {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listOnline(queryParams).then(res => { listOnline(queryParams).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tableState.data = res.rows; const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
} }
tableState.loading = false; tableState.loading = false;
}); });
@@ -209,7 +211,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.monitor.online.host')" name="ipaddr"> <a-form-item :label="t('views.monitor.online.host')" name="ipaddr">
<a-input <a-input
v-model:value="queryParams.ipaddr" v-model:value="queryParams.loginIp"
allow-clear allow-clear
:maxlength="128" :maxlength="128"
> >

View File

@@ -51,7 +51,7 @@ function fnGraphGroupChange(value: any) {
function fnGraphDataGroups(reload: boolean = false) { function fnGraphDataGroups(reload: boolean = false) {
getGraphGroups() getGraphGroups()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
graphState.groupOptions = res.data.map(str => { graphState.groupOptions = res.data.map(str => {
return { label: str, value: str }; return { label: str, value: str };
}); });

View File

@@ -245,14 +245,15 @@ function fnGetList(pageNum?: number) {
} }
listNBState(toRaw(queryParams)).then(res => { listNBState(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -277,7 +277,7 @@ function fnGetList() {
return; return;
} }
req.then(res => { req.then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
@@ -656,7 +656,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
useNeInfoStore().neCascaderOptions.forEach(item => { useNeInfoStore().neCascaderOptions.forEach(item => {

View File

@@ -66,7 +66,7 @@ async function fnSelectNeType(_: any, info: any) {
neId: v.neId, neId: v.neId,
paramName: `${treeState.data[0].key}`, paramName: `${treeState.data[0].key}`,
}); });
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
ne.disabled = !res.data.length; ne.disabled = !res.data.length;
} else { } else {
ne.disabled = true; ne.disabled = true;
@@ -227,7 +227,7 @@ async function fnGetNeConfig(neType: string) {
treeState.loading = true; treeState.loading = true;
// 获取数据 // 获取数据
const res = await getAllNeConfig(neType); const res = await getAllNeConfig(neType);
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
const arr = []; const arr = [];
for (const v of res.data) { for (const v of res.data) {
const item = JSON.parse(JSON.stringify(v)); const item = JSON.parse(JSON.stringify(v));
@@ -304,7 +304,7 @@ function fnGetNeConfigData(
// 获取网元端的配置数据 // 获取网元端的配置数据
getNeConfigData({ neType, neId, paramName }).then(res => { getNeConfigData({ neType, neId, paramName }).then(res => {
// 数据处理 // 数据处理
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
const ruleArr: Record<string, any>[] = JSON.parse( const ruleArr: Record<string, any>[] = JSON.parse(
JSON.stringify(param.paramData) JSON.stringify(param.paramData)
); );
@@ -478,12 +478,12 @@ watch(
val => { val => {
// SMF需要选择配置的UPF id // SMF需要选择配置的UPF id
if (val && neTypeSelect.value[0] === 'SMF') { if (val && neTypeSelect.value[0] === 'SMF') {
if (neTypeSelect.value[1].startsWith('SYNC')) { let neId = neTypeSelect.value[1];
smfByUPFIdLoadData(neTypeSelect.value[1]); // 无neId时取首个可连接的
return; if (neId.startsWith('SYNC')) {
} else { neId = neIdSelect.value[0];
smfByUPFIdLoadData(neTypeSelect.value[1]);
} }
smfByUPFIdLoadData(neId);
} }
} }
); );
@@ -537,7 +537,7 @@ const {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
neCascaderOptions.value = neInfoStore.getNeSelectOtions.filter( neCascaderOptions.value = neInfoStore.getNeSelectOtions.filter(

View File

@@ -179,9 +179,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeConfigBackup(toRaw(queryParams)).then(res => { listNeConfigBackup(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -372,7 +373,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
neOtions.value = useNeInfoStore().getNeSelectOtions; neOtions.value = useNeInfoStore().getNeSelectOtions;
} else { } else {
message.warning({ message.warning({

View File

@@ -188,9 +188,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeHost(toRaw(queryParams)).then(res => { listNeHost(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -161,9 +161,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeHostCmd(toRaw(queryParams)).then(res => { listNeHostCmd(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -50,9 +50,9 @@ function backupSearch(name?: string) {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}).then(res => { }).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
importState.backupData = []; importState.backupData = [];
res.rows.forEach((item: any) => { res.data.rows.forEach((item: any) => {
importState.backupData.push({ importState.backupData.push({
label: item.name, label: item.name,
value: item.path, value: item.path,

View File

@@ -364,14 +364,15 @@ function fnGetList(pageNum?: number) {
} }
listNeInfo(toRaw(queryParams)) listNeInfo(toRaw(queryParams))
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tablePagination.total = total;
// 遍历处理资源情况数值 // 遍历处理资源情况数值
tableState.data = res.rows.map(item => { tableState.data = rows.map((item:any) => {
let resouresUsage = { let resouresUsage = {
sysDiskUsage: 0, sysDiskUsage: 0,
sysMemUsage: 0, sysMemUsage: 0,

View File

@@ -186,9 +186,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeLicense(toRaw(queryParams)).then(res => { listNeLicense(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows.filter(s => s.neType !== 'OMC'); tablePagination.total = total;
tableState.data = rows.filter((s:any) => s.neType !== 'OMC');
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -328,7 +329,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
neOtions.value = useNeInfoStore().getNeSelectOtions; neOtions.value = useNeInfoStore().getNeSelectOtions;
} else { } else {
message.warning({ message.warning({

View File

@@ -132,14 +132,14 @@ function fnGetList(pageNum?: number) {
tableState.queryParams.pageNum = pageNum; tableState.queryParams.pageNum = pageNum;
} }
listNeSoftware(toRaw(tableState.queryParams)).then(res => { listNeSoftware(toRaw(tableState.queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
// 遍历处理资源情况数值 tablePagination.total = total;
tableState.data = res.rows; tableState.data = rows;
} }
tableState.loading = false; tableState.loading = false;
}); });

View File

@@ -191,9 +191,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeSoftware(toRaw(queryParams)).then(res => { listNeSoftware(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -342,7 +343,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
neOtions.value = useNeInfoStore().getNeSelectOtions; neOtions.value = useNeInfoStore().getNeSelectOtions;
} else { } else {
message.warning({ message.warning({

View File

@@ -214,13 +214,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeVersion(toRaw(queryParams)).then(res => { listNeVersion(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -442,7 +443,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
neOtions.value = useNeInfoStore().getNeSelectOtions; neOtions.value = useNeInfoStore().getNeSelectOtions;
} else { } else {
message.warning({ message.warning({

View File

@@ -563,13 +563,14 @@ function fnGetList(pageNum?: number) {
tablePagination.current = pageNum; tablePagination.current = pageNum;
} }
listUDMAuth(toRaw(queryParams)).then(res => { listUDMAuth(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -721,12 +722,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'UDM') { if (v.neType === 'UDM') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -4,11 +4,12 @@ import { PageContainer } from 'antdv-pro-layout';
import { TableColumnsType, message } from 'ant-design-vue/es'; import { TableColumnsType, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
import { listBase5G } from '@/api/neUser/base5G';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeInfoStore from '@/store/modules/neinfo'; import useNeInfoStore from '@/store/modules/neinfo';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { listAMFNblist } from '@/api/neData/amf';
import { listMMENblist } from '@/api/neData/mme';
const neInfoStore = useNeInfoStore(); const neInfoStore = useNeInfoStore();
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@@ -152,24 +153,34 @@ function fnGetList(pageNum?: number) {
promises.value = []; promises.value = [];
//同时获取45G基站信息 且在每条信息中添加45G字段(原始数据没有) 已经筛选后的 //同时获取45G基站信息 且在每条信息中添加45G字段(原始数据没有) 已经筛选后的
neCascaderOptions.value.map((item: any) => { neCascaderOptions.value.map((item: any) => {
item.children.forEach((child: any) => { item.children.forEach((child: any) => {
promises.value.push( let resq = null;
listBase5G({ let s = {
neId: child.neId, neId: child.neId,
neType: child.neType, neType: child.neType,
nbId: queryParams.id, nbId: queryParams.id,
pageNum: queryParams.pageNum, pageNum: queryParams.pageNum,
pageSize: 10000, pageSize: 10000,
}).then(res => { };
// 添加 neName 字段到每一项数据 if (child.neType === '5G' || child.neType === 'AMF') {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { resq = listAMFNblist(s);
res.rows.forEach(row => { }
row.neName = `${child.neType}_${child.neId}`; if (child.neType === '4G' || child.neType === 'MME') {
}); resq = listMMENblist(s);
} }
return res; if (resq !== null) {
}) promises.value.push(
); resq.then(res => {
// 添加 neName 字段到每一项数据
if (res.code === RESULT_CODE_SUCCESS) {
res.data.forEach((row: any) => {
row.neName = `${child.neType}_${child.neId}`;
});
}
return res;
})
);
}
}); });
}); });
@@ -212,16 +223,25 @@ function fnGetList(pageNum?: number) {
pageNum: queryParams.pageNum, pageNum: queryParams.pageNum,
pageSize: queryParams.pageSize, pageSize: queryParams.pageSize,
}; };
listBase5G(toRaw(toBack)).then(res => { let resq = null;
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (queryParams.neType[0] === '5G' || queryParams.neType[0] === 'AMF') {
resq = listAMFNblist(toRaw(toBack));
}
if (queryParams.neType[0] === '4G' || queryParams.neType[0] === 'MME') {
resq = listMMENblist(toRaw(toBack));
}
if (resq === null) return;
resq.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total;
tableState.data = res.rows;
res.rows.forEach((item: any) => { tablePagination.total = res.data.length;
tableState.data = res.data;
res.data.forEach((item: any) => {
item.neName = queryParams.neType.join('_'); item.neName = queryParams.neType.join('_');
}); });
@@ -247,7 +267,7 @@ onMounted(() => {
neInfoStore neInfoStore
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
for (const item of neInfoStore.getNeCascaderOptions) { for (const item of neInfoStore.getNeCascaderOptions) {

View File

@@ -9,6 +9,7 @@ import { listUEInfoByIMS } from '@/api/neUser/ims';
import useNeInfoStore from '@/store/modules/neinfo'; import useNeInfoStore from '@/store/modules/neinfo';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { listIMSSessionList } from '@/api/neData/ims';
const { t } = useI18n(); const { t } = useI18n();
/**网元参数 */ /**网元参数 */
@@ -146,14 +147,14 @@ function fnGetList(pageNum?: number) {
if (pageNum) { if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listUEInfoByIMS(toRaw(queryParams)).then(res => { listIMSSessionList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; tablePagination.total = res.data.length;
tableState.data = res.rows; tableState.data = res.data;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -175,12 +176,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'IMS') { if (v.neType === 'IMS') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -92,8 +92,9 @@ function fnGetList() {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listN3iwf(toRaw(queryParams)).then(res => { listN3iwf(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tableState.data = res.rows; const { total, rows } = res.data;
tableState.data = rows;
} else { } else {
tableState.data = []; tableState.data = [];
} }
@@ -106,12 +107,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'N3IWF') { if (v.neType === 'N3IWF') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;
@@ -246,5 +247,4 @@ onMounted(() => {
</PageContainer> </PageContainer>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>

View File

@@ -69,12 +69,13 @@ function fnGetList(pageNum?: number) {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listNSSF().then(res => { listNSSF().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tableState.data = res.rows; const { total, rows } = res.data;
tableState.data = rows;
} else { } else {
tableState.data = []; tableState.data = [];
} }

View File

@@ -58,12 +58,13 @@ function fnGetList(pageNum?: number) {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listNSSFAMF().then(res => { listNSSFAMF().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tableState.data = res.rows; const { total, rows } = res.data;
tableState.data = rows;
} else { } else {
tableState.data = []; tableState.data = [];
} }

View File

@@ -549,12 +549,14 @@ function fnGetList() {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listRules(toRaw(queryParams)).then(res => { listRules(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tableState.data = res.rows; const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
} else { } else {
tableState.data = []; tableState.data = [];
} }
@@ -640,12 +642,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'PCF') { if (v.neType === 'PCF') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -942,14 +942,15 @@ function fnGetList(pageNum?: number) {
tablePagination.current = pageNum; tablePagination.current = pageNum;
} }
listUDMSub(toRaw(queryParams)).then(res => { listUDMSub(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -1115,12 +1116,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'UDM') { if (v.neType === 'UDM') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -225,9 +225,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listSMFSubList(toRaw(queryParams)).then(res => { listSMFSubList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -249,12 +250,12 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
let arr: Record<string, any>[] = []; let arr: Record<string, any>[] = [];
res.data.forEach(i => { res.data.forEach((v: any) => {
if (i.neType === 'SMF') { if (v.neType === 'SMF') {
arr.push({ value: i.neId, label: i.neName }); arr.push({ value: v.neId, label: v.neName });
} }
}); });
neOtions.value = arr; neOtions.value = arr;

View File

@@ -106,6 +106,12 @@ let tableColumns: ColumnsType = [
key: 'status', key: 'status',
align: 'left', align: 'left',
width: 100, width: 100,
customRender: ({ text }) => {
if (text === '1') {
return 'Active';
}
return 'Inactive';
},
}, },
{ {
title: t('common.operate'), title: t('common.operate'),
@@ -190,13 +196,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listCustom(toRaw(queryParams)).then(res => { listCustom(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.data; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
@@ -247,7 +254,7 @@ let modalState: ModalStateType = reactive({
neType: 'UDM', neType: 'UDM',
title: '', title: '',
expression: '', expression: '',
status: 'Active', status: '1',
unit: '', unit: '',
description: '', description: '',
}, },
@@ -316,7 +323,7 @@ function fnSelectPerformanceInit(value: any) {
if (language === 'zh') language = 'cn'; if (language === 'zh') language = 'cn';
// 获取表头文字 // 获取表头文字
getKPITitle(value).then(res => { getKPITitle(value).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
for (const item of res.data) { for (const item of res.data) {
const kpiDisplay = item[`${language}Title`]; const kpiDisplay = item[`${language}Title`];
const kpiValue = item[`kpiId`]; const kpiValue = item[`kpiId`];
@@ -622,12 +629,12 @@ onMounted(() => {
:options="[ :options="[
{ {
label: t('views.perfManage.customTarget.active'), label: t('views.perfManage.customTarget.active'),
value: 'Active', value: '1',
tagType: 'success', tagType: 'success',
}, },
{ {
label: t('views.perfManage.customTarget.inactive'), label: t('views.perfManage.customTarget.inactive'),
value: 'Inactive', value: '0',
tagType: 'error', tagType: 'error',
}, },
]" ]"
@@ -685,11 +692,11 @@ onMounted(() => {
:options="[ :options="[
{ {
label: t('views.perfManage.customTarget.active'), label: t('views.perfManage.customTarget.active'),
value: 'Active', value: '1',
}, },
{ {
label: t('views.perfManage.customTarget.inactive'), label: t('views.perfManage.customTarget.inactive'),
value: 'Inactive', value: '0',
}, },
]" ]"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"

View File

@@ -25,6 +25,7 @@ import {
h, h,
watch, watch,
} from 'vue'; } from 'vue';
import dayjs, { Dayjs } from 'dayjs';
import { PageContainer } from 'antdv-pro-layout'; import { PageContainer } from 'antdv-pro-layout';
import { message, Modal, TableColumnType } from 'ant-design-vue/es'; import { message, Modal, TableColumnType } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
@@ -61,14 +62,6 @@ echarts.use([
UniversalTransition, UniversalTransition,
]); ]);
type EChartsOption = echarts.ComposeOption<
| TooltipComponentOption
| GridComponentOption
| LegendComponentOption
| DataZoomComponentOption
| LineSeriesOption
>;
/**图DOM节点实例对象 */ /**图DOM节点实例对象 */
const kpiChartDom = ref<HTMLElement | undefined>(undefined); const kpiChartDom = ref<HTMLElement | undefined>(undefined);
@@ -78,8 +71,26 @@ const kpiChart = ref<any>(null);
/**网元参数 */ /**网元参数 */
let neCascaderOptions = ref<Record<string, any>[]>([]); let neCascaderOptions = ref<Record<string, any>[]>([]);
/**记录开始结束时间 */ /**开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']); let queryRangePicker = ref<[Dayjs, Dayjs] | undefined>([
dayjs().startOf('hour'),
dayjs().endOf('hour'),
]);
/**时间范围 */
let rangePickerPresets = ref([
{
label: 'Now hour',
value: [dayjs().startOf('hour'), dayjs().endOf('hour')],
},
{ label: 'Today', value: [dayjs().startOf('day'), dayjs().endOf('day')] },
{
label: 'Yesterday',
value: [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
},
]);
/**表格字段列 */ /**表格字段列 */
let tableColumns = ref<any[]>([]); let tableColumns = ref<any[]>([]);
@@ -150,9 +161,9 @@ let queryParams: any = reactive({
/**颗粒度 */ /**颗粒度 */
interval: 900, interval: 900,
/**开始时间 */ /**开始时间 */
startTime: '', beginTime: undefined as undefined | number,
/**结束时间 */ /**结束时间 */
endTime: '', endTime: undefined as undefined | number,
/**排序字段 */ /**排序字段 */
sortField: 'timeGroup', sortField: 'timeGroup',
/**排序方式 */ /**排序方式 */
@@ -314,7 +325,7 @@ function fnGetListTitle() {
getKPITitle(state.neType[0]) getKPITitle(state.neType[0])
.then(res => { .then(res => {
//处理getKPITitle返回的结果 //处理getKPITitle返回的结果
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
//检查值 //检查值
tableColumns.value = []; //设为空数组 tableColumns.value = []; //设为空数组
const columns: any[] = []; //初始化,构建新表头 const columns: any[] = []; //初始化,构建新表头
@@ -374,12 +385,23 @@ function fnGetList() {
tableState.loading = true; tableState.loading = true;
queryParams.neType = state.neType[0]; queryParams.neType = state.neType[0];
queryParams.neId = state.neType[1]; queryParams.neId = state.neType[1];
queryParams.startTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; // 时间范围
if (
Array.isArray(queryRangePicker.value) &&
queryRangePicker.value.length > 0
) {
queryParams.beginTime = queryRangePicker.value[0].valueOf();
queryParams.endTime = queryRangePicker.value[1].valueOf();
} else {
queryParams.beginTime = undefined;
queryParams.endTime = undefined;
}
listKPIData(toRaw(queryParams)) listKPIData(toRaw(queryParams))
.then(res => { .then(res => {
tableState.loading = false; tableState.loading = false;
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.data.length; tablePagination.total = res.data.length;
tableState.data = res.data; tableState.data = res.data;
@@ -804,7 +826,7 @@ onMounted(() => {
// 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF // 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter(
@@ -836,17 +858,6 @@ onMounted(() => {
queryParams.neId = info.neId; queryParams.neId = info.neId;
} }
// 查询当前小时
const now = new Date();
now.setMinutes(0, 0, 0);
// 设置起始时间为整点前一小时
const startTime = new Date(now);
startTime.setHours(now.getHours() - 1);
queryRangePicker.value[0] = `${startTime.getTime()}`;
// 设置结束时间为整点
const endTime = new Date(now);
endTime.setMinutes(59, 59, 59);
queryRangePicker.value[1] = `${endTime.getTime()}`;
fnGetListTitle(); fnGetListTitle();
// 绘图 // 绘图
fnRanderChart(); fnRanderChart();
@@ -892,12 +903,12 @@ onBeforeUnmount(() => {
> >
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
bordered :presets="rangePickerPresets"
:bordered="true"
:allow-clear="false" :allow-clear="false"
style="width: 100%"
:show-time="{ format: 'HH:mm:ss' }" :show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>
</a-col> </a-col>

View File

@@ -329,10 +329,10 @@ function fnGetListTitle() {
if (!state.neType[0]) return false; if (!state.neType[0]) return false;
// 获取表头文字 // 获取表头文字
listCustom({ neType: state.neType[0], status: 'Active' }) listCustom({ neType: state.neType[0], status: '1' })
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length === 0) { if (res.data.rows.length === 0) {
message.error({ message.error({
content: t('views.perfManage.customTarget.kpiIdTip'), content: t('views.perfManage.customTarget.kpiIdTip'),
duration: 2, duration: 2,
@@ -346,7 +346,7 @@ function fnGetListTitle() {
} }
tableColumns.value = []; tableColumns.value = [];
const columns: any[] = []; const columns: any[] = [];
for (const item of res.data) { for (const item of res.data.rows) {
const kpiDisplay = item[`unit`] const kpiDisplay = item[`unit`]
? item[`title`] + `(${item['unit']})` ? item[`title`] + `(${item['unit']})`
: item[`title`]; : item[`title`];
@@ -407,7 +407,7 @@ function fnGetList() {
listCustomData(toRaw(queryParams)) listCustomData(toRaw(queryParams))
.then(res => { .then(res => {
tableState.loading = false; tableState.loading = false;
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.data.length; tablePagination.total = res.data.length;
tableState.data = res.data; tableState.data = res.data;
if (!res.data.length) { if (!res.data.length) {
@@ -834,9 +834,9 @@ watch(
onMounted(() => { onMounted(() => {
// 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF // 目前支持的 AMF AUSF MME MOCNGW NSSF SMF UDM UPF PCF
// 获取网元网元列表 // 获取网元网元列表
listCustom({ status: 'Active' }).then((res: any) => { listCustom({ status: '1' }).then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (!res.data.length) { if (!res.data.rows.length) {
message.warning({ message.warning({
content: '无可用的自定义指标,请先添加自定义指标', content: '无可用的自定义指标,请先添加自定义指标',
duration: 2, duration: 2,
@@ -844,12 +844,12 @@ onMounted(() => {
return false; return false;
} }
let typeArr: any = []; let typeArr: any = [];
res.data.forEach((item: any) => { res.data.rows.forEach((item: any) => {
typeArr.push(item.neType); typeArr.push(item.neType);
}); });
typeArr = Array.from(new Set(typeArr)); typeArr = Array.from(new Set(typeArr));
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter(

View File

@@ -301,14 +301,9 @@ const chartStates: Record<
> = Object.fromEntries( > = Object.fromEntries(
networkElementTypes.value.map(type => [type, createChartState(type)]) networkElementTypes.value.map(type => [type, createChartState(type)])
) as Record<AllChartType, ReturnType<typeof createChartState>>; ) as Record<AllChartType, ReturnType<typeof createChartState>>;
//期择器
interface RangePicker extends Record<AllChartType, [string, string]> {
placeholder: [string, string];
}
// 日期选择器状态 // 日期选择器状态
const rangePicker = reactive<RangePicker>({ const rangePicker = reactive({
...(Object.fromEntries( ...(Object.fromEntries(
networkElementTypes.value.map(type => [ networkElementTypes.value.map(type => [
type, type,
@@ -533,18 +528,18 @@ const fetchData = async (type: AllChartType) => {
try { try {
const dateRange = rangePicker[type] as [string, string]; const dateRange = rangePicker[type] as [string, string];
const [startTime, endTime] = dateRange; const [beginTime, endTime] = dateRange;
const res = await listKPIData({ const res = await listKPIData({
neType: type.toUpperCase(), neType: type.toUpperCase(),
neId: '001', neId: '001',
startTime, beginTime,
endTime, endTime,
sortField: 'timeGroup', sortField: 'timeGroup',
sortOrder: 'desc', sortOrder: 'desc',
interval: 60 * 15, interval: 60 * 15,
}); });
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
state.tableState.data = res.data; state.tableState.data = res.data;
await renderChart(type); await renderChart(type);
} }
@@ -810,7 +805,7 @@ const fetchKPITitle = async (type: AllChartType) => {
: currentLocale.value.split('_')[0]; : currentLocale.value.split('_')[0];
try { try {
const res = await getKPITitle(type.toUpperCase()); const res = await getKPITitle(type.toUpperCase());
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 保存现有的颜色映 // 保存现有的颜色映
const existingColors = new Map(chartStates[type].seriesColors); const existingColors = new Map(chartStates[type].seriesColors);
@@ -827,7 +822,7 @@ const fetchKPITitle = async (type: AllChartType) => {
return dayjs(Number(text)).format('YYYY-MM-DD HH:mm:ss'); return dayjs(Number(text)).format('YYYY-MM-DD HH:mm:ss');
}, },
}, },
...res.data.map(item => { ...res.data.map((item:any) => {
const kpiId = item.kpiId; const kpiId = item.kpiId;
// 如果没有现有的颜色,生成新的颜色 // 如果没有现有的颜色,生成新的颜色
if (!existingColors.has(kpiId)) { if (!existingColors.has(kpiId)) {

View File

@@ -83,9 +83,9 @@ const ranges = ref([
}, },
]); ]);
//日期范围响应式变量 //日期范围响应式变量
const dateRange = ref<[string, string]>([ const dateRange = ref<[Dayjs, Dayjs] | undefined>([
dayjs().subtract(1, 'hour').startOf('hour').valueOf().toString(), // 上一小时开始 dayjs().subtract(1, 'hour').startOf('hour'), // 上一小时开始
dayjs().startOf('hour').add(1, 'hour').valueOf().toString(), // 当前小时结束 dayjs().startOf('hour').add(1, 'hour'), // 当前小时结束
]); ]);
//实时数据状态 //实时数据状态
const isRealtime = ref(false); const isRealtime = ref(false);
@@ -108,10 +108,7 @@ const handleDateChange = (
return; return;
} }
dateRange.value = [ dateRange.value = [dayjs(dateStrings[0]), dayjs(dateStrings[1])];
dayjs(dateStrings[0]).valueOf().toString(),
dayjs(dateStrings[1]).valueOf().toString(),
];
fetchChartData(); fetchChartData();
}; };
@@ -226,8 +223,14 @@ const fetchChartData = async () => {
tableLoading.value = true; tableLoading.value = true;
rangeLoading.value = true; rangeLoading.value = true;
try { try {
const [startTime, endTime] = dateRange.value; let beginTime = 0;
if (!startTime || !endTime) { let endTime = 0;
// 时间范围
if (Array.isArray(dateRange.value) && dateRange.value.length > 0) {
beginTime = dateRange.value[0].valueOf();
endTime = dateRange.value[1].valueOf();
}
if (beginTime == 0 || endTime == 0) {
console.warn('Invalid date range:', dateRange.value); console.warn('Invalid date range:', dateRange.value);
return; return;
} }
@@ -237,8 +240,8 @@ const fetchChartData = async () => {
const params = { const params = {
neType, neType,
neId: '001', neId: '001',
startTime: String(startTime), beginTime: beginTime,
endTime: String(endTime), endTime: endTime,
sortField: 'timeGroup', sortField: 'timeGroup',
sortOrder: 'asc', sortOrder: 'asc',
interval: 60 * 15, interval: 60 * 15,
@@ -247,7 +250,7 @@ const fetchChartData = async () => {
try { try {
const res = await listKPIData(params); const res = await listKPIData(params);
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
return res.data; return res.data;
} }
return []; return [];
@@ -651,8 +654,8 @@ const fetchSpecificKPI = async () => {
for (const neType of ALL_NE_TYPES) { for (const neType of ALL_NE_TYPES) {
const res = await getKPITitle(neType.toUpperCase()); const res = await getKPITitle(neType.toUpperCase());
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
const formattedKPIs = res.data.map(item => ({ const formattedKPIs = res.data.map((item: any) => ({
title: item[`${language}Title`], title: item[`${language}Title`],
dataIndex: item.kpiId, dataIndex: item.kpiId,
key: item.kpiId, key: item.kpiId,

View File

@@ -190,9 +190,10 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listperfData(toRaw(queryParams)).then(res => { listperfData(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
tableState.loading = false; tableState.loading = false;
fnGetList(queryParams.pageNum - 1); fnGetList(queryParams.pageNum - 1);

View File

@@ -189,13 +189,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listPerfThreshold(toRaw(queryParams)).then(res => { listPerfThreshold(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -222,13 +222,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listPerfTask(toRaw(queryParams)).then(res => { listPerfTask(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -445,13 +445,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listConfig(toRaw(queryParams)).then(res => { listConfig(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -36,20 +36,20 @@ let queryParams = reactive({
/**部门名称 */ /**部门名称 */
deptName: '', deptName: '',
/**部门状态 */ /**部门状态 */
status: undefined, statusFlag: undefined,
}); });
/**查询参数重置 */ /**查询参数重置 */
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
deptName: '', deptName: '',
status: undefined, statusFlag: undefined,
}); });
fnGetList(); fnGetList();
} }
/**表格全展开行key */ /**表格全展开行key */
let expandedRowKeys: string[] = []; let expandedRowKeys: number[] = [];
/**表格状态类型 */ /**表格状态类型 */
type TabeStateType = { type TabeStateType = {
@@ -93,15 +93,15 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.dept.classSort'), title: t('views.system.dept.classSort'),
dataIndex: 'orderNum', dataIndex: 'deptSort',
align: 'left', align: 'left',
width: 200, width: 200,
}, },
{ {
title: t('views.system.dept.status'), title: t('views.system.dept.status'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'left',
width: 150, width: 150,
}, },
{ {
@@ -165,12 +165,12 @@ let modalState: ModalStateType = reactive({
deptName: '', deptName: '',
email: '', email: '',
leader: '', leader: '',
orderNum: 0, deptSort: 0,
parentId: '100', parentId: '100',
ancestors: '', ancestors: '',
parentName: null, parentName: null,
phone: '', phone: '',
status: '0', statusFlag: '0',
}, },
confirmLoading: false, confirmLoading: false,
treeData: [], treeData: [],
@@ -386,14 +386,15 @@ function fnGetList() {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listDept(toRaw(queryParams)).then(res => { listDept(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
const treeData = parseDataToTree(res.data, 'deptId'); const treeData = parseDataToTree(res.data, 'deptId');
// 初始上级部门和展开编号key // 初始上级部门和展开编号key
if (treeDataAll.length <= 0) { if (treeDataAll.length <= 0) {
// 转换树状数据 // 转换树状数据
treeDataAll = treeData; treeDataAll = treeData;
// 展开编号key // 展开编号key
expandedRowKeys = [...new Set(res.data.map(item => item.parentId))]; const parentIds: number[] = res.data.map((item: any) => item.parentId);
expandedRowKeys = [...new Set(parentIds)];
fnTableExpandedRowsAll(tableState.expandedRowAll); fnTableExpandedRowsAll(tableState.expandedRowAll);
} }
tableState.data = treeData; tableState.data = treeData;
@@ -436,9 +437,12 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.system.dept.status')" name="status"> <a-form-item
:label="t('views.system.dept.status')"
name="statusFlag"
>
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -547,8 +551,11 @@ onMounted(() => {
@expandedRowsChange="fnTableExpandedRowsChange" @expandedRowsChange="fnTableExpandedRowsChange"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" /> <DictTag
:options="dict.sysNormalDisable"
:value="record.statusFlag"
/>
</template> </template>
<template v-if="column.key === 'deptId'"> <template v-if="column.key === 'deptId'">
<a-space :size="8" align="center"> <a-space :size="8" align="center">
@@ -582,7 +589,7 @@ onMounted(() => {
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip placement="topRight" v-if="record.status !== '0'"> <a-tooltip placement="topRight" v-if="record.statusFlag !== '0'">
<template #title>{{ <template #title>{{
t('views.system.dept.addClass') t('views.system.dept.addClass')
}}</template> }}</template>
@@ -643,19 +650,22 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dept.classSort')" :label="t('views.system.dept.classSort')"
name="orderNum" name="deptSort"
> >
{{ modalState.from.orderNum }} {{ modalState.from.deptSort }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.dept.status')" name="status"> <a-form-item
:label="t('views.system.dept.status')"
name="statusFlag"
>
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -755,9 +765,12 @@ onMounted(() => {
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.dept.status')" name="status"> <a-form-item
:label="t('views.system.dept.status')"
name="statusFlag"
>
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -767,10 +780,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dept.classSort')" :label="t('views.system.dept.classSort')"
name="orderNum" name="deptSort"
> >
<a-input-number <a-input-number
v-model:value="modalState.from.orderNum" v-model:value="modalState.from.deptSort"
:min="0" :min="0"
:max="9999" :max="9999"
:step="1" :step="1"

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { getLocalColor, changePrimaryColor } from '@/hooks/useTheme';
import { reactive, ref, onMounted, toRaw } from 'vue'; import { reactive, ref, onMounted, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout'; import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal'; import { ProModal } from 'antdv-pro-modal';
@@ -16,7 +15,7 @@ import {
addData, addData,
updateData, updateData,
} from '@/api/system/dict/data'; } from '@/api/system/dict/data';
import { getDictOptionselect, getType } from '@/api/system/dict/type'; import { getDictOption, getType } from '@/api/system/dict/type';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useTabsStore from '@/store/modules/tabs'; import useTabsStore from '@/store/modules/tabs';
@@ -34,18 +33,6 @@ const dictId = route.params && (route.params.dictId as string);
const zh = currentLocale.value === 'zh_CN'; const zh = currentLocale.value === 'zh_CN';
let color = ref<string>(getLocalColor());
/**改变主题色 */
function fnColorChange(e: Event) {
const target = e.target as HTMLInputElement;
if (target.nodeName === 'INPUT') {
changePrimaryColor(target.value ?? '#1890ff');
} else {
changePrimaryColor();
}
color.value = getLocalColor();
}
/**标签类型数据固定项 */ /**标签类型数据固定项 */
const tagTypeOptions = ref([ const tagTypeOptions = ref([
{ value: '', label: zh ? '普通文本' : 'Plain text' }, { value: '', label: zh ? '普通文本' : 'Plain text' },
@@ -85,9 +72,9 @@ let queryParams = reactive({
/**字典名称 */ /**字典名称 */
dictType: '', dictType: '',
/**数据标签 */ /**数据标签 */
dictLabel: '', dataLabel: '',
/**数据状态 */ /**数据状态 */
status: undefined, statusFlag: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -98,16 +85,16 @@ let queryParams = reactive({
function fnQueryReset() { function fnQueryReset() {
if (dictId && dictId !== '0') { if (dictId && dictId !== '0') {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
dictLabel: '', dataLabel: '',
status: undefined, statusFlag: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
} else { } else {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
dictType: '', dictType: '',
dictLabel: '', dataLabel: '',
status: undefined, statusFlag: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
@@ -143,33 +130,33 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */ /**表格字段列 */
let tableColumns: ColumnsType = [ let tableColumns: ColumnsType = [
{ {
title: t('views.system.dictData.dictCode'), title: t('views.system.dictData.dataId'),
dataIndex: 'dictCode', dataIndex: 'dataId',
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{ {
title: t('views.system.dictData.dictLabel'), title: t('views.system.dictData.dataLabel'),
dataIndex: 'dictLabel', dataIndex: 'dataLabel',
align: 'left', align: 'left',
width: 200, width: 200,
}, },
{ {
title: t('views.system.dictData.dictValue'), title: t('views.system.dictData.dataValue'),
dataIndex: 'dictValue', dataIndex: 'dataValue',
align: 'left', align: 'left',
width: 200, width: 200,
}, },
{ {
title: t('views.system.dictData.dictSort'), title: t('views.system.dictData.dataSort'),
dataIndex: 'dictSort', dataIndex: 'dataSort',
align: 'left', align: 'left',
width: 100, width: 100,
}, },
{ {
title: t('views.system.dictData.status'), title: t('views.system.dictData.statusFlag'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'left', align: 'left',
width: 100, width: 100,
}, },
@@ -185,7 +172,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'dictCode', key: 'dataId',
align: 'left', align: 'left',
}, },
]; ];
@@ -249,15 +236,15 @@ let modalState: ModalStateType = reactive({
openByEdit: false, openByEdit: false,
title: '字典数据', title: '字典数据',
from: { from: {
dictCode: undefined, dataId: undefined,
dictLabel: '', dataLabel: '',
dictSort: 0, dataSort: 0,
dictType: 'sys_oper_type', dictType: 'sys_oper_type',
dictValue: '', dataValue: '',
tagClass: '', tagClass: '',
tagType: '', tagType: '',
remark: '', remark: '',
status: '0', statusFlag: '0',
createTime: 0, createTime: 0,
createBy: undefined, createBy: undefined,
}, },
@@ -268,20 +255,26 @@ let modalState: ModalStateType = reactive({
const modalStateFrom = Form.useForm( const modalStateFrom = Form.useForm(
modalState.from, modalState.from,
reactive({ reactive({
dictLabel: [ dictType: [
{ {
required: true, required: true,
min: 1, message: t('common.selectPlease'),
max: 50,
message: t('views.system.dictData.dictLabelPleac'),
}, },
], ],
dictValue: [ dataLabel: [
{ {
required: true, required: true,
min: 1, min: 1,
max: 50, max: 50,
message: t('views.system.dictData.dictValuePleac'), message: t('views.system.dictData.dataLabelPleac'),
},
],
dataValue: [
{
required: true,
min: 1,
max: 50,
message: t('views.system.dictData.dataValuePleac'),
}, },
], ],
}) })
@@ -299,10 +292,10 @@ function fnModalVisibleByVive(row: Record<string, string>) {
/** /**
* 对话框弹出显示为 新增或者修改 * 对话框弹出显示为 新增或者修改
* @param dictCode 数据编号id, 不传为新增 * @param dataId 数据编号id, 不传为新增
*/ */
function fnModalVisibleByEdit(dictCode?: string | number, record?: any) { function fnModalVisibleByEdit(dataId?: string | number, record?: any) {
if (!dictCode) { if (!dataId) {
modalStateFrom.resetFields(); modalStateFrom.resetFields();
modalState.from.dictType = queryParams.dictType; modalState.from.dictType = queryParams.dictType;
modalState.title = t('views.system.dictData.addInfo'); modalState.title = t('views.system.dictData.addInfo');
@@ -311,7 +304,7 @@ function fnModalVisibleByEdit(dictCode?: string | number, record?: any) {
if (modalState.confirmLoading) return; if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
getData(dictCode).then(res => { getData(dataId).then(res => {
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
@@ -335,7 +328,7 @@ function fnModalOk() {
.then(() => { .then(() => {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const from = toRaw(modalState.from); const from = toRaw(modalState.from);
const dictData = from.dictCode ? updateData(from) : addData(from); const dictData = from.dataId ? updateData(from) : addData(from);
const key = 'dictData'; const key = 'dictData';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
dictData dictData
@@ -378,19 +371,19 @@ function fnModalCancel() {
/** /**
* 字典删除 * 字典删除
* @param dictCode 字典代码 * @param dataId 字典代码
*/ */
function fnRecordDelete(dictCode: string = '0') { function fnRecordDelete(dataId: string = '0') {
if (dictCode === '0') { if (dataId === '0') {
dictCode = tableState.selectedRowKeys.join(','); dataId = tableState.selectedRowKeys.join(',');
} }
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.system.dictData.delTip', { txt: dictCode }), content: t('views.system.dictData.delTip', { txt: dataId }),
onOk() { onOk() {
const key = 'delData'; const key = 'delData';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
delData(dictCode).then(res => { delData(dataId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: t('views.system.dictData.delOk'), content: t('views.system.dictData.delOk'),
@@ -456,13 +449,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listData(toRaw(queryParams)).then(res => { listData(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -478,20 +472,19 @@ function fnGetList(pageNum?: number) {
onMounted(() => { onMounted(() => {
// 初始字典数据 // 初始字典数据
Promise.allSettled([ Promise.allSettled([getDict('sys_normal_disable'), getDictOption()]).then(
getDict('sys_normal_disable'), resArr => {
getDictOptionselect(), if (resArr[0].status === 'fulfilled') {
]).then(resArr => { dict.sysNormalDisable = resArr[0].value;
if (resArr[0].status === 'fulfilled') { }
dict.sysNormalDisable = resArr[0].value; if (resArr[1].status === 'fulfilled') {
} const dicts = resArr[1].value;
if (resArr[1].status === 'fulfilled') { if (dicts.code === RESULT_CODE_SUCCESS) {
const dicts = resArr[1].value; dict.sysDictType = dicts.data;
if (dicts.code === RESULT_CODE_SUCCESS) { }
dict.sysDictType = dicts.data;
} }
} }
}); );
// 指定字典id列表数据 // 指定字典id列表数据
if (dictId && dictId !== '0') { if (dictId && dictId !== '0') {
getType(dictId).then(res => { getType(dictId).then(res => {
@@ -535,11 +528,11 @@ onMounted(() => {
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictLabel')" :label="t('views.system.dictData.dataLabel')"
name="dictLabel" name="dataLabel"
> >
<a-input <a-input
v-model:value="queryParams.dictLabel" v-model:value="queryParams.dataLabel"
allow-clear allow-clear
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
></a-input> ></a-input>
@@ -547,11 +540,11 @@ onMounted(() => {
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.status')" :label="t('views.system.dictData.statusFlag')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
@@ -662,7 +655,7 @@ onMounted(() => {
<!-- 表格列表 --> <!-- 表格列表 -->
<a-table <a-table
class="table" class="table"
row-key="dictCode" row-key="dataId"
:columns="tableColumns" :columns="tableColumns"
:loading="tableState.loading" :loading="tableState.loading"
:data-source="tableState.data" :data-source="tableState.data"
@@ -676,10 +669,13 @@ onMounted(() => {
}" }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" /> <DictTag
:options="dict.sysNormalDisable"
:value="record.statusFlag"
/>
</template> </template>
<template v-if="column.key === 'dictCode'"> <template v-if="column.key === 'dataId'">
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.viewText') }}</template> <template #title>{{ t('common.viewText') }}</template>
@@ -695,7 +691,7 @@ onMounted(() => {
<template #title>{{ t('common.editText') }}</template> <template #title>{{ t('common.editText') }}</template>
<a-button <a-button
type="link" type="link"
@click.prevent="fnModalVisibleByEdit(record.dictCode, record)" @click.prevent="fnModalVisibleByEdit(record.dataId, record)"
v-perms:has="['system:dict:edit']" v-perms:has="['system:dict:edit']"
> >
<template #icon><FormOutlined /></template> <template #icon><FormOutlined /></template>
@@ -705,7 +701,7 @@ onMounted(() => {
<template #title>{{ t('common.deleteText') }}</template> <template #title>{{ t('common.deleteText') }}</template>
<a-button <a-button
type="link" type="link"
@click.prevent="fnRecordDelete(record.dictCode)" @click.prevent="fnRecordDelete(record.dataId)"
v-perms:has="['system:dict:remove']" v-perms:has="['system:dict:remove']"
> >
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
@@ -753,20 +749,20 @@ onMounted(() => {
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictCode')" :label="t('views.system.dictData.dataId')"
name="dictCode" name="dataId"
> >
{{ modalState.from.dictCode }} {{ modalState.from.dataId }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.status')" :label="t('views.system.dictData.statusFlag')"
name="status" name="statusFlag"
> >
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -774,18 +770,18 @@ onMounted(() => {
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictLabel')" :label="t('views.system.dictData.dataLabel')"
name="dictLabel" name="dataLabel"
> >
{{ modalState.from.dictLabel }} {{ modalState.from.dataLabel }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictValue')" :label="t('views.system.dictData.dataValue')"
name="dictValue" name="dataValue"
> >
{{ modalState.from.dictValue }} {{ modalState.from.dataValue }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -818,16 +814,16 @@ onMounted(() => {
> >
<DictTag <DictTag
:options="parseDataDict(modalState.from)" :options="parseDataDict(modalState.from)"
:value="modalState.from.dictValue" :value="modalState.from.dataValue"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictSort')" :label="t('views.system.dictData.dataSort')"
name="dictSort" name="dataSort"
> >
{{ modalState.from.dictSort }} {{ modalState.from.dataSort }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -875,24 +871,25 @@ onMounted(() => {
<a-form-item <a-form-item
:label="t('views.system.dictData.dictType')" :label="t('views.system.dictData.dictType')"
name="dictType" name="dictType"
v-bind="modalStateFrom.validateInfos.dictType"
> >
<a-select <a-select
v-model:value="modalState.from.dictType" v-model:value="modalState.from.dictType"
default-value="sys_oper_type" default-value="sys_oper_type"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
:options="dict.sysDictType" :options="dict.sysDictType"
:disabled="true" :disabled="dictId !== '0'"
> >
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.status')" :label="t('views.system.dictData.statusFlag')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
@@ -904,27 +901,27 @@ onMounted(() => {
<a-row> <a-row>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictLabel')" :label="t('views.system.dictData.dataLabel')"
name="dictLabel" name="dataLabel"
v-bind="modalStateFrom.validateInfos.dictLabel" v-bind="modalStateFrom.validateInfos.dataLabel"
> >
<a-input <a-input
v-model:value="modalState.from.dictLabel" v-model:value="modalState.from.dataLabel"
allow-clear allow-clear
:placeholder="t('views.system.dictData.dictLabelPleac')" :placeholder="t('views.system.dictData.dataLabelPleac')"
></a-input> ></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictValue')" :label="t('views.system.dictData.dataValue')"
name="dictValue" name="dataValue"
v-bind="modalStateFrom.validateInfos.dictValue" v-bind="modalStateFrom.validateInfos.dataValue"
> >
<a-input <a-input
v-model:value="modalState.from.dictValue" v-model:value="modalState.from.dataValue"
allow-clear allow-clear
:placeholder="t('views.system.dictData.dictValuePleac')" :placeholder="t('views.system.dictData.dataValuePleac')"
></a-input> ></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -965,11 +962,11 @@ onMounted(() => {
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dictData.dictSort')" :label="t('views.system.dictData.dataSort')"
name="dictSort" name="dataSort"
> >
<a-input-number <a-input-number
v-model:value="modalState.from.dictSort" v-model:value="modalState.from.dataSort"
:min="0" :min="0"
:max="65535" :max="65535"
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"

View File

@@ -46,7 +46,7 @@ let queryParams = reactive({
/**字典类型 */ /**字典类型 */
dictType: '', dictType: '',
/**字典状态 */ /**字典状态 */
status: undefined, statusFlag: undefined,
/**记录开始时间 */ /**记录开始时间 */
beginTime: '', beginTime: '',
/**记录结束时间 */ /**记录结束时间 */
@@ -62,7 +62,7 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
dictName: '', dictName: '',
dictType: '', dictType: '',
status: undefined, statusFlag: undefined,
beginTime: '', beginTime: '',
endTime: '', endTime: '',
pageNum: 1, pageNum: 1,
@@ -119,8 +119,8 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.dict.dictSatus'), title: t('views.system.dict.dictSatus'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'center',
width: 100, width: 100,
}, },
@@ -202,7 +202,7 @@ let modalState: ModalStateType = reactive({
dictId: undefined, dictId: undefined,
dictName: '', dictName: '',
dictType: undefined, dictType: undefined,
status: '0', statusFlag: '0',
remark: undefined, remark: undefined,
}, },
confirmLoading: false, confirmLoading: false,
@@ -446,13 +446,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listType(toRaw(queryParams)).then(res => { listType(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -513,10 +514,10 @@ onMounted(() => {
<a-col :lg="4" :md="12" :xs="24"> <a-col :lg="4" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dict.dictSatus')" :label="t('views.system.dict.dictSatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -669,8 +670,8 @@ onMounted(() => {
}" }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" /> <DictTag :options="dict.sysNormalDisable" :value="record.statusFlag" />
</template> </template>
<template v-if="column.key === 'dictId'"> <template v-if="column.key === 'dictId'">
<a-space :size="8" align="center"> <a-space :size="8" align="center">
@@ -740,10 +741,10 @@ onMounted(() => {
<a-form-item :label="t('views.system.dict.dictType')" name="dictType"> <a-form-item :label="t('views.system.dict.dictType')" name="dictType">
{{ modalState.from.dictType }} {{ modalState.from.dictType }}
</a-form-item> </a-form-item>
<a-form-item :label="t('views.system.dict.dictSatus')" name="status"> <a-form-item :label="t('views.system.dict.dictSatus')" name="statusFlag">
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
<a-form-item :label="t('views.system.dict.mark')" name="remark"> <a-form-item :label="t('views.system.dict.mark')" name="remark">
@@ -800,9 +801,9 @@ onMounted(() => {
allow-clear allow-clear
></a-input> ></a-input>
</a-form-item> </a-form-item>
<a-form-item :label="t('views.system.dict.dictSatus')" name="status"> <a-form-item :label="t('views.system.dict.dictSatus')" name="statusFlag">
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >

View File

@@ -34,11 +34,11 @@ let queryRangePicker = ref<[string, string]>(['', '']);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**登录地址 */ /**登录地址 */
ipaddr: '', loginIp: '',
/**登录账号 */ /**登录账号 */
userName: '', userName: '',
/**登录状态 */ /**登录状态 */
status: undefined, statusFlag: undefined,
/**开始时间 */ /**开始时间 */
beginTime: '', beginTime: '',
/**结束时间 */ /**结束时间 */
@@ -52,9 +52,9 @@ let queryParams = reactive({
/**查询参数重置 */ /**查询参数重置 */
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
ipaddr: '', loginIp: '',
userName: '', userName: '',
status: undefined, statusFlag: undefined,
beginTime: '', beginTime: '',
endTime: '', endTime: '',
pageNum: 1, pageNum: 1,
@@ -96,7 +96,7 @@ let tableState: TabeStateType = reactive({
let tableColumns: ColumnsType = [ let tableColumns: ColumnsType = [
{ {
title: t('views.system.log.login.operId'), title: t('views.system.log.login.operId'),
dataIndex: 'loginId', dataIndex: 'id',
align: 'left', align: 'left',
width: 100, width: 100,
}, },
@@ -108,7 +108,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.log.login.loginIp'), title: t('views.system.log.login.loginIp'),
dataIndex: 'ipaddr', dataIndex: 'loginIp',
align: 'left', align: 'left',
width: 150, width: 150,
}, },
@@ -132,8 +132,8 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.log.login.status'), title: t('views.system.log.login.status'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'center',
width: 100, width: 100,
}, },
@@ -193,7 +193,7 @@ function fnTableSelectedRows(
_: (string | number)[], _: (string | number)[],
rows: Record<string, string>[] rows: Record<string, string>[]
) { ) {
tableState.selectedRowKeys = rows.map(item => item.loginId); tableState.selectedRowKeys = rows.map(item => item.id);
// 针对单个登录账号解锁 // 针对单个登录账号解锁
if (rows.length === 1) { if (rows.length === 1) {
tableState.selectedUserName = rows[0].userName; tableState.selectedUserName = rows[0].userName;
@@ -332,13 +332,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listSysLogLogin(toRaw(queryParams)).then(res => { listSysLogLogin(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
} }
tableState.loading = false; tableState.loading = false;
}); });
@@ -369,10 +370,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.login.loginIp')" :label="t('views.system.log.login.loginIp')"
name="ipaddr" name="loginIp"
> >
<a-input <a-input
v-model:value="queryParams.ipaddr" v-model:value="queryParams.loginIp"
allow-clear allow-clear
:maxlength="128" :maxlength="128"
></a-input> ></a-input>
@@ -393,10 +394,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.login.status')" :label="t('views.system.log.login.status')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysCommonStatus" :options="dict.sysCommonStatus"
> >
@@ -528,7 +529,7 @@ onMounted(() => {
<!-- 表格列表 --> <!-- 表格列表 -->
<a-table <a-table
class="table" class="table"
row-key="loginId" row-key="id"
:columns="tableColumns" :columns="tableColumns"
:loading="tableState.loading" :loading="tableState.loading"
:data-source="tableState.data" :data-source="tableState.data"
@@ -542,8 +543,8 @@ onMounted(() => {
}" }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysCommonStatus" :value="record.status" /> <DictTag :options="dict.sysCommonStatus" :value="record.statusFlag" />
</template> </template>
</template> </template>
</a-table> </a-table>

View File

@@ -39,11 +39,11 @@ let queryParams = reactive({
/**操作模块 */ /**操作模块 */
title: '', title: '',
/**操作人员 */ /**操作人员 */
operName: '', operaBy: '',
/**业务类型 */ /**业务类型 */
businessType: undefined, businessType: undefined,
/**操作状态 */ /**操作状态 */
status: undefined, statusFlag: undefined,
/**开始时间 */ /**开始时间 */
beginTime: '', beginTime: '',
/**结束时间 */ /**结束时间 */
@@ -58,9 +58,9 @@ let queryParams = reactive({
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
title: '', title: '',
operName: '', operaBy: '',
businessType: undefined, businessType: undefined,
status: undefined, statusFlag: undefined,
beginTime: '', beginTime: '',
endTime: '', endTime: '',
pageNum: 1, pageNum: 1,
@@ -99,8 +99,8 @@ let tableState: TabeStateType = reactive({
let tableColumns: ColumnsType = [ let tableColumns: ColumnsType = [
{ {
title: t('views.system.log.operate.operId'), title: t('views.system.log.operate.operId'),
dataIndex: 'operId', dataIndex: 'id',
align: 'center', align: 'left',
width: 100, width: 100,
}, },
{ {
@@ -118,33 +118,33 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.log.operate.operUser'), title: t('views.system.log.operate.operUser'),
dataIndex: 'operName', dataIndex: 'operaBy',
align: 'left', align: 'left',
width: 120, width: 120,
}, },
// { // {
// title: t('views.system.log.operate.requestMe'), // title: t('views.system.log.operate.requestMe'),
// dataIndex: 'requestMethod', // dataIndex: 'operaUrlMethod',
// align: 'left', // align: 'left',
// width: 150, // width: 150,
// }, // },
{ {
title: t('views.system.log.operate.host'), title: t('views.system.log.operate.host'),
dataIndex: 'operIp', dataIndex: 'operaIp',
align: 'center', align: 'left',
width: 150, width: 150,
}, },
{ {
title: t('views.system.log.operate.operStatus'), title: t('views.system.log.operate.operStatus'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'left',
width: 150, width: 150,
}, },
{ {
title: t('views.system.log.operate.operDate'), title: t('views.system.log.operate.operDate'),
dataIndex: 'operTime', dataIndex: 'operaTime',
align: 'center', align: 'left',
width: 150, width: 150,
customRender(opt) { customRender(opt) {
if (+opt.value <= 0) return ''; if (+opt.value <= 0) return '';
@@ -163,7 +163,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'operId', key: 'id',
align: 'left', align: 'left',
}, },
]; ];
@@ -221,20 +221,19 @@ let modalState: ModalStateType = reactive({
openByView: false, openByView: false,
title: '操作日志', title: '操作日志',
from: { from: {
operId: undefined, id: undefined,
businessType: 0, businessType: 0,
deptName: '', deptName: '',
method: '', operaMethod: '',
operIp: '', operaIp: '',
operLocation: '', operaLocation: '',
operMsg: '', operaMsg: '',
operName: '', operaBy: '',
operParam: '', operaParam: '',
operTime: 0, operaTime: 0,
operUrl: '', operaUrl: '',
operType: 1, operaUrlMethod: 'PUT',
requestMethod: 'PUT', statusFlag: 1,
status: 1,
title: '', title: '',
}, },
}); });
@@ -356,13 +355,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listSysLogOperate(toRaw(queryParams)).then(res => { listSysLogOperate(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -415,10 +415,10 @@ onMounted(() => {
<a-col :lg="8" :md="12" :xs="24"> <a-col :lg="8" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.operUser')" :label="t('views.system.log.operate.operUser')"
name="operName" name="operaBy"
> >
<a-input <a-input
v-model:value="queryParams.operName" v-model:value="queryParams.operaBy"
allow-clear allow-clear
></a-input> ></a-input>
</a-form-item> </a-form-item>
@@ -439,10 +439,10 @@ onMounted(() => {
<a-col :lg="8" :md="12" :xs="24"> <a-col :lg="8" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.operStatus')" :label="t('views.system.log.operate.operStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysCommonStatus" :options="dict.sysCommonStatus"
> >
@@ -565,7 +565,7 @@ onMounted(() => {
<!-- 表格列表 --> <!-- 表格列表 -->
<a-table <a-table
class="table" class="table"
row-key="operId" row-key="id"
:columns="tableColumns" :columns="tableColumns"
:loading="tableState.loading" :loading="tableState.loading"
:data-source="tableState.data" :data-source="tableState.data"
@@ -585,10 +585,13 @@ onMounted(() => {
:value="record.businessType" :value="record.businessType"
/> />
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysCommonStatus" :value="record.status" /> <DictTag
:options="dict.sysCommonStatus"
:value="record.statusFlag"
/>
</template> </template>
<template v-if="column.key === 'operId'"> <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.viewText') }}</template> <template #title>{{ t('common.viewText') }}</template>
@@ -619,22 +622,22 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.operId')" :label="t('views.system.log.operate.operId')"
name="operId" name="id"
> >
{{ modalState.from.operId }} {{ modalState.from.id }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.operStatus')" :label="t('views.system.log.operate.operStatus')"
name="status" name="statusFlag"
> >
<a-tag :color="+modalState.from.status ? 'success' : 'error'"> <a-tag :color="+modalState.from.statusFlag ? 'success' : 'error'">
{{ {{
[ [
t('views.system.log.operate.fail'), t('views.system.log.operate.fail'),
t('views.system.log.operate.suss'), t('views.system.log.operate.suss'),
][+modalState.from.status] ][+modalState.from.statusFlag]
}} }}
</a-tag> </a-tag>
</a-form-item> </a-form-item>
@@ -656,9 +659,9 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.operUser')" :label="t('views.system.log.operate.operUser')"
name="operName" name="operaBy"
> >
{{ modalState.from.operName }} / {{ modalState.from.operIp }} {{ modalState.from.operaBy }} / {{ modalState.from.operaIp }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -666,19 +669,19 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.RequestIp')" :label="t('views.system.log.operate.RequestIp')"
name="operUrl" name="operaUrl"
> >
{{ modalState.from.requestMethod }} - {{ modalState.from.operaUrlMethod }} -
{{ modalState.from.operUrl }} {{ modalState.from.operaUrl }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.log.operate.operTime')" :label="t('views.system.log.operate.operTime')"
name="operTime" name="operaTime"
> >
<span v-if="+modalState.from.operTime > 0"> <span v-if="+modalState.from.operaTime > 0">
{{ parseDateToStr(+modalState.from.operTime) }} {{ parseDateToStr(+modalState.from.operaTime) }}
</span> </span>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -695,32 +698,32 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<!-- <a-form-item <!-- <a-form-item
:label="t('views.system.log.operate.operMe')" :label="t('views.system.log.operate.operMe')"
name="method" name="operaMethod"
> >
{{ modalState.from.method }} {{ modalState.from.operaMethod }}
</a-form-item> --> </a-form-item> -->
</a-col> </a-col>
</a-row> </a-row>
<a-form-item <a-form-item
:label="t('views.system.log.operate.reqParam')" :label="t('views.system.log.operate.reqParam')"
name="operParam" name="operaParam"
:label-col="{ span: 3 }" :label-col="{ span: 3 }"
:label-wrap="true" :label-wrap="true"
> >
<a-textarea <a-textarea
v-model:value="modalState.from.operParam" v-model:value="modalState.from.operaParam"
:auto-size="{ minRows: 2, maxRows: 6 }" :auto-size="{ minRows: 2, maxRows: 6 }"
:disabled="true" :disabled="true"
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="t('views.system.log.operate.operInfo')" :label="t('views.system.log.operate.operInfo')"
name="operMsg" name="operaMsg"
:label-col="{ span: 3 }" :label-col="{ span: 3 }"
:label-wrap="true" :label-wrap="true"
> >
<a-textarea <a-textarea
v-model:value="modalState.from.operMsg" v-model:value="modalState.from.operaMsg"
:auto-size="{ minRows: 2, maxRows: 6 }" :auto-size="{ minRows: 2, maxRows: 6 }"
:disabled="true" :disabled="true"
/> />

View File

@@ -61,14 +61,14 @@ let queryParams = reactive({
/**菜单名称 */ /**菜单名称 */
menuName: undefined, menuName: undefined,
/**状态 */ /**状态 */
status: undefined, statusFlag: undefined,
}); });
/**查询参数重置 */ /**查询参数重置 */
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
menuName: '', menuName: '',
status: undefined, statusFlag: undefined,
}); });
fnGetList(); fnGetList();
} }
@@ -126,7 +126,7 @@ let tableColumns: ColumnsType = [
title: t('views.system.menu.menuTitle'), title: t('views.system.menu.menuTitle'),
dataIndex: 'icon', dataIndex: 'icon',
key: 'icon', key: 'icon',
align: 'center', align: 'left',
width: 100, width: 100,
}, },
{ {
@@ -143,22 +143,22 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.menu.status'), title: t('views.system.menu.status'),
dataIndex: 'visible', dataIndex: 'visibleFlag',
key: 'visible', key: 'visibleFlag',
align: 'center', align: 'center',
width: 120, width: 120,
}, },
{ {
title: t('views.system.menu.menuStatus'), title: t('views.system.menu.menuStatus'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'center',
width: 120, width: 120,
}, },
{ {
title: t('views.system.menu.createTime'), title: t('views.system.menu.createTime'),
dataIndex: 'createTime', dataIndex: 'createTime',
align: 'center', align: 'left',
width: 150, width: 150,
customRender(opt) { customRender(opt) {
if (+opt.value <= 0) return ''; if (+opt.value <= 0) return '';
@@ -239,13 +239,13 @@ let modalState: ModalStateType = reactive({
menuSort: 0, menuSort: 0,
menuType: MENU_TYPE_BUTTON, menuType: MENU_TYPE_BUTTON,
component: '', component: '',
path: '', menuPath: '',
icon: '#', icon: '#',
perms: '', perms: '',
isFrame: '1', frameFlag: '1',
isCache: '0', cacheFlag: '0',
visible: '0', visibleFlag: '0',
status: '0', statusFlag: '0',
createTime: 0, createTime: 0,
remark: '', remark: '',
parentType: '', // 标记禁止菜单类型添加目录和菜单 parentType: '', // 标记禁止菜单类型添加目录和菜单
@@ -280,7 +280,7 @@ const modalStateFrom = Form.useForm(
message: t('views.system.menu.formLoc') + t('common.unableNull'), message: t('views.system.menu.formLoc') + t('common.unableNull'),
}, },
], ],
path: [ menuPath: [
{ {
required: true, required: true,
min: 1, min: 1,
@@ -370,11 +370,11 @@ function fnModalVisibleByEdit(
function fnModalOk() { function fnModalOk() {
let validateNames = ['parentId', 'menuName']; let validateNames = ['parentId', 'menuName'];
if (modalState.from.menuType === MENU_TYPE_DIR) { if (modalState.from.menuType === MENU_TYPE_DIR) {
validateNames.push('path'); validateNames.push('menuPath');
} }
if (modalState.from.menuType === MENU_TYPE_MENU) { if (modalState.from.menuType === MENU_TYPE_MENU) {
validateNames.push('component'); validateNames.push('component');
validateNames.push('path'); validateNames.push('menuPath');
validateNames.push('perms'); validateNames.push('perms');
} }
if (modalState.from.menuType === MENU_TYPE_BUTTON) { if (modalState.from.menuType === MENU_TYPE_BUTTON) {
@@ -463,9 +463,7 @@ function fnGetList() {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
listMenu(toRaw(queryParams)).then(res => { listMenu(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 过滤旧前端菜单
res.data = res.data.filter(i => i.perms !== 'page');
menuListData = JSON.parse(JSON.stringify(res.data)); menuListData = JSON.parse(JSON.stringify(res.data));
// 初始上级菜单和展开编号key // 初始上级菜单和展开编号key
if (treeDataAll.length <= 0) { if (treeDataAll.length <= 0) {
@@ -533,10 +531,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.menu.menuStatus')" :label="t('views.system.menu.menuStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -648,17 +646,20 @@ onMounted(() => {
<template v-if="column.key === 'icon'"> <template v-if="column.key === 'icon'">
<IconFont :type="record.icon" style="font-size: 18px"></IconFont> <IconFont :type="record.icon" style="font-size: 18px"></IconFont>
</template> </template>
<template v-if="column.key === 'visible'"> <template v-if="column.key === 'visibleFlag'">
<a-tag :color="+record.visible ? 'processing' : 'warning'"> <a-tag :color="+record.visibleFlag ? 'processing' : 'warning'">
{{ {{
[t('views.system.menu.hidden'), t('views.system.menu.show')][ [t('views.system.menu.hidden'), t('views.system.menu.show')][
+record.visible +record.visibleFlag
] ]
}} }}
</a-tag> </a-tag>
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" /> <DictTag
:options="dict.sysNormalDisable"
:value="record.statusFlag"
/>
</template> </template>
<template v-if="column.key === 'menuId'"> <template v-if="column.key === 'menuId'">
<a-space :size="8" align="center"> <a-space :size="8" align="center">
@@ -812,8 +813,8 @@ onMounted(() => {
:xs="24" :xs="24"
v-if="modalState.from.menuType !== MENU_TYPE_BUTTON" v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"
> >
<a-form-item :label="t('views.system.menu.routerAdrr')" name="path"> <a-form-item :label="t('views.system.menu.routerAdrr')" name="menuPath">
{{ modalState.from.path }} {{ modalState.from.menuPath }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col <a-col
@@ -833,11 +834,11 @@ onMounted(() => {
<a-row v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"> <a-row v-if="modalState.from.menuType !== MENU_TYPE_BUTTON">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.menu.local')" name="isFrame"> <a-form-item :label="t('views.system.menu.local')" name="frameFlag">
<a-tag color="default"> <a-tag color="default">
{{ {{
[t('views.system.menu.no'), t('views.system.menu.yes')][ [t('views.system.menu.no'), t('views.system.menu.yes')][
+modalState.from.isFrame +modalState.from.frameFlag
] ]
}} }}
</a-tag> </a-tag>
@@ -846,24 +847,27 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.menu.pageCache')" :label="t('views.system.menu.pageCache')"
name="isCache" name="cacheFlag"
> >
<a-tag color="default"> <a-tag color="default">
{{ {{
[ [
t('views.system.menu.noCache'), t('views.system.menu.noCache'),
t('views.system.menu.cache'), t('views.system.menu.cache'),
][+modalState.from.isCache] ][+modalState.from.cacheFlag]
}} }}
</a-tag> </a-tag>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.menu.status')" name="visible"> <a-form-item
:label="t('views.system.menu.status')"
name="visibleFlag"
>
<a-tag color="default"> <a-tag color="default">
{{ {{
[t('views.system.menu.hidden'), t('views.system.menu.show')][ [t('views.system.menu.hidden'), t('views.system.menu.show')][
+modalState.from.visible +modalState.from.visibleFlag
] ]
}} }}
</a-tag> </a-tag>
@@ -872,11 +876,11 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.menu.menuStatus')" :label="t('views.system.menu.menuStatus')"
name="status" name="statusFlag"
> >
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -1033,10 +1037,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.menu.routerAdrr')" :label="t('views.system.menu.routerAdrr')"
name="path" name="menuPath"
v-bind="modalStateFrom.validateInfos.path" v-bind="modalStateFrom.validateInfos.menuPath"
> >
<a-input v-model:value="modalState.from.path" allow-clear> <a-input v-model:value="modalState.from.menuPath" allow-clear>
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
@@ -1057,9 +1061,9 @@ onMounted(() => {
<a-row v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"> <a-row v-if="modalState.from.menuType !== MENU_TYPE_BUTTON">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.menu.local')" name="isFrame"> <a-form-item :label="t('views.system.menu.local')" name="frameFlag">
<a-select <a-select
v-model:value="modalState.from.isFrame" v-model:value="modalState.from.frameFlag"
default-value="0" default-value="0"
> >
<a-select-option key="0" value="0">{{ <a-select-option key="0" value="0">{{
@@ -1074,10 +1078,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.menu.pageCache')" :label="t('views.system.menu.pageCache')"
name="isCache" name="cacheFlag"
> >
<a-select <a-select
v-model:value="modalState.from.isCache" v-model:value="modalState.from.cacheFlag"
default-value="0" default-value="0"
> >
<a-select-option key="0" value="0">{{ <a-select-option key="0" value="0">{{
@@ -1090,9 +1094,12 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.menu.status')" name="visible"> <a-form-item
:label="t('views.system.menu.status')"
name="visibleFlag"
>
<a-select <a-select
v-model:value="modalState.from.visible" v-model:value="modalState.from.visibleFlag"
default-value="0" default-value="0"
> >
<a-select-option key="0" value="0">{{ <a-select-option key="0" value="0">{{
@@ -1107,10 +1114,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.menu.menuStatus')" :label="t('views.system.menu.menuStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >

View File

@@ -37,7 +37,7 @@ let queryParams = reactive({
/**岗位名称 */ /**岗位名称 */
postName: '', postName: '',
/**岗位状态 */ /**岗位状态 */
status: undefined, statusFlag: undefined,
/**当前页数 */ /**当前页数 */
pageNum: 1, pageNum: 1,
/**每页条数 */ /**每页条数 */
@@ -49,7 +49,7 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
postCode: '', postCode: '',
postName: '', postName: '',
status: undefined, statusFlag: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}); });
@@ -109,9 +109,9 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.post.positionStatus'), title: t('views.system.post.positionStatus'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'left',
width: 150, width: 150,
}, },
{ {
@@ -193,7 +193,7 @@ let modalState: ModalStateType = reactive({
postName: '', postName: '',
postCode: '', postCode: '',
postSort: 0, postSort: 0,
status: '0', statusFlag: '0',
remark: '', remark: '',
createTime: 0, createTime: 0,
}, },
@@ -400,13 +400,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listPost(toRaw(queryParams)).then(res => { listPost(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -467,10 +468,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.post.positionStatus')" :label="t('views.system.post.positionStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -590,8 +591,8 @@ onMounted(() => {
}" }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" /> <DictTag :options="dict.sysNormalDisable" :value="record.statusFlag" />
</template> </template>
<template v-if="column.key === 'postId'"> <template v-if="column.key === 'postId'">
<a-space :size="8" align="center"> <a-space :size="8" align="center">
@@ -672,11 +673,11 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.post.positionStatus')" :label="t('views.system.post.positionStatus')"
name="status" name="statusFlag"
> >
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -754,10 +755,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.post.positionStatus')" :label="t('views.system.post.positionStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >

View File

@@ -481,7 +481,7 @@ function fnGetList() {
listAllNeInfo({ listAllNeInfo({
bandHost: true, bandHost: true,
}).then(res => { }).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
tabState.panes = []; tabState.panes = [];
res.data.forEach((item: any, index: any) => { res.data.forEach((item: any, index: any) => {
if (item.neType === 'OMC' || !Array.isArray(item.hosts)) return; if (item.neType === 'OMC' || !Array.isArray(item.hosts)) return;

View File

@@ -81,7 +81,7 @@ function fnGetList() {
getPara5GFilee(), getPara5GFilee(),
listNeInfo({ listNeInfo({
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 100,
}), }),
]).then(resArr => { ]).then(resArr => {
// 已保存的配置 // 已保存的配置
@@ -89,11 +89,9 @@ function fnGetList() {
state.from = resArr[0].data; state.from = resArr[0].data;
} }
// 填充固定网元类型的ip // 填充固定网元类型的ip
if ( if (resArr[1].code === RESULT_CODE_SUCCESS) {
resArr[1].code === RESULT_CODE_SUCCESS && const { rows } = resArr[1].data;
Array.isArray(resArr[1].rows) for (const item of rows) {
) {
for (const item of resArr[1].rows) {
switch (item.neType) { switch (item.neType) {
case 'OMC': case 'OMC':
state.from.sbi.omc_ip = item.ip; state.from.sbi.omc_ip = item.ip;

View File

@@ -206,13 +206,13 @@ function fnGetList() {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}).then(res => { }).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (state.selectedRowKeys.length > 0) { if (state.selectedRowKeys.length > 0) {
state.selectedRowKeys = []; state.selectedRowKeys = [];
state.selectedRowOne = { neType: '' }; state.selectedRowOne = { neType: '' };
} }
state.data = res.rows.filter(s => s.neType !== 'OMC'); state.data = res.data.rows.filter((s: any) => s.neType !== 'OMC');
} }
state.loading = false; state.loading = false;
}); });

View File

@@ -194,12 +194,12 @@ function fnGetList() {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}).then(res => { }).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (state.selectedRowKeys.length > 0) { if (state.selectedRowKeys.length > 0) {
state.selectedRowKeys = []; state.selectedRowKeys = [];
} }
state.data = res.rows.filter(s => s.neType !== 'OMC'); state.data = res.data.rows.filter((s: any) => s.neType !== 'OMC');
} }
state.loading = false; state.loading = false;
}); });

View File

@@ -7,7 +7,7 @@ import { SizeType } from 'ant-design-vue/es/config-provider';
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
import { ColumnsType } from 'ant-design-vue/es/table'; import { ColumnsType } from 'ant-design-vue/es/table';
import AuthUserSelect from './components/auth-user-select.vue'; import AuthUserSelect from './components/auth-user-select.vue';
import { authUserAllocatedList, authUserChecked } from '@/api/system/role'; import { authUserList, authUserChecked } from '@/api/system/role';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useTabsStore from '@/store/modules/tabs'; import useTabsStore from '@/store/modules/tabs';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
@@ -36,7 +36,7 @@ let queryParams = reactive({
/**登录账号 */ /**登录账号 */
userName: '', userName: '',
/**手机号码 */ /**手机号码 */
phonenumber: '', phone: '',
/**用户状态 */ /**用户状态 */
status: undefined, status: undefined,
/**角色ID */ /**角色ID */
@@ -53,7 +53,7 @@ let queryParams = reactive({
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
userName: '', userName: '',
phonenumber: '', phone: '',
status: undefined, status: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
@@ -105,7 +105,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.role.phone'), title: t('views.system.role.phone'),
dataIndex: 'phonenumber', dataIndex: 'phone',
align: 'left', align: 'left',
}, },
{ {
@@ -285,14 +285,15 @@ function fnGetList(pageNum?: number) {
if (pageNum) { if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
authUserAllocatedList(toRaw(queryParams)).then(res => { authUserList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
tableState.loading = false; tableState.loading = false;
fnGetList(queryParams.pageNum - 1); fnGetList(queryParams.pageNum - 1);
@@ -347,10 +348,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.role.phone')" :label="t('views.system.role.phone')"
name="phonenumber" name="phone"
> >
<a-input <a-input
v-model:value="queryParams.phonenumber" v-model:value="queryParams.phone"
allow-clear allow-clear
:maxlength="11" :maxlength="11"
></a-input> ></a-input>

View File

@@ -4,7 +4,7 @@ import { message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider'; import { SizeType } from 'ant-design-vue/es/config-provider';
import { ColumnsType } from 'ant-design-vue/es/table'; import { ColumnsType } from 'ant-design-vue/es/table';
import { ProModal } from 'antdv-pro-modal'; import { ProModal } from 'antdv-pro-modal';
import { authUserAllocatedList } from '@/api/system/role'; import { authUserList } from '@/api/system/role';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
@@ -40,7 +40,7 @@ let queryParams = reactive({
/**登录账号 */ /**登录账号 */
userName: '', userName: '',
/**手机号码 */ /**手机号码 */
phonenumber: '', phone: '',
/**用户状态 */ /**用户状态 */
status: undefined, status: undefined,
/**角色ID */ /**角色ID */
@@ -57,7 +57,7 @@ let queryParams = reactive({
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
userName: '', userName: '',
phonenumber: '', phone: '',
status: undefined, status: undefined,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
@@ -106,7 +106,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.role.phone'), title: t('views.system.role.phone'),
dataIndex: 'phonenumber', dataIndex: 'phone',
align: 'left', align: 'left',
}, },
{ {
@@ -176,14 +176,15 @@ function fnGetList(pageNum?: number) {
if (pageNum) { if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
authUserAllocatedList(toRaw(queryParams)).then(res => { authUserList(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -260,9 +261,9 @@ watch(
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="8" :md="12" :xs="24"> <a-col :lg="8" :md="12" :xs="24">
<a-form-item :label="t('views.system.role.phone')" name="phonenumber"> <a-form-item :label="t('views.system.role.phone')" name="phone">
<a-input <a-input
v-model:value="queryParams.phonenumber" v-model:value="queryParams.phone"
allow-clear allow-clear
:maxlength="11" :maxlength="11"
></a-input> ></a-input>

View File

@@ -17,8 +17,8 @@ import {
listRole, listRole,
updateRole, updateRole,
} from '@/api/system/role'; } from '@/api/system/role';
import { roleMenuTreeSelect, menuTreeSelect } from '@/api/system/menu'; import { menuTreeSelectRole, menuTreeSelect } from '@/api/system/menu';
import { roleDeptTreeSelect } from '@/api/system/dept'; import { deptTreeRole } from '@/api/system/dept';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
@@ -56,7 +56,7 @@ let queryParams = reactive({
/**角色键值 */ /**角色键值 */
roleKey: '', roleKey: '',
/**角色状态 */ /**角色状态 */
status: undefined, statusFlag: undefined,
/**记录开始时间 */ /**记录开始时间 */
beginTime: '', beginTime: '',
/**记录结束时间 */ /**记录结束时间 */
@@ -72,7 +72,7 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
roleName: '', roleName: '',
roleKey: '', roleKey: '',
status: undefined, statusFlag: undefined,
beginTime: '', beginTime: '',
endTime: '', endTime: '',
pageNum: 1, pageNum: 1,
@@ -135,8 +135,8 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.role.roleStatus'), title: t('views.system.role.roleStatus'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'center', align: 'center',
width: 100, width: 100,
}, },
@@ -258,7 +258,7 @@ let modalState: ModalStateType = reactive({
roleName: '', roleName: '',
roleKey: '', roleKey: '',
roleSort: 0, roleSort: 0,
status: '0', statusFlag: '0',
menuIds: [], menuIds: [],
deptIds: [], deptIds: [],
remark: '', remark: '',
@@ -320,7 +320,7 @@ function fnModalVisibleByVive(roleId: string | number) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
// 查询角色详细同时根据角色ID查询菜单下拉树结构 // 查询角色详细同时根据角色ID查询菜单下拉树结构
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => { Promise.all([getRole(roleId), menuTreeSelectRole(roleId)]).then(resArr => {
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) { if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
@@ -366,7 +366,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
menuTreeSelect().then(res => { menuTreeSelect().then(res => {
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
menuTree.checkedKeys = parseTreeKeys(res.data, 'id'); menuTree.checkedKeys = parseTreeKeys(res.data, 'id');
menuTree.expandedKeys = parseTreeNodeKeys(res.data, 'id'); menuTree.expandedKeys = parseTreeNodeKeys(res.data, 'id');
menuTree.treeData = res.data; menuTree.treeData = res.data;
@@ -382,7 +382,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
// 查询角色详细同时根据角色ID查询菜单下拉树结构 // 查询角色详细同时根据角色ID查询菜单下拉树结构
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => { Promise.all([getRole(roleId), menuTreeSelectRole(roleId)]).then(resArr => {
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) { if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
@@ -570,7 +570,7 @@ function fnRecordDataScope(roleId: string | number) {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
// 查询角色详细同时根据角色ID查询部门树结构 // 查询角色详细同时根据角色ID查询部门树结构
Promise.all([getRole(roleId), roleDeptTreeSelect(roleId)]) Promise.all([getRole(roleId), deptTreeRole(roleId)])
.then(resArr => { .then(resArr => {
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) { if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
modalState.from = Object.assign(modalState.from, resArr[0].data); modalState.from = Object.assign(modalState.from, resArr[0].data);
@@ -619,7 +619,7 @@ function fnRecordAuthUser(row: Record<string, string>) {
*/ */
function fnRecordStatus(row: Record<string, string>) { function fnRecordStatus(row: Record<string, string>) {
const text = const text =
row.status === '1' row.statusFlag === '1'
? t('views.system.role.open') ? t('views.system.role.open')
: t('views.system.role.close'); : t('views.system.role.close');
Modal.confirm({ Modal.confirm({
@@ -630,7 +630,7 @@ function fnRecordStatus(row: Record<string, string>) {
}), }),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
changeRoleStatus(row.roleId, row.status).then(res => { changeRoleStatus(row.roleId, row.statusFlag).then(res => {
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -650,7 +650,7 @@ function fnRecordStatus(row: Record<string, string>) {
}); });
}, },
onCancel() { onCancel() {
row.status = row.status === '1' ? '0' : '1'; row.statusFlag = row.statusFlag === '1' ? '0' : '1';
}, },
}); });
} }
@@ -732,13 +732,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listRole(toRaw(queryParams)).then(res => { listRole(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -796,10 +797,10 @@ onMounted(() => {
<a-col :lg="4" :md="12" :xs="24"> <a-col :lg="4" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.role.roleStatus')" :label="t('views.system.role.roleStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -935,14 +936,14 @@ onMounted(() => {
}" }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<a-switch <a-switch
v-if=" v-if="
dict.sysNormalDisable.length > 0 && dict.sysNormalDisable.length > 0 &&
record.roleId !== '1' && record.roleId !== 1 &&
hasPermissions(['system:role:edit']) hasPermissions(['system:role:edit'])
" "
v-model:checked="record.status" v-model:checked="record.statusFlag"
checked-value="1" checked-value="1"
:checked-children="dict.sysNormalDisable[0].label" :checked-children="dict.sysNormalDisable[0].label"
un-checked-value="0" un-checked-value="0"
@@ -953,7 +954,7 @@ onMounted(() => {
<DictTag <DictTag
v-else v-else
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="record.status" :value="record.statusFlag"
/> />
</template> </template>
<template v-if="column.key === 'roleId'"> <template v-if="column.key === 'roleId'">
@@ -968,7 +969,7 @@ onMounted(() => {
<template #icon><ProfileOutlined /></template> <template #icon><ProfileOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip v-if="record.roleId !== '1'"> <a-tooltip v-if="record.roleId !== 1">
<template #title>{{ t('common.editText') }}</template> <template #title>{{ t('common.editText') }}</template>
<a-button <a-button
type="link" type="link"
@@ -978,7 +979,7 @@ onMounted(() => {
<template #icon><FormOutlined /></template> <template #icon><FormOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip v-if="record.roleId !== '1'"> <a-tooltip v-if="record.roleId !== 1">
<template #title>{{ t('common.deleteText') }}</template> <template #title>{{ t('common.deleteText') }}</template>
<a-button <a-button
type="link" type="link"
@@ -988,7 +989,7 @@ onMounted(() => {
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip placement="topRight" v-if="record.roleId !== '1'"> <a-tooltip placement="topRight" v-if="record.roleId !== 1">
<template #title>{{ <template #title>{{
t('views.system.role.distribute') t('views.system.role.distribute')
}}</template> }}</template>
@@ -1000,7 +1001,7 @@ onMounted(() => {
<template #icon><SecurityScanOutlined /></template> <template #icon><SecurityScanOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip placement="topRight" v-if="record.roleId !== '1'"> <a-tooltip placement="topRight" v-if="record.roleId !== 1">
<template #title>{{ <template #title>{{
t('views.system.role.distributeUser') t('views.system.role.distributeUser')
}}</template> }}</template>
@@ -1057,11 +1058,11 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.role.roleStatus')" :label="t('views.system.role.roleStatus')"
name="status" name="statusFlag"
> >
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -1157,10 +1158,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.role.roleStatus')" :label="t('views.system.role.roleStatus')"
name="status" name="statusFlag"
> >
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
> >
@@ -1315,11 +1316,11 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.role.roleStatus')" :label="t('views.system.role.roleStatus')"
name="status" name="statusFlag"
> >
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>

View File

@@ -58,9 +58,7 @@ function fnEdit(v: boolean) {
onMounted(() => { onMounted(() => {
listMenu(toRaw({ status: 1 })).then(res => { listMenu(toRaw({ status: 1 })).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
// 过滤旧前端菜单以及不是菜单类型以及路径为空
res.data = res.data.filter(i => i.perms !== 'page' && i.menuType !== 'B');
state.options = parseDataToTree(res.data, 'menuId'); state.options = parseDataToTree(res.data, 'menuId');
const setDisabledAndComponent = (item:any) => { const setDisabledAndComponent = (item:any) => {
if (!item.component) { if (!item.component) {

View File

@@ -19,7 +19,7 @@ import {
updateUser, updateUser,
addUser, addUser,
} from '@/api/system/user'; } from '@/api/system/user';
import { deptTreeSelect } from '@/api/system/dept'; import { deptTree } from '@/api/system/dept';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
@@ -34,6 +34,7 @@ import useDictStore from '@/store/modules/dict';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import { DataNode } from 'ant-design-vue/es/tree'; import { DataNode } from 'ant-design-vue/es/tree';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { uploadFile } from '@/api/tool/file';
const { getDict } = useDictStore(); const { getDict } = useDictStore();
const userStore = useUserStore(); const userStore = useUserStore();
const { t } = useI18n(); const { t } = useI18n();
@@ -57,11 +58,11 @@ let queryParams = reactive({
/**登录账号 */ /**登录账号 */
userName: '', userName: '',
/**手机号 */ /**手机号 */
phonenumber: '', phone: '',
/**部门ID */ /**部门ID */
deptId: undefined, deptId: undefined,
/**用户状态 */ /**用户状态 */
status: undefined, statusFlag: undefined,
/**记录开始时间 */ /**记录开始时间 */
beginTime: '', beginTime: '',
/**记录结束时间 */ /**记录结束时间 */
@@ -76,9 +77,9 @@ let queryParams = reactive({
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
userName: '', userName: '',
phonenumber: '', phone: '',
deptId: undefined, deptId: undefined,
status: undefined, statusFlag: undefined,
beginTime: '', beginTime: '',
endTime: '', endTime: '',
pageNum: 1, pageNum: 1,
@@ -155,7 +156,7 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.user.loginTime'), title: t('views.system.user.loginTime'),
dataIndex: 'loginDate', dataIndex: 'loginTime',
align: 'left', align: 'left',
width: 150, width: 150,
customRender(opt) { customRender(opt) {
@@ -165,8 +166,8 @@ let tableColumns: ColumnsType = [
}, },
{ {
title: t('views.system.user.status'), title: t('views.system.user.status'),
dataIndex: 'status', dataIndex: 'statusFlag',
key: 'status', key: 'statusFlag',
align: 'left', align: 'left',
width: 100, width: 100,
}, },
@@ -253,14 +254,14 @@ let modalState: ModalStateType = reactive({
password: '', password: '',
deptId: '100', deptId: '100',
email: '', email: '',
loginDate: 0, loginTime: 0,
loginIp: '', loginIp: '',
nickName: '', nickName: '',
phonenumber: '', phone: '',
postIds: [], postIds: [],
roleIds: [], roleIds: [],
sex: '0', sex: '0',
status: '0', statusFlag: '0',
remark: '', remark: '',
createTime: 0, createTime: 0,
}, },
@@ -303,7 +304,7 @@ const modalStateFrom = Form.useForm(
message: t('views.system.user.emailTip'), message: t('views.system.user.emailTip'),
}, },
], ],
phonenumber: [ phone: [
{ {
required: false, required: false,
pattern: regExpMobile, pattern: regExpMobile,
@@ -330,12 +331,12 @@ function fnModalVisibleByVive(userId: string | number) {
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) { if (res.code === RESULT_CODE_SUCCESS && res.data) {
const roles = res.data.roles.map((m: Record<string, any>) => { const roles = res.data.roles.map((m: Record<string, any>) => {
const disabled = m.status === '0'; const disabled = m.statusFlag === '0';
Reflect.set(m, 'disabled', disabled); Reflect.set(m, 'disabled', disabled);
return m; return m;
}); });
const posts = res.data.posts.map((m: Record<string, any>) => { const posts = res.data.posts.map((m: Record<string, any>) => {
const disabled = m.status === '0'; const disabled = m.statusFlag === '0';
Reflect.set(m, 'disabled', disabled); Reflect.set(m, 'disabled', disabled);
return m; return m;
}); });
@@ -371,12 +372,12 @@ function fnModalVisibleByEdit(userId?: string | number) {
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) { if (res.code === RESULT_CODE_SUCCESS && res.data) {
const roles = res.data.roles.map((m: Record<string, any>) => { const roles = res.data.roles.map((m: Record<string, any>) => {
const disabled = m.status === '0'; const disabled = m.statusFlag === '0';
Reflect.set(m, 'disabled', disabled); Reflect.set(m, 'disabled', disabled);
return m; return m;
}); });
const posts = res.data.posts.map((m: Record<string, any>) => { const posts = res.data.posts.map((m: Record<string, any>) => {
const disabled = m.status === '0'; const disabled = m.statusFlag === '0';
Reflect.set(m, 'disabled', disabled); Reflect.set(m, 'disabled', disabled);
return m; return m;
}); });
@@ -403,12 +404,12 @@ function fnModalVisibleByEdit(userId?: string | number) {
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) { if (res.code === RESULT_CODE_SUCCESS && res.data) {
const roles = res.data.roles.map((m: Record<string, any>) => { const roles = res.data.roles.map((m: Record<string, any>) => {
const disabled = m.status === '0'; const disabled = m.statusFlag === '0';
Reflect.set(m, 'disabled', disabled); Reflect.set(m, 'disabled', disabled);
return m; return m;
}); });
const posts = res.data.posts.map((m: Record<string, any>) => { const posts = res.data.posts.map((m: Record<string, any>) => {
const disabled = m.status === '0'; const disabled = m.statusFlag === '0';
Reflect.set(m, 'disabled', disabled); Reflect.set(m, 'disabled', disabled);
return m; return m;
}); });
@@ -433,7 +434,7 @@ function fnModalVisibleByEdit(userId?: string | number) {
* 进行表达规则校验 * 进行表达规则校验
*/ */
function fnModalOk() { function fnModalOk() {
let validateName = ['nickName', 'email', 'phonenumber']; let validateName = ['nickName', 'email', 'phone'];
if (!modalState.from.userId) { if (!modalState.from.userId) {
validateName.push('userName', 'password'); validateName.push('userName', 'password');
} }
@@ -542,7 +543,7 @@ function fnRecordResetPwd(row: Record<string, string>) {
*/ */
function fnRecordStatus(row: Record<string, string>) { function fnRecordStatus(row: Record<string, string>) {
const text = const text =
row.status === '1' row.statusFlag === '1'
? t('views.system.user.start') ? t('views.system.user.start')
: t('views.system.user.stop'); : t('views.system.user.stop');
Modal.confirm({ Modal.confirm({
@@ -554,7 +555,7 @@ function fnRecordStatus(row: Record<string, string>) {
onOk() { onOk() {
const key = 'changeUserStatus'; const key = 'changeUserStatus';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
changeUserStatus(row.userId, row.status).then(res => { changeUserStatus(row.userId, row.statusFlag).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: `${row.userName} ${t('common.msgSuccess', { msg: text })}`, content: `${row.userName} ${t('common.msgSuccess', { msg: text })}`,
@@ -572,7 +573,7 @@ function fnRecordStatus(row: Record<string, string>) {
}); });
}, },
onCancel() { onCancel() {
row.status = row.status === '1' ? '0' : '1'; row.statusFlag = row.statusFlag === '1' ? '0' : '1';
}, },
}); });
} }
@@ -617,26 +618,27 @@ function fnExportList() {
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.system.user.exportSure'), content: t('views.system.user.exportSure'),
onOk() { onOk() {
const key = 'exportUser'; const hide = message.loading(t('common.loading'), 0);
message.loading({ content: t('common.loading'), key }); exportUser(toRaw(queryParams))
exportUser(toRaw(queryParams)).then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: t('common.msgSuccess', { content: t('common.msgSuccess', {
msg: t('views.system.user.export'), msg: t('views.system.user.export'),
}), }),
key, duration: 3,
duration: 2, });
}); saveAs(res.data, `user_${Date.now()}.xlsx`);
saveAs(res.data, `user_${Date.now()}.xlsx`); } else {
} else { message.error({
message.error({ content: `${res.msg}`,
content: `${res.msg}`, duration: 3,
key, });
duration: 2, }
}); })
} .finally(() => {
}); hide();
});
}, },
}); });
} }
@@ -681,17 +683,30 @@ function fnModalUploadImportClose() {
/**对话框表格信息导入上传 */ /**对话框表格信息导入上传 */
function fnModalUploadImportUpload(file: File) { function fnModalUploadImportUpload(file: File) {
// 发送请求
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
uploadImportState.loading = true; uploadImportState.loading = true;
let formData = new FormData(); let formData = new FormData();
formData.append('file', file); formData.append('file', file);
formData.append('updateSupport', `${uploadImportState.updateSupport}`); formData.append('subPath', 'import');
importData(formData) uploadFile(formData)
.then(res => { .then(res => {
uploadImportState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r'); if (res.code === RESULT_CODE_SUCCESS) {
return res.data.filePath;
}
return '';
}) })
.catch((err: { code: number; msg: string }) => { .then(filePath => {
message.error(` ${err.msg}`); if (filePath === '') return undefined;
return importData(filePath, uploadImportState.updateSupport);
})
.then(res => {
if (res === undefined) return;
if (res.code === RESULT_CODE_SUCCESS) {
uploadImportState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r');
} else {
message.error(res.msg, 3);
}
}) })
.finally(() => { .finally(() => {
hide(); hide();
@@ -738,13 +753,14 @@ function fnGetList(pageNum?: number) {
queryParams.beginTime = queryRangePicker.value[0]; queryParams.beginTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listUser(toRaw(queryParams)).then(res => { listUser(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
} }
tableState.loading = false; tableState.loading = false;
}); });
@@ -756,8 +772,8 @@ let deptTreeData = ref<DataNode[]>([]);
/**查询部门下拉树结构 */ /**查询部门下拉树结构 */
function fnGetDeptTree() { function fnGetDeptTree() {
if (deptTreeData.value.length > 0) return; if (deptTreeData.value.length > 0) return;
deptTreeSelect().then(res => { deptTree().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
deptTreeData.value = res.data; deptTreeData.value = res.data;
} }
}); });
@@ -849,10 +865,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.user.phone')" :label="t('views.system.user.phone')"
name="phonenumber" name="phone"
> >
<a-input <a-input
v-model:value="queryParams.phonenumber" v-model:value="queryParams.phone"
allow-clear allow-clear
:maxlength="11" :maxlength="11"
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
@@ -860,9 +876,9 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="4" :md="12" :xs="24"> <a-col :lg="4" :md="12" :xs="24">
<a-form-item :label="t('views.system.user.status')" name="status"> <a-form-item :label="t('views.system.user.status')" name="statusFlag">
<a-select <a-select
v-model:value="queryParams.status" v-model:value="queryParams.statusFlag"
allow-clear allow-clear
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"
@@ -1001,18 +1017,18 @@ onMounted(() => {
<template v-if="column.key === 'deptId'"> <template v-if="column.key === 'deptId'">
{{ record.dept?.deptName }} {{ record.dept?.deptName }}
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'statusFlag'">
<DictTag <DictTag
v-if=" v-if="
record.userId === '1' || record.userName === userStore.userName record.userId === 1 || record.userName === userStore.userName
" "
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="record.status" :value="record.statusFlag"
/> />
<a-switch <a-switch
v-else v-else
v-perms:has="['system:user:edit']" v-perms:has="['system:user:edit']"
v-model:checked="record.status" v-model:checked="record.statusFlag"
checked-value="1" checked-value="1"
:checked-children="dict.sysNormalDisable[0].label" :checked-children="dict.sysNormalDisable[0].label"
un-checked-value="0" un-checked-value="0"
@@ -1022,7 +1038,7 @@ onMounted(() => {
/> />
</template> </template>
<template v-if="column.key === 'userId'"> <template v-if="column.key === 'userId'">
<a-space :size="8" align="center" v-if="record.userId !== '1'"> <a-space :size="8" align="center" v-if="record.userId !== 1">
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.viewText') }}</template> <template #title>{{ t('common.viewText') }}</template>
<a-button <a-button
@@ -1107,10 +1123,10 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.user.loginTime')" :label="t('views.system.user.loginTime')"
name="loginDate" name="loginTime"
> >
<span v-if="+modalState.from.loginDate > 0"> <span v-if="+modalState.from.loginTime > 0">
{{ parseDateToStr(+modalState.from.loginDate) }} {{ parseDateToStr(+modalState.from.loginTime) }}
</span> </span>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -1154,10 +1170,10 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.user.status')" name="status"> <a-form-item :label="t('views.system.user.status')" name="statusFlag">
<DictTag <DictTag
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:value="modalState.from.status" :value="modalState.from.statusFlag"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -1167,9 +1183,9 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.user.phone')" :label="t('views.system.user.phone')"
name="phonenumber" name="phone"
> >
{{ modalState.from.phonenumber }} {{ modalState.from.phone }}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
@@ -1361,11 +1377,11 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.user.phone')" :label="t('views.system.user.phone')"
name="phonenumber" name="phone"
v-bind="modalStateFrom.validateInfos.phonenumber" v-bind="modalStateFrom.validateInfos.phone"
> >
<IntlTelInput <IntlTelInput
v-model:value="modalState.from.phonenumber" v-model:value="modalState.from.phone"
allow-clear allow-clear
:maxlength="20" :maxlength="20"
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
@@ -1405,13 +1421,13 @@ onMounted(() => {
:md="12" :md="12"
:xs="24" :xs="24"
v-if=" v-if="
modalState.from.userId !== '1' && modalState.from.userId !== 1 &&
modalState.from.userId !== userStore.userId modalState.from.userId !== userStore.userId
" "
> >
<a-form-item :label="t('views.system.user.status')" name="status"> <a-form-item :label="t('views.system.user.status')" name="statusFlag">
<a-select <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.statusFlag"
default-value="0" default-value="0"
:options="dict.sysNormalDisable" :options="dict.sysNormalDisable"
:placeholder="t('common.selectPlease')" :placeholder="t('common.selectPlease')"

View File

@@ -230,7 +230,7 @@ function fnMessage(res: Record<string, any>) {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
for (const item of neInfoStore.getNeCascaderOptions) { for (const item of neInfoStore.getNeCascaderOptions) {

View File

@@ -188,7 +188,7 @@ function fnMessage(res: Record<string, any>) {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
for (const item of neInfoStore.getNeCascaderOptions) { for (const item of neInfoStore.getNeCascaderOptions) {

View File

@@ -144,9 +144,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeHost(toRaw(queryParams)).then(res => { listNeHost(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&

View File

@@ -67,7 +67,7 @@ function fnGetHostList(pageNum?: number) {
} }
listNeHost(toRaw(hostState.params)).then(res => { listNeHost(toRaw(hostState.params)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
hostState.total = res.total; hostState.total = res.total;
hostState.data = hostState.data.concat(res.rows); hostState.data = hostState.data.concat(res.rows);
// 页数+ // 页数+

View File

@@ -10,7 +10,7 @@ import { parseDateToStr } from '@/utils/date-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { getTraceRawInfo, listTraceData } from '@/api/trace/analysis'; import { listTraceData } from '@/api/trace/analysis';
const { t } = useI18n(); const { t } = useI18n();
/**查询参数 */ /**查询参数 */
@@ -156,9 +156,10 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listTraceData(toRaw(queryParams)).then(res => { listTraceData(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -485,11 +486,7 @@ onMounted(() => {
<div class="raw-title"> <div class="raw-title">
{{ t('views.traceManage.analysis.signalData') }} {{ t('views.traceManage.analysis.signalData') }}
</div> </div>
<a-row <a-row class="raw" v-for="v in modalState.from.rawData" :key="v.row">
class="raw"
v-for="v in modalState.from.rawData"
:key="v.row"
>
<a-col class="num" :span="2">{{ v.row }}</a-col> <a-col class="num" :span="2">{{ v.row }}</a-col>
<a-col class="code" :span="12">{{ v.code }}</a-col> <a-col class="code" :span="12">{{ v.code }}</a-col>
<a-col class="txt" :span="10">{{ v.asciiText }}</a-col> <a-col class="txt" :span="10">{{ v.asciiText }}</a-col>

View File

@@ -253,9 +253,10 @@ function fnGetList(pageNum?: number) {
} }
queryParams.path = nePathArr.value.join('/'); queryParams.path = nePathArr.value.join('/');
listNeFiles(toRaw(queryParams)).then(res => { listNeFiles(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -295,7 +296,7 @@ function fnDrawerOpen(row: Record<string, any>) {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore.fnNelist().then(res => { neInfoStore.fnNelist().then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length === 0) { if (res.data.length === 0) {
message.warning({ message.warning({
content: t('common.noData'), content: t('common.noData'),

View File

@@ -212,13 +212,14 @@ function fnGetList(pageNum?: number) {
queryParams.startTime = queryRangePicker.value[0]; queryParams.startTime = queryRangePicker.value[0];
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listTaskHLR(toRaw(queryParams)).then(res => { listTaskHLR(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -729,7 +730,7 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.imsiTip') }}</div> <div>{{ t('views.traceManage.task.imsiTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>
</template> </template>
</a-input> </a-input>
@@ -749,7 +750,7 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.msisdnTip') }}</div> <div>{{ t('views.traceManage.task.msisdnTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>
</template> </template>
</a-input> </a-input>

View File

@@ -246,13 +246,14 @@ function fnGetList(pageNum?: number) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listTraceTask(toRaw(queryParams)).then(res => { listTraceTask(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS) {
// 取消勾选 // 取消勾选
if (tableState.selectedRowKeys.length > 0) { if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = []; tableState.selectedRowKeys = [];
} }
tablePagination.total = res.total; const { total, rows } = res.data;
tableState.data = res.rows; tablePagination.total = total;
tableState.data = rows;
if ( if (
tablePagination.total <= tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize && (queryParams.pageNum - 1) * tablePagination.pageSize &&
@@ -314,7 +315,7 @@ let modalState: ModalStateType = reactive({
neTypeInterfaceSelect: [], neTypeInterfaceSelect: [],
timeRangePicker: ['', ''], timeRangePicker: ['', ''],
from: { from: {
id: '', id: undefined,
neType: '', neType: '',
neId: '', neId: '',
traceId: '', traceId: '',
@@ -573,7 +574,7 @@ onMounted(() => {
useNeInfoStore() useNeInfoStore()
.fnNelist() .fnNelist()
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
neCascaderOptions.value = neInfoStore.getNeSelectOtions.filter( neCascaderOptions.value = neInfoStore.getNeSelectOtions.filter(
@@ -918,7 +919,7 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.signalPortTip') }}</div> <div>{{ t('views.traceManage.task.signalPortTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>
</template> </template>
</a-input-number> </a-input-number>
@@ -941,7 +942,9 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.srcIpTip') }}</div> <div>{{ t('views.traceManage.task.srcIpTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined
style="opacity: 0.45; color: inherit"
/>
</a-tooltip> </a-tooltip>
</template> </template>
</a-input> </a-input>
@@ -964,7 +967,9 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.dstIpTip') }}</div> <div>{{ t('views.traceManage.task.dstIpTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined
style="opacity: 0.45; color: inherit"
/>
</a-tooltip> </a-tooltip>
</template> </template>
</a-input> </a-input>
@@ -990,7 +995,7 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.imsiTip') }}</div> <div>{{ t('views.traceManage.task.imsiTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>
</template> </template>
</a-input> </a-input>
@@ -1010,7 +1015,7 @@ onMounted(() => {
<template #title> <template #title>
<div>{{ t('views.traceManage.task.msisdnTip') }}</div> <div>{{ t('views.traceManage.task.msisdnTip') }}</div>
</template> </template>
<InfoCircleOutlined style="opacity: 0.45; color: inherit;" /> <InfoCircleOutlined style="opacity: 0.45; color: inherit" />
</a-tooltip> </a-tooltip>
</template> </template>
</a-input> </a-input>