Commit 9b0a1b0f by wangzhihui

Merge branch 'release/venus-usedcar-h5/1.0.0' of http://192.168.3.233:8090/monor…

…epo/venus into release/venus-usedcar-h5/1.0.0
2 parents 1755b25c c85bf007
Pipeline #93 for 9b0a1b0f failed in 0 seconds
Showing 36 changed files with 815 additions and 556 deletions
{ {
"tailwindCSS.experimental.configFile": "internal/tailwind-config/src/index.ts", "tailwindCSS.experimental.configFile": "internal/tailwind-config/src/index.ts",
"eslint.nodePath": "./node_modules", "eslint.nodePath": "./node_modules",
// 告诉 ESLint:这是一个 monorepo // 单份 flat config 在仓库根目录;若用 mode:auto,子包目录下没有 eslint.config.* 会报 Could not find config file
"eslint.workingDirectories": [{ "mode": "auto" }], "eslint.workingDirectories": [{ "directory": ".", "changeProcessCWD": true }],
// 使用 flat config(ESLint v9+ 必需) // 使用 flat config(ESLint v9+ 必需)
"eslint.useFlatConfig": true, "eslint.useFlatConfig": true,
"eslint.useESLintClass": true, "eslint.useESLintClass": true,
......
...@@ -365,6 +365,21 @@ export function saveInspectionRecord(params: InspectionRecordSaveParams) { ...@@ -365,6 +365,21 @@ export function saveInspectionRecord(params: InspectionRecordSaveParams) {
// ===== 完成检测(检测评分提交)===== // ===== 完成检测(检测评分提交)=====
/**
* POST `/rest/inspectionRecord/completeInspection` 请求体
* @example
* {
* "taskId": 0,
* "exteriorScore": 0,
* "exteriorComment": "",
* "skeletonLevel": "",
* "skeletonComment": "",
* "interiorLevel": "",
* "interiorComment": "",
* "overallScore": 0,
* "overallComment": ""
* }
*/
export interface CompleteInspectionParams { export interface CompleteInspectionParams {
taskId: number | string; taskId: number | string;
exteriorScore: number; exteriorScore: number;
......
/*
* @Author: cen
* @Date: 2026-03-16 15:09:35
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/src/api/modules/user.ts
* @LastEditTime: 2026-03-24 17:21:07
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
*/
import type { UserInfo } from "@stores/modules/user.ts"; import type { UserInfo } from "@stores/modules/user.ts";
import { get, post } from "@utils/request"; import { get, post } from "@utils/request";
export interface LoginParams { export interface LoginParams {
phone: string; phone: string;
verifyCode: string; verifyCode: string;
} }
...@@ -17,6 +26,7 @@ export interface InspectDetailAccount { ...@@ -17,6 +26,7 @@ export interface InspectDetailAccount {
id: number; id: number;
name: string; name: string;
phone: string; phone: string;
avatar?: string;
status: number; status: number;
region?: string; region?: string;
regionName?: string; regionName?: string;
......
...@@ -25,6 +25,7 @@ body { ...@@ -25,6 +25,7 @@ body {
} }
// ===== 最大宽度限制(超过 430px 居中显示,手机端正常自适应)===== // ===== 最大宽度限制(超过 430px 居中显示,手机端正常自适应)=====
// rem 根字号上限与 utils/flexible.ts 中 LAYOUT_MAX_WIDTH 保持一致
// #app 已加入 postcss-pxtorem selectorBlackList,px 不会被转 rem // #app 已加入 postcss-pxtorem selectorBlackList,px 不会被转 rem
#app { #app {
max-width: 430px; max-width: 430px;
......
...@@ -13,38 +13,35 @@ declare module 'vue' { ...@@ -13,38 +13,35 @@ declare module 'vue' {
Layouts: typeof import('./layouts/index.vue')['default'] Layouts: typeof import('./layouts/index.vue')['default']
PageTitle: typeof import('./components/PageTitle.vue')['default'] PageTitle: typeof import('./components/PageTitle.vue')['default']
PageTop: typeof import('./components/PageTop.vue')['default'] PageTop: typeof import('./components/PageTop.vue')['default']
RadioSelect: typeof import('./components/CustomizeForm/radioSelect.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
SelectDatePicker: typeof import('./components/CustomizeForm/selectDatePicker.vue')['default'] SelectDatePicker: typeof import('./components/CustomizeForm/selectDatePicker.vue')['default']
SelectDropdown: typeof import('./components/CustomizeForm/selectDropdown.vue')['default'] SelectDropdown: typeof import('./components/CustomizeForm/selectDropdown.vue')['default']
VanActionSheet: typeof import('vant/es')['ActionSheet'] VanActionSheet: typeof import('vant/es')['ActionSheet']
VanButton: typeof import('vant/es')['Button'] VanButton: typeof import('vant/es')['Button']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCheckbox: typeof import('vant/es')['Checkbox'] VanCheckbox: typeof import('vant/es')['Checkbox']
VanDatePicker: typeof import('vant/es')['DatePicker']
VanEmpty: typeof import('vant/es')['Empty'] VanEmpty: typeof import('vant/es')['Empty']
VanField: typeof import('vant/es')['Field'] VanField: typeof import('vant/es')['Field']
VanGrid: typeof import('vant/es')['Grid'] VanForm: typeof import('vant/es')['Form']
VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon'] VanIcon: typeof import('vant/es')['Icon']
VanImage: typeof import('vant/es')['Image'] VanImage: typeof import('vant/es')['Image']
VanImagePreview: typeof import('vant/es')['ImagePreview']
VanList: typeof import('vant/es')['List'] VanList: typeof import('vant/es')['List']
VanLoading: typeof import('vant/es')['Loading'] VanLoading: typeof import('vant/es')['Loading']
VanNavBar: typeof import('vant/es')['NavBar'] VanPicker: typeof import('vant/es')['Picker']
VanPopup: typeof import('vant/es')['Popup']
VanProgress: typeof import('vant/es')['Progress'] VanProgress: typeof import('vant/es')['Progress']
VanPullRefresh: typeof import('vant/es')['PullRefresh'] VanPullRefresh: typeof import('vant/es')['PullRefresh']
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanSearch: typeof import('vant/es')['Search'] VanSearch: typeof import('vant/es')['Search']
VanSkeleton: typeof import('vant/es')['Skeleton'] VanSkeleton: typeof import('vant/es')['Skeleton']
VanSlider: typeof import('vant/es')['Slider'] VanSlider: typeof import('vant/es')['Slider']
VanSticky: typeof import('vant/es')['Sticky']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar'] VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem'] VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTabs: typeof import('vant/es')['Tabs']
VanTag: typeof import('vant/es')['Tag'] VanTag: typeof import('vant/es')['Tag']
VanUploader: typeof import('vant/es')['Uploader']
WorkOrderStatusTags: typeof import('./components/WorkOrderStatusTags.vue')['default'] WorkOrderStatusTags: typeof import('./components/WorkOrderStatusTags.vue')['default']
} }
} }
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import type { CustomizeFormValidateResult } from "@/types/views/car-detail";
import { ref, watch } from "vue";
import selectDatePicker from "@/components/customizeForm/selectDatePicker.vue"; import selectDatePicker from "@/components/customizeForm/selectDatePicker.vue";
import selectDropdown from "@/components/customizeForm/selectDropdown.vue"; import selectDropdown from "@/components/customizeForm/selectDropdown.vue";
import buttonSelect from "@/components/customizeForm/buttonSelect.vue"; import buttonSelect from "@/components/customizeForm/buttonSelect.vue";
import radioSelect from "@/components/customizeForm/radioSelect.vue";
import customizeUploadFile from "@/components/customizeForm/customizeUploadFile.vue"; import customizeUploadFile from "@/components/customizeForm/customizeUploadFile.vue";
// 获取父组件传递的model // 获取父组件传递数据
const props = defineProps({ const props = withDefaults(
model: { defineProps<{
type: Array, leafNodes?: [];
default: () => [], bigModuleLabel?: string;
}, subTabLabel?: string;
allowNoStructure?: boolean;
}>(), {
leafNodes: () => [],
bigModuleLabel: "",
subTabLabel: "",
allowNoStructure: false,
}); });
const columnsList = ref([]);
const resultStatus = ref(false);
const form = ref({}); const form = ref({});
const rules = ref({}); const rules = ref({});
watch(() => props.leafNodes, (nodes) => {
columnsList.value = nodes || [];
console.log('watchLeafNodes', columnsList.value);
}, { immediate: true, deep: true });
// 提交数据
function setSubmitData() {
let dataList: never[] = [];
columnsList.value.forEach((item: any) => {
let itemData: any = {};
const inputList = ['text_input', 'textarea_input', 'number_input', 'date_picker'];
const dropdownList = ['dropdown', 'radio_button_select'];
if (inputList.includes(item.interactionType)) {
itemData = {
id: item.id,
valueText: item.value || '',
valueKey: item.value || '',
interactionType: item.interactionType,
remark: item.remark || '',
}
} else if (dropdownList.includes(item.interactionType)) {
itemData = {
id: item.id,
valueText: item.valueText || '',
valueKey: item.valueKey || '',
interactionType: item.interactionType,
remark: item.remark || '',
}
} else if (item.interactionType == 'button_select') {
const valueList = JSON.parse(item.value || '[]');
if (valueList && valueList.length > 0) {
for (let i = 0; i < valueList.length; i++) {
const foritemData = {
id: item.id,
valueText: valueList[i].valueText || '',
valueKey: valueList[i].valueKey || '',
interactionType: item.interactionType,
remark: item.remark || '',
valueSeq: i + 1,
}
dataList.push(foritemData);
}
} else {
itemData = {
id: item.id,
valueText: item.valueText || '',
valueKey: item.valueKey || '',
interactionType: item.interactionType,
remark: item.remark || '',
}
dataList.push(itemData);
}
} else if (item.interactionType == 'image_upload' || item.interactionType == 'video_upload') {
const valueList = JSON.parse(item.value || '[]');
if (valueList && valueList.length > 0) {
for (let i = 0; i < valueList.length; i++) {
const foritemData = {
id: item.id,
valueText: valueList[i] || '',
valueKey: valueList[i] || '',
interactionType: item.interactionType,
remark: item.remark || '',
valueSeq: i + 1,
}
dataList.push(foritemData);
}
} else {
itemData = {
id: item.id,
valueText: item.valueText || '',
valueKey: item.valueKey || '',
interactionType: item.interactionType,
remark: item.remark || '',
}
dataList.push(itemData);
}
} else {
itemData = {
id: item.id,
valueText: item.valueText || '',
valueKey: item.valueKey || '',
interactionType: item.interactionType,
remark: item.remark || '',
}
}
if (item.interactionType != 'button_select' && item.interactionType != 'image_upload' && item.interactionType != 'video_upload') {
dataList.push(itemData);
}
});
return {
nodeId: columnsList.value[0].parentId || '', //节点 ID(inspection_node_version.nodeId,叶子节点)
nodeName: props.subTabLabel,//节点名称(快照)
resultStatus: resultStatus.value ? 3 : 1,//结果状态:1-正常,2-故障,3-无此结构
remark: '',//备注
data: dataList,
};
}
async function validate(): Promise<CustomizeFormValidateResult> {
const nodesData = setSubmitData();
console.log('validate', nodesData);
let success = true;
let message = '';
columnsList.value.forEach((item: any) => {
if (item.required == 1 && !item.value) {
success = false;
message = message ? message : item.nodeName;
}
});
return {
data: nodesData,
message: message || "操作成功",
success: success,
};
}
async function validate() { /** 与 `validate` 相同返回结构,不校验必填,用于静默保存 / 上一步等场景 */
async function saveData(): Promise<CustomizeFormValidateResult> {
const nodesData = setSubmitData();
console.log('saveData', nodesData);
return { return {
data: formList.value, data: nodesData,
message: "操作成功", message: "操作成功",
success: true, success: true,
}; };
} }
const formList = ref([ function getValidationRules(item: any) {
{ return JSON.parse(item.validationRules || '{}');
interactionType: "image_upload", }
required: 1,
nodeName: "是否一手车",
placeholder: "请选择",
value: "",
maxCount: 50,
}
]);
defineExpose({ defineExpose({
validate, validate,
saveData,
}); });
</script> </script>
<template> <template>
<div> <div>
<van-form ref="customizeFormRef" :model="form" :rules="rules"> <van-form ref="customizeFormRef" :model="form" :rules="rules">
<div class="formTitle"> <div class="formTitle">
<div>车辆信息</div> <div>{{ subTabLabel }}</div>
<div class="formRadio"> <div v-if="allowNoStructure" class="formRadio" @click="resultStatus = !resultStatus">
<van-radio-group direction="horizontal"> <van-icon v-if="!resultStatus" name="circle" size="14" color="#666666" />
<van-radio name="1" icon-size="14px"> <van-icon v-if="resultStatus" name="checked" size="14" color="#185EFE" />
<span class="radioText">无此结构</span> <span class="radioText">无此结构</span>
</van-radio>
</van-radio-group>
</div> </div>
</div> </div>
<div v-for="(item, index) in formList" :key="index" class="customizeList" <div v-for="(item, index) in columnsList" :key="index" class="customizeList"
:class="{ 'border-bottom': index < formList.length - 1 }"> :class="{ 'border-bottom': index < columnsList.length - 1 && item.interactionType != 'image_upload' }">
<!-- 文本输入框 --> <!-- 文本输入框 -->
<div v-if="item.interactionType == 'text_input'"> <div v-if="item.interactionType == 'text_input'">
<van-field v-model="item.value" clearable :label="item.nodeName" :maxlength="item.maxCount" <van-field v-model="item.value" clearable :label="item.nodeName"
:placeholder="item.placeholder" :required="item.required === 1" /> :maxlength="getValidationRules(item).maxLength || 120" :placeholder="item.placeholder"
:required="item.required === 1" />
</div> </div>
<!-- 长文本输入框 --> <!-- 长文本输入框 -->
<div v-if="item.interactionType == 'textarea_input'"> <div v-if="item.interactionType == 'textarea_input'">
<van-field v-model="item.value" autosize :label="item.nodeName" :maxlength="item.maxCount" clearable <van-field v-model="item.value" autosize :label="item.nodeName"
:placeholder="item.placeholder" :required="item.required === 1" rows="2" show-word-limit :maxlength="getValidationRules(item).maxLength || 120" clearable :placeholder="item.placeholder"
type="textarea" /> :required="item.required === 1" rows="2" show-word-limit type="textarea" />
</div> </div>
<!-- 数字输入框 --> <!-- 数字输入框 -->
<div v-if="item.interactionType == 'number_input'"> <div v-if="item.interactionType == 'number_input'">
<van-field v-model="item.value" :label="item.nodeName" clearable :maxlength="item.maxCount" <van-field v-model="item.value" :label="item.nodeName" clearable
:placeholder="item.placeholder" :required="item.required === 1" type="number" /> :maxlength="getValidationRules(item).maxLength || 120" :placeholder="item.placeholder"
:required="item.required === 1" type="number" />
</div> </div>
<!-- 单选框 --> <!-- 单选框 -->
<div v-if="item.interactionType == 'radio_button_select'"> <div v-if="item.interactionType == 'radio_button_select'">
<van-field name="radio" v-model="item.value" :required="item.required === 1" :label="item.nodeName"> <radioSelect :item="item" :value="item.value" @update="item.value = $event" />
<template #input>
<div class="templateBox">
<van-radio-group style="float: right;" v-model="item.value" direction="horizontal">
<van-radio name="1" icon-size="14px">是</van-radio>
<van-radio name="2" icon-size="14px">否</van-radio>
</van-radio-group>
</div>
</template>
</van-field>
</div> </div>
<!-- 日期选择器 --> <!-- 日期选择器 -->
...@@ -113,7 +225,7 @@ defineExpose({ ...@@ -113,7 +225,7 @@ defineExpose({
</div> </div>
<!-- 图片上传 --> <!-- 图片上传 -->
<div v-if="item.interactionType == 'image_upload'"> <div v-if="item.interactionType == 'image_upload' || item.interactionType == 'video_upload'">
<customizeUploadFile :item="item" :value="item.value" @update="item.value = $event" /> <customizeUploadFile :item="item" :value="item.value" @update="item.value = $event" />
</div> </div>
...@@ -141,6 +253,7 @@ defineExpose({ ...@@ -141,6 +253,7 @@ defineExpose({
.radioText { .radioText {
color: #666666; color: #666666;
font-size: 12px; font-size: 12px;
padding-left: 4px;
} }
.customizeList { .customizeList {
...@@ -148,11 +261,12 @@ defineExpose({ ...@@ -148,11 +261,12 @@ defineExpose({
float: left; float: left;
} }
.border-bottom { .customizeList50 {
border-bottom: 1px solid #e6ebf5; width: 50%;
float: left;
} }
.templateBox { .border-bottom {
width: 100%; border-bottom: 1px solid #e6ebf5;
} }
</style> </style>
...@@ -7,26 +7,21 @@ const props = defineProps({ ...@@ -7,26 +7,21 @@ const props = defineProps({
default: () => { }, default: () => { },
}, },
}); });
const emit = defineEmits(["update"]); const emit = defineEmits(["update"]);
const pickerValue = ref([]); const pickerValue = ref([]);
const columnsList = ref([
{ label: '精品', value: '1' },
{ label: '瑕疵', value: '2' },
{ label: '重大', value: '3' },
{ label: '精品', value: '5' },
{ label: '瑕疵', value: '6' },
{ label: '重大', value: '7' },
{ label: '瑕疵', value: '8' },
{ label: '钣金修复', value: '9' }
])
// 计算属性 // 计算属性
// const columnsList = computed(() => { const columnsList = computed(() => {
// return columns; const optionsList = JSON.parse(props.item.options || '[]').map(item => {
// }); const valueList = (item || '').split('-');
return {
text: valueList[1] || '',
value: valueList[0] || '',
};
});
return optionsList;
});
function handleBut(item: { value: string }) { function handleBut(item: { value: string }) {
if (pickerValue.value.includes(item.value)) { if (pickerValue.value.includes(item.value)) {
...@@ -34,8 +29,15 @@ function handleBut(item: { value: string }) { ...@@ -34,8 +29,15 @@ function handleBut(item: { value: string }) {
} else { } else {
pickerValue.value.push(item.value); pickerValue.value.push(item.value);
} }
props.item.value = pickerValue.value.join(','); const valueList = (pickerValue.value || []).map(item => {
emit("update", pickerValue.value.join(',')); const object = (columnsList.value || []).find(finditem => finditem.value == item) || {};
return {
valueText: object.text || '',
valueKey: item || '',
};
});
props.item.value = JSON.stringify(valueList || []);
emit("update", JSON.stringify(valueList || []));
} }
</script> </script>
...@@ -49,7 +51,7 @@ function handleBut(item: { value: string }) { ...@@ -49,7 +51,7 @@ function handleBut(item: { value: string }) {
<div class="selectList"> <div class="selectList">
<div v-for="(item, index) in columnsList" :key="index" @click="handleBut(item)" class="selectBut" <div v-for="(item, index) in columnsList" :key="index" @click="handleBut(item)" class="selectBut"
:class="{ 'pitchOn': pickerValue.includes(item.value) }"> :class="{ 'pitchOn': pickerValue.includes(item.value) }">
{{ item.label }} {{ item.text }}
<div v-if="pickerValue.includes(item.value)" class="pitchImg"></div> <div v-if="pickerValue.includes(item.value)" class="pitchImg"></div>
</div> </div>
</div> </div>
......
...@@ -22,6 +22,11 @@ function pickFile() { ...@@ -22,6 +22,11 @@ function pickFile() {
fileInputRef.value?.click(); fileInputRef.value?.click();
} }
// 计算属性
const validationRules = computed(() => {
return JSON.parse(props.item.validationRules || '{}');
});
async function onFileChange(ev: Event) { async function onFileChange(ev: Event) {
const input = ev.target as HTMLInputElement; const input = ev.target as HTMLInputElement;
const file = input.files?.[0]; const file = input.files?.[0];
...@@ -33,6 +38,9 @@ async function onFileChange(ev: Event) { ...@@ -33,6 +38,9 @@ async function onFileChange(ev: Event) {
const url = (typeof res.aliyunAddress === "string" && res.aliyunAddress) || (typeof res.url === "string" && res.url) || ""; const url = (typeof res.aliyunAddress === "string" && res.aliyunAddress) || (typeof res.url === "string" && res.url) || "";
showToast("上传成功"); showToast("上传成功");
pickerValue.value.push(url); pickerValue.value.push(url);
console.log('pickerValue.value', pickerValue.value);
updateData(); updateData();
} catch (e: unknown) { } catch (e: unknown) {
const msg = e instanceof Error ? e.message : String(e); const msg = e instanceof Error ? e.message : String(e);
...@@ -48,8 +56,8 @@ function handleDelete(item: string) { ...@@ -48,8 +56,8 @@ function handleDelete(item: string) {
} }
function updateData() { function updateData() {
props.item.value = pickerValue.value.join(','); props.item.value = JSON.stringify(pickerValue.value);
emit("update", pickerValue.value.join(',')); emit("update", JSON.stringify(pickerValue.value));
} }
</script> </script>
...@@ -61,16 +69,19 @@ function updateData() { ...@@ -61,16 +69,19 @@ function updateData() {
<span v-if="item.required === 1" class="isRequired">*</span> <span v-if="item.required === 1" class="isRequired">*</span>
<span>{{ item.nodeName }}</span> <span>{{ item.nodeName }}</span>
</div> </div>
<div class="titleTip">有损伤请拍摄图片,无损伤请忽略</div> <div v-if="validationRules.maxCount && validationRules.maxCount.length > 1 && item.interactionType == 'image_upload'"
class="titleTip">
有损伤请拍摄图片,无损伤请忽略
</div>
</div> </div>
<input ref="fileInputRef" :accept="item.interactionType == 'image_upload' ? 'image/*' : 'video/*'"
<input ref="fileInputRef" accept="image/*" class="hidden-input" type="file" @change="onFileChange"> class="hidden-input" type="file" @change="onFileChange">
<div class="uploadPage"> <div class="uploadPage">
<div class="uploadBox" @click="pickFile"> <div v-if="(validationRules.maxCount || 3) > pickerValue.length" class="uploadBox" @click="pickFile">
<van-icon name="plus" size="24" color="#999999" class="plusBox" /> <van-icon name="plus" size="24" color="#999999" class="plusBox" />
<div class="uploadTxt">添加照片</div> <div class="uploadTxt"> {{ item.interactionType == 'image_upload' ? '添加照片' : '添加视频' }}</div>
</div> </div>
<div v-for="(item, index) in pickerValue" :key="index" class="uploadBox"> <div v-if="pickerValue.length" v-for="(item, index) in pickerValue" :key="index" class="uploadBox">
<div class="deleteBox" @click="handleDelete(item)"> <div class="deleteBox" @click="handleDelete(item)">
<van-icon name="clear" size="20" color="#999999" /> <van-icon name="clear" size="20" color="#999999" />
</div> </div>
......
<script setup lang="ts">
import { computed, ref } from "vue";
const props = defineProps({
item: {
type: Object,
default: () => { },
},
});
const emit = defineEmits(["update"]);
const pickerValue = ref('');
// 计算属性
const columnsList = computed(() => {
const optionsList = JSON.parse(props.item.options || '[]').map(item => {
const valueList = (item || '').split('-');
return {
text: valueList[1] || '',
value: valueList[0] || '',
};
});
return optionsList;
});
function handleBut() {
const ObjectItem = columnsList.value.find(item => item.value == pickerValue.value);
props.item.valueText = ObjectItem.text || '';
props.item.valueKey = ObjectItem.value || '';
props.item.value = pickerValue.value || '';
emit("update", pickerValue.value);
}
</script>
<template>
<van-field name="radio" v-model="pickerValue" :required="item.required === 1" :label="item.nodeName">
<template #input>
<div class="templateBox">
<van-radio-group style="float: right;" v-model="pickerValue" @change="handleBut" direction="horizontal">
<van-radio v-for="item in columnsList" :key="item.value" :name="item.value" icon-size="14px">
{{ item.text }}
</van-radio>
</van-radio-group>
</div>
</template>
</van-field>
</template>
<style lang="scss" scoped>
.templateBox {
width: 100%;
}
</style>
...@@ -12,24 +12,25 @@ const emit = defineEmits(["update"]); ...@@ -12,24 +12,25 @@ const emit = defineEmits(["update"]);
const showPicker = ref(false); const showPicker = ref(false);
const pickerValue = ref([]); const pickerValue = ref([]);
const columns = [
{ text: "杭州", value: "杭州" },
{ text: "宁波", value: "宁波" },
{ text: "温州", value: "温州" },
{ text: "绍兴", value: "绍兴" },
{ text: "湖州", value: "湖州" },
];
// 计算属性 // 计算属性
const columnsList = computed(() => { const columnsList = computed(() => {
return columns; const optionsList = JSON.parse(props.item.options || '[]').map(item => {
const valueList = (item || '').split('-');
return {
text: valueList[1] || '',
value: valueList[0] || '',
};
});
return optionsList;
}); });
function onConfirm() { function onConfirm() {
const picker = pickerValue.value && pickerValue.value.length > 0 ? pickerValue.value[0] : ""; const picker = pickerValue.value && pickerValue.value.length > 0 ? pickerValue.value[0] : "";
showPicker.value = false; showPicker.value = false;
props.item.value = picker; const ObjectItem = columnsList.value.find(item => item.value == picker);
props.item.valueText = ObjectItem.text || '';
props.item.valueKey = ObjectItem.value || '';
props.item.value = picker || '';
emit("update", picker); emit("update", picker);
} }
...@@ -37,7 +38,7 @@ function onConfirm() { ...@@ -37,7 +38,7 @@ function onConfirm() {
<template> <template>
<div> <div>
<van-field v-model="item.value" clearable is-link :label="item.nodeName" name="datePicker" <van-field v-model="item.valueText" clearable is-link :label="item.nodeName" name="datePicker"
:placeholder="item.placeholder" readonly :required="item.required === 1" @click="showPicker = true" /> :placeholder="item.placeholder" readonly :required="item.required === 1" @click="showPicker = true" />
<van-popup v-model:show="showPicker" destroy-on-close position="bottom"> <van-popup v-model:show="showPicker" destroy-on-close position="bottom">
<van-picker v-model="pickerValue" :columns="columnsList" :title="item.nodeName" @cancel="showPicker = false" <van-picker v-model="pickerValue" :columns="columnsList" :title="item.nodeName" @cancel="showPicker = false"
......
...@@ -30,8 +30,16 @@ const checkTag = computed(() => { ...@@ -30,8 +30,16 @@ const checkTag = computed(() => {
const auditTag = computed(() => { const auditTag = computed(() => {
if (props.auditStatus === undefined) return null; if (props.auditStatus === undefined) return null;
if (props.status !== 2 && props.status !== 3) return null; if (props.status !== 2 && props.status !== 3) return null;
if (props.auditStatus === 3) return { text: "审核通过", bg: "#e9f9f1", color: "#2cca74", icon: "passed" }; // auditStatus: 1待审批;2审批中;3审批通过;4审批驳回
if (props.auditStatus === 4) return { text: "审核失败", bg: "#fdeded", color: "#eb4e4e", icon: "close" }; if (props.auditStatus === 1 || props.auditStatus === 2) {
return { text: "待审核", bg: "#f0eefd", color: "#6A56F0", icon: "clock" as const };
}
if (props.auditStatus === 3) {
return { text: "审核通过", bg: "#e9f9f1", color: "#27CD5A", icon: "checked" as const };
}
if (props.auditStatus === 4) {
return { text: "审核失败", bg: "#fdeded", color: "#EE3140", icon: "warning" as const };
}
return null; return null;
}); });
</script> </script>
...@@ -46,7 +54,7 @@ const auditTag = computed(() => { ...@@ -46,7 +54,7 @@ const auditTag = computed(() => {
<van-tag v-if="auditTag" <van-tag v-if="auditTag"
class="wo-tag" class="wo-tag"
:style="{ background: auditTag.bg, color: auditTag.color }"> :style="{ background: auditTag.bg, color: auditTag.color }">
<van-icon class="wo-tag__icon" :name="auditTag.icon" /> <van-icon class="wo-tag__icon" :color="auditTag.color" :name="auditTag.icon" />
{{ auditTag.text }} {{ auditTag.text }}
</van-tag> </van-tag>
</div> </div>
......
<script setup lang="ts"> <script setup lang="ts">
import { computed } from "vue"; import { computed, ref, watch } from "vue";
import { RouterView, useRoute, useRouter } from "vue-router"; import { RouterView, useRoute, useRouter } from "vue-router";
import tabMineOff from "@/assets/image/tab-mine-off.png";
import tabMineOn from "@/assets/image/tab-mine-on.png";
import tabReportOff from "@/assets/image/tab-report-off.png";
import tabReportOn from "@/assets/image/tab-report-on.png";
import tabWorkOrderOff from "@/assets/image/tab-work-order-off.png";
import tabWorkOrderOn from "@/assets/image/tab-work-order-on.png";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const showTabBar = computed(() => route.meta.showTabBar !== false); const showTabBar = computed(() => route.meta.showTabBar !== false);
const tabList = [ const tabList = [
{ routeName: "Home", title: "检测工单", icon: "todo-list-o", activeIcon: "todo-list" }, { routeName: "Home", title: "检测工单", icon: tabWorkOrderOff, activeIcon: tabWorkOrderOn },
{ routeName: "CarList", title: "检测报告", icon: "description", activeIcon: "description" }, { routeName: "CarList", title: "检测报告", icon: tabReportOff, activeIcon: tabReportOn },
{ routeName: "Mine", title: "我的", icon: "user-o", activeIcon: "user" }, { routeName: "Mine", title: "我的", icon: tabMineOff, activeIcon: tabMineOn },
]; ];
const activeTab = computed(() => { /**
const name = route.name as string | undefined; * 数字下标 + v-model;勿给 TabbarItem 绑字符串 name。
return tabList.findIndex((tab) => tab.routeName === name); * 变量勿命名 `active`:`#icon` 插槽会传入同名 prop,会遮蔽 setup 里的 ref,导致 tabbarIndex(false)→0、第一项误判为选中。
*/
const tabbarActive = ref(0);
/** 供模板(含 `#icon` 插槽)使用:在插槽内直接读 ref 可能解析失败→undefined→tabbarIndex 恒为 0,第一项图标永远「选中」 */
const currentTabbarIndex = computed(() => tabbarIndex(tabbarActive.value));
function tabbarIndex(val: unknown): number {
const n = typeof val === "number" ? val : Number(val);
return Number.isFinite(n) ? n : 0;
}
function routeToActiveIndex(): number {
const n = route.name;
if (typeof n === "string") {
const i = tabList.findIndex((t) => t.routeName === n);
if (i !== -1) return i;
}
const p = route.path;
if (p.includes("/home")) return 0;
if (p.includes("car-list")) return 1;
if (p.includes("/mine")) return 2;
return 0;
}
watch(
() => route.fullPath,
() => {
tabbarActive.value = routeToActiveIndex();
},
{ immediate: true },
);
/** 防止 v-model 偶发成字符串导致与 TabbarItem 内部 index 比较失败 */
watch(tabbarActive, (v: unknown) => {
const n = tabbarIndex(v);
if (n !== v) tabbarActive.value = n;
}); });
function onTabChange(index: number) { function onTabChange(index: number | string) {
const tab = tabList[index]; const i = tabbarIndex(index);
const tab = tabList[i];
if (tab) { if (tab) {
router.push({ name: tab.routeName }); router.push({ name: tab.routeName });
} }
...@@ -44,15 +88,19 @@ function onTabChange(index: number) { ...@@ -44,15 +88,19 @@ function onTabChange(index: number) {
</RouterView> </RouterView>
<van-tabbar v-if="showTabBar" <van-tabbar v-if="showTabBar"
active-color="var(--color-primary)" v-model="tabbarActive"
inactive-color="#7d7e80" active-color="#185efe"
:model-value="activeTab" inactive-color="#999999"
safe-area-inset-bottom safe-area-inset-bottom
@change="onTabChange"> @change="onTabChange">
<van-tabbar-item v-for="tab in tabList" <van-tabbar-item v-for="(tab, idx) in tabList"
:key="tab.routeName" :key="tab.routeName">
:icon="activeTab === tabList.indexOf(tab) ? tab.activeIcon : tab.icon">
{{ tab.title }} {{ tab.title }}
<template #icon>
<img alt=""
class="tabbar-item-icon"
:src="currentTabbarIndex === idx ? tab.activeIcon : tab.icon" />
</template>
</van-tabbar-item> </van-tabbar-item>
</van-tabbar> </van-tabbar>
</div> </div>
...@@ -72,6 +120,18 @@ function onTabChange(index: number) { ...@@ -72,6 +120,18 @@ function onTabChange(index: number) {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
} }
:deep(.van-tabbar-item__text) {
font-size: 10px;
font-weight: 400;
}
}
.tabbar-item-icon {
display: block;
width: 22px;
height: 22px;
object-fit: contain;
} }
.fade-enter-active, .fade-enter-active,
......
import type { InspectionNode, LeafNodeRecord } from "@/api";
/** 检测评分:骨架/内饰等级选项(与 ScoreForm 共用) */
export const SCORE_RATING_OPTIONS = ["A", "B", "C", "D"] as const;
export type ScoreRatingOption = (typeof SCORE_RATING_OPTIONS)[number];
export interface SubTab {
key: number | string;
label: string;
nodeId?: number;
/** 该二级项下的叶子节点列表(nodeType=3) */
leafNodes?: InspectionNode[];
/** 二级项自身的完成标志:0 未完成,1 已完成 */
completedFlag?: 0 | 1;
}
export interface BigModule {
key: number | string;
label: string;
nodeId?: number;
subTabs: SubTab[];
}
/**
* 内容组件需要通过 defineExpose 暴露此接口。
* validate=false 时不校验直接收集数据;
* validate=true 时校验,未填完返回 null。
*/
export interface InspectSubContentExpose {
collectData(validate: boolean): Promise<LeafNodeRecord[] | null>;
}
/** 中间表单 validate 返回体 */
export interface CustomizeFormValidateResult {
success: boolean;
message?: string;
data?: {
data: Array<{
id: number;
interactionType?: string;
remark?: string;
valueKey?: string;
valueSeq?: number;
valueText?: string;
}>;
nodeId: number | string;
nodeName: string;
remark: string;
resultStatus: number;
};
}
export interface ReportItem {
id: number;
reportNo: string;
carTitle: string;
plateNo: string;
vin: string;
address: string;
updateTime: string;
coverImage: string;
}
import type { AuditStatus, WorkOrderStatus } from "./work-order-common";
export type ActionVariant = "primary" | "secondary";
export interface CardAction {
key:
| "continueCheck"
| "editCheck"
| "rejectReason"
| "startCheck"
| "viewReport"
| "viewWorkOrder";
label: string;
variant: ActionVariant;
onClick: () => void;
}
export interface WorkOrderItem {
id: string;
status: WorkOrderStatus;
auditStatus?: AuditStatus;
orderNo: string;
carTitle: string;
plateNo: string;
vin: string;
address: string;
dispatchTime: string;
coverImage: string;
auditContent?: string;
}
import type { WorkOrderStatus } from "./work-order-common";
export interface VehicleCover {
thumbUrl?: null | string;
url?: null | string;
thumbPath?: null | string;
filePath?: null | string;
}
export interface WorkOrderBaseInfo {
licensePlate?: string;
carTypeName?: string;
vin?: string;
carBrand?: string;
carSeriesName?: string;
}
export interface WorkOrderVehicle {
baseInfo?: WorkOrderBaseInfo;
venue?: { address?: string };
ownership?: { carCityName?: string; carProvinceName?: string };
cover?: VehicleCover;
custodianInfo?: { custodianName?: string; custodianPhone?: string };
}
export interface NodeVO {
nodeId: number;
nodeName: string;
count: number;
status?: number;
nodeStatus?: number;
}
export interface InspectionWORespVO {
woId?: string;
status?: WorkOrderStatus;
woTime?: string;
inspectionAddress?: string;
updateTime?: string;
inspectionCompletedTime?: string;
vehicle?: WorkOrderVehicle;
}
export interface WorkOrderDetailRemote {
inspectionWORespVO?: InspectionWORespVO;
nodeVOList?: NodeVO[];
}
/** 工单列表、详情等页面共用的状态字面量 */
export type WorkOrderStatus = 1 | 2 | 3 | 4;
export type AuditStatus = 1 | 2 | 3 | 4;
// 简易版 rem 适配: // 简易版 rem 适配:
// 以设计稿 375 宽为基准,希望设计稿下 html 字体为 14px。 // 以设计稿 375 宽为基准,希望设计稿下 html 字体为 14px。
// 不同屏幕下:html.fontSize = (当前宽度 / 375) * 14px。 // 不同屏幕下:html.fontSize = (有效宽度 / 375) * 14px。
// 有效宽度不超过 LAYOUT_MAX_WIDTH,与 reset.scss 中 #app 的 max-width 一致,避免 Pad 等大屏整屏算 rem 导致字体偏大。
const DESIGN_WIDTH = 375; const DESIGN_WIDTH = 375;
const BASE_FONT_SIZE = 14; // 设计稿宽度下的根字体大小 const BASE_FONT_SIZE = 14; // 设计稿宽度下的根字体大小
/** 与 #app max-width 保持一致,大屏 rem 按此宽度折算 */
const LAYOUT_MAX_WIDTH = 430;
function setRootFontSize() { function setRootFontSize() {
const docEl = document.documentElement; const docEl = document.documentElement;
const width = docEl.clientWidth || window.innerWidth; const width = docEl.clientWidth || window.innerWidth;
// 限制最大/最小宽度,防止在大屏或非常小的屏幕上过大/过小
const minWidth = 320; const minWidth = 320;
const maxWidth = 540; const effectiveWidth = Math.min(width, LAYOUT_MAX_WIDTH);
const clampedWidth = Math.min(Math.max(width, minWidth), maxWidth); const clampedWidth = Math.max(effectiveWidth, minWidth);
const fontSize = (clampedWidth / DESIGN_WIDTH) * BASE_FONT_SIZE; const fontSize = (clampedWidth / DESIGN_WIDTH) * BASE_FONT_SIZE;
docEl.style.fontSize = `${fontSize}px`; docEl.style.fontSize = `${fontSize}px`;
......
...@@ -3,6 +3,29 @@ import { showToast } from "vant"; ...@@ -3,6 +3,29 @@ import { showToast } from "vant";
import { getConfig } from "../config/center"; import { getConfig } from "../config/center";
/**
* 已在 `handleResponse` 中提示过用户(或 1006 已跳转登录),页面 catch 中勿再套一层「保存失败」等通用文案。
*/
export class ApiHandledError extends Error {
constructor(message: string) {
super(message);
this.name = "ApiHandledError";
Object.setPrototypeOf(this, ApiHandledError.prototype);
}
}
/** 请求层已 toast / 已处理:避免业务页 catch 再 showToast 盖住接口 message */
export function isRequestFailureAlreadyHandled(error: unknown): boolean {
if (error instanceof ApiHandledError) {
return true;
}
if (axios.isAxiosError(error)) {
// 走 axios 错误拦截器时均已 showToast(含无 response 的 default 分支)
return true;
}
return false;
}
export interface ApiResponse<T = unknown> { export interface ApiResponse<T = unknown> {
code?: number | string; code?: number | string;
message?: string; message?: string;
...@@ -28,6 +51,27 @@ export interface RequestConfig { ...@@ -28,6 +51,27 @@ export interface RequestConfig {
const TOKEN_KEY = "venus_usedcar_token"; const TOKEN_KEY = "venus_usedcar_token";
const defaultBaseURL = import.meta.env.VITE_API_BASE_URL ?? ""; const defaultBaseURL = import.meta.env.VITE_API_BASE_URL ?? "";
/** 业务成功码 */
const BIZ_CODE_OK = 200;
/** 不统一 toast / 由调用方自行处理的业务码 */
const BIZ_CODES_NO_GLOBAL_TOAST = new Set([1000, 1002, 1003, 1010]);
/** 未登录或登录过期 */
const BIZ_CODE_UNAUTHORIZED = 1006;
function normalizeBizCode(code: unknown): number | null {
if (code === null || code === undefined || code === "") {
return null;
}
const n = Number(code);
return Number.isNaN(n) ? null : n;
}
function redirectToLogin(message?: string) {
showToast(message || "登录已过期,请重新登录");
localStorage.removeItem(TOKEN_KEY);
window.location.href = "/login";
}
let axiosInstance: AxiosInstance | null = null; let axiosInstance: AxiosInstance | null = null;
function getToken(): string { function getToken(): string {
...@@ -89,9 +133,7 @@ function getInstance(): AxiosInstance { ...@@ -89,9 +133,7 @@ function getInstance(): AxiosInstance {
switch (status) { switch (status) {
case 401: { case 401: {
showToast("登录已过期,请重新登录"); redirectToLogin();
localStorage.removeItem(TOKEN_KEY);
window.location.href = "/login";
break; break;
} }
case 403: { case 403: {
...@@ -125,17 +167,28 @@ async function handleResponse<T>( ...@@ -125,17 +167,28 @@ async function handleResponse<T>(
// 兼容业务响应结构:{ code, success, message, data } // 兼容业务响应结构:{ code, success, message, data }
if (typeof data === "object" && data && ("code" in data || "success" in data)) { if (typeof data === "object" && data && ("code" in data || "success" in data)) {
const biz = data as ApiResponse<T>; const biz = data as ApiResponse<T>;
const code = String(biz.code ?? ""); const codeNum = normalizeBizCode(biz.code);
// 约定:业务成功为 code === 200;未返回 code 时沿用 success 字段兼容旧接口
const isSuccess = const isSuccess =
biz.success === true || code === "0" || code === "200" || code === "000000"; codeNum === BIZ_CODE_OK || (codeNum === null && biz.success === true);
if (isSuccess) { if (isSuccess) {
return (biz.data ?? (data as unknown)) as T; return (biz.data ?? (data as unknown)) as T;
} }
const errMsg = biz.message || biz.msg || "请求失败"; const errMsg = biz.message || biz.msg || "请求失败";
if (codeNum === BIZ_CODE_UNAUTHORIZED) {
redirectToLogin(errMsg);
throw new ApiHandledError(errMsg);
}
if (codeNum !== null && BIZ_CODES_NO_GLOBAL_TOAST.has(codeNum)) {
throw new Error(errMsg);
}
showToast(errMsg); showToast(errMsg);
throw new Error(errMsg); throw new ApiHandledError(errMsg);
} }
// 非标准结构,直接返回 data // 非标准结构,直接返回 data
......
<template>
<div class="inspect-sub-content inspect-sub-content--mock">
<div v-if="!leafNodes?.length"
class="sub-empty">
<van-icon color="#c8c9cc"
name="notes-o"
size="40" />
<p>当前二级项暂无检测项(childrenNodes 为空)</p>
</div>
<template v-else>
<div v-if="bigModuleLabel || subTabLabel"
class="sub-header">
<span v-if="bigModuleLabel">{{ bigModuleLabel }}</span>
<span v-if="bigModuleLabel && subTabLabel"> · </span>
<span v-if="subTabLabel">{{ subTabLabel }}</span>
<span class="sub-header-tag">模拟</span>
</div>
<div v-for="node in leafNodes"
:key="node.id"
class="mock-field-card">
<div class="mock-field-title">
{{ node.nodeName }}
<span v-if="node.required === 1"
class="req">*</span>
</div>
<div class="mock-field-meta">
<span>nodeCode: {{ node.nodeCode || "—" }}</span>
<span>interaction: {{ node.interactionType || "—" }}</span>
</div>
<div v-if="showResolvedDefault(node)"
class="mock-resolved">
解析默认: {{ node.resolvedInitialValue ?? node.defaultValue ?? "—" }}
</div>
<van-field class="mock-input"
:model-value="fieldValues[node.id] ?? ''"
:placeholder="node.placeholder || '模拟输入'"
@update:model-value="(v) => onFieldInput(node.id, v)" />
</div>
</template>
</div>
</template>
<script setup lang="ts">
import type { InspectionNode, LeafNodeRecord } from "@api";
import { ref, watch } from "vue";
import { showToast } from "vant";
const props = withDefaults(
defineProps<{
/** 当前二级项下已处理默认值的 childrenNodes(叶子节点) */
leafNodes?: InspectionNode[];
bigModuleLabel?: string;
subTabLabel?: string;
}>(),
{
leafNodes: () => [],
bigModuleLabel: "",
subTabLabel: "",
}
);
/** 模拟表单值(nodeId -> 文本) */
const fieldValues = ref<Record<number, string>>({});
function initialFieldText(n: InspectionNode): string {
if (n.resolvedInitialValue !== undefined) {
return n.resolvedInitialValue;
}
const list = n.inspectionResultVO?.inspectionValueList;
if (list?.length) {
return list
.map((item) => String(item.valueText ?? "").trim())
.filter(Boolean)
.join(", ");
}
return n.defaultValue ?? "";
}
watch(
() => props.leafNodes,
(nodes: InspectionNode[] | undefined) => {
const next: Record<number, string> = {};
for (const n of nodes ?? []) {
next[n.id] = initialFieldText(n);
}
fieldValues.value = next;
},
{ immediate: true, deep: true }
);
function showResolvedDefault(node: InspectionNode) {
return (
node.existsDefaultValue === "1" ||
node.existsDefaultValue === 1 ||
node.resolvedInitialValue !== undefined ||
!!node.defaultValue
);
}
function onFieldInput(nodeId: number, v: string) {
fieldValues.value = { ...fieldValues.value, [nodeId]: v };
}
/**
* 与父页 InspectSubContentExpose 对齐;正式组件实现后替换逻辑即可。
*/
async function collectData(validate: boolean): Promise<LeafNodeRecord[] | null> {
const list = props.leafNodes ?? [];
if (validate) {
for (const n of list) {
if (n.required === 1 && !String(fieldValues.value[n.id] ?? "").trim()) {
showToast(`请填写:${n.nodeName}`);
return null;
}
}
}
return list.map((leaf) => ({
nodeId: leaf.id,
nodeName: leaf.nodeName,
resultStatus: 0,
remark: "",
data: [
{
id: leaf.id,
valueText: String(fieldValues.value[leaf.id] ?? ""),
valueKey: "",
interactionType: leaf.interactionType ?? "",
valueSeq: 0,
remark: "",
},
],
}));
}
defineExpose({ collectData });
</script>
<style lang="scss" scoped>
.inspect-sub-content--mock {
padding-bottom: 8px;
}
.sub-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 220px;
gap: 12px;
padding: 24px;
font-size: 13px;
color: #969799;
text-align: center;
}
.sub-header {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
margin-bottom: 12px;
font-size: 13px;
font-weight: 600;
color: #323233;
.sub-header-tag {
padding: 0 6px;
font-size: 11px;
font-weight: 500;
color: #185efe;
background: #185efe1a;
border-radius: 4px;
}
}
.mock-field-card {
margin-bottom: 14px;
padding: 12px;
background: #f7f8fa;
border-radius: 8px;
}
.mock-field-title {
margin-bottom: 6px;
font-size: 15px;
font-weight: 600;
color: #323233;
.req {
margin-left: 2px;
color: #ee0a24;
}
}
.mock-field-meta {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 6px;
font-size: 11px;
color: #969799;
}
.mock-resolved {
margin-bottom: 8px;
padding: 6px 8px;
font-size: 12px;
line-height: 1.4;
color: #185efe;
word-break: break-all;
background: #185efe14;
border-radius: 4px;
}
.mock-input {
padding: 8px 10px;
margin-top: 4px;
overflow: hidden;
background: #fff;
border-radius: 6px;
:deep(.van-field__body) {
padding: 0;
}
}
</style>
...@@ -4,7 +4,15 @@ ...@@ -4,7 +4,15 @@
<div class="score-section"> <div class="score-section">
<div class="score-section-header"> <div class="score-section-header">
<span class="score-label">外观评分<span class="required-mark">*</span></span> <span class="score-label">外观评分<span class="required-mark">*</span></span>
<span class="score-value">{{ form.appearanceScore }} <em>分</em></span> <div class="score-input-with-unit">
<input class="score-input"
inputmode="numeric"
maxlength="3"
type="text"
:value="String(form.appearanceScore)"
@input="onAppearanceScoreInput" />
<span class="score-unit">分</span>
</div>
</div> </div>
<div class="score-slider-wrap"> <div class="score-slider-wrap">
<van-slider v-model="form.appearanceScore" <van-slider v-model="form.appearanceScore"
...@@ -23,18 +31,6 @@ ...@@ -23,18 +31,6 @@
<!-- 外观评级 --> <!-- 外观评级 -->
<div class="score-section"> <div class="score-section">
<div class="score-section-header">
<span class="score-label">外观评级<span class="required-mark">*</span></span>
</div>
<div class="rating-btns">
<div v-for="opt in RATING_OPTIONS"
:key="opt"
class="rating-btn"
:class="{ active: form.appearanceRating === opt }"
@click="form.appearanceRating = opt">
{{ opt }}
</div>
</div>
<div class="score-basis-label"> <div class="score-basis-label">
评分依据<span class="required-mark">*</span> 评分依据<span class="required-mark">*</span>
</div> </div>
...@@ -102,7 +98,15 @@ ...@@ -102,7 +98,15 @@
<div class="score-section"> <div class="score-section">
<div class="score-section-header"> <div class="score-section-header">
<span class="score-label">综合评分<span class="required-mark">*</span></span> <span class="score-label">综合评分<span class="required-mark">*</span></span>
<span class="score-value">{{ form.overallScore }} <em>分</em></span> <div class="score-input-with-unit">
<input class="score-input"
inputmode="numeric"
maxlength="3"
type="text"
:value="String(form.overallScore)"
@input="onOverallScoreInput" />
<span class="score-unit">分</span>
</div>
</div> </div>
<div class="score-slider-wrap"> <div class="score-slider-wrap">
<van-slider v-model="form.overallScore" <van-slider v-model="form.overallScore"
...@@ -130,47 +134,76 @@ ...@@ -130,47 +134,76 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { CompleteInspectionParams } from "@api";
import { reactive } from "vue"; import { reactive } from "vue";
import { SCORE_RATING_OPTIONS as RATING_OPTIONS, type ScoreRatingOption } from "@/types/views/car-detail";
import { showToast } from "vant"; import { showToast } from "vant";
const RATING_OPTIONS = ["A", "B", "C", "D"] as const;
type RatingOption = (typeof RATING_OPTIONS)[number];
const form = reactive({ const form = reactive({
appearanceScore: 0, appearanceScore: 0,
appearanceRating: "" as "" | RatingOption,
appearanceBasis: "", appearanceBasis: "",
frameRating: "" as "" | RatingOption, frameRating: "" as "" | ScoreRatingOption,
frameBasis: "", frameBasis: "",
interiorRating: "" as "" | RatingOption, interiorRating: "" as "" | ScoreRatingOption,
interiorBasis: "", interiorBasis: "",
overallScore: 0, overallScore: 0,
overallRating: "", overallRating: "",
}); });
function clampScoreFromInput(raw: string): number {
const digits = (raw.match(/\d/g) ?? []).join("");
if (digits === "") {
return 0;
}
const n = Number.parseInt(digits, 10);
if (Number.isNaN(n)) {
return 0;
}
return Math.min(100, Math.max(0, n));
}
function onAppearanceScoreInput(e: Event) {
form.appearanceScore = clampScoreFromInput((e.target as HTMLInputElement).value);
}
function onOverallScoreInput(e: Event) {
form.overallScore = clampScoreFromInput((e.target as HTMLInputElement).value);
}
function validate(): boolean { function validate(): boolean {
const { const { appearanceBasis, frameRating, frameBasis, interiorRating, interiorBasis, overallRating } = form;
appearanceRating, if (
appearanceBasis, !appearanceBasis.trim() ||
frameRating, !frameRating ||
frameBasis, !frameBasis.trim() ||
interiorRating, !interiorRating ||
interiorBasis, !interiorBasis.trim() ||
overallRating, !overallRating.trim()
} = form; ) {
if (!appearanceRating || !appearanceBasis || !frameRating || !frameBasis || !interiorRating || !interiorBasis || !overallRating) {
showToast("请填完需评分必填项"); showToast("请填完需评分必填项");
return false; return false;
} }
return true; return true;
} }
function getFormData() { /** 与接口 `completeInspection` 入参字段一致 */
return { ...form }; function getCompleteInspectionPayload(taskId: number | string): CompleteInspectionParams {
return {
taskId,
exteriorScore: form.appearanceScore,
exteriorComment: form.appearanceBasis,
skeletonLevel: form.frameRating,
skeletonComment: form.frameBasis,
interiorLevel: form.interiorRating,
interiorComment: form.interiorBasis,
overallScore: form.overallScore,
overallComment: form.overallRating,
};
} }
defineExpose({ validate, getFormData }); defineExpose({ validate, getCompleteInspectionPayload });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -208,19 +241,40 @@ defineExpose({ validate, getFormData }); ...@@ -208,19 +241,40 @@ defineExpose({ validate, getFormData });
} }
} }
.score-value { .score-input-with-unit {
font-size: 20px; display: flex;
font-weight: 700; flex-shrink: 0;
color: #185efe; gap: 4px;
align-items: center;
}
em { .score-input {
font-size: 13px; box-sizing: border-box;
font-weight: 400; width: 64px;
font-style: normal; height: 28px;
color: #666; padding: 0 6px;
font-size: 16px;
font-weight: 500;
color: #333333;
text-align: center;
appearance: none;
background: #fff;
border: 1px solid #dce0e6;
border-radius: 6px;
opacity: 1;
&:focus {
outline: none;
border-color: #185efe;
} }
} }
.score-unit {
font-size: 14px;
font-weight: 500;
color: #666;
}
.score-ref { .score-ref {
padding: 2px 8px; padding: 2px 8px;
font-size: 12px; font-size: 12px;
......
...@@ -3,19 +3,9 @@ import { onActivated, ref, watch } from "vue"; ...@@ -3,19 +3,9 @@ import { onActivated, ref, watch } from "vue";
import { getInspectReportPage } from "@/api/modules/inspect-report.ts"; import { getInspectReportPage } from "@/api/modules/inspect-report.ts";
import PageTop from "@/components/PageTop.vue"; import PageTop from "@/components/PageTop.vue";
import type { ReportItem } from "@/types/views/car-list";
import { showToast } from "vant"; import { showToast } from "vant";
interface ReportItem {
id: number;
reportNo: string;
carTitle: string;
plateNo: string;
vin: string;
address: string;
updateTime: string;
coverImage: string;
}
const keyword = ref(""); const keyword = ref("");
const refreshing = ref(false); const refreshing = ref(false);
const loading = ref(false); const loading = ref(false);
......
...@@ -5,38 +5,10 @@ import { useRouter } from "vue-router"; ...@@ -5,38 +5,10 @@ import { useRouter } from "vue-router";
import { getWorkOrderCountByStatus, getWorkOrderPage } from "@/api/modules/work-order"; import { getWorkOrderCountByStatus, getWorkOrderPage } from "@/api/modules/work-order";
import PageTop from "@/components/PageTop.vue"; import PageTop from "@/components/PageTop.vue";
import WorkOrderStatusTags from "@/components/WorkOrderStatusTags.vue"; import WorkOrderStatusTags from "@/components/WorkOrderStatusTags.vue";
import type { CardAction, WorkOrderItem } from "@/types/views/home";
import type { AuditStatus, WorkOrderStatus } from "@/types/views/work-order-common";
import { showToast } from "vant"; import { showToast } from "vant";
type WorkOrderStatus = 1 | 2 | 3 | 4;
type AuditStatus = 1 | 2 | 3 | 4;
type ActionVariant = "primary" | "secondary";
interface CardAction {
key:
| "continueCheck"
| "editCheck"
| "rejectReason"
| "startCheck"
| "viewReport"
| "viewWorkOrder";
label: string;
variant: ActionVariant;
onClick: () => void;
}
interface WorkOrderItem {
id: string;
status: WorkOrderStatus;
auditStatus?: AuditStatus;
orderNo: string;
carTitle: string;
plateNo: string;
vin: string;
address: string;
dispatchTime: string;
coverImage: string;
}
const keyword = ref(""); const keyword = ref("");
const activeStatus = ref<WorkOrderStatus>(1); const activeStatus = ref<WorkOrderStatus>(1);
const refreshing = ref(false); const refreshing = ref(false);
...@@ -159,17 +131,14 @@ function onStatusChange(status: WorkOrderStatus) { ...@@ -159,17 +131,14 @@ function onStatusChange(status: WorkOrderStatus) {
function startCheck(item: WorkOrderItem) { function startCheck(item: WorkOrderItem) {
item.status = 2; item.status = 2;
showToast("已开始检测");
void router.push({ name: "CarDetail", params: { id: item.id } }); void router.push({ name: "CarDetail", params: { id: item.id } });
} }
function continueCheck(item: WorkOrderItem) { function continueCheck(item: WorkOrderItem) {
showToast("继续检测");
void router.push({ name: "CarDetail", params: { taskId: item.id } }); void router.push({ name: "CarDetail", params: { taskId: item.id } });
} }
function editCheck(item: WorkOrderItem) { function editCheck(item: WorkOrderItem) {
showToast("修改检测项");
void router.push({ name: "CarDetail", params: { id: item.id } }); void router.push({ name: "CarDetail", params: { id: item.id } });
} }
...@@ -179,12 +148,11 @@ function viewWorkOrder(item: WorkOrderItem) :void{ ...@@ -179,12 +148,11 @@ function viewWorkOrder(item: WorkOrderItem) :void{
} }
function viewReport(_item: WorkOrderItem) { function viewReport(_item: WorkOrderItem) {
showToast("查看报告");
void router.push({ name: "CarList" }); void router.push({ name: "CarList" });
} }
function showRejectReason(_item: WorkOrderItem) { function showRejectReason(_item: WorkOrderItem) {
showToast(`驳回原因(示例):请补充图片与里程数`); showToast(_item.auditContent ?? "");
} }
function getCardActions(item: WorkOrderItem): CardAction[] { function getCardActions(item: WorkOrderItem): CardAction[] {
...@@ -230,18 +198,7 @@ function getCardActions(item: WorkOrderItem): CardAction[] { ...@@ -230,18 +198,7 @@ function getCardActions(item: WorkOrderItem): CardAction[] {
} }
if (item.status === 3) { if (item.status === 3) {
if (item.auditStatus === 3) { const actions: CardAction[] = [
return [
{
key: "viewReport",
label: "查看报告",
variant: "secondary",
onClick: () => viewReport(item),
},
];
}
// 待审批/审批中(或无值) => 查看工单(只读)
return [
{ {
key: "viewWorkOrder", key: "viewWorkOrder",
label: "查看工单", label: "查看工单",
...@@ -249,11 +206,24 @@ function getCardActions(item: WorkOrderItem): CardAction[] { ...@@ -249,11 +206,24 @@ function getCardActions(item: WorkOrderItem): CardAction[] {
onClick: () => viewWorkOrder(item), onClick: () => viewWorkOrder(item),
}, },
]; ];
// 审批通过时可额外查看报告
if (item.auditStatus === 3) {
actions.push({
key: "viewReport",
label: "查看报告",
variant: "secondary",
onClick: () => viewReport(item),
});
}
return actions;
} }
return []; return [];
} }
/** 底部操作区统一拦冒泡,避免点到按钮与卡片间隙时仍触发整张卡的 viewWorkOrder */
function stopCardFooterBubbling() {}
watch([keyword, activeStatus], () => { watch([keyword, activeStatus], () => {
void onRefresh(); void onRefresh();
}); });
...@@ -334,12 +304,13 @@ void onRefresh(); ...@@ -334,12 +304,13 @@ void onRefresh();
<div class="card-bottom"> <div class="card-bottom">
派单于 {{ item.dispatchTime }} 派单于 {{ item.dispatchTime }}
</div> </div>
<div class="card-actions"> <div class="card-actions"
@click.stop="stopCardFooterBubbling">
<van-button v-for="act in getCardActions(item)" <van-button v-for="act in getCardActions(item)"
:key="act.key" :key="act.key"
class="wo-btn" class="wo-btn"
:class="act.variant === 'primary' ? 'wo-btn--primary' : 'wo-btn--secondary'" :class="act.variant === 'primary' ? 'wo-btn--primary' : 'wo-btn--secondary'"
@click="act.onClick"> @click.stop="act.onClick">
{{ act.label }} {{ act.label }}
</van-button> </van-button>
</div> </div>
......
...@@ -14,18 +14,21 @@ const { ...@@ -14,18 +14,21 @@ const {
</script> </script>
<template> <template>
<div class="relative flex min-h-screen flex-col box-border bg-gradient-to-b from-[#f4f7ff] via-[#f7f9ff] to-white px-[32px] pb-6 mobile"> <div class="relative flex min-h-screen flex-col box-border bg-gradient-to-b from-[#f4f7ff] via-[#f7f9ff] to-white mobile">
<div class="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_0_0,#e4f0ff_0,transparent_50%),radial-gradient(circle_at_100%_0,#e1e8ff_0,transparent_50%)]" /> <div class="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_0_0,#e4f0ff_0,transparent_50%),radial-gradient(circle_at_100%_0,#e1e8ff_0,transparent_50%)]" />
<div class="relative flex flex-1 flex-col mt-[160px]"> <!-- 键盘弹起时随文档流滚动,避免 absolute 贴屏底被顶到输入区上方 -->
<div class="text-center text-[24px] font-semibold text-[#111]"> <div class="relative z-[1] flex flex-1 flex-col px-[32px] pb-[max(1.5rem,env(safe-area-inset-bottom,0px))]">
检测端登录 <div class="mt-[160px] shrink-0">
</div> <div class="text-center text-[24px] font-semibold text-[#111]">
<div class="mt-[6px] text-center text-[12px] text-[#999]"> 检测端登录
专业的车辆检测工具 </div>
<div class="mt-[6px] text-center text-[12px] text-[#999]">
专业的车辆检测工具
</div>
</div> </div>
<div class="mt-8 space-y-4"> <div class="mt-8 shrink-0 space-y-4">
<van-field v-model="phone" <van-field v-model="phone"
class="rounded-full login-input" class="rounded-full login-input"
clearable clearable
...@@ -42,11 +45,11 @@ const { ...@@ -42,11 +45,11 @@ const {
placeholder="请输入验证码" placeholder="请输入验证码"
type="tel"> type="tel">
<template #button> <template #button>
<van-button class="p-0 text-[13px]" <van-button class="login-send-code-btn p-0 text-[13px] leading-[1.25]"
:class="countdown > 0 ? '!text-[#CCCCCC]' : '!text-[#185EFE]'" :class="countdown > 0 ? '!text-[#CCCCCC]' : '!text-[#185EFE]'"
:disabled="sending || countdown > 0" :disabled="sending || countdown > 0"
:loading="sending" :loading="sending"
size="small" plain
@click="handleSendCode"> @click="handleSendCode">
<span v-if="!hasSent">获取验证码</span> <span v-if="!hasSent">获取验证码</span>
<span v-else-if="countdown > 0">重新发送({{ countdown }}s)</span> <span v-else-if="countdown > 0">重新发送({{ countdown }}s)</span>
...@@ -56,24 +59,26 @@ const { ...@@ -56,24 +59,26 @@ const {
</van-field> </van-field>
<van-button block <van-button block
class="mt-6 !h-[52px] border-0 bg-gradient-to-r from-[#84a9ff] to-[#90b5ff] text-[16px] font-medium" class="mt-6 !h-[52px] border-0 !bg-[#185EFE] !text-[#ffffff] text-[16px] font-medium"
:disabled="!phone || !code"
round round
type="primary"
@click="handleLogin"> @click="handleLogin">
登录 登录
</van-button> </van-button>
</div>
<div class="absolute bottom-[70px] left-1/2 flex -translate-x-1/2 items-center justify-center text-[12px] text-[#999]"> <div aria-hidden="true" class="min-h-6 flex-1" />
<van-checkbox v-model="agreed"
checked-color="#4f8cff" <div class="flex shrink-0 justify-center pt-10 text-center text-[12px] text-[#999]">
icon-size="14px"> <van-checkbox v-model="agreed"
<span class="whitespace-nowrap"> checked-color="#4f8cff"
我已阅读并同意 icon-size="14px">
<a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《用户协议》</a> <span class="whitespace-nowrap">
<a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《隐私协议》</a> 我已阅读并同意
</span> <a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《用户协议》</a>
</van-checkbox> <a class="mx-0.5 text-[#4f8cff] no-underline" href="javascript:;">《隐私协议》</a>
</div> </span>
</van-checkbox>
</div> </div>
</div> </div>
</div> </div>
...@@ -81,26 +86,48 @@ const { ...@@ -81,26 +86,48 @@ const {
<style scoped lang="scss"> <style scoped lang="scss">
.mobile { .mobile {
min-height: 100vh;
min-height: 100dvh;
background: url('@assets/image/bg.png') no-repeat center center; background: url('@assets/image/bg.png') no-repeat center center;
background-size: 100% 100%; background-size: 100% 100%;
} }
.login-input { .login-input {
box-sizing: border-box;
display: flex;
align-items: center;
min-height: 56px;
padding: 16px !important; padding: 16px !important;
background: #f2f4f7; background: #f2f4f7;
&:deep(.van-field__body) {
align-items: center;
}
&:deep(.van-field__button) {
display: flex;
align-items: center;
margin-left: 8px;
}
&:deep(.van-field__label) { &:deep(.van-field__label) {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
} }
&:deep(.van-button--default) { &:deep(.login-send-code-btn.van-button) {
padding: 0; height: auto !important;
font-size: 13px; min-height: 0 !important;
color: transparent; padding: 0 !important;
background: transparent; line-height: 1.25 !important;
border: none; border: none !important;
background: transparent !important;
}
&:deep(.login-send-code-btn.van-button--disabled) {
opacity: 1;
background: transparent !important;
} }
} }
</style> </style>
......
<script setup lang="ts"> <script setup lang="ts">
import { useDeviceLayout } from "@/composables/useDeviceLayout"; // Pad 与手机共用同一套 UI,由全局 #app max-width + margin 居中;避免 LoginPad 单独放大字号(如 text-[40px])
import LoginMobile from "./LoginMobile.vue"; import LoginMobile from "./LoginMobile.vue";
import LoginPad from "./LoginPad.vue";
const { isPad } = useDeviceLayout();
</script> </script>
<template> <template>
<LoginPad v-if="isPad" /> <LoginMobile />
<LoginMobile v-else />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onActivated, onMounted, ref, watch } from "vue"; import { computed, onActivated, onMounted, ref, watch } from "vue";
import type { InspectDetailAccount } from "@/api/modules/user";
import { getInspectDetail } from "@/api/modules/user"; import { getInspectDetail } from "@/api/modules/user";
import PageTop from "@/components/PageTop.vue"; import PageTop from "@/components/PageTop.vue";
import { useUserStore } from "@/stores"; import { useUserStore } from "@/stores";
...@@ -9,21 +10,39 @@ import { showToast } from "vant"; ...@@ -9,21 +10,39 @@ import { showToast } from "vant";
const userStore = useUserStore(); const userStore = useUserStore();
const avgInspectCost = ref<number>(0); const avgInspectCost = ref<number>(0);
const inspectAccount = ref<InspectDetailAccount | null>(null);
const avgInspectCostText = computed(() => `${avgInspectCost.value || 0}秒`); const avgInspectCostText = computed(() => `${avgInspectCost.value || 0}秒`);
const displayName = computed(() =>
userStore.isLoggedIn ? inspectAccount.value?.name || userStore.username : ""
);
const displayPhone = computed(() =>
userStore.isLoggedIn ? inspectAccount.value?.phone || userStore.userInfo?.phone || "" : ""
);
const displayAvatar = computed(() =>
userStore.isLoggedIn
? inspectAccount.value?.avatar || userStore.userInfo?.avatar || ""
: ""
);
async function fetchInspectDetail() { async function fetchInspectDetail() {
if (!userStore.isLoggedIn) { if (!userStore.isLoggedIn) {
avgInspectCost.value = 0; avgInspectCost.value = 0;
inspectAccount.value = null;
return; return;
} }
try { try {
const detail = await getInspectDetail(); const detail = await getInspectDetail();
inspectAccount.value = detail.account ?? null;
avgInspectCost.value = Number(detail.inspectorSimpleSummary?.avgInspectCost || 0); avgInspectCost.value = Number(detail.inspectorSimpleSummary?.avgInspectCost || 0);
} catch (error) { } catch (error) {
console.error("getInspectDetail error", error); console.error("getInspectDetail error", error);
avgInspectCost.value = 0; avgInspectCost.value = 0;
inspectAccount.value = null;
} }
} }
...@@ -34,6 +53,7 @@ function onLogin() { ...@@ -34,6 +53,7 @@ function onLogin() {
async function onLogout() { async function onLogout() {
userStore.logout(); userStore.logout();
avgInspectCost.value = 0; avgInspectCost.value = 0;
inspectAccount.value = null;
showToast("已退出登录"); showToast("已退出登录");
} }
...@@ -58,7 +78,7 @@ watch( ...@@ -58,7 +78,7 @@ watch(
fit="cover" fit="cover"
height="44" height="44"
round round
:src="userStore.userInfo?.avatar || ''" :src="displayAvatar"
width="44" width="44"
@click="!userStore.isLoggedIn && onLogin()"> @click="!userStore.isLoggedIn && onLogin()">
<template #error> <template #error>
...@@ -70,7 +90,7 @@ watch( ...@@ -70,7 +90,7 @@ watch(
<div class="user-text"> <div class="user-text">
<div v-if="userStore.isLoggedIn" class="name"> <div v-if="userStore.isLoggedIn" class="name">
{{ userStore.username }} {{ displayName }}
</div> </div>
<div v-else <div v-else
class="name" class="name"
...@@ -78,7 +98,7 @@ watch( ...@@ -78,7 +98,7 @@ watch(
点击登录 点击登录
</div> </div>
<div class="phone"> <div class="phone">
{{ userStore.isLoggedIn ? userStore.userInfo?.phone : "" }} {{ displayPhone }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -3,55 +3,15 @@ import { computed, onMounted, ref } from "vue"; ...@@ -3,55 +3,15 @@ import { computed, onMounted, ref } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { getWorkOrderDetail } from "@/api/modules/work-order"; import { getWorkOrderDetail } from "@/api/modules/work-order";
import type {
type WorkOrderStatus = 1 | 2 | 3 | 4; InspectionWORespVO,
NodeVO,
VehicleCover,
interface VehicleCover { WorkOrderBaseInfo,
thumbUrl?: null | string; WorkOrderDetailRemote,
url?: null | string; WorkOrderVehicle,
thumbPath?: null | string; } from "@/types/views/word-order-detail";
filePath?: null | string; import type { WorkOrderStatus } from "@/types/views/work-order-common";
}
interface WorkOrderBaseInfo {
licensePlate?: string;
carTypeName?: string;
vin?: string;
carBrand?: string;
carSeriesName?: string;
}
interface WorkOrderVehicle {
baseInfo?: WorkOrderBaseInfo;
venue?: { address?: string };
ownership?: { carCityName?: string; carProvinceName?: string; };
cover?: VehicleCover;
custodianInfo?: { custodianName?: string; custodianPhone?: string };
}
interface NodeVO {
nodeId: number;
nodeName: string;
count: number;
status?: number;
nodeStatus?: number;
}
interface InspectionWORespVO {
woId?: string;
status?: WorkOrderStatus;
woTime?: string;
inspectionAddress?: string;
updateTime?: string;
inspectionCompletedTime?: string;
vehicle?: WorkOrderVehicle;
}
interface WorkOrderDetailRemote {
inspectionWORespVO?: InspectionWORespVO;
nodeVOList?: NodeVO[];
}
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"paths": { "paths": {
"@/*": ["src/*"], "@/*": ["src/*"],
"@api": ["src/api/index.ts"],
"@assets/*": ["src/assets/*"], "@assets/*": ["src/assets/*"],
"@views/*": ["src/views/*"], "@views/*": ["src/views/*"],
"@components/*": ["src/components/*"], "@components/*": ["src/components/*"],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!