Browse Source

基础数据管理、实验室数据展示模块开发

master
daikun1@bosssoft.com.cn 12 months ago
parent
commit
b297a5b3bd
  1. 1
      package.json
  2. 50
      src/api/basedata/device/index.ts
  3. 54
      src/api/basedata/factory/index.ts
  4. 53
      src/api/basedata/group/index.ts
  5. 54
      src/api/basedata/progx/index.ts
  6. 54
      src/api/basedata/proline/index.ts
  7. 54
      src/api/basedata/workshop/index.ts
  8. 53
      src/api/lab/hardness/one/index.ts
  9. 68
      src/api/lab/impact/index.ts
  10. 75
      src/api/lab/platscale/index.ts
  11. 72
      src/api/lab/spectrum/index.ts
  12. 96
      src/api/lab/stretch/stretchThousandnew/index.ts
  13. 74
      src/api/lab/stretch/stretchthousand/index.ts
  14. 54
      src/api/lab/stretch/stretchthousandqx/index.ts
  15. 119
      src/api/lab/stretch/stretchthreehundred/index.ts
  16. 54
      src/api/lab/stretch/stretchthreehundredqx/index.ts
  17. BIN
      src/assets/imgs/bgnew.jpg
  18. 160
      src/components/BasicForm/src/BasicForm.vue
  19. 71
      src/components/Detail/src/Detail.vue
  20. 45
      src/components/Form/src/Form.vue
  21. 34
      src/components/ImportForm/src/ImportForm.vue
  22. 3
      src/components/ImportSimpleForm/index.ts
  23. 278
      src/components/ImportSimpleForm/src/ImportSimpleForm.vue
  24. 4
      src/components/Qxview/index.ts
  25. 116
      src/components/Qxview/src/Qxview.vue
  26. 67
      src/components/Qxview/src/QxviewThree.vue
  27. 286
      src/components/Qxview/src/echarts-data.ts
  28. 52
      src/components/SearchHigh/src/SearchHigh.vue
  29. 41
      src/components/SearchTable/src/SearchTable.vue
  30. 9
      src/components/TableForm/src/TableForm.vue
  31. 47
      src/components/TableHead/src/TableHead.vue
  32. 87
      src/components/XButton/src/ButtonBase.vue
  33. 55
      src/components/rowDrop/index.vue
  34. 63
      src/router/modules/remaining.ts
  35. 88
      src/utils/dict.ts
  36. 383
      src/views/Home/Index.vue
  37. 381
      src/views/Home/Index.vue.bark
  38. 94
      src/views/basedata/device/device.data.ts
  39. 220
      src/views/basedata/device/index.vue
  40. 96
      src/views/basedata/factory/factory.data.ts
  41. 220
      src/views/basedata/factory/index.vue
  42. 60
      src/views/basedata/group/group.data.ts
  43. 220
      src/views/basedata/group/index.vue
  44. 220
      src/views/basedata/progx/index.vue
  45. 93
      src/views/basedata/progx/progx.data.ts
  46. 220
      src/views/basedata/proline/index.vue
  47. 93
      src/views/basedata/proline/proline.data.ts
  48. 220
      src/views/basedata/workshop/index.vue
  49. 93
      src/views/basedata/workshop/workshop.data.ts
  50. 58
      src/views/lab/hardness/one/hardnessOne.data.ts
  51. 227
      src/views/lab/hardness/one/index.vue
  52. 248
      src/views/lab/impact/impact.data.ts
  53. 225
      src/views/lab/impact/index.vue
  54. 227
      src/views/lab/platscale/index.vue
  55. 332
      src/views/lab/platscale/platscale.data.ts
  56. 233
      src/views/lab/spectrum/index.vue
  57. 281
      src/views/lab/spectrum/spectrum.data.ts
  58. 211
      src/views/lab/stretch/stretchthousand/index.vue
  59. 257
      src/views/lab/stretch/stretchthousand/stretchthousand.data.ts
  60. 238
      src/views/lab/stretch/stretchthousandnew/index.vue
  61. 515
      src/views/lab/stretch/stretchthousandnew/stretchThousandnew.data.ts
  62. 221
      src/views/lab/stretch/stretchthousandqx/index.vue
  63. 92
      src/views/lab/stretch/stretchthousandqx/stretch1000Qx.data.ts
  64. 246
      src/views/lab/stretch/stretchthreehundred/index.vue
  65. 734
      src/views/lab/stretch/stretchthreehundred/stretchthreehundred.data.ts
  66. 220
      src/views/lab/stretch/stretchthreehundredqx/index.vue
  67. 106
      src/views/lab/stretch/stretchthreehundredqx/stretch300Qx.data.ts

1
package.json

@ -30,6 +30,7 @@
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"diagram-js": "^12.3.0", "diagram-js": "^12.3.0",
"docx-preview": "^0.1.20",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
"element-plus": "2.3.14", "element-plus": "2.3.14",

50
src/api/basedata/device/index.ts

