|
@@ -0,0 +1,56 @@
|
|
|
+
|
|
|
+
|
|
|
+//
|
|
|
+// type openApiGanZhiGet8ziByDate = openApiRes.openApiGanZhiGet8ziByDate["data"]
|
|
|
+// interface ganZhiGet8ziByDate extends openApiGanZhiGet8ziByDate {
|
|
|
+// ganZhiProRowVoList: openApiGanZhiGet8ziByDate["ganZhiRowVoList"][]
|
|
|
+// }
|
|
|
+
|
|
|
+const textSwitchColor = (text) => {
|
|
|
+ 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) {
|
|
|
+ const respData = {
|
|
|
+ ...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
|
|
|
+}
|