|
|
@@ -13,6 +13,9 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { onMounted, reactive } from "vue"; |
|
|
|
import{fileURL} from '@/datas/fileURL.js'; |
|
|
|
import { getItem} from "@/utils/storage"; |
|
|
|
import { getGlobalParam } from "@/utils/network/api.js"; |
|
|
|
import {getCodeName} from "@/datas/queryKey.js"; |
|
|
|
const emit = defineEmits(['numberplateResult']) |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
@@ -26,12 +29,18 @@ |
|
|
|
numberplateCor:{ |
|
|
|
type:Object, |
|
|
|
default:()=>{return {id:-1}} |
|
|
|
} |
|
|
|
}, |
|
|
|
//客车1 货车2 |
|
|
|
type:{ |
|
|
|
type:String, |
|
|
|
default:'1' |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
curCheckId:-1, //当前选择的车牌 |
|
|
|
numberplateColorList:[//车牌颜色 |
|
|
|
numberplateColorList:[], |
|
|
|
allColorList:[//车牌颜色 |
|
|
|
{src:'bg-blue',checkSrc:'icon-select-blue',id:0,color:'#ffffff',title:'蓝色'}, |
|
|
|
{src:'bg-green',checkSrc:'icon-select-green',id:4,color:'#000000',title:'渐变绿色'}, |
|
|
|
{src:'bg-orange',checkSrc:'icon-select-orange',id:1,color:'#000000',title:'黄色'}, |
|
|
@@ -39,7 +48,10 @@ |
|
|
|
{src:'bg-black',checkSrc:'icon-select-black',id:2,color:'#ffffff',title:'黑色'}, |
|
|
|
{src:'bg-white',checkSrc:'icon-select-white',id:3,color:'#000000',title:'白色'}, |
|
|
|
{src:'bg-white_blue',checkSrc:'icon-select-blue',id:6,color:'#000000',title:'蓝白渐变'}, |
|
|
|
], |
|
|
|
|
|
|
|
{src:'bg-green',checkSrc:'icon-select-green',id:11,color:'rgb(0,255,0)',title:'绿色'}, |
|
|
|
{src:'bg-white_white',checkSrc:'icon-select-white',id:12,color:'rgb(255,0,0)',title:'红色'}, |
|
|
|
] |
|
|
|
}) |
|
|
|
|
|
|
|
/* 选择车牌颜色 */ |
|
|
@@ -47,10 +59,34 @@ |
|
|
|
state.curCheckId = item.id; |
|
|
|
emit('numberplateResult',item) |
|
|
|
} |
|
|
|
const getCarColor = () => { |
|
|
|
const data=getItem('globalParam') |
|
|
|
if(props.type==1){ |
|
|
|
for(var i=0;i<data.carPlateColorType.length;i++){ |
|
|
|
for(var j=0;j<state.allColorList.length;j++){ |
|
|
|
if(state.allColorList[j].title==getCodeName('VEHICLE_COLOR_TYPE',data.carPlateColorType[i])){ |
|
|
|
state.numberplateColorList.push(state.allColorList[j]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
for(var i=0;i<data.trucksPlateColorType.length;i++){ |
|
|
|
for(var j=0;j<state.allColorList.length;j++){ |
|
|
|
if(state.allColorList[j].title==getCodeName('VEHICLE_COLOR_TYPE',data.trucksPlateColorType[i])){ |
|
|
|
state.numberplateColorList.push(state.allColorList[j]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
onMounted(()=>{ |
|
|
|
state.curCheckId = props.numberplateCor.id; |
|
|
|
getCarColor() |
|
|
|
console.log("type",props.type) |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |