Browse Source

1212

master
李达明 2 months ago
parent
commit
215cf45c4e
  1. 51
      src/api/ccwin/eqBlender/index.ts
  2. 51
      src/api/ccwin/eqCoater/index.ts
  3. 51
      src/api/ccwin/eqFine/index.ts
  4. 51
      src/api/ccwin/eqPre/index.ts
  5. 51
      src/api/ccwin/eqRollsqueezer/index.ts
  6. 51
      src/api/ccwin/eqStacking/index.ts
  7. 51
      src/api/ccwin/paAc/index.ts
  8. 51
      src/api/ccwin/paDhu/index.ts
  9. 51
      src/api/ccwin/paLoopwater/index.ts
  10. 51
      src/api/ccwin/paRo/index.ts
  11. 51
      src/api/ccwin/paVacuo/index.ts
  12. 51
      src/api/ccwin/paWastewater/index.ts
  13. 58
      src/api/opc/dieCutting/index.ts
  14. 70
      src/views/ccwin/eqBlender/eqBlender.data.ts
  15. 244
      src/views/ccwin/eqBlender/index.vue
  16. 70
      src/views/ccwin/eqCoater/eqCoater.data.ts
  17. 244
      src/views/ccwin/eqCoater/index.vue
  18. 70
      src/views/ccwin/eqFine/eqFine.data.ts
  19. 244
      src/views/ccwin/eqFine/index.vue
  20. 70
      src/views/ccwin/eqPre/eqPre.data.ts
  21. 244
      src/views/ccwin/eqPre/index.vue
  22. 70
      src/views/ccwin/eqRollsqueezer/eqRollsqueezer.data.ts
  23. 244
      src/views/ccwin/eqRollsqueezer/index.vue
  24. 70
      src/views/ccwin/eqStacking/eqStacking.data.ts
  25. 244
      src/views/ccwin/eqStacking/index.vue
  26. 244
      src/views/ccwin/paAc/index.vue
  27. 70
      src/views/ccwin/paAc/paAc.data.ts
  28. 244
      src/views/ccwin/paDhu/index.vue
  29. 68
      src/views/ccwin/paDhu/paDhu.data.ts
  30. 244
      src/views/ccwin/paLoopwater/index.vue
  31. 70
      src/views/ccwin/paLoopwater/paLoopwater.data.ts
  32. 244
      src/views/ccwin/paRo/index.vue
  33. 70
      src/views/ccwin/paRo/paRo.data.ts
  34. 245
      src/views/ccwin/paVacuo/index.vue
  35. 69
      src/views/ccwin/paVacuo/paVacuo.data.ts
  36. 244
      src/views/ccwin/paWastewater/index.vue
  37. 70
      src/views/ccwin/paWastewater/paWastewater.data.ts
  38. 121
      src/views/opc/dieCutting/dieCutting.data.ts
  39. 244
      src/views/opc/dieCutting/index.vue

