123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>车辆诊断报告</title>
- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
- <style>
- body {
- font-family: Arial, sans-serif;
- }
- h1, h2, h3 {
- margin-top: 20px;
- }
- /* 诊断报告标题 */
- .report-title {
- font-size: 28px; /* 调整字体大小 */
- font-weight: bold;
- color: #365697;
- text-align: center;
- }
- /* 时间 */
- .report-time {
- font-size: 20px; /* 调整字体大小 */
- color: #365697;
- text-align: center;
- }
- .vehicle-info, .diagnosis-details, .company-info {
- margin-top: 20px;
- background-color: #EBF1FA;
- border-radius: 5px;
- padding: 10px;
- }
- .vehicle-info h2{
- background-color: #406DB7;
- color: #FFFFFF;
- font-size: 24px; /* 调整字体大小 */
- font-weight: bold;
- text-align: center;
- margin: 0 auto;
- padding: 10px;
- width: 120px;
- border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
- }
- .fan h3{
- background-color: #406DB7;
- color: #FFFFFF;
- font-size: 24px; /* 调整字体大小 */
- font-weight: bold;
- text-align: center;
- padding: 10px;
- width: 500px;
- margin-top: 40px;
- margin-left: -10px;
- border-top-right-radius: 8px; /* 设置顶部右上角的圆角半径为20像素 */
- }
- .diagnosis-details h2, .company-info h2 {
- background-color: #406DB7;
- color: #FFFFFF;
- font-size: 24px; /* 调整字体大小 */
- font-weight: bold;
- text-align: center;
- padding: 10px;
- width: 120px;
- margin: 0 auto;
- border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
- }
- ul {
- list-style-type: none;
- padding-left: 0;
- font-size: 20px; /* 调整字体大小 */
- color: #e50909;
- }
- li {
- margin-bottom: 5px;
- }
- .diagnosis-details {
- margin-top: 10px;
- }
- .diagnosis-details h2 {
- margin-top: -10px;
- align-content: center;
- }
- .diagnosis-details table, .diagnosis-details th, .diagnosis-details td {
- border-collapse: collapse;
- padding: 8px;
- text-align: left;
- font-size: 20px; /* 调整字体大小 */
- color: #000000;
- }
- .diagnosis-details th, .diagnosis-details td {
- border: none;
- left:500px;
- }
- .diagnosis-details ul {
- margin-left: 0; /* 防止默认的列表缩进 */
- }
- .diagnosis-details ul li {
- padding-left: 0; /* 防止列表项内的额外缩进 */
- }
- .company-info {
- margin-top: 10px;
- padding: 10px;
- background-color: #EBF1FA;
- border-radius: 5px;
- }
- .company-info p {
- font-size: 20px; /* 调整字体大小 */
- color: #888888;
- }
- .company-info tr {
- font-size: 20px; /* 调整字体大小 */
- color: #000000;
- }
- .company-info td{
- color: #888888;
- font-size: 20px;
- }
- .vehicle-info table {
- font-size: 20px; /* 调整车辆信息表格内字体大小 */
- }
- .disclaimer {
- font-size: 16px; /* 调整字体大小 */
- color: #888888;
- margin-left: 10px;
- margin-top: 10px;
- }
- /* 添加样式以美化页面 */
- .edit-form {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background-color: #f9f9f9;
- padding: 20px;
- border: 1px solid #ccc;
- border-radius: 5px;
- z-index: 9999;
- }
- #vinInput{
- background-color: #ECF1FA;
- }
- #yearInput{
- background-color: #ECF1FA;
- }
- #mileageInput{
- background-color: #ECF1FA;
- }
- #companyInput{
- background-color: #ECF1FA;
- }
- #phoneInput{
- background-color: #ECF1FA;
- }
- #addressInput{
- background-color: #ECF1FA;
- }
- </style>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
- <script src="https://wl-resource.obs.cn-south-1.myhuaweicloud.com/static/axios.min.js"></script>
- </head>
- <body>
- <div class="vehicle-info">
- <h1 class="report-title">诊断报告</h1>
- <p class="report-time">- ${reportTime} -</p>
- </div>
- <#list controlListMap as controlMap>
- <div class="vehicle-info">
- <div>
- <h2>车辆信息</h2>
- <img src="https://wl-resource.obs.cn-south-1.myhuaweicloud.com/static/img.png"
- height="30" width="30"
- style="float: right; margin: 0 0 10px 10px; cursor: pointer;"
- onclick="editCell()">
- </div>
- <table>
- <tr>
- <td>车架号:</td>
- <td id="vin" style="padding-left: 180px">
- <#if baseMap["车架号"]?has_content>
- ${baseMap["车架号"]}
- <#else>
- </#if>
- </td>
- </tr>
- <tr>
- <td>年款:</td>
- <td id="year" style="padding-left: 180px">
- <#if baseMap["年款"]?has_content>
- ${baseMap["年款"]}
- <#else>
- </#if>
- </td>
- </tr>
- <tr>
- <td>里程:</td>
- <td id="mileage" style="padding-left: 180px">
- <#if baseMap["里程"]?has_content>
- ${baseMap["里程"]}
- <#else>
- </#if>
- </td>
- </tr>
- <tr>
- <td>诊断路径:</td>
- <td style="padding-left: 180px">${baseMap["诊断路径"]}</td>
- </tr>
- <tr>
- <td>报告编号:</td>
- <td style="padding-left: 180px">${baseMap["报告编号"]}</td>
- </tr>
- <tr>
- <td>SN:</td>
- <td style="padding-left: 180px">${baseMap["SN"]}</td>
- </tr>
- </table>
- </div>
- <div class="diagnosis-details">
- <h2>诊断详情</h2>
- <div style="display: flex;"><div class="fan"><h3>${controlMap.getName()}</h3></div>
- <div style="margin-top: 83px;width: 10000px;margin-right: 50px" ><hr color="#406DB7"></div></div>
- <table>
- <div class="company-info">
- <p>故障码(
- <#if controlMap.getFaultCodeMap()?size != 0 >
- ${controlMap.getFaultCodeMap()?size}
- <#else>
- 0
- </#if>
- )</p>
- </div>
- <tr>
- <td>
- <ul>
- <#list controlMap.getFaultCodeMap()?keys as key>
- <li>${key}:</li>
- <p></p>
- </#list>
- </ul>
- </td>
- <td style="padding-left: 180px">
- <ul>
- <#list controlMap.getFaultCodeMap()?values as value>
- <li>${value}</li>
- <p></p>
- </#list>
- </ul>
- </td>
- </tr>
- </table>
- <div class="vehicle-info">
- <p>版本信息(
- <#if controlMap.getVersionMap()?size != 0 >
- ${controlMap.getVersionMap()?size}
- <#else>
- 0
- </#if>
- )</p>
- </div>
- <table>
- <#list controlMap.getVersionMap()?keys as key>
- <tr>
- <td>${key}</td>
- <td style="padding-left: 190px">${controlMap.getVersionMap()[key]}</td>
- </tr>
- </#list>
- </table>
- </div>
- </#list>
- <div class="company-info">
- <img src="https://wl-resource.obs.cn-south-1.myhuaweicloud.com/static/img.png"
- height="30" width="30"
- style="float: right; margin: 0 0 10px 10px; cursor: pointer;"
- onclick="editCellFoot()">
- <table>
- <tr>
- <td>公司:</td>
- <td id="company" style="padding-left: 180px">
- <#if companyMap["公司"]?has_content>
- ${companyMap["公司"]}
- <#else>
- </#if>
- </td>
- </tr>
- <tr>
- <td>电话:</td>
- <td id="phone" style="padding-left: 180px">
- <#if companyMap["电话"]?has_content>
- ${companyMap["电话"]}
- <#else>
- </#if>
- </td>
- </tr>
- <tr>
- <td>地址:</td>
- <td id="address" style="padding-left: 180px">
- <#if companyMap["地址"]?has_content>
- ${companyMap["地址"]}
- <#else>
- </#if>
- </td>
- </tr>
- </table>
- <p STYLE="font-size: 15px"><text style="color: red">*</text>该车辆检测报告仅对本次检查结果负责</p>
- </div>
- <script>
- function editCell() {
- var vin = document.getElementById('vin');
- var year = document.getElementById('year');
- var mileage = document.getElementById('mileage');
- var vinText = vin.innerText;
- var yearText = year.innerText;
- var mileageText = mileage.innerText;
- vin.innerHTML = '<input type="text" id="vinInput" value="' + vinText + '" onblur="saveChanges(\'vin\', this.value)">';
- year.innerHTML = '<input type="text" id="yearInput" value="' + yearText + '" onblur="saveChanges(\'year\', this.value)">';
- mileage.innerHTML = '<input type="text" id="mileageInput" value="' + mileageText + '" onblur="saveChanges(\'mileage\', this.value)">';
- }
- function saveChanges(field,value) {
- if (value==''){
- return
- }
- var input = document.getElementById(field);
- var id = ${id};
- // 这里可以进行保存操作,比如向服务器发送请求保存数据修改
- // 保存完成后可以进行一些提示或其他操作
- // 使用 Axios 发送 POST 请求
- axios.post('http://47.113.197.148:8888/app/diagnosis/report/updateBase', {
- id: id,
- type: field,
- value: value,
- }, {
- withCredentials: true, // 启用跨域支持
- })
- .then(function (response) {
- if (response.data.code == 200) {
- swal("修改成功!", "", "success");
- // 最后销毁输入框,恢复文本
- input.innerHTML = value;
- } else {
- swal("修改失败!", "", "fail");
- }
- })
- .catch(function (error) {
- console.error(error);
- });
- }
- function editCellFoot() {
- var address = document.getElementById('address');
- var company = document.getElementById('company');
- var phone = document.getElementById('phone');
- var addressText = address.innerText;
- var companyText = company.innerText;
- var phoneText = phone.innerText;
- address.innerHTML = '<input type="text" id="addressInput" value="' +
- addressText + '" onblur="saveChangesFoot(\'address\', this.value)">';
- company.innerHTML = '<input type="text" id="companyInput" value="'
- + companyText + '" onblur="saveChangesFoot(\'company\', this.value)">';
- phone.innerHTML = '<input type="text" id="phoneInput" value="' +
- phoneText + '" onblur="saveChangesFoot(\'phone\', this.value)">';
- }
- function saveChangesFoot(field,value) {
- if (value == '') {
- return
- }
- var input = document.getElementById(field);
- var id = ${id};
- axios.post('http://116.205.227.91:8888/app/diagnosis/report/updateCompany', {
- id: id,
- type: field,
- value: value,
- }, {
- withCredentials: true, // 启用跨域支持
- })
- .then(function (response) {
- if (response.data.code == 200) {
- swal("修改成功!", "", "success");
- // 最后销毁输入框,恢复文本
- input.innerHTML = value;
- } else {
- swal("修改失败!", "", "fail");
- }
- })
- .catch(function (error) {
- console.error(error);
- });
- }
- </script>
- </body>
- </html>
|