Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
8c2af7fe76
|
@ -164,5 +164,6 @@ function syncTriggerClass(
|
||||||
.j-ellipsis-line-clamp {
|
.j-ellipsis-line-clamp {
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<template v-if="isPermission">
|
<template v-if="isPermission">
|
||||||
<template v-if="popConfirm">
|
<template v-if="popConfirm">
|
||||||
<j-popconfirm v-bind="popConfirm" :disabled="!isPermission || props.disabled">
|
<j-popconfirm :overlayStyle='{minWidth: "180px"}' v-bind="popConfirm" :disabled="!isPermission || props.disabled">
|
||||||
<j-tooltip v-if="tooltip" v-bind="tooltip">
|
<j-tooltip v-if="tooltip" v-bind="tooltip">
|
||||||
<slot v-if="noButton"></slot>
|
<slot v-if="noButton"></slot>
|
||||||
<j-button v-else v-bind="props" :disabled="_isPermission" :style="props.style">
|
<j-button v-else v-bind="props" :disabled="_isPermission" :style="props.style">
|
||||||
|
|
|
@ -172,6 +172,7 @@ const objectValue = ref<string>('');
|
||||||
const handleItemModalSubmit = () => {
|
const handleItemModalSubmit = () => {
|
||||||
myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '');
|
myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '');
|
||||||
modalVis.value = false;
|
modalVis.value = false;
|
||||||
|
emit('change', myValue.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 文件上传
|
// 文件上传
|
||||||
|
|
|
@ -84,6 +84,7 @@ import TopCard from '@/views/device/DashBoard/components/TopCard.vue';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import Amap from './components/Amap.vue';
|
import Amap from './components/Amap.vue';
|
||||||
import { useSystem } from '@/store/system';
|
import { useSystem } from '@/store/system';
|
||||||
|
import dayjs from 'dayjs'
|
||||||
const system = useSystem();
|
const system = useSystem();
|
||||||
const AmapKey = system.$state.configInfo.amap?.apiKey;
|
const AmapKey = system.$state.configInfo.amap?.apiKey;
|
||||||
let productTotal = ref(0);
|
let productTotal = ref(0);
|
||||||
|
@ -206,6 +207,9 @@ getDeviceData();
|
||||||
* 获取在线数量
|
* 获取在线数量
|
||||||
*/
|
*/
|
||||||
const getOnline = () => {
|
const getOnline = () => {
|
||||||
|
const startTime = dayjs().subtract(0, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const endTime = dayjs().subtract(0, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
dashboard([
|
dashboard([
|
||||||
{
|
{
|
||||||
dashboard: 'device',
|
dashboard: 'device',
|
||||||
|
@ -215,26 +219,34 @@ const getOnline = () => {
|
||||||
group: 'aggOnline',
|
group: 'aggOnline',
|
||||||
params: {
|
params: {
|
||||||
state: 'online',
|
state: 'online',
|
||||||
limit: 15,
|
limit: 24,
|
||||||
from: 'now-15d',
|
from: startTime,
|
||||||
time: '1d',
|
to: endTime,
|
||||||
format: 'yyyy-MM-dd',
|
time: '1h',
|
||||||
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]).then((res) => {
|
]).then((res) => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
const x = res.result
|
// const x = res.result
|
||||||
.map((item: any) => item.data.timeString)
|
// .map((item: any) => item.data.timeString)
|
||||||
.reverse();
|
// .reverse();
|
||||||
const y = res.result.map((item: any) => item.data.value);
|
// const y = res.result.map((item: any) => item.data.value);
|
||||||
|
const x: string[] = [];
|
||||||
|
const y: number[] = [];
|
||||||
|
(res.result as any)?.forEach((item: any) => {
|
||||||
|
x.push(item.data.timeString)
|
||||||
|
y.push(item.data.value)
|
||||||
|
})
|
||||||
|
x.reverse()
|
||||||
const onlineYdata = y;
|
const onlineYdata = y;
|
||||||
onlineYdata.reverse();
|
onlineYdata.reverse();
|
||||||
setOnlineChartOpition(x, onlineYdata);
|
setOnlineChartOption(x, onlineYdata);
|
||||||
onlineFooter.value[0].value = y?.[1];
|
onlineFooter.value[0].value = y?.[1];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const setOnlineChartOpition = (x: Array<any>, y: Array<number>): void => {
|
const setOnlineChartOption = (x: Array<any>, y: Array<number>): void => {
|
||||||
onlineOptions.value = {
|
onlineOptions.value = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</j-select>
|
</j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-form-item label="选择产品" v-bind="validateInfos.copy" v-if="formModel.type === 'copy'">
|
<j-form-item label="选择产品" v-bind="validateInfos.copy" v-if="formModel.type === 'copy'">
|
||||||
<j-select :options="productList" v-model:value="formModel.copy" option-filter-prop="label" filterable></j-select>
|
<j-select :options="productList" v-model:value="formModel.copy" option-filter-prop="label" showSearch></j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-form-item label="物模型类型" v-bind="validateInfos.metadata" v-if="type === 'device' || formModel.type === 'import'">
|
<j-form-item label="物模型类型" v-bind="validateInfos.metadata" v-if="type === 'device' || formModel.type === 'import'">
|
||||||
<j-select v-model:value="formModel.metadata">
|
<j-select v-model:value="formModel.metadata">
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
<div class="card-item-content-text">
|
<div class="card-item-content-text">
|
||||||
绑定设备
|
绑定设备
|
||||||
</div>
|
</div>
|
||||||
<div>{{ slotProps.deviceName }}</div>
|
<Ellipsis>{{ slotProps.deviceName }}</Ellipsis>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
<j-divider style="margin: 12px 0" />
|
<j-divider style="margin: 12px 0" />
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<CardSelect v-model:value="formModel.type" :options="options"/>
|
<CardSelect v-model:value="formModel.type" :options="options.filter(item => !(item.value === 'delay' && parallel))"/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<ActionTypeComponent
|
<ActionTypeComponent
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<j-modal
|
<j-modal
|
||||||
title="执行动作"
|
title="执行动作"
|
||||||
visible
|
visible
|
||||||
:width="860"
|
:width="800"
|
||||||
@cancel="onCancel"
|
@cancel="onCancel"
|
||||||
@ok="onOk"
|
@ok="onOk"
|
||||||
:maskClosable="false"
|
:maskClosable="false"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<pro-search
|
<pro-search
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
target="category"
|
target="category"
|
||||||
@search="(params:any)=>queryParams = {...params}"
|
@search="handleParams"
|
||||||
/>
|
/>
|
||||||
<j-pro-table
|
<j-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
@ -119,8 +119,8 @@ const columns = [
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'state',
|
dataIndex: 'status',
|
||||||
key: 'state',
|
key: 'status',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
search: {
|
search: {
|
||||||
|
@ -149,6 +149,10 @@ const columns = [
|
||||||
// 搜索参数
|
// 搜索参数
|
||||||
const queryParams = ref({});
|
const queryParams = ref({});
|
||||||
|
|
||||||
|
const handleParams = (params: any) => {
|
||||||
|
queryParams.value = params
|
||||||
|
}
|
||||||
|
|
||||||
// 表格
|
// 表格
|
||||||
const tableRef = ref<Record<string, any>>({}); // 表格实例
|
const tableRef = ref<Record<string, any>>({}); // 表格实例
|
||||||
const table = reactive({
|
const table = reactive({
|
||||||
|
@ -169,6 +173,7 @@ const table = reactive({
|
||||||
value: props.parentId,
|
value: props.parentId,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
type: 'and'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -3700,8 +3700,8 @@ jetlinks-store@^0.0.3:
|
||||||
|
|
||||||
jetlinks-ui-components@^1.0.5:
|
jetlinks-ui-components@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#8cb5c9e68e46e6e7eebc0d96b1cdaab24828779f"
|
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#f5a8ce70859a9c523b2e50b1e3560ae11c21fd0b"
|
||||||
integrity sha512-yIbmplK+twekevr7n+dGMvO8tvyIqguC60TWeJCmx2mUqpwv8dEnr/cwwpJee4PBLWohvGPywsYgmm7KxVBbcw==
|
integrity sha512-raeJHyYE2LLa47FhlO3V7P/86+VDhaABlhB2ShJJZGwpR1mRpr+Y/r+iuW2PDsPST7shgk7lb2xsKrzJ8aZN6A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vueuse/core" "^9.12.0"
|
"@vueuse/core" "^9.12.0"
|
||||||
ant-design-vue "^3.2.15"
|
ant-design-vue "^3.2.15"
|
||||||
|
|
Loading…
Reference in New Issue