|
@@ -0,0 +1,260 @@
|
|
|
+<template>
|
|
|
+ <div class="choose-chart-container">
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="show"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ @close="cancelHandle"
|
|
|
+ custom-class="dialog"
|
|
|
+ title="添加图表"
|
|
|
+ top="3vh"
|
|
|
+ center
|
|
|
+ width="86%"
|
|
|
+ style="min-width:1200px;"
|
|
|
+ v-dialogDrag
|
|
|
+ >
|
|
|
+ <div class="dialog-top">
|
|
|
+ <el-input
|
|
|
+ :placeholder="$t('Chart.Detail.chart_name')"
|
|
|
+ v-model="search_txt"
|
|
|
+ style="width: 100%"
|
|
|
+ @input="searchHandle"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
+ </el-input>
|
|
|
+ <div style="margin-top: 10px">
|
|
|
+ <el-radio-group v-model="chart_source" @change="searchHandle" style="margin-right:15px;">
|
|
|
+ <el-radio :label="1"><!-- ETA图库 -->{{$t('Chart.AllChartSource.eta_chart')}}</el-radio>
|
|
|
+ <el-radio :label="2"><!-- 商品价格曲线 -->{{$t('Chart.AllChartSource.commodity_chart')}}</el-radio>
|
|
|
+ <el-radio :label="3"><!-- 相关性图表 -->{{$t('Chart.AllChartSource.correla_chart')}}</el-radio>
|
|
|
+ <el-radio :label="6"><!-- 拟合方程曲线 -->{{$t('Chart.AllChartSource.equation_chart')}}</el-radio>
|
|
|
+ <el-radio :label="7"><!-- 统计特征 -->{{$t('Chart.AllChartSource.statis_chart')}}</el-radio>
|
|
|
+ <el-radio :label="10"><!-- 跨品种分析 -->{{$t('Chart.AllChartSource.cross_chart')}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ <el-checkbox v-model="isShowMe" @change="searchHandle"><!-- 只看我的 -->{{$t('MyEtaPage.label_see_mine')}}</el-checkbox>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="choose-dialog-min">
|
|
|
+ <div
|
|
|
+ v-if="haveData"
|
|
|
+ class="chart-public-list"
|
|
|
+ style="margin-bottom: 20px;padding-right: 20px;"
|
|
|
+ :infinite-scroll-disabled="!haveMove"
|
|
|
+ v-infinite-scroll="loadMove"
|
|
|
+ ref="scrollCont"
|
|
|
+ >
|
|
|
+ <el-col
|
|
|
+ :span="5"
|
|
|
+ v-for="chart in chartPublicList"
|
|
|
+ :key="chart.ChartInfoId"
|
|
|
+ style="padding-right: 20px;margin-bottom:20px;min-width: 260px;"
|
|
|
+ >
|
|
|
+ <el-card shadow class="public-chart-item">
|
|
|
+ <div slot="header" class="item-top">
|
|
|
+ <span class="text_oneLine">{{ $parent.chart_lang==='en' ? (chart.ChartNameEn||chart.ChartName) : chart.ChartName }}</span>
|
|
|
+ </div>
|
|
|
+ <img :src="(chart_source===1&&!chart.HaveOperaAuth) ? $icons.lock_big : chart.ChartImage" alt="" class="chart-img" />
|
|
|
+ <div class="item-bottom">
|
|
|
+ <span class="last-time"><!-- 最近更新 -->{{$t('MyEtaPage.label_update_time')}}:{{ chart.ModifyTime.substr(0,10) }}</span>
|
|
|
+ <span class="join_txt" @click="addMychartHandle(chart)"
|
|
|
+ v-if="(chart.HaveOperaAuth&&chart_source===1)||chart_source!==1">
|
|
|
+ <img
|
|
|
+ :src="$icons.chart_join_ico"
|
|
|
+ alt=""
|
|
|
+ style="width: 13px; height: 12px; vertical-align: middle"
|
|
|
+ />
|
|
|
+ <!-- 加入我的图库 -->{{$t('Chart.chart_addmy_btn')}}
|
|
|
+ </span>
|
|
|
+ <!-- <span style="color: #3BB737;" v-else>已加入</span> -->
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ <div v-else class="nodata">
|
|
|
+ <tableNoData :text="$t('Common.no_chart_msg')"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="dia-bot">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="cancelHandle"
|
|
|
+ style="margin-right: 20px"
|
|
|
+ >{{ $t("Dialog.cancel_btn") }}</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="saveHandle">{{
|
|
|
+ $t("Dialog.confirm_save_btn")
|
|
|
+ }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mychartInterface } from '@/api/api.js';
|
|
|
+import chartRelevanceApi from '@/api/modules/chartRelevanceApi';
|
|
|
+import { fittingEquationInterface,statisticFeatureInterface,crossVarietyInterface } from '@/api/modules/chartRelevanceApi';
|
|
|
+import futuresInterface from '@/api/modules/futuresBaseApi';
|
|
|
+export default {
|
|
|
+ model: {
|
|
|
+ prop: 'show',
|
|
|
+ event: 'showChange'
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ show: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ show(newval) {
|
|
|
+ newval && this.getPublicChartList();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ haveData: false,
|
|
|
+ search_txt: '',
|
|
|
+ page_no: 1,
|
|
|
+ page_size: 15,
|
|
|
+ haveMove: true,
|
|
|
+ chartPublicList: [],
|
|
|
+
|
|
|
+ chart_source:1,
|
|
|
+ isShowMe: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 获取图库列表 */
|
|
|
+ async getPublicChartList() {
|
|
|
+ let params = {
|
|
|
+ PageSize: this.page_size,
|
|
|
+ CurrentIndex: this.page_no,
|
|
|
+ ChartClassifyId: 0,
|
|
|
+ KeyWord: this.search_txt,
|
|
|
+ IsShowMe: this.isShowMe
|
|
|
+ };
|
|
|
+
|
|
|
+ const apiMap = {
|
|
|
+ 1: mychartInterface.publicList,
|
|
|
+ 2: futuresInterface.searchChart,
|
|
|
+ 3: chartRelevanceApi.getChartList,
|
|
|
+ 6: fittingEquationInterface.getChartList,
|
|
|
+ 7: statisticFeatureInterface.getChartList,
|
|
|
+ 10: crossVarietyInterface.searchChart,
|
|
|
+ }
|
|
|
+ let res = await apiMap[this.chart_source](params)
|
|
|
+
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.haveMove = res.Data ? this.page_no < res.Data.Paging.Pages : false;
|
|
|
+ this.chartPublicList = res.Data
|
|
|
+ ? this.page_no === 1
|
|
|
+ ? res.Data.List
|
|
|
+ : [...this.chartPublicList, ...res.Data.List]
|
|
|
+ : [];
|
|
|
+ this.haveData = this.chartPublicList.length ? true : false;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ addSuccess(params) {
|
|
|
+ this.isAddMyChart = false;
|
|
|
+ this.isHaveAdd = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ loadMove() {
|
|
|
+ this.page_no++;
|
|
|
+ this.getPublicChartList();
|
|
|
+ },
|
|
|
+
|
|
|
+ searchHandle() {
|
|
|
+ this.page_no = 1;
|
|
|
+ if(this.$refs.scrollCont) this.$refs.scrollCont.scrollTop = 0;
|
|
|
+ this.getPublicChartList();
|
|
|
+ },
|
|
|
+
|
|
|
+ init() {
|
|
|
+ this.page_no = 1;
|
|
|
+ if(this.$refs.scrollCont) this.$refs.scrollCont.scrollTop = 0;
|
|
|
+ this.search_txt = '';
|
|
|
+ },
|
|
|
+ cancelHandle() {
|
|
|
+ this.init();
|
|
|
+ this.$emit('showChange', false)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {},
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss">
|
|
|
+.choose-chart-container {
|
|
|
+ .el-col-5 {
|
|
|
+ width: 20%;
|
|
|
+ }
|
|
|
+ .el-card .el-card__header,
|
|
|
+ .el-card__body {
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .el-dialog--center .el-dialog__body {
|
|
|
+ padding: 25px 0 10px;
|
|
|
+ }
|
|
|
+ .dialog-top {
|
|
|
+ padding: 0 25px;
|
|
|
+ }
|
|
|
+ .choose-dialog-min {
|
|
|
+ margin-top: 20px;
|
|
|
+ .chart-public-list {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ /* height: 650px; */
|
|
|
+ max-height: 650px;
|
|
|
+ height: 65vh;
|
|
|
+ padding: 0 0 0 20px;
|
|
|
+ overflow: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
+ .dragShdow {
|
|
|
+ box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+ .public-chart-item {
|
|
|
+ .item-top {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ .chart-img {
|
|
|
+ width: 100%;
|
|
|
+ height: 180px;
|
|
|
+ object-fit: fill !important;
|
|
|
+ }
|
|
|
+ .item-bottom {
|
|
|
+ margin-top: 10px;
|
|
|
+ font-size: 12px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ color: #666;
|
|
|
+ .join_txt {
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .nodata {
|
|
|
+ height: 500px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.dia-bot {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin: 40px 0;
|
|
|
+}
|
|
|
+</style>
|