|
@@ -0,0 +1,440 @@
|
|
|
+<template>
|
|
|
+ <van-row class="GuQuanZhiYa yhc-tab-search">
|
|
|
+ <div class="selectDate">
|
|
|
+ <van-dropdown-menu active-color="#1989fa">
|
|
|
+ <van-dropdown-item
|
|
|
+ v-model="state.selectDate"
|
|
|
+ :options="state.optDate"
|
|
|
+ @change="checkDate"
|
|
|
+ />
|
|
|
+ </van-dropdown-menu>
|
|
|
+ </div>
|
|
|
+ <div class="gudongzhiyabili conetnt-seroll">
|
|
|
+ <div class="biliBlock">
|
|
|
+ <div class="blTitle">股权质押走势</div>
|
|
|
+ <div class="zsPic" @touchstart.stop="()=>{}" @touchmove.stop="()=>{}">
|
|
|
+ <div class="mobile-header"></div>
|
|
|
+ <div class="mobile-content">
|
|
|
+ <canvas id="containerZs" style="width: 100%;height: 250px;" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="biliBlock">
|
|
|
+ <div class="blTitle">质押比例</div>
|
|
|
+ <div class="yhc-subject">
|
|
|
+ <van-row type="flex" justify="space-between" class="yhc-item-row">
|
|
|
+ <van-col span="12" class="yhc-item-left">
|
|
|
+ <div class="left-first">股票代码</div>
|
|
|
+ <div class="black">{{ state.showData.stockCode || '-' }}</div>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="12" class="yhc-item-right">
|
|
|
+ <div class="right-first">股票简称</div>
|
|
|
+ <div class="black">{{ state.showData.stockAbbreviation || '-' }}</div>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row type="flex" justify="space-between" class="yhc-item-row">
|
|
|
+ <van-col span="12" class="yhc-item-left">
|
|
|
+ <div class="left-first">质押比例</div>
|
|
|
+ <div class="black">{{ state.showData.pledgedRatio || ' ' }}%</div>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="12" class="yhc-item-right">
|
|
|
+ <div class="right-first">质押股数</div>
|
|
|
+ <div class="black">{{ state.showData.pledgedShares || ' ' }}股</div>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row type="flex" justify="space-between" class="yhc-item-row">
|
|
|
+ <van-col span="12" class="yhc-item-left">
|
|
|
+ <div class="left-first">质押市值</div>
|
|
|
+ <div class="black">{{ state.showData.pledgedValue || ' ' }}元</div>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="12" class="yhc-item-right">
|
|
|
+ <div class="right-first">质押笔数</div>
|
|
|
+ <div class="black">{{ state.showData.pledgedNum || '-' }}</div>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row type="flex" justify="space-between" class="yhc-item-row">
|
|
|
+ <van-col span="12" class="yhc-item-left">
|
|
|
+ <div class="left-first">无限售股质押数</div>
|
|
|
+ <div class="black">{{ state.showData.unlimitedPledgedShares || ' ' }}股</div>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="12" class="yhc-item-right">
|
|
|
+ <div class="right-first">限售股质押数</div>
|
|
|
+ <div class="black">{{ state.showData.restrictedPledgedShares || ' ' }}股</div>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row type="flex" justify="space-between" class="yhc-item-row">
|
|
|
+ <van-col span="12" class="yhc-item-left">
|
|
|
+ <div class="left-first">近一年涨跌幅</div>
|
|
|
+ <div class="black">{{ state.showData.oneYearChange || ' ' }}%</div>
|
|
|
+ </van-col>
|
|
|
+ <van-col span="12" class="yhc-item-right">
|
|
|
+ <div class="right-first">所属行业</div>
|
|
|
+ <div class="black">{{ state.showData.industry || '-' }}</div>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row type="flex" justify="space-between" class="yhc-item-row">
|
|
|
+ <van-col span="24" class="yhc-item-left">
|
|
|
+ <div class="left-first">交易日期</div>
|
|
|
+ <div class="black">{{ state.showData.date || '-' }}</div>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-row>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+ import $axios from '@/api'
|
|
|
+ import { useDemensionListStore } from '@/store/demensionList'
|
|
|
+
|
|
|
+ import { onMounted, reactive } from 'vue'
|
|
|
+ import F2 from '@antv/f2'
|
|
|
+
|
|
|
+ const state = reactive({
|
|
|
+ details: {} as any,
|
|
|
+ optDate: [],
|
|
|
+ allData:[],
|
|
|
+ selectDate:'',
|
|
|
+ showData:{}
|
|
|
+ })
|
|
|
+
|
|
|
+ const getData1 = async () => {
|
|
|
+ const params = {
|
|
|
+ dimensionCode: 'stock_pledge',
|
|
|
+ entityId: useDemensionListStore().entityId,
|
|
|
+ entityName: useDemensionListStore().entityName,
|
|
|
+ entityType: useDemensionListStore().entityType,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 1000
|
|
|
+ }
|
|
|
+ const res:any = await $axios.get('lawyer-workbench/risk/dimension/page',{params})
|
|
|
+
|
|
|
+ res.dataList.forEach(i => {
|
|
|
+ const _d=i.transactionDate && i.transactionDate.substring(0, 10)
|
|
|
+ state.allData.push({...i,date:_d})
|
|
|
+ state.optDate.push({text: _d, value: _d})
|
|
|
+ })
|
|
|
+ state.selectDate = state.allData[0].date
|
|
|
+ checkDate(state.selectDate)
|
|
|
+ graph()
|
|
|
+ state.details = res[0]
|
|
|
+ }
|
|
|
+
|
|
|
+ const getData = async () => {
|
|
|
+ const params = {
|
|
|
+ dimensionCode: useDemensionListStore().selectDemension?.code,
|
|
|
+ entityId: useDemensionListStore().entityId,
|
|
|
+ entityName: useDemensionListStore().entityName,
|
|
|
+ entityType: useDemensionListStore().entityType,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 1000
|
|
|
+ }
|
|
|
+ const res:any = await $axios.get('lawyer-workbench/risk/dimension/page',{params})
|
|
|
+ res.dataList.forEach(i => {
|
|
|
+ const _d=i.transactionDate && i.transactionDate.substring(0, 10)
|
|
|
+ state.allData.push({...i,date:_d})
|
|
|
+ state.optDate.push({text: _d, value: _d})
|
|
|
+ })
|
|
|
+ state.selectDate = state.allData[0].date
|
|
|
+ checkDate(state.selectDate)
|
|
|
+ graph()
|
|
|
+ state.details = res[0]
|
|
|
+ }
|
|
|
+
|
|
|
+ const checkDate = (e) => {
|
|
|
+ state.allData.forEach((item) => {
|
|
|
+
|
|
|
+ if (item.date === e) {
|
|
|
+ state.showData = item
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const graph = () => {
|
|
|
+ const ticks=[]
|
|
|
+ const data=state.allData.map((item,i) => {
|
|
|
+ if(i===0 || i===state.allData.length-1) {
|
|
|
+ ticks.push(item.date)
|
|
|
+ } else {
|
|
|
+ ticks.push('')
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ date:item.date,
|
|
|
+ value:item.pledgedRatio*1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ data.reverse()
|
|
|
+ ticks.reverse()
|
|
|
+ const chart = new F2.Chart({
|
|
|
+ id: 'containerZs',
|
|
|
+ pixelRatio: window.devicePixelRatio,
|
|
|
+ padding: [45, 40, 'auto']
|
|
|
+ })
|
|
|
+
|
|
|
+ chart.source(data, {
|
|
|
+ value: {
|
|
|
+ tickCount: 5,
|
|
|
+ min: 0,
|
|
|
+ formatter: function formatter(val) {
|
|
|
+ return val + '%'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ date: {
|
|
|
+ // type:'cat',
|
|
|
+ // values:ticks,
|
|
|
+ ticks:ticks
|
|
|
+ // tickInterval:100,
|
|
|
+ // min:data[data.length-15].date,
|
|
|
+ // max:data[data.length-1].date,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ data.forEach(function (obj) {
|
|
|
+ chart.guide().point({
|
|
|
+ position: [obj.date, obj.value],
|
|
|
+ style: {
|
|
|
+ fill: '#1890ff',
|
|
|
+ r: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // chart.guide().text({
|
|
|
+ // position: [ obj.time, obj.tem ],
|
|
|
+ // content: obj.tem + '人',
|
|
|
+ // style: {
|
|
|
+ // fill: '#222',
|
|
|
+ // textAlign: 'center'
|
|
|
+ // },
|
|
|
+ // offsetY: -15,
|
|
|
+ // offsetX: 0
|
|
|
+ // });
|
|
|
+ })
|
|
|
+ chart.axis('date', {
|
|
|
+ label: function label(text, index, total) {
|
|
|
+ const textCfg = {}
|
|
|
+ if (index === 0) {
|
|
|
+ textCfg.textAlign = 'left'
|
|
|
+ } else if (index === total - 1) {
|
|
|
+ textCfg.textAlign = 'right'
|
|
|
+ }
|
|
|
+ return textCfg
|
|
|
+ }
|
|
|
+ })
|
|
|
+ chart.axis('value', {
|
|
|
+ label: function label(text, index, total) {
|
|
|
+ const textCfg = {}
|
|
|
+ if (index === 0) {
|
|
|
+ textCfg.textBaseline = 'bottom'
|
|
|
+ } else if (index === total - 1) {
|
|
|
+ textCfg.textBaseline = 'top'
|
|
|
+ }
|
|
|
+ return textCfg
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // chart.interaction('pan')
|
|
|
+ // chart.scrollBar({
|
|
|
+ // mode: 'x',
|
|
|
+ // xStyle: {
|
|
|
+ // offsetY: -5
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ chart.guide().html({
|
|
|
+ position: ['min', 'max'],
|
|
|
+ html: `<div id="tooltipWrapper" style="height: 30px;background-color:#E9F1FF;line-height: 30px;">
|
|
|
+ <div id="tooltipName" style="float:left;font-size:12px;color:#2E2E2E;"></div>
|
|
|
+ <div id="tooltipValue" style="float:right;font-size:12px;color:#2E2E2E;"></div>
|
|
|
+ </div>`,
|
|
|
+ offsetY: -22.5
|
|
|
+ })
|
|
|
+ chart.tooltip({
|
|
|
+ alwaysShow: true,
|
|
|
+ showCrosshairs: true,
|
|
|
+ custom: true, // 自定义 tooltip 内容框
|
|
|
+ tooltipMarkerStyle: {
|
|
|
+ fill: '#fff' // 设置 tooltipMarker 的样式
|
|
|
+ },
|
|
|
+ onChange: function onChange(obj) {
|
|
|
+ const items = obj.items
|
|
|
+ const originData = items[0].origin
|
|
|
+ const date = originData.date
|
|
|
+ const value = originData.value
|
|
|
+ const tag = originData.tag
|
|
|
+ document.querySelector('#tooltipWrapper').style.width =
|
|
|
+ document.documentElement.clientWidth + 'px'
|
|
|
+ document.querySelector('#tooltipWrapper').style.left = 0
|
|
|
+ document.querySelector('#tooltipWrapper').style.right = 0
|
|
|
+ document.querySelector('#tooltipName').style.paddingLeft = '15px'
|
|
|
+ document.querySelector('#tooltipValue').style.paddingRight = '15px'
|
|
|
+
|
|
|
+ document.querySelector('#tooltipName').innerText = '日期:' + date
|
|
|
+ const color = '#FA541C'
|
|
|
+ document.querySelector('#tooltipValue').innerHTML =
|
|
|
+ '质押比例:<span style="color:' +
|
|
|
+ color +
|
|
|
+ '">' +
|
|
|
+ items[0].value +
|
|
|
+ '</span>'
|
|
|
+ document.querySelector('#tooltipWrapper').style.display = 'block'
|
|
|
+ }
|
|
|
+ // onHide: function onHide() {
|
|
|
+ // document.querySelector("#tooltipWrapper").style.display = 'none';
|
|
|
+ // },
|
|
|
+ })
|
|
|
+ chart.line().position('date*value').color('#518DFE')
|
|
|
+
|
|
|
+ chart.render()
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ getData()
|
|
|
+ getData1()
|
|
|
+ })
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang='scss'>
|
|
|
+body {
|
|
|
+ background: #f5f5f5;
|
|
|
+}
|
|
|
+
|
|
|
+.GuQuanZhiYa {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .van-tabs__wrap {
|
|
|
+ border-bottom: 1px solid #f5f3f3;
|
|
|
+ }
|
|
|
+ .selectDate {
|
|
|
+ border-bottom: 1px solid #f5f3f3;
|
|
|
+ .van-dropdown-menu .van-dropdown-menu__bar {
|
|
|
+ height: 38px;
|
|
|
+ box-shadow: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .gudongzhiyabili {
|
|
|
+ .biliBlock {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ background: #fff;
|
|
|
+ .blTitle {
|
|
|
+ height: 38px;
|
|
|
+ line-height: 38px;
|
|
|
+ color: #333;
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 0 15px;
|
|
|
+ border-bottom: 1px solid #f5f3f3;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ .zsPic {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .zhongyaogudongtongji{
|
|
|
+ .tj-top{
|
|
|
+ background: #fff;
|
|
|
+ .items-det-top{
|
|
|
+ flex: 1;
|
|
|
+ margin: 0 16px;
|
|
|
+ padding: 16px 0;
|
|
|
+ img{
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ margin-right: 6px;
|
|
|
+ }
|
|
|
+ span{
|
|
|
+ line-height: 20px;
|
|
|
+ flex: 1;
|
|
|
+ color: #242A32;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .yhc-subject {
|
|
|
+ padding: 6px $padding 10px $padding;
|
|
|
+ border-bottom: 12px solid #f1f2f4;
|
|
|
+ background-color: white;
|
|
|
+ }
|
|
|
+ .yhc-item-row {
|
|
|
+ padding-top: 12px;
|
|
|
+ .yhc-item-left {
|
|
|
+ color: $grayFont;
|
|
|
+
|
|
|
+ .left-first {
|
|
|
+ padding: 2px 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ color: $link;
|
|
|
+ padding-top: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .black {
|
|
|
+ color: $blackColor;
|
|
|
+ padding-top: 8px;
|
|
|
+ line-height: 16px;
|
|
|
+ padding-right: $padding;
|
|
|
+ }
|
|
|
+
|
|
|
+ .entireLine {
|
|
|
+ color: $blackColor;
|
|
|
+ padding: 8px 0;
|
|
|
+ line-height: 16px;
|
|
|
+ border-bottom: 0.5px solid $border;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .yhc-item-right {
|
|
|
+ color: $grayFont;
|
|
|
+ .right-first {
|
|
|
+ padding: 2px $padding;
|
|
|
+ border-left: 1px solid $border;
|
|
|
+ i {
|
|
|
+ color: $link;
|
|
|
+ vertical-align: bottom;
|
|
|
+ margin-left: 10px;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .black {
|
|
|
+ padding-left: $padding;
|
|
|
+ color: $blackColor;
|
|
|
+ padding-top: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bzxr-items {
|
|
|
+ background: #fff;
|
|
|
+ padding: 15px 10px;
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 15px;
|
|
|
+
|
|
|
+ .bzxr-items-top {
|
|
|
+ line-height: 24px;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bzxr-items-info {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 100%;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .bzxr-items-left {
|
|
|
+ flex: 1;
|
|
|
+ line-height: 24px;
|
|
|
+ color: $grayFont;
|
|
|
+
|
|
|
+ .bzxr-items-nr {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bzxr-item-right {
|
|
|
+ width: 16px;
|
|
|
+ margin-left: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|