diff --git a/frontend/components.d.ts b/frontend/components.d.ts index dac9717..6ef1e51 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -10,12 +10,18 @@ declare module 'vue' { 403: typeof import('./src/components/ErrorMessage/403.vue')['default'] 404: typeof import('./src/components/ErrorMessage/404.vue')['default'] 500: typeof import('./src/components/ErrorMessage/500.vue')['default'] + ColSetting: typeof import('./src/components/ProTable/components/ColSetting.vue')['default'] + ComplexProTable: typeof import('./src/components/proTable/complexProTable/index.vue')['default'] + Default: typeof import('./src/components/echarts/pie/default.vue')['default'] + Detail: typeof import('./src/components/proTable/useProTable/detail.vue')['default'] + Document: typeof import('./src/components/proTable/document/index.vue')['default'] ElAside: typeof import('element-plus/es')['ElAside'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] ElContainer: typeof import('element-plus/es')['ElContainer'] + ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] @@ -31,16 +37,39 @@ declare module 'vue' { ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] + ElOption: typeof import('element-plus/es')['ElOption'] + ElPagination: typeof import('element-plus/es')['ElPagination'] + ElRadio: typeof import('element-plus/es')['ElRadio'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] + ElSelect: typeof import('element-plus/es')['ElSelect'] + ElSpace: typeof import('element-plus/es')['ElSpace'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] + ElTable: typeof import('element-plus/es')['ElTable'] + ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] + ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] + ElTree: typeof import('element-plus/es')['ElTree'] + ElUpload: typeof import('element-plus/es')['ElUpload'] + Grid: typeof import('./src/components/Grid/index.vue')['default'] + GridItem: typeof import('./src/components/Grid/components/GridItem.vue')['default'] + ImportExcel: typeof import('./src/components/ImportExcel/index.vue')['default'] Loading: typeof import('./src/components/Loading/index.vue')['default'] + Pagination: typeof import('./src/components/ProTable/components/Pagination.vue')['default'] + ProTable: typeof import('./src/components/ProTable/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + SearchForm: typeof import('./src/components/SearchForm/index.vue')['default'] + SearchFormItem: typeof import('./src/components/SearchForm/components/SearchFormItem.vue')['default'] SvgIcon: typeof import('./src/components/staticExtend/SvgIcon/src/SvgIcon.vue')['default'] SwitchDark: typeof import('./src/components/SwitchDark/index.vue')['default'] + TableColumn: typeof import('./src/components/ProTable/components/TableColumn.vue')['default'] + TreeProTable: typeof import('./src/components/proTable/treeProTable/index.vue')['default'] + UseProTable: typeof import('./src/components/proTable/useProTable/index.vue')['default'] + UserDrawer: typeof import('./src/components/proTable/components/UserDrawer.vue')['default'] + UseSelectFilter: typeof import('./src/components/proTable/useSelectFilter/index.vue')['default'] + UseTreeFilter: typeof import('./src/components/proTable/useTreeFilter/index.vue')['default'] } } diff --git a/frontend/src/api/plan/planList.ts b/frontend/src/api/plan/planList.ts new file mode 100644 index 0000000..fbebcc1 --- /dev/null +++ b/frontend/src/api/plan/planList.ts @@ -0,0 +1,11 @@ +import http from "@/api"; + +//获取计划列表 +export const getPlanList = (data: any) => { + return http.post( + "http://192.168.1.123:4523/m1/2573730-0-default/plan/planList/list", + data, + { loading: false } + ); + }; + \ No newline at end of file diff --git a/frontend/src/components/Grid/components/GridItem.vue b/frontend/src/components/Grid/components/GridItem.vue new file mode 100644 index 0000000..c506cce --- /dev/null +++ b/frontend/src/components/Grid/components/GridItem.vue @@ -0,0 +1,68 @@ + + diff --git a/frontend/src/components/Grid/index.vue b/frontend/src/components/Grid/index.vue new file mode 100644 index 0000000..38200f4 --- /dev/null +++ b/frontend/src/components/Grid/index.vue @@ -0,0 +1,167 @@ + + + diff --git a/frontend/src/components/Grid/interface/index.ts b/frontend/src/components/Grid/interface/index.ts new file mode 100644 index 0000000..a0beff2 --- /dev/null +++ b/frontend/src/components/Grid/interface/index.ts @@ -0,0 +1,6 @@ +export type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl"; + +export type Responsive = { + span?: number; + offset?: number; +}; diff --git a/frontend/src/components/ImportExcel/index.scss b/frontend/src/components/ImportExcel/index.scss new file mode 100644 index 0000000..3a61d6a --- /dev/null +++ b/frontend/src/components/ImportExcel/index.scss @@ -0,0 +1,3 @@ +.upload { + width: 80%; +} diff --git a/frontend/src/components/ImportExcel/index.vue b/frontend/src/components/ImportExcel/index.vue new file mode 100644 index 0000000..8575576 --- /dev/null +++ b/frontend/src/components/ImportExcel/index.vue @@ -0,0 +1,149 @@ + + + + diff --git a/frontend/src/components/ProTable/components/ColSetting.vue b/frontend/src/components/ProTable/components/ColSetting.vue new file mode 100644 index 0000000..e312eec --- /dev/null +++ b/frontend/src/components/ProTable/components/ColSetting.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/frontend/src/components/ProTable/components/Pagination.vue b/frontend/src/components/ProTable/components/Pagination.vue new file mode 100644 index 0000000..5685f48 --- /dev/null +++ b/frontend/src/components/ProTable/components/Pagination.vue @@ -0,0 +1,29 @@ + + + diff --git a/frontend/src/components/ProTable/components/TableColumn.vue b/frontend/src/components/ProTable/components/TableColumn.vue new file mode 100644 index 0000000..38ba940 --- /dev/null +++ b/frontend/src/components/ProTable/components/TableColumn.vue @@ -0,0 +1,58 @@ + + + diff --git a/frontend/src/components/ProTable/index.vue b/frontend/src/components/ProTable/index.vue new file mode 100644 index 0000000..153f19e --- /dev/null +++ b/frontend/src/components/ProTable/index.vue @@ -0,0 +1,333 @@ + + + diff --git a/frontend/src/components/ProTable/interface/index.ts b/frontend/src/components/ProTable/interface/index.ts new file mode 100644 index 0000000..6a80695 --- /dev/null +++ b/frontend/src/components/ProTable/interface/index.ts @@ -0,0 +1,86 @@ +import { VNode, ComponentPublicInstance, Ref } from "vue"; +import { BreakPoint, Responsive } from "@/components/Grid/interface"; +import { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults"; +import { ProTableProps } from "@/components/ProTable/index.vue"; +import ProTable from "@/components/ProTable/index.vue"; + +export interface EnumProps { + label?: string; // 选项框显示的文字 + value?: string | number | boolean | any[]; // 选项框值 + disabled?: boolean; // 是否禁用此选项 + tagType?: string; // 当 tag 为 true 时,此选择会指定 tag 显示类型 + children?: EnumProps[]; // 为树形选择时,可以通过 children 属性指定子选项 + [key: string]: any; +} + +export type TypeProps = "index" | "selection" | "radio" | "expand" | "sort"; + +export type SearchType = + | "input" + | "input-number" + | "select" + | "select-v2" + | "tree-select" + | "cascader" + | "date-picker" + | "time-picker" + | "time-select" + | "switch" + | "slider"; + +export type SearchRenderScope = { + searchParam: { [key: string]: any }; + placeholder: string; + clearable: boolean; + options: EnumProps[]; + data: EnumProps[]; +}; + +export type SearchProps = { + el?: SearchType; // 当前项搜索框的类型 + label?: string; // 当前项搜索框的 label + props?: any; // 搜索项参数,根据 element plus 官方文档来传递,该属性所有值会透传到组件 + key?: string; // 当搜索项 key 不为 prop 属性时,可通过 key 指定 + tooltip?: string; // 搜索提示 + order?: number; // 搜索项排序(从大到小) + span?: number; // 搜索项所占用的列数,默认为 1 列 + offset?: number; // 搜索字段左侧偏移列数 + defaultValue?: string | number | boolean | any[] | Ref; // 搜索项默认值 + render?: (scope: SearchRenderScope) => VNode; // 自定义搜索内容渲染(tsx语法) +} & Partial>; + +export type FieldNamesProps = { + label: string; + value: string; + children?: string; +}; + +export type RenderScope = { + row: T; + $index: number; + column: TableColumnCtx; + [key: string]: any; +}; + +export type HeaderRenderScope = { + $index: number; + column: TableColumnCtx; + [key: string]: any; +}; + +export interface ColumnProps + extends Partial, "type" | "children" | "renderCell" | "renderHeader">> { + type?: TypeProps; // 列类型 + tag?: boolean | Ref; // 是否是标签展示 + isShow?: boolean | Ref; // 是否显示在表格当中 + isSetting?: boolean | Ref; // 是否在 ColSetting 中可配置 + search?: SearchProps | undefined; // 搜索项配置 + enum?: EnumProps[] | Ref | ((params?: any) => Promise); // 枚举字典 + isFilterEnum?: boolean | Ref; // 当前单元格值是否根据 enum 格式化(示例:enum 只作为搜索项数据) + fieldNames?: FieldNamesProps; // 指定 label && value && children 的 key 值 + headerRender?: (scope: HeaderRenderScope) => VNode; // 自定义表头内容渲染(tsx语法) + render?: (scope: RenderScope) => VNode | string; // 自定义单元格内容渲染(tsx语法) + _children?: ColumnProps[]; // 多级表头 +} + +export type ProTableInstance = Omit, keyof ComponentPublicInstance | keyof ProTableProps>; diff --git a/frontend/src/components/SearchForm/components/SearchFormItem.vue b/frontend/src/components/SearchForm/components/SearchFormItem.vue new file mode 100644 index 0000000..db78afd --- /dev/null +++ b/frontend/src/components/SearchForm/components/SearchFormItem.vue @@ -0,0 +1,96 @@ + + + diff --git a/frontend/src/components/SearchForm/index.vue b/frontend/src/components/SearchForm/index.vue new file mode 100644 index 0000000..b961824 --- /dev/null +++ b/frontend/src/components/SearchForm/index.vue @@ -0,0 +1,94 @@ + + diff --git a/frontend/src/hooks/useTable.ts b/frontend/src/hooks/useTable.ts index 4decc65..8ad8624 100644 --- a/frontend/src/hooks/useTable.ts +++ b/frontend/src/hooks/useTable.ts @@ -64,8 +64,7 @@ export const useTable = ( state.tableData = isPageable ? data.list : data; // 解构后台返回的分页数据 (如果有分页更新分页信息) if (isPageable) { - const { pageNum, pageSize, total } = data; - updatePageable({ pageNum, pageSize, total }); + state.pageable.total = data.total; } } catch (error) { requestError && requestError(error); @@ -87,16 +86,7 @@ export const useTable = ( nowSearchParam[key] = state.searchParam[key]; } } - Object.assign(state.totalParam, nowSearchParam, isPageable ? pageParam.value : {}); - }; - - /** - * @description 更新分页信息 - * @param {Object} pageable 后台返回的分页数据 - * @return void - * */ - const updatePageable = (pageable: Table.Pageable) => { - Object.assign(state.pageable, pageable); + Object.assign(state.totalParam, nowSearchParam); }; /** diff --git a/frontend/src/routers/modules/staticRouter.ts b/frontend/src/routers/modules/staticRouter.ts index b21eb82..8cde7b3 100644 --- a/frontend/src/routers/modules/staticRouter.ts +++ b/frontend/src/routers/modules/staticRouter.ts @@ -7,24 +7,46 @@ import { HOME_URL, LOGIN_URL } from "@/config"; export const staticRouter: RouteRecordRaw[] = [ { path: "/", - redirect: HOME_URL + redirect: HOME_URL, }, { path: LOGIN_URL, name: "login", component: () => import("@/views/login/index.vue"), meta: { - title: "登录" - } + title: "登录", + }, }, { path: "/layout", name: "layout", component: () => import("@/layouts/index.vue"), // component: () => import("@/layouts/indexAsync.vue"), - redirect: HOME_URL, - children: [] - } + // redirect: HOME_URL, + children: [ + { + path: "/plan", + name: "plan", + redirect:"/plan/planList", + children: [ + { + path: "/plan/planList", + name: "planList", + component:()=> import("@/views/plan/planList/index.vue"), + meta: { + title: "检测计划列表", + icon: "List", + isLink: "", + isHide: false, + isFull: false, + isAffix: false, + isKeepAlive: false, + }, + }, + ], + }, + ], + }, ]; /** @@ -36,28 +58,28 @@ export const errorRouter = [ name: "403", component: () => import("@/components/ErrorMessage/403.vue"), meta: { - title: "403页面" - } + title: "403页面", + }, }, { path: "/404", name: "404", component: () => import("@/components/ErrorMessage/404.vue"), meta: { - title: "404页面" - } + title: "404页面", + }, }, { path: "/500", name: "500", component: () => import("@/components/ErrorMessage/500.vue"), meta: { - title: "500页面" - } + title: "500页面", + }, }, // Resolve refresh page, route warnings { path: "/:pathMatch(.*)*", - component: () => import("@/components/ErrorMessage/404.vue") - } + component: () => import("@/components/ErrorMessage/404.vue"), + }, ]; diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index c87f056..d982067 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -142,7 +142,7 @@ 设备导入 - 计划详情 + 计划详情 @@ -340,6 +340,12 @@ const handleDetection = () => { path: "/detection", }); }; +//前往计划详情 +const planDetail = () => { + router.push({ + path: "/plan/planList", + }); +}; onMounted(() => { console.log(); getTree(); diff --git a/frontend/src/views/machine/testScript/index.vue b/frontend/src/views/machine/testScript/index.vue new file mode 100644 index 0000000..e04c522 --- /dev/null +++ b/frontend/src/views/machine/testScript/index.vue @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue new file mode 100644 index 0000000..f9ca121 --- /dev/null +++ b/frontend/src/views/plan/planList/index.vue @@ -0,0 +1,290 @@ + + + + diff --git a/package.json b/package.json index 204825b..104bc71 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "license": "Apache", "devDependencies": { "@electron/rebuild": "^3.2.13", + "@vitejs/plugin-vue-jsx": "^4.0.1", "debug": "^4.3.3", "ee-bin": "1.6.0", "electron": "^21.4.4", @@ -60,4 +61,4 @@ "electron-updater": "^5.3.0", "lodash": "^4.17.21" } -} \ No newline at end of file +}