fix: 优化系统管理/用户管理的逻辑问题;修复了设备进行批量导出时,无法导出成功;
* fix: 优化部分文件对TOKEN_KEY的使用 * fix: 优化系统管理/用户管理的逻辑问题;修复了设备进行批量导出时,无法导出成功;系统管理/日志/详情的异常信息文本框可输入的问题(样式问题) * fix:还原优化物联卡/物联卡管理/详细信息的更改 * fix: NO1:系统管理/日志/详情的异常信息文本框可输入的问题(样式问题) NO2:视频中心/国标级联/新增的SIP本地地址端口的逻辑问题
This commit is contained in:
parent
2115c196df
commit
cfc16a0559
|
@ -5,7 +5,7 @@
|
|||
name="file"
|
||||
:action="FILE_UPLOAD"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}"
|
||||
:maxCount="1"
|
||||
:showUploadList="false"
|
||||
|
@ -165,4 +165,4 @@ const uploadChange = async (info: Record<string, any>) => {
|
|||
await submitData(resp?.result || '');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
@change="handleChange"
|
||||
:action="FILE_UPLOAD"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}"
|
||||
v-bind="props"
|
||||
>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="import">
|
||||
<a-upload-dragger v-model:fileList="fileList" name="file" :action="`${FILE_UPLOAD}?options=tempFile`"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}" :limit="1" :showUploadList="false" @change="uploadChange" :accept="['xlsx', 'xls', 'csv']"
|
||||
:before-upload="beforeUpload">
|
||||
<div class="dragger-box">
|
||||
|
@ -203,4 +203,4 @@ const handleImport = async (file: any) => {
|
|||
width: 152px;
|
||||
color: #666666;
|
||||
}
|
||||
}</style>
|
||||
}</style>
|
||||
|
|
|
@ -115,6 +115,7 @@
|
|||
v-model:value="descriptionsData.exception"
|
||||
placeholder="暂无数据"
|
||||
:auto-size="{ minRows: 3, maxRows: 20 }"
|
||||
readonly
|
||||
/>
|
||||
</j-descriptions-item>
|
||||
</j-descriptions>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
@change="handleChange"
|
||||
:action="FILE_UPLOAD"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}"
|
||||
v-bind="props"
|
||||
>
|
||||
|
|
|
@ -791,7 +791,7 @@ const Status = defineComponent({
|
|||
{
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'loading',
|
||||
text: '正在诊断中...',
|
||||
info: null,
|
||||
|
@ -805,7 +805,7 @@ const Status = defineComponent({
|
|||
list.value = modifyArrayList(list.value, {
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'success',
|
||||
text: '正常',
|
||||
info: null,
|
||||
|
@ -822,7 +822,7 @@ const Status = defineComponent({
|
|||
list.value = modifyArrayList(list.value, {
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'error',
|
||||
text: '异常',
|
||||
info: (
|
||||
|
@ -849,7 +849,7 @@ const Status = defineComponent({
|
|||
{
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'success',
|
||||
text: '正常',
|
||||
info: null,
|
||||
|
@ -873,7 +873,7 @@ const Status = defineComponent({
|
|||
list.value = modifyArrayList(list.value, {
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'warning',
|
||||
text: '可能存在异常',
|
||||
info: (
|
||||
|
@ -890,7 +890,7 @@ const Status = defineComponent({
|
|||
type: 'product',
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
data: { ...item },
|
||||
configuration: _configuration,
|
||||
productId: unref(device).productId,
|
||||
|
@ -909,7 +909,7 @@ const Status = defineComponent({
|
|||
{
|
||||
key: `product-auth${i}`,
|
||||
name: `产品-${item?.name}`,
|
||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'success',
|
||||
text: '正常',
|
||||
info: null,
|
||||
|
@ -952,7 +952,7 @@ const Status = defineComponent({
|
|||
{
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'loading',
|
||||
text: '正在诊断中...',
|
||||
info: null,
|
||||
|
@ -966,7 +966,7 @@ const Status = defineComponent({
|
|||
list.value = modifyArrayList(list.value, {
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'success',
|
||||
text: '正常',
|
||||
info: null,
|
||||
|
@ -983,7 +983,7 @@ const Status = defineComponent({
|
|||
list.value = modifyArrayList(list.value, {
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'error',
|
||||
text: '异常',
|
||||
info: (
|
||||
|
@ -1010,7 +1010,7 @@ const Status = defineComponent({
|
|||
{
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'success',
|
||||
text: '正常',
|
||||
info: null,
|
||||
|
@ -1034,7 +1034,7 @@ const Status = defineComponent({
|
|||
list.value = modifyArrayList(list.value, {
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'warning',
|
||||
text: '可能存在异常',
|
||||
info: (
|
||||
|
@ -1051,7 +1051,7 @@ const Status = defineComponent({
|
|||
type: 'device',
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
data: { ...item },
|
||||
configuration: _configuration,
|
||||
productId: unref(device).productId,
|
||||
|
@ -1070,7 +1070,7 @@ const Status = defineComponent({
|
|||
{
|
||||
key: `device-auth${i}`,
|
||||
name: `设备-${item?.name}`,
|
||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||
desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`,
|
||||
status: 'success',
|
||||
text: '正常',
|
||||
info: null,
|
||||
|
|
|
@ -53,6 +53,8 @@ import { downloadFileByUrl } from '@/utils/utils';
|
|||
import { paramsEncodeQuery } from '@/utils/encodeQuery';
|
||||
import { deviceExport , deviceExportPath} from '@/api/device/instance';
|
||||
import { getToken } from '@/utils/comm';
|
||||
import { TOKEN_KEY } from '@/utils/variable';
|
||||
import { LocalStore, onlyMessage } from '@/utils/comm';
|
||||
|
||||
const emit = defineEmits(['close']);
|
||||
const props = defineProps({
|
||||
|
@ -82,10 +84,17 @@ watch(
|
|||
});
|
||||
},
|
||||
{ immediate: true, deep: true },
|
||||
|
||||
|
||||
);
|
||||
|
||||
const productName = computed(() => {
|
||||
console.log(modelRef.product);
|
||||
return productList.value.find(item => item.id === modelRef.product)?.name || ''
|
||||
// console.log(item.id);
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
const handleOk = async () => {
|
||||
|
@ -98,13 +107,17 @@ const handleOk = async () => {
|
|||
modelRef.product || '',
|
||||
modelRef.fileType,
|
||||
params
|
||||
|
||||
|
||||
);
|
||||
if (res) {
|
||||
const blob = new Blob([res], { type: modelRef.fileType });
|
||||
const url = URL.createObjectURL(blob);
|
||||
downloadFileByUrl(url, `${productName.value ? (productName.value + '下设备') : '设备实例'}`, modelRef.fileType);
|
||||
// const blob = new Blob([res], { type: modelRef.fileType });
|
||||
// const url = URL.createObjectURL(blob);
|
||||
// downloadFileByUrl(url, `${productName.value ? (productName.value + '下设备') : '设备实例'}`, modelRef.fileType);
|
||||
window.open(`${origin}/api/device-instance/${modelRef.product}/export.xlsx?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`)
|
||||
emit('close');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
<div class="alert"><AIcon style="margin-right: 5px;" type="InfoCircleOutlined" />导入系统已存在的设备数据,不会更改已存在设备的所属产品信息</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<a-upload-dragger
|
||||
v-model:fileList="modelRef.upload"
|
||||
name="file"
|
||||
:action="FILE_UPLOAD"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}"
|
||||
:maxCount="1"
|
||||
:showUploadList="false"
|
||||
|
@ -222,7 +222,7 @@ const uploadChange = async (info: Record<string, any>) => {
|
|||
color: #666666;
|
||||
|
||||
.icon {
|
||||
font-size: 30px;
|
||||
font-size: 30px;
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
@ -250,4 +250,4 @@ const uploadChange = async (info: Record<string, any>) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -239,16 +239,17 @@ const pageChange = (page: number, pageSize: number) => {
|
|||
const init = async () => {
|
||||
if (props.accessId) {
|
||||
const resp = await getCommandsByAccess(props.accessId);
|
||||
if (resp.success) {
|
||||
const item = resp.result?.[0];
|
||||
if (resp.success && resp.result?.length) {
|
||||
// 获取分页查询条件
|
||||
const item = resp.result.find(item => item.id === 'QueryDevicePage');
|
||||
if (item) {
|
||||
showPage.value = item.id === 'QueryDevicePage'; // 分页
|
||||
showPage.value = true
|
||||
columns.value = item.expands?.terms?.map((t) => ({
|
||||
title: t.name,
|
||||
dataIndex: t.id,
|
||||
search: {
|
||||
type: t.valueType.type,
|
||||
},
|
||||
title: t.name,
|
||||
dataIndex: t.id,
|
||||
search: {
|
||||
type: t.valueType.type,
|
||||
},
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
:show-upload-list="false"
|
||||
:action="FILE_UPLOAD"
|
||||
@change="fileChange"
|
||||
:headers="{ 'X-Access-Token': getToken() }"
|
||||
:headers="{ [TOKEN_KEY]: getToken() }"
|
||||
>
|
||||
<j-button>
|
||||
<template #icon
|
||||
|
|
|
@ -280,7 +280,7 @@ const backLoading = ref(false);
|
|||
const iconLoading = ref(false);
|
||||
const imageTypes = ref(['image/jpeg', 'image/png']);
|
||||
const iconTypes = ref(['image/x-icon']);
|
||||
const headers = ref({ 'X-Access-Token': LocalStore.get(TOKEN_KEY) });
|
||||
const headers = ref({ [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) });
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
|
|
|
@ -233,7 +233,7 @@ const saveChange = (val: any) => {
|
|||
const getData = (
|
||||
start: number,
|
||||
end: number,
|
||||
): Promise<{ sortArray: any[]; data: any[] }> => {
|
||||
): Promise<{ sortArray: any[]}> => {
|
||||
return new Promise((resolve) => {
|
||||
queryFlow(start, end, {
|
||||
orderBy: 'date',
|
||||
|
@ -250,13 +250,11 @@ const getData = (
|
|||
);
|
||||
resolve({
|
||||
sortArray,
|
||||
data: sortArray.map(
|
||||
(item: any) => item.value && item.value.toFixed(2),
|
||||
),
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -276,37 +274,23 @@ const getDataTotal = () => {
|
|||
moment().endOf('year').valueOf(),
|
||||
];
|
||||
getData(dTime[0], dTime[1]).then((resp) => {
|
||||
dayTotal.value = resp.data
|
||||
.reduce((r, n) => r + Number(n), 0)
|
||||
dayTotal.value = resp.sortArray
|
||||
.reduce((r, n) => r + Number(n.value), 0)
|
||||
.toFixed(2);
|
||||
dayOptions.value = resp.sortArray;
|
||||
});
|
||||
getData(mTime[0], mTime[1]).then((resp) => {
|
||||
const monthData = resp.data;
|
||||
monthTotal.value = monthData
|
||||
.reduce((r, n) => r + Number(n), 0)
|
||||
.toFixed(2);
|
||||
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) => {
|
||||
yearTotal.value = resp.data
|
||||
.reduce((r, n) => r + Number(n), 0)
|
||||
.toFixed(2);
|
||||
yearOptions.value = resp.sortArray;
|
||||
console.log('yearTotal.value:' + yearTotal.value);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
monthTotal.value = resp.sortArray
|
||||
.reduce((r, n) => r + Number(n.value), 0)
|
||||
.toFixed(2);
|
||||
monthOptions.value = resp.sortArray;
|
||||
})
|
||||
getData(yTime[0], yTime[1]).then((resp) => {
|
||||
yearTotal.value = resp.sortArray
|
||||
.reduce((r, n) => r + Number(n.value), 0)
|
||||
.toFixed(2);
|
||||
yearOptions.value = monthOptions.value;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
@ -317,7 +301,7 @@ const getDataTotal = () => {
|
|||
const getEcharts = (data: any) => {
|
||||
let startTime = data.start;
|
||||
let endTime = data.end;
|
||||
if (data.type === 'week' || data.type === 'month'||data.type === 'year') {
|
||||
if (data.type === 'week' || data.type === 'month') {
|
||||
startTime = moment(data.start).startOf('days').valueOf();
|
||||
endTime = moment(data.end).startOf('days').valueOf();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
name="file"
|
||||
:action="FILE_UPLOAD"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}"
|
||||
:maxCount="1"
|
||||
:showUploadList="false"
|
||||
|
|
|
@ -177,7 +177,7 @@ const quickBtnList = [
|
|||
const getData = (
|
||||
start: number,
|
||||
end: number,
|
||||
): Promise<{ sortArray: any[]; data: any[] }> => {
|
||||
): Promise<{ sortArray: any[]}> => {
|
||||
return new Promise((resolve) => {
|
||||
queryFlow(start, end, {
|
||||
orderBy: 'date',
|
||||
|
@ -189,9 +189,6 @@ const getData = (
|
|||
);
|
||||
resolve({
|
||||
sortArray,
|
||||
data: sortArray.map(
|
||||
(item: any) => item.value && item.value.toFixed(2),
|
||||
),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -215,20 +212,20 @@ const getDataTotal = () => {
|
|||
dayjs().endOf('year').valueOf(),
|
||||
];
|
||||
getData(dTime[0], dTime[1]).then((resp) => {
|
||||
dayTotal.value = resp.data
|
||||
.reduce((r, n) => r + Number(n), 0)
|
||||
dayTotal.value = resp.sortArray
|
||||
.reduce((r, n) => r + Number(n.value), 0)
|
||||
.toFixed(2);
|
||||
dayOptions.value = resp.sortArray;
|
||||
});
|
||||
getData(mTime[0], mTime[1]).then((resp) => {
|
||||
monthTotal.value = resp.data
|
||||
.reduce((r, n) => r + Number(n), 0)
|
||||
monthTotal.value = resp.sortArray
|
||||
.reduce((r, n) => r + Number(n.value), 0)
|
||||
.toFixed(2);
|
||||
monthOptions.value = resp.sortArray;
|
||||
});
|
||||
getData(yTime[0], yTime[1]).then((resp) => {
|
||||
yearTotal.value = resp.data
|
||||
.reduce((r, n) => r + Number(n), 0)
|
||||
yearTotal.value = resp.sortArray
|
||||
.reduce((r, n) => r + Number(n.value), 0)
|
||||
.toFixed(2);
|
||||
yearOptions.value = resp.sortArray;
|
||||
});
|
||||
|
|
|
@ -643,7 +643,10 @@ const handleTransportChange = () => {
|
|||
*/
|
||||
const allListPorts = ref([]);
|
||||
const setPorts = () => {
|
||||
if (!formData.value.host) return;
|
||||
if (!formData.value.host) {
|
||||
allListPorts.value = []
|
||||
return
|
||||
};
|
||||
allListPorts.value = allList.value
|
||||
.find((f: any) => f.host === formData.value.host)
|
||||
?.ports[formData.value.transport || '']?.map((m: string) => ({
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
:before-upload="beforeUpload"
|
||||
:action="FILE_UPLOAD"
|
||||
:headers="{
|
||||
'X-Access-Token': LocalStore.get(TOKEN_KEY),
|
||||
[TOKEN_KEY]: LocalStore.get(TOKEN_KEY),
|
||||
}"
|
||||
v-bind="props"
|
||||
>
|
||||
|
|
|
@ -267,11 +267,11 @@ const confirm = () => {
|
|||
const formRef = ref<FormInstance>();
|
||||
const form = reactive({
|
||||
data: {} as formType,
|
||||
|
||||
rules: {
|
||||
checkUserName: (_rule: Rule, value: string): Promise<any> =>
|
||||
new Promise((resolve, reject) => {
|
||||
if (props.type === 'edit') return resolve('');
|
||||
if(props.type==='edit') return resolve('')
|
||||
else if(!value) return reject('请输入用户名');
|
||||
else if (value.length > 64) return reject('最多可输入64个字符');
|
||||
validateField_api('username', value).then((resp: any): any => {
|
||||
resp.result.passed
|
||||
|
|
Loading…
Reference in New Issue