Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

luoyali 1 жил өмнө
parent
commit
4db471687e

+ 2 - 1
src/hooks/useTablePage.ts

@@ -23,7 +23,8 @@ export const useTablePage = (tableProps: Partial<LeTableProps> = {}, config: Par
 			updateParams: () => {
 				tableOpts.searchParams = {
 					...(tableOpts.searchParams as SearchParams),
-					...searchData.value,
+					// ...searchData.value,
+					data: searchData.value,
 					// ...todo 若有更多操作 searchData 进行请求,请覆盖updateParams 方法
 					page: 1
 				}

+ 16 - 16
src/views/setting/department/index.vue

@@ -188,22 +188,22 @@ const forms = ref([
 		itemType: 'input',
 		placeholder: '请输入角色名称'
 	},
-  {
-    prop: 'status',
-    label: '状态:',
-    itemType: 'select',
-    placeholder: '请选择状态',
-    options: [
-      {
-        label: '禁用',
-        value: 0
-      },
-      {
-        label: '正常',
-        value: 1
-      }
-    ]
-  }
+	{
+		prop: 'status',
+		label: '状态:',
+		itemType: 'select',
+		placeholder: '请选择状态',
+		options: [
+			{
+				label: '禁用',
+				value: 0
+			},
+			{
+				label: '正常',
+				value: 1
+			}
+		]
+	}
 ])
 
 // table 参数

+ 34 - 1
src/views/setting/dict/index.vue

@@ -42,6 +42,8 @@
 			</el-container>
 		</el-aside>
 		<div class="content-warp flex-column-page-wrap">
+			<!-- 公用搜索组件 -->
+			<LeSearchForm ref="searchForm" v-model:searchData="searchData" :forms="forms" :loading="tableOpts.options.loading"></LeSearchForm>
 			<!--  LeTable 组件使用  -->
 			<LeTable
 				ref="tableRef"
@@ -206,9 +208,40 @@ const getGroup = async () => {
 
 // 左侧菜单点击
 const leftTreeClick = data => {
-	searchData.value = { ...searchData.value, data: { pid: data.id ? data.id : null } }
+	searchData.value = { ...searchData.value, pid: data.id ? data.id : null }
 }
 
+// 表格搜索条件
+const forms = ref([
+	{
+		prop: 'name',
+		label: '名称:',
+		itemType: 'input',
+		placeholder: '请输入名称'
+	},
+	{
+		prop: 'code',
+		label: '编码:',
+		itemType: 'input',
+		placeholder: '请输入编码'
+	},
+	{
+		prop: 'status',
+		label: '状态:',
+		itemType: 'select',
+		placeholder: '请选择状态',
+		options: [
+			{
+				label: '禁用',
+				value: 0
+			},
+			{
+				label: '正常',
+				value: 1
+			}
+		]
+	}
+])
 // table列表数据请求
 const queryList = async () => {
 	const { options, searchParams } = tableOpts

+ 16 - 0
src/views/setting/role/index.vue

@@ -140,6 +140,22 @@ const forms = ref([
 		label: '角色名称:',
 		itemType: 'input',
 		placeholder: '请输入角色名称'
+	},
+	{
+		prop: 'status',
+		label: '状态:',
+		itemType: 'select',
+		placeholder: '请选择状态',
+		options: [
+			{
+				label: '禁用',
+				value: 0
+			},
+			{
+				label: '正常',
+				value: 1
+			}
+		]
 	}
 ])
 

+ 2 - 1
src/views/setting/user/index.vue

@@ -264,7 +264,8 @@ const getDepartmentsList = async () => {
 const roleClick = data => {
 	console.log(data.id, 'data.id')
 	// 修改search参数 watch 变更 自动刷新 列表
-	searchData.value = { ...searchData.value, data: { roleId: data.id ? data.id : null } }
+	// searchData.value = { ...searchData.value, data: { roleId: data.id ? data.id : null } }
+	searchData.value = { ...searchData.value, roleId: data.id || null }
 }
 
 // 表格搜索条件