Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
09a3873546
|
@ -0,0 +1,59 @@
|
||||||
|
.config .title {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.config .title::before {
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: #2810ff;
|
||||||
|
content: '|';
|
||||||
|
}
|
||||||
|
.config .item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.config .item .context {
|
||||||
|
margin: 5px 0;
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 630px;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #e6e6e6;
|
||||||
|
}
|
||||||
|
.driver .driver-next-btn {
|
||||||
|
color: #fff !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
line-height: 22px !important;
|
||||||
|
text-shadow: 0 0 black !important;
|
||||||
|
background-color: #2f54eb !important;
|
||||||
|
}
|
||||||
|
.driver .driver-prev-btn {
|
||||||
|
font-size: 14px !important;
|
||||||
|
line-height: 22px !important;
|
||||||
|
background-color: #fff !important;
|
||||||
|
}
|
||||||
|
.driver .driver-prev-btn.driver-disabled {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.driver .driver-close-btn {
|
||||||
|
padding: 5px 0 0 0 !important;
|
||||||
|
color: #828282 !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
background-color: #fff !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
.driver .driver-popover-description {
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
.driver .driver-popover-title {
|
||||||
|
display: flex !important;
|
||||||
|
justify-content: space-between !important;
|
||||||
|
}
|
||||||
|
.driver .driver-popover-title #guide {
|
||||||
|
margin-top: 3px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
|
@ -487,6 +487,7 @@ defineExpose({
|
||||||
.button-style {
|
.button-style {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 66px;
|
height: 66px;
|
||||||
|
overflow: hidden;
|
||||||
.card-content {
|
.card-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.img-style {
|
.img-style {
|
||||||
|
@ -498,23 +499,35 @@ defineExpose({
|
||||||
right: -22px;
|
right: -22px;
|
||||||
bottom: -22px;
|
bottom: -22px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
color: #2f54eb;
|
color: #fff;
|
||||||
// background-color: #2f54eb;
|
background-color: @primary-color-active;
|
||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
background-color: transparent;
|
|
||||||
|
> span {
|
||||||
|
position: absolute;
|
||||||
|
top: 6px;
|
||||||
|
left: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.checked {
|
||||||
|
position: relative;
|
||||||
|
color: @primary-color-active;
|
||||||
|
border-color: @primary-color-active;
|
||||||
|
|
||||||
|
> .checked-icon {
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// &:hover {
|
|
||||||
// color: #2f54eb;
|
|
||||||
// border: 1px solid #2f54eb;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -15,9 +15,19 @@
|
||||||
:params="params"
|
:params="params"
|
||||||
>
|
>
|
||||||
<template #headerTitle>
|
<template #headerTitle>
|
||||||
<a-button type="primary" @click="add"
|
<a-space>
|
||||||
><plus-outlined />新增</a-button
|
<a-button type="primary" @click="add"
|
||||||
>
|
><plus-outlined />新增</a-button
|
||||||
|
>
|
||||||
|
<a-upload
|
||||||
|
name="file"
|
||||||
|
accept=".json"
|
||||||
|
:showUploadList="false"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
>
|
||||||
|
<a-button>导入</a-button>
|
||||||
|
</a-upload>
|
||||||
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<template #deviceType="slotProps">
|
<template #deviceType="slotProps">
|
||||||
<div>{{ slotProps.deviceType.text }}</div>
|
<div>{{ slotProps.deviceType.text }}</div>
|
||||||
|
@ -172,8 +182,10 @@ import {
|
||||||
addProduct,
|
addProduct,
|
||||||
editProduct,
|
editProduct,
|
||||||
queryProductId,
|
queryProductId,
|
||||||
|
updateDevice,
|
||||||
} from '@/api/device/product';
|
} from '@/api/device/product';
|
||||||
import { isNoCommunity } from '@/utils/utils';
|
import { isNoCommunity, downloadObject } from '@/utils/utils';
|
||||||
|
import { omit } from 'lodash-es';
|
||||||
import { typeOptions } from '@/components/Search/util';
|
import { typeOptions } from '@/components/Search/util';
|
||||||
import Save from './Save/index.vue';
|
import Save from './Save/index.vue';
|
||||||
/**
|
/**
|
||||||
|
@ -293,6 +305,17 @@ const getActions = (
|
||||||
},
|
},
|
||||||
|
|
||||||
icon: 'icon-xiazai',
|
icon: 'icon-xiazai',
|
||||||
|
onClick: () => {
|
||||||
|
const extra = omit(data, [
|
||||||
|
'transportProtocol',
|
||||||
|
'protocolName',
|
||||||
|
'accessId',
|
||||||
|
'accessName',
|
||||||
|
'accessProvider',
|
||||||
|
'messageProtocol',
|
||||||
|
]);
|
||||||
|
downloadObject(extra, '产品');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
@ -356,6 +379,42 @@ const add = () => {
|
||||||
saveRef.value.show(currentForm.value);
|
saveRef.value.show(currentForm.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入
|
||||||
|
*/
|
||||||
|
const beforeUpload = (file: any) => {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.readAsText(file);
|
||||||
|
reader.onload = async (result) => {
|
||||||
|
const text = result.target?.result;
|
||||||
|
console.log('text: ', text);
|
||||||
|
if (!file.type.includes('json')) {
|
||||||
|
message.error('请上传json格式文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(text || '{}');
|
||||||
|
// 设置导入的产品状态为未发布
|
||||||
|
data.state = 0;
|
||||||
|
if (Array.isArray(data)) {
|
||||||
|
message.error('请上传json格式文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
delete data.state;
|
||||||
|
const res = await updateDevice(data);
|
||||||
|
if (res.status === 200) {
|
||||||
|
message.success('操作成功');
|
||||||
|
tableRef.value?.reload();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
message.error('请上传json格式文件');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
return false;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* 查看
|
* 查看
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
<Guide title="数据统计" />
|
<Guide title="数据统计" />
|
||||||
<div class="static-info" style="min-height: 490px">
|
<div class="static-info" style="min-height: 490px">
|
||||||
<div class="data-statistics-item">
|
<div class="data-statistics-item">
|
||||||
<div class="info" style="width: 100%">
|
<div class="flow-info" style="width: 100%">
|
||||||
<div class="label">昨日流量消耗</div>
|
<div class="label">昨日流量消耗</div>
|
||||||
<a-tooltip placement="bottomLeft">
|
<a-tooltip placement="bottomLeft">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="data-statistics-item">
|
<div class="data-statistics-item">
|
||||||
<div class="info" style="width: 100%">
|
<div class="flow-info" style="width: 100%">
|
||||||
<div class="label">当月流量消耗</div>
|
<div class="label">当月流量消耗</div>
|
||||||
<a-tooltip placement="bottomLeft">
|
<a-tooltip placement="bottomLeft">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
<LineChart :chartData="monthOptions" />
|
<LineChart :chartData="monthOptions" />
|
||||||
</div>
|
</div>
|
||||||
<div class="data-statistics-item">
|
<div class="data-statistics-item">
|
||||||
<div class="info" style="width: 100%">
|
<div class="flow-info" style="width: 100%">
|
||||||
<div class="label">本年流量消耗</div>
|
<div class="label">本年流量消耗</div>
|
||||||
<a-tooltip placement="bottomLeft">
|
<a-tooltip placement="bottomLeft">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -328,7 +328,7 @@ getDataTotal();
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
||||||
.info {
|
.flow-info {
|
||||||
// width: 180px;
|
// width: 180px;
|
||||||
width: 28%;
|
width: 28%;
|
||||||
.label {
|
.label {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<a-col :span="24"><Guide title="数据统计" /></a-col>
|
<a-col :span="24"><Guide title="数据统计" /></a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<div class="data-statistics-item">
|
<div class="data-statistics-item">
|
||||||
<div class="info" style="width: 100%">
|
<div class="flow-info" style="width: 100%">
|
||||||
<div class="label">昨日流量消耗</div>
|
<div class="label">昨日流量消耗</div>
|
||||||
<a-tooltip placement="bottomLeft">
|
<a-tooltip placement="bottomLeft">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<div class="data-statistics-item">
|
<div class="data-statistics-item">
|
||||||
<div class="info" style="width: 100%">
|
<div class="flow-info" style="width: 100%">
|
||||||
<div class="label">当月流量消耗</div>
|
<div class="label">当月流量消耗</div>
|
||||||
<a-tooltip placement="bottomLeft">
|
<a-tooltip placement="bottomLeft">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<div class="data-statistics-item">
|
<div class="data-statistics-item">
|
||||||
<div class="info" style="width: 100%">
|
<div class="flow-info" style="width: 100%">
|
||||||
<div class="label">本年流量消耗</div>
|
<div class="label">本年流量消耗</div>
|
||||||
<a-tooltip placement="bottomLeft">
|
<a-tooltip placement="bottomLeft">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -279,7 +279,7 @@ getDataTotal();
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
||||||
.info {
|
.flow-info {
|
||||||
// width: 180px;
|
// width: 180px;
|
||||||
width: 28%;
|
width: 28%;
|
||||||
.label {
|
.label {
|
||||||
|
|
Loading…
Reference in New Issue