123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import { openApiRes } from '@/api/openApi/type'
- import { def } from '@vue/shared'
- import { Color } from 'XrFrame/xrFrameSystem'
- type openApiGanZhiGet8ziByDate = openApiRes.openApiGanZhiGet8ziByDate["data"]
- interface ganZhiGet8ziByDate extends openApiGanZhiGet8ziByDate {
- ganZhiProRowVoList: openApiGanZhiGet8ziByDate["ganZhiRowVoList"][]
- }
- const textSwitchColor = (text: string) => {
- let color = '#333'
- switch (text) {
- case '棕':
- color = '#9C4B08'
- break;
- case '红':
- color = '#CB2C00'
- break;
- case '绿':
- color = '#53996B'
- break;
- case '蓝':
- color = '#006494'
- break;
- case '黄':
- color = '#D19C03'
- break;
- default:
- color = '#333'
- }
- return color
- }
- const get8ziByDateDecorator = function (responseData: openApiRes.openApiGanZhiGet8ziByDate["data"]) {
- const respData: ganZhiGet8ziByDate = {
- ...responseData,
- ganZhiProRowVoList: []
- }
- for (let index = 0; index < (respData.ganZhiRowVoList.length / 2); index++) {
- const element1 = respData.ganZhiRowVoList[index * 2];
- const element2 = respData.ganZhiRowVoList[index * 2 + 1];
- element1.textColor = textSwitchColor(element1.color)
- element2.textColor = textSwitchColor(element2.color)
- respData.ganZhiProRowVoList.push([element1, element2])
- }
- return respData
- }
- export default {
- get8ziByDateDecorator
- }
|