Karsa 1 year ago
parent
commit
d925d7cc04

+ 21 - 10
src/views/chartRelevance_manage/crossVarietyAnalysis/chartEditor.vue

@@ -158,13 +158,19 @@
           <tableNoData text="暂无信息"/>
         </div>
 
-        <!-- 图表相关配置 -->
-        <chartFormSection
-          :tagList="tagOptions"
-          :chartInfo="chartInfo"
-          ref="chartFormRef"
-          @getData="getChartPreviewData"
-        />
+        <div class="bottom-wrapper">
+          <!-- 图表相关配置 -->
+          <chartFormSection
+            :tagList="tagOptions"
+            :chartInfo="chartInfo"
+            ref="chartFormRef"
+            @getData="getChartPreviewData"
+          />
+
+          <!-- 指标列表 -->
+          <edbTableSection :tableData="tableData"/>
+        </div>
+
       </div> 
 
     </div>
@@ -203,13 +209,15 @@ import ExplainDialog from '../components/explainDialog.vue';
 import chartFormSection from './components/chartFormSection.vue';
 import tagSetDialog from './components/tagSetDialog.vue';
 import tagRelationDialog from './components/tagRelationDialog.vue';
+import edbTableSection from './components/edbTableSection.vue'
 export default {
   components: {
     ExplainDialog,
     Chart,
     chartFormSection,
     tagSetDialog,
-    tagRelationDialog
+    tagRelationDialog,
+    edbTableSection
   },
   directives: {
     drag(el, bindings) {
@@ -527,8 +535,6 @@ export default {
         .list {
           display: flex;
           flex-wrap: wrap;
-          max-height: 200px;
-          overflow-y: auto;
           gap: 10px;
           .tag {
             color: #333;
@@ -646,6 +652,11 @@ export default {
       width: 100%;
       padding: 100px 0;
     }
+    .bottom-wrapper {
+      width: 100%;
+      padding: 20px;
+      border-top: 1px solid #ebeff6;
+    }
   }
 }
 </style>

+ 0 - 2
src/views/chartRelevance_manage/crossVarietyAnalysis/components/chartFormSection.vue

@@ -184,8 +184,6 @@ export default {
 <style scoped lang="scss">
 .form-cont {
   width: 100%;
-  padding: 20px;
-  border-top: 1px solid #ebeff6;
   display: flex;
   gap: 50px;
 

+ 140 - 0
src/views/chartRelevance_manage/crossVarietyAnalysis/components/edbTableSection.vue

@@ -0,0 +1,140 @@
+<template>
+  <el-table
+    :data="tableData"
+    ref="tableRef"
+    highlight-current-row
+    border
+    >
+      <el-table-column
+        v-for="item in tableColums"
+        :key="item.label"
+        :label="item.label"
+        :width="item.widthsty"
+        :min-width="item.minwidthsty"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row[item.key] }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" key="Copy" align="center" width="140">
+        <template slot-scope="scope">
+          <span class="editsty" @click="copyCode(scope.row)">
+          <i class="el-icon-document-copy" />&nbsp;复制数据</span
+        ><br />
+        <span class="editsty" @click="viewTarget(scope.row)">查看数据</span>
+      </template>
+    </el-table-column>
+    <div slot="empty">
+      <tableNoData text="暂无指标" size="mini"/>
+    </div>
+  </el-table>
+</template>
+<script>
+import { dataBaseInterface } from '@/api/api';
+import * as preDictEdbInterface from '@/api/modules/predictEdbApi.js';
+export default {
+  props: {
+    tableData: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      tableColums: [
+        {
+          label: '指标名称',
+          key: 'EdbName',
+          enKey:'EdbNameEn',
+					inputTip:'点击输入英文指标名称',
+          minwidthsty: '150px',
+        },
+        {
+          label: '指标ID',
+          key: 'EdbCode',
+          widthsty: '120px',
+        },
+        {
+          label: '更新频度',
+          key: 'Frequency',
+          enKey:'FrequencyEn',
+          minwidthsty: '60px',
+        },
+        {
+          label: '单位',
+          key: 'Unit',
+          enKey:'UnitEn',
+					inputTip:'英文单位',
+          minwidthsty: '50px',
+        },
+        {
+          label: '起始时间',
+          key: 'StartDate',
+          minwidthsty: '100px',
+        },
+        {
+          label: '最新日期',
+          key: 'LatestDate',
+          minwidthsty: '90px',
+        },
+        {
+          label: '最新值',
+          key: 'LatestValue',
+          minwidthsty: '90px',
+        },
+        {
+          label: '最近更新',
+          key: 'ModifyTime',
+          minwidthsty: '100px',
+        },
+        {
+          label: '数据来源',
+          key: 'SourceName',
+        },
+      ],//表格列
+    }
+  },
+  methods:{
+    /* 用于复制指标 */
+    async copyCode({EdbInfoId, EdbInfoCategoryType}) {
+      let params = {
+        PageSize: 100000,
+        CurrentIndex: 1,
+        EdbInfoId: EdbInfoId,
+      }
+      const res = EdbInfoCategoryType === 1 
+        ? await preDictEdbInterface.edbDataInfo(params)
+        : await dataBaseInterface.targetList(params);
+      if (res.Ret !== 200) return
+
+      let arr = res.Data.Item.DataList || [];
+
+      let str = '日期\t 值\n';
+      arr.forEach((item) => (str += `${item.DataTime}\t${item.Value}\n`));
+      this.$copyText(str).then(
+        (res) => {
+          this.$message.success('已成功复制!');
+        },
+        (err) => {
+          this.$message.error('复制失败!');
+        }
+      );
+    },
+
+    /* 查看数据 跳转指标库展开具体指标 */
+    viewTarget({ UniqueCode,EdbInfoId,EdbInfoCategoryType,ClassifyId }) {
+      let path = EdbInfoCategoryType ? '/predictEdb' : '/database';
+      let {href} = this.$router.resolve({path, query: {
+        code: UniqueCode,
+        id: EdbInfoId,
+        classifyId:ClassifyId
+      }});
+			window.open(href,'_blank');
+    },
+  },
+}
+</script>
+<style scoped lang='scss'>
+
+</style>

+ 7 - 3
src/views/chartRelevance_manage/crossVarietyAnalysis/components/tagRelationDialog.vue

@@ -151,6 +151,10 @@ export default {
 .dialog-min {
   padding: 30px 0 50px;
   .list-ul{
+    padding: 0 15px;
+    max-height: calc(100vh - 500px);
+    min-height: 300px;
+    overflow-y: auto;
     .list-li {
       display: flex;
       align-items: center;
@@ -164,15 +168,15 @@ export default {
   }
   .dialog-bot {
     display: flex;
-    margin-top: 40px;
+    margin-top: 30px;
     justify-content: center;
   }
 }
 </style>
 <style lang="scss">
-  .tag-relation-dialog .el-dialog__body {
+  /* .tag-relation-dialog .el-dialog__body {
     max-height: calc(100vh - 350px);
     min-height: 300px;
     overflow-y: auto;
-  }
+  } */
 </style>

+ 6 - 31
src/views/chartRelevance_manage/crossVarietyAnalysis/list.vue

@@ -165,36 +165,9 @@
               </el-col>
           </el-row>
 
-					 <el-table
-						:data="tableData"
-						ref="tableRef"
-						highlight-current-row
-						border
-						>
-							<el-table-column
-								v-for="item in tableColums"
-								:key="item.label"
-								:label="item.label"
-								:width="item.widthsty"
-								:min-width="item.minwidthsty"
-								align="center"
-							>
-								<template slot-scope="scope">
-									<span>{{ scope.row[item.key] }}</span>
-								</template>
-							</el-table-column>
-							<el-table-column label="操作" key="Copy" align="center" width="140">
-								<template slot-scope="scope">
-									<span class="editsty" @click="copyCode(scope.row)">
-									<i class="el-icon-document-copy" />&nbsp;复制数据</span
-								><br />
-								<span class="editsty" @click="viewTarget(scope.row)">查看数据</span>
-							</template>
-						</el-table-column>
-						<div slot="empty">
-							<tableNoData text="暂无指标" size="mini"/>
-						</div>
-					</el-table>
+					<!-- 指标列表 -->
+					<edbTableSection :tableData="tableData"/>
+
 				</div>
 				<!-- 列表 -->
 				<chartListWrap
@@ -257,13 +230,15 @@ import SaveChartOther from '@/views/dataEntry_manage/components/SaveChartOther';
 import setEnNameDia from '@/views/dataEntry_manage/components/setEnNameDia.vue'
 import { chartSetMixin } from '@/views/dataEntry_manage/mixins/chartPublic';
 import { copyOtherOptions } from '@/utils/defaultOptions';
+import edbTableSection from './components/edbTableSection.vue';
 export default {
 	components: {
 		classifyDia,
 		Chart,
 		addMyClassifyDia,
 		SaveChartOther,
-		setEnNameDia
+		setEnNameDia,
+		edbTableSection
 	},
 	mixins:[ leftMixin,chartSetMixin ],
 	computed: {