Commit 1d19bad4 by yancanhua

fix: 检测编辑页面开发

1 parent c1b8458e
......@@ -14,12 +14,13 @@
"@types/lodash-es": "^4.17.12",
"ant-design-vue": "~4.2.1",
"axios": "~1.7.6",
"image-conversion": "^2.1.1",
"china-area-data": "^5.0.1",
"clipboard": "^2.0.11",
"core-js": "^3.6.5",
"dayjs": "^1.10.7",
"echarts": "^5.2.2",
"glsk-oss-jssdk": "^1.0.6",
"image-conversion": "^2.1.1",
"ionicons": "^8.0.9",
"lib": "file:../lib",
"lodash-es": "^4.17.21",
......@@ -59,8 +60,8 @@
"vite": "^5.3.3",
"vite-svg-loader": "^5.1.0"
},
"volta":{
"node":"16.20.2"
"volta": {
"node": "16.20.2"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5"
......
......@@ -95,4 +95,21 @@ export class DetectionController {
static inspectOrderAudit(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/wo/audit', params);
}
static inspectionTemplate(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('inspectionTemplate/' + params.id +'/rootNodes', params);
}
static inspectionTemplateDefault(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspectionTemplate/default', params);
}
static getCarTypeList(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('ropApi/getCarTypeList?csId=' + params.csId, params);
}
static inspectionNode(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('inspectionNode/' + params.id +'/children?taskId='+params.taskId);
}
}
export const OSS_CONFIG = {
BUCKET_NAME: "glsk-oss",
OSS_DOMAIN: "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com",
FOLDER: "usedCarH5/",
/**
* glsk-oss-jssdk 需要的 systemSource(会传给 STS 凭证接口)
* H5 默认用 h5,按你们接口约定调整
*/
SYSTEM_SOURCE: "h5",
} as const;
import { OSS_CONFIG } from "@/config/oss.ts";
import GlOssApi from "glsk-oss-jssdk";
let ossApi = null;
function getOssApi() {
if (!ossApi) ossApi = new GlOssApi();
return ossApi;
}
/**
* 使用 glsk-oss-jssdk 分片上传到 OSS。
*
* @param {File} file
* @param {{
* bucketName?: string,
* dir?: string,
* custAttrObj?: Record<string, any>,
* partSizeKB?: number,
* maxRetries?: number
* }} [options]
* @returns {Promise<any>} SDK 返回结果(含 aliyunAddress/attachment 等字段)
*/
export function uploadFile(file, options = {}) {
if (!file) return Promise.reject(new Error("file 不能为空"));
const api = getOssApi();
const bucketName = options.bucketName ?? OSS_CONFIG.BUCKET_NAME;
const dir = options.dir ?? OSS_CONFIG.FOLDER;
const custAttrObj =
options.custAttrObj ?? { systemSource: OSS_CONFIG.SYSTEM_SOURCE };
const partSizeKB = options.partSizeKB ?? 500;
const maxRetries = options.maxRetries ?? 3;
return new Promise((resolve, reject) => {
api.multipartUpload(
file,
(res) => resolve(res),
(err) => reject(err),
bucketName,
dir,
custAttrObj,
{},
partSizeKB,
maxRetries
);
});
}
/**
* 批量上传
* @param {File[]} files
* @param {Parameters<typeof uploadFile>[1]} [options]
*/
export function uploadFiles(files, options = {}) {
if (!Array.isArray(files) || files.length === 0) {
return Promise.reject(new Error("files 不能为空"));
}
return Promise.all(files.map((f) => uploadFile(f, options)));
}
<template>
<div>
<h1>编辑检测报告</h1>
<div class="pageBox_title">
编辑检测报告
<a-button style="float: right;" @click="handleBack()">返回列表</a-button>
</div>
<InformationEdit ref="informationEditRef" :pageData="pageData.inspectionWORespVO || {}" />
<div class="optionBox">
<div v-for="item in nodeList" @click="handleNodeList(item)" :key="item.id"
:class="{ 'optionBut_active': item.id == activeNodeId }" class="optionBut">
{{ item.nodeName }}
</div>
</div>
<div class="customizeFormBox">
<CustomizeForm ref="customizeFormRef" />
</div>
</div>
</template>
\ No newline at end of file
</template>
<script lang="ts">
import { Component } from 'vue-facing-decorator';
import { PaginationComponent } from "@/components/PaginationComponent";
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
import InformationEdit from "@/views/detection/order/components/InformationEdit.vue";
import CustomizeForm from "@/views/detection/order/components/CustomizeForm.vue";
import { DetectionController } from "@/api/DetectionController";
@Component({
components: { InformationEdit, CustomizeForm }
})
export default class DetectionOrderEdit extends PaginationComponent<Vehicle> {
pageData: any = {};
defaultData: any = {};
nodeList: any = [];
activeNodeId: number = null;
carTypeList: any = [];
inspectionNodeList: any = [];
created(): void {
this.getDetailData();
this.getTemplateData();
this.getDefaultTemplate();
}
getDetailData() {
const routeData = this.$route.query || {};
let postData = { workOrderId: routeData.id }
DetectionController.inspectOrderDetail(this.axios, postData).then(response => {
this.pageData = response.data.data || {};
});
}
getTemplateData() {
const routeData = this.$route.query || {};
DetectionController.inspectionTemplate(this.axios, { id: routeData.id }).then(response => {
this.nodeList = (response?.data?.data || []).filter(item => item.nodeName);
this.activeNodeId = this.nodeList[0].id || null;
this.getInspectionNodeData(this.activeNodeId);
});
}
getDefaultTemplate() {
const routeData = this.$route.query || {};
DetectionController.inspectionTemplateDefault(this.axios, { taskId: routeData.id }).then(response => {
this.defaultData = response?.data?.data || {};
this.getCarTypeList(this.defaultData.carSeriesId);
});
}
getCarTypeList(id) {
DetectionController.getCarTypeList(this.axios, { csId: id }).then(response => {
const data = response?.data?.data || {};
this.carTypeList = data.carinfos || [];
console.log(this.carTypeList);
});
}
getInspectionNodeData(taskId) {
const routeData = this.$route.query || {};
DetectionController.inspectionNode(this.axios, { id: taskId, taskId: routeData.id }).then(response => {
const nodeList = response?.data?.data || [];
if (taskId == 48) {
this.inspectionNodeList = [{
id: 48,
nodeName: "车型信息",
childrenNodes: nodeList
}];
} else if (taskId == 60) {
this.inspectionNodeList = [{
id: 60,
nodeName: "车身主图",
childrenNodes: nodeList
}];
} else if (taskId == 551) {
this.inspectionNodeList = [{
id: 551,
nodeName: "工况视频",
childrenNodes: nodeList
}];
} else {
this.inspectionNodeList = nodeList;
}
this.$refs.customizeFormRef.init({
customizeFormList: this.inspectionNodeList,
});
});
}
handleNodeList(item: any) {
this.activeNodeId = item.id;
this.getInspectionNodeData(this.activeNodeId);
}
handleBack() {
this.$router.back();
}
}
</script>
<style scoped lang="less">
.pageBox_title {
width: 100%;
height: 24px;
float: left;
color: #202020;
font-size: 16px;
font-weight: 700;
line-height: 24px;
margin-top: 16px;
margin-bottom: 16px;
}
.optionBox {
width: 100%;
float: left;
margin-top: 24px;
margin-bottom: 4px;
}
.optionBut {
min-width: 76px;
padding: 0 24px;
height: 36px;
float: left;
line-height: 36px;
border-radius: 6px;
background: #f7f8f9;
color: #565d6b;
font-size: 14px;
font-weight: 400;
text-align: center;
margin-right: 12px;
margin-bottom: 12px;
cursor: pointer;
}
.optionBut_active {
background: #e8f0ff !important;
color: #1956fe !important;
}
.customizeFormBox {
width: 100%;
float: left;
}
</style>
\ No newline at end of file
......@@ -106,6 +106,11 @@
<a-button type="link" size="small">检测报告</a-button>
</router-link>
<router-link v-if="record.status != 3"
:to="{ path: '/detection/order/edit', query: { id: record.id, page: 'order', action: 'EDIT' } }">
<a-button type="link" size="small">编辑</a-button>
</router-link>
</template>
</template>
</a-table>
......
<template>
<div>
<a-form layout="vertical" :model="columnsList" ref="formRef">
<div v-for="columns in columnsList" :key="columns.id">
<title-divider :title="columns.nodeName"></title-divider>
<a-row>
<a-col v-for="item in (columns.childrenNodes || [])" :key="item.columnName"
:span="item.interactionType == 'image_upload_and_button_select' ? 24 : 8">
<a-form-item class="calc_24" :label="item.nodeName"
:rules="[{ required: (item.required === 1 || (item.interactionType == 'image_upload_and_button_select' && item.value)) ? true : false, message: item.placeholder }]">
<!-- 文本输入框 -->
<div v-if="item.interactionType == 'text_input'">
<a-input v-model:value="item.value" :placeholder="item.placeholder"
:maxlength="getValidationRules(item).maxLength || 120"
:disabled="item.editPermission == '0'" allow-clear />
</div>
<!-- 长文本输入框 -->
<div v-if="item.interactionType == 'textarea_input'">
<a-textarea v-model:value="item.value" type="textarea" :placeholder="item.placeholder"
:maxlength="getValidationRules(item).maxLength || 120"
:disabled="item.editPermission == '0'" :auto-size="{ minRows: 2, maxRows: 5 }"
show-word-limit show-count allow-clear />
</div>
<!-- 数字输入框 -->
<div v-if="item.interactionType == 'number_input'">
<a-input-number style="width: 100%;" v-model:value="item.value"
:min="getValidationRules(item).min || 0"
:max="getValidationRules(item).max || 100000"
:maxlength="getValidationRules(item).maxLength || 120" step="0.01"
:placeholder="item.placeholder" :disabled="item.editPermission == '0'"
@input="(e) => { item.value = parseFloat(item.value)?.toFixed(getValidationRules(item).decimalDigits || 2) || '' }"
:addon-after="item.suffix || ''" allow-clear />
</div>
<!-- 单选框 -->
<div v-if="item.interactionType == 'radio_button_select'">
<a-radio-group v-model:value="item.value">
<a-radio v-for="option in getOptionList(item)" :key="option.value"
:value="option.value">
{{ option.text }}
</a-radio>
</a-radio-group>
</div>
<!-- 日期选择器 -->
<div v-if="item.interactionType == 'date_picker'">
<a-date-picker
v-if="getValidationRules(item).datePattern && getValidationRules(item).datePattern.length > 8"
format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 100%;"
v-model:value="item.value" :placeholder="item.placeholder"
:disabled="item.editPermission == '0'" allow-clear />
<a-date-picker v-else style="width: 100%;" v-model:value="item.value" format="YYYY-MM"
value-format="YYYY-MM" picker="month" :placeholder="item.placeholder"
:disabled="item.editPermission == '0'" allow-clear />
</div>
<!-- 下拉选择器 -->
<div v-if="item.interactionType == 'dropdown'">
<a-select v-model:value="item.value" :placeholder="item.placeholder"
:disabled="item.editPermission == '0'" style="width: 100%;" allow-clear>
<a-select-option v-for="option in getOptionList(item)" :key="option.value"
:value="option.value">
{{ option.text }}
</a-select-option>
</a-select>
</div>
<!-- 按钮选择器 -->
<div v-if="item.interactionType == 'button_select'">
<CustomizeFormButtonSelect :columnsList="getOptionList(item)" :value="item.value"
@update="item.value = $event" />
</div>
<!-- 图片上传 -->
<div
v-if="item.interactionType == 'image_upload' || item.interactionType == 'video_upload'">
<CustomizeFormUploadFile :item="item" :value="item.value"
@update="item.value = $event" />
</div>
<!-- image_upload_and_button_select -->
<div v-if="item.interactionType == 'image_upload_and_button_select'">
<CustomizeFormButtonSelect :columnsList="getOptionList(item)" :value="item.value"
@update="item.value = $event" />
<CustomizeFormButtonSelectUploadFile v-if="item.value" :item="item" :value="item.value"
@update="item.uploadValue = $event" />
</div>
</a-form-item>
</a-col>
</a-row>
</div>
</a-form>
<div class="footer-submit">
<a-button type="primary" class="mr-10" @click="submitForm">保存</a-button>
<a-button @click="handleBack()">取消</a-button>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
import TitleDivider from "@/components/TitleDivider.vue";
import CustomizeFormButtonSelect from "@/views/detection/order/components/CustomizeFormButtonSelect.vue";
import CustomizeFormUploadFile from "@/views/detection/order/components/CustomizeFormUploadFile.vue";
import CustomizeFormButtonSelectUploadFile from "@/views/detection/order/components/CustomizeFormButtonSelectUploadFile.vue";
@Component({ components: { TitleDivider, CustomizeFormButtonSelect, CustomizeFormUploadFile, CustomizeFormButtonSelectUploadFile } })
export default class CustomizeForm extends Vue {
postData: any = {};
columnsList: any = [];
submitted: boolean = true;
//初始化数据
init(data) {
//重置表单数据
if (this.$refs.formRef && this.$refs.formRef.resetFields) {
this.$refs.formRef.resetFields();
}
this.columnsList = data.customizeFormList || [];
console.log('111111111111111111', this.columnsList);
}
getValidationRules(item: any) {
return JSON.parse(item.validationRules || "{}");
}
getOptionList(item: any) {
const optionsList = JSON.parse(item.options || "[]").map(item => {
const valueList = (item || "").split("-");
return {
text: valueList[1] || "",
value: valueList[0] || "",
};
});
return optionsList;
}
submitForm() {
this.$refs.formRef.validate().then((valid) => {
if (valid) {
console.log('11111111111111111xxxx1', this.columnsList);
}
});
}
handleBack() {
this.$router.back();
}
}
</script>
<style scoped lang="less">
.calc_24 {
width: -webkit-calc(100% - 24px);
width: -moz-calc(100% - 24px);
width: calc(100% - 24px);
position: relative;
}
.footer-submit {
width: 100%;
margin-top: 20px;
border-top: 1px solid #f2f4f7;
display: flex;
padding: 16px 0;
}
.selectBut {
position: relative;
float: left;
height: 36px;
margin-right: 6px;
margin-bottom: 12px;
margin-left: 6px;
font-size: 14px;
font-weight: 400;
line-height: 36px;
color: #333;
text-align: center;
cursor: pointer;
background: #f9f9f9;
border: 1px solid #f9f9f9;
border-radius: 6px;
padding: 0 16px;
min-width: 30%;
}
.pitchOn {
color: #185EFE !important;
background: #ecf1ff !important;
border: 1px solid #185efe !important;
}
</style>
\ No newline at end of file
<template>
<div>
<div class="selectList">
<div v-for="(col, index) in columnsList" :key="index" class="selectBut"
:class="{ 'pitchOn': pickerValue.includes(col.value) }" @click="handleBut(col)">
{{ col.text }}
<div v-if="pickerValue.includes(col.value)" class="pitchImg"></div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
@Component({ components: {} })
export default class CustomizeFormButtonSelect extends Vue {
@Prop({ default: () => [] })
columnsList: any = [];
pickerValue = []
handleBut(item: { value: string }) {
// if (item.value) {
// props.item.resultStatus = false;
// }
if (this.pickerValue.includes(item.value)) {
this.pickerValue = this.pickerValue.filter((i) => i !== item.value);
} else {
this.pickerValue.push(item.value);
}
this.setupdate();
}
setupdate() {
const valueList = (this.pickerValue || []).map(item => {
const object = (this.columnsList || []).find(finditem => finditem.value == item) || {};
return { valueText: object.text || "", valueKey: item || "" };
});
if (valueList.length > 0) {
this.$emit("update", JSON.stringify(valueList || []));
} else {
this.$emit("update", "");
}
}
}
</script>
<style scoped lang="less">
.buttonSelect {
float: left;
width: 100%;
background: #fff;
}
.title {
float: left;
width: 100%;
height: 24px;
padding-left: 16px;
margin-top: 16px;
margin-bottom: 10px;
font-size: 14px;
line-height: 24px;
color: #141e34;
}
.isRequired {
padding-right: 2px;
font-size: 14px;
color: #ee3040;
}
.selectList {
width: 100%;
}
.selectBut {
position: relative;
float: left;
min-width: 76px;
padding: 0 24px;
height: 36px;
margin-right: 6px;
margin-bottom: 12px;
margin-left: 6px;
font-size: 14px;
font-weight: 400;
line-height: 36px;
color: #333;
text-align: center;
cursor: pointer;
background: #f9f9f9;
border: 1px solid #f9f9f9;
border-radius: 6px;
}
.pitchOn {
color: #185EFE !important;
background: #ecf1ff !important;
border: 1px solid #185efe !important;
}
.pitchImg {
position: absolute;
top: 0;
right: 0;
z-index: 99;
width: 16px;
height: 16px;
background-image: url("https://img02.glsx.com.cn/aus/images/preference/pitchOn.png");
background-repeat: no-repeat;
background-size: 100%;
}
</style>
\ No newline at end of file
<template>
<div>
<div class="hidden-input">
<input ref="fileInputRef" accept="image/*" type="file" @change="onFileChange">
</div>
<div class="uploadPage">
<div v-if="(getValidationRules().maxCount || 3) > pickerValue.length" class="uploadBox"
@click="handlePickFile()">
<PlusOutlined class="plusBox" />
<div class="uploadTxt">
上传图片
</div>
</div>
<div v-for="(url, index) in pickerValue" :key="index" class="uploadBox">
<!-- 删除按钮 -->
<div class="deleteBox" title="点击删除" @click="handleDelete(url)">
<CloseCircleOutlined class="closeIcon" />
</div>
<!-- 图片 -->
<a-image class="uploadBoxImg" :src="url" />
</div>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
import { uploadFile } from "@/utils/upload.js";
import { PlusOutlined, CloseCircleOutlined } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
@Component({ components: { PlusOutlined, CloseCircleOutlined } })
export default class CustomizeFormUploadFile extends Vue {
@Prop({ default: () => { } })
item: any = {};
pickerValue: any = [];
getValidationRules() {
return JSON.parse(this.item.validationRules || "{}");
}
//点击上传文件
handlePickFile() {
this.$refs.fileInputRef?.click();
}
async onFileChange(ev: Event) {
const input = ev.target as HTMLInputElement;
const file = input.files?.[0];
input.value = "";
if (!file) return;
const maxSize10MB = 10 * 1024 * 1024;
const maxSize100MB = 100 * 1024 * 1024;
if (this.item.interactionType == "image_upload" && file.size > maxSize10MB) {
return message.error("文件大小不能超过10MB");
}
if (this.item.interactionType == "video_upload" && file.size > maxSize100MB) {
return message.error("文件大小不能超过100MB");
}
try {
const res = await uploadFile(file);
const url = (typeof res.aliyunAddress === "string" && res.aliyunAddress) || (typeof res.url === "string" && res.url) || "";
message.success("上传成功");
this.pickerValue.push(url);
this.updateData();
} catch (error: unknown) {
const msg = error instanceof Error ? error.message : String(error);
message.error(`上传失败:${msg}`);
} finally {
}
}
handleDelete(item: string) {
this.pickerValue = this.pickerValue.filter((i) => i !== item);
this.updateData();
}
updateData() {
if (this.pickerValue.length > 0) {
this.$emit("update", JSON.stringify(this.pickerValue));
} else {
this.$emit("update", "");
}
}
}
</script>
<style scoped lang="less">
.hidden-input {
position: absolute;
width: 0;
height: 0;
pointer-events: none;
opacity: 0;
}
.uploadPage {
float: left;
width: calc(100% - 24px);
margin-left: 12px;
}
.uploadBox {
position: relative;
float: left;
width: 88px;
height: 88px;
margin-right: 12px;
margin-bottom: 16px;
background: #f5f7fa;
border: 1px solid #e1e3e6;
border-radius: 6px;
cursor: pointer;
}
.plusBox {
float: left;
margin-top: 22px;
margin-right: 36px;
margin-left: 36px;
font-size: 12px;
color: #9BA3AD;
}
.closeIcon {
font-size: 20px;
color: #999999;
}
.uploadTxt {
float: left;
width: 100%;
height: 20px;
margin-top: 8px;
font-size: 12px;
font-weight: 400;
line-height: 20px;
color: #969aa3;
text-align: center;
}
.uploadBoxImg {
width: 100%;
height: 100%;
z-index: 9;
border-radius: 8px;
}
.deleteBox {
position: absolute;
top: 2px;
right: 2px;
z-index: 999;
width: 20px;
height: 20px;
cursor: pointer;
}
</style>
\ No newline at end of file
<template>
<div>
<div class="hidden-input">
<input ref="fileInputRef" :accept="item.interactionType == 'image_upload' ? 'image/*' : 'video/*'"
type="file" @change="onFileChange">
</div>
<div class="uploadPage">
<div v-if="(getValidationRules().maxCount || 3) > pickerValue.length" class="uploadBox"
@click="handlePickFile()">
<PlusOutlined class="plusBox" />
<div class="uploadTxt">
{{ item.interactionType == 'image_upload' ? '上传图片' : '上传视频' }}
</div>
</div>
<div v-for="(url, index) in pickerValue" :key="index" class="uploadBox">
<!-- 删除按钮 -->
<div class="deleteBox" title="点击删除" @click="handleDelete(url)">
<CloseCircleOutlined class="closeIcon" />
</div>
<!-- 图片 -->
<a-image v-if="item.interactionType == 'image_upload'" class="uploadBoxImg" :src="url" />
<!-- 视频 -->
<video v-if="item.interactionType == 'video_upload'" class="uploadBoxImg" controls :src="url">
您的浏览器不支持 video 标签。
</video>
<!-- 点击视频预览 -->
<div v-if="item.interactionType == 'video_upload'" @click="previewVideo(url)" class="videoPreviewBox">
</div>
</div>
</div>
<!-- 视频预览弹窗 -->
<a-modal v-model:open="videoVisible" title="视频播放" :width="760">
<div style="width: 100%; height: 680px;overflow: auto;">
<video style="width: 100%;height: 660px;" controls :src="videoUrl">
您的浏览器不支持 video 标签。
</video>
</div>
<template #footer></template>
</a-modal>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
import { uploadFile } from "@/utils/upload.js";
import { PlusOutlined, CloseCircleOutlined } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
@Component({ components: { PlusOutlined, CloseCircleOutlined } })
export default class CustomizeFormUploadFile extends Vue {
@Prop({ default: () => { } })
item: any = {};
pickerValue: any = [];
videoVisible: boolean = false;
videoUrl: string = "";
getValidationRules() {
return JSON.parse(this.item.validationRules || "{}");
}
//点击上传文件
handlePickFile() {
this.$refs.fileInputRef?.click();
}
async onFileChange(ev: Event) {
const input = ev.target as HTMLInputElement;
const file = input.files?.[0];
input.value = "";
if (!file) return;
const maxSize10MB = 10 * 1024 * 1024;
const maxSize100MB = 100 * 1024 * 1024;
if (this.item.interactionType == "image_upload" && file.size > maxSize10MB) {
return message.error("文件大小不能超过10MB");
}
if (this.item.interactionType == "video_upload" && file.size > maxSize100MB) {
return message.error("文件大小不能超过100MB");
}
try {
const res = await uploadFile(file);
const url = (typeof res.aliyunAddress === "string" && res.aliyunAddress) || (typeof res.url === "string" && res.url) || "";
message.success("上传成功");
this.pickerValue.push(url);
this.updateData();
} catch (error: unknown) {
const msg = error instanceof Error ? error.message : String(error);
message.error(`上传失败:${msg}`);
} finally {
}
}
handleDelete(item: string) {
this.pickerValue = this.pickerValue.filter((i) => i !== item);
this.updateData();
}
updateData() {
if (this.pickerValue.length > 0) {
this.$emit("update", JSON.stringify(this.pickerValue));
} else {
this.$emit("update", "");
}
}
previewVideo(url: string) {
const timestamp = new Date().getTime();
const urlWithTimestamp = url.includes('?') ? `${url}&t=${timestamp}` : `${url}?t=${timestamp}`;
this.videoUrl = urlWithTimestamp;
this.videoVisible = true;
}
}
</script>
<style scoped lang="less">
.hidden-input {
position: absolute;
width: 0;
height: 0;
pointer-events: none;
opacity: 0;
}
.uploadPage {
float: left;
width: calc(100% - 24px);
margin-left: 12px;
}
.uploadBox {
position: relative;
float: left;
width: 88px;
height: 88px;
margin-right: 12px;
margin-bottom: 16px;
background: #f5f7fa;
border: 1px solid #e1e3e6;
border-radius: 6px;
cursor: pointer;
}
.plusBox {
float: left;
margin-top: 22px;
margin-right: 36px;
margin-left: 36px;
font-size: 12px;
color: #9BA3AD;
}
.closeIcon {
font-size: 20px;
color: #999999;
}
.uploadTxt {
float: left;
width: 100%;
height: 20px;
margin-top: 8px;
font-size: 12px;
font-weight: 400;
line-height: 20px;
color: #969aa3;
text-align: center;
}
.uploadBoxImg {
width: 100%;
height: 100%;
z-index: 9;
border-radius: 8px;
}
.deleteBox {
position: absolute;
top: 2px;
right: 2px;
z-index: 999;
width: 20px;
height: 20px;
cursor: pointer;
}
.videoPreviewBox {
position: absolute;
top: 0px;
left: 0;
width: 88px;
height: 88px;
background: rgba(0, 0, 0, 0.5);
opacity: 0.1;
z-index: 9;
}
</style>
\ No newline at end of file
<template>
<div class="InformationBox">
<a-card class="tabs-card" :bordered="false">
<a-descriptions :column="6" size="small" layout="vertical">
<template #title>
报告基本信息
</template>
<a-descriptions-item label="报告编号">-</a-descriptions-item>
<a-descriptions-item label="工单编号">{{ pageData?.woId || '-' }}</a-descriptions-item>
<a-descriptions-item label="检测模板">燃油车通用检测模板V1.0</a-descriptions-item>
<a-descriptions-item label="车辆信息">
{{ pageData.vehicle?.baseInfo?.carSeriesName }} {{ pageData.vehicle?.baseInfo?.carTypeName || '-' }}
</a-descriptions-item>
<a-descriptions-item label="VIN码">
{{ pageData.vehicle?.baseInfo?.vin || '-' }}
</a-descriptions-item>
<a-descriptions-item label="车牌号">
{{ pageData.vehicle?.baseInfo?.licensePlate || '-' }}
</a-descriptions-item>
</a-descriptions>
</a-card>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-facing-decorator";
@Component({ components: {} })
export default class InformationEdit extends Vue {
@Prop({ type: Object, required: true })
pageData: any;
}
</script>
<style scoped lang="less">
.InformationBox {
width: 100%;
padding: 0 24px;
float: left;
border-radius: 8px;
background: linear-gradient(56.9deg, #e6f6ff 0%, #f0f6ff 28.999999999999996%, #f0f6ff 60%, #e3f1ff 100%);
}
.tabs-card {
background: linear-gradient(56.9deg, #e6f6ff 0%, #f0f6ff 28.999999999999996%, #f0f6ff 60%, #e3f1ff 100%);
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!