Browse Source

热轧90穿孔机

master
songguoqiang 1 year ago
parent
commit
f0c60db9a0
  1. 23
      src/api/pszc/hrpuncherdata90/index.ts
  2. 4
      src/utils/dict.ts
  3. 2
      src/views/pszc/hrpuncherdata108/operationtimedata108/index.vue
  4. 135
      src/views/pszc/hrpuncherdata90/operationtimedata90/hrPuncherdata90.data.ts
  5. 238
      src/views/pszc/hrpuncherdata90/operationtimedata90/index.vue
  6. 135
      src/views/pszc/hrpuncherdata90/rollcountdata90/hrPuncherdata90.data.ts
  7. 238
      src/views/pszc/hrpuncherdata90/rollcountdata90/index.vue
  8. 140
      src/views/pszc/hrpuncherdata90/rolltimedata90/hrPuncherdata90.data.ts
  9. 238
      src/views/pszc/hrpuncherdata90/rolltimedata90/index.vue

23
src/api/pszc/hrpuncherdata90/index.ts

@ -9,7 +9,7 @@ export interface HrPuncherdata90VO {
mname: string
}
// 查询热轧90-穿孔机列表
// 查询热轧90-穿孔机列表钢针支数
export const getHrPuncherdata90Page = async (params) => {
if (params.isSearch) {
delete params.isSearch
@ -19,6 +19,27 @@ export const getHrPuncherdata90Page = async (params) => {
return await request.get({ url: `/pszc/hrpuncherdata90/page`, params })
}
}
// 查询热轧90-穿孔机列表运行时间
export const getHrPuncherdata90Page1 = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/pszc/hrpuncherdata90/senior', data })
} else {
return await request.get({ url: `/pszc/hrpuncherdata90/page1`, params })
}
}
// 查询热轧90-穿孔机列表轧制时间
export const getHrPuncherdata90Page2 = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/pszc/hrpuncherdata90/senior', data })
} else {
return await request.get({ url: `/pszc/hrpuncherdata90/page2`, params })
}
}
// 查询热轧90-穿孔机详情
export const getHrPuncherdata90 = async (id: number) => {

4
src/utils/dict.ts

@ -101,10 +101,10 @@ export enum DICT_TYPE {
//===============智能水表统计模块===================
Water_Module = 'Water_Module',
// ========== 热轧108穿孔机 模块 ==========
// ========== 热轧108 模块 ==========
pszc_hr_puncherdata108 ='pszc_hr_puncherdata108',//热轧108运行时间类型
pszc_hr_puncherdata108_roll ='pszc_hr_puncherdata108_roll',//热轧108轧制时间类型
pszc_hr_puncherdata108_operation ='pszc_hr_puncherdata108_operation',//热轧108穿孔机运行时间下拉组合类型数据由数据库四种类型分为两种类型,数据用逗号分隔
pszc_hr_puncherdata108_operation ='pszc_hr_puncherdata108_operation',//热轧108运行时间下拉组合类型数据由数据库四种类型分为两种类型,数据用逗号分隔
// ========== SYSTEM 模块 ==========

2
src/views/pszc/hrpuncherdata108/operationtimedata108/index.vue

@ -28,7 +28,7 @@
v-model:sort="tableObject.sort"
>
<template #iname="{row}">
<el-button :type="row.icode == 'Up_Roller_runtime' ? 'warning' : 'success'" link>
<el-button :type="row.icode == 'Down_Roller_runtime' || row.icode == 'Up_Roller_runtime' ? 'success' : 'warning'" link>
<span>{{ row.iname}}</span>
</el-button>
</template>

135
src/views/pszc/hrpuncherdata90/operationtimedata90/hrPuncherdata90.data.ts

@ -0,0 +1,135 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as PszcCommonApi from '@/api/pszc/pszccommon'
import * as DictApi from '@/utils/dict'
// 数据点
//const sjdList = await PszcCommonApi.selectHr108Pros({flag: '3' , type: '1',module:'2'})
const sjdList = DictApi.getStrDictOptions(DICT_TYPE.pszc_hr_puncherdata108_operation);
// 仪器仪表
const yqbList = await PszcCommonApi.selectHr90Pros({flag: '2' , type: '2'})
// 表单校验
export const HrPuncherdata90Rules = reactive({
})
export const HrPuncherdata90 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: false,
},
{
label: '数据点名称',
field: 'iname',
isTable: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return sjdList1.find((obj) => obj.value === cellValue)?.label
// },
// dictType: DICT_TYPE.pszc_hr_puncherdata108,
search: {
show: true,
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
},
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
// formatter: (row,column, cellValue) => {
// const hourTime = parseInt(time.slice(0,2));
// const minuteTime = parseInt(time.slice(3,5));
// const secondTime = parseInt(time.slice(6,8));
// return hourTime*3600+minuteTime*60+secondTime;
// },
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mcode',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return yqbList.find((obj) => obj.code === cellValue)?.label
},
search: {
show: true,
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
},
form: {
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '开始时间',
field: 'updateTime',
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: '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'
// }
// }
]))

