Commit e4da02fb by chenwq1

fix: 修改上传的图片格式化

1 parent 3b39c7dc
No preview for this file type
......@@ -20,7 +20,7 @@
"core-js": "^3.6.5",
"dayjs": "^1.10.7",
"echarts": "^5.2.2",
"glsk-oss-jssdk": "^1.0.6",
"glsk-oss-jssdk": "^1.0.7",
"image-conversion": "^2.1.1",
"ionicons": "^8.0.9",
"lib": "file:../lib",
......
......@@ -45,8 +45,8 @@ importers:
specifier: ^5.2.2
version: 5.6.0
glsk-oss-jssdk:
specifier: ^1.0.6
version: 1.0.6
specifier: ^1.0.7
version: 1.0.7
image-conversion:
specifier: ^2.1.1
version: 2.1.1
......@@ -1826,8 +1826,8 @@ packages:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
glsk-oss-jssdk@1.0.6:
resolution: {integrity: sha512-uifUcPNbb6Roas0Dlx6LRldHPwU1yQqJbQRldUaNB+e6stFvn9XrsewCueNDUty3cZw4NCg3yao2WVCUm3T2Og==}
glsk-oss-jssdk@1.0.7:
resolution: {integrity: sha512-e5uQWWD+f8UJ/zE7F1qJi09YvSMhX3iAbglJuwOOstMv0aVulX8gA3tdn8zPruS0fxzqrcpE9BNhwnETuHbSpw==}
good-listener@1.2.2:
resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==}
......@@ -5014,7 +5014,7 @@ snapshots:
merge2: 1.4.1
slash: 3.0.0
glsk-oss-jssdk@1.0.6:
glsk-oss-jssdk@1.0.7:
dependencies:
ali-oss: 6.23.0
axios: 1.15.0
......
......@@ -199,6 +199,23 @@ export class DetectionController {
): Promise<AxiosResponse> {
return axios.post("inspectionRecord/completeInspection", params);
}
static inspectRecordSaveScore(
axios: AxiosStatic,
params: any,
): Promise<AxiosResponse> {
return axios.post("inspect/record/saveScore", params);
}
static inspectWoOpLogPage(
axios: AxiosStatic,
params: any,
): Promise<AxiosResponse> {
return axios.post("inspect/wo/opLog/" + params.workOrderId + "/page", {
offset: params.offset,
limit: params.limit,
});
}
static PAGE_INSPECTOR_REPORT_INSPECTOR = "inspectionTemplate/page";
static inspectionTemplatePage(
axios: AxiosStatic,
......
......@@ -20,5 +20,8 @@ export class TrackController{
static PAGE_VEHICLE_BROWSER_HISTORY = 'track/pageVehicleBrowserHistory';
// region 前端扩展代码区
static eventTrackingBatchSave(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('eventTracking/batchSave', params);
}
// endregion
}
import { AxiosStatic } from "axios";
import dayjs from "dayjs";
import { TrackController } from "@/api/TrackController";
export interface TrackUser {
id?: number | string;
name?: string;
fullName?: string;
authorities?: string[];
[k: string]: any;
}
export interface TrackBusinessKey {
businessType: string;
businessKey: string | number;
}
export type TrackParamType = "STRING" | "NUMBER" | "BOOLEAN" | "JSON";
export interface TrackParam {
paramKey: string;
paramValue: string;
paramType?: TrackParamType;
}
export interface TrackEventOptions {
eventCode: string;
user?: TrackUser;
duration?: number;
remark?: string;
businessKeys?: TrackBusinessKey[];
params?: TrackParam[];
}
interface EditContext {
reportId?: string | number;
vehicleId?: string | number;
workOrderId?: string | number;
[k: string]: any;
}
export class TrackHelper {
private static editStartTimestamp = 0;
private static editContext: EditContext = {};
static markEditStart() {
TrackHelper.editStartTimestamp = dayjs().unix();
}
static getEditStartTimestamp(): number {
return TrackHelper.editStartTimestamp;
}
static getEditDurationSeconds(): number {
if (!TrackHelper.editStartTimestamp) return 0;
const currentTimestamp = dayjs().unix();
const startTimestamp = TrackHelper.editStartTimestamp;
return Math.max(0, currentTimestamp - startTimestamp);
}
static clearEditStart() {
TrackHelper.editStartTimestamp = 0;
}
static setEditContext(ctx: EditContext) {
TrackHelper.editContext = { ...TrackHelper.editContext, ...ctx };
}
static getEditContext(): EditContext {
return TrackHelper.editContext;
}
static clearEditContext() {
TrackHelper.editContext = {};
}
private static toStringSafe(v: any): string {
if (v === null || v === undefined) return "";
return String(v);
}
private static buildUserParams(user?: TrackUser): TrackParam[] {
const u = user || {};
const roleName = Array.isArray(u.authorities)
? u.authorities.join(",")
: TrackHelper.toStringSafe((u as any).roleName);
return [
{ paramKey: "user_id", paramValue: TrackHelper.toStringSafe(u.id), paramType: "STRING" },
{ paramKey: "role_name", paramValue: roleName, paramType: "STRING" },
];
}
static send(axios: AxiosStatic, options: TrackEventOptions): Promise<any> {
const now = dayjs().format("YYYY-MM-DD HH:mm:ss");
const params = [
...TrackHelper.buildUserParams(options.user),
...(options.params || []),
];
const payload = {
events: [
{
eventCode: options.eventCode,
eventTime: now,
duration: options.duration || 0,
remark: options.remark || "",
businessKeys: options.businessKeys || [],
params,
},
],
};
return TrackController.eventTrackingBatchSave(axios, payload).catch((err) => {
console.warn("[track] event report failed", options.eventCode, err);
});
}
/** 计算两个对象之间值不同的字段名列表(浅比较,按需可扩展) */
static diffFieldNames(
before: Record<string, any> = {},
after: Record<string, any> = {},
): string[] {
const keys = new Set([...Object.keys(before || {}), ...Object.keys(after || {})]);
const changed: string[] = [];
keys.forEach((key) => {
const b = before?.[key];
const a = after?.[key];
if (TrackHelper.normalize(b) !== TrackHelper.normalize(a)) {
changed.push(key);
}
});
return changed;
}
static normalize(v: any): string {
if (v === null || v === undefined) return "";
if (typeof v === "object") return JSON.stringify(v);
return String(v);
}
}
......@@ -4,8 +4,8 @@ import GlOssApi from "glsk-oss-jssdk";
let ossApi = null;
function getOssApi() {
if (!ossApi) ossApi = new GlOssApi();
return ossApi;
if (!ossApi) ossApi = new GlOssApi();
return ossApi;
}
/**
......@@ -22,29 +22,30 @@ function getOssApi() {
* @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
);
});
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,
);
});
}
/**
......@@ -53,9 +54,21 @@ export function uploadFile(file, options = {}) {
* @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)));
if (!Array.isArray(files) || files.length === 0) {
return Promise.reject(new Error("files 不能为空"));
}
return Promise.all(files.map((f) => uploadFile(f, options)));
}
// 将图片进行格式转换。
async function format() {
try {
const result = await ossApi.get("example.jpg", "./example-format.jpg", {
process: "image/format,png",
});
} catch (e) {
console.log(e);
}
}
format();
......@@ -30,6 +30,7 @@ import CustomizeForm from "@/views/detection/order/components/CustomizeForm.vue"
import TestingScore from "@/views/detection/order/components/TestingScore.vue";
import { DetectionController } from "@/api/DetectionController";
import { CheckCircleFilled } from '@ant-design/icons-vue'
import { TrackHelper } from "@/common/TrackHelper";
@Component({
......@@ -48,16 +49,33 @@ export default class DetectionOrderEdit extends PaginationComponent<Vehicle> {
inspectionNodeList: any = [];
created(): void {
TrackHelper.markEditStart();
const q = this.$route.query || {};
TrackHelper.setEditContext({
workOrderId: q.id,
reportId: q.id,
});
this.getDetailData();
this.getTemplateData('1');
this.getDefaultTemplate();
}
unmounted(): void {
TrackHelper.clearEditStart();
TrackHelper.clearEditContext();
}
getDetailData() {
const routeData = this.$route.query || {};
let postData = { workOrderId: routeData.id }
DetectionController.inspectOrderDetail(this.axios, postData).then(response => {
this.pageData = response.data.data || {};
const wo = this.pageData?.inspectionWORespVO || {};
TrackHelper.setEditContext({
workOrderId: routeData.id,
reportId: routeData.id,
vehicleId: wo.vehicleId || wo.vehicle?.id || this.pageData?.vehicle?.id || "",
});
});
}
......
......@@ -108,7 +108,7 @@
<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>
<a-button type="link" size="small" @click="trackEnterEditMode(record)">编辑报告</a-button>
</router-link>
</template>
......@@ -136,6 +136,7 @@ import { ExportUtil } from "@/common/ExportUtil";
import { DetectionController } from "@/api/DetectionController";
import OrderAddForm from "@/views/detection/order/components/OrderAddForm.vue";
import cancelDialog from "@/views/detection/order/components/cancelDialog.vue";
import { TrackHelper } from "@/common/TrackHelper";
@Component({
components: { VehicleStateTag, OrderAddForm, cancelDialog }
......@@ -255,6 +256,24 @@ export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
this.$refs.orderAddFormRef.init(data);
}
// 点击【编辑报告】埋点
trackEnterEditMode(record: any) {
const reportId = record?.inspectionRecord?.reportId || record?.reportId || record?.id;
const vehicleId = record?.vehicle?.id || record?.vehicleId || "";
TrackHelper.send(this.axios, {
eventCode: "click_backend_enter_edit_mode",
user: this.$auth.getAuthentication(),
businessKeys: [
{ businessType: "REPORT", businessKey: String(reportId || "") },
],
params: [
{ paramKey: "report_id", paramValue: String(reportId || ""), paramType: "STRING" },
{ paramKey: "vehicle_id", paramValue: String(vehicleId || ""), paramType: "STRING" },
{ paramKey: "entry_point", paramValue: "work_order_detail", paramType: "STRING" },
],
});
}
// 取消工单
handleCancelOrder(data) {
this.$refs.cancelDialogRef.init(data);
......
......@@ -29,23 +29,13 @@
<a-descriptions :column="1" size="small" layout="vertical">
<template #title>
<div>
<div>
<title-tip-icon></title-tip-icon>
操作日志
</div>
<div @click="handleFold(false)" v-if="isShowFold" class="foldBox">收起
<DoubleLeftOutlined color="#666666" font-size="13px;"
style="transform: rotate(90deg);" />
</div>
<div @click="handleFold(true)" v-else class="foldBox">展开
<DoubleLeftOutlined color="#666666" font-size="13px;"
style="transform: rotate(270deg);" />
</div>
<title-tip-icon></title-tip-icon>
操作日志
</div>
<div class="title-line"></div>
</template>
<a-descriptions-item v-if="isShowFold" label="">
<OperationLog ref="operationLogRef" :operationLogData="pageData" />
<a-descriptions-item label="">
<OperationLog ref="operationLogRef" />
</a-descriptions-item>
</a-descriptions>
</div>
......@@ -66,11 +56,10 @@ import OperationLog from "@/views/detection/order/components/OperationLog.vue";
import orderReport from "@/views/detection/order/components/orderReport.vue";
import orderDetails from "@/views/detection/order/components/orderDetails.vue";
import reviewDialog from "@/views/detection/order/components/reviewDialog.vue";
import { DoubleLeftOutlined } from '@ant-design/icons-vue';
@Component({
components: { TitleDivider, TitleTipIcon, OperationLog, orderReport, orderDetails, reviewDialog, DoubleLeftOutlined }
components: { TitleDivider, TitleTipIcon, OperationLog, orderReport, orderDetails, reviewDialog }
})
......@@ -87,8 +76,6 @@ export default class DetectionOrderView extends PaginationComponent<Vehicle> {
pageData: any = {};
isShowFold: boolean = true;
get tabs() {
let tabs = [
{ key: "DETAIL", tab: "工单详情" },
......@@ -107,6 +94,10 @@ export default class DetectionOrderView extends PaginationComponent<Vehicle> {
this.getDetailData();
}
mounted(): void {
this.$refs.operationLogRef?.init(this.routeData.id);
}
getDetailData() {
let postDat = { workOrderId: this.routeData.id }
if (this.routeData.page == 'report') {
......@@ -121,10 +112,6 @@ export default class DetectionOrderView extends PaginationComponent<Vehicle> {
this.$refs.reviewDialogRef.showVisible({ ...this.pageData, status });
}
handleFold(isFold: boolean) {
this.isShowFold = isFold;
}
handleBack() {
this.$router.back();
}
......@@ -153,13 +140,4 @@ export default class DetectionOrderView extends PaginationComponent<Vehicle> {
margin-top: 16px;
margin-bottom: 16px;
}
.foldBox {
float: right;
color: #666666;
font-size: 13px;
font-weight: 400;
margin-top: -16px;
cursor: pointer;
}
</style>
\ No newline at end of file
......@@ -112,6 +112,7 @@ import CustomizeFormButtonSelectUploadFile from "@/views/detection/order/compone
import { CheckCircleFilled } from "@ant-design/icons-vue";
import { DetectionController } from "@/api/DetectionController";
import { message } from "ant-design-vue";
import { TrackHelper } from "@/common/TrackHelper";
@Component({ components: { TitleDivider, CustomizeFormButtonSelect, CustomizeFormUploadFile, CustomizeFormButtonSelectUploadFile, CheckCircleFilled } })
......@@ -124,6 +125,9 @@ export default class CustomizeForm extends Vue {
activeNodeId: string = '';
taskId: number = null;
initialLeafValues: Record<string, any> = {};
leafIdToName: Record<string, string> = {};
//初始化数据
init(data) {
//重置表单数据
......@@ -134,9 +138,79 @@ export default class CustomizeForm extends Vue {
this.carTypeList = data.carTypeList || [];
this.activeNodeId = data.activeNodeId || '';
this.taskId = data.taskId || '';
this.snapshotInitialValues();
console.log('111111111111111111initData', this.columnsList);
}
snapshotInitialValues() {
const leafMap: Record<string, any> = {};
const nameMap: Record<string, string> = {};
const walk = (nodes: any[] = []) => {
(nodes || []).forEach((node) => {
if (node?.childrenNodes && node.childrenNodes.length) {
walk(node.childrenNodes);
} else if (node?.id != null) {
leafMap[node.id] = TrackHelper.normalize(node.value);
nameMap[node.id] = node.nodeName || String(node.id);
}
});
};
walk(this.columnsList || []);
this.initialLeafValues = leafMap;
this.leafIdToName = nameMap;
}
collectModifiedFieldNames(): string[] {
const current: Record<string, any> = {};
const walk = (nodes: any[] = []) => {
(nodes || []).forEach((node) => {
if (node?.childrenNodes && node.childrenNodes.length) {
walk(node.childrenNodes);
} else if (node?.id != null) {
current[node.id] = TrackHelper.normalize(node.value);
}
});
};
walk(this.columnsList || []);
const changedIds = TrackHelper.diffFieldNames(this.initialLeafValues, current);
return changedIds.map((id) => this.leafIdToName[id] || String(id));
}
sendSaveTrack(modifiedFields: string[]) {
const ctx = TrackHelper.getEditContext();
TrackHelper.send(this.axios, {
eventCode: "click_backend_save_report",
user: this.$auth.getAuthentication(),
duration: TrackHelper.getEditDurationSeconds(),
businessKeys: [
{ businessType: "REPORT", businessKey: String(ctx.reportId || ctx.workOrderId || "") },
],
params: [
{ paramKey: "report_id", paramValue: String(ctx.reportId || ""), paramType: "STRING" },
{ paramKey: "vehicle_id", paramValue: String(ctx.vehicleId || ""), paramType: "STRING" },
{ paramKey: "modified_fields", paramValue: JSON.stringify(modifiedFields), paramType: "STRING" },
{ paramKey: "edit_duration", paramValue: String(TrackHelper.getEditDurationSeconds()), paramType: "STRING" },
],
});
}
sendCancelTrack() {
const ctx = TrackHelper.getEditContext();
TrackHelper.send(this.axios, {
eventCode: "click_backend_cancel_edit",
user: this.$auth.getAuthentication(),
duration: TrackHelper.getEditDurationSeconds(),
businessKeys: [
{ businessType: "REPORT", businessKey: String(ctx.reportId || ctx.workOrderId || "") },
],
params: [
{ paramKey: "report_id", paramValue: String(ctx.reportId || ""), paramType: "STRING" },
{ paramKey: "vehicle_id", paramValue: String(ctx.vehicleId || ""), paramType: "STRING" },
{ paramKey: "edit_duration", paramValue: String(TrackHelper.getEditDurationSeconds()), paramType: "STRING" },
],
});
}
getValidationRules(item: any) {
return JSON.parse(item.validationRules || "{}");
}
......@@ -161,11 +235,14 @@ export default class CustomizeForm extends Vue {
nextFlag: true,
modules
};
const modifiedFields = this.collectModifiedFieldNames();
DetectionController.inspectRecordSave(this.axios, postData).then(response => {
const res = response?.data || {};
if (res.code === "200") {
this.$emit('submitSuccess', res);
message.success(res.message || '保存成功');
this.sendSaveTrack(modifiedFields);
this.snapshotInitialValues();
} else {
message.error(res.message || '保存失败');
}
......@@ -283,7 +360,10 @@ export default class CustomizeForm extends Vue {
returnSpan(item: { interactionType: string }) {
return item.interactionType === 'image_upload_and_button_select' ? 24 : 8;
}
handleBack() { this.$router.back(); }
handleBack() {
this.sendCancelTrack();
this.$router.back();
}
}
......
<template>
<div class="logBox">
<div v-for="(item, index) in logList" :key="index" class="log-list">
<div ref="scrollBoxRef" class="logBox" @scroll="handleScroll">
<div v-for="(item, index) in logList" :key="item.id || index" class="log-list">
<div class="progressBox">
<div class="progressBox-point" :class="{ 'bg-1956fe': index > 0 }"></div>
<div v-if="alllist.length !== index + 1" class="progressBox-line"></div>
<div v-if="logList.length !== index + 1 || hasMore" class="progressBox-line"></div>
</div>
<div class="log-title">
<div v-if="item.description || item.operationContent" :title="item.description || item.operationContent" class="logBox-content">
{{ item.description || item.operationContent }}
</div>
<template v-if="item.description">
<a-popover
v-if="isChangeLog(item)"
trigger="hover"
placement="topLeft"
:overlay-class-name="'op-log-detail-popover'"
:overlay-style="{ maxWidth: '820px' }"
>
<template #content>
<a-table
:columns="detailColumns"
:data-source="item.detailItems"
:pagination="false"
:scroll="{ y: 280 }"
:row-key="(row) => row.logItemId"
size="small"
bordered
class="op-log-detail-table"
/>
</template>
<div :title="item.description" class="logBox-content with-detail">
{{ item.description }}
</div>
</a-popover>
<div v-else :title="item.description" class="logBox-content">
{{ item.description }}
</div>
</template>
<div class="logBox-time">
<div class="logBox-point" v-if="item.updateNameCnFirst">{{ item.updateNameCnFirst }}</div>
<div v-if="getFirstChar(item.operatorName)" class="logBox-point">
{{ getFirstChar(item.operatorName) }}
</div>
<span class="p-l-4">{{ item.operatorName }}</span>
<span class="p-l-8">{{ item.operationTime }}</span>
</div>
</div>
</div>
<div v-if="!isAllData" @click="handleMore()" class="moreBox">
查看更多
<DoubleLeftOutlined color="#666666" font-size="16px;" style="transform: rotate(270deg);" />
</div>
<div v-if="loading" class="statusBox">加载中...</div>
<div v-else-if="!hasMore && logList.length > 0" class="statusBox">已加载全部</div>
<div v-else-if="!loading && logList.length === 0" class="statusBox">暂无操作日志</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-facing-decorator";
import { DoubleLeftOutlined } from '@ant-design/icons-vue';
import { Component, Vue } from "vue-facing-decorator";
import { DetectionController } from "@/api/DetectionController";
@Component({ components: { DoubleLeftOutlined } })
@Component({ components: {} })
export default class OperationLog extends Vue {
@Prop({ type: Object, required: true })
operationLogData: any;
logList = [];
isAllData = false;
alllist = [];
@Watch('operationLogData', { deep: true, immediate: true })
watchOperationLogData(newValue: any, oldValue: any): void {
const list = (newValue.logList || []).map((item: any) => { return { ...item } });
if (list.length > 5) {
this.isAllData = false;
this.alllist = list;
this.logList = list.slice(0, 5);
} else {
this.isAllData = true;
this.logList = list;
}
workOrderId: any = "";
logList: any[] = [];
offset = 0;
limit = 20;
totalElements = 0;
loading = false;
hasMore = true;
detailColumns: any[] = [
{
title: "变更项",
dataIndex: "fieldLabel",
key: "fieldLabel",
width: 200,
ellipsis: true,
},
{
title: "变更前的值",
dataIndex: "beforeValue",
key: "beforeValue",
width: 280,
ellipsis: true,
},
{
title: "变更后的值",
dataIndex: "afterValue",
key: "afterValue",
width: 280,
ellipsis: true,
},
];
isChangeLog(item: any) {
const type = Number(item?.operationType);
return (
(type === 11 || type === 12) &&
Array.isArray(item?.detailItems) &&
item.detailItems.length > 0
);
}
init(workOrderId: any) {
this.workOrderId = workOrderId;
this.logList = [];
this.offset = 0;
this.totalElements = 0;
this.hasMore = true;
this.loadNextPage();
}
handleMore() {
this.isAllData = true;
this.logList = this.alllist
loadNextPage() {
if (this.loading || !this.hasMore || !this.workOrderId) return;
this.loading = true;
DetectionController.inspectWoOpLogPage(this.axios, {
workOrderId: this.workOrderId,
offset: this.offset,
limit: this.limit,
})
.then((response) => {
const data = response?.data?.data || {};
const content = data.content || [];
this.logList = [...this.logList, ...content];
this.totalElements = data.totalElements || this.logList.length;
this.offset += this.limit;
this.hasMore =
this.logList.length < this.totalElements &&
content.length > 0;
})
.finally(() => {
this.loading = false;
});
}
handleScroll(e: Event) {
const target = e.target as HTMLElement;
if (
target.scrollTop + target.clientHeight >=
target.scrollHeight - 20
) {
this.loadNextPage();
}
}
getFirstChar(str: string) {
if (!str) return "";
return String(str).charAt(0);
}
}
</script>
<style lang="less" scoped>
.logBox {
width: 100%;
height: auto;
float: left;
width: 100%;
max-height: 480px;
margin-top: 16px;
overflow-y: auto;
}
.log-list {
float: left;
width: -webkit-calc(100% - 32px);
width: -moz-calc(100% - 32px);
width: calc(100% - 32px);
float: left;
margin-bottom: 16px;
margin-left: 32px;
}
.progressBox {
width: 24px;
float: left;
width: 24px;
}
.progressBox-point {
......@@ -91,72 +182,75 @@ export default class OperationLog extends Vue {
.progressBox-line {
width: 2px;
height: 40px;
background: #1956fe;
margin-top: 3px;
margin-left: 2.5px;
background: #1956fe;
}
.log-title {
float: left;
width: -webkit-calc(100% - 24px);
width: -moz-calc(100% - 24px);
width: calc(100% - 24px);
float: left;
}
.logBox-content {
width: 100%;
line-height: 20px;
float: left;
color: #2F3133;
width: 100%;
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: #2f3133;
word-wrap: break-word;
word-break: break-word;
}
.logBox-content.with-detail {
color: #1956fe;
cursor: help;
text-decoration: underline;
text-decoration-color: rgba(25, 86, 254, 0.4);
text-decoration-style: dashed;
text-underline-offset: 3px;
}
.logBox-content span {
color: #2f3133;
}
.logBox-time {
float: left;
width: 100%;
height: 20px;
line-height: 20px;
float: left;
color: #777c85;
margin-top: 6px;
font-size: 12px;
font-weight: 400;
margin-top: 6px;
line-height: 20px;
color: #777c85;
}
.logBox-point {
float: left;
width: 14px;
height: 14px;
line-height: 14px;
background: #e6efff;
text-align: center;
float: left;
margin: 3px 0;
color: #1956fe;
font-size: 8px;
font-weight: 700;
line-height: 14px;
color: #1956fe;
text-align: center;
background: #e6efff;
border-radius: 8px;
}
.moreBox {
width: -webkit-calc(100% - 32px);
width: -moz-calc(100% - 32px);
width: calc(100% - 32px);
height: 20px;
.statusBox {
float: left;
color: #666666;
font-size: 14px;
width: 100%;
padding: 8px 0 16px;
font-size: 13px;
font-weight: 400;
line-height: 20px;
margin-top: 8px;
margin-bottom: 22px;
margin-left: 32px;
cursor: pointer;
color: #999999;
text-align: center;
}
.p-l-4 {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!