fix: 优化系统管理/基础配置 base-path添加localhost校验;优化用户新增二次确认密码提示语;优化视频中心仪表盘初始化报错;

* fix: 优化系统管理/基础配置 base-path添加localhost校验;优化用户新增二次确认密码提示语;优化视频中心仪表盘初始化报错;

* fix: 修改nginx配置和插件引入

* fix: bug#24221、24217、24118

* fix: bug#22824

* fix: 优化视频中心分屏演示初无数据时异常

* fix: 优化物联卡详情数据统计异常;优化告警中心初始化异常;优化数据字典长度超长限制;

* fix: bug#24502--同步状态

* fix: bug#24502--批量操作

* fix: 优化docker
This commit is contained in:
XieYongHong 2024-04-25 18:03:11 +08:00 committed by GitHub
parent 859f2f8881
commit 8d9d82e81f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 6346 additions and 98 deletions

View File

@ -58,7 +58,7 @@ export const resumptionBatch = (data: any) => server.get(`/network/card/_resumpt
/** /**
* *
*/ */
export const sync = () => server.get(`/network/card/state/_sync`); export const sync = (data: any) => server.get(`/network/card/state/_sync`,data);
/** /**
* *

View File

@ -282,19 +282,34 @@ const getDataTotal = () => {
dayOptions.value = resp.sortArray; dayOptions.value = resp.sortArray;
}); });
getData(mTime[0], mTime[1]).then((resp) => { getData(mTime[0], mTime[1]).then((resp) => {
monthTotal.value = resp.data const monthData = resp.data;
monthTotal.value = monthData
.reduce((r, n) => r + Number(n), 0) .reduce((r, n) => r + Number(n), 0)
.toFixed(2); .toFixed(2);
monthOptions.value = resp.sortArray; monthOptions.value = resp.sortArray;
}); console.log('monthTotal.value:' + monthTotal.value);
console.log('monthData.length:' + monthData.length);
//
if (monthData.length <=31) {
yearTotal.value = monthTotal.value;
yearOptions.value = monthOptions.value;
console.log('yearTotal.value:' + yearTotal.value);
} else {
getData(yTime[0], yTime[1]).then((resp) => { getData(yTime[0], yTime[1]).then((resp) => {
yearTotal.value = resp.data yearTotal.value = resp.data
.reduce((r, n) => r + Number(n), 0) .reduce((r, n) => r + Number(n), 0)
.toFixed(2); .toFixed(2);
yearOptions.value = resp.sortArray; yearOptions.value = resp.sortArray;
console.log('yearTotal.value:' + yearTotal.value);
}); });
}
});
}; };
/** /**
* 流量统计 * 流量统计
* @param data * @param data
@ -302,7 +317,7 @@ const getDataTotal = () => {
const getEcharts = (data: any) => { const getEcharts = (data: any) => {
let startTime = data.start; let startTime = data.start;
let endTime = data.end; let endTime = data.end;
if (data.type === 'week' || data.type === 'month') { if (data.type === 'week' || data.type === 'month'||data.type === 'year') {
startTime = moment(data.start).startOf('days').valueOf(); startTime = moment(data.start).startOf('days').valueOf();
endTime = moment(data.end).startOf('days').valueOf(); endTime = moment(data.end).startOf('days').valueOf();
} }

View File

@ -900,13 +900,20 @@ const handleResumption = () => {
/** /**
* 同步状态 * 同步状态
*/ */
const handleSync = () => { const handleSync = async() => {
sync().then((res: any) => { if (!_selectedRowKeys.value.length) {
if (res.status === 200) { onlyMessage('请选择数据', 'error');
return;
}
const resp = await sync(
_selectedRowKeys.value.map((v) => ({ id: v })),
);
if (resp.status === 200) {
_selectedRowKeys.value = [];
cardManageRef.value?.reload(); cardManageRef.value?.reload();
onlyMessage('同步状态成功'); onlyMessage('同步状态成功');
} }
});
}; };
/** /**
@ -991,11 +998,13 @@ const batchActions: BatchActionsType[] = [
type: 'primary', type: 'primary',
permission: 'iot-card/CardManagement:sync', permission: 'iot-card/CardManagement:sync',
icon: 'SwapOutlined', icon: 'SwapOutlined',
selected:{
popConfirm: { popConfirm: {
title: '确认同步状态吗?', title: '确认同步状态吗?',
onConfirm: handleSync, onConfirm: handleSync,
}, },
}, },
},
{ {
key: 'delete', key: 'delete',
text: '批量删除', text: '批量删除',

View File

@ -45,7 +45,7 @@
<j-col :span="8"> <j-col :span="8">
<div class="data-statistics-item"> <div class="data-statistics-item">
<div class="flow-info" style="width: 100%"> <div class="flow-info" style="width: 100%">
<div class="label">本年流量消耗</div> <div class="label">本年流量消耗1</div>
<j-tooltip placement="bottomLeft"> <j-tooltip placement="bottomLeft">
<template #title> <template #title>
<span>{{ yearTotal }} M</span> <span>{{ yearTotal }} M</span>

View File

@ -36,7 +36,6 @@ const props = defineProps({
const createChart = () => { const createChart = () => {
nextTick(() => { nextTick(() => {
const myChart = echarts.init(proxy.$refs.chart); const myChart = echarts.init(proxy.$refs.chart);
const options = { const options = {
grid: { grid: {
left: '5%', left: '5%',

View File

@ -40,6 +40,7 @@ const props = defineProps({
title: { type: String, default: '' }, title: { type: String, default: '' },
// //
chartData: { type: Array, default: () => [] }, chartData: { type: Array, default: () => [] },
}); });
// //
@ -55,10 +56,14 @@ const dateRange = ref<any>([
const chartRef = ref(); const chartRef = ref();
const createChart = () => { const createChart = () => {
nextTick(() => { nextTick(() => {
if (!chartRef.value) {
return; //
}
const myChart = echarts.init(chartRef.value as HTMLElement); const myChart = echarts.init(chartRef.value as HTMLElement);
const sData: number[] = props.chartData.map( const sData: number[] = props.chartData.map(
(m: any) => m.value && m.value.toFixed(0), (m: any) => m.value && m.value.toFixed(0),
); );
const maxY = Math.max.apply(null, sData.length ? sData : [0]); const maxY = Math.max.apply(null, sData.length ? sData : [0]);
const options = { const options = {
grid: { grid: {
@ -136,6 +141,7 @@ const createChart = () => {
myChart.resize(); myChart.resize();
}); });
}); });
}; };
watch( watch(
@ -145,6 +151,7 @@ watch(
}, },
{ deep: true }, { deep: true },
); );
watch( watch(
() => dateRange.value, () => dateRange.value,
(val) => { (val) => {

View File

@ -87,6 +87,7 @@ const getDeviceList = async () => {
...extra, ...extra,
}; };
}); });
if (treeData.value.length > 0 && treeData.value[0]) {
getChildren(treeData.value[0].id,{ getChildren(treeData.value[0].id,{
pageIndex: 0, pageIndex: 0,
pageSize: 100, pageSize: 100,
@ -98,6 +99,8 @@ const getDeviceList = async () => {
], ],
},true) },true)
} }
}
}; };
getDeviceList(); getDeviceList();

View File

@ -445,6 +445,7 @@ const selectChange = () => {
sData.push(item.data.value); sData.push(item.data.value);
}); });
const data:any = JSON.parse(JSON.stringify(sData)) const data:any = JSON.parse(JSON.stringify(sData))
if (data && data.length > 0 ) {
const maxY = data.sort((a,b)=>{ const maxY = data.sort((a,b)=>{
return b-a return b-a
})[0] })[0]
@ -499,6 +500,9 @@ const selectChange = () => {
}, },
], ],
}; };
}else{
console.log('data is empty ')
}
state.ranking = res.result state.ranking = res.result
?.filter( ?.filter(
(item: any) => (item: any) =>

View File

@ -371,6 +371,16 @@ const form = reactive<formType>({
message: '请输入base-path', message: '请输入base-path',
trigger: 'blur', trigger: 'blur',
}, },
{
validator: (rule, value, callback) => {
if (value && value.includes('localhost')) {
callback('输入内容不能包含 localhost');
} else {
callback();
}
},
trigger: 'blur',
},
], ],
}, },
logoLoading: false, // logo logoLoading: false, // logo

View File

@ -76,9 +76,16 @@ const form = reactive({
const rules = { const rules = {
id: [ id: [
{ required:true,message:'请输入ID'}, { required:true,message:'请输入ID',trigger: 'blur' },
{ validator: validateInput, trigger: 'blur' },
{ max: 64, message: '最多可输入64位字符', trigger: 'change' }, { max: 64, message: '最多可输入64位字符', trigger: 'change' },
{ validator: (rule: Rule, value: string) => {
//
if (value && value.length <= 64) {
return validateInput(rule, value);
} else {
return Promise.reject();
}
}, trigger: 'blur' },
], ],
name: [ name: [
{ required: true, message: '请输入名称', trigger: 'blur' }, { required: true, message: '请输入名称', trigger: 'blur' },

View File

@ -32,6 +32,7 @@
</j-alert> </j-alert>
</div> </div>
</template> </template>
<!-- // -->
<template v-else> <template v-else>
<div class="role-alert" style="margin-bottom: 10px;"> <div class="role-alert" style="margin-bottom: 10px;">
<j-alert type="info"> <j-alert type="info">
@ -80,9 +81,7 @@
:bodyStyle="{ padding: 0 }" :bodyStyle="{ padding: 0 }"
:gridColumn="gridColumn" :gridColumn="gridColumn"
:alertRender="false" :alertRender="false"
:defaultParams="{ :defaultParams="defaultParams"
sorts: [{ name: 'createTime', order: 'desc' }],
}"
:rowSelection="{ :rowSelection="{
selectedRowKeys: _selectedRowKeys, selectedRowKeys: _selectedRowKeys,
}" }"
@ -101,11 +100,9 @@
</j-scrollbar> </j-scrollbar>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { queryRoleList } from '@/api/system/noticeRule'; import { queryRoleList } from '@/api/system/noticeRule';
import { PropType } from 'vue'; import { PropType } from 'vue';
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
type: Array as PropType<string[]>, type: Array as PropType<string[]>,
@ -120,9 +117,7 @@ const props = defineProps({
default: '', default: '',
}, },
}); });
const emit = defineEmits(['update:modelValue']); const emit = defineEmits(['update:modelValue']);
const params = ref<any>(); const params = ref<any>();
const _selectedRowKeys = ref<string[]>([]); const _selectedRowKeys = ref<string[]>([]);
const tableRef = ref(); const tableRef = ref();
@ -130,7 +125,19 @@ const tableRef = ref();
const dataSource = computed(() => { const dataSource = computed(() => {
return tableRef.value?._dataSource || []; return tableRef.value?._dataSource || [];
}); });
const defaultParams = ref({
sorts: [{ name: 'id', order: 'asc', value: 'id' }],
});
onMounted(() => {
// modelValuedefaultParams.value.sortsvalue
props.modelValue.forEach((value: string) => {
defaultParams.value.sorts.push({
name: 'id',
order: 'asc',
value: value,
});
});
});
const indeterminate = computed(() => { const indeterminate = computed(() => {
return ( return (
dataSource.value.some((item: any) => { dataSource.value.some((item: any) => {
@ -201,6 +208,7 @@ const onSelect = (e: any, record: any) => {
_set.delete(record.id); _set.delete(record.id);
} }
emit('update:modelValue', [..._set.values()]); emit('update:modelValue', [..._set.values()]);
console.log('')
}; };
const onSelectAll = (e: any) => { const onSelectAll = (e: any) => {

View File

@ -186,6 +186,8 @@ const form = reactive({
if (!id) return Promise.reject('请输入标识(ID)'); if (!id) return Promise.reject('请输入标识(ID)');
else if (id.length > 64) else if (id.length > 64)
return Promise.reject('最多可输入64个字符'); return Promise.reject('最多可输入64个字符');
else if (!/^\w+$/.test(id))
return Promise.reject('内容只能为字母、数字或者下划线!');
else if (props.data?.id && props.data?.id === form.data?.id) else if (props.data?.id && props.data?.id === form.data?.id)
return Promise.resolve(); return Promise.resolve();
else { else {

View File

@ -293,7 +293,7 @@ const form = reactive({
}); });
}), }),
checkAgainPassword: (_rule: Rule, value: string): Promise<any> => { checkAgainPassword: (_rule: Rule, value: string): Promise<any> => {
if (!value) return Promise.reject('请输入8~64位的密码'); if (!value) return Promise.reject('请再次输入密码');
return value === form.data.password return value === form.data.password
? Promise.resolve() ? Promise.resolve()
: Promise.reject('两次密码输入不一致'); : Promise.reject('两次密码输入不一致');

View File

@ -97,6 +97,7 @@ export default defineConfig(({ mode}) => {
// target: 'http://192.168.32.163:8844', //张本地 // target: 'http://192.168.32.163:8844', //张本地
// target: 'http://120.77.179.54:8844', // 120测试 // target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境 target: 'http://192.168.33.46:8844', // 本地开发环境
// target: 'http://192.168.32.167:8844', // 本地开发环境1
// target: 'http://192.168.33.1:8848', // 社区版开发环境 // target: 'http://192.168.33.1:8848', // 社区版开发环境
// target: 'http://192.168.32.207:8844', // 刘本地 // target: 'http://192.168.32.207:8844', // 刘本地
// target: 'http://192.168.32.187:8844', // 谭本地 // target: 'http://192.168.32.187:8844', // 谭本地

6183
yarn.lock Normal file

File diff suppressed because it is too large Load Diff