238
src/views/pszc/hrpuncherdata90/operationtimedata90/index.vue

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPuncherdata90.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPuncherdata90.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 #iname="{row}">
<el-button :type="row.icode == 'Up_Roller_runtime' ? 'warning' : 'success'" link>
<span>{{ row.iname}}</span>
</el-button>
</template>
<template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template>
<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="HrPuncherdata90Rules"
:formAllSchemas="HrPuncherdata90.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HrPuncherdata90Api.updateHrPuncherdata90"
:apiCreate="HrPuncherdata90Api.createHrPuncherdata90"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPuncherdata90,HrPuncherdata90Rules } from './hrPuncherdata90.data'
import * as HrPuncherdata90Api from '@/api/pszc/hrPuncherdata90'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'OperationTimeData90' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPuncherdata90.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: HrPuncherdata90Api.getHrPuncherdata90Page1 //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:hrPuncherdata108:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:hrPuncherdata108:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(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({hasPermi:'wms:hrPuncherdata108:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:hrPuncherdata108:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
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, 'basicHrPuncherdata108')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrPuncherdata90Api.deleteHrPuncherdata90(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 HrPuncherdata90Api.exportHrPuncherdata90(setSearchParams)
download.excel(data, '热轧108-穿孔机.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '热轧108-穿孔机导入模版.xls'
})
//
const importSuccess = () => {
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param);
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();
// importTemplateData.templateUrl = await HrPuncherdata108Api.importTemplate()
})
</script>

135
src/views/pszc/hrpuncherdata90/rollcountdata90/hrPuncherdata90.data.ts

@ -0,0 +1,135 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as PszcCommonApi from '@/api/pszc/pszccommon'
// 数据点
//const sjdList = await PszcCommonApi.selectHr90Pros({flag: '2' , type: '1'})
// 仪器仪表
const yqbList = await PszcCommonApi.selectHr90Pros({flag: '2' , type: '2'})
// 表单校验
export const HrPuncherdata90Rules = reactive({
})
export const HrPuncherdata90 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: false,
},
{
label: '数据点名称',
field: 'iname',
isTable: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return sjdList.find((obj) => obj.code === cellValue)?.label
// },
// search: {
// show: true,
// component: 'Select',
// api: () => sjdList,
// componentProps: {
// optionsAlias: {
// labelField: 'label',
// valueField: 'code'
// }
// }
// },
// form: {
// component: 'Select',
// api: () => sjdList,
// componentProps: {
// optionsAlias: {
// labelField: 'label',
// valueField: 'code'
// }
// }
// }
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mcode',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return yqbList.find((obj) => obj.code === cellValue)?.label
},
search: {
show: true,
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
},
form: {
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '开始时间',
field: 'updateTime',
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: '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'
// }
// }
]))

