lrf402788946 4 rokov pred
rodič
commit
fe9964e170

+ 1 - 1
.gitignore

@@ -1,7 +1,7 @@
 .DS_Store
 node_modules
 /dist
-umychart
+# umychart
 
 
 # local env files

+ 36 - 34
public/umychart/umychart.js

@@ -6102,13 +6102,14 @@ function KLineFrame()
 
         this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
         /*lrf-2021-05-21在K线栏添加 "威" 查看数据*/ 
-        const weiButton=`<span class='index_wei' id='weiindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='威'>威</span>`;
+        /*lrf-2021-05-31 将威放在对应K线图右侧显示 */
+        // const weiButton=`<span class='index_wei' id='weiindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='威'>威</span>`;
         const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
         const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
         const overlayButton=`<span class='index_overlay icon iconfont icon-overlay_index' id='overlayindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='叠加指标'></span>`;
         const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
 
-        var spanIcon=weiButton+modifyButton+changeButton+overlayButton;
+        var spanIcon=modifyButton+changeButton+overlayButton; //weiButton+
 
         if (this.Identify!==0 && this.CloseIndex)  //第1个窗口不能关闭
         {
@@ -6165,38 +6166,38 @@ function KLineFrame()
         /*lrf-2021-05-21K线栏添加 "威" */ 
         //只在主框体上加,别的不加
 
-        if(identify!=0) $("#"+divToolbar.id+" .index_wei").hide();
-        else {
-          $("#"+divToolbar.id+" .index_wei").mouseover(
-            {
-              Chart:this.ChartBorder.UIElement.JSChartContainer,
-              Identify:this.Identify
-            },
-            function(event){
-              var hqChart=event.data.Chart;
-              var pixelTatio = GetDevicePixelRatio(); //鼠标移动坐标是原始坐标 需要乘以放大倍速
-              var x = (event.clientX-hqChart.UIElement.getBoundingClientRect().left)*pixelTatio;
-              var y = (event.clientY-hqChart.UIElement.getBoundingClientRect().top)*pixelTatio;
-
-              //加载数据中,禁用鼠标事件
-              if (hqChart.ChartSplashPaint && hqChart.ChartSplashPaint.IsEnableSplash == true) return;
-              if (hqChart.DisableMouse==true) return;
-              if (hqChart.BorderDrag) return;
-
-              //保存最后一次鼠标移动信息
-              var MoveStatus={ X:x, Y:y, IsInClient: hqChart.IsMouseOnClient(x,y) };
-              hqChart.LastMouseStatus.OnMouseMove=MoveStatus;
-              hqChart.ShowTooltip(x,y,hqChart.customData)
-            });
-          $("#"+divToolbar.id+" .index_wei").mouseout(
-            {
-              Chart:this.ChartBorder.UIElement.JSChartContainer,
-              Identify:this.Identify
-            },function(event){
-              var hqChart=event.data.Chart;
-              hqChart.HideTooltip();
-            });
-        }
+        // if(identify!=0) $("#"+divToolbar.id+" .index_wei").hide();
+        // else {
+        //   $("#"+divToolbar.id+" .index_wei").mouseover(
+        //     {
+        //       Chart:this.ChartBorder.UIElement.JSChartContainer,
+        //       Identify:this.Identify
+        //     },
+        //     function(event){
+        //       var hqChart=event.data.Chart;
+        //       var pixelTatio = GetDevicePixelRatio(); //鼠标移动坐标是原始坐标 需要乘以放大倍速
+        //       var x = (event.clientX-hqChart.UIElement.getBoundingClientRect().left)*pixelTatio;
+        //       var y = (event.clientY-hqChart.UIElement.getBoundingClientRect().top)*pixelTatio;
+
+        //       //加载数据中,禁用鼠标事件
+        //       if (hqChart.ChartSplashPaint && hqChart.ChartSplashPaint.IsEnableSplash == true) return;
+        //       if (hqChart.DisableMouse==true) return;
+        //       if (hqChart.BorderDrag) return;
+
+        //       //保存最后一次鼠标移动信息
+        //       var MoveStatus={ X:x, Y:y, IsInClient: hqChart.IsMouseOnClient(x,y) };
+        //       hqChart.LastMouseStatus.OnMouseMove=MoveStatus;
+        //       hqChart.ShowTooltip(x,y,hqChart.customData)
+        //     });
+        //   $("#"+divToolbar.id+" .index_wei").mouseout(
+        //     {
+        //       Chart:this.ChartBorder.UIElement.JSChartContainer,
+        //       Identify:this.Identify
+        //     },function(event){
+        //       var hqChart=event.data.Chart;
+        //       hqChart.HideTooltip();
+        //     });
+        // }
         $("#"+divToolbar.id+" .index_close").click(
             {
                 Chart:this.ChartBorder.UIElement.JSChartContainer,
@@ -23871,6 +23872,7 @@ function HQMinuteTimeStringFormat()
 //行情tooltip提示信息格式
 var WEEK_NAME=["日","一","二","三","四","五","六"];
 // 自定义 数据=>字符串 类
+/*lrf-2021-05-21在K线栏添加 "威" 查看数据*/
 function CustomDataStringFormat(){
   this.newMethod=IChangeStringFormat;   //派生
   this.newMethod();

+ 1 - 1
src/views/index/parts/main-table.vue

@@ -50,7 +50,7 @@ export default {
       // let urls = 'https://www.ilikegou.cn/umychart/phone7.html?mid=' + row.id;
       // //					let urls = "http://127.0.0.1:8020/iponekline/phone7.html?mid="+item.id
       // window.location.href = urls;
-      this.$router.push({ path: '/kline', query: { mid: row.id } });
+      this.$router.push({ path: '/kline', query: { mid: row.id, matchId: row.dataWeekteamId } });
     },
   },
 };

+ 59 - 36
src/views/kline/index.vue

@@ -3,28 +3,62 @@
     <div class="left-menu">
       <leftMenu />
     </div>
-    <!--//****************************Franklin 创建主队K线*********************************-->
-    <div id="klineHome" style="width: 900px; height: 400px; float: left; position: relative"></div>
-    <!--//****************************Franklin 创建客队K线*********************************-->
-    <div id="klineAway" style="width: 900px; height: 400px; float: left; position: relative"></div>
-    <!--//****************************Franklin 创建主队VS客队K线*********************************-->
-    <div id="klineCalculation" style="width: 900px; height: 400px; float: left; position: relative"></div>
+    <div id="kline1Frame" style="border: 1px solid #000; height: 350px; float: left">
+      <!--//****************************Franklin 创建主队K线*********************************-->
+      <div id="klineHome" style="height: 400px; float: left; position: relative; border: 1px solid #000"></div>
+      <div id="kline1Sub" style="float: left; width: 300px; height: 400px; border: 1px solid #000">
+        <subs :title="matchTitle" :fields="field1" :team="team.team1" />
+      </div>
+    </div>
+
+    <div id="kline2Frame" style="border: 1px solid #000; height: 350px; float: left">
+      <!--//****************************Franklin 创建主队K线*********************************-->
+      <div id="klineAway" style="height: 400px; float: left; position: relative; border: 1px solid #000"></div>
+      <div id="kline2Sub" style="float: left; width: 300px; height: 400px; border: 1px solid #000">
+        <subs :fields="field1" :team="team.team2" />
+      </div>
+    </div>
+
+    <div id="kline3Frame" style="border: 1px solid #000; height: 350px; float: left">
+      <!--//****************************Franklin 创建主队K线*********************************-->
+      <div id="klineCalculation" style="height: 400px; float: left; position: relative; border: 1px solid #000"></div>
+      <div id="kline3Sub" style="float: left; width: 300px; height: 400px; border: 1px solid #000">
+        <subs :fields="field2" :team="team.team3" />
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
+import subs from './parts/sub.vue';
 import leftMenu from './parts/left-menu.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: gameList } = createNamespacedHelpers('gameList');
 export default {
   name: 'kLineIndex',
   props: {},
-  components: { leftMenu },
+  components: { leftMenu, subs },
   data: function () {
     return {
       jsChart1: undefined,
       jsChart2: undefined,
       jsChart3: undefined,
+      team: {},
+      field1: [
+        [{ label: 'none' }, { label: '胜' }, { label: '平' }, { label: '负' }, { label: '场次数' }],
+        [{ label: '12场' }, { key: 's12' }, { key: 'p12' }, { key: 'f12' }, { key: 'matchCount12', getColor: true }],
+        [{ label: '24场' }, { key: 's24' }, { key: 'p24' }, { key: 'f24' }, { key: 'matchCount12', getColor: true }],
+      ],
+      field2: [
+        [{ label: 'none' }, { label: '胜' }, { label: '平' }, { label: '负' }, { label: '场次数' }],
+        [{ label: '12场' }, { key: 'xs12' }, { key: 'xp12' }, { key: 'xf12' }, { key: 'matchCountx12', getColor: true }],
+        [{ label: '主队6场' }, { key: 'homeOdds6' }, { key: 'homeOddp6' }, { key: 'homeOddf6' }, { key: 'homeMatchCount6', getColor: true }],
+        [{ label: '主队12场' }, { key: 'homeOdds12' }, { key: 'homeOddp12' }, { key: 'homeOddf12' }, { key: 'homeMatchCount12', getColor: true }],
+        [{ label: '主队24场' }, { key: 'homeOdds24' }, { key: 'homeOddp24' }, { key: 'homeOddf24' }, { key: 'homeMatchCount24', getColor: true }],
+        [{ label: '客队6场' }, { key: 'awayOdds6' }, { key: 'awayOddp6' }, { key: 'awayOddf6' }, { key: 'awayMatchCount6', getColor: true }],
+        [{ label: '客队12场' }, { key: 'awayOdds12' }, { key: 'awayOddp12' }, { key: 'awayOddf12' }, { key: 'awayMatchCount12', getColor: true }],
+        [{ label: '客队24场' }, { key: 'awayOdds24' }, { key: 'awayOddp24' }, { key: 'awayOddf24' }, { key: 'awayMatchCount24', getColor: true }],
+      ],
     };
   },
   created() {},
@@ -60,7 +94,7 @@ export default {
         Name: testIndex.Name,
         Script: testIndex.Script,
         Args: testIndex.Args,
-        Modify: false,
+        Modify: true,
         Change: true,
       };
       aryIndex.push(scriptIndex);
@@ -248,6 +282,7 @@ export default {
           };
           const res = await this.kline(reqData);
           if (this.$checkRes(res)) {
+            this.$set(this.team, `team${data.Team}`, res);
             callback(res);
           }
           break;
@@ -263,21 +298,33 @@ export default {
       // var height= $(window).height()-300; //300高度给指标编辑器
       // 计算k线框体大小
       var height = $(window).height() / 3; //300高度给指标编辑器
-      var width = $(window).width() - 80;
+      var width = $(window).width() - 375;
       //****************************Franklin 创建第一条K线*********************************
       var divKlineHome = document.getElementById('klineHome');
       divKlineHome.style.width = width + 'px';
       divKlineHome.style.height = height + 'px';
+      var kline1Frame = document.getElementById('kline1Frame');
+      kline1Frame.style.height = height + 'px';
+      var kline1Sub = document.getElementById('kline1Sub');
+      kline1Sub.style.height = height + 'px';
       divKlineHome.JSChart.OnSize();
       //****************************Franklin 创建第二条K线*********************************
       var divKlineAway = document.getElementById('klineAway');
       divKlineAway.style.width = width + 'px';
       divKlineAway.style.height = height + 'px';
+      var kline2Frame = document.getElementById('kline2Frame');
+      kline2Frame.style.height = height + 'px';
+      var kline2Sub = document.getElementById('kline2Sub');
+      kline2Sub.style.height = height + 'px';
       divKlineAway.JSChart.OnSize();
       //****************************Franklin 创建第三条K线*********************************
       var divKlineCalculation = document.getElementById('klineCalculation');
       divKlineCalculation.style.width = width + 'px';
       divKlineCalculation.style.height = height + 'px';
+      var kline3Frame = document.getElementById('kline3Frame');
+      kline3Frame.style.height = height + 'px';
+      var kline3Sub = document.getElementById('kline3Sub');
+      kline3Sub.style.height = height + 'px';
       divKlineCalculation.JSChart.OnSize();
     },
 
@@ -286,39 +333,15 @@ export default {
       var lockData = { IndexName: info.Data.IndexName, IsLocked: false };
       info.HQChart.LockIndex(lockData);
     },
-
-    GetUserBuy(obj) {
-      console.log('[GetUserBuy] obj ', obj);
-      var result = [];
-      for (var i in obj.KData.Data) {
-        result[i] = 0;
-        var item = obj.KData.Data[i];
-        if (USER_BUY.has(item.Date)) result[i] = USER_BUY.get(item.Date).Count;
-      }
-
-      return result;
-    },
-    DownloadUserBuy(obj) {
-      // TODO:待修改
-      console.log('[DownloadUserBuy] obj ', obj);
-
-      setTimeout(() => {
-        const USER_BUY = new Map([
-          [20190705, { Count: 1 }],
-          [20190714, { Count: 3 }],
-          [20190806, { Count: 1 }],
-          [20190826, { Count: 1 }],
-          [20190902, { Count: 2 }],
-        ]);
-        obj.Success();
-      }, 500);
-    },
   },
   computed: {
     ...mapState(['user', 'menuParams']),
     pageTitle() {
       return `${this.$route.meta.title}`;
     },
+    matchTitle() {
+      return `竞彩足球 ${this.$route.query.matchId}`;
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };

+ 78 - 0
src/views/kline/parts/sub.vue

@@ -0,0 +1,78 @@
+<template>
+  <div id="subs">
+    <el-row>
+      <el-col :span="24" v-if="title" class="title">{{ title }}</el-col>
+      <el-col :span="24" class="teamTitle">{{ `${getProp({ key: 'symbol' })}-` || '' }}威廉希尔赔率</el-col>
+    </el-row>
+    <el-row v-for="(l, index) in fields" :key="`tableRow-${index}`" type="flex">
+      <el-col :span="5" v-for="(f, fi) in l" :key="`tableCol-${index}-${fi}`" :style="{ color: getColor(f) }" class="tableCell">
+        {{ getProp(f) }}
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+export default {
+  name: 'subs',
+  props: {
+    title: { type: String },
+    team: { type: Object, default: () => {} },
+    fields: { type: Array, default: () => [] },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    // {label,key}: label:值为什么显示什么;key:去team中取出来对应key的value
+    getProp(object) {
+      const { label, key } = object;
+      if (label) return label === 'none' ? '' : label;
+      return _.get(this.team, key);
+    },
+    getColor(object) {
+      // 取出key值的数字,看excel的规律是数字位临界判断值
+      let color = '#000';
+      if (_.get(object, 'getColor')) {
+        const { key } = object;
+        const num = key.replace(/[^0-9]/gi, '');
+        const value = this.getProp(object);
+        if (num && value && parseFloat(value) < parseFloat(num)) color = 'red';
+      }
+      return color;
+    },
+  },
+  computed: {
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.title {
+  text-align: center;
+  font-size: 20px;
+  font-weight: 500;
+  border-bottom: 2px solid #000;
+}
+.teamTitle {
+  text-align: center;
+  font-size: 16px;
+  font-weight: 400;
+  padding-bottom: 10px;
+}
+.el-col {
+  text-align: center;
+}
+.tableCell {
+  padding-bottom: 10px;
+}
+</style>