From 57b91b137d5716b7b4bab5c1a3443d2383dcd029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9C=E9=98=B3?= <1301318913@qq.com> Date: Fri, 29 Mar 2024 08:45:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8A=82=E5=81=87=E6=97=A5ap?= =?UTF-8?q?i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 3 + src/api/mes/holidaySetting/index.ts | 61 +++++ .../mes/holidaySetting/holidaySetting.data.ts | 178 +++++++++++++ src/views/mes/holidaySetting/index.vue | 245 ++++++++++++++++++ src/views/mes/jobcalendar/index.vue | 4 +- 5 files changed, 488 insertions(+), 3 deletions(-) create mode 100644 src/api/mes/holidaySetting/index.ts create mode 100644 src/views/mes/holidaySetting/holidaySetting.data.ts create mode 100644 src/views/mes/holidaySetting/index.vue diff --git a/.eslintrc.js b/.eslintrc.js index 3e4af635c..eee5ae3c0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,6 @@ // @ts-check const { defineConfig } = require('eslint-define-config') +const { off } = require('process') module.exports = defineConfig({ root: true, env: { @@ -26,6 +27,8 @@ module.exports = defineConfig({ '@unocss' ], rules: { + //'indent':['off',2], + //"@typescript-eslint/no-this-alias":["off"], 'vue/script-setup-uses-vars': 'error', 'vue/no-reserved-component-names': 'off', 'vue/no-setup-props-destructure': 'off', diff --git a/src/api/mes/holidaySetting/index.ts b/src/api/mes/holidaySetting/index.ts new file mode 100644 index 000000000..979a7e633 --- /dev/null +++ b/src/api/mes/holidaySetting/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface HolidaySettingVO { + id: number + textOne: string + textTwo: string + textThree: string + textFour: string + textFive: string + deleteTime: Date + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + changeEmplId: number + holidayDate: Date + holidayFlag: string + holidayName: string +} + +// 查询节假日设置列表 +export const getHolidaySettingPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/holidaySetting/senior', data }) + } else { + return await request.get({ url: `/mes/holidaySetting/page`, params }) + } +} + +// 查询节假日设置详情 +export const getHolidaySetting = async (id: number) => { + return await request.get({ url: `/mes/holidaySetting/get?id=` + id }) +} + +// 新增节假日设置 +export const createHolidaySetting = async (data: HolidaySettingVO) => { + return await request.post({ url: `/mes/holidaySetting/create`, data }) +} + +// 修改节假日设置 +export const updateHolidaySetting = async (data: HolidaySettingVO) => { + return await request.put({ url: `/mes/holidaySetting/update`, data }) +} + +// 删除节假日设置 +export const deleteHolidaySetting = async (id: number) => { + return await request.delete({ url: `/mes/holidaySetting/delete?id=` + id }) +} + +// 导出节假日设置 Excel +export const exportHolidaySetting = async (params) => { + return await request.download({ url: `/mes/holidaySetting/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/holidaySetting/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/mes/holidaySetting/holidaySetting.data.ts b/src/views/mes/holidaySetting/holidaySetting.data.ts new file mode 100644 index 000000000..4f7e833a6 --- /dev/null +++ b/src/views/mes/holidaySetting/holidaySetting.data.ts @@ -0,0 +1,178 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const HolidaySettingRules = reactive({ + concurrencyStamp: [required], +}) + +export const HolidaySetting = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '备用字段一', + field: 'textOne', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段二', + field: 'textTwo', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段三', + field: 'textThree', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段四', + field: 'textFour', + sort: 'custom', + isSearch: true, + }, + { + label: '备用字段五', + field: 'textFive', + sort: 'custom', + isSearch: true, + }, + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + form: { + component: 'Radio' + }, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isSearch: true, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '更改ID', + field: 'changeEmplId', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '节假日日期', + field: 'holidayDate', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '节假日类型', + field: 'holidayFlag', + sort: 'custom', + isSearch: true, + }, + { + label: '节假日名称', + field: 'holidayName', + sort: 'custom', + isSearch: true, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/holidaySetting/index.vue b/src/views/mes/holidaySetting/index.vue new file mode 100644 index 000000000..bb63733b0 --- /dev/null +++ b/src/views/mes/holidaySetting/index.vue @@ -0,0 +1,245 @@ + + + +./holidaySetting.data \ No newline at end of file diff --git a/src/views/mes/jobcalendar/index.vue b/src/views/mes/jobcalendar/index.vue index ac7716f24..acd7a2a6c 100644 --- a/src/views/mes/jobcalendar/index.vue +++ b/src/views/mes/jobcalendar/index.vue @@ -5,6 +5,4 @@ - - \ No newline at end of file + \ No newline at end of file