fix: bug#16191、16070、16087、15717、15420

This commit is contained in:
leiqiaochu 2023-07-11 11:53:42 +08:00
parent e4191da93e
commit 2f073b0413
6 changed files with 39 additions and 9 deletions

View File

@ -182,6 +182,7 @@ type Emits = {
(e: 'update:productId', data: string): void;
(e: 'close'): void;
(e: 'save', data: Record<string, any>): void;
(e: 'update:password',data:string):void
};
const emit = defineEmits<Emits>();
@ -288,8 +289,10 @@ const handleOk = () => {
.then(async () => {
btnLoading.value = true;
const res = await DeviceApi.saveProduct(formData.value);
console.log(res)
if (res.success) {
emit('update:productId', res.result.id);
emit('update:password', res.result.configuration.access_pwd)
const deployResp = await DeviceApi.deployProductById(
res.result.id,
);

View File

@ -290,6 +290,7 @@
<SaveProduct
v-model:visible="saveProductVis"
v-model:productId="formData.productId"
v-model:password="formData.others.access_pwd"
:channel="formData.channel"
@close="getProductList"
/>

View File

@ -51,8 +51,8 @@
<j-descriptions-item label="告警流水" :span="2"
><div style="max-height: 500px; overflow-y: auto">
<JsonViewer
:value="JSON.parse(data?.alarmInfo || '{}')"
:expand-depth="5"
:value="data"
:expanded="true" :expandDepth="4"
></JsonViewer></div
></j-descriptions-item>
</j-descriptions>
@ -67,6 +67,10 @@ const props = defineProps({
data: Object,
description: String,
});
const data = computed(()=>{
return JSON.parse(props.data?.alarmInfo);
})
const emit = defineEmits(['close']);
const closeModal = () => {
emit('close');

View File

@ -27,7 +27,9 @@
:params="queryParams"
:rowSelection="{
selectedRowKeys: table._selectedRowKeys.value,
onChange: selectChange,
onSelect: selectChange,
onSelectNone: ()=> table._selectedRowKeys.value = [],
onSelectAll: selectAll
}"
:columns="columns"
>
@ -422,14 +424,33 @@ table.init();
// };
// fix: bug#10749
const selectChange = (record: any,selected: boolean,selectedRows: any,) => {
const arr = new Set(table._selectedRowKeys.value);
if(selected){
table._selectedRowKeys.value.push(record?.id)
arr.add(record.id)
}else{
arr.delete(record.id)
}
console.log(record,selected,selectedRows);
table._selectedRowKeys.value = [...arr.values()]
};
const selectAll = (selected: Boolean, selectedRows: any,changeRows:any) => {
if (selected) {
changeRows.map((i: any) => {
if (!table._selectedRowKeys.value.includes(i.id)) {
table._selectedRowKeys.value.push(i.id)
}
})
} else {
const arr = changeRows.map((item: any) => item.id)
const _ids: string[] = [];
table._selectedRowKeys.value.map((i: any) => {
if (!arr.includes(i)) {
_ids.push(i)
}
})
table._selectedRowKeys.value = _ids
}
}
const cancel = () => {
departmentStore.setProductId()
emits('update:visible', false)

View File

@ -265,7 +265,7 @@ init();
.tree {
overflow-y: auto;
overflow-x: hidden;
overflow-x: auto;
.department-tree-item-content {
display: flex;
@ -274,11 +274,13 @@ init();
.title {
flex: 1;
min-width: 80px;
margin-right: 80px;
}
.func-btns {
display: none;
font-size: 14px;
width: 80px;
margin-left: -80px;
:deep(.ant-btn-link) {
padding: 0 4px;
height: 24px;

View File

@ -112,7 +112,6 @@ const selectAll = (selected: Boolean, selectedRows: any,changeRows:any) => {
})
selectedRowKeys.value = _ids
}
}
}
</script>