Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev

This commit is contained in:
100011797 2023-07-14 13:51:43 +08:00
commit 30de9c322a
2 changed files with 10 additions and 5 deletions

View File

@ -43,7 +43,7 @@
</j-space> </j-space>
</j-tooltip> </j-tooltip>
</template> </template>
<template #channelId="slotProps"> <template #gbChannelId="slotProps">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<Ellipsis style="width: 150px"> <Ellipsis style="width: 150px">
{{ slotProps.gbChannelId }} {{ slotProps.gbChannelId }}
@ -180,8 +180,8 @@ const columns = [
}, },
{ {
title: '国标ID', title: '国标ID',
dataIndex: 'channelId', dataIndex: 'gbChannelId',
key: 'channelId', key: 'gbChannelId',
scopedSlots: true, scopedSlots: true,
width: 200, width: 200,
headerCell: 'gbChannelIdHeader', // headerCell: 'gbChannelIdHeader', //

View File

@ -77,7 +77,7 @@ const handleHeader= (data:any) =>{
}) })
} }
const dataSource = reactive({ const dataSource = reactive({
table:props.headers.length > 0 ? handleHeader(props.headers) : '' table:props.headers.length > 0 ? handleHeader(props.headers) : []
}); });
watch(()=>JSON.stringify(props.headers),()=>{ watch(()=>JSON.stringify(props.headers),()=>{
@ -102,12 +102,17 @@ const handleAdd = () => {
}; };
const validate = () =>{ const validate = () =>{
return new Promise((resolve:any,reject:any)=>{ return new Promise((resolve:any,reject:any)=>{
tableRef.value.validate().then(()=>{ if(dataSource.table){
tableRef.value.validate().then(()=>{
valueChange() valueChange()
resolve(data.value) resolve(data.value)
}).catch((err:any)=>{ }).catch((err:any)=>{
console.log(err);
reject(false) reject(false)
}) })
}else{
resolve([])
}
}) })
} }
defineExpose({ defineExpose({