瀏覽代碼

Merge branch 'master' into cygx_new

db 2 年之前
父節點
當前提交
c5759d71d8
共有 3 個文件被更改,包括 33 次插入15 次删除
  1. 7 0
      src/api/hzyb/pricedriven.js
  2. 11 11
      src/views/hzyb/chart/Detail.vue
  3. 15 4
      src/views/hzyb/pricedriven/detail.vue

+ 7 - 0
src/api/hzyb/pricedriven.js

@@ -25,5 +25,12 @@ export const priceDrivenLog = params => {
   return post('/price_driven/visit_log',{ source_agent: 1,...params })
 }
 
+/**
+ * 标签树
+ */
+ export const tabTree = parmas=>{
+  return get('/public/get_variety_tag_tree',parmas)
+}
+
 
 

+ 11 - 11
src/views/hzyb/chart/Detail.vue

@@ -376,11 +376,11 @@ const setSplineOpt=(data)=>{
             },
             tickWidth: sameSideIndex !== index ? 0 : 1,
             title: {
-                text:  sameSideIndex !== index ? '' : `单位:${item.Unit}`,
+                text:  sameSideIndex !== index ? '' : `${item.Unit}`,
                 align: 'high',
                 rotation: 0,
                 y: -15,
-                offset: 0,
+                offset: -(10 * item.Unit.length),
             },
             opposite: item.IsAxis === 0,
             reversed: item.IsOrder,
@@ -555,11 +555,11 @@ const setStackOrCombinChart = data => {
                 y:5,
             },
             title: {
-                text:  sameSideIndex !== index ? '' : `单位:${item.Unit}`,
+                text:  sameSideIndex !== index ? '' : `${item.Unit}`,
                 align: 'high',
                 rotation: 0,
                 y: -15,
-                offset: 0,
+                offset: -(10 * item.Unit.length),
             },
             opposite: item.IsAxis === 0,
             reversed: item.IsOrder,
@@ -699,11 +699,11 @@ const setSeasonOpt=(data)=>{
                     y:5
                 },
                 title: {
-                    text:  `单位:${data.Unit}`,
+                    text:  `${data.Unit}`,
                     align: 'high',
                     rotation: 0,
                     y: -15,
-                    offset: 0,
+                    offset: -(10 * data.Unit.length),
                 },
                 max: Number(data.MaxData),
                 min: Number(data.MinData),
@@ -762,11 +762,11 @@ const setSeasonOpt=(data)=>{
                     y:5
                 },
                 title: {
-                    text:  `单位:${data.Unit}`,
+                    text:  `${data.Unit}`,
                     align: 'high',
                     rotation: 0,
                     y: -15,
-                    offset: 0,
+                    offset: -(10 * data.Unit.length),
                 },
                 max: Number(data.MaxData),
                 min: Number(data.MinData),
@@ -921,11 +921,11 @@ const setScatterOptions = (dataList) => {
     //y轴
     let yAxis = {
         title: {
-            text:  `单位:${dataList[1].Unit}`,
+            text:  `${dataList[1].Unit}`,
             align: 'high',
             rotation: 0,
             y: -15,
-            offset: 0,
+            offset: -(10 * dataList[1].Unit.length),
         },
         labels: {
             formatter: function (ctx) {
@@ -974,7 +974,7 @@ const setScatterOptions = (dataList) => {
         xAxis: {
             ...scatterXAxis,
             title: {
-                text:  `单位:${dataList[0].Unit}`,
+                text:  `${dataList[0].Unit}`,
                 align: 'high',
                 rotation: 0,
                 x: 0,

+ 15 - 4
src/views/hzyb/pricedriven/detail.vue

@@ -24,10 +24,21 @@ const select_classify_sub = ref(""); //选中的分类id
 const select_classify_subtitle = ref(""); //选中分类名称
 /* 获取分类 */
 const getClassify = async () => {
-  const { code, data } = await priceApi.tabList();
-
+  //const { code, data } = await priceApi.tabList();
+  const {code, data} = await priceApi.tabTree()
   if (code === 200) {
-    const { permission_list } = data;
+    //const { permission_list } = data;
+    const result = data
+    const permission_list = result.map((item,index)=>{
+      let obj = {}
+      obj.classify_name = item.classify_name
+      obj.id = index
+      obj.list = item.tags.map((i)=>{
+        return {chart_permission_id:i.tag_id,chart_permission_name:i.tag_name,pirce_driven_state:i.price_driven_state}
+      })
+      return obj
+    })
+    
     permission_list.forEach(_ => {
       _.isShow = _.list ? _.list.some(sub_item => sub_item.pirce_driven_state) : false
     })
@@ -89,7 +100,7 @@ const info = ref({});
 const getDetail = async () => {
   showData.value = false;
   const { code, data } = await priceApi.priceDrivenDetail({
-    chart_permission_id: select_classify_sub.value,
+    variety_tag_id: select_classify_sub.value,
   });
 
   if (code !== 200) return;