Commit 95ac1908 by zhangxw

Merge branch 'SAAS+V5.0.0' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.0.0
2 parents c88ddaaa 3a95e1dc
...@@ -2,8 +2,73 @@ ...@@ -2,8 +2,73 @@
* @Author: 'wangzhihui' '1733904062@qq.com' * @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-09-18 15:01:57 * @Date: 2025-09-18 15:01:57
* @LastEditors: 'wangzhihui' '1733904062@qq.com' * @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-09-18 15:02:24 * @LastEditTime: 2025-09-20 16:34:53
* @FilePath: \dj-car-life-system\src\api\usedCarManagement.js * @FilePath: \dj-car-life-system\src\api\usedCarManagement.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
/**二手车 */ /**二手车 */
// import Request from "@/newRequest/index.esm"
// console.log("request", Request)
// const request = new Request({
// baseURL: "http://192.168.3.145:9898/gsc-vcp-web-facade",
// appId: "dj_zhixin",
// appSecret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
// sentry: {
// enable: false,
// dsn: "https://be4fb79a912b4c34a5d1c539a1618978@sentry.glsx.com.cn/1"
// },
// security: {
// enable: false,
// address:
// "https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=glsx-common" // 自定义地址
// },
// httpOptions: {
// // HTTP选项配置
// customer: {
// response: {
// code_key: "status", // 状态码字段名,支持字符串或数组
// code_success_value: "200", // 成功状态码值
// data_key: "data", // 数据字段名
// errId: "errId", // 错误ID字段名
// errId_logout_value: "" // 登出状态码值
// }
// }
// }
// })
// export function getListApi(data) {
// return request.request({
// url: "/test/page/test",
// method: "POST",
// data: {
// id: 6,
// objs: ["hehe", "haah"],
// dogs: [
// { name: "haogou", age: 1 },
// { name: "拉布拉多", age: 2 }
// ],
// dog: { name: "haogou", age: 1 }
// }
// })
// }
// export function getListApi(data) {
// return new Promise(async (resolve) => {
// let result = await request.request({
// url: "/test/page/test",
// method: "POST",
// data: {
// id: 6,
// objs: ["hehe", "haah"],
// dogs: [
// { name: "haogou", age: 1 },
// { name: "拉布拉多", age: 2 }
// ],
// dog: { name: "haogou", age: 1 }
// }
// })
// console.log(result, "result")
// if (result.status == 200) {
// resolve(result.data)
// }
// })
// }
...@@ -1487,3 +1487,57 @@ export const scheduling_inviteStatus = [ ...@@ -1487,3 +1487,57 @@ export const scheduling_inviteStatus = [
{ confId: 6, confValue: "已撤销" }, { confId: 6, confValue: "已撤销" },
{ confId: 7, confValue: "已支付" } { confId: 7, confValue: "已支付" }
] ]
// 时间tab
export const timeTabOpt = [
{ confId: "0", confValue: "全部" },
{ confId: "1", confValue: "今日" },
{ confId: "2", confValue: "昨日" },
{ confId: "3", confValue: "本月" },
{ confId: "3", confValue: "上月" }
]
//使用性质
export const usageTypeOpt = [
{ confId: "2", confValue: "营运" },
{ confId: "1", confValue: "非营运" },
{ confId: "3", confValue: "营转非" }
]
//所有人性质
export const ownerTypeOpt = [
{ confId: "1", confValue: "个人" },
{ confId: "2", confValue: "公司" }
]
//车辆类别
export const vehicleCategoryOpt = [
{ confId: "1", confValue: "置换车" },
{ confId: "2", confValue: "报废车" }
]
//是否新车下定
export const buyNewCarOpt = [
{ confId: "1", confValue: "是" },
{ confId: "0", confValue: "否" }
]
//是否事故
export const hasAccidentOpt = [
{ confId: "1", confValue: "是" },
{ confId: "0", confValue: "否" }
]
//评估单状态
export const evaluationStatusOpt = [
{ confId: "10", confValue: "评估中" },
{ confId: "20", confValue: "已报价" },
{ confId: "30", confValue: "已签约" },
{ confId: "40", confValue: "已支付-定金" },
{ confId: "50", confValue: "已支付-尾款" },
{ confId: "100", confValue: "已完成" },
{ confId: "1", confValue: "已驳回" }
]
export const evaluationStatusOptMap = {
10: "#FDB757",
20: "#2CCA74",
30: "#2CCA74",
40: "#2CCA74",
50: "#2CCA74",
100: "#8C8C8C",
1: "#EB4E4E"
}
...@@ -94,5 +94,74 @@ export const routerName = { ...@@ -94,5 +94,74 @@ export const routerName = {
} }
], ],
component: _import("usedCarManagement/operateManagement/index") component: _import("usedCarManagement/operateManagement/index")
},
92004: {
path: "/vehicleManagement",
name: "vehicleManagement",
meta: {
title: "车辆管理",
authId: "92004",
parentId: "920",
cache: false
},
auth: [
{
authId: "9200401",
parentId: "92004",
label: "详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "9200404",
name: "车辆详情",
parentId: "92004"
},
{
authId: "9200405",
name: "编辑车辆",
parentId: "92004"
}
]
},
{
authId: "9200402",
parentId: "92004",
label: "状态变更",
handle: "handleChangeStatus"
},
{
authId: "9200403",
parentId: "92004",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
} }
],
component: _import("usedCarManagement/vehicleManagement/index")
},
9200404: {
path: "/detail",
name: "vehicleDetail",
meta: {
title: "车辆详情",
authId: "9200404",
parentId: "92004",
cache: false
},
auth: [],
component: _import("usedCarManagement/vehicleManagement/detail")
},
9200405: {
path: "/detail",
name: "editVehicle",
meta: {
title: "编辑车辆",
authId: "9200405",
parentId: "92004",
cache: false
},
auth: [],
component: _import("usedCarManagement/vehicleManagement/detail")
},
} }
<template> <template>
<d2-dialog :appendToBody="true" :is-visible="dialogVisible" class="accountDailog" title="选择门店" width="720px" <d2-dialog class="relateStore" :appendToBody="true" :is-visible="dialogVisible" title="选择门店" width="50%"
@confirmDialog="handleAddConfirm" @closeDialog="handleClose"> @confirmDialog="handleAddConfirm" @closeDialog="handleClose">
<div class="tableBox"> <!-- <div class="tableBox"> -->
<div style="padding: 10px 50px"> <div>
<span>门店名称: </span>
<el-input v-model="realSearchForm.merchantName" placeholder="搜索门店名称" maxlength="20" clearable size="small" <el-input v-model="realSearchForm.merchantName" placeholder="搜索门店名称" maxlength="20" clearable size="small"
style="width: 300px; margin-right: 12px" /> style="width: 300px; margin-right: 12px" />
<el-button size="small" type="primary" @click="searchList"> <el-button size="small" type="primary" @click="searchList">
查询 查询
</el-button> </el-button>
</div> </div>
<d2-table ref="merchantTable" :search-form="realSearchForm" :table-params="tableParams" :get-list-api="getListApi" <!-- <d2-table ref="merchantTable" :search-form="realSearchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> :before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
</d2-table> </d2-table> -->
<el-row class="tableCon">
<div class="tableBox">
<el-table ref="seletingTable" :data="selectingData" height="365px" class="table" border @select="handleChange"
@select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column>
</el-table>
<el-pagination small background @current-change="handleCurrentChange" :current-page.sync="currentPage"
:page-size="pageSize" layout="total, prev, pager, next" :total="total" />
</div> </div>
<el-table class="tableBox table" :data="selectedData" border height="365px">
<el-table-column prop="merchantName" label="门店名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.merchantName }}</span>
</template>
</el-table-column>
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
</template>
</el-table-column>
</el-table>
</el-row>
<!-- </div> -->
</d2-dialog> </d2-dialog>
</template> </template>
<script> <script>
import { deepClone } from "@/common/util"
import { import {
getAllMerchantList, getAllMerchantList,
getMerchantListByScene, getMerchantListByScene
getBrandList
} from "@api/contentManager" } from "@api/contentManager"
import { deepClone } from "@/common/util"
export default { export default {
name: "SelectGoodsTypeDialog", name: "SelectGoodsTypeDialog",
props: { props: {
...@@ -46,6 +70,12 @@ export default { ...@@ -46,6 +70,12 @@ export default {
data() { data() {
return { return {
getListApi: getAllMerchantList, getListApi: getAllMerchantList,
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 10,
realSearchForm: { realSearchForm: {
merchantName: "" merchantName: ""
}, },
...@@ -63,44 +93,112 @@ export default { ...@@ -63,44 +93,112 @@ export default {
} }
} }
}, },
mounted() { }, mounted() {
this.selectedData = deepClone(this.selectedList)
this.getSelectingList()
},
methods: { methods: {
recoverySelection(list) { recoverySelection() {
var exitIds = this.selectedList.map((item) => +item.merchantId) var exitIds = this.selectedData.map((item) => item.merchantId)
console.log(exitIds) this.selectingData.forEach((item) => {
list.forEach((item) => {
console.log(item.merchantId, "item.merchantId")
exitIds.includes(item.merchantId) && exitIds.includes(item.merchantId) &&
this.$refs.merchantTable.$refs.merchantIndexMutiTable.toggleRowSelection( this.$refs.seletingTable.toggleRowSelection(item, true)
item,
true
)
}) })
}, },
beforeSearchFn() { handleAll(selection) {
return new Promise((resolve) => { this.selectingData.forEach((item) => {
if (this.config.scene == 0 || this.config.scene == 4) { var isExit = this.selectedData.findIndex(
this.getListApi = getAllMerchantList (subItem) => subItem.merchantId === item.merchantId
} else { )
this.getListApi = getMerchantListByScene if (selection.length && isExit === -1) {
this.realSearchForm.scene = this.config.scene this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
} }
resolve()
}) })
}, },
handleDelete(row) {
this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId
)
const obj = this.selectingData.find((v) => v.merchantId == row.merchantId)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.merchantId === row.merchantId
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId
))
},
getSelectingList() {
getMerchantListByScene({
...this.realSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize
}).then((res) => {
// res?.list?.forEach((val) => {
// // 账户中心门店返回商户号字段是merchantNo
// if (val.merchantNo) val.merchantId = Number(val.merchantNo)
// val?.sceneList?.forEach((subVal) => {
// if (subVal.scene == this.selectedScene) {
// val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-"
// val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-"
// }
// })
// })
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
// recoverySelection(list) {
// var exitIds = this.selectedList.map((item) => +item.merchantId)
// console.log(exitIds)
// list.forEach((item) => {
// console.log(item.merchantId, "item.merchantId")
// exitIds.includes(item.merchantId) &&
// this.$refs.merchantTable.$refs.merchantIndexMutiTable.toggleRowSelection(
// item,
// true
// )
// })
// },
// beforeSearchFn() {
// return new Promise((resolve) => {
// if (this.config.scene == 0 || this.config.scene == 4) {
// this.getListApi = getAllMerchantList
// } else {
// this.getListApi = getMerchantListByScene
// this.realSearchForm.scene = this.config.scene
// }
// resolve()
// })
// },
setTableFinishFun(data) { setTableFinishFun(data) {
this.$nextTick(() => { this.$nextTick(() => {
this.recoverySelection(data) this.recoverySelection(data)
}) })
}, },
searchList() { searchList() {
this.$refs?.merchantTable?.refreshTable(true, true) this.page = {
pageSize: this.page.pageSize,
currentPage: 1
}
this.getSelectingList()
// this.$refs?.merchantTable?.refreshTable(true, true)
}, },
handleAddConfirm() { handleAddConfirm() {
const selectItemList = const selectItemList = this.selectedData
this.$refs.merchantTable?.mutiSelectArr?.[
this.tableParams.mutiSelectName
] || []
if (selectItemList.length) { if (selectItemList.length) {
this.$emit("confirmDialogFn", selectItemList) this.$emit("confirmDialogFn", selectItemList)
} else { } else {
...@@ -114,4 +212,47 @@ export default { ...@@ -114,4 +212,47 @@ export default {
} }
</script> </script>
<style></style> <style lang="scss" scoped>
.table {
margin: 0 auto 20px !important;
width: 98%;
}
.tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
<template slot="carName" slot-scope="scope"> <template slot="carName" slot-scope="scope">
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top"> <el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
<div slot="content" class="car-type-list"> <div slot="content" class="car-type-list">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div> <div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">
{{ `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}` }}</div>
</div> </div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div> <div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
</el-tooltip> </el-tooltip>
...@@ -201,7 +202,7 @@ export default { ...@@ -201,7 +202,7 @@ export default {
formatCar(list) { formatCar(list) {
console.log(list, 'list') console.log(list, 'list')
let str = list.map(item => { let str = list.map(item => {
return item.carTypeName return `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}`
}).join(',') }).join(',')
return str.length > 15 ? str.substring(0, 15) + '...' : str return str.length > 15 ? str.substring(0, 15) + '...' : str
} }
......
...@@ -83,7 +83,8 @@ ...@@ -83,7 +83,8 @@
<template slot="carName" slot-scope="scope"> <template slot="carName" slot-scope="scope">
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top"> <el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
<div slot="content" class="car-type-list"> <div slot="content" class="car-type-list">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div> <div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{
`${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}` }}</div>
</div> </div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div> <div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
</el-tooltip> </el-tooltip>
...@@ -378,7 +379,7 @@ export default { ...@@ -378,7 +379,7 @@ export default {
formatCar(list) { formatCar(list) {
console.log(list, 'list') console.log(list, 'list')
let str = list.map(item => { let str = list.map(item => {
return item.carTypeName return `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}`
}).join(',') }).join(',')
return str.length > 15 ? str.substring(0, 15) + '...' : str return str.length > 15 ? str.substring(0, 15) + '...' : str
} }
......
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
<template slot="carName" slot-scope="scope"> <template slot="carName" slot-scope="scope">
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top"> <el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
<div slot="content" class="car-type-list"> <div slot="content" class="car-type-list">
<div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{ item.carTypeName }}</div> <div v-for="(item, index) in scope.scope.suitCarTypeList" :key="index">{{
`${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}` }}</div>
</div> </div>
<div>{{ scope.scope.suitCarTypeList | formatCar }}</div> <div>{{ scope.scope.suitCarTypeList | formatCar }}</div>
</el-tooltip> </el-tooltip>
...@@ -131,7 +132,7 @@ export default { ...@@ -131,7 +132,7 @@ export default {
formatCar(list) { formatCar(list) {
console.log(list, 'list') console.log(list, 'list')
let str = list.map(item => { let str = list.map(item => {
return item.carTypeName return `${item.brandName}-${item.childName}-${item.seriesName}-${item.carTypeName}`
}).join(',') }).join(',')
return str.length > 15 ? str.substring(0, 15) + '...' : str return str.length > 15 ? str.substring(0, 15) + '...' : str
} }
......
<template>
<transition name="viewer-fade">
<div
tabindex="-1"
ref="el-image-viewer__wrapper"
class="el-image-viewer__wrapper"
:style="{ 'z-index': zIndex }"
>
<div class="el-image-viewer__mask" @click="hide"></div>
<!-- CLOSE -->
<span class="el-image-viewer__btn el-image-viewer__close" @click="hide">
<i class="el-icon-circle-close"></i>
</span>
<!-- ARROW -->
<template v-if="!isSingle">
<span
class="el-image-viewer__btn el-image-viewer__prev"
:class="{ 'is-disabled': !infinite && isFirst }"
@click="prev"
>
<i class="el-icon-arrow-left" />
</span>
<span
class="el-image-viewer__btn el-image-viewer__next"
:class="{ 'is-disabled': !infinite && isLast }"
@click="next"
>
<i class="el-icon-arrow-right" />
</span>
</template>
<!-- ACTIONS -->
<div class="el-image-viewer__btn el-image-viewer__actions">
<div class="el-image-viewer__actions__inner">
<i class="el-icon-zoom-out" @click="handleActions('zoomOut')"></i>
<i class="el-icon-zoom-in" @click="handleActions('zoomIn')"></i>
<i class="el-image-viewer__actions__divider"></i>
<i :class="mode.icon" @click="toggleMode"></i>
<i class="el-image-viewer__actions__divider"></i>
<i
class="el-icon-refresh-left"
@click="handleActions('anticlocelise')"
></i>
<i
class="el-icon-refresh-right"
@click="handleActions('clocelise')"
></i>
</div>
</div>
<!-- CANVAS -->
<div class="el-image-viewer__canvas">
<img
v-for="(url, i) in urlList"
v-if="i === index"
ref="img"
class="el-image-viewer__img"
:key="url"
:src="currentImg"
:style="imgStyle"
@load="handleImgLoad"
@error="handleImgError"
@mousedown="handleMouseDown"
/>
</div>
</div>
</transition>
</template>
<script>
function rafThrottle(fn) {
let locked = false
return function (...args) {
if (locked) return
locked = true
window.requestAnimationFrame((_) => {
fn.apply(this, args)
locked = false
})
}
}
const on = (function () {
return function (element, event, handler) {
if (element && event && handler) {
element.addEventListener(event, handler, false)
}
}
})()
const off = (function () {
return function (element, event, handler) {
if (element && event) {
element.removeEventListener(event, handler, false)
}
}
})()
const isFirefox = function () {
return !!window.navigator.userAgent.match(/firefox/i)
}
const Mode = {
CONTAIN: {
name: "contain",
icon: "el-icon-full-screen"
},
ORIGINAL: {
name: "original",
icon: "el-icon-c-scale-to-original"
}
}
const mousewheelEventName = isFirefox() ? "DOMMouseScroll" : "mousewheel"
export default {
name: "elImageViewer",
props: {
urlList: {
type: Array,
default: () => []
},
zIndex: {
type: Number,
default: 2000
},
onSwitch: {
type: Function,
default: () => {}
},
onClose: {
type: Function,
default: () => {}
},
initialIndex: {
type: Number,
default: 0
}
},
data() {
return {
index: this.initialIndex,
isShow: false,
infinite: true,
loading: false,
mode: Mode.CONTAIN,
transform: {
scale: 1,
deg: 0,
offsetX: 0,
offsetY: 0,
enableTransition: false
}
}
},
computed: {
isSingle() {
return this.urlList.length <= 1
},
isFirst() {
return this.index === 0
},
isLast() {
return this.index === this.urlList.length - 1
},
currentImg() {
return this.urlList[this.index]
},
imgStyle() {
const { scale, deg, offsetX, offsetY, enableTransition } = this.transform
const style = {
transform: `scale(${scale}) rotate(${deg}deg)`,
transition: enableTransition ? "transform .3s" : "",
"margin-left": `${offsetX}px`,
"margin-top": `${offsetY}px`
}
if (this.mode === Mode.CONTAIN) {
style.maxWidth = style.maxHeight = "100%"
}
return style
}
},
watch: {
index: {
handler: function (val) {
this.reset()
this.onSwitch(val)
}
},
currentImg(val) {
this.$nextTick((_) => {
const $img = this.$refs.img[0]
if (!$img.complete) {
this.loading = true
}
})
}
},
methods: {
hide() {
console.log(888)
this.deviceSupportUninstall()
this.onClose()
},
deviceSupportInstall() {
this._keyDownHandler = rafThrottle((e) => {
const keyCode = e.keyCode
switch (keyCode) {
// ESC
case 27:
this.hide()
break
// SPACE
case 32:
this.toggleMode()
break
// LEFT_ARROW
case 37:
this.prev()
break
// UP_ARROW
case 38:
this.handleActions("zoomIn")
break
// RIGHT_ARROW
case 39:
this.next()
break
// DOWN_ARROW
case 40:
this.handleActions("zoomOut")
break
}
})
this._mouseWheelHandler = rafThrottle((e) => {
const delta = e.wheelDelta ? e.wheelDelta : -e.detail
if (delta > 0) {
this.handleActions("zoomIn", {
zoomRate: 0.015,
enableTransition: false
})
} else {
this.handleActions("zoomOut", {
zoomRate: 0.015,
enableTransition: false
})
}
})
on(document, "keydown", this._keyDownHandler)
on(document, mousewheelEventName, this._mouseWheelHandler)
},
deviceSupportUninstall() {
off(document, "keydown", this._keyDownHandler)
off(document, mousewheelEventName, this._mouseWheelHandler)
this._keyDownHandler = null
this._mouseWheelHandler = null
},
handleImgLoad(e) {
this.loading = false
},
handleImgError(e) {
this.loading = false
e.target.alt = "加载失败"
},
handleMouseDown(e) {
if (this.loading || e.button !== 0) return
const { offsetX, offsetY } = this.transform
const startX = e.pageX
const startY = e.pageY
this._dragHandler = rafThrottle((ev) => {
this.transform.offsetX = offsetX + ev.pageX - startX
this.transform.offsetY = offsetY + ev.pageY - startY
})
on(document, "mousemove", this._dragHandler)
on(document, "mouseup", (ev) => {
off(document, "mousemove", this._dragHandler)
})
e.preventDefault()
},
reset() {
this.transform = {
scale: 1,
deg: 0,
offsetX: 0,
offsetY: 0,
enableTransition: false
}
},
toggleMode() {
if (this.loading) return
const modeNames = Object.keys(Mode)
const modeValues = Object.values(Mode)
const index = modeValues.indexOf(this.mode)
const nextIndex = (index + 1) % modeNames.length
this.mode = Mode[modeNames[nextIndex]]
this.reset()
},
prev() {
if (this.isFirst && !this.infinite) return
const len = this.urlList.length
this.index = (this.index - 1 + len) % len
},
next() {
if (this.isLast && !this.infinite) return
const len = this.urlList.length
this.index = (this.index + 1) % len
},
handleActions(action, options = {}) {
if (this.loading) return
const { zoomRate, rotateDeg, enableTransition } = {
zoomRate: 0.2,
rotateDeg: 90,
enableTransition: true,
...options
}
const { transform } = this
switch (action) {
case "zoomOut":
if (transform.scale > 0.2) {
transform.scale = parseFloat(
(transform.scale - zoomRate).toFixed(3)
)
}
break
case "zoomIn":
transform.scale = parseFloat((transform.scale + zoomRate).toFixed(3))
break
case "clocelise":
transform.deg += rotateDeg
break
case "anticlocelise":
transform.deg -= rotateDeg
break
}
transform.enableTransition = enableTransition
}
},
mounted() {
this.deviceSupportInstall()
// add tabindex then wrapper can be focusable via Javascript
// focus wrapper so arrow key can't cause inner scroll behavior underneath
this.$refs["el-image-viewer__wrapper"].focus()
}
}
</script>
<!--评估量趋势 -->
<template>
<div class="container">
<line-header @handleClick="handleClick" :title="title"></line-header>
<echart-line
class="echart"
:xData="xData"
:yData="yData"
id="assessRef"
:title="title"
></echart-line>
</div>
</template>
<script>
import lineHeader from "./lineHeader.vue"
import echartLine from "./echartLine.vue"
export default {
components: {
lineHeader,
echartLine
},
data() {
return {
title: "评估量",
xData: [
"2025-08-18",
"2025-08-19",
"2025-08-20",
"2025-08-21",
"2025-08-22",
"2025-08-23",
"2025-08-24",
"2025-08-25",
"2025-08-26",
"2025-08-27",
"2025-08-28",
"2025-08-29",
"2025-08-30",
"2025-08-31"
],
yData: [
12, 3000, 4000, 3000, 2000, 12, 3000, 4000, 3000, 2000, 50, 30, 90, 1888
]
}
},
methods: {
handleClick(data) {}
}
}
</script>
<style scoped lang="scss">
.container {
height: 385px;
padding: 20px;
background: #ffffff;
margin-bottom: 16px;
.echart {
height: 319px;
}
}
</style>
<template>
<div :ref="id" class="canvas"></div>
</template>
<script>
// 按需引入 echarts
import * as echarts from "echarts"
export default {
data() {
return {
client: "",
chart: ""
}
},
props: {
colors: {
type: Array,
default: () => ["#FFC154", "#FF9671"]
},
xData: {
type: Array,
default: []
},
yData: {
type: Array,
default: []
},
id: {
type: String,
default: ""
},
title: {
type: String,
default: ""
}
},
watch: {
yData: {
handler() {
this.chart.setOption(this.getChartSetOption())
},
deep: true
}
},
mounted() {
this.client = this.$refs[this.id]
this.chart = echarts.init(this.client)
this.chart.setOption(this.getChartSetOption())
window.addEventListener("resize", this.resizeHandler)
},
methods: {
resizeHandler() {
if (this.chart) {
this.chart.clear()
setTimeout(() => {
this.chart.setOption(this.getChartSetOption())
this.chart.resize()
}, 1000)
}
},
getChartSetOption() {
var option = {
grid: {
top: "37",
bottom: "0",
left: "13",
right: "16",
containLabel: true
},
tooltip: {
trigger: "axis",
axisPointer: {
lineStyle: {
type: "solid"
}
},
padding: 12,
borderColor: "transparent",
borderWidth: 1,
backgroundColor: "rgba(255, 255, 255, 0.95)",
borderRadius: 4,
textStyle: {
color: "rgba(0, 0, 0, 0.65)",
fontSize: 14
},
formatter: (params) => {
return `
<div style="font-weight:normal;color:rgba(0, 0, 0, 0.65); line-height: 20px;margin-bottom:4px;">${params[0].name}</div>
<div style="rgba(0, 0, 0, 0.65);display:flex;align-items:center; line-height: 20px;"> <div style="width: 6px;
height: 6px;background: ${params[0].color};border-radius:50%;margin-right:7.8px;"></div>
${this.title}:${params[0].value}辆
</div>
`
}
},
xAxis: {
type: "category",
// boundaryGap: false,
// splitNumber: 4,
axisLine: {
show: false
},
axisTick: {
show: true,
lineStyle: {
color: "#E9E9E9"
}
},
splitLine: {
show: false, // 根据截图隐藏网格线
color: "#E9E9E9"
},
axisLine: {
show: false
},
axisLabel: {
// rotate: 30, // 横轴名称旋转
// interval: 0,// 强制显示所有标签
show: true,
color: "rgba(0, 0, 0, 0.65)",
fontSize: "12px"
},
data: this.xData
},
yAxis: {
type: "value",
name: "辆",
nameTextStyle: {
color: "rgba(0, 0, 0, 0.65)",
align: "right"
},
offset: 10,
labelLine: {
show: true
},
axisLine: {
show: false,
lineStyle: {
color: "#E7EBEF"
}
},
axisLabel: {
show: true,
color: "rgba(0, 0, 0, 0.65)",
fontSize: "12px"
},
splitLine: {
show: true, // 根据截图隐藏网格线
color: "#E9E9E9"
},
axisTick: {
show: false
}
},
series: [
{
type: "line",
avoidLabelOverlap: false,
label: {
formatter: "{c}%",
position: "top",
fontSize: 11,
show: false,
color: "#999999"
},
showSymbol: true,
itemStyle: {
color: "#2A58AD"
},
data: this.yData
}
]
}
return option
},
destroyChart() {
// 移除窗口 resize 事件监听器
window.removeEventListener("resize", this.resizeHandler)
// 销毁 ECharts 实例
if (this.chart) {
this.chart.dispose()
this.chart = null
}
}
},
beforeDestroy() {
this.destroyChart()
},
// 如果使用的是 Vue 3,则使用 beforeUnmount
beforeUnmount() {
this.destroyChart()
}
}
</script>
<style scoped lang="scss">
.canvas {
width: 100%;
height: 100%;
}
</style>
<template>
<div class="header">
<div>{{ title }}趋势</div>
<div class="times">
<div
:class="{
time: true,
active: index === activeIndex
}"
v-for="(item, index) in timeopts"
:key="index"
@click="handleClick(index)"
>
{{ item.label }}
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
activeIndex: 0,
timeopts: [
{ label: "近7日", value: 1 },
{ label: "本月", value: 2 },
{ label: "上月", value: 3 },
{ label: "近30日", value: 4 }
]
}
},
props: {
title: {
type: String,
default: "评估量趋势"
}
},
methods: {
handleClick(index) {
this.activeIndex = index
let data = this.timeopts[index]
this.$emit("handleClick", data)
}
}
}
</script>
<style scoped lang="scss">
.header {
display: flex;
align-items: center;
justify-content: space-between;
.times {
display: flex;
align-items: center;
border: 1px solid #dbdbdb;
border-radius: 2px;
box-sizing: border-box;
.time {
padding: 7.5px 18px;
line-height: 17px;
cursor: pointer;
color: #1d1d1d;
font-size: 12px;
font-weight: 400;
border-right: 1px solid #dbdbdb;
box-sizing: border-box;
}
.active {
color: #ffffff;
background: #2a58ad;
}
.time:last-child {
border-right: none;
}
}
}
</style>
<!--评估量趋势 -->
<template>
<div class="container">
<line-header @handleClick="handleClick" :title="title"></line-header>
<echart-line
class="echart"
:xData="xData"
:yData="yData"
id="turnoverRef"
:title="title"
></echart-line>
</div>
</template>
<script>
import lineHeader from "./lineHeader.vue"
import echartLine from "./echartLine.vue"
export default {
components: {
lineHeader,
echartLine
},
data() {
return {
title: "二手车成交量",
xData: [
"2025-08-18",
"2025-08-19",
"2025-08-20",
"2025-08-21",
"2025-08-22",
"2025-08-23",
"2025-08-24",
"2025-08-25",
"2025-08-26",
"2025-08-27",
"2025-08-28",
"2025-08-29",
"2025-08-30",
"2025-08-31"
],
yData: [
12, 3000, 4000, 3000, 2000, 12, 3000, 4000, 3000, 2000, 50, 30, 90, 1888
]
}
},
methods: {
handleClick(data) {}
}
}
</script>
<style scoped lang="scss">
.container {
height: 385px;
padding: 20px;
background: #ffffff;
margin-bottom: 16px;
.echart {
height: 319px;
}
}
</style>
<!--数据看板 --> <!--数据看板 -->
<template>
<div class="data-board">
<div class="data-statistics">
<div class="form-line">
<el-form :inline="true" :model="dataForm">
<el-form-item label="请选择门店:">
<el-select v-model="dataForm.merchantId" placeholder="活动区域">
<el-option label="区域一" value="shanghai"></el-option>
</el-select>
</el-form-item>
</el-form>
<div class="time-select-box">
<div class="tabs">
<div
:class="{
'tabs-item': true,
'tabs-item-active': index === activeIndex
}"
v-for="(item, index) in timeTabOpt"
:key="index"
@click="handleClick(index)"
>
{{ item.confValue }}
</div>
</div>
<el-date-picker
class="date-picker"
v-model="dataForm.value"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
</div>
<div class="data-statistics-list">
<div
class="data-statistics-item"
v-for="(item, index) in statisticsData"
:key="index"
>
<div class="text">{{ item.text }}</div>
<div class="value">
{{ item.key }}<span v-if="item.suffix">{{ item.suffix }}</span>
</div>
<div class="rate">
环比
<span :class="['rateValue', item.isUp()]"
>{{ item.isSymbol() }}{{ item.rateKey }}%</span
>
<div v-if="item.rateKey" :class="['triangle-' + item.isUp()]"></div>
</div>
</div>
</div>
</div>
<!-- 评估量趋势 -->
<assess-trend></assess-trend>
<!-- 二手车成交量趋势 -->
<turnover-trend></turnover-trend>
</div>
</template>
<script>
import { timeTabOpt } from "@/common/constants.js"
import AssessTrend from "./components/assessTrend.vue"
import TurnoverTrend from "./components/turnoverTrend.vue"
export default {
components: {
AssessTrend,
TurnoverTrend
},
data() {
return {
dataForm: {
merchantId: "",
value: []
},
statisticsData: [
{
text: "评估量(辆)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
rateKey: "90"
},
{
text: "总毛利(万元)",
key: "100",
isUp: (val) => {
return "up"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "单车毛利(元)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "平均售价(万元)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "新车下定数(辆)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "二手车成交量(辆)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "评估转化率(比)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "置换率(比)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "新车交付数(辆)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
},
{
text: "二手车收购交车数(辆)",
key: "100",
isUp: (val) => {
return "down"
},
isSymbol: () => {
return "+"
},
suffix: "%",
rateKey: "90"
}
],
timeTabOpt,
activeIndex: 0
}
},
methods: {
handleClick(index) {
this.activeIndex = index
}
}
}
</script>
<style lang="scss" scoped>
.data-board {
height: calc(100vh - 116px);
overflow: scroll;
margin: 0 20px 16px;
.data-statistics {
padding: 20px;
background: #ffffff;
margin-bottom: 20px;
.form-line {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
::v-deep .el-form-item {
margin-bottom: 0;
.el-input {
width: 245px;
}
.el-input--medium .el-input__inner {
height: 32px;
}
}
.time-select-box {
display: flex;
align-items: center;
.tabs {
display: flex;
align-items: center;
background: #fff;
border: 1px solid #dbdbdb;
border-radius: 2px;
box-sizing: border-box;
.tabs-item {
padding: 7.5px 18px;
line-height: 17px;
cursor: pointer;
font-size: 12px;
font-weight: 400;
color: #1d1d1d;
border-right: 1px solid #dbdbdb;
box-sizing: border-box;
}
.tabs-item-active {
color: #ffffff;
background: #2a58ad;
}
.tabs-item:last-child {
border-right: none;
}
}
.date-picker {
margin-left: 8px;
}
::v-deep .el-range-editor--medium.el-input__inner {
height: 32px;
}
}
}
.data-statistics-list {
display: flex;
align-items: center;
flex-wrap: wrap;
box-sizing: border-box;
.data-statistics-item {
width: calc((100% - 16px * 4) / 5);
min-height: 139px;
padding: 20px;
border-radius: 4px;
opacity: 1;
background: #f8faff;
margin-bottom: 16px;
box-sizing: border-box;
margin-right: 16px;
.text {
color: #333333;
font-size: 14px;
font-weight: normal;
}
.value {
color: #1d1d1d;
font-size: 32px;
line-height: 45px;
margin: 12px 0 2px 0;
font-weight: bold;
}
.rate {
display: flex;
align-items: center;
color: #888888;
font-size: 12px;
line-height: 20px;
.rateValue {
color: #eb4e4e;
font-size: 14px;
margin: 0 6px;
}
.up {
color: #eb4e4e;
}
.down {
color: #2cca74;
}
.triangle-up {
width: 0;
height: 0;
border-left: 4px solid transparent; /* 左半边透明 */
border-right: 4px solid transparent; /* 右半边透明 */
border-bottom: 6px solid #eb4e4e; /* 底部红色形成三角形 */
}
/* 向下 */
.triangle-down {
width: 0;
height: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 6px solid #43cf7c;
}
.just {
}
}
}
.data-statistics-item:nth-child(5n) {
margin-right: 0;
}
}
}
}
</style>
<template>
<div>
详情
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ 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!