feat: 同步规则优化

This commit is contained in:
GaoHao
2025-04-11 17:25:02 +08:00
parent 85eba13919
commit 688f30635b
8 changed files with 59 additions and 43 deletions

View File

@@ -125,20 +125,16 @@ if (conName) {
searchConfig.formItems[1].initialValue = conName;
}
}
console.log(isSyncStatus())
console.log(contentConfig)
if (isSyncStatus()) {
if( JSON.stringify(contentConfig.toolbar)?.indexOf("add") != -1){
contentConfig.toolbar?.splice(0, 1)
}
if( JSON.stringify(contentConfig.cols[contentConfig.cols.length-1].operat)?.indexOf("delete") != -1){
contentConfig.cols[contentConfig.cols.length-1].operat?.splice(2, 1)
}
}else {
if( JSON.stringify(contentConfig.toolbar)?.indexOf("sync") != -1){
contentConfig.toolbar?.splice(1, 1)
}
contentConfig.toolbar[0].hidden = true
contentConfig.toolbar[1].hidden = false
} else {
contentConfig.toolbar[0].hidden = false
contentConfig.toolbar[1].hidden = true
}
//统计数据
const gongjiData = reactive({ totalRow: 0 });
function getTongji(params: IObject | undefined) {
@@ -208,7 +204,7 @@ async function handleEditClick(row: IObject) {
// 其他工具栏
async function handleToolbarClick(name: string) {
console.log(name);
if( name === 'sync' ){
if (name === 'sync') {
let res = await UserAPI.sync()
ElMessage.success('操作成功,数据正在后台同步中...')
return;