fix: bug#11021、11047、11088

This commit is contained in:
jackhoo_98 2023-03-28 10:58:00 +08:00
parent 4782c510d5
commit c7137ea8e5
5 changed files with 64 additions and 26 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<template v-if="isPermission"> <template v-if="isPermission">
<template v-if="popConfirm"> <template v-if="popConfirm">
<j-popconfirm :overlayStyle='{minWidth: "180px"}' v-bind="popConfirm" :disabled="!isPermission || props.disabled"> <j-popconfirm :overlayStyle='{width: "220px"}' 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">

View File

@ -135,6 +135,7 @@
v-model:value="formData.configuration.authType" v-model:value="formData.configuration.authType"
:options="Options['auth-types']" :options="Options['auth-types']"
@change="changeAuthType" @change="changeAuthType"
:column="2"
/> />
</j-form-item> </j-form-item>
<j-form-item <j-form-item

View File

@ -257,6 +257,7 @@ const getActions = (
state === 'enabled' ? '请先禁用该组件,再删除。' : '删除', state === 'enabled' ? '请先禁用该组件,再删除。' : '删除',
}, },
popConfirm: { popConfirm: {
placement: 'topRight',
title: '该操作将会删除下属采集器与点位,确定删除?', title: '该操作将会删除下属采集器与点位,确定删除?',
onConfirm: async () => { onConfirm: async () => {
const res = await remove(data.id); const res = await remove(data.id);

View File

@ -212,6 +212,9 @@ const handleClick = () => {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.card-header-left {
flex: 1;
}
} }
.card-item { .card-item {

View File

@ -64,7 +64,8 @@
hasPermission="DataCollect/Collector:delete" hasPermission="DataCollect/Collector:delete"
:popConfirm="{ :popConfirm="{
title: `确定删除?`, title: `确定删除?`,
onConfirm: () => handlDelete(), onConfirm: () =>
handlBatchDelete(),
}" }"
> >
<template #icon <template #icon
@ -101,9 +102,11 @@
> >
<template #title> <template #title>
<slot name="title"> <slot name="title">
<div class="card-box-title"> <Ellipsis style="width: calc(100% - 10px)">
{{ slotProps.name }} <div class="card-box-title">
</div> {{ slotProps.name }}
</div>
</Ellipsis>
</slot> </slot>
</template> </template>
<template #action> <template #action>
@ -184,7 +187,7 @@
</p> </p>
<p> <p>
{{ {{
moment( dayjs(
propertyValue.get( propertyValue.get(
slotProps.id, slotProps.id,
)?.timestamp, )?.timestamp,
@ -195,24 +198,42 @@
</div> </div>
<div class="card-box-content-right"> <div class="card-box-content-right">
<div <Ellipsis
v-if="getRight1(slotProps)" style="
class="card-box-content-right-1" width: calc(100% - 10px);
margin-bottom: 10px;
"
> >
<span>{{ <div
getQuantity(slotProps) v-if="getRight1(slotProps)"
}}</span> class="card-box-content-right-1"
<span>{{ getAddress(slotProps) }}</span> >
<span>{{ <span>
getScaleFactor(slotProps) {{ getQuantity(slotProps) }}
}}</span> </span>
</div> <span>
<div class="card-box-content-right-2"> {{ getAddress(slotProps) }}
<span>{{ getText(slotProps) }}</span> </span>
<span>{{ <span>
getInterval(slotProps) {{ getScaleFactor(slotProps) }}
}}</span> </span>
</div> </div>
</Ellipsis>
<Ellipsis
style="
width: calc(100% - 10px);
margin-bottom: 10px;
"
>
<div class="card-box-content-right-2">
<span>{{
getText(slotProps)
}}</span>
<span>{{
getInterval(slotProps)
}}</span>
</div>
</Ellipsis>
</div> </div>
</div> </div>
</template> </template>
@ -262,7 +283,7 @@ import { colorMap, getState } from '../data.ts';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import { getWebSocket } from '@/utils/websocket'; import { getWebSocket } from '@/utils/websocket';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import moment from 'moment'; import dayjs from 'dayjs';
const props = defineProps({ const props = defineProps({
data: { data: {
@ -404,6 +425,7 @@ const handlEdit = (data: any) => {
} }
current.value = cloneDeep(data); current.value = cloneDeep(data);
}; };
const handlDelete = async (id: string | undefined = undefined) => { const handlDelete = async (id: string | undefined = undefined) => {
spinning.value = true; spinning.value = true;
const res = !id const res = !id
@ -416,6 +438,18 @@ const handlDelete = async (id: string | undefined = undefined) => {
} }
spinning.value = false; spinning.value = false;
}; };
const handlBatchDelete = () => {
if (_selectedRowKeys.value.length === 0) {
onlyMessage('请先选择', 'warning');
return;
} else {
console.log(2);
handlDelete();
}
};
const handlBatchUpdate = () => { const handlBatchUpdate = () => {
if (_selectedRowKeys.value.length === 0) { if (_selectedRowKeys.value.length === 0) {
onlyMessage('请先选择', 'warning'); onlyMessage('请先选择', 'warning');
@ -590,7 +624,7 @@ const handleSearch = (e: any) => {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.card-box { .card-box {
min-width: 480px; // min-width: 480px;
a { a {
color: #474747; color: #474747;
z-index: 1; z-index: 1;
@ -638,7 +672,6 @@ const handleSearch = (e: any) => {
span { span {
margin: 0 5px 0 0; margin: 0 5px 0 0;
} }
margin-bottom: 10px;
} }
.card-box-content-right-2 { .card-box-content-right-2 {
span { span {