feat: 同步规格优化

This commit is contained in:
GaoHao
2025-04-11 16:53:14 +08:00
parent 6df2050d2b
commit c956972cb3
3 changed files with 21 additions and 11 deletions

View File

@@ -246,6 +246,7 @@ export interface UserInfo {
* 用户分页查询对象 * 用户分页查询对象
*/ */
export interface UserPageQuery extends PageQuery { export interface UserPageQuery extends PageQuery {
times: any;
/** 搜索关键字 */ /** 搜索关键字 */
keywords?: string; keywords?: string;

View File

@@ -200,18 +200,21 @@ let datas = reactive({
remark: "", remark: "",
images: [] images: []
}); });
console.log(isSyncStatus())
console.log(contentConfig.toolbar)
if (isSyncStatus()) { if (isSyncStatus()) {
if( JSON.stringify(contentConfig.toolbar)?.indexOf("add") != -1){ if (JSON.stringify(contentConfig.toolbar)?.indexOf("add") != -1) {
contentConfig.toolbar?.splice(0, 1) // contentConfig.toolbar?.splice(0, 1)
} }
if( JSON.stringify(contentConfig.cols[contentConfig.cols.length-1].operat)?.indexOf("delete") != -1){ if (JSON.stringify(contentConfig.cols[contentConfig.cols.length - 1].operat)?.indexOf("delete") != -1) {
contentConfig.cols[contentConfig.cols.length-1].operat?.splice(2, 1) contentConfig.cols[contentConfig.cols.length - 1].operat?.splice(2, 1)
} }
}else { } else {
if( JSON.stringify(contentConfig.toolbar)?.indexOf("sync") != -1){ if (JSON.stringify(contentConfig.toolbar)?.indexOf("sync") != -1) {
contentConfig.toolbar?.splice(1, 1) // contentConfig.toolbar?.splice(1, 1)
} }
} }
console.log(contentConfig.toolbar)
onMounted(() => { onMounted(() => {
console.log(route.query); console.log(route.query);
@@ -220,7 +223,7 @@ onMounted(() => {
} }
// 获取耗材列表 // 获取耗材列表
gethaocaiList() gethaocaiList()
}); });
function newHandleQueryClick(e: IObject | undefined) { function newHandleQueryClick(e: IObject | undefined) {
const filterParams = contentRef.value?.getFilterParams(); const filterParams = contentRef.value?.getFilterParams();
@@ -324,11 +327,11 @@ async function handleEditClick(row: IObject) {
// 其他工具栏 // 其他工具栏
async function handleToolbarClick(name: string) { async function handleToolbarClick(name: string) {
console.log(name); console.log(name);
if ( name === "custom1" ) { if (name === "custom1") {
// ElMessage.success("点击了自定义1按钮"); // ElMessage.success("点击了自定义1按钮");
myDialogRef.value.open(); myDialogRef.value.open();
} }
if ( name === "sync" ) { //商品同步 if (name === "sync") { //商品同步
let res = await UserAPI.sync() let res = await UserAPI.sync()
ElMessage.success('操作成功,数据正在后台同步中...') ElMessage.success('操作成功,数据正在后台同步中...')
} }

View File

@@ -58,7 +58,13 @@ const contentConfig: IContentConfig<UserPageQuery> = {
}, },
pk: "id", pk: "id",
toolbar: [ toolbar: [
"add", {
icon: "plus",
text: "新增",
type: "primary",
name: "add",
auth: "import",
},
{ {
icon: "refresh", icon: "refresh",
text: "同步", text: "同步",