Commit fc1f6a4d by yancanhua

fix: 收车偏好接口联调

1 parent db71966b
......@@ -12,11 +12,11 @@ export class PreferenceController {
static PAGE_PREFERENCE = 'account/preference/page';
static getPreferenceDetail(axios: AxiosStatic, id: number): Promise<AxiosResponse> {
return axios.get('account/preference/detail', { params: { id: id } });
return axios.get('account/preference/detail/' + id, {});
}
static updatePreference(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.put('account/preference/update', params);
static postPreference(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('account/preference/update', params);
}
static exportPreference(axios: AxiosStatic, params: any, config?: any): Promise<AxiosResponse<void>> {
......
<template>
<div class="logBox">
<div class="log-list">
<div v-for="(item, index) in logList" :key="index" class="log-list">
<div class="progressBox">
<div class="progressBox-point"></div>
<div class="progressBox-line"></div>
</div>
<div class="log-title">
<div class="logBox-content">偏好品牌:<span>新增“奔驰”,新增“宝马”</span></div>
<div v-if="item.title || item.content" class="logBox-content">
{{ item.title }}:
<span>{{ item.content }}</span>
</div>
<div class="logBox-time">
<div class="logBox-point">M</div>
<span class="p-l-4">方世盛</span>
<span class="p-l-8">2026-01-20 14:32:05</span>
<span class="p-l-4">{{ item.opBy }}</span>
<span class="p-l-8">{{ item.createTime }}</span>
</div>
</div>
</div>
<div class="moreBox">
<div v-if="!isAllData" @click="handleMore()" class="moreBox">
查看更多
<DoubleLeftOutlined color="#666666" font-size="16px;" style="transform: rotate(270deg);" />
</div>
......@@ -24,17 +25,38 @@
</template>
<script lang="ts">
import { Component, Vue } from "vue-facing-decorator";
import { Component, Prop, Vue, Watch } from "vue-facing-decorator";
import { DoubleLeftOutlined } from '@ant-design/icons-vue';
@Component({ components: { DoubleLeftOutlined } })
export default class OperationLog extends Vue {
@Prop({ type: Object, required: true })
operationLogData: any;
logList = [];
//初始数据
init(data: any) {
this.logList = data.operationLogList || [];
isAllData = false;
alllist = [];
@Watch('operationLogData', { deep: true, immediate: true })
watchOperationLogData(newValue: any, oldValue: any): void {
const list = (newValue.logList || []).map((item: any) => {
const values = (item.opContent || '').split(':').filter(Boolean);
return { ...item, title: values[0] || '', content: values[1] || '' };
});
if (list.length > 5) {
this.isAllData = false;
this.alllist = list;
this.logList = list.slice(0, 5);
} else {
this.isAllData = true;
this.logList = list;
}
}
handleMore() {
this.isAllData = true;
// this.logList = this.alllist.slice(0, 5);
this.logList = this.alllist
}
}
</script>
......
......@@ -10,7 +10,7 @@
<div v-for="(item, index) in returnPageList()" :key="index" style="float: left;">
<div v-if="index < 2" class="tag-box tag-box-max">{{ item.label }}</div>
</div>
<div class="tag-box">+ {{ returnPageList().length - 2 }}</div>
<div v-if="returnPageList().length > 2" class="tag-box">+ {{ returnPageList().length - 2 }}</div>
</div>
</a-popover>
</div>
......@@ -28,8 +28,8 @@ interface TagItem {
export default class PageMultipleTag extends Vue {
@Prop({ type: Array, required: true })
listValue: any[];
@Prop({ type: String, required: true })
listValue: String;
@Prop({ type: String, required: true })
tagValue: string;
......@@ -39,7 +39,12 @@ export default class PageMultipleTag extends Vue {
@Watch('tagValue')
@Watch('listValue')
updateTagList() {
this.cachedTagList = this.generateTagList();
if (this.listValue == 'vehicleConditionList' || this.listValue == 'vehicleAgeList' || this.listValue == 'vehicleFuelTypeList' || this.listValue == 'vehicleTypeList') {
this.cachedTagList = this.generateTagList();
} else {
//自定义品牌标签
this.cachedTagList = JSON.parse(this.listValue || '[]').map((item: any) => ({ label: item.name, value: item.id }));
}
}
private generateTagList(): TagItem[] {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!