feat: 同步规则优化
This commit is contained in:
@@ -20,7 +20,15 @@ const contentConfig: IContentConfig = {
|
||||
return Api.edit(data);
|
||||
},
|
||||
pk: "id",
|
||||
toolbar: ["add"],
|
||||
toolbar: [
|
||||
{
|
||||
icon: "plus",
|
||||
text: "新增",
|
||||
type: "primary",
|
||||
name: "add",
|
||||
auth: "import",
|
||||
},
|
||||
],
|
||||
defaultToolbar: ["refresh", "filter", "search"],
|
||||
cols: [
|
||||
// { type: "selection", width: 50, align: "center" },
|
||||
@@ -49,7 +57,7 @@ const contentConfig: IContentConfig = {
|
||||
fixed: "right",
|
||||
width: 280,
|
||||
templet: "tool",
|
||||
operat: ["edit"],
|
||||
operat: [{ text: "编辑", icon: 'edit', name: "edit"}],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -89,13 +89,13 @@ const {
|
||||
} = usePage();
|
||||
|
||||
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("edit") != -1){
|
||||
contentConfig.cols[contentConfig.cols.length-1].operat?.splice(0, 1)
|
||||
}
|
||||
contentConfig.toolbar[0].hidden = true
|
||||
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = true
|
||||
} else {
|
||||
contentConfig.toolbar[0].hidden = false
|
||||
contentConfig.cols[contentConfig.cols.length - 1].operat[0].hidden = false
|
||||
}
|
||||
|
||||
// 新增
|
||||
async function handleAddClick() {
|
||||
addModalRef.value?.setModalVisible();
|
||||
|
||||
Reference in New Issue
Block a user