@ -0,0 +1,50 @@
import request from '@/config/axios'
export interface DeviceVO {
id: number
deviceNo: string
deviceName: string
deviceDesc: string
gxId: number
}
// 查询设备信息列表
export const getDevicePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basedata/device/senior', data })
} else {
return await request.get({ url: `/basedata/device/page`, params })
}
}
// 查询设备信息详情
export const getDevice = async (id: number) => {
return await request.get({ url: `/basedata/device/get?id=` + id })
}
// 新增设备信息
export const createDevice = async (data: DeviceVO) => {
return await request.post({ url: `/basedata/device/create`, data })
}
// 修改设备信息
export const updateDevice = async (data: DeviceVO) => {
return await request.put({ url: `/basedata/device/update`, data })
}
// 删除设备信息
export const deleteDevice = async (id: number) => {
return await request.delete({ url: `/basedata/device/delete?id=` + id })
}
// 导出设备信息 Excel
export const exportDevice = async (params) => {
return await request.download({ url: `/basedata/device/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basedata/device/get-import-template' })
}

54
src/api/basedata/factory/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface FactoryVO {
id: number
facNo: string
facName: string
facDesc: string
groupId: number
}
// 查询工厂信息列表
export const getFactoryPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basedata/factory/senior', data })
} else {
return await request.get({ url: `/basedata/factory/page`, params })
}
}
// 查询工厂信息详情
export const getFactory = async (id: number) => {
return await request.get({ url: `/basedata/factory/get?id=` + id })
}
// 新增工厂信息
export const createFactory = async (data: FactoryVO) => {
return await request.post({ url: `/basedata/factory/create`, data })
}
// 修改工厂信息
export const updateFactory = async (data: FactoryVO) => {
return await request.put({ url: `/basedata/factory/update`, data })
}
// 删除工厂信息
export const deleteFactory = async (id: number) => {
return await request.delete({ url: `/basedata/factory/delete?id=` + id })
}
// 导出工厂信息 Excel
export const exportFactory = async (params) => {
return await request.download({ url: `/basedata/factory/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basedata/factory/get-import-template' })
}
export const selectAllFactorys = async () => {
return await request.get({ url: `/basedata/factory/selectAllFactorys`})
}

53
src/api/basedata/group/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface GroupVO {
id: number
groupNo: string
groupName: string
groupDesc: string
}
// 查询集团信息列表
export const getGroupPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basedata/group/senior', data })
} else {
return await request.get({ url: `/basedata/group/page`, params })
}
}
// 查询集团信息详情
export const getGroup = async (id: number) => {
return await request.get({ url: `/basedata/group/get?id=` + id })
}
// 新增集团信息
export const createGroup = async (data: GroupVO) => {
return await request.post({ url: `/basedata/group/create`, data })
}
// 修改集团信息
export const updateGroup = async (data: GroupVO) => {
return await request.put({ url: `/basedata/group/update`, data })
}
// 删除集团信息
export const deleteGroup = async (id: number) => {
return await request.delete({ url: `/basedata/group/delete?id=` + id })
}
// 导出集团信息 Excel
export const exportGroup = async (params) => {
return await request.download({ url: `/basedata/group/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basedata/group/get-import-template' })
}
export const getAllGroupList = async () => {
return request.get({ url: '/basedata/group/getAllGroupList'})
}

54
src/api/basedata/progx/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface ProgxVO {
id: number
gxNo: string
gxName: string
gxDesc: string
lineId: number
}
// 查询工序信息列表
export const getProgxPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basedata/progx/senior', data })
} else {
return await request.get({ url: `/basedata/progx/page`, params })
}
}
// 查询工序信息详情
export const getProgx = async (id: number) => {
return await request.get({ url: `/basedata/progx/get?id=` + id })
}
// 新增工序信息
export const createProgx = async (data: ProgxVO) => {
return await request.post({ url: `/basedata/progx/create`, data })
}
// 修改工序信息
export const updateProgx = async (data: ProgxVO) => {
return await request.put({ url: `/basedata/progx/update`, data })
}
// 删除工序信息
export const deleteProgx = async (id: number) => {
return await request.delete({ url: `/basedata/progx/delete?id=` + id })
}
// 导出工序信息 Excel
export const exportProgx = async (params) => {
return await request.download({ url: `/basedata/progx/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basedata/progx/get-import-template' })
}
export const getAllGxs = async () => {
return await request.get({ url: `/basedata/progx/getAllGxs`})
}

54
src/api/basedata/proline/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface ProlineVO {
id: number
lineNo: string
lineName: string
lineDesc: string
shopId: number
}
// 查询产线信息列表
export const getProlinePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basedata/proline/senior', data })
} else {
return await request.get({ url: `/basedata/proline/page`, params })
}
}
// 查询产线信息详情
export const getProline = async (id: number) => {
return await request.get({ url: `/basedata/proline/get?id=` + id })
}
// 新增产线信息
export const createProline = async (data: ProlineVO) => {
return await request.post({ url: `/basedata/proline/create`, data })
}
// 修改产线信息
export const updateProline = async (data: ProlineVO) => {
return await request.put({ url: `/basedata/proline/update`, data })
}
// 删除产线信息
export const deleteProline = async (id: number) => {
return await request.delete({ url: `/basedata/proline/delete?id=` + id })
}
// 导出产线信息 Excel
export const exportProline = async (params) => {
return await request.download({ url: `/basedata/proline/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basedata/proline/get-import-template' })
}
export const selectAllLines = async () => {
return await request.get({ url: `/basedata/proline/selectAllLines`})
}

54
src/api/basedata/workshop/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface WorkshopVO {
id: number
shopNo: string
shopName: string
shopDesc: string
facId: number
}
// 查询车间信息列表
export const getWorkshopPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basedata/workshop/senior', data })
} else {
return await request.get({ url: `/basedata/workshop/page`, params })
}
}
// 查询车间信息详情
export const getWorkshop = async (id: number) => {
return await request.get({ url: `/basedata/workshop/get?id=` + id })
}
// 新增车间信息
export const createWorkshop = async (data: WorkshopVO) => {
return await request.post({ url: `/basedata/workshop/create`, data })
}
// 修改车间信息
export const updateWorkshop = async (data: WorkshopVO) => {
return await request.put({ url: `/basedata/workshop/update`, data })
}
// 删除车间信息
export const deleteWorkshop = async (id: number) => {
return await request.delete({ url: `/basedata/workshop/delete?id=` + id })
}
// 导出车间信息 Excel
export const exportWorkshop = async (params) => {
return await request.download({ url: `/basedata/workshop/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basedata/workshop/get-import-template' })
}
export const selectAllShops = async () => {
return await request.get({ url: `/basedata/workshop/selectAllShops`})
}

53
src/api/lab/hardness/one/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface HardnessOneVO {
id: number
fileName: string
fileType: string
fileNewName: string
}
// 查询实验室-硬度-文档数据列表
export const getHardnessOnePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/hardnessone/senior', data })
} else {
return await request.get({ url: `/lab/hardnessone/page`, params })
}
}
// 查询实验室-硬度-文档数据详情
export const getHardnessOne = async (id: number) => {
return await request.get({ url: `/lab/hardnessone/get?id=` + id })
}
// 新增实验室-硬度-文档数据
export const createHardnessOne = async (data: HardnessOneVO) => {
return await request.post({ url: `/lab/hardnessone/create`, data })
}
// 修改实验室-硬度-文档数据
export const updateHardnessOne = async (data: HardnessOneVO) => {
return await request.put({ url: `/lab/hardnessone/update`, data })
}
// 删除实验室-硬度-文档数据
export const deleteHardnessOne = async (id: number) => {
return await request.delete({ url: `/lab/hardnessone/delete?id=` + id })
}
// 导出实验室-硬度-文档数据 Excel
export const exportHardnessOne = async (params) => {
return await request.download({ url: `/lab/hardnessone/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/hardnessone/get-import-template' })
}
export const downLoadForHardOne = (id: number) => {
return request.download({ url: `/lab/hardnessone/downLoadForHardOne?id=` + id})
}

68
src/api/lab/impact/index.ts

@ -0,0 +1,68 @@
import request from '@/config/axios'
export interface ImpactVO {
id: number
dataId: string
fineshed: string
batchNo: string
sampleNo: string
energy: string
toughness: string
standard: string
testDate: string
operator: string
material: string
temperature: string
style: string
length: string
width: string
height: string
deep: string
area: string
sydw: string
cz: string
guig: string
testUser: string
auditStatus: string
}
// 查询实验室-冲击数据列表
export const getImpactPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/impact/senior', data })
} else {
return await request.get({ url: `/lab/impact/page`, params })
}
}
// 查询实验室-冲击数据详情
export const getImpact = async (id: number) => {
return await request.get({ url: `/lab/impact/get?id=` + id })
}
// 新增实验室-冲击数据
export const createImpact = async (data: ImpactVO) => {
return await request.post({ url: `/lab/impact/create`, data })
}
// 修改实验室-冲击数据
export const updateImpact = async (data: ImpactVO) => {
return await request.put({ url: `/lab/impact/update`, data })
}
// 删除实验室-冲击数据
export const deleteImpact = async (id: number) => {
return await request.delete({ url: `/lab/impact/delete?id=` + id })
}
// 导出实验室-冲击数据 Excel
export const exportImpact = async (params) => {
return await request.download({ url: `/lab/impact/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/impact/get-import-template' })
}

75
src/api/lab/platscale/index.ts

@ -0,0 +1,75 @@
import request from '@/config/axios'
export interface PlatscaleVO {
id: number
ch: string
cx: string
pz: string
ghdw: string
ysdw: string
crk: string
mz: string
pzh: string
jz: string
jjy: string
rq: string
jlsjOne: string
jlsjTwo: string
bh: string
shdw: string
xz: string
fwm: string
cysj: string
cybh: string
cyjg: string
bgdbh: string
sfcj: string
batchNo: string
sydw: string
standard: string
cz: string
guig: string
testUser: string
auditStatus: string
}
// 查询实验室-地衡列表
export const getPlatscalePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/platscale/senior', data })
} else {
return await request.get({ url: `/lab/platscale/page`, params })
}
}
// 查询实验室-地衡详情
export const getPlatscale = async (id: number) => {
return await request.get({ url: `/lab/platscale/get?id=` + id })
}
// 新增实验室-地衡
export const createPlatscale = async (data: PlatscaleVO) => {
return await request.post({ url: `/lab/platscale/create`, data })
}
// 修改实验室-地衡
export const updatePlatscale = async (data: PlatscaleVO) => {
return await request.put({ url: `/lab/platscale/update`, data })
}
// 删除实验室-地衡
export const deletePlatscale = async (id: number) => {
return await request.delete({ url: `/lab/platscale/delete?id=` + id })
}
// 导出实验室-地衡 Excel
export const exportPlatscale = async (params) => {
return await request.download({ url: `/lab/platscale/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/platscale/get-import-template' })
}

72
src/api/lab/spectrum/index.ts

@ -0,0 +1,72 @@
import request from '@/config/axios'
export interface SpectrumVO {
id: number
batchNo: string
oprDate: string
syCompany: string
yclSupplier: string
deviceNo: string
specsNo: string
task: string
taskType: string
sid1: string
type: string
cfC: string
cfSi: string
cfMn: string
cfP: string
cfS: string
cfCr: string
cfMo: string
cfNi: string
cfV: string
cfAl: string
cfCu: string
cfTi: string
cfW: string
cfB: string
cfFe: string
cfNb: string
}
// 查询实验室-光谱数据列表
export const getSpectrumPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/spectrum/senior', data })
} else {
return await request.get({ url: `/lab/spectrum/page`, params })
}
}
// 查询实验室-光谱数据详情
export const getSpectrum = async (id: number) => {
return await request.get({ url: `/lab/spectrum/get?id=` + id })
}
// 新增实验室-光谱数据
export const createSpectrum = async (data: SpectrumVO) => {
return await request.post({ url: `/lab/spectrum/create`, data })
}
// 修改实验室-光谱数据
export const updateSpectrum = async (data: SpectrumVO) => {
return await request.put({ url: `/lab/spectrum/update`, data })
}
// 删除实验室-光谱数据
export const deleteSpectrum = async (id: number) => {
return await request.delete({ url: `/lab/spectrum/delete?id=` + id })
}
// 导出实验室-光谱数据 Excel
export const exportSpectrum = async (params) => {
return await request.download({ url: `/lab/spectrum/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/spectrum/get-import-template' })
}

96
src/api/lab/stretch/stretchThousandnew/index.ts

@ -0,0 +1,96 @@
import request from '@/config/axios'
export interface StretchThousandnewVO {
id: number
qxId: string
batchNo: string
bhNo: string
testDate: string
testUser: string
deviceXz: string
deviceCc: string
deviceArea: string
deviceBjbl: string
deviceGauge: string
deviceLu: string
deviceA: string
deviceDmcc: string
deviceSu: string
deviceZ: string
deviceFm: string
deviceRm: string
deviceFeh: string
deviceReh: string
deviceFel: string
deviceRel: string
deviceFp: string
deviceRp: string
deviceFt: string
deviceRt: string
deviceE: string
deviceQqb: string
deviceQqbb: string
deviceAt: string
deviceAgt: string
deviceAg: string
deviceAe: string
deviceGdfh: string
deviceGdfhXsc: string
deviceGdfhXscl: string
deviceGdsc: string
deviceGdscXfh: string
slope: string
testFlag: string
deviceDhsc: string
deviceGdssc: string
deviceZdlsc: string
deviceRpXb: string
deviceRtXb: string
deviceQfjsx: string
}
// 查询实验室-拉伸1000列表
export const getStretchThousandnewPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/stretchthousandnew/senior', data })
} else {
return await request.get({ url: `/lab/stretchthousandnew/page`, params })
}
}
// 查询实验室-拉伸1000详情
export const getStretchThousandnew = async (id: number) => {
return await request.get({ url: `/lab/stretchthousandnew/get?id=` + id })
}
// 新增实验室-拉伸1000
export const createStretchThousandnew = async (data: StretchThousandnewVO) => {
return await request.post({ url: `/lab/stretchthousandnew/create`, data })
}
// 修改实验室-拉伸1000
export const updateStretchThousandnew = async (data: StretchThousandnewVO) => {
return await request.put({ url: `/lab/stretchthousandnew/update`, data })
}
// 删除实验室-拉伸1000
export const deleteStretchThousandnew = async (id: number) => {
return await request.delete({ url: `/lab/stretchthousandnew/delete?id=` + id })
}
// 导出实验室-拉伸1000 Excel
export const exportStretchThousandnew = async (params) => {
return await request.download({ url: `/lab/stretchthousandnew/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/stretchthousandnew/get-import-template' })
}
// 查询曲线数据
export const getStretchQxInfo = async (id: number) => {
return await request.get({ url: `/lab/stretchthousandnew/getStretchQxInfo?id=` + id})
}

74
src/api/lab/stretch/stretchthousand/index.ts

@ -0,0 +1,74 @@
import request from '@/config/axios'
export interface Stretch1000VO {
id: number
qxId: string
batchNo: string
bhNo: string
testDate: string
testUser: string
deviceXz: string
deviceCc: string
deviceArea: string
deviceLo: string
deviceFmc: string
deviceRmc: string
deviceFehc: string
deviceRehc: string
deviceFelc: string
deviceRelc: string
deviceFpc: string
deviceRpc: string
deviceFtc: string
deviceRtc: string
deviceEc: string
slope: string
testFlag: string
}
// 查询实验室-拉伸1000列表
export const getStretch1000Page = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/stretchthousand/senior', data })
} else {
return await request.get({ url: `/lab/stretchthousand/page`, params })
}
}
// 查询实验室-拉伸1000详情
export const getStretch1000 = async (id: number) => {
return await request.get({ url: `/lab/stretchthousand/get?id=` + id })
}
// 新增实验室-拉伸1000
export const createStretch1000 = async (data: Stretch1000VO) => {
return await request.post({ url: `/lab/stretchthousand/create`, data })
}
// 修改实验室-拉伸1000
export const updateStretch1000 = async (data: Stretch1000VO) => {
return await request.put({ url: `/lab/stretchthousand/update`, data })
}
// 删除实验室-拉伸1000
export const deleteStretch1000 = async (id: number) => {
return await request.delete({ url: `/lab/stretchthousand/delete?id=` + id })
}
// 导出实验室-拉伸1000 Excel
export const exportStretch1000 = async (params) => {
return await request.download({ url: `/lab/stretchthousand/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/stretchthousand/get-import-template' })
}
// 查询曲线数据
export const getStretchQxInfo = async (id: number) => {
return await request.get({ url: `/lab/stretchthousand/getStretchQxInfo?id=` + id})
}

54
src/api/lab/stretch/stretchthousandqx/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface Stretch1000QxVO {
id: number
qxId: string
dedviceType: string
deviceX: string
deviceY: string
}
// 查询实验室-拉伸1000--曲线数据列表
export const getStretch1000QxPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/stretchthousandqx/senior', data })
} else {
return await request.get({ url: `/lab/stretchthousandqx/page`, params })
}
}
// 查询实验室-拉伸1000--曲线数据详情
export const getStretch1000Qx = async (id: number) => {
return await request.get({ url: `/lab/stretchthousandqx/get?id=` + id })
}
// 新增实验室-拉伸1000--曲线数据
export const createStretch1000Qx = async (data: Stretch1000QxVO) => {
return await request.post({ url: `/lab/stretchthousandqx/create`, data })
}
// 修改实验室-拉伸1000--曲线数据
export const updateStretch1000Qx = async (data: Stretch1000QxVO) => {
return await request.put({ url: `/lab/stretchthousandqx/update`, data })
}
// 删除实验室-拉伸1000--曲线数据
export const deleteStretch1000Qx = async (id: number) => {
return await request.delete({ url: `/lab/stretchthousandqx/delete?id=` + id })
}
// 导出实验室-拉伸1000--曲线数据 Excel
export const exportStretch1000Qx = async (params) => {
return await request.download({ url: `/lab/stretchthousandqx/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/stretchthousandqx/get-import-template' })
}
export const getQxTypeList = async () => {
return await request.get({ url: `/lab/stretchthousandqx/getQxTypeList`})
}

119
src/api/lab/stretch/stretchthreehundred/index.ts

@ -0,0 +1,119 @@
import request from '@/config/axios'
export interface Stretch300VO {
id: number
syid: string
syzbh: string
flag: string
jfb: string
jb: string
jsu: string
js: string
jt: string
je: string
jp: string
jdl: string
jdm: string
jsuf: string
jsf: string
jpf: string
jag: string
jagt: string
jrt: string
jae: string
sorbWork: string
jr: string
jn: string
jbsb: string
jrf: string
jdlStartvalue: string
jdlEndvalue: string
jbsbStartvalue: string
jbsbEndvalue: string
jrSpecon: string
jnStartvalue: string
jnEndvalue: string
jnSpecon: string
jfbInx: string
jsufInx: string
jsfInx: string
jpfInx: string
jeStartvalue: string
jeEndvalue: string
jeSpemath: string
jpStartvalue: string
jpEndvalue: string
jpSpecon: string
jpSpemath: string
jpfStartvalue: string
jpfEndvalue: string
jpfSpecon: string
jpfSpemath: string
jagStartvalue: string
jagEndvalue: string
jagSpemath: string
jrtSpecon: string
jrfSpecon: string
jaeStartvalue: string
jaeEndvalue: string
jaeSpemath: string
isExtension: string
lot: string
dt: string
bt: string
at1: string
extensionType: string
extensionName: string
vld: string
testDate: string
hlSd: string
dlbfbV: string
isBhkz: string
userId: string
}
// 查询实验室-拉伸300列表
export const getStretch300Page = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/stretchthreehundred/senior', data })
} else {
return await request.get({ url: `/lab/stretchthreehundred/page`, params })
}
}
// 查询实验室-拉伸300详情
export const getStretch300 = async (id: number) => {
return await request.get({ url: `/lab/stretchthreehundred/get?id=` + id })
}
// 新增实验室-拉伸300
export const createStretch300 = async (data: Stretch300VO) => {
return await request.post({ url: `/lab/stretchthreehundred/create`, data })
}
// 修改实验室-拉伸300
export const updateStretch300 = async (data: Stretch300VO) => {
return await request.put({ url: `/lab/stretchthreehundred/update`, data })
}
// 删除实验室-拉伸300
export const deleteStretch300 = async (id: number) => {
return await request.delete({ url: `/lab/stretchthreehundred/delete?id=` + id })
}
// 导出实验室-拉伸300 Excel
export const exportStretch300 = async (params) => {
return await request.download({ url: `/lab/stretchthreehundred/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/stretchthreehundred/get-import-template' })
}
// 查询曲线图数据
export const getStretchThreeQxInfo = async (syzbh: String) => {
return await request.get({ url: `/lab/stretchthreehundred/getStretchThreeQxInfo?syzbh=` + syzbh })
}

54
src/api/lab/stretch/stretchthreehundredqx/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
export interface Stretch300QxVO {
id: number
syl: string
zxbx: string
hxbx: string
wy: string
hlsd: string
sj: string
zyl: string
zyb: string
}
// 查询实验室-拉伸300-曲线图数据列表
export const getStretch300QxPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/lab/StretchThreeHundredqx/senior', data })
} else {
return await request.get({ url: `/lab/StretchThreeHundredqx/page`, params })
}
}
// 查询实验室-拉伸300-曲线图数据详情
export const getStretch300Qx = async (id: number) => {
return await request.get({ url: `/lab/StretchThreeHundredqx/get?id=` + id })
}
// 新增实验室-拉伸300-曲线图数据
export const createStretch300Qx = async (data: Stretch300QxVO) => {
return await request.post({ url: `/lab/StretchThreeHundredqx/create`, data })
}
// 修改实验室-拉伸300-曲线图数据
export const updateStretch300Qx = async (data: Stretch300QxVO) => {
return await request.put({ url: `/lab/StretchThreeHundredqx/update`, data })
}
// 删除实验室-拉伸300-曲线图数据
export const deleteStretch300Qx = async (id: number) => {
return await request.delete({ url: `/lab/StretchThreeHundredqx/delete?id=` + id })
}
// 导出实验室-拉伸300-曲线图数据 Excel
export const exportStretch300Qx = async (params) => {
return await request.download({ url: `/lab/StretchThreeHundredqx/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/lab/StretchThreeHundredqx/get-import-template' })
}

BIN
src/assets/imgs/bgnew.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

160
src/components/BasicForm/src/BasicForm.vue

@ -1,110 +1,13 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="isBusiness?'60%':'40%'"> <Dialog :title="dialogTitle" v-model="dialogVisible" :width="isBusiness?'60%':'40%'">
<Form ref="formRef" v-loading="formLoading" :rules="rules" :schema="formSchema" :is-col="true" > <Form
<!-- <template #productItemCode="form"> ref="formRef"
<slot name="productItemCode" :param="form"></slot> v-loading="formLoading"
</template> --> :rules="rules"
<template #itemCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'itemCode'))"> :schema="formSchema"
<div class="w-[100%] flex"> :is-col="true"
<el-input v-model="form['itemCode']" :placeholder="'请选择物料代码'" @click="opensearchTable('itemCode', 'code')" /> @opensearchTable="opensearchTable"
</div> />
</template>
<template #productItemCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'productItemCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['productItemCode']" :placeholder="'请选择物料代码'" @click="opensearchTable('productItemCode', 'code')" />
</div>
</template>
<template #componentItemCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'componentItemCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['componentItemCode']" :placeholder="'请选择物料代码'" @click="opensearchTable('componentItemCode', 'code')" />
</div>
</template>
<template #supplierCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'supplierCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['supplierCode']" :placeholder="'请选择供应商代码'" @click="opensearchTable('supplierCode', 'code')" />
</div>
</template>
<template #productionLineCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'productionLineCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['productionLineCode']" :placeholder="'请选择生产线代码'" @click="opensearchTable('productionLineCode', 'code')" />
</div>
</template>
<template #fgLocationCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'fgLocationCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['fgLocationCode']" :placeholder="'请选择库位代码'" @click="opensearchTable('fgLocationCode', 'code')" />
</div>
</template>
<template #defaultWarehouseCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'defaultWarehouseCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['defaultWarehouseCode']" :placeholder="'请选择仓库代码'" @click="opensearchTable('defaultWarehouseCode', 'code')" />
</div>
</template>
<template #defaultLocationCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'defaultLocationCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['defaultLocationCode']" :placeholder="'请选择库位代码'" @click="opensearchTable('defaultLocationCode', 'code')" />
</div>
</template>
<template #customerCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'customerCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['customerCode']" :placeholder="'请选择客户代码'" @click="opensearchTable('customerCode', 'code')" />
</div>
</template>
<template #warehouseCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'warehouseCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['warehouseCode']" :placeholder="'请选择仓库代码'" @click="opensearchTable('warehouseCode', 'code')" />
</div>
</template>
<template #areaCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'areaCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['areaCode']" :placeholder="'请选择库区代码'" @click="opensearchTable('areaCode', 'code')" />
</div>
</template>
<template #locationGroupCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'locationGroupCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['locationGroupCode']" :placeholder="'请选择库位组代码'" @click="opensearchTable('locationGroupCode', 'code')" />
</div>
</template>
<template #rawLocationCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'rawLocationCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['rawLocationCode']" :placeholder="'请选择库位代码'" @click="opensearchTable('rawLocationCode', 'code')" />
</div>
</template>
<template #workshopCode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'workshopCode'))">
<div class="w-[100%] flex">
<el-input v-model="form['workshopCode']" :placeholder="'请选择车间代码'" @click="opensearchTable('workshopCode', 'code')" />
</div>
</template>
<template #outAreaCodes="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'outAreaCodes'))">
<div class="w-[100%] flex">
<el-input v-model="form['outAreaCodes']" :placeholder="'请选择库区代码'" @click="opensearchTable('outAreaCodes', 'code')" />
</div>
</template>
<template #inAreaCodes="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'inAreaCodes'))">
<div class="w-[100%] flex">
<el-input v-model="form['inAreaCodes']" :placeholder="'请选择库区代码'" @click="opensearchTable('inAreaCodes', 'code')" />
</div>
</template>
<template #customercode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'customercode'))">
<div class="w-[100%] flex">
<el-input v-model="form['customercode']" :placeholder="'请选择客户代码'" @click="opensearchTable('customercode', 'code')" />
</div>
</template>
<template #itemcode="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'itemcode'))">
<div class="w-[100%] flex">
<el-input v-model="form['itemcode']" :placeholder="'请选择物料代码'" @click="opensearchTable('itemcode', 'code')" />
</div>
</template>
<template #asnNumber="form" v-if="props.searchTableParams?.find((item:any) => (item.formField == 'asnNumber'))">
<div class="w-[100%] flex">
<el-input v-model="form['asnNumber']" :placeholder="'请选择发货单号'" @click="opensearchTable('asnNumber', 'asnNumber')" />
</div>
</template>
<template #poNumber="form" v-if="props.searchTableParams?.find((item: any) => (item.formField == 'poNumber'))">
<div class="w-[100%] flex">
<el-input v-model="form['poNumber']" :placeholder="'请选择发货单号'" @click="opensearchTable('poNumber', 'poNumber')" />
</div>
</template>
</Form>
<div class="table" v-if="isBusiness && formType == 'create'"> <div class="table" v-if="isBusiness && formType == 'create'">
<TableForm ref="tableFormRef" <TableForm ref="tableFormRef"
class="w-[100%]" class="w-[100%]"
@ -132,7 +35,6 @@ import { SearchTable } from '@/components/SearchTable';
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ButtonBase from '@/components/XButton/src/ButtonBase.vue' import ButtonBase from '@/components/XButton/src/ButtonBase.vue'
import TableForm from '@/components/TableForm/src/TableForm.vue' import TableForm from '@/components/TableForm/src/TableForm.vue'
import { string } from 'vue-types';
const props = defineProps({ const props = defineProps({
// rules // rules
@ -165,11 +67,11 @@ const props = defineProps({
default: null default: null
}, },
// //
searchTableParams: { // searchTableParams: {
type: Array, // type: Array,
required: false, // required: false,
default: null // default: null
}, // },
// APIVo // APIVo
apiVo: { apiVo: {
type: Object, type: Object,
@ -219,18 +121,29 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema) const formSchema = ref(props.formAllSchemas?.formSchema)
/** 弹层操作 */ /** 弹层操作 */
// formField form // formField form
// searchField // searchField
// type type=tableForm // type type=tableForm
// searchCondition
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = (formField, searchField, type, row) => { const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, searchPage, type, row, searchCondition) => {
const _searchTableParamsObject:any = props.searchTableParams.find((item:any) => (item.formField == formField)) const _searchCondition = {}
const _searchTableTitle = _searchTableParamsObject.searchTableTitle //
const _searchTableAllSchemas = _searchTableParamsObject.searchTableAllSchemas if (searchCondition && searchCondition.length > 0) {
const _searchTablePage = _searchTableParamsObject.searchTablePage searchCondition.forEach(item => {
searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField, type, row) //
if (item.isMainValue) {
_searchCondition[item.key] = formRef.value.formModel[item.value]
} else {
_searchCondition[item.key] = item.value
}
})
}
const _searchTableTitle = searchTitle
const _searchTableAllSchemas = searchAllSchemas
const _searchTablePage = searchPage
searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField, type, row, _searchCondition)
} }
// //
// val row // val row
@ -394,7 +307,16 @@ const handleAddTable = () => {
} }
// //
const inpuFocus = (headerItem, row, index) => { const inpuFocus = (headerItem, row, index) => {
opensearchTable(headerItem.field, 'poNumber', 'tableForm', row) opensearchTable(
headerItem.field,
headerItem.tableForm.searchField,
headerItem.tableForm.searchTitle,
headerItem.tableForm.searchAllSchemas,
headerItem.tableForm.searchPage,
'tableForm',
row,
headerItem.tableForm.searchCondition
)
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

71
src/components/Detail/src/Detail.vue

@ -35,7 +35,7 @@
v-model:pageSize="tableObject.pageSize" v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage" > v-model:currentPage="tableObject.currentPage" >
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="buttondata(row)" @button-base-click="buttonTableClick($event, row)" /> <ButtonBase :Butttondata="buttondata" @button-base-click="buttonTableClick($event, row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -56,7 +56,6 @@
@success="getList" @success="getList"
:rules="detailAllSchemasRules" :rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas" :formAllSchemas="detailAllSchemas"
:searchTableParams="searchTableParams"
:isBusiness="false" :isBusiness="false"
:apiUpdate="apiUpdate" :apiUpdate="apiUpdate"
:apiCreate="apiCreate" :apiCreate="apiCreate"
@ -116,12 +115,6 @@ const props = defineProps({
type: Object, type: Object,
required: true, required: true,
default: null default: null
},
//
searchTableParams: {
type: Array,
required: true,
default: null
}, },
// API // API
apiCreate: { apiCreate: {
@ -221,6 +214,11 @@ const masterParmas=ref({
status: '',// status: '',//
}) })
//
const HeadButttondata = ref()
// -
const buttondata = ref()
/** 打开弹窗 */ /** 打开弹窗 */
const titleNameRef = ref() const titleNameRef = ref()
const titleValueRef = ref() const titleValueRef = ref()
@ -250,7 +248,16 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
getRemarkList() getRemarkList()
getFileList() getFileList()
getChangeRecordList() getChangeRecordList()
//
HeadButttondata.value = [
defaultButtons.defaultAddBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), //
defaultButtons.defaultFilterBtn(null), //
]
//
buttondata.value = [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1','1','PLAN_PURCHASE_READY','1'])}), //
]
} finally { } finally {
detailLoading.value = false detailLoading.value = false
} }
@ -281,13 +288,20 @@ const getChangeRecordList = async () => {
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage // getListApi: props.apiPage //
}) })
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// //
const { getList } = tableMethods const { getList } = tableMethods
//
const HeadButttondata = ref([
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFilterBtn(null), //
])
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
@ -308,13 +322,7 @@ const buttonBaseClick = (val, item) => {
// const updataTableColumns = (val) => { // const updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val // detailAllSchemas.tableColumns.value = val
// } // }
// -
const buttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hide: masterParmas.value.status=='REQUEST_NEW'?false:true, hasPermi: 'wms:purchaseclaim-request-main:update' }), //
defaultButtons.mainListDeleteBtn({ hide: masterParmas.value.status=='REQUEST_NEW'?false:true, hasPermi: 'wms:purchaseclaim-request-main:delete' }), //
]
}
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
@ -329,20 +337,13 @@ const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value) formRef.value.open(type, row, masterParmas.value)
} }
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { emit('searchTableSuccessDetail', formField, searchField, val, formRef)
if (type == 'tableForm') {
} else {
const setV = {}
setV[formField] = val[0][searchField]
console.log(formField);
props.Echo.forEach((item)=>{
setV[item] = val[0][item]
})
formRef.setValues(setV)
}
})
} }
//
const emit = defineEmits([
'searchTableSuccessDetail',
])
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {
@ -359,7 +360,7 @@ const handleDelete = async (id: number) => {
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters?searchData.filters:[{column: "masterId", action: "==", value: masterParmas.value.masterId}]
} }
getList() // getList() //
} }

45
src/components/Form/src/Form.vue

@ -1,6 +1,6 @@
<script lang="tsx"> <script lang="tsx">
import { computed, defineComponent, onMounted, PropType, ref, unref, watch } from 'vue' import { computed, defineComponent, onMounted, PropType, ref, unref, watch } from 'vue'
import { ElCol, ElForm, ElFormItem, ElRow, ElTooltip } from 'element-plus' import { ElButton, ElCol, ElForm, ElFormItem, ElInput, ElRow, ElTooltip } from 'element-plus'
import { componentMap } from './componentMap' import { componentMap } from './componentMap'
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { getSlot } from '@/utils/tsxHelper' import { getSlot } from '@/utils/tsxHelper'
@ -21,6 +21,7 @@ import { set } from 'lodash-es'
import { FormProps } from './types' import { FormProps } from './types'
import { Icon } from '@/components/Icon' import { Icon } from '@/components/Icon'
import { FormSchema, FormSetPropsType } from '@/types/form' import { FormSchema, FormSetPropsType } from '@/types/form'
import { Search } from '@element-plus/icons-vue'
const { getPrefixCls } = useDesign() const { getPrefixCls } = useDesign()
@ -53,7 +54,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false), vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'), labelPosition: propTypes.string.def('left'),
}, },
emits: ['register'], emits: ['register','opensearchTable'],
setup(props, { slots, expose, emit }) { setup(props, { slots, expose, emit }) {
// element form // element form
const elFormRef = ref<ComponentRef<typeof ElForm>>() const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -119,6 +120,10 @@ export default defineComponent({
return unref(elFormRef) as ComponentRef<typeof ElForm> return unref(elFormRef) as ComponentRef<typeof ElForm>
} }
const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage, searchCondition) => {
emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition)
}
expose({ expose({
setValues, setValues,
formModel, formModel,
@ -126,7 +131,8 @@ export default defineComponent({
delSchema, delSchema,
addSchema, addSchema,
setSchema, setSchema,
getElFormRef getElFormRef,
opensearchTable
}) })
// formModel // formModel
@ -213,6 +219,26 @@ export default defineComponent({
) )
} }
} }
// isSearchList: true 使
const formItemSlotsSearchList: Recordable = setFormItemSlots(slots, item.field)
if (item?.componentProps?.isSearchList) {
formItemSlotsSearchList[item.field] = () => {
return (
<>
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} disabled={true} />
<ElButton icon={Search} onClick={()=>{
opensearchTable(
item.field, item?.componentProps?.searchField,
item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition
)}}/>
</>
)
}
}
return ( return (
<ElFormItem {...(item.formItemProps || {})} prop={item.field} label={item.label || ''}> <ElFormItem {...(item.formItemProps || {})} prop={item.field} label={item.label || ''}>
{{ {{
@ -221,10 +247,11 @@ export default defineComponent({
const Com = componentMap[item.component as string] as ReturnType< const Com = componentMap[item.component as string] as ReturnType<
typeof defineComponent typeof defineComponent
> >
const { autoSetPlaceholder } = unref(getProps) const { autoSetPlaceholder } = unref(getProps)
//
return slots[item.field] ? ( return formItemSlotsSearchList[item.field] ?
(getSlot(formItemSlotsSearchList, item.field, formModel.value)) :
slots[item.field] ? (
getSlot(slots, item.field, formModel.value) getSlot(slots, item.field, formModel.value)
) : ( ) : (
<Com <Com
@ -240,7 +267,7 @@ export default defineComponent({
{{ ...slotsMap }} {{ ...slotsMap }}
</Com> </Com>
) )
} },
}} }}
</ElFormItem> </ElFormItem>
) )
@ -296,12 +323,16 @@ export default defineComponent({
} }
}} }}
</ElForm> </ElForm>
) )
} }
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.myInput{
width: calc(100% - 46px);
}
.#{$elNamespace}-form.#{$namespace}-form .#{$elNamespace}-row { .#{$elNamespace}-form.#{$namespace}-form .#{$elNamespace}-row {
margin-right: 0 !important; margin-right: 0 !important;
margin-left: 0 !important; margin-left: 0 !important;

34
src/components/ImportForm/src/ImportForm.vue

@ -1,16 +1,16 @@
<!-- 导入组件 --> <!-- 导入组件 -->
<template> <template>
<Dialog v-model="dialogVisible" title="导入" width="600"> <Dialog v-model="dialogVisible" title="导入" width="600">
<el-upload ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart" <el-upload ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart + '&outFile=' + outFile"
:auto-upload="false" :disabled="formLoading" :headers="uploadHeaders" :limit="1" :on-error="submitFormError" :auto-upload="false" :disabled="formLoading" :headers="uploadHeaders" :limit="1" :on-error="submitFormError"
:on-exceed="handleExceed" :on-success="submitFormSuccess" :accept="accept" drag :on-exceed="handleExceed" :on-success="submitFormSuccess" :accept="accept" drag
style="width:300px;margin:0 auto"> style="width:300px;margin:0 auto">
<Icon icon="ep:upload-filled" color="#c0c4cc" size="60" /> <Icon icon="ep:upload-filled" color="#c0c4cc" size="60" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip> <template #tip>
<div class="el-upload__tip ml--80px mr--80px"> <div class="el-upload__tip ml--126px mr--80px">
<div class="flex"> <div class="flex">
<div class="label h-32px mr-26px color-#acaeb3 font-size-14px" style="line-height:32px">导入模式</div> <div class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" style="line-height:32px">导入模式</div>
<div class=""> <div class="">
<div class="radio"> <div class="radio">
<el-radio-group v-model="mode"> <el-radio-group v-model="mode">
@ -28,18 +28,25 @@
</div> </div>
</div> </div>
<div class="flex mt-16px"> <div class="flex mt-16px">
<div class="label h-32px mr-26px color-#acaeb3 font-size-14px" style="line-height:32px">部分保存</div> <div class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" style="line-height:32px">部分保存</div>
<div class=""> <div class="">
<div class="switch"> <div class="switch">
<el-switch v-model="updatePart" /> <el-switch v-model="updatePart" />
</div> </div>
<div class="tips color-#acaeb3 font-size-14px"> <div class="tips color-#acaeb3 font-size-14px">
<div class="mt-2">部分保存如存在错误数据正确数据正常导入</div> <div class="mt-2">部分保存如存在错误数据正确数据正常导入</div>
<div class="mt-2">全部保存全部数据正确才能导入</div> <div class="mt-2">全部保存全部数据正确才能导入</div>
</div> </div>
</div> </div>
</div> </div>
<div class="flex mt-16px" v-if="isShowOut">
<div class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" style="line-height:32px">是否外部资源</div>
<div class="">
<div class="switch">
<el-switch v-model="outFile" />
</div>
</div>
</div>
</div> </div>
</template> </template>
</el-upload> </el-upload>
@ -54,7 +61,6 @@
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button> <el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</div> </div>
</template> </template>
</Dialog> </Dialog>
</template> </template>
@ -114,12 +120,23 @@ const file = ref('')
updatePart: { updatePart: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: false
}, },
url:{ url:{
type: String, type: String,
required: false, required: false,
} },
//
isShowOut: {
type: Boolean,
required: false,
default: false
},
outFile: {
type: Boolean,
required: false,
default: false
},
}) })
const importTemplateData= ref(props.importTemplateData) const importTemplateData= ref(props.importTemplateData)
const accept= ref(props.accept) const accept= ref(props.accept)
@ -128,6 +145,7 @@ const updateIsDisable = ref(props.updateIsDisable)//更新是否禁用,默认值
const appendIsDisable = ref(props.appendIsDisable)//, const appendIsDisable = ref(props.appendIsDisable)//,
const coverIsDisable = ref(props.coverIsDisable)//, const coverIsDisable = ref(props.coverIsDisable)//,
const updatePart = ref(props.updatePart)// const updatePart = ref(props.updatePart)//
const outFile = ref(props.outFile)//
const importUrl = const importUrl =
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url

3
src/components/ImportSimpleForm/index.ts

@ -0,0 +1,3 @@
import ImportSimpleForm from './src/ImportSimpleForm.vue'
export { ImportSimpleForm }

278
src/components/ImportSimpleForm/src/ImportSimpleForm.vue

@ -0,0 +1,278 @@
<!-- 导入组件 -->
<template>
<Dialog v-model="dialogVisible" title="导入" width="600">
<el-upload
ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart + '&outFile=' + outFile"
:auto-upload="false" :disabled="formLoading" :headers="uploadHeaders" :limit="1" :on-error="submitFormError"
:on-exceed="handleExceed" :on-success="submitFormSuccess" :accept="accept" drag
style="width:300px;margin:0 auto">
<Icon icon="ep:upload-filled" color="#c0c4cc" size="60" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<!-- <template #tip>
<div class="el-upload__tip ml--126px mr--80px">
<div class="flex">
<div class="label mr-26px h-32px w-100px text-right font-size-14px color-#acaeb3" style="line-height:32px">导入模式</div>
<div class="">
<div class="radio">
<el-radio-group v-model="mode">
<el-radio :label="1" :disabled="updateIsDisable">更新</el-radio>
<el-radio :label="2" :disabled="appendIsDisable">追加</el-radio>
<el-radio :label="3" :disabled="coverIsDisable">覆盖</el-radio>
</el-radio-group>
</div>
<div class="tips font-size-14px color-#acaeb3">
<div class="mt-2">更新新增并修改</div>
<div class="mt-2">追加只新增不修改</div>
<div class="mt-2">覆盖只修改不新增</div>
</div>
</div>
</div>
<div class="mt-16px flex">
<div class="label mr-26px h-32px w-100px text-right font-size-14px color-#acaeb3" style="line-height:32px">部分保存</div>
<div class="">
<div class="switch">
<el-switch v-model="updatePart" />
</div>
<div class="tips font-size-14px color-#acaeb3">
<div class="mt-2">部分保存如存在错误数据正确数据正常导入</div>
<div class="mt-2">全部保存全部数据正确才能导入</div>
</div>
</div>
</div>
<div class="mt-16px flex" v-if="isShowOut">
<div class="label mr-26px h-32px w-100px text-right font-size-14px color-#acaeb3" style="line-height:32px">是否外部资源</div>
<div class="">
<div class="switch">
<el-switch v-model="outFile" />
</div>
</div>
</div>
</div>
</template> -->
</el-upload>
<template #footer>
<div class="flex items-center">
<div class="flex-1 text-left">
<!-- <el-button type="primary" plain @click="importTemplate">
<Icon icon="ep:download" />
下载模板
</el-button> -->
</div>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</template>
</Dialog>
</template>
<script lang="ts" setup>
import { getAccessToken, getTenantId } from '@/utils/auth'
import download from '@/utils/download'
defineOptions({ name: 'ImportSimpleForm' })
const message = useMessage() //
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const uploadRef = ref()
const uploadHeaders = ref() // Header
const fileList = ref([]) //
const file = ref('')
const props = defineProps({
importTemplateData: {
type: Object,
required: true
},
//
accept: {
type: String,
required: false,
default:'.docx, .doc'
},
// .1
mode: {
type: Number,
required: false,
default: 1
},
// ,
updateIsDisable: {
type: Boolean,
required: false,
default: false
},
// ,
appendIsDisable: {
type: Boolean,
required: false,
default: false
},
// ,
coverIsDisable: {
type: Boolean,
required: false,
default: false
},
// ,
updatePart: {
type: Boolean,
required: false,
default: false
},
url:{
type: String,
required: false,
},
//
isShowOut: {
type: Boolean,
required: false,
default: false
},
outFile: {
type: Boolean,
required: false,
default: false
},
})
const importTemplateData= ref(props.importTemplateData)
const accept= ref(props.accept)
const mode = ref(props.mode)//.1
const updateIsDisable = ref(props.updateIsDisable)//,
const appendIsDisable = ref(props.appendIsDisable)//,
const coverIsDisable = ref(props.coverIsDisable)//,
const updatePart = ref(props.updatePart)//
const outFile = ref(props.outFile)//
const importUrl =
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url
/** 打开弹窗 */
const open = () => {
dialogVisible.value = true
resetForm()
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async () => {
if (fileList.value.length == 0) {
message.error('请上传文件')
return
}
file.value = fileList.value[0].name
//
uploadHeaders.value = {
Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId(),
}
formLoading.value = true
uploadRef.value!.submit()
}
/** 文件上传成功 */
const emits = defineEmits(['success'])
const submitFormSuccess = (response: any) => {
formLoading.value = true
if(response){
if(response.code == 500){
message.error('导入失败')
return;
} else if (response.data.errorCount > 0) {
message.confirm('文件中有部分数据导入失败,是否下载失败数据?').then(() => {
// download.excel(file, 'file_' + new Date().getTime())
// url
// const downloadElement = document.createElement('a')
// console.log(172, import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/' + response.data.errorFile)
// console.log(172, import.meta.env.VITE_BASE_URL + '/admin-api/opt/profile/' + response.data.errorFile)
window.open(import.meta.env.VITE_BASE_URL + '/admin-api/profile/' + response.data.errorFile ,'222')
// downloadElement.setAttribute('href', import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + response.data.errorFile )
//
// downloadElement.click()
})
}
}else{
message.success('导入成功')
}
// if (response.code !== 0) {
// message.error(response.msg)
// formLoading.value = false
// return
// }
// //
// const data = response.data
// const create = response.data.importResult[0]
// const update = response.data.importResult[1]
// const failure = response.data.importResult[2]
// let text = '' + data[create].length + ';'
// for (let name of data[create]) {
// text += '< ' + name + ' >'
// }
// text += '' + data[update].length + ';'
// for (const name of data[update]) {
// text += '< ' + name + ' >'
// }
// text += '' + Object.keys(data[failure]).length + ';'
// for (const name in data[failure]) {
// text += '< ' + name + ': ' + data[failure][name] + ' >'
// }
// message.alert(text)
//
formLoading.value = false
emits('success')
dialogVisible.value = false
}
/** 上传错误提示 */
const submitFormError = (): void => {
message.error('上传失败,请您重新上传!')
formLoading.value = false
}
/** 重置表单 */
const resetForm = () => {
//
formLoading.value = false
uploadRef.value?.clearFiles()
fileList.value = []
}
/** 文件数超出提示 */
const handleExceed = (): void => {
message.error('最多只能上传一个文件!')
}
/** 下载模板操作 */
const importTemplate = () => {
const res = importTemplateData.value.templateUrl
download.excel(res, importTemplateData.value.templateTitle)
}
</script>
<style scoped lang="scss">
.tips {
div {
position: relative;
padding-left: 22px;
&::before {
width: 4px;
height: 4px;
border-radius: 50%;
content: '';
background: #c2c2c2;
position: absolute;
top: 50%;
margin-top: -2px;
left: 4px;
}
}
}
</style>

4
src/components/Qxview/index.ts

@ -0,0 +1,4 @@
import Qxview from './src/Qxview.vue'
import QxviewThree from './src/QxviewThree.vue'
export { Qxview , QxviewThree}

116
src/components/Qxview/src/Qxview.vue

@ -0,0 +1,116 @@
<template>
<Dialog v-model="dialogVisible" title="曲线明细" width="1080">
<el-row class="mt-5px" :gutter="20" justify="space-between">
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<el-skeleton :loading="loading" animated>
<el-row :gutter="20" justify="space-between">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<el-skeleton :loading="loading" animated>
<Echart :options="lineOptionsData" :width="650" :height="470" />
</el-skeleton>
</el-col>
</el-row>
</el-skeleton>
</el-card>
</el-col>
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<template #header>
<div class="h-3 flex justify-between">
<span>曲线类别</span>
</div>
</template>
<el-skeleton :loading="loading" animated>
<div v-for="(item, index) in deviceTypeList" :key="`dynamics-${index}`">
<div style="height: 20px">
<el-button type="text" @click="changeData(item)">
{{ item.value }} : {{ item.name }}
</el-button>
</div>
<el-divider />
</div>
</el-skeleton>
</el-card>
</el-col>
</el-row>
</Dialog>
</template>
<script lang="ts" setup>
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
import { formatTime } from '@/utils'
import { useUserStore } from '@/store/modules/user'
import { useWatermark } from '@/hooks/web/useWatermark'
import { pieOptions, barOptions , lineOptions } from './echarts-data'
defineOptions({ name: 'Qxview' })
const { t } = useI18n()
const userStore = useUserStore()
const { setWatermark } = useWatermark()
const loading = ref(false)
const dialogVisible = ref(false) //
const viewData = ref()
const deviceTypeList = ref([])
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
const open = (typeList , vData) => {
deviceTypeList.value = typeList
viewData.value = vData
changeQxData(viewData.value.tt , '2倍变形-力')
loading.value = false
dialogVisible.value = true
}
defineExpose({ open }) // open
const changeData = (item) => {
switch (item.value) {
case 'lb':
changeQxData(viewData.value.lb, item.name)
break
case 'ld':
changeQxData(viewData.value.ld, item.name)
break
case 'le':
changeQxData(viewData.value.le, item.name)
break
case 'lt':
changeQxData(viewData.value.lt, item.name)
break
case 'et':
changeQxData(viewData.value.et, item.name)
break
case '1t':
changeQxData(viewData.value.tt, item.name)
break
default:
changeQxData(viewData.value.lb, item.name)
}
}
// 线
const changeQxData = async (viewData , title) => {
if (viewData != null) {
set(
lineOptionsData,
'title.text',
title
)
set(
lineOptionsData,
'xAxis.data',
viewData.map((v) => t(v.name))
)
set(lineOptionsData, 'series', [
{
name: title,
data: viewData.map((v) => v.value),
type: 'line'
}
])
}
}
</script>

67
src/components/Qxview/src/QxviewThree.vue

@ -0,0 +1,67 @@
<template>
<Dialog v-model="dialogVisible" title="曲线明细" width="700">
<el-row class="mt-5px" :gutter="20" justify="space-between">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<el-skeleton :loading="loading" animated>
<el-row :gutter="20" justify="space-between">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<el-skeleton :loading="loading" animated>
<Echart :options="lineOptionsData" :width="650" :height="400" />
</el-skeleton>
</el-col>
</el-row>
</el-skeleton>
</el-card>
</el-col>
</el-row>
</Dialog>
</template>
<script lang="ts" setup>
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
import { formatTime } from '@/utils'
import { useUserStore } from '@/store/modules/user'
import { useWatermark } from '@/hooks/web/useWatermark'
import { pieOptions, barOptions , lineOptions } from './echarts-data'
defineOptions({ name: 'QxviewThree' })
const { t } = useI18n()
const userStore = useUserStore()
const { setWatermark } = useWatermark()
const loading = ref(false)
const dialogVisible = ref(false) //
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption
const open = (vData , title) => {
console.log(vData)
initData(vData , title)
loading.value = false
dialogVisible.value = true
}
defineExpose({ open }) // open
// 线
const initData = async (datas , title) => {
if (datas != null) {
set(
lineOptionsData,
'title.text',
title
)
set(
lineOptionsData,
'xAxis.data',
datas.map((v) => t(v.syl))
)
set(lineOptionsData, 'series', [
{
name: title,
data: datas.map((v) => v.wy),
type: 'line'
}
])
}
}
</script>

286
src/components/Qxview/src/echarts-data.ts

@ -0,0 +1,286 @@
import { EChartsOption } from 'echarts'
const { t } = useI18n()
export const lineOptions: EChartsOption = {
title: {
text: '',
left: 'center'
},
xAxis: {
data: [],
boundaryGap: false,
axisTick: {
show: false
}
},
grid: {
left: 20,
right: 20,
bottom: 20,
top: 80,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
padding: [5, 10]
},
yAxis: {
axisTick: {
show: false
}
},
// legend: {
// data: [t('analysis.estimate'), t('analysis.actual')],
// top: 50
// },
series: [
{
name: '',
smooth: true,
type: 'line',
data: [],
animationDuration: 2800,
animationEasing: 'cubicInOut'
}
]
}
export const pieOptions: EChartsOption = {
title: {
text: t('analysis.userAccessSource'),
left: 'center'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'left',
data: [
t('analysis.directAccess'),
t('analysis.mailMarketing'),
t('analysis.allianceAdvertising'),
t('analysis.videoAdvertising'),
t('analysis.searchEngines')
]
},
series: [
{
name: t('analysis.userAccessSource'),
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{ value: 335, name: t('analysis.directAccess') },
{ value: 310, name: t('analysis.mailMarketing') },
{ value: 234, name: t('analysis.allianceAdvertising') },
{ value: 135, name: t('analysis.videoAdvertising') },
{ value: 1548, name: t('analysis.searchEngines') }
]
}
]
}
export const barOptions: EChartsOption = {
title: {
text: t('analysis.weeklyUserActivity'),
left: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: 50,
right: 20,
bottom: 20
},
xAxis: {
type: 'category',
data: [
t('analysis.monday'),
t('analysis.tuesday'),
t('analysis.wednesday'),
t('analysis.thursday'),
t('analysis.friday'),
t('analysis.saturday'),
t('analysis.sunday')
],
axisTick: {
alignWithLabel: true
}
},
yAxis: {
type: 'value'
},
series: [
{
name: t('analysis.activeQuantity'),
data: [13253, 34235, 26321, 12340, 24643, 1322, 1324],
type: 'bar'
}
]
}
export const radarOption: EChartsOption = {
legend: {
data: [t('workplace.personal'), t('workplace.team')]
},
radar: {
// shape: 'circle',
indicator: [
{ name: t('workplace.quote'), max: 65 },
{ name: t('workplace.contribution'), max: 160 },
{ name: t('workplace.hot'), max: 300 },
{ name: t('workplace.yield'), max: 130 },
{ name: t('workplace.follow'), max: 100 }
]
},
series: [
{
name: `xxx${t('workplace.index')}`,
type: 'radar',
data: [
{
value: [42, 30, 20, 35, 80],
name: t('workplace.personal')
},
{
value: [50, 140, 290, 100, 90],
name: t('workplace.team')
}
]
}
]
}
export const wordOptions = {
series: [
{
type: 'wordCloud',
gridSize: 2,
sizeRange: [12, 50],
rotationRange: [-90, 90],
shape: 'pentagon',
width: 600,
height: 400,
drawOutOfBound: true,
textStyle: {
color: function () {
return (
'rgb(' +
[
Math.round(Math.random() * 160),
Math.round(Math.random() * 160),
Math.round(Math.random() * 160)
].join(',') +
')'
)
}
},
emphasis: {
textStyle: {
shadowBlur: 10,
shadowColor: '#333'
}
},
data: [
{
name: 'Sam S Club',
value: 10000,
textStyle: {
color: 'black'
},
emphasis: {
textStyle: {
color: 'red'
}
}
},
{
name: 'Macys',
value: 6181
},
{
name: 'Amy Schumer',
value: 4386
},
{
name: 'Jurassic World',
value: 4055
},
{
name: 'Charter Communications',
value: 2467
},
{
name: 'Chick Fil A',
value: 2244
},
{
name: 'Planet Fitness',
value: 1898
},
{
name: 'Pitch Perfect',
value: 1484
},
{
name: 'Express',
value: 1112
},
{
name: 'Home',
value: 965
},
{
name: 'Johnny Depp',
value: 847
},
{
name: 'Lena Dunham',
value: 582
},
{
name: 'Lewis Hamilton',
value: 555
},
{
name: 'KXAN',
value: 550
},
{
name: 'Mary Ellen Mark',
value: 462
},
{
name: 'Farrah Abraham',
value: 366
},
{
name: 'Rita Ora',
value: 360
},
{
name: 'Serena Williams',
value: 282
},
{
name: 'NCAA baseball tournament',
value: 273
},
{
name: 'Point Break',
value: 265
}
]
}
]
}

52
src/components/SearchHigh/src/SearchHigh.vue

@ -23,20 +23,20 @@
<!-- 数字输入框 --> <!-- 数字输入框 -->
<el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="6" :disabled="item.disabled"/> <el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="6" :disabled="item.disabled"/>
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value" placeholder="请选择内容" :filterable="true" clearable :disabled="item.disabled"> <el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" placeholder="请选择内容" :filterable="true" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action">
<el-option v-for="dict in initSelectOptions(item.column)" :key="dict.value" :label="dict.label" <el-option v-for="dict in initSelectOptions(item.column)" :key="dict.value" :label="dict.label"
:value="dict.value" /> :value="dict.value" />
<!-- <el-option v-for="(op, index) in initSelectOptions(item.column)" :label="op[item.optionsLabel] || op.label" <!-- <el-option v-for="(op, index) in initSelectOptions(item.column)" :label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value" :key="index" /> --> :value="op[item.optionsValue] || op.value" :key="index" /> -->
</el-select> </el-select>
<!-- 时间 --> <!-- 时间 -->
<el-time-picker v-else-if="getInputType(item.column) == 'time'" range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" v-model="item.time" style="width: 340px;margin-right: 20px;" :disabled="item.disabled"/> <el-time-picker v-else-if="getInputType(item.column) == 'time'" range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" v-model="item.value1" style="width: calc(100% - 20px);margin-right: 10px;" :disabled="item.disabled"/>
<!-- 日期 --> <!-- 日期 -->
<el-date-picker v-else-if="getInputType(item.column) == 'date'" v-model="item.time" type="daterange" <el-date-picker v-else-if="getInputType(item.column) == 'date'" v-model="item.value1" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 340px;margin-right: 20px;" @change="changeDateTimePicker($event, item,'daterange')" value-format="YYYY-MM-DD" format="YYYY/MM/DD" :disabled="item.disabled"/> range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" style="width: calc(100% - 20px);margin-right: 10px;" @change="changeDateTimePicker($event, item,'daterange')" value-format="YYYY-MM-DD" format="YYYY/MM/DD" :disabled="item.disabled"/>
<!-- 日期时间 --> <!-- 日期时间 -->
<el-date-picker v-else-if="getInputType(item.column) == 'datePicker'" v-model="item.time" type="datetimerange" <el-date-picker v-else-if="getInputType(item.column) == 'datePicker'" v-model="item.value1" type="datetimerange"
range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 340px;" @change="changeDateTimePicker($event, item, 'datetimerange')" value-format="x" format="YYYY/MM/DD HH:mm:ss" :disabled="item.disabled"/> range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" style="width: calc(100% - 20px);margin-right: 10px;" @change="changeDateTimePicker($event, item, 'datetimerange')" value-format="x" format="YYYY/MM/DD HH:mm:ss" :disabled="item.disabled"/>
</div> </div>
<!-- 删除条件按钮 --> <!-- 删除条件按钮 -->
<el-button type="danger" :icon="Minus" circle size="small" <el-button type="danger" :icon="Minus" circle size="small"
@ -178,7 +178,7 @@ const moreListPush = () => {
column: '', column: '',
action: "==", action: "==",
value: "", value: "",
time:'' value1 :""
} }
moreListData.value.filters.push(data) moreListData.value.filters.push(data)
} }
@ -187,13 +187,13 @@ const moreListPush = () => {
const resetSelect = (val) => { const resetSelect = (val) => {
if (getInputType(val.column) == 'datePicker' || getInputType(val.column) == 'date') { if (getInputType(val.column) == 'datePicker' || getInputType(val.column) == 'date') {
val.action = 'betweeen' val.action = 'betweeen'
val.value = ""
val.disabled = false val.disabled = false
}else{ }else{
val.action = '==' val.action = '=='
val.value = ""
val.disabled = false val.disabled = false
} }
val.value1 = ""
val.value = ""
} }
// //
const actionSelect = (val)=>{ const actionSelect = (val)=>{
@ -202,6 +202,12 @@ const actionSelect = (val)=>{
}else{ }else{
val.disabled = false val.disabled = false
} }
val.value1 = undefined
nextTick(()=>{
val.value1 =[]
val.value = ''
})
} }
// //
@ -209,11 +215,21 @@ const buttonBaseClick = (val) => {
if (val == 'search') { // if (val == 'search') { //
let data = [] let data = []
moreListData.value.filters.forEach(item => { moreListData.value.filters.forEach(item => {
let obj = { let obj = {}
if(item.value1&&item.value1.length>0){
obj = {
column: item.column, column: item.column,
action: item.action, action: item.action,
value: item.value, value:Array.isArray(item.value1)?item.value1.join(','):item.value1,
} }
}else{
obj = {
column: item.column,
action: item.action,
value:item.value,
}
}
data.push(obj) data.push(obj)
}) })
if (props.masterId){ if (props.masterId){
@ -229,6 +245,8 @@ const buttonBaseClick = (val) => {
} else if (val == 'searchReset') { // } else if (val == 'searchReset') { //
moreListData.value = {filters:[]} moreListData.value = {filters:[]}
moreListPush() moreListPush()
//
emit('searchFormClick', {})
} }
} }
@ -281,19 +299,19 @@ defineExpose({
} }
.rowInnerItem { .rowInnerItem {
margin-right: 20px; margin-right: 10px;
width: 220px; width: 20%;
.el-input__wrapper { .el-input__wrapper {
width: 220px; width:100%;
} }
} }
.rowInnerItem1{ .rowInnerItem1{
margin-right: 20px; margin-right: 10px;
width: 360px; width: 50%;
.el-input__wrapper { .el-input__wrapper {
width: 340px; width:100%;
} }
} }
.moreListBaseBts { .moreListBaseBts {

41
src/components/SearchTable/src/SearchTable.vue

@ -1,7 +1,16 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="'80%'"> <Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="'80%'">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> <!-- <Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> -->
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="allSchemasRef"
/>
<ContentWrap>
<Table <Table
ref="searchTableRef" ref="searchTableRef"
:columns="tableColumns" :columns="tableColumns"
@ -15,6 +24,7 @@
v-model:sort="tableObjectRef.sort" v-model:sort="tableObjectRef.sort"
:selection="true" :selection="true"
/> />
</ContentWrap>
<template #footer> <template #footer>
<div class="flex items-center"> <div class="flex items-center">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
@ -24,14 +34,26 @@
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// const { t } = useI18n() // // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const searchDialogVisible = ref(false) // const searchDialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
//
const HeadButttondata = [
defaultButtons.defaultFilterBtn(null), //
]
/** 打开弹窗 */ /** 打开弹窗 */
const getListRef = ref()
const setSearchParamsRef = ref() const setSearchParamsRef = ref()
const tableObjectRef = ref() const tableObjectRef = ref()
const getPage:any = ref() const getPage:any = ref()
@ -41,12 +63,14 @@ const formFieldRef = ref()
const searchFieldRef = ref() const searchFieldRef = ref()
const typeRef = ref() const typeRef = ref()
const rowRef = ref() const rowRef = ref()
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any, type: any, row: any ) => { const allSchemasRef = ref()
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any, type: any, row: any, searchCondition:any ) => {
searchDialogVisible.value = true searchDialogVisible.value = true
formFieldRef.value = formField formFieldRef.value = formField
searchFieldRef.value = searchField searchFieldRef.value = searchField
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns tableColumns.value = allSchemas.tableColumns.filter(item => (item.field !== 'action'))
getPage.value = getApiPage getPage.value = getApiPage
typeRef.value = type typeRef.value = type
rowRef.value = row rowRef.value = row
@ -56,12 +80,23 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
getListApi: getPage.value // getListApi: getPage.value //
}) })
tableObjectRef.value = tableObject tableObjectRef.value = tableObject
if (searchCondition) tableObjectRef.value.params = searchCondition
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams setSearchParamsRef.value = setSearchParams
getListRef.value = getList
getList() getList()
} }
//
const searchFormClick = (searchData) => {
tableObjectRef.value.params = {
isSearch: true,
filters: searchData.filters
}
getListRef.value() //
}
defineExpose({ open }) // open defineExpose({ open }) // open
// Table ref // Table ref

9
src/components/TableForm/src/TableForm.vue

@ -57,16 +57,16 @@
<!-- 字符串输入框 --> <!-- 字符串输入框 -->
<el-form-item <el-form-item
v-if="!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString'" v-if="!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString'"
:prop="headerItem.field"> :prop="headerItem.field" style="display: flex;align-items: center;">
<el-input <el-input
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
clearable clearable
:type="headerItem?.tableForm?.inputType" :type="headerItem?.tableForm?.inputType"
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label" :placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="itemIsDisabled(headerItem, row)" :disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false"
style="width: 100%;" style="flex:1"
@click="inpuFocus(headerItem,row,index)"
/> />
<el-button v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button>
</el-form-item> </el-form-item>
<!-- 金额输入框 --> <!-- 金额输入框 -->
<el-form-item <el-form-item
@ -91,6 +91,7 @@
v-model="row[headerItem.field]" v-model="row[headerItem.field]"
:max="headerItem?.tableForm?.max" :max="headerItem?.tableForm?.max"
:min="headerItem?.tableForm?.min" :min="headerItem?.tableForm?.min"
:precision="headerItem?.tableForm?.precision"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
/> />
</el-form-item> </el-form-item>

47
src/components/TableHead/src/TableHead.vue

@ -8,27 +8,19 @@
/> />
</div> </div>
<div class="tableNavRightBtns"> <div class="tableNavRightBtns">
<!-- 快速搜索 -->
<!-- <SearchNormal
ref="quicklySearchDom_Ref"
:vueName="vueName"
:quicklySearchOption="quicklySearchOption"
@searchNormalClick="quicklySearchClick"
@searchNormalClear="quicklySearchClear"
style="margin-right: 15px;"
></SearchNormal> -->
<!-- 右侧按钮 --> <!-- 右侧按钮 -->
<ButtonBase :Butttondata="buttonsRight" @button-base-click="buttonBaseClick" /> <ButtonBase :Butttondata="buttonsRight" @button-base-click="buttonBaseClick" @updata-table-columns="updataTableColumns"
:allSchemas="allSchemas" ref="rowDropRef"/>
</div> </div>
</div> </div>
<slot></slot> <slot></slot>
</div> </div>
<!-- 字段设置弹窗 --> <!-- 字段设置弹窗 -->
<rowDrop <!-- <rowDrop
ref="rowDropRef" ref="rowDropRef"
@updata-table-columns="updataTableColumns" @updata-table-columns="updataTableColumns"
:allSchemas="allSchemas" :allSchemas="allSchemas"
/> /> -->
<!-- 高级筛选 --> <!-- 高级筛选 -->
<SearchHigh <SearchHigh
ref="searchHigh_Ref" ref="searchHigh_Ref"
@ -83,6 +75,8 @@ import rowDrop from "@/components/rowDrop/index.vue"
// const defaultButtons = inject('global').defaultButtons // const defaultButtons = inject('global').defaultButtons
// //
const buttonsLeftOrRight = () => { const buttonsLeftOrRight = () => {
buttonsRight.value = []
buttonsLeft.value = []
// () // ()
// let _primarySearchOption = primarySearch[props.vueName] // let _primarySearchOption = primarySearch[props.vueName]
// let _highSearchOption = highSearch[props.vueName] // let _highSearchOption = highSearch[props.vueName]
@ -100,12 +94,17 @@ import rowDrop from "@/components/rowDrop/index.vue"
} }
buttonsLeftOrRight() buttonsLeftOrRight()
watch(
() => props.HeadButttondata,
() => {
buttonsLeftOrRight()
}
)
// //
const emit = defineEmits([ const emit = defineEmits([
'buttonBaseClick', 'buttonBaseClick',
'quicklySearchClick',
'quicklySearchClear',
'updataTableColumns', 'updataTableColumns',
'searchFormClick' 'searchFormClick'
]) ])
@ -117,7 +116,7 @@ import rowDrop from "@/components/rowDrop/index.vue"
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
// //
if (val == 'set') { if (val == 'set') {
rowDropRef.value.popoverVisible = true rowDropRef.value.popoverVisible = !rowDropRef.value.popoverVisible
} else if (val == 'filtrate') { } else if (val == 'filtrate') {
searchHigh_Ref.value.popoverVisible = true searchHigh_Ref.value.popoverVisible = true
} else { } else {
@ -125,16 +124,6 @@ import rowDrop from "@/components/rowDrop/index.vue"
} }
} }
//
const quicklySearchClick = (val, option) => {
emit('quicklySearchClick', val, option)
}
//
const quicklySearchClear = (val, option) => {
emit('quicklySearchClear', val, option)
}
const quicklySearchDom_Ref = ref() const quicklySearchDom_Ref = ref()
// //
@ -158,13 +147,15 @@ import rowDrop from "@/components/rowDrop/index.vue"
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.tableNavLeftBtns{
display: flex;
margin-left: -5px;
}
.tableNavRightBtns{ .tableNavRightBtns{
display: flex; display: flex;
margin-left: 10px; margin-left: 10px;
.currenButton .el-button { margin-right: -5px;
margin-left: 10px !important;
}
} }
} }
</style> </style>

87
src/components/XButton/src/ButtonBase.vue

@ -1,38 +1,95 @@
<template> <template>
<div v-for="(item, index) in Butttondata" :key="index" class="btn-div">
<el-button <el-button
v-for="(item, index) in Butttondata" :key="index"
v-show="!item.hide" v-show="!item.hide"
:type="item.type" :type="item.type"
:color="item.color" :color="item.color"
:link = "item.link ? item.link : false" :link="item.link ? item.link : false"
v-hasPermi="[item.hasPermi] || []" v-hasPermi="[item.hasPermi] || []"
@click="buttonBaseClick(item.name,item,$event)" v-if="item.name != 'set'"
@click="buttonBaseClick(item.name, item, $event)"
> >
<Icon v-if="item.icon" :icon="item.icon" class="mr-1px" /> <Icon v-if="item.icon" :icon="item.icon" class="mr-1px" />
{{ item.label }} {{ item.label }}
</el-button> </el-button>
<!-- 设置按钮 -->
<el-popover
:visible="popoverVisible"
placement="bottom"
:width="300"
trigger="click"
v-if="item.name == 'set'&&!item.hide"
>
<rowDrop
ref="rowDropRef"
@updata-table-columns="updataTableColumns"
:allSchemas="allSchemas"
@closeRowDrop="closeRowDrop"
@updataTableColumns="updataTableColumns"
/>
<template #reference>
<el-button
v-show="!item.hide"
:type="item.type"
:color="item.color"
:link="item.link ? item.link : false"
v-hasPermi="[item.hasPermi] || []"
@click="buttonBaseClick(item.name, item, $event)"
>
<Icon v-if="item.icon" :icon="item.icon" class="mr-1px" />
{{ item.label }}
</el-button>
</template>
</el-popover>
</div>
<slot></slot> <slot></slot>
</template> </template>
<script setup> <script setup>
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import { clearButtonBlurHandle } from '@/utils/index' import { clearButtonBlurHandle } from '@/utils/index'
const props = defineProps({ import rowDrop from '@/components/rowDrop/index.vue'
const props = defineProps({
Butttondata: { Butttondata: {
type: Array, type: Array,
default: () => { default: () => {
return [] return []
} }
}, },
}) allSchemas: {
type: Object,
default: null
}
})
// //
const emit = defineEmits([ const emit = defineEmits(['buttonBaseClick', 'updataTableColumns'])
'buttonBaseClick',
])
const buttonBaseClick = (val, item, $event) => { const buttonBaseClick = (val, item, $event) => {
clearButtonBlurHandle($event)//el-button clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event) emit('buttonBaseClick', val, item, $event)
} }
const popoverVisible = ref(false)
//
const closeRowDrop = () => {
popoverVisible.value = false
}
defineExpose({
popoverVisible
})
//
const updataTableColumns = (val) => {
emit('updataTableColumns', val)
}
</script> </script>
<style scoped lang="scss">
.btn-div{
display: inline;
::v-deep(.el-button){
margin: 0px 5px;
}
::v-deep(.el-button.is-link){
margin: 0px;
}
}
</style>

55
src/components/rowDrop/index.vue

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="字段设置" width="270" v-model="popoverVisible" :scroll="true" :maxHeight="500"> <!-- <Dialog title="字段设置" width="270" v-model="popoverVisible" :scroll="true" :maxHeight="500"> -->
<div class="test_wrapper" @dragover="dragover($event)"> <div class="test_wrapper" @dragover="dragover($event)">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handlecheckallchange">全部</el-checkbox> <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handlecheckallchange">全部</el-checkbox>
<el-checkbox-group v-model="checkedDataList" @change="handlecheckedchange"> <el-checkbox-group v-model="checkedDataList" @change="handlecheckedchange">
@ -10,11 +10,13 @@
</draggable> </draggable>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<template #footer> <div class="footer">
<!-- <template #footer> -->
<el-button size="small" @click="reset">重置</el-button> <el-button size="small" @click="reset">重置</el-button>
<el-button size="small" @click="closeRowDrop">关闭</el-button> <el-button size="small" @click="closeRowDrop">关闭</el-button>
</template> <!-- </template> -->
</Dialog> </div>
<!-- </Dialog> -->
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
@ -68,7 +70,7 @@ const reset = () => {
// //
const closeRowDrop = () => { const closeRowDrop = () => {
popoverVisible.value = false emit('closeRowDrop')
} }
// //
@ -153,7 +155,20 @@ const initSelectSta = () => {
}) })
_showTableColumns.push(_myTableColumns[_myTableColumns.length-1]) _showTableColumns.push(_myTableColumns[_myTableColumns.length-1])
if(checkedDataList.value.length>0){
if(allData.value?.length != checkedDataList.value.length){
isIndeterminate.value = true
}else{
isIndeterminate.value = false
checkAll.value = true
}
}else{
isIndeterminate.value = false
checkAll.value = false
}
updataTableColumns(_showTableColumns) updataTableColumns(_showTableColumns)
} else { // } else { //
checkedDataList.value = [] checkedDataList.value = []
allData.value = [] allData.value = []
@ -182,7 +197,8 @@ const updataTableColumns = (val) => {
// //
const emit = defineEmits([ const emit = defineEmits([
'updataTableColumns' 'updataTableColumns',
'closeRowDrop'
]) ])
/** 初始化 **/ /** 初始化 **/
@ -196,10 +212,25 @@ defineExpose({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// .buttonsBox { .test_wrapper{
// text-align: center; max-height: calc(100vh - 350px);
// margin: 0; overflow-y: auto;
// padding: 15px; }
// border-top: #eee solid 1px; .footer{
// } margin-top: 10px;
}
.el-checkbox-group ::v-deep(.el-checkbox .el-checkbox__inner){
background: url(../../assets/imgs/Eyes-closed.png) no-repeat 0px 0px;
background-size: 16px;
width: 16px;
height: 16px;
border: none;
}
.el-checkbox-group ::v-deep(.el-checkbox .is-checked .el-checkbox__inner){
background: url(../../assets/imgs/eye.png) no-repeat 0px 0px;
background-size: 16px;
width: 16px;
height: 16px;
border: none;
}
</style> </style>

63
src/router/modules/remaining.ts

@ -329,41 +329,54 @@ const remainingRouter: AppRouteRecordRaw[] = [
} }
} }
] ]
}, }
{ // ,
path: '/wms',
component: Layout,
name: 'wms',
meta: {
hidden: true
},
children: [
// { // {
// path: '/wms/itembasic-manage/itembasic-detail', // path: '/lab',
// component: () => import('@/views/wms/itembasic/ItembasicDetail.vue'), // component: Layout,
// name: 'ItembasicDetail', // name: 'lab',
// meta: { // meta: {
// noCache: true, // hidden: false
// hidden: true,
// canTo: true,
// title: '物品详情',
// activeMenu: '/wms/itembasic-manage/itembasic'
// }
// }, // },
// children: [
// { // {
// path: '/wms/itempackaging-manage/itempackaging-detail', // path: '/lab/impact',
// component: () => import('@/views/wms/itempackaging/ItempackagingDetail.vue'), // component: () => import('@/views/lab/impact/index.vue'),
// name: 'ItempackagingDetail', // name: 'impact',
// meta: { // meta: {
// noCache: true, // noCache: true,
// hidden: true, // hidden: true,
// canTo: true, // canTo: true,
// title: '包装详情', // title: '物品详情',
// activeMenu: '/wms/itempackaging-manage/itempackaging' // activeMenu: '/lab/impact'
// } // }
// } // }
] // // {
} // // path: '/wms/itembasic-manage/itembasic-detail',
// // component: () => import('@/views/wms/itembasic/ItembasicDetail.vue'),
// // name: 'ItembasicDetail',
// // meta: {
// // noCache: true,
// // hidden: true,
// // canTo: true,
// // title: '物品详情',
// // activeMenu: '/wms/itembasic-manage/itembasic'
// // }
// // },
// // {
// // path: '/wms/itempackaging-manage/itempackaging-detail',
// // component: () => import('@/views/wms/itempackaging/ItempackagingDetail.vue'),
// // name: 'ItempackagingDetail',
// // meta: {
// // noCache: true,
// // hidden: true,
// // canTo: true,
// // title: '包装详情',
// // activeMenu: '/wms/itempackaging-manage/itempackaging'
// // }
// // }
// ]
// }
] ]
export default remainingRouter export default remainingRouter

88
src/utils/dict.ts

@ -30,7 +30,7 @@ export const getIntDictOptions = (dictType: string) => {
dictOptions.forEach((dict: DictDataType) => { dictOptions.forEach((dict: DictDataType) => {
dictOption.push({ dictOption.push({
...dict, ...dict,
value: parseInt(dict.value + '') value: dict.value + '' // parseInt(dict.value + '')
}) })
}) })
return dictOption return dictOption
@ -182,88 +182,8 @@ export enum DICT_TYPE {
PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态 PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举
// ========== 业务 - WMS ========== // ========== LAB - 实验室数据模块 ============
ITEM_STATUS = 'item_status', // 物品状态 LAB_USER_TEST_TYPE = 'test_user_type',
ITEM_TYPE = 'item_type', // 物品类型 LAB_AUDIT_STATUS = 'lab_audit_status'
UOM = 'uom', // 计量单位
ABC_CLASS = 'abc_class', // ABC类
TRUE_FALSE = 'true_false', // 是否
ITEM_GROUP = 'item_group', // 物品分组
ITEM_CATEGORY = 'Item_category', // 物品种类
ITEM_COLOR = 'item_color', // 物品颜色
ITEM_CONFIGURATION = 'item_configuration', // 物品配置
EQ_LEVEL = 'eq_level', // 质量等级
CURRENCY = 'currency', // 货币
SUPPLIER_TYPE = 'supplier_type', // 供应商类型
CUSTOMER_TYPE = 'customer_type', // 客户类型
OWNER_TYPE = 'owner_type', // 货主类型
CARRIER_TYPE = 'carrier_type', // 承运商类型
INSPECT_TYPE = 'inspect_type', // 检验类型
NEXT_ACTION = 'next_action', // 下一步检验动作
SAMPLE_METHOD = 'sample_method', // 抽检方式
WAREHOUSE_TYPE = 'warehouse_type', // 仓库类型
DOCK_TYPE = 'dock_type', // 月台类型
AREA_TYPE = 'area_type', // 库区类型
INVENTORY_STATUS = 'inventory_status', // 库存状态
ERP_LOCATION = 'erp_location', // ERP库位
LOCATION_TYPE = 'location_type', // 库位类型
WORKSHOP_TYPE = 'workshop_type', // 车间类型
PRODUCTION_LINE_TYPE = 'production_line_type', // 生产线类型
WORK_STATION_TYPE = 'work_station_type', // 工位类型
PROCESS_TYPE = 'process_type', // 工序类型
LOCATION_SCOPE_TYPE = 'location_scope_type', // 库位维度
STORAGE_TYPE = 'storage_type', // 存储类型
ITEM_SCOPE_TYPE = 'item_scope_type', // 物品维度
BATCH_TYPE = 'batch_type', // 批次类型
BATCH_DIRECTION = 'batch_direction', // 批次方向
MANAGEMENT_MODE = 'management_mode', // 管理模式
DOCUMENT_TYPE = 'document_type', // 单据分类
REQEUST_MODE = 'reqeust_mode', // 申请模式
TIME_UNIT = 'time_unit', // 时间单位
COUNT_TYPE = 'count_type', // 盘点类型
BARCODE_PREFIX = 'barcode_prefix', // 条码前缀
SETTLEMENT_TYPE = 'settlement_type', // 结算类型
FROZEN_REASON = 'frozen_reason', // 冻结原因
INVENTORY_ACTION = 'inventory_action', // 库存动作
CONTAINER_TYPE = 'container_type', // 器具类型
CONTAINER_CONTENT_TYPE = 'container_content_type', // 器具内容类型
RESET_PERIOD = 'reset_period', // 重置周期
INTERFACE_TYPE = 'interface_type', // 接口类型
PURCHASE_ORDER_TYPE = 'purchase_order_type', // 采购订单类型
PURCHASE_ORDER_STATUS = 'purchase_order_status', // 采购订单状态
PURCHASE_ORDER_DETAIL_STATUS = 'purchase_order_detail_status', // 采购订单明细状态
SALE_ORDER_TYPE = 'sale_order_type', // 销售订单类型
SALE_ORDER_STATUS = 'sale_order_status', // 销售订单状态
SALE_ORDER_DETAIL_STATUS = 'sale_order_detail_status', // 销售订单明细状态
WORK_ORDER_TYPE = 'work_order_type', // 生产订单类型
WORK_ORDER_STATUS = 'work_order_status', // 生产订单状态
WORK_ORDER_DETAIL_STATUS = 'work_order_detail_status', // 生产订单明细状态
PURCHASE_PLAN_STATUS = 'purchase_plan_status', // 要货计划状态
PURCHASE_PLAN_DETAIL_STATUS = 'purchase_plan_detail_status', // 要货计划明细状态
PRODUCTION_PLAN_STATUS = 'production_plan_status', // 生产计划状态
PRODUCTION_PLAN_DETAIL_STATUS = 'production_plan_detail_status', // 生产计划明细状态
PREPARE_TO_ISSUE_PLAN_STATUS = 'prepare_to_issue_plan_status', // 备料计划状态
PREPARE_TO_ISSUE_PLAN_DETAIL_STATUS = 'prepare_to_issue_plan_detail_status', // 备料计划明细状态
DELIVER_PLAN_STATUS = 'deliver_plan_status', // 发货计划状态
DELIVER_DETAIL_STATUS = 'deliver_detail_status', // 发货计划明细状态
PREPARE_TO_DELIVER_PLAN_STATUS = 'prepare_to_deliver_plan_status', // 备货计划状态
PREPARE_TO_DELIVER_PLAN_DETAIL_STATUS = 'prepare_to_deliver_plan_detail_status', // 备货计划明细状态
COUNT_PLAN_STATUS = 'count_plan_status', // 盘点计划状态
COUNT_DIMENSION = 'count_dimension', // 盘点维度
REQUEST_STATUS = 'request_status', // 申请状态
UNPLANNED_RECEIPT_REASON = 'unplanned_receipt_reason', // 计划外入库原因
UNPLANNED_ISSUE_REASON = 'unplanned_issue_reason', // 计划外出库原因
SCRAP_REASON = 'scrap_reason', // 报废出库原因
COUNT_STAGE = 'count_stage', // 盘点阶段
JOB_STATUS = 'job_status', // 任务状态
RECORD_STATUS = 'record_status', // 记录状态
PURCHASE_RETURN_REASON = 'purchase_return_reason', // 采购退货原因
INSPECT_FAILED_REASON = 'inspect_failed_reason', // 检验不合格原因
INSPECT_RESULT = 'inspect_result', // 检验结果
STRATEGY_TYPE = 'strategy_type', // 策略类型
STRATEGY_PARAM_OPEARTOR = 'strategy_param_opeartor', // 策略参数操作符
DATA_TYPE = 'data_type', // 数据类型
PACK_UNIT = 'pack_unit', // 包装单位
DETAIL_STATUS = 'detail_status' // 明细状态
} }

383
src/views/Home/Index.vue

@ -1,381 +1,16 @@
<template> <template>
<div> <!-- <img class="homebg" src="@/assets/imgs/bgnew.jpg" /> -->
<el-card shadow="never"> <div></div>
<el-skeleton :loading="loading" animated>
<el-row :gutter="20" justify="space-between">
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<div class="flex items-center">
<img :src="avatar" alt="" class="mr-20px h-70px w-70px rounded-[50%]" />
<div>
<div class="text-20px">
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
</div>
<div class="mt-10px text-14px text-gray-500">
{{ t('workplace.toady') }}20 - 32
</div>
</div>
</div>
</el-col>
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<div class="h-70px flex items-center justify-end lt-sm:mt-10px">
<div class="px-8px text-right">
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.project') }}</div>
<CountTo
class="text-20px"
:start-val="0"
:end-val="totalSate.project"
:duration="2600"
/>
</div>
<el-divider direction="vertical" />
<div class="px-8px text-right">
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
<CountTo
class="text-20px"
:start-val="0"
:end-val="totalSate.todo"
:duration="2600"
/>
</div>
<el-divider direction="vertical" border-style="dashed" />
<div class="px-8px text-right">
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.access') }}</div>
<CountTo
class="text-20px"
:start-val="0"
:end-val="totalSate.access"
:duration="2600"
/>
</div>
</div>
</el-col>
</el-row>
</el-skeleton>
</el-card>
</div>
<el-row class="mt-5px" :gutter="20" justify="space-between">
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<template #header>
<div class="h-3 flex justify-between">
<span>{{ t('workplace.project') }}</span>
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
</div>
</template>
<el-skeleton :loading="loading" animated>
<el-row>
<el-col
v-for="(item, index) in projects"
:key="`card-${index}`"
:xl="8"
:lg="8"
:md="8"
:sm="24"
:xs="24"
>
<el-card shadow="hover">
<div class="flex items-center">
<Icon :icon="item.icon" :size="25" class="mr-10px" />
<span class="text-16px">{{ item.name }}</span>
</div>
<div class="mt-15px text-14px text-gray-400">{{ t(item.message) }}</div>
<div class="mt-20px flex justify-between text-12px text-gray-400">
<span>{{ item.personal }}</span>
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
</div>
</el-card>
</el-col>
</el-row>
</el-skeleton>
</el-card>
<el-card shadow="never" class="mt-5px">
<el-skeleton :loading="loading" animated>
<el-row :gutter="20" justify="space-between">
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
<el-card shadow="hover" class="mb-10px">
<el-skeleton :loading="loading" animated>
<Echart :options="pieOptionsData" :height="280" />
</el-skeleton>
</el-card>
</el-col>
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
<el-card shadow="hover" class="mb-10px">
<el-skeleton :loading="loading" animated>
<Echart :options="barOptionsData" :height="280" />
</el-skeleton>
</el-card>
</el-col>
</el-row>
</el-skeleton>
</el-card>
</el-col>
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<template #header>
<div class="h-3 flex justify-between">
<span>{{ t('workplace.shortcutOperation') }}</span>
</div>
</template>
<el-skeleton :loading="loading" animated>
<el-row>
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-10px">
<div class="flex items-center">
<Icon :icon="item.icon" class="mr-10px" />
<el-link type="default" :underline="false" @click="setWatermark(item.name)">
{{ item.name }}
</el-link>
</div>
</el-col>
</el-row>
</el-skeleton>
</el-card>
<el-card shadow="never" class="mt-10px">
<template #header>
<div class="h-3 flex justify-between">
<span>{{ t('workplace.notice') }}</span>
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
</div>
</template>
<el-skeleton :loading="loading" animated>
<div v-for="(item, index) in notice" :key="`dynamics-${index}`">
<div class="flex items-center">
<img :src="avatar" alt="" class="mr-20px h-35px w-35px rounded-[50%]" />
<div>
<div class="text-14px">
<Highlight :keys="item.keys.map((v) => t(v))">
{{ item.type }} : {{ item.title }}
</Highlight>
</div>
<div class="mt-15px text-12px text-gray-400">
{{ formatTime(item.date, 'yyyy-MM-dd') }}
</div>
</div>
</div>
<el-divider />
</div>
</el-skeleton>
</el-card>
</el-col>
</el-row>
</template> </template>
<script lang="ts" setup> <style lang="scss">
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
import { formatTime } from '@/utils'
import { useUserStore } from '@/store/modules/user'
import { useWatermark } from '@/hooks/web/useWatermark'
import avatarImg from '@/assets/imgs/avatar.gif'
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
import { pieOptions, barOptions } from './echarts-data'
defineOptions({ name: 'Home' })
const { t } = useI18n() .homebg {
const userStore = useUserStore() padding: 0px;
const { setWatermark } = useWatermark() width: 100%;
const loading = ref(true) height: 100%;
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg // background-size: cover;
const username = userStore.getUser.nickname
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
//
let totalSate = reactive<WorkplaceTotal>({
project: 0,
access: 0,
todo: 0
})
const getCount = async () => {
const data = {
project: 40,
access: 2340,
todo: 10
}
totalSate = Object.assign(totalSate, data)
}
//
let projects = reactive<Project[]>([])
const getProject = async () => {
const data = [
{
name: 'Github',
icon: 'akar-icons:github-fill',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Vue',
icon: 'logos:vue',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Angular',
icon: 'logos:angular-icon',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'React',
icon: 'logos:react',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Webpack',
icon: 'logos:webpack',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Vite',
icon: 'vscode-icons:file-type-vite',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
} }
]
projects = Object.assign(projects, data)
}
//
let notice = reactive<Notice[]>([])
const getNotice = async () => {
const data = [
{
title: '系统升级版本',
type: '通知',
keys: ['通知', '升级'],
date: new Date()
},
{
title: '系统凌晨维护',
type: '公告',
keys: ['公告', '维护'],
date: new Date()
},
{
title: '系统升级版本',
type: '通知',
keys: ['通知', '升级'],
date: new Date()
},
{
title: '系统凌晨维护',
type: '公告',
keys: ['公告', '维护'],
date: new Date()
}
]
notice = Object.assign(notice, data)
}
//
let shortcut = reactive<Shortcut[]>([])
const getShortcut = async () => {
const data = [
{
name: 'Github',
icon: 'akar-icons:github-fill',
url: 'github.io'
},
{
name: 'Vue',
icon: 'logos:vue',
url: 'vuejs.org'
},
{
name: 'Vite',
icon: 'vscode-icons:file-type-vite',
url: 'https://vitejs.dev/'
},
{
name: 'Angular',
icon: 'logos:angular-icon',
url: 'github.io'
},
{
name: 'React',
icon: 'logos:react',
url: 'github.io'
},
{
name: 'Webpack',
icon: 'logos:webpack',
url: 'github.io'
}
]
shortcut = Object.assign(shortcut, data)
}
//
const getUserAccessSource = async () => {
const data = [
{ value: 335, name: 'analysis.directAccess' },
{ value: 310, name: 'analysis.mailMarketing' },
{ value: 234, name: 'analysis.allianceAdvertising' },
{ value: 135, name: 'analysis.videoAdvertising' },
{ value: 1548, name: 'analysis.searchEngines' }
]
set(
pieOptionsData,
'legend.data',
data.map((v) => t(v.name))
)
pieOptionsData!.series![0].data = data.map((v) => {
return {
name: t(v.name),
value: v.value
}
})
}
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
//
const getWeeklyUserActivity = async () => {
const data = [
{ value: 13253, name: 'analysis.monday' },
{ value: 34235, name: 'analysis.tuesday' },
{ value: 26321, name: 'analysis.wednesday' },
{ value: 12340, name: 'analysis.thursday' },
{ value: 24643, name: 'analysis.friday' },
{ value: 1322, name: 'analysis.saturday' },
{ value: 1324, name: 'analysis.sunday' }
]
set(
barOptionsData,
'xAxis.data',
data.map((v) => t(v.name))
)
set(barOptionsData, 'series', [
{
name: t('analysis.activeQuantity'),
data: data.map((v) => v.value),
type: 'bar'
}
])
}
const getAllApi = async () => {
await Promise.all([
getCount(),
getProject(),
getNotice(),
getShortcut(),
getUserAccessSource(),
getWeeklyUserActivity()
])
loading.value = false
}
getAllApi() </style>
</script>

381
src/views/Home/Index.vue.bark

@ -0,0 +1,381 @@
<template>
<div>
<el-card shadow="never">
<el-skeleton :loading="loading" animated>
<el-row :gutter="20" justify="space-between">
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<div class="flex items-center">
<img :src="avatar" alt="" class="mr-20px h-70px w-70px rounded-[50%]" />
<div>
<div class="text-20px">
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
</div>
<div class="mt-10px text-14px text-gray-500">
{{ t('workplace.toady') }},20℃ - 32℃!
</div>
</div>
</div>
</el-col>
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<div class="h-70px flex items-center justify-end lt-sm:mt-10px">
<div class="px-8px text-right">
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.project') }}</div>
<CountTo
class="text-20px"
:start-val="0"
:end-val="totalSate.project"
:duration="2600"
/>
</div>
<el-divider direction="vertical" />
<div class="px-8px text-right">
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
<CountTo
class="text-20px"
:start-val="0"
:end-val="totalSate.todo"
:duration="2600"
/>
</div>
<el-divider direction="vertical" border-style="dashed" />
<div class="px-8px text-right">
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.access') }}</div>
<CountTo
class="text-20px"
:start-val="0"
:end-val="totalSate.access"
:duration="2600"
/>
</div>
</div>
</el-col>
</el-row>
</el-skeleton>
</el-card>
</div>
<el-row class="mt-5px" :gutter="20" justify="space-between">
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<template #header>
<div class="h-3 flex justify-between">
<span>{{ t('workplace.project') }}</span>
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
</div>
</template>
<el-skeleton :loading="loading" animated>
<el-row>
<el-col
v-for="(item, index) in projects"
:key="`card-${index}`"
:xl="8"
:lg="8"
:md="8"
:sm="24"
:xs="24"
>
<el-card shadow="hover">
<div class="flex items-center">
<Icon :icon="item.icon" :size="25" class="mr-10px" />
<span class="text-16px">{{ item.name }}</span>
</div>
<div class="mt-15px text-14px text-gray-400">{{ t(item.message) }}</div>
<div class="mt-20px flex justify-between text-12px text-gray-400">
<span>{{ item.personal }}</span>
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
</div>
</el-card>
</el-col>
</el-row>
</el-skeleton>
</el-card>
<el-card shadow="never" class="mt-5px">
<el-skeleton :loading="loading" animated>
<el-row :gutter="20" justify="space-between">
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
<el-card shadow="hover" class="mb-10px">
<el-skeleton :loading="loading" animated>
<Echart :options="pieOptionsData" :height="280" />
</el-skeleton>
</el-card>
</el-col>
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
<el-card shadow="hover" class="mb-10px">
<el-skeleton :loading="loading" animated>
<Echart :options="barOptionsData" :height="280" />
</el-skeleton>
</el-card>
</el-col>
</el-row>
</el-skeleton>
</el-card>
</el-col>
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px">
<el-card shadow="never">
<template #header>
<div class="h-3 flex justify-between">
<span>{{ t('workplace.shortcutOperation') }}</span>
</div>
</template>
<el-skeleton :loading="loading" animated>
<el-row>
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-10px">
<div class="flex items-center">
<Icon :icon="item.icon" class="mr-10px" />
<el-link type="default" :underline="false" @click="setWatermark(item.name)">
{{ item.name }}
</el-link>
</div>
</el-col>
</el-row>
</el-skeleton>
</el-card>
<el-card shadow="never" class="mt-10px">
<template #header>
<div class="h-3 flex justify-between">
<span>{{ t('workplace.notice') }}</span>
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
</div>
</template>
<el-skeleton :loading="loading" animated>
<div v-for="(item, index) in notice" :key="`dynamics-${index}`">
<div class="flex items-center">
<img :src="avatar" alt="" class="mr-20px h-35px w-35px rounded-[50%]" />
<div>
<div class="text-14px">
<Highlight :keys="item.keys.map((v) => t(v))">
{{ item.type }} : {{ item.title }}
</Highlight>
</div>
<div class="mt-15px text-12px text-gray-400">
{{ formatTime(item.date, 'yyyy-MM-dd') }}
</div>
</div>
</div>
<el-divider />
</div>
</el-skeleton>
</el-card>
</el-col>
</el-row>
</template>
<script lang="ts" setup>
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
import { formatTime } from '@/utils'
import { useUserStore } from '@/store/modules/user'
import { useWatermark } from '@/hooks/web/useWatermark'
import avatarImg from '@/assets/imgs/avatar.gif'
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
import { pieOptions, barOptions } from './echarts-data'
defineOptions({ name: 'Home' })
const { t } = useI18n()
const userStore = useUserStore()
const { setWatermark } = useWatermark()
const loading = ref(true)
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
const username = userStore.getUser.nickname
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
// 获取统计数
let totalSate = reactive<WorkplaceTotal>({
project: 0,
access: 0,
todo: 0
})
const getCount = async () => {
const data = {
project: 40,
access: 2340,
todo: 10
}
totalSate = Object.assign(totalSate, data)
}
// 获取项目数
let projects = reactive<Project[]>([])
const getProject = async () => {
const data = [
{
name: 'Github',
icon: 'akar-icons:github-fill',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Vue',
icon: 'logos:vue',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Angular',
icon: 'logos:angular-icon',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'React',
icon: 'logos:react',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Webpack',
icon: 'logos:webpack',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
},
{
name: 'Vite',
icon: 'vscode-icons:file-type-vite',
message: 'workplace.introduction',
personal: 'Archer',
time: new Date()
}
]
projects = Object.assign(projects, data)
}
// 获取通知公告
let notice = reactive<Notice[]>([])
const getNotice = async () => {
const data = [
{
title: '系统升级版本',
type: '通知',
keys: ['通知', '升级'],
date: new Date()
},
{
title: '系统凌晨维护',
type: '公告',
keys: ['公告', '维护'],
date: new Date()
},
{
title: '系统升级版本',
type: '通知',
keys: ['通知', '升级'],
date: new Date()
},
{
title: '系统凌晨维护',
type: '公告',
keys: ['公告', '维护'],
date: new Date()
}
]
notice = Object.assign(notice, data)
}
// 获取快捷入口
let shortcut = reactive<Shortcut[]>([])
const getShortcut = async () => {
const data = [
{
name: 'Github',
icon: 'akar-icons:github-fill',
url: 'github.io'
},
{
name: 'Vue',
icon: 'logos:vue',
url: 'vuejs.org'
},
{
name: 'Vite',
icon: 'vscode-icons:file-type-vite',
url: 'https://vitejs.dev/'
},
{
name: 'Angular',
icon: 'logos:angular-icon',
url: 'github.io'
},
{
name: 'React',
icon: 'logos:react',
url: 'github.io'
},
{
name: 'Webpack',
icon: 'logos:webpack',
url: 'github.io'
}
]
shortcut = Object.assign(shortcut, data)
}
// 用户来源
const getUserAccessSource = async () => {
const data = [
{ value: 335, name: 'analysis.directAccess' },
{ value: 310, name: 'analysis.mailMarketing' },
{ value: 234, name: 'analysis.allianceAdvertising' },
{ value: 135, name: 'analysis.videoAdvertising' },
{ value: 1548, name: 'analysis.searchEngines' }
]
set(
pieOptionsData,
'legend.data',
data.map((v) => t(v.name))
)
pieOptionsData!.series![0].data = data.map((v) => {
return {
name: t(v.name),
value: v.value
}
})
}
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
// 周活跃量
const getWeeklyUserActivity = async () => {
const data = [
{ value: 13253, name: 'analysis.monday' },
{ value: 34235, name: 'analysis.tuesday' },
{ value: 26321, name: 'analysis.wednesday' },
{ value: 12340, name: 'analysis.thursday' },
{ value: 24643, name: 'analysis.friday' },
{ value: 1322, name: 'analysis.saturday' },
{ value: 1324, name: 'analysis.sunday' }
]
set(
barOptionsData,
'xAxis.data',
data.map((v) => t(v.name))
)
set(barOptionsData, 'series', [
{
name: t('analysis.activeQuantity'),
data: data.map((v) => v.value),
type: 'bar'
}
])
}
const getAllApi = async () => {
await Promise.all([
getCount(),
getProject(),
getNotice(),
getShortcut(),
getUserAccessSource(),
getWeeklyUserActivity()
])
loading.value = false
}
getAllApi()
</script>

94
src/views/basedata/device/device.data.ts

@ -0,0 +1,94 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as GxApi from '@/api/basedata/progx'
const gxList = await GxApi.getAllGxs()
// 表单校验
export const DeviceRules = reactive({
deviceNo: [required],
deviceName: [required],
gxId: [required]
})
export const Device = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '设备编号',
field: 'deviceNo',
sort: 'custom',
isSearch: true,
},
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: true,
},
{
label: '设备描述',
field: 'deviceDesc',
sort: 'custom',
isSearch: false,
},
{
label: '所属工序',
field: 'gxId',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return gxList.find((obj) => obj.id === cellValue)?.gxName
},
search: {
show: true,
component: 'Select',
api: () => gxList,
componentProps: {
optionsAlias: {
labelField: 'gxName',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => gxList,
componentProps: {
optionsAlias: {
labelField: 'gxName',
valueField: 'id'
}
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
}
]))

220
src/views/basedata/device/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Device.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Device.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="getList"
:rules="DeviceRules"
:formAllSchemas="Device.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="DeviceApi.updateDevice"
:apiCreate="DeviceApi.createDevice"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Device,DeviceRules } from './device.data'
import * as DeviceApi from '@/api/basedata/device'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Device' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Device.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: DeviceApi.getDevicePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDevice')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceApi.deleteDevice(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 DeviceApi.exportDevice(setSearchParams)
download.excel(data, '设备信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceApi.importTemplate()
})
</script>

96
src/views/basedata/factory/factory.data.ts

@ -0,0 +1,96 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime'
import * as GroupApi from '@/api/basedata/group'
const groupList = await GroupApi.getAllGroupList()
// 表单校验
export const FactoryRules = reactive({
facNo: [required],
facName: [required],
groupId: [required]
})
const crudSchemas = reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '工厂编号',
field: 'facNo',
sort: 'custom',
isSearch: false,
},
{
label: '工厂名称',
field: 'facName',
sort: 'custom',
isSearch: true,
},
{
label: '工厂描述',
field: 'facDesc',
sort: 'custom',
isSearch: false,
},
{
label: '所属集团',
field: 'groupId',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return groupList.find((group) => group.id === cellValue)?.groupName
},
search: {
show: true,
component: 'Select',
api: () => groupList,
componentProps: {
optionsAlias: {
labelField: 'groupName',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => groupList,
componentProps: {
optionsAlias: {
labelField: 'groupName',
valueField: 'id'
}
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
}
])
export const { allSchemas } = useCrudSchemas(crudSchemas)

220
src/views/basedata/factory/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="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="getList"
:rules="FactoryRules"
:formAllSchemas="allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="FactoryApi.updateFactory"
:apiCreate="FactoryApi.createFactory"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { allSchemas , FactoryRules } from './factory.data'
import * as FactoryApi from '@/api/basedata/factory'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Factory' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: FactoryApi.getFactoryPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicFactory')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await FactoryApi.deleteFactory(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 FactoryApi.exportFactory(setSearchParams)
download.excel(data, '工厂信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工厂信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await FactoryApi.importTemplate()
})
</script>

60
src/views/basedata/group/group.data.ts

@ -0,0 +1,60 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const GroupRules = reactive({
groupNo: [required],
groupName: [required]
})
export const Group = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '集团编号',
field: 'groupNo',
sort: 'custom',
isSearch: false,
},
{
label: '集团名称',
field: 'groupName',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'groupDesc',
sort: 'custom',
isSearch: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
}
]))

220
src/views/basedata/group/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Group.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Group.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="getList"
:rules="GroupRules"
:formAllSchemas="Group.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="GroupApi.updateGroup"
:apiCreate="GroupApi.createGroup"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Group,GroupRules } from './group.data'
import * as GroupApi from '@/api/basedata/group'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Group' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Group.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: GroupApi.getGroupPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicGroup')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await GroupApi.deleteGroup(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 GroupApi.exportGroup(setSearchParams)
download.excel(data, '集团信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '集团信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await GroupApi.importTemplate()
})
</script>

220
src/views/basedata/progx/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Progx.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Progx.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="getList"
:rules="ProgxRules"
:formAllSchemas="Progx.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="ProgxApi.updateProgx"
:apiCreate="ProgxApi.createProgx"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Progx,ProgxRules } from './progx.data'
import * as ProgxApi from '@/api/basedata/progx'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Progx' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Progx.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: ProgxApi.getProgxPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicProgx')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProgxApi.deleteProgx(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 ProgxApi.exportProgx(setSearchParams)
download.excel(data, '工序信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工序信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProgxApi.importTemplate()
})
</script>

93
src/views/basedata/progx/progx.data.ts

@ -0,0 +1,93 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as LineApi from '@/api/basedata/proline'
const lineList = await LineApi.selectAllLines()
// 表单校验
export const ProgxRules = reactive({
gxNo: [required],
gxName: [required],
lineId: [required]
})
export const Progx = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '工序编号',
field: 'gxNo',
sort: 'custom',
isSearch: false,
},
{
label: '工序名称',
field: 'gxName',
sort: 'custom',
isSearch: true,
},
{
label: '工序描述',
field: 'gxDesc',
sort: 'custom',
isSearch: false,
},
{
label: '所属产线',
field: 'lineId',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return lineList.find((obj) => obj.id === cellValue)?.lineName
},
search: {
show: true,
component: 'Select',
api: () => lineList,
componentProps: {
optionsAlias: {
labelField: 'lineName',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => lineList,
componentProps: {
optionsAlias: {
labelField: 'lineName',
valueField: 'id'
}
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
}
]))

220
src/views/basedata/proline/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Proline.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Proline.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="getList"
:rules="ProlineRules"
:formAllSchemas="Proline.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="ProlineApi.updateProline"
:apiCreate="ProlineApi.createProline"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Proline,ProlineRules } from './proline.data'
import * as ProlineApi from '@/api/basedata/proline'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Proline' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Proline.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: ProlineApi.getProlinePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicProline')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProlineApi.deleteProline(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 ProlineApi.exportProline(setSearchParams)
download.excel(data, '产线信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '产线信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProlineApi.importTemplate()
})
</script>

93
src/views/basedata/proline/proline.data.ts

@ -0,0 +1,93 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as ShopApi from '@/api/basedata/workshop'
const shopList = await ShopApi.selectAllShops()
// 表单校验
export const ProlineRules = reactive({
lineNo: [required],
lineName: [required],
shopId: [required]
})
export const Proline = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '产线编号',
field: 'lineNo',
sort: 'custom',
isSearch: false,
},
{
label: '产线名称',
field: 'lineName',
sort: 'custom',
isSearch: true,
},
{
label: '产线描述',
field: 'lineDesc',
sort: 'custom',
isSearch: false,
},
{
label: '所属车间',
field: 'shopId',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return shopList.find((obj) => obj.id === cellValue)?.shopName
},
search: {
show: true,
component: 'Select',
api: () => shopList,
componentProps: {
optionsAlias: {
labelField: 'shopName',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => shopList,
componentProps: {
optionsAlias: {
labelField: 'shopName',
valueField: 'id'
}
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
}
]))

220
src/views/basedata/workshop/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Workshop.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Workshop.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="getList"
:rules="WorkshopRules"
:formAllSchemas="Workshop.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="WorkshopApi.updateWorkshop"
:apiCreate="WorkshopApi.createWorkshop"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Workshop,WorkshopRules } from './workshop.data'
import * as WorkshopApi from '@/api/basedata/workshop'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Workshop' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Workshop.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: WorkshopApi.getWorkshopPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkshop')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await WorkshopApi.deleteWorkshop(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 WorkshopApi.exportWorkshop(setSearchParams)
download.excel(data, '车间信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '车间信息导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await WorkshopApi.importTemplate()
})
</script>

93
src/views/basedata/workshop/workshop.data.ts

@ -0,0 +1,93 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as FactoryApi from '@/api/basedata/factory'
const facList = await FactoryApi.selectAllFactorys()
// 表单校验
export const WorkshopRules = reactive({
shopNo: [required],
shopName: [required],
facId: [required]
})
export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '车间编号',
field: 'shopNo',
sort: 'custom',
isSearch: false,
},
{
label: '车间名称',
field: 'shopName',
sort: 'custom',
isSearch: true,
},
{
label: '车间描述',
field: 'shopDesc',
sort: 'custom',
isSearch: false,
},
{
label: '所属工厂',
field: 'facId',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return facList.find((obj) => obj.id === cellValue)?.facName
},
search: {
show: true,
component: 'Select',
api: () => facList,
componentProps: {
optionsAlias: {
labelField: 'facName',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => facList,
componentProps: {
optionsAlias: {
labelField: 'facName',
valueField: 'id'
}
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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'
}
}
]))

58
src/views/lab/hardness/one/hardnessOne.data.ts

@ -0,0 +1,58 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const HardnessOneRules = reactive({
})
export const HardnessOne = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '批次号',
field: 'fileName',
sort: 'custom',
isSearch: true,
},
{
label: '文件类型',
field: 'fileType',
sort: 'custom',
isSearch: false,
form: {
component: 'SelectV2'
},
},
{
label: '系统生成的文件名称',
field: 'fileNewName',
sort: 'custom',
isSearch: false,
table: {
width: 400
}
},
{
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: 200,
fixed: 'right'
}
}
]))

227
src/views/lab/hardness/one/index.vue

@ -0,0 +1,227 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HardnessOne.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HardnessOne.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 }">
<el-button type="text" @click="viewHardOne(row)">预览</el-button>
<el-button type="text" @click="downloadHardOne(row)">下载</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="HardnessOneRules"
:formAllSchemas="HardnessOne.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HardnessOneApi.updateHardnessOne"
:apiCreate="HardnessOneApi.createHardnessOne"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 导入 -->
<ImportSimpleForm ref="importFormRef" url="/lab/hardnessone/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<Dialog v-model="viewVisible" title="预览" width="850" :close-on-click-modal="false">
<div style="width: 820px; height: 600px ; overflow-y: auto">
<div ref="fileRef"></div>
</div>
</Dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HardnessOne,HardnessOneRules } from './hardnessOne.data'
import {renderAsync} from 'docx-preview'
import * as HardnessOneApi from '@/api/lab/hardness/one'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'HardnessOne' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const viewVisible = ref(false)
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HardnessOne.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: HardnessOneApi.getHardnessOnePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn({}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListDeleteBtn({}), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicHardnessOne')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HardnessOneApi.deleteHardnessOne(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
const fileRef = ref()
const viewHardOne = async (row) => {
viewVisible.value = true
const res = await HardnessOneApi.downLoadForHardOne(row.id)
renderAsync(res, fileRef.value)
}
const downloadHardOne = async (row) => {
const res = await HardnessOneApi.downLoadForHardOne(row.id)
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", row.fileName + ".docx");
document.body.appendChild(link);
link.click();
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-硬度-文档数据导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
// importTemplateData.templateUrl = await HardnessOneApi.importTemplate()
})
</script>

248
src/views/lab/impact/impact.data.ts

@ -0,0 +1,248 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ImpactRules = reactive({
})
export const Impact = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '批次号',
field: 'batchNo',
sort: 'custom',
isSearch: true,
table: {
width: 200
}
},
{
label: '送样单位',
field: 'sydw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '材质',
field: 'cz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规格',
field: 'guig',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '实验人',
field: 'operator',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
dictClass: 'number'
},
{
label: '实验日期',
field: 'testDate',
sort: 'custom',
// formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'x'
}
},
table: {
width: 250
}
},
{
label: '采集来源ID',
field: 'dataId',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '是否完成',
field: 'fineshed',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '序号(一般3次)',
field: 'sampleNo',
sort: 'custom',
isSearch: false,
table: {
width: 250
}
},
{
label: '冲击能量',
field: 'energy',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '冲击韧度',
field: 'toughness',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '检测标准',
field: 'standard',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
// {
// label: '实验操作者',
// field: 'operator',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150
// }
// },
{
label: '物料号',
field: 'material',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '温度',
field: 'temperature',
sort: 'custom',
isSearch: false,
},
{
label: '缺口类型',
field: 'style',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '长度',
field: 'length',
sort: 'custom',
isSearch: false,
},
{
label: '宽度',
field: 'width',
sort: 'custom',
isSearch: false,
},
{
label: '厚度',
field: 'height',
sort: 'custom',
isSearch: false,
},
{
label: '缺口深度',
field: 'deep',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '面积',
field: 'area',
sort: 'custom',
isSearch: false,
},
{
label: '审核状态',
field: 'auditStatus',
sort: 'custom',
isSearch: true,
table: {
width: 120,
fixed: 'right'
},
dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number'
},
{
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,
table: {
width: 200,
fixed: 'right'
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 180,
fixed: 'right'
}
}
]))

225
src/views/lab/impact/index.vue

@ -0,0 +1,225 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Impact.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Impact.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 }">
<el-button type="text" @click="auditStatus(row)">确认</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ImpactRules"
:formAllSchemas="Impact.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="ImpactApi.updateImpact"
:apiCreate="ImpactApi.createImpact"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Impact,ImpactRules } from './impact.data'
import * as ImpactApi from '@/api/lab/impact'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Impact' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Impact.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: ImpactApi.getImpactPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
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({}), //
defaultButtons.mainListDeleteBtn({}), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await ImpactApi.updateImpact(data)
message.success('操作成功')
//
await getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicImpact')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ImpactApi.deleteImpact(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 ImpactApi.exportImpact(setSearchParams)
download.excel(data, '实验室-冲击数据.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-冲击数据导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ImpactApi.importTemplate()
})
</script>

227
src/views/lab/platscale/index.vue

@ -0,0 +1,227 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Platscale.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Platscale.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 }">
<el-button type="text" @click="auditStatus(row)">确认</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="PlatscaleRules"
:formAllSchemas="Platscale.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="PlatscaleApi.updatePlatscale"
:apiCreate="PlatscaleApi.createPlatscale"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Platscale,PlatscaleRules } from './platscale.data'
import * as PlatscaleApi from '@/api/lab/platscale'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Platscale' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Platscale.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: PlatscaleApi.getPlatscalePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await PlatscaleApi.updatePlatscale(data)
message.success('操作成功')
//
await getList()
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PlatscaleApi.deletePlatscale(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 PlatscaleApi.exportPlatscale(setSearchParams)
download.excel(data, '实验室-地衡.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-地衡导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
// importTemplateData.templateUrl = await PlatscaleApi.importTemplate()
})
</script>

332
src/views/lab/platscale/platscale.data.ts

@ -0,0 +1,332 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime'
// 表单校验
export const PlatscaleRules = reactive({
})
export const Platscale = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '批号',
field: 'batchNo',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '送样单位',
field: 'sydw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '标准',
field: 'standard',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '材质',
field: 'cz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规格',
field: 'guig',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '实验人',
field: 'testUser',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
dictClass: 'number'
},
{
label: '车号',
field: 'ch',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '车型',
field: 'cx',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '品种',
field: 'pz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '供货单位',
field: 'ghdw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '运输单位',
field: 'ysdw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '出入库',
field: 'crk',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '毛重',
field: 'mz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '皮重',
field: 'pzh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '净重',
field: 'jz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '检斤员',
field: 'jjy',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '日期',
field: 'rq',
sort: 'custom',
isSearch: false,
formatter: dateFormatter2,
form: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'date'
}
},
table: {
width: 200
}
},
{
label: '一次计量时间',
field: 'jlsjOne',
sort: 'custom',
isSearch: false,
form: {
component: 'TimePicker',
componentProps: {
valueFormat: 'HH:mm:ss',
type: 'time'
}
},
table: {
width: 200
}
},
{
label: '二次计量时间',
field: 'jlsjTwo',
sort: 'custom',
isSearch: false,
form: {
component: 'TimePicker',
componentProps: {
valueFormat: 'HH:mm:ss',
type: 'time'
}
},
table: {
width: 200
}
},
{
label: '编号',
field: 'bh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '送货单位',
field: 'shdw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '性质',
field: 'xz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '防伪码',
field: 'fwm',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '抽样时间',
field: 'cysj',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '抽样编号',
field: 'cybh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '抽样结果',
field: 'cyjg',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '报告单编号',
field: 'bgdbh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '是否抽检',
field: 'sfcj',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '审核状态',
field: 'auditStatus',
sort: 'custom',
isSearch: true,
table: {
width: 120,
fixed: 'right'
},
dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number'
},
{
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,
table: {
width: 200,
fixed: 'right'
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 180,
fixed: 'right'
}
}
]))

233
src/views/lab/spectrum/index.vue

@ -0,0 +1,233 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Spectrum.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Spectrum.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 }">
<el-button type="text" @click="auditStatus(row)">确认</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="SpectrumRules"
:formAllSchemas="Spectrum.allSchemas"
:searchTableParams="searchTableParams"
@searchTableSuccess="searchTableSuccess"
:apiUpdate="SpectrumApi.updateSpectrum"
:apiCreate="SpectrumApi.createSpectrum"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Spectrum,SpectrumRules } from './spectrum.data'
import * as SpectrumApi from '@/api/lab/spectrum'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Spectrum' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Spectrum.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: SpectrumApi.getSpectrumPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({}), //
defaultButtons.defaultFreshBtn(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({}), //
defaultButtons.mainListDeleteBtn({}), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await SpectrumApi.updateSpectrum(data)
message.success('操作成功')
//
await getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSpectrum')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SpectrumApi.deleteSpectrum(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 SpectrumApi.exportSpectrum(setSearchParams)
download.excel(data, '实验室-光谱数据.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-光谱数据导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SpectrumApi.importTemplate()
})
</script>

281
src/views/lab/spectrum/spectrum.data.ts

@ -0,0 +1,281 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SpectrumRules = reactive({
})
export const Spectrum = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '批次号',
field: 'batchNo',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '送样单位',
field: 'syCompany',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '标准',
field: 'standard',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '材质',
field: 'cz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规格',
field: 'specsNo',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '实验人',
field: 'testUser',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
dictClass: 'number'
},
{
label: '实验日期',
field: 'oprDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 200
}
},
{
label: '原材料厂家',
field: 'yclSupplier',
sort: 'custom',
isSearch: false,
table: {
width: 180
}
},
// {
// label: '炉号',
// field: 'deviceNo',
// sort: 'custom',
// isSearch: false,
// },
{
label: '任务',
field: 'task',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '任务类型',
field: 'taskType',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '预留',
field: 'sid1',
sort: 'custom',
isSearch: false,
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: false,
},
{
label: 'C',
field: 'cfC',
sort: 'custom',
isSearch: false,
},
{
label: 'Si',
field: 'cfSi',
sort: 'custom',
isSearch: false,
},
{
label: 'Mn',
field: 'cfMn',
sort: 'custom',
isSearch: false,
},
{
label: 'P',
field: 'cfP',
sort: 'custom',
isSearch: false,
},
{
label: 'S',
field: 'cfS',
sort: 'custom',
isSearch: false,
},
{
label: 'Cr',
field: 'cfCr',
sort: 'custom',
isSearch: false,
},
{
label: 'Mo',
field: 'cfMo',
sort: 'custom',
isSearch: false,
},
{
label: 'Ni',
field: 'cfNi',
sort: 'custom',
isSearch: false,
},
{
label: 'V',
field: 'cfV',
sort: 'custom',
isSearch: false,
},
{
label: 'Al',
field: 'cfAl',
sort: 'custom',
isSearch: false,
},
{
label: 'Cu',
field: 'cfCu',
sort: 'custom',
isSearch: false,
},
{
label: 'Ti',
field: 'cfTi',
sort: 'custom',
isSearch: false,
},
{
label: 'W',
field: 'cfW',
sort: 'custom',
isSearch: false,
},
{
label: 'B',
field: 'cfB',
sort: 'custom',
isSearch: false,
},
{
label: 'Fe',
field: 'cfFe',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'Nb',
field: 'cfNb',
sort: 'custom',
isSearch: false,
},
{
label: '审核状态',
field: 'auditStatus',
sort: 'custom',
isSearch: true,
table: {
width: 120,
fixed: 'right'
},
dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number'
},
{
label: '数据采集时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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,
table: {
width: 200,
fixed: 'right'
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

211
src/views/lab/stretch/stretchthousand/index.vue

@ -0,0 +1,211 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Stretch1000.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Stretch1000.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 }">
<el-button type="text" @click="openQxView(row)">曲线视图</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="Stretch1000Rules"
:formAllSchemas="Stretch1000.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="Stretch1000Api.updateStretch1000"
:apiCreate="Stretch1000Api.createStretch1000"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<Qxview ref="qxviewRef" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Stretch1000,Stretch1000Rules } from './stretchthousand.data'
import * as Stretch1000Api from '@/api/lab/stretch/stretchthousand'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Stretch1000' })
const deviceTypeList = ref([])
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Stretch1000.allSchemas.tableColumns)
const qxviewRef = ref()
const openQxView = async (row) => {
const data = await Stretch1000Api.getStretchQxInfo(row.id)
if (data != null && data.deviceTypeList != null && data.dataList != null) {
qxviewRef.value.open(data.deviceTypeList , data.dataList)
}
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([])
const { tableObject, tableMethods } = useTable({
getListApi: Stretch1000Api.getStretch1000Page //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
}else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
// console.log('', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch1000')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await Stretch1000Api.deleteStretch1000(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 Stretch1000Api.exportStretch1000(setSearchParams)
download.excel(data, '实验室-拉伸1000.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-拉伸1000导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

257
src/views/lab/stretch/stretchthousand/stretchthousand.data.ts

@ -0,0 +1,257 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime'
// 表单校验
export const Stretch1000Rules = reactive({
})
export const Stretch1000 = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '曲线id',
field: 'qxId',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '批号',
field: 'batchNo',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '编号',
field: 'bhNo',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '实验日期',
field: 'testDate',
sort: 'custom',
formatter: dateFormatter2,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'x'
}
},
table: {
width: 200
}
},
{
label: '实验人',
field: 'testUser',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '形状',
field: 'deviceXz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '尺寸',
field: 'deviceCc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '面积',
field: 'deviceArea',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'lo',
field: 'deviceLo',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'fmc',
field: 'deviceFmc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'rmc',
field: 'deviceRmc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'fehc',
field: 'deviceFehc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'rehc',
field: 'deviceRehc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'felc',
field: 'deviceFelc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'relc',
field: 'deviceRelc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'fpc',
field: 'deviceFpc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'rpc',
field: 'deviceRpc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'ftc',
field: 'deviceFtc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'rtc',
field: 'deviceRtc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'ec',
field: 'deviceEc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'slope',
field: 'slope',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'test_flag',
field: 'testFlag',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
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,
table: {
width: 200
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 250,
fixed: 'right'
}
}
]))

238
src/views/lab/stretch/stretchthousandnew/index.vue

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="StretchThousandnew.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="StretchThousandnew.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 }">
<el-button type="text" @click="auditStatus(row)">确认</el-button>
<el-button type="text" @click="openQxView(row)">曲线视图</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="StretchThousandnewRules"
:formAllSchemas="StretchThousandnew.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="StretchThousandnewApi.updateStretchThousandnew"
:apiCreate="StretchThousandnewApi.createStretchThousandnew"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<Qxview ref="qxviewRef" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { StretchThousandnew,StretchThousandnewRules } from './stretchThousandnew.data'
import * as StretchThousandnewApi from '@/api/lab/stretch/stretchThousandnew'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'StretchThousandnew' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(StretchThousandnew.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const qxviewRef = ref()
const openQxView = async (row) => {
const data = await StretchThousandnewApi.getStretchQxInfo(row.id)
if (data != null && data.deviceTypeList != null && data.dataList != null) {
qxviewRef.value.open(data.deviceTypeList , data.dataList)
} else {
message.success('未获取到对应的数据')
}
}
//
const searchTableParams = ref([])
const { tableObject, tableMethods } = useTable({
getListApi: StretchThousandnewApi.getStretchThousandnewPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await StretchThousandnewApi.updateStretchThousandnew(data)
message.success('操作成功')
//
await getList()
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretchThousandnew')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await StretchThousandnewApi.deleteStretchThousandnew(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 StretchThousandnewApi.exportStretchThousandnew(setSearchParams)
download.excel(data, '实验室-拉伸1000.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-拉伸1000导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

515
src/views/lab/stretch/stretchthousandnew/stretchThousandnew.data.ts

@ -0,0 +1,515 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime'
// 表单校验
export const StretchThousandnewRules = reactive({
})
export const StretchThousandnew = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '曲线ID',
field: 'qxId',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '批次号',
field: 'batchNo',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '编号',
field: 'bhNo',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '送样单位',
field: 'sydw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '标准',
field: 'standard',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '材质',
field: 'cz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规格',
field: 'guig',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '实验人',
field: 'testUser',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
dictClass: 'number'
},
{
label: '实验日期',
field: 'testDate',
sort: 'custom',
formatter: dateFormatter2,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'x'
}
},
table: {
width: 150
}
},
{
label: '形状',
field: 'deviceXz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '尺寸',
field: 'deviceCc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '面积',
field: 'deviceArea',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '标距倍率',
field: 'deviceBjbl',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: 'Gauge',
field: 'deviceGauge',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'lu',
field: 'deviceLu',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'A',
field: 'deviceA',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '断面尺寸',
field: 'deviceDmcc',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: 'su',
field: 'deviceSu',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'z',
field: 'deviceZ',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'fm',
field: 'deviceFm',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'rm',
field: 'deviceRm',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'feh',
field: 'deviceFeh',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'reh',
field: 'deviceReh',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'fel',
field: 'deviceFel',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'rel',
field: 'deviceRel',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'fp',
field: 'deviceFp',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'rp',
field: 'deviceRp',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'ft',
field: 'deviceFt',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'rt',
field: 'deviceRt',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'e',
field: 'deviceE',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '屈强比',
field: 'deviceQqb',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '强屈比',
field: 'deviceQqbb',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'At',
field: 'deviceAt',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'agt',
field: 'deviceAgt',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'ag',
field: 'deviceAg',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'ae',
field: 'deviceAe',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '规定负荷',
field: 'deviceGdfh',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '规定负荷下伸长',
field: 'deviceGdfhXsc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规定负荷下伸长率',
field: 'deviceGdfhXscl',
sort: 'custom',
isSearch: false,
table: {
width: 180
}
},
{
label: '规定伸长',
field: 'deviceGdsc',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '规定伸长下负荷',
field: 'deviceGdscXfh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'slope',
field: 'slope',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '实验完成',
field: 'testFlag',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '断后伸长',
field: 'deviceDhsc',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '拐点伸长',
field: 'deviceGdssc',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '最大力伸长',
field: 'deviceZdlsc',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'rp下标',
field: 'deviceRpXb',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: 'rt下标',
field: 'deviceRtXb',
sort: 'custom',
isSearch: false,
table: {
width: 100
}
},
{
label: '屈服结束X',
field: 'deviceQfjsx',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '审核状态',
field: 'auditStatus',
sort: 'custom',
isSearch: true,
table: {
width: 120,
fixed: 'right'
},
dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number'
},
{
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,
table: {
width: 200,
fixed: 'right'
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 250,
fixed: 'right'
}
}
]))

221
src/views/lab/stretch/stretchthousandqx/index.vue

@ -0,0 +1,221 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Stretch1000Qx.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Stretch1000Qx.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="getList"
:rules="Stretch1000QxRules"
:formAllSchemas="Stretch1000Qx.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="Stretch1000QxApi.updateStretch1000Qx"
:apiCreate="Stretch1000QxApi.createStretch1000Qx"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Stretch1000Qx,Stretch1000QxRules } from './stretch1000Qx.data'
import * as Stretch1000QxApi from '@/api/lab/stretch/stretchthousandqx'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Stretch1000Qx' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Stretch1000Qx.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: Stretch1000QxApi.getStretch1000QxPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch1000Qx')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await Stretch1000QxApi.deleteStretch1000Qx(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 Stretch1000QxApi.exportStretch1000Qx(setSearchParams)
download.excel(data, '实验室-拉伸1000--曲线数据.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-拉伸1000--曲线数据导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await Stretch1000QxApi.importTemplate()
})
</script>

92
src/views/lab/stretch/stretchthousandqx/stretch1000Qx.data.ts

@ -0,0 +1,92 @@
import { isObject } from './../../../../utils/is';
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as Stretch1000QxApi from '@/api/lab/stretch/stretchthousandqx'
const typeList = await Stretch1000QxApi.getQxTypeList()
// 表单校验
export const Stretch1000QxRules = reactive({
})
export const Stretch1000Qx = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '曲线id',
field: 'qxId',
sort: 'custom',
isSearch: true,
},
{
label: '曲线类型',
field: 'dedviceType',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: String) => {
return typeList.find((obj) => obj.value === cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => typeList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'value'
}
}
},
form: {
component: 'Select',
api: () => typeList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'value'
}
}
}
},
{
label: '横轴值',
field: 'deviceX',
sort: 'custom',
isSearch: false,
},
{
label: 'y轴值',
field: 'deviceY',
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'
}
}
]))

246
src/views/lab/stretch/stretchthreehundred/index.vue

@ -0,0 +1,246 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Stretch300.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Stretch300.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 }">
<el-button type="text" @click="auditStatus(row)">确认</el-button>
<el-button type="text" @click="openQxView(row)">曲线视图</el-button>
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="Stretch300Rules"
:formAllSchemas="Stretch300.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="Stretch300Api.updateStretch300"
:apiCreate="Stretch300Api.createStretch300"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<QxviewThree ref="qxviewThreeRef" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Stretch300,Stretch300Rules } from './stretchthreehundred.data'
import * as Stretch300Api from '@/api/lab/stretch/stretchthreehundred'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Stretch300' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Stretch300.allSchemas.tableColumns)
const qxviewThreeRef = ref()
const openQxView = async (row) => {
const data = await Stretch300Api.getStretchThreeQxInfo(row.syzbh)
if (data != null && data.dataList != null) {
qxviewThreeRef.value.open(data.dataList , '实验力-位移')
}
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: Stretch300Api.getStretch300Page //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await Stretch300Api.updateStretch300(data)
message.success('操作成功')
//
await getList()
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch300')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await Stretch300Api.deleteStretch300(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 Stretch300Api.exportStretch300(setSearchParams)
download.excel(data, '实验室-拉伸300.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-拉伸300导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await Stretch300Api.importTemplate()
})
</script>

734
src/views/lab/stretch/stretchthreehundred/stretchthreehundred.data.ts

@ -0,0 +1,734 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter , dateFormatter2} from '@/utils/formatTime'
// 表单校验
export const Stretch300Rules = reactive({
})
export const Stretch300 = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '试样序号',
field: 'syid',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '试样编号',
field: 'syzbh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '送样单位',
field: 'sydw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '标准',
field: 'standard',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '材质',
field: 'cz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规格',
field: 'guig',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '实验人',
field: 'testUser',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
dictClass: 'number'
},
{
label: '试验日期',
field: 'testDate',
sort: 'custom',
formatter: dateFormatter2,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'x'
}
},
table: {
width: 150
}
},
{
label: '是否完成标识',
field: 'flag',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '最大力',
field: 'jfb',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '最大强度',
field: 'jb',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '上屈服强度',
field: 'jsu',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '下屈服强度',
field: 'js',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断裂强度',
field: 'jt',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '弹性模量',
field: 'je',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '非比例应力',
field: 'jp',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断裂伸长率',
field: 'jdl',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断面收缩率',
field: 'jdm',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '上屈服力',
field: 'jsuf',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '下屈服力',
field: 'jsf',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '非比例伸长力',
field: 'jpf',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '最大力非比例伸长率(%)',
field: 'jag',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '最大力总伸长率(%)',
field: 'jagt',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '规定总延伸强度(%)',
field: 'jrt',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '屈服点延伸率(%)',
field: 'jae',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '吸收功(N.m)',
field: 'sorbWork',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'R值',
field: 'jr',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'N值',
field: 'jn',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '泊松比',
field: 'jbsb',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '规定总延伸力(N)',
field: 'jrf',
sort: 'custom',
isSearch: false,
table: {
width: 180
}
},
{
label: '弹性之起点值',
field: 'jdlStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '弹性之未点值',
field: 'jdlEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 180
}
},
{
label: '泊松比的起点变形值',
field: 'jbsbStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '泊松比的末点变形值',
field: 'jbsbEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '规定应变值',
field: 'jrSpecon',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'N值的起点应变',
field: 'jnStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'N值的末点应变',
field: 'jnEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: 'N值的规定点数',
field: 'jnSpecon',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '最大力之索引点',
field: 'jfbInx',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '上屈服力之索引点',
field: 'jsufInx',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '下屈服力之索引点',
field: 'jsfInx',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例伸长力之索引点',
field: 'jpfInx',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '弹性模量之起点值',
field: 'jeStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '弹性模量之未点值',
field: 'jeEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '弹性模量之算法',
field: 'jeSpemath',
sort: 'custom',
isSearch: false,
table: {
width: 180
}
},
{
label: '非比例应力之起点值',
field: 'jpStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例应力之未点值',
field: 'jpEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例应力之n%之值',
field: 'jpSpecon',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例应力之算法',
field: 'jpSpemath',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例伸长力之起点值',
field: 'jpfStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例伸长力之未点值',
field: 'jpfEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例伸长力之n%之值',
field: 'jpfSpecon',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '非比例伸长力之算法',
field: 'jpfSpemath',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '最大力非比例伸长率(%)',
field: 'jagStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '最大力非比例伸长率(%)',
field: 'jagEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '最大力非比例伸长率(%)之算法',
field: 'jagSpemath',
sort: 'custom',
isSearch: false,
table: {
width: 250
}
},
{
label: '规定总延伸强度(%)',
field: 'jrtSpecon',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '规定总延伸力(N)',
field: 'jrfSpecon',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '屈服点延伸率(%)',
field: 'jaeStartvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '屈服点延伸率(%)',
field: 'jaeEndvalue',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '屈服点延伸率(%)之算法',
field: 'jaeSpemath',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '是否使用引伸计',
field: 'isExtension',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '断后标距',
field: 'lot',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断后直径',
field: 'dt',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断后宽度',
field: 'bt',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断后厚度',
field: 'at1',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '引伸计类型',
field: 'extensionType',
sort: 'custom',
isSearch: false,
// form: {
// component: 'SelectV2'
// },
table: {
width: 150
}
},
{
label: '引伸计的名称',
field: 'extensionName',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '试样是否有效的标志',
field: 'vld',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '横梁速度',
field: 'hlSd',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '断裂百分比之值',
field: 'dlbfbV',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '是否闭环控制',
field: 'isBhkz',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '用户代号(采集的数据)',
field: 'userId',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '审核状态',
field: 'auditStatus',
sort: 'custom',
isSearch: true,
table: {
width: 120,
fixed: 'right'
},
dictType: DICT_TYPE.LAB_AUDIT_STATUS,
dictClass: 'number'
},
{
label: '采集时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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,
table: {
width: 200,
fixed: 'right'
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 250,
fixed: 'right'
}
}
]))

220
src/views/lab/stretch/stretchthreehundredqx/index.vue

@ -0,0 +1,220 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Stretch300Qx.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Stretch300Qx.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="getList"
:rules="Stretch300QxRules"
:formAllSchemas="Stretch300Qx.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="Stretch300QxApi.updateStretch300Qx"
:apiCreate="Stretch300QxApi.createStretch300Qx"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Stretch300Qx,Stretch300QxRules } from './stretch300Qx.data'
import * as Stretch300QxApi from '@/api/lab/stretch/stretchthreehundredqx'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'Stretch300Qx' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Stretch300Qx.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: Stretch300QxApi.getStretch300QxPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultFreshBtn(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(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch300Qx')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await Stretch300QxApi.deleteStretch300Qx(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 Stretch300QxApi.exportStretch300Qx(setSearchParams)
download.excel(data, '实验室-拉伸300-曲线图数据.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-拉伸300-曲线图数据导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await Stretch300QxApi.importTemplate()
})
</script>

106
src/views/lab/stretch/stretchthreehundredqx/stretch300Qx.data.ts

@ -0,0 +1,106 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const Stretch300QxRules = reactive({
})
export const Stretch300Qx = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '试样编号',
field: 'syzbh',
sort: 'custom',
isSearch: true,
},
{
label: '实验力(N)',
field: 'syl',
sort: 'custom',
isSearch: false,
},
{
label: '轴向变形(mm)',
field: 'zxbx',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '横向变形(mm)',
field: 'hxbx',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '位移(mm)',
field: 'wy',
sort: 'custom',
isSearch: false,
},
{
label: '横梁速度(mm/min)',
field: 'hlsd',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '时间(s)',
field: 'sj',
sort: 'custom',
isSearch: false,
},
{
label: '真应力',
field: 'zyl',
sort: 'custom',
isSearch: false,
},
{
label: '真应变',
field: 'zyb',
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,
table: {
width: 200
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
Loading…
Cancel
Save