51
src/api/ccwin/eqBlender/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface EqBlenderVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询搅拌机列表
export const getEqBlenderPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/eqBlender/senior', data })
} else {
return await request.get({ url: `/ccwin/eqBlender/page`, params })
}
}
// 查询搅拌机详情
export const getEqBlender = async (id: number) => {
return await request.get({ url: `/ccwin/eqBlender/get?id=` + id })
}
// 新增搅拌机
export const createEqBlender = async (data: EqBlenderVO) => {
return await request.post({ url: `/ccwin/eqBlender/create`, data })
}
// 修改搅拌机
export const updateEqBlender = async (data: EqBlenderVO) => {
return await request.put({ url: `/ccwin/eqBlender/update`, data })
}
// 删除搅拌机
export const deleteEqBlender = async (id: number) => {
return await request.delete({ url: `/ccwin/eqBlender/delete?id=` + id })
}
// 导出搅拌机 Excel
export const exportEqBlender = async (params) => {
return await request.download({ url: `/ccwin/eqBlender/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/eqBlender/get-import-template' })
}

51
src/api/ccwin/eqCoater/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface EqCoaterVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询涂布机列表
export const getEqCoaterPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/eqCoater/senior', data })
} else {
return await request.get({ url: `/ccwin/eqCoater/page`, params })
}
}
// 查询涂布机详情
export const getEqCoater = async (id: number) => {
return await request.get({ url: `/ccwin/eqCoater/get?id=` + id })
}
// 新增涂布机
export const createEqCoater = async (data: EqCoaterVO) => {
return await request.post({ url: `/ccwin/eqCoater/create`, data })
}
// 修改涂布机
export const updateEqCoater = async (data: EqCoaterVO) => {
return await request.put({ url: `/ccwin/eqCoater/update`, data })
}
// 删除涂布机
export const deleteEqCoater = async (id: number) => {
return await request.delete({ url: `/ccwin/eqCoater/delete?id=` + id })
}
// 导出涂布机 Excel
export const exportEqCoater = async (params) => {
return await request.download({ url: `/ccwin/eqCoater/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/eqCoater/get-import-template' })
}

51
src/api/ccwin/eqFine/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface EqFineVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询精分机列表
export const getEqFinePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/eqFine/senior', data })
} else {
return await request.get({ url: `/ccwin/eqFine/page`, params })
}
}
// 查询精分机详情
export const getEqFine = async (id: number) => {
return await request.get({ url: `/ccwin/eqFine/get?id=` + id })
}
// 新增精分机
export const createEqFine = async (data: EqFineVO) => {
return await request.post({ url: `/ccwin/eqFine/create`, data })
}
// 修改精分机
export const updateEqFine = async (data: EqFineVO) => {
return await request.put({ url: `/ccwin/eqFine/update`, data })
}
// 删除精分机
export const deleteEqFine = async (id: number) => {
return await request.delete({ url: `/ccwin/eqFine/delete?id=` + id })
}
// 导出精分机 Excel
export const exportEqFine = async (params) => {
return await request.download({ url: `/ccwin/eqFine/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/eqFine/get-import-template' })
}

51
src/api/ccwin/eqPre/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface EqPreVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询预分机列表
export const getEqPrePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/eqPre/senior', data })
} else {
return await request.get({ url: `/ccwin/eqPre/page`, params })
}
}
// 查询预分机详情
export const getEqPre = async (id: number) => {
return await request.get({ url: `/ccwin/eqPre/get?id=` + id })
}
// 新增预分机
export const createEqPre = async (data: EqPreVO) => {
return await request.post({ url: `/ccwin/eqPre/create`, data })
}
// 修改预分机
export const updateEqPre = async (data: EqPreVO) => {
return await request.put({ url: `/ccwin/eqPre/update`, data })
}
// 删除预分机
export const deleteEqPre = async (id: number) => {
return await request.delete({ url: `/ccwin/eqPre/delete?id=` + id })
}
// 导出预分机 Excel
export const exportEqPre = async (params) => {
return await request.download({ url: `/ccwin/eqPre/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/eqPre/get-import-template' })
}

51
src/api/ccwin/eqRollsqueezer/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface EqRollsqueezerVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询辊压机列表
export const getEqRollsqueezerPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/eqRollsqueezer/senior', data })
} else {
return await request.get({ url: `/ccwin/eqRollsqueezer/page`, params })
}
}
// 查询辊压机详情
export const getEqRollsqueezer = async (id: number) => {
return await request.get({ url: `/ccwin/eqRollsqueezer/get?id=` + id })
}
// 新增辊压机
export const createEqRollsqueezer = async (data: EqRollsqueezerVO) => {
return await request.post({ url: `/ccwin/eqRollsqueezer/create`, data })
}
// 修改辊压机
export const updateEqRollsqueezer = async (data: EqRollsqueezerVO) => {
return await request.put({ url: `/ccwin/eqRollsqueezer/update`, data })
}
// 删除辊压机
export const deleteEqRollsqueezer = async (id: number) => {
return await request.delete({ url: `/ccwin/eqRollsqueezer/delete?id=` + id })
}
// 导出辊压机 Excel
export const exportEqRollsqueezer = async (params) => {
return await request.download({ url: `/ccwin/eqRollsqueezer/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/eqRollsqueezer/get-import-template' })
}

51
src/api/ccwin/eqStacking/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface EqStackingVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询叠片机列表
export const getEqStackingPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/eqStacking/senior', data })
} else {
return await request.get({ url: `/ccwin/eqStacking/page`, params })
}
}
// 查询叠片机详情
export const getEqStacking = async (id: number) => {
return await request.get({ url: `/ccwin/eqStacking/get?id=` + id })
}
// 新增叠片机
export const createEqStacking = async (data: EqStackingVO) => {
return await request.post({ url: `/ccwin/eqStacking/create`, data })
}
// 修改叠片机
export const updateEqStacking = async (data: EqStackingVO) => {
return await request.put({ url: `/ccwin/eqStacking/update`, data })
}
// 删除叠片机
export const deleteEqStacking = async (id: number) => {
return await request.delete({ url: `/ccwin/eqStacking/delete?id=` + id })
}
// 导出叠片机 Excel
export const exportEqStacking = async (params) => {
return await request.download({ url: `/ccwin/eqStacking/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/eqStacking/get-import-template' })
}

51
src/api/ccwin/paAc/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface PaAcVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询空调列表
export const getPaAcPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/paAc/senior', data })
} else {
return await request.get({ url: `/ccwin/paAc/page`, params })
}
}
// 查询空调详情
export const getPaAc = async (id: number) => {
return await request.get({ url: `/ccwin/paAc/get?id=` + id })
}
// 新增空调
export const createPaAc = async (data: PaAcVO) => {
return await request.post({ url: `/ccwin/paAc/create`, data })
}
// 修改空调
export const updatePaAc = async (data: PaAcVO) => {
return await request.put({ url: `/ccwin/paAc/update`, data })
}
// 删除空调
export const deletePaAc = async (id: number) => {
return await request.delete({ url: `/ccwin/paAc/delete?id=` + id })
}
// 导出空调 Excel
export const exportPaAc = async (params) => {
return await request.download({ url: `/ccwin/paAc/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/paAc/get-import-template' })
}

51
src/api/ccwin/paDhu/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface paDhuVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询除湿机列表
export const getpaDhuPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/paDhu/senior', data })
} else {
return await request.get({ url: `/ccwin/paDhu/page`, params })
}
}
// 查询除湿机详情
export const getpaDhu = async (id: number) => {
return await request.get({ url: `/ccwin/paDhu/get?id=` + id })
}
// 新增除湿机
export const createpaDhu = async (data: paDhuVO) => {
return await request.post({ url: `/ccwin/paDhu/create`, data })
}
// 修改除湿机
export const updatepaDhu = async (data: paDhuVO) => {
return await request.put({ url: `/ccwin/paDhu/update`, data })
}
// 删除除湿机
export const deletepaDhu = async (id: number) => {
return await request.delete({ url: `/ccwin/paDhu/delete?id=` + id })
}
// 导出除湿机 Excel
export const exportpaDhu = async (params) => {
return await request.download({ url: `/ccwin/paDhu/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/paDhu/get-import-template' })
}

51
src/api/ccwin/paLoopwater/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface PaLoopwaterVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询循环水列表
export const getPaLoopwaterPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/paLoopwater/senior', data })
} else {
return await request.get({ url: `/ccwin/paLoopwater/page`, params })
}
}
// 查询循环水详情
export const getPaLoopwater = async (id: number) => {
return await request.get({ url: `/ccwin/paLoopwater/get?id=` + id })
}
// 新增循环水
export const createPaLoopwater = async (data: PaLoopwaterVO) => {
return await request.post({ url: `/ccwin/paLoopwater/create`, data })
}
// 修改循环水
export const updatePaLoopwater = async (data: PaLoopwaterVO) => {
return await request.put({ url: `/ccwin/paLoopwater/update`, data })
}
// 删除循环水
export const deletePaLoopwater = async (id: number) => {
return await request.delete({ url: `/ccwin/paLoopwater/delete?id=` + id })
}
// 导出循环水 Excel
export const exportPaLoopwater = async (params) => {
return await request.download({ url: `/ccwin/paLoopwater/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/paLoopwater/get-import-template' })
}

51
src/api/ccwin/paRo/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface PaRoVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询RO(净水)列表
export const getPaRoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/paRo/senior', data })
} else {
return await request.get({ url: `/ccwin/paRo/page`, params })
}
}
// 查询RO(净水)详情
export const getPaRo = async (id: number) => {
return await request.get({ url: `/ccwin/paRo/get?id=` + id })
}
// 新增RO(净水)
export const createPaRo = async (data: PaRoVO) => {
return await request.post({ url: `/ccwin/paRo/create`, data })
}
// 修改RO(净水)
export const updatePaRo = async (data: PaRoVO) => {
return await request.put({ url: `/ccwin/paRo/update`, data })
}
// 删除RO(净水)
export const deletePaRo = async (id: number) => {
return await request.delete({ url: `/ccwin/paRo/delete?id=` + id })
}
// 导出RO(净水) Excel
export const exportPaRo = async (params) => {
return await request.download({ url: `/ccwin/paRo/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/paRo/get-import-template' })
}

51
src/api/ccwin/paVacuo/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface paVacuoVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询真空列表
export const getpaVacuoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/paVacuo/senior', data })
} else {
return await request.get({ url: `/ccwin/paVacuo/page`, params })
}
}
// 查询真空详情
export const getpaVacuo = async (id: number) => {
return await request.get({ url: `/ccwin/paVacuo/get?id=` + id })
}
// 新增真空
export const createpaVacuo = async (data: paVacuoVO) => {
return await request.post({ url: `/ccwin/paVacuo/create`, data })
}
// 修改真空
export const updatepaVacuo = async (data: paVacuoVO) => {
return await request.put({ url: `/ccwin/paVacuo/update`, data })
}
// 删除真空
export const deletepaVacuo = async (id: number) => {
return await request.delete({ url: `/ccwin/paVacuo/delete?id=` + id })
}
// 导出真空 Excel
export const exportpaVacuo = async (params) => {
return await request.download({ url: `/ccwin/paVacuo/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/paVacuo/get-import-template' })
}

51
src/api/ccwin/paWastewater/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface PaWastewaterVO {
id: number
icode: string
iname: string
ivalue: string
mcode: string
mname: string
}
// 查询污水处理列表
export const getPaWastewaterPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/ccwin/paWastewater/senior', data })
} else {
return await request.get({ url: `/ccwin/paWastewater/page`, params })
}
}
// 查询污水处理详情
export const getPaWastewater = async (id: number) => {
return await request.get({ url: `/ccwin/paWastewater/get?id=` + id })
}
// 新增污水处理
export const createPaWastewater = async (data: PaWastewaterVO) => {
return await request.post({ url: `/ccwin/paWastewater/create`, data })
}
// 修改污水处理
export const updatePaWastewater = async (data: PaWastewaterVO) => {
return await request.put({ url: `/ccwin/paWastewater/update`, data })
}
// 删除污水处理
export const deletePaWastewater = async (id: number) => {
return await request.delete({ url: `/ccwin/paWastewater/delete?id=` + id })
}
// 导出污水处理 Excel
export const exportPaWastewater = async (params) => {
return await request.download({ url: `/ccwin/paWastewater/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/ccwin/paWastewater/get-import-template' })
}

58
src/api/opc/dieCutting/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface DieCuttingVO {
id: number
sbzt: string
wmjqh: string
nmjqh: string
wdzy: string
wmjsm: string
nmjsm: string
qdsm: string
fjzl: string
mzpzjd: string
xsmpzjd: string
qycd: string
rework: number
}
// 查询模切列表
export const getDieCuttingPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/opc/dieCutting/senior', data })
} else {
return await request.get({ url: `/opc/dieCutting/page`, params })
}
}
// 查询模切详情
export const getDieCutting = async (id: number) => {
return await request.get({ url: `/opc/dieCutting/get?id=` + id })
}
// 新增模切
export const createDieCutting = async (data: DieCuttingVO) => {
return await request.post({ url: `/opc/dieCutting/create`, data })
}
// 修改模切
export const updateDieCutting = async (data: DieCuttingVO) => {
return await request.put({ url: `/opc/dieCutting/update`, data })
}
// 删除模切
export const deleteDieCutting = async (id: number) => {
return await request.delete({ url: `/opc/dieCutting/delete?id=` + id })
}
// 导出模切 Excel
export const exportDieCutting = async (params) => {
return await request.download({ url: `/opc/dieCutting/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/opc/dieCutting/get-import-template' })
}

70
src/views/ccwin/eqBlender/eqBlender.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EqBlenderRules = reactive({
})
export const EqBlender = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/eqBlender/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EqBlender.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EqBlender.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EqBlenderRules"
:formAllSchemas="EqBlender.allSchemas"
:apiUpdate="EqBlenderApi.updateEqBlender"
:apiCreate="EqBlenderApi.createEqBlender"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EqBlender.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/eq-blender/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EqBlender,EqBlenderRules } from './eqBlender.data'
import * as EqBlenderApi from '@/api/ccwin/eqBlender'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EqBlender' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EqBlender.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EqBlenderApi.getEqBlenderPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:eqBlender:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:eqBlender:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:eqBlender:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:eqBlender:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:eqBlender:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EqBlender.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EqBlenderApi.createEqBlender(data)
message.success(t('common.createSuccess'))
} else {
await EqBlenderApi.updateEqBlender(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEqBlender')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EqBlenderApi.deleteEqBlender(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EqBlenderApi.exportEqBlender(tableObject.params)
download.excel(data, '搅拌机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '搅拌机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EqBlenderApi.importTemplate()
})
</script>

70
src/views/ccwin/eqCoater/eqCoater.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EqCoaterRules = reactive({
})
export const EqCoater = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/eqCoater/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EqCoater.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EqCoater.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EqCoaterRules"
:formAllSchemas="EqCoater.allSchemas"
:apiUpdate="EqCoaterApi.updateEqCoater"
:apiCreate="EqCoaterApi.createEqCoater"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EqCoater.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/eq-coater/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EqCoater,EqCoaterRules } from './eqCoater.data'
import * as EqCoaterApi from '@/api/ccwin/eqCoater'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EqCoater' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EqCoater.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EqCoaterApi.getEqCoaterPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:eqCoater:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:eqCoater:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:eqCoater:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:eqCoater:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:eqCoater:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EqCoater.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EqCoaterApi.createEqCoater(data)
message.success(t('common.createSuccess'))
} else {
await EqCoaterApi.updateEqCoater(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEqCoater')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EqCoaterApi.deleteEqCoater(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EqCoaterApi.exportEqCoater(tableObject.params)
download.excel(data, '涂布机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '涂布机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EqCoaterApi.importTemplate()
})
</script>

70
src/views/ccwin/eqFine/eqFine.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EqFineRules = reactive({
})
export const EqFine = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/eqFine/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EqFine.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EqFine.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EqFineRules"
:formAllSchemas="EqFine.allSchemas"
:apiUpdate="EqFineApi.updateEqFine"
:apiCreate="EqFineApi.createEqFine"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EqFine.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/eq-fine/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EqFine,EqFineRules } from './eqFine.data'
import * as EqFineApi from '@/api/ccwin/eqFine'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EqFine' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EqFine.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EqFineApi.getEqFinePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:eqFine:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:eqFine:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:eqFine:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:eqFine:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:eqFine:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EqFine.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EqFineApi.createEqFine(data)
message.success(t('common.createSuccess'))
} else {
await EqFineApi.updateEqFine(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEqFine')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EqFineApi.deleteEqFine(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EqFineApi.exportEqFine(tableObject.params)
download.excel(data, '精分机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '精分机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EqFineApi.importTemplate()
})
</script>

70
src/views/ccwin/eqPre/eqPre.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EqPreRules = reactive({
})
export const EqPre = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/eqPre/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EqPre.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EqPre.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EqPreRules"
:formAllSchemas="EqPre.allSchemas"
:apiUpdate="EqPreApi.updateEqPre"
:apiCreate="EqPreApi.createEqPre"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EqPre.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/eq-pre/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EqPre,EqPreRules } from './eqPre.data'
import * as EqPreApi from '@/api/ccwin/eqPre'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EqPre' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EqPre.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EqPreApi.getEqPrePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:eqPre:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:eqPre:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:eqPre:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:eqPre:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:eqPre:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EqPre.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EqPreApi.createEqPre(data)
message.success(t('common.createSuccess'))
} else {
await EqPreApi.updateEqPre(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEqPre')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EqPreApi.deleteEqPre(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EqPreApi.exportEqPre(tableObject.params)
download.excel(data, '预分机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '预分机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EqPreApi.importTemplate()
})
</script>

70
src/views/ccwin/eqRollsqueezer/eqRollsqueezer.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EqRollsqueezerRules = reactive({
})
export const EqRollsqueezer = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/eqRollsqueezer/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EqRollsqueezer.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EqRollsqueezer.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EqRollsqueezerRules"
:formAllSchemas="EqRollsqueezer.allSchemas"
:apiUpdate="EqRollsqueezerApi.updateEqRollsqueezer"
:apiCreate="EqRollsqueezerApi.createEqRollsqueezer"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EqRollsqueezer.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/eq-rollsqueezer/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EqRollsqueezer,EqRollsqueezerRules } from './eqRollsqueezer.data'
import * as EqRollsqueezerApi from '@/api/ccwin/eqRollsqueezer'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EqRollsqueezer' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EqRollsqueezer.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EqRollsqueezerApi.getEqRollsqueezerPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:eqRollsqueezer:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:eqRollsqueezer:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:eqRollsqueezer:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:eqRollsqueezer:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:eqRollsqueezer:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EqRollsqueezer.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EqRollsqueezerApi.createEqRollsqueezer(data)
message.success(t('common.createSuccess'))
} else {
await EqRollsqueezerApi.updateEqRollsqueezer(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEqRollsqueezer')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EqRollsqueezerApi.deleteEqRollsqueezer(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EqRollsqueezerApi.exportEqRollsqueezer(tableObject.params)
download.excel(data, '辊压机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '辊压机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EqRollsqueezerApi.importTemplate()
})
</script>

70
src/views/ccwin/eqStacking/eqStacking.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EqStackingRules = reactive({
})
export const EqStacking = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/eqStacking/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EqStacking.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EqStacking.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EqStackingRules"
:formAllSchemas="EqStacking.allSchemas"
:apiUpdate="EqStackingApi.updateEqStacking"
:apiCreate="EqStackingApi.createEqStacking"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EqStacking.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/eq-stacking/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EqStacking,EqStackingRules } from './eqStacking.data'
import * as EqStackingApi from '@/api/ccwin/eqStacking'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'EqStacking' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EqStacking.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: EqStackingApi.getEqStackingPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:eqStacking:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:eqStacking:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:eqStacking:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:eqStacking:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:eqStacking:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EqStacking.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await EqStackingApi.createEqStacking(data)
message.success(t('common.createSuccess'))
} else {
await EqStackingApi.updateEqStacking(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEqStacking')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EqStackingApi.deleteEqStacking(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EqStackingApi.exportEqStacking(tableObject.params)
download.excel(data, '叠片机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '叠片机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EqStackingApi.importTemplate()
})
</script>

244
src/views/ccwin/paAc/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PaAc.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PaAc.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PaAcRules"
:formAllSchemas="PaAc.allSchemas"
:apiUpdate="PaAcApi.updatePaAc"
:apiCreate="PaAcApi.createPaAc"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PaAc.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/pa-ac/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PaAc,PaAcRules } from './paAc.data'
import * as PaAcApi from '@/api/ccwin/paAc'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'PaAc' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PaAc.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PaAcApi.getPaAcPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:paAc:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:paAc:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:paAc:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:paAc:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:paAc:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PaAc.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PaAcApi.createPaAc(data)
message.success(t('common.createSuccess'))
} else {
await PaAcApi.updatePaAc(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPaAc')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PaAcApi.deletePaAc(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PaAcApi.exportPaAc(tableObject.params)
download.excel(data, '空调.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '空调导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PaAcApi.importTemplate()
})
</script>

70
src/views/ccwin/paAc/paAc.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PaAcRules = reactive({
})
export const PaAc = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/paDhu/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PaDhu.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PaDhu.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PaDhuRules"
:formAllSchemas="PaDhu.allSchemas"
:apiUpdate="PaDhuApi.updatePaDhu"
:apiCreate="PaDhuApi.createPaDhu"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PaDhu.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/pa-dhu/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PaDhu,PaDhuRules } from './paDhu.data'
import * as PaDhuApi from '@/api/ccwin/paDhu'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'PaDhu' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PaDhu.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PaDhuApi.getpaDhuPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:paDhu:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:paDhu:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:paDhu:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:paDhu:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:paDhu:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PaDhu.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PaDhuApi.createPaDhu(data)
message.success(t('common.createSuccess'))
} else {
await PaDhuApi.updatePaDhu(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPaDhu')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PaDhuApi.deletePaDhu(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PaDhuApi.exportpaDhu(tableObject.params)
download.excel(data, '除湿机.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '除湿机导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PaDhuApi.importTemplate()
})
</script>

68
src/views/ccwin/paDhu/paDhu.data.ts

@ -0,0 +1,68 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const PaDhuRules = reactive({
})
export const PaDhu = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: true,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: true,
},
{
label: '仪表的名称',
field: 'mname',
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/paLoopwater/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PaLoopwater.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PaLoopwater.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PaLoopwaterRules"
:formAllSchemas="PaLoopwater.allSchemas"
:apiUpdate="PaLoopwaterApi.updatePaLoopwater"
:apiCreate="PaLoopwaterApi.createPaLoopwater"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PaLoopwater.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/pa-loopwater/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PaLoopwater,PaLoopwaterRules } from './paLoopwater.data'
import * as PaLoopwaterApi from '@/api/ccwin/paLoopwater'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'PaLoopwater' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PaLoopwater.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PaLoopwaterApi.getPaLoopwaterPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:paLoopwater:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:paLoopwater:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:paLoopwater:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:paLoopwater:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:paLoopwater:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PaLoopwater.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PaLoopwaterApi.createPaLoopwater(data)
message.success(t('common.createSuccess'))
} else {
await PaLoopwaterApi.updatePaLoopwater(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPaLoopwater')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PaLoopwaterApi.deletePaLoopwater(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PaLoopwaterApi.exportPaLoopwater(tableObject.params)
download.excel(data, '循环水.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '循环水导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PaLoopwaterApi.importTemplate()
})
</script>

70
src/views/ccwin/paLoopwater/paLoopwater.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PaLoopwaterRules = reactive({
})
export const PaLoopwater = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/paRo/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PaRo.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PaRo.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PaRoRules"
:formAllSchemas="PaRo.allSchemas"
:apiUpdate="PaRoApi.updatePaRo"
:apiCreate="PaRoApi.createPaRo"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PaRo.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/pa-ro/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PaRo,PaRoRules } from './paRo.data'
import * as PaRoApi from '@/api/ccwin/paRo'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'PaRo' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PaRo.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PaRoApi.getPaRoPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'ccwin:paRo:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'ccwin:paRo:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:paRo:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:paRo:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:paRo:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PaRo.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PaRoApi.createPaRo(data)
message.success(t('common.createSuccess'))
} else {
await PaRoApi.updatePaRo(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPaRo')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PaRoApi.deletePaRo(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PaRoApi.exportPaRo(tableObject.params)
download.excel(data, 'RO(净水).xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: 'RO(净水)导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PaRoApi.importTemplate()
})
</script>

70
src/views/ccwin/paRo/paRo.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PaRoRules = reactive({
})
export const PaRo = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

245
src/views/ccwin/paVacuo/index.vue

@ -0,0 +1,245 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PaVacuo.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PaVacuo.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PaVacuoRules"
:formAllSchemas="PaVacuo.allSchemas"
:apiUpdate="PaVacuoApi.updatePaVacuo"
:apiCreate="PaVacuoApi.createPaVacuo"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PaVacuo.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/pa-vacuo/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PaVacuo,PaVacuoRules } from './paVacuo.data'
import * as PaVacuoApi from '@/api/ccwin/paVacuo'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import {getpaVacuoPage} from "@/api/ccwin/paVacuo";
defineOptions({ name: 'PaVacuo' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PaVacuo.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PaVacuoApi.getpaVacuoPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:paVacuo:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:paVacuo:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:paVacuo:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:paVacuo:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:paVacuo:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PaVacuo.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PaVacuoApi.createPaVacuo(data)
message.success(t('common.createSuccess'))
} else {
await PaVacuoApi.updatePaVacuo(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPaVacuo')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PaVacuoApi.deletePaVacuo(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PaVacuoApi.exportpaVacuo(tableObject.params)
download.excel(data, '真空.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '真空导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PaVacuoApi.importTemplate()
})
</script>

69
src/views/ccwin/paVacuo/paVacuo.data.ts

@ -0,0 +1,69 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const PaVacuoRules = reactive({
})
export const PaVacuo = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: true,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: true,
},
{
label: '仪表的名称',
field: 'mname',
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/ccwin/paWastewater/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PaWastewater.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PaWastewater.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PaWastewaterRules"
:formAllSchemas="PaWastewater.allSchemas"
:apiUpdate="PaWastewaterApi.updatePaWastewater"
:apiCreate="PaWastewaterApi.createPaWastewater"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PaWastewater.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/ccwin/pa-wastewater/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PaWastewater,PaWastewaterRules } from './paWastewater.data'
import * as PaWastewaterApi from '@/api/ccwin/paWastewater'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'PaWastewater' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PaWastewater.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PaWastewaterApi.getPaWastewaterPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'ccwin:paWastewater:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'ccwin:paWastewater:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'ccwin:paWastewater:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'ccwin:paWastewater:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'ccwin:paWastewater:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PaWastewater.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PaWastewaterApi.createPaWastewater(data)
message.success(t('common.createSuccess'))
} else {
await PaWastewaterApi.updatePaWastewater(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPaWastewater')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PaWastewaterApi.deletePaWastewater(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PaWastewaterApi.exportPaWastewater(tableObject.params)
download.excel(data, '污水处理.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '污水处理导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PaWastewaterApi.importTemplate()
})
</script>

70
src/views/ccwin/paWastewater/paWastewater.data.ts

@ -0,0 +1,70 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PaWastewaterRules = reactive({
})
export const PaWastewater = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: true,
},
{
label: '数据点名称',
field: 'iname',
sort: 'custom',
isSearch: false,
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mname',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

121
src/views/opc/dieCutting/dieCutting.data.ts

@ -0,0 +1,121 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const DieCuttingRules = reactive({
})
export const DieCutting = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: 'id',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '设备状态',
field: 'sbzt',
sort: 'custom',
isSearch: true,
},
{
label: '外模具前后',
field: 'wmjqh',
sort: 'custom',
isSearch: false,
},
{
label: '内模具前后',
field: 'nmjqh',
sort: 'custom',
isSearch: false,
},
{
label: '切刀左右',
field: 'wdzy',
sort: 'custom',
isSearch: false,
},
{
label: '外模具寿命',
field: 'wmjsm',
sort: 'custom',
isSearch: false,
},
{
label: '内模具寿命',
field: 'nmjsm',
sort: 'custom',
isSearch: false,
},
{
label: '切刀寿命',
field: 'qdsm',
sort: 'custom',
isSearch: false,
},
{
label: '放卷张力',
field: 'fjzl',
sort: 'custom',
isSearch: false,
},
{
label: '面阵拍照角度',
field: 'mzpzjd',
sort: 'custom',
isSearch: false,
},
{
label: '线扫拍照角度',
field: 'xsmpzjd',
sort: 'custom',
isSearch: false,
},
{
label: '牵引长度',
field: 'qycd',
sort: 'custom',
isSearch: false,
},
{
label: '返工品',
field: 'rework',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
dictType: DICT_TYPE.REWORK,
dictClass: 'string',
isTable: true,
tableForm: {
type: 'Select'
}
// },
// {
// label: 'create_time',
// 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: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
]))

244
src/views/opc/dieCutting/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DieCutting.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DieCutting.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DieCuttingRules"
:formAllSchemas="DieCutting.allSchemas"
:apiUpdate="DieCuttingApi.updateDieCutting"
:apiCreate="DieCuttingApi.createDieCutting"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DieCutting.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/opc/die-cutting/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DieCutting,DieCuttingRules } from './dieCutting.data'
import * as DieCuttingApi from '@/api/opc/dieCutting'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'DieCutting' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DieCutting.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DieCuttingApi.getDieCuttingPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:dieCutting:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:dieCutting:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'opc:dieCutting:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'opc:dieCutting:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'opc:dieCutting:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =DieCutting.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await DieCuttingApi.createDieCutting(data)
message.success(t('common.createSuccess'))
} else {
await DieCuttingApi.updateDieCutting(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDieCutting')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DieCuttingApi.deleteDieCutting(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await DieCuttingApi.exportDieCutting(tableObject.params)
download.excel(data, '模切.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '模切导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DieCuttingApi.importTemplate()
})
</script>
Loading…
Cancel
Save