微调
This commit is contained in:
@@ -67,7 +67,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '设备名称',
|
label: '名称',
|
||||||
search: { el: 'input' },
|
search: { el: 'input' },
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
|||||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '误差体系名称',
|
label: '名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'standardName',
|
prop: 'standardName',
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ function useMetaInfo() {
|
|||||||
const formContent = reactive<TestSource.ParameterType>({
|
const formContent = reactive<TestSource.ParameterType>({
|
||||||
id: "",
|
id: "",
|
||||||
sourceParamType: "",
|
sourceParamType: "",
|
||||||
sourceParamDesc: "",
|
|
||||||
sourceParamValue: "",
|
sourceParamValue: "",
|
||||||
|
sourceParamDesc: "",
|
||||||
sort: 100,
|
sort: 100,
|
||||||
pId: "0",
|
pId: "0",
|
||||||
})
|
})
|
||||||
@@ -115,8 +115,8 @@ const resetFormContent = () => {
|
|||||||
Object.assign(formContent, {
|
Object.assign(formContent, {
|
||||||
id: "",
|
id: "",
|
||||||
sourceParamType: "",
|
sourceParamType: "",
|
||||||
sourceParamDesc: "",
|
|
||||||
sourceParamValue: "",
|
sourceParamValue: "",
|
||||||
|
sourceParamDesc: "",
|
||||||
sort: 100,
|
sort: 100,
|
||||||
pId: "0",
|
pId: "0",
|
||||||
})
|
})
|
||||||
@@ -140,7 +140,6 @@ const save = () => {
|
|||||||
let newUpdateParameter = toRaw({...formContent})
|
let newUpdateParameter = toRaw({...formContent})
|
||||||
delete newUpdateParameter.children
|
delete newUpdateParameter.children
|
||||||
emit('get-parameter', newUpdateParameter)
|
emit('get-parameter', newUpdateParameter)
|
||||||
ElMessage.success({message: `${dialogTitle.value}成功!`})
|
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import ParameterPopup from '@/views/machine/testSource/components/parameterPopup
|
|||||||
import {reactive, ref, watch} from 'vue'
|
import {reactive, ref, watch} from 'vue'
|
||||||
import {generateUUID} from "@/styles";
|
import {generateUUID} from "@/styles";
|
||||||
import {defineEmits} from "vue/dist/vue";
|
import {defineEmits} from "vue/dist/vue";
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
const parameterPopup = ref()
|
const parameterPopup = ref()
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
@@ -178,14 +179,20 @@ const copyRow = (row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getParameter = (data: TestSource.ParameterType) => {
|
const getParameter = (data: TestSource.ParameterType) => {
|
||||||
|
if (originalParameterArr.some(item => item.sourceParamType == data.sourceParamType)) {
|
||||||
|
ElMessage.error({message: '参数类型已存在!'})
|
||||||
|
return;
|
||||||
|
}
|
||||||
let index = originalParameterArr.findIndex(item => item.id === data.id)
|
let index = originalParameterArr.findIndex(item => item.id === data.id)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
data.id = generateUUID()
|
data.id = generateUUID()
|
||||||
// 新增
|
// 新增
|
||||||
originalParameterArr.push(data)
|
originalParameterArr.push(data)
|
||||||
|
ElMessage.success({message: '新增成功!'})
|
||||||
} else {
|
} else {
|
||||||
// 编辑
|
// 编辑
|
||||||
originalParameterArr[index] = data
|
originalParameterArr[index] = data
|
||||||
|
ElMessage.success({message: '编辑成功!'})
|
||||||
}
|
}
|
||||||
emit('change-parameter', originalParameterArr)
|
emit('change-parameter', originalParameterArr)
|
||||||
tableData.value = getTreeData(originalParameterArr)
|
tableData.value = getTreeData(originalParameterArr)
|
||||||
@@ -193,7 +200,6 @@ const getParameter = (data: TestSource.ParameterType) => {
|
|||||||
|
|
||||||
//清空数据
|
//清空数据
|
||||||
const clearData = () => {
|
const clearData = () => {
|
||||||
console.log('clearData')
|
|
||||||
originalParameterArr = []
|
originalParameterArr = []
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user