diff --git a/src/api/demo/demo/index.ts b/src/api/demo/demo/index.ts index 7441720..6882b9d 100644 --- a/src/api/demo/demo/index.ts +++ b/src/api/demo/demo/index.ts @@ -1,13 +1,14 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { DemoVO, DemoForm, DemoQuery } from '@/api/demo/demo/types'; +import { DemoVO, DemoForm, DemoPageQuery, DemoCountQuery } from '@/api/demo/demo/types'; /** * 查询测试单列表 * @param query * @returns {*} */ -export const listDemo = (query?: DemoQuery): AxiosPromise => { + +export const listDemo = (query?: DemoPageQuery): AxiosPromise => { return request({ url: '/demo/demo/list', method: 'get', @@ -15,6 +16,19 @@ export const listDemo = (query?: DemoQuery): AxiosPromise => { }); }; +/** + * 查询测试单数量 + * @param query + * @returns {*} + */ + +export const countDemo = (query?: DemoCountQuery): AxiosPromise => { + return request({ + url: '/demo/demo/count', + method: 'get', + params: query + }); +}; /** * 查询测试单详细 * @param id diff --git a/src/api/demo/demo/types.ts b/src/api/demo/demo/types.ts index ea51d32..c7a8d77 100644 --- a/src/api/demo/demo/types.ts +++ b/src/api/demo/demo/types.ts @@ -62,7 +62,7 @@ export interface DemoForm extends BaseEntity { value?: string; } -export interface DemoQuery extends PageQuery { +export interface DemoPageQuery extends PageQuery { /** * 部门id */ @@ -87,4 +87,41 @@ export interface DemoQuery extends PageQuery { * 值 */ value?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + +export interface DemoCountQuery { + /** + * 部门id + */ + deptId?: string | number; + + /** + * 用户id + */ + userId?: string | number; + + /** + * 排序号 + */ + orderNum?: number; + + /** + * key键 + */ + testKey?: string; + + /** + * 值 + */ + value?: string; + + /** + * 日期范围参数 + */ + params?: any; } diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue index 09036b7..0f4219f 100644 --- a/src/components/RightToolbar/index.vue +++ b/src/components/RightToolbar/index.vue @@ -7,13 +7,23 @@ - - + + +
显示/隐藏列
+ + +
- - - @@ -29,15 +39,9 @@ const props = defineProps({ gutter: propTypes.number.def(10), }) +const columnRef = ref(); const emits = defineEmits(['update:showSearch', 'queryTable']); -// 显隐数据 -const value = ref>([]); -// 弹出层标题 -const title = ref("显示/隐藏"); -// 是否显示弹出层 -const open = ref(false); - const style = computed(() => { const ret: any = {}; if (props.gutter) { @@ -56,23 +60,19 @@ function refresh() { emits("queryTable"); } -// 右侧列表元素变化 -function dataChange(data: TransferKey[]) { - props.columns?.forEach((item) => { - item.visible = !data.includes(item.key); - }) -} - -// 打开显隐列dialog -const showColumn = () => { - open.value = true; +// 更改数据列的显示和隐藏 +function columnChange(...args: any[]) { + props.columns?.forEach((item) => { + item.visible = args[1].checkedKeys.includes(item.key); + }) } // 显隐列初始默认隐藏列 onMounted(() => { props.columns?.forEach((item) => { - if (!item.visible) { - value.value.push(item.key); + if (item.visible) { + columnRef.value?.setChecked(item.key, true, false); + // value.value.push(item.key); } }) }) @@ -91,4 +91,9 @@ onMounted(() => { .my-el-transfer { text-align: center; } +.tree-header{ + width: 100%; + line-height: 24px; + text-align: center; +} diff --git a/src/types/global.d.ts b/src/types/global.d.ts index b9bc5f4..130f855 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -13,6 +13,7 @@ declare global { key: number; label: string; visible: boolean; + children: Array; } /** diff --git a/src/views/demo/demo/index.vue b/src/views/demo/demo/index.vue index a7f3bd7..b7a1f18 100644 --- a/src/views/demo/demo/index.vue +++ b/src/views/demo/demo/index.vue @@ -1,34 +1,32 @@