fix: bug#11127 11132 11133 11136

This commit is contained in:
leiqiaochu 2023-03-28 15:57:50 +08:00
parent 407f3a8758
commit 0c46c38177
5 changed files with 36 additions and 22 deletions

View File

@ -43,7 +43,7 @@ export const detail = (id: string) => server.get<ProductItem>(`/device-product/$
*
* @param data
*/
export const category = (data: any) => server.post('/device/category/_tree', data)
export const category = (data: any) => server.get('/device/category/_tree?paging=false', data)
/**
*

View File

@ -77,7 +77,7 @@
type="primary"
:popConfirm="{
title: `确定应用配置?`,
onConfirm: handleConfig,
onConfirm: handleDeploy,
}"
:disabled="productStore.current?.state === 0"
:tooltip="

View File

@ -68,7 +68,11 @@
:tree-data="treeList"
@change="valueChange"
allow-clear
:fieldNames="{ label: 'name', value: 'id' }"
:fieldNames="{
label: 'name',
value: 'id',
children: 'children',
}"
:filterTreeNode="
(v, option) => filterSelectNode(v, option)
"
@ -120,11 +124,7 @@ import { FILE_UPLOAD } from '@/api/comm';
import { isInput } from '@/utils/regular';
import type { Rule } from 'ant-design-vue/es/form';
import { queryProductId, addProduct, editProduct } from '@/api/device/product';
import {
SearchOutlined,
CheckOutlined,
DeleteOutlined,
} from '@ant-design/icons-vue';
import encodeQuery from '@/utils/encodeQuery';
const productStore = useProductStore();
const emit = defineEmits(['success']);
const props = defineProps({
@ -246,14 +246,25 @@ const valueChange = (value: string, label: string) => {
* 查询产品分类
*/
const queryProductTree = async () => {
category({
paging: false,
}).then((resp) => {
category(encodeQuery({ sorts: { sortIndex: 'asc' } })).then((resp) => {
if (resp.status === 200) {
treeList.value = resp.result;
treeList.value = dealProductTree(treeList.value);
}
});
};
/**
* 处理产品分类key
*/
const dealProductTree = (arr: any) => {
return arr.map((element: any) => {
element.key = element.id;
if (element.children) {
element.children = dealProductTree(element.children);
}
return element
});
};
watch(
() => props.isAdd,
() => {
@ -326,7 +337,7 @@ const submitData = () => {
//
form.classifiedId
? form.classifiedId
: (form.classifiedId = ''); //
: (form.classifiedId = ''); //
form.classifiedName
? form.classifiedName
: (form.classifiedName = '');

View File

@ -22,7 +22,7 @@
<PermissionButton
type="primary"
@click="add"
hasPermission="device/Instance:add"
hasPermission="rule-engine/Alarm/Configuration:add"
>
<template #icon
><AIcon type="PlusOutlined"
@ -82,7 +82,7 @@
<PermissionButton
:disabled="item.disabled"
:popConfirm="item.popConfirm"
:tooltip="{ ...item.tootip }"
:tooltip="{ ...item.tooltip }"
@click="item.onClick"
:hasPermission="
'rule-engine/Alarm/Configuration:' +

View File

@ -287,7 +287,7 @@ const orgCol = [
},
];
let params:any = ref({
let params: any = ref({
sorts: [{ name: 'alarmTime', order: 'desc' }],
terms: [],
});
@ -369,7 +369,10 @@ const getActions = (
key: 'solve',
text: '告警处理',
tooltip: {
title: '告警处理',
title:
currentData.state?.value === 'normal'
? '无告警'
: '告警处理',
},
icon: 'ToolOutlined',
onClick: () => {
@ -432,14 +435,14 @@ const closeLog = () => {
};
</script>
<style lang="less" scoped>
.content-left{
border-right: .2px solid rgba(0,0,0,0.2);
.content-left {
border-right: 0.2px solid rgba(0, 0, 0, 0.2);
}
.content-right-title{
.content-right-title {
color: #666;
font-size: 12px
font-size: 12px;
}
.content-left-title{
font-size: 18px
.content-left-title {
font-size: 18px;
}
</style>