From c956972cb34fe3e5b2da673b7837ad844da5380b Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Fri, 11 Apr 2025 16:53:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8C=E6=AD=A5=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/user.ts | 1 + src/views/product/index.vue | 23 +++++++++++++---------- src/views/product/indexconfig/content.ts | 8 +++++++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/api/system/user.ts b/src/api/system/user.ts index 223ad79..4cbd9df 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -246,6 +246,7 @@ export interface UserInfo { * 用户分页查询对象 */ export interface UserPageQuery extends PageQuery { + times: any; /** 搜索关键字 */ keywords?: string; diff --git a/src/views/product/index.vue b/src/views/product/index.vue index 7e7c056..d38bc3f 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -200,18 +200,21 @@ let datas = reactive({ remark: "", images: [] }); +console.log(isSyncStatus()) +console.log(contentConfig.toolbar) if (isSyncStatus()) { - if( JSON.stringify(contentConfig.toolbar)?.indexOf("add") != -1){ - contentConfig.toolbar?.splice(0, 1) + 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) + 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) +} else { + if (JSON.stringify(contentConfig.toolbar)?.indexOf("sync") != -1) { + // contentConfig.toolbar?.splice(1, 1) } } +console.log(contentConfig.toolbar) onMounted(() => { console.log(route.query); @@ -220,7 +223,7 @@ onMounted(() => { } // 获取耗材列表 gethaocaiList() - + }); function newHandleQueryClick(e: IObject | undefined) { const filterParams = contentRef.value?.getFilterParams(); @@ -324,11 +327,11 @@ async function handleEditClick(row: IObject) { // 其他工具栏 async function handleToolbarClick(name: string) { console.log(name); - if ( name === "custom1" ) { + if (name === "custom1") { // ElMessage.success("点击了自定义1按钮"); myDialogRef.value.open(); } - if ( name === "sync" ) { //商品同步 + if (name === "sync") { //商品同步 let res = await UserAPI.sync() ElMessage.success('操作成功,数据正在后台同步中...') } diff --git a/src/views/product/indexconfig/content.ts b/src/views/product/indexconfig/content.ts index 433bb17..fd7bc20 100644 --- a/src/views/product/indexconfig/content.ts +++ b/src/views/product/indexconfig/content.ts @@ -58,7 +58,13 @@ const contentConfig: IContentConfig = { }, pk: "id", toolbar: [ - "add", + { + icon: "plus", + text: "新增", + type: "primary", + name: "add", + auth: "import", + }, { icon: "refresh", text: "同步",