Browse Source

穿孔机格式化数据值为时分秒

master
songguoqiang 1 year ago
parent
commit
d4b322a452
  1. 7
      src/views/pszc/hrpuncherdata108/operationtimedata108/hrPuncherdata108.data.ts
  2. 13
      src/views/pszc/hrpuncherdata108/operationtimedata108/index.vue

7
src/views/pszc/hrpuncherdata108/operationtimedata108/hrPuncherdata108.data.ts

@ -46,6 +46,13 @@ export const HrPuncherdata108 = useCrudSchemas(reactive<CrudSchema[]>([
field: 'ivalue', field: 'ivalue',
sort: 'custom', sort: 'custom',
isSearch: false, 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: '仪表的编号', label: '仪表的编号',

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

@ -29,10 +29,14 @@
> >
<template #iname="{row}"> <template #iname="{row}">
<el-button :type="row.icode == 'Up_Roller_runtime' ? 'warning' : 'success'" link> <el-button :type="row.icode == 'Up_Roller_runtime' ? 'warning' : 'success'" link>
<span>{{ row.iname }}</span> <span>{{ row.iname}}</span>
</el-button> </el-button>
</template> </template>
<template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template>
<template #code="{row}"> <template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
@ -64,6 +68,9 @@ import download from '@/utils/download'
import { HrPuncherdata108,HrPuncherdata108Rules } from './hrPuncherdata108.data' import { HrPuncherdata108,HrPuncherdata108Rules } from './hrPuncherdata108.data'
import * as HrPuncherdata108Api from '@/api/pszc/hrpuncherdata108' import * as HrPuncherdata108Api from '@/api/pszc/hrpuncherdata108'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'OperationTimeData108' }) defineOptions({ name: 'OperationTimeData108' })
@ -218,6 +225,10 @@ const searchFormClick = (searchData) => {
setSearchParams(param); // setSearchParams(param); //
} }
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList(); getList();

Loading…
Cancel
Save