微调
This commit is contained in:
@@ -349,21 +349,13 @@ import { el } from 'element-plus/es/locale'
|
||||
{
|
||||
formContent.value.arrivedDate = dayjs(formContent.value.arrivedDate).format('YYYY-MM-DD');
|
||||
}
|
||||
//console.log('1111'+formContent.value.arrivedDate)
|
||||
if (formContent.value.id) {
|
||||
const result = await updatePqDev(formContent.value);
|
||||
if(result.code != 'A0000'){
|
||||
ElMessage.error({ message: result.message})
|
||||
}else{
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
}
|
||||
await updatePqDev(formContent.value);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
} else {
|
||||
const result = await addPqDev(formContent.value);
|
||||
if(result.code != 'A0000'){
|
||||
ElMessage.error({ message: result.message})
|
||||
}else{
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
}
|
||||
await addPqDev(formContent.value);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
|
||||
}
|
||||
close()
|
||||
// 刷新表格
|
||||
|
||||
@@ -64,7 +64,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
search: { el: 'input',order:2,offset:0.1},
|
||||
search: { el: 'input'},
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
@@ -74,36 +74,12 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
fieldNames: { label: 'name', value: 'code' },
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'devChns',
|
||||
label: '设备通道数',
|
||||
minWidth: 110,
|
||||
},
|
||||
{
|
||||
prop: 'devVolt',
|
||||
label: '额定电压(V)',
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
prop: 'devCurr',
|
||||
label: '额定电流(A)',
|
||||
minWidth: 130,
|
||||
|
||||
},
|
||||
{
|
||||
prop: 'manufacturer',
|
||||
label: '生产厂商',
|
||||
enum: dictStore.getDictData('Dev_Manufacturers'),
|
||||
search: { el: 'select', props: { filterable: true }},
|
||||
fieldNames: { label: 'name', value: 'code' },
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'createDate',
|
||||
label: '生产日期',
|
||||
minWidth: 200,
|
||||
search: {
|
||||
order:1,
|
||||
span:2,
|
||||
render: () => {
|
||||
return (
|
||||
<div class='flx-flex-start'>
|
||||
@@ -117,6 +93,38 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'devChns',
|
||||
label: '设备通道数',
|
||||
minWidth: 110,
|
||||
render: scope => {
|
||||
return String(scope.row.devChns) // 将数字转换为字符串
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'devVolt',
|
||||
label: '额定电压(V)',
|
||||
minWidth: 130,
|
||||
render: scope => {
|
||||
return String(scope.row.devVolt) // 将数字转换为字符串
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'devCurr',
|
||||
label: '额定电流(A)',
|
||||
minWidth: 130,
|
||||
render: scope => {
|
||||
return String(scope.row.devCurr) // 将数字转换为字符串
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'manufacturer',
|
||||
label: '生产厂商',
|
||||
enum: dictStore.getDictData('Dev_Manufacturers'),
|
||||
search: { el: 'select', props: { filterable: true },order:1},
|
||||
fieldNames: { label: 'name', value: 'code' },
|
||||
minWidth: 200,
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
|
||||
])
|
||||
|
||||
@@ -127,13 +135,10 @@ const endDate = ref('')
|
||||
const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
||||
startDate.value = startDateTemp
|
||||
endDate.value = endDateTemp
|
||||
//console.log(startDateTemp)
|
||||
//console.log(endDateTemp)
|
||||
}
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
devicePopup.value?.open(titleType, row)
|
||||
console.log(columns)
|
||||
}
|
||||
|
||||
// 批量删除设备
|
||||
@@ -150,9 +155,16 @@ const handleDelete = async (params: Device.ResPqDev) => {
|
||||
}
|
||||
|
||||
// 导出设备
|
||||
const downloadFile = async () => {
|
||||
const downloadFile = async (params: Device.ReqPqDevParams) => {
|
||||
// 获取当前的搜索参数
|
||||
const searchParam = proTable.value?.searchParam || {};
|
||||
|
||||
// 将开始时间和结束时间添加到搜索参数中
|
||||
searchParam.searchBeginTime = startDate.value;
|
||||
searchParam.searchEndTime = endDate.value;
|
||||
|
||||
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>
|
||||
useDownload(exportPqDev, '被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
|
||||
useDownload(exportPqDev,'被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ const typeList = [
|
||||
{
|
||||
// 将表单数据转为json,发送到后端
|
||||
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
|
||||
console.log(confirmFormData)
|
||||
// console.log(confirmFormData)
|
||||
emit('submit', props.formData); // 提交表单数据
|
||||
emit('update:visible', false); // 提交后关闭对话框
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 250,},
|
||||
])
|
||||
|
||||
// 打开编辑对话框
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='View' >查看</el-button>
|
||||
<el-button type='primary' link :icon='EditPen' >编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' >删除</el-button>
|
||||
<el-button type='primary' :model-value="false" link :icon='Upload' >升级为模板</el-button>
|
||||
@@ -114,7 +113,7 @@ const columns = reactive<ColumnProps<TestScript.TestScriptBO>[]>([
|
||||
search: { el: 'select' },
|
||||
minWidth: 150,
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
|
||||
])
|
||||
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
search: { el: 'select' },
|
||||
minWidth: 150,
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
|
||||
])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user