238
src/views/pszc/hrpuncherdata90/rollcountdata90/index.vue

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPuncherdata90.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPuncherdata90.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 #iname="{row}">
<el-button :type="row.icode == 'Up_Roller_runtime' ? 'warning' : 'success'" link>
<span>{{ row.iname}}</span>
</el-button>
</template> -->
<!-- <template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template> -->
<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="HrPuncherdata90Rules"
:formAllSchemas="HrPuncherdata90.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HrPuncherdata90Api.updateHrPuncherdata90"
:apiCreate="HrPuncherdata90Api.createHrPuncherdata90"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPuncherdata90,HrPuncherdata90Rules } from './hrPuncherdata90.data'
import * as HrPuncherdata90Api from '@/api/pszc/hrPuncherdata90'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'RollCountdata90' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPuncherdata90.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: HrPuncherdata90Api.getHrPuncherdata90Page //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:hrPuncherdata108:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:hrPuncherdata108:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(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({hasPermi:'wms:hrPuncherdata108:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:hrPuncherdata108:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
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, 'basicHrPuncherdata108')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrPuncherdata90Api.deleteHrPuncherdata90(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 HrPuncherdata90Api.exportHrPuncherdata90(setSearchParams)
download.excel(data, '热轧108-穿孔机.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '热轧108-穿孔机导入模版.xls'
})
//
const importSuccess = () => {
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param);
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();
// importTemplateData.templateUrl = await HrPuncherdata108Api.importTemplate()
})
</script>

140
src/views/pszc/hrpuncherdata90/rolltimedata90/hrPuncherdata90.data.ts

@ -0,0 +1,140 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as PszcCommonApi from '@/api/pszc/pszccommon'
import * as DictApi from '@/utils/dict'
import { number } from 'echarts'
// 数据点
// const sjdList = await PszcCommonApi.selectHr108Pros({flag: '3' , type: '1',module:'2'})
const sjdList = DictApi.getStrDictOptions(DICT_TYPE.pszc_hr_puncherdata108_roll);
// 仪器仪表
const yqbList = await PszcCommonApi.selectHr90Pros({flag: '2' , type: '2'})
// 表单校验
export const HrPuncherdata90Rules = reactive({
})
export const HrPuncherdata90 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '数据点编号',
field: 'icode',
sort: 'custom',
isSearch: false,
},
{
label: '数据点名称',
field: 'iname',
isTable: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return sjdList.find((obj) => obj.value === cellValue)?.label
// },
search: {
show: true,
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
},
form: {
component: 'Select',
api: () => sjdList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '采集值',
field: 'ivalue',
sort: 'custom',
isSearch: false,
formatter: (row,column,cellValue) => {
return cellValue+"秒"
},
},
{
label: '仪表的编号',
field: 'mcode',
sort: 'custom',
isSearch: false,
},
{
label: '仪表的名称',
field: 'mcode',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return yqbList.find((obj) => obj.code === cellValue)?.label
},
search: {
show: true,
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
},
form: {
component: 'Select',
api: () => yqbList,
componentProps: {
optionsAlias: {
labelField: 'label',
valueField: 'code'
}
}
}
},
{
label: '开始时间',
field: 'updateTime',
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: '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'
// }
// }
]))

238
src/views/pszc/hrpuncherdata90/rolltimedata90/index.vue

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="HrPuncherdata90.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="HrPuncherdata90.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 #iname="{row}">
<el-button :type="row.icode == 'Up_Roller_runtime' ? 'warning' : 'success'" link>
<span>{{ row.iname}}</span>
</el-button>
</template> -->
<template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template>
<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="HrPuncherdata90Rules"
:formAllSchemas="HrPuncherdata90.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="HrPuncherdata90Api.updateHrPuncherdata90"
:apiCreate="HrPuncherdata90Api.createHrPuncherdata90"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { HrPuncherdata90,HrPuncherdata90Rules } from './hrPuncherdata90.data'
import * as HrPuncherdata90Api from '@/api/pszc/hrPuncherdata90'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'RollTimeData90' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(HrPuncherdata90.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: HrPuncherdata90Api.getHrPuncherdata90Page2 //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:hrPuncherdata108:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:hrPuncherdata108:export'}), //
// defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(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({hasPermi:'wms:hrPuncherdata108:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:hrPuncherdata108:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
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, 'basicHrPuncherdata108')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await HrPuncherdata90Api.deleteHrPuncherdata90(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 HrPuncherdata90Api.exportHrPuncherdata90(setSearchParams)
download.excel(data, '热轧108-穿孔机.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '热轧108-穿孔机导入模版.xls'
})
//
const importSuccess = () => {
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param);
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
let param = {
icode: 'Up_Roller_Start,Up_Roller_runtime,Down_Roller_Start,Down_Roller_runtime'
}
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();
// importTemplateData.templateUrl = await HrPuncherdata108Api.importTemplate()
})
</script>
Loading…
Cancel
Save