Commit cbc10206 by yancanhua

fix: 自测问题优化

1 parent fea3fb4d
......@@ -18,6 +18,7 @@ onMounted(() => {
// 初始化数据
function initData() {
pickerValue.value = [];
if (props?.item?.inspectionResultVO) {
const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || [];
if (inspectionValueList && inspectionValueList.length > 0 && inspectionValueList[0].valueKey) {
......@@ -26,9 +27,10 @@ function initData() {
pickerValue.value.push(inspectionValueList[i].valueKey);
}
}
setupdate();
}
}
setupdate();
}
// 计算属性
......
......@@ -27,15 +27,14 @@ onMounted(() => {
// 初始化数据
function initData() {
pickerValue.value = [];
if (props?.item?.inspectionResultVO) {
const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || [];
for (const i of inspectionValueList) {
if (i.valueText) { pickerValue.value.push(i.valueText) }
}
if (pickerValue.value.length > 0) {
updateData();
}
}
updateData();
}
// 计算属性
......
......@@ -18,6 +18,7 @@ onMounted(() => {
// 初始化数据
function initData() {
pickerValue.value = '';
if (props?.item?.inspectionResultVO) {
const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || [];
if (inspectionValueList && inspectionValueList.length > 0) {
......@@ -38,7 +39,6 @@ const columnsList = computed(() => {
return optionsList;
});
function handleBut() {
const ObjectItem = columnsList.value.find(item => item.value == pickerValue.value);
props.item.valueText = ObjectItem.text || '';
......
......@@ -32,7 +32,11 @@ function handleShowPicker() {
showPicker.value = true;
if (!props.item.value) {
const date = new Date();
pickerValue.value = [date.getFullYear(), date.getMonth() + 1, date.getDate()];
if (columnsType.value.length === 2) {
pickerValue.value = [date.getFullYear(), date.getMonth() + 1];
} else {
pickerValue.value = [date.getFullYear(), date.getMonth() + 1, date.getDate()];
}
}
}
......
......@@ -20,13 +20,14 @@ onMounted(() => {
// 初始化数据
function initData() {
pickerValue.value = [];
if (props?.item?.inspectionResultVO) {
const inspectionValueList = props?.item?.inspectionResultVO?.inspectionValueList || [];
if (inspectionValueList && inspectionValueList.length > 0 && inspectionValueList[0].valueKey) {
pickerValue.value = [inspectionValueList[0].valueKey];
}
onConfirm();
}
onConfirm();
}
// 计算属性
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!