소스 검색

Merge branch 'eta1.8.4'

Karsa 6 달 전
부모
커밋
5ea9b651fa

+ 63 - 1
src/api/modules/dataSource.js

@@ -66,8 +66,70 @@ const apiDataSource={
 
     
 
+}
+
+//自有数据
+const selfDataInterface = {
+    /**
+     * 来源列表
+     * @param {*} params 
+     * @returns 
+     */
+    getSourceList: params => {
+        return http.get('/datamanage/business_data/source/list')
+    },
+
+    /**
+     * 指标数据
+     * @param {*} params 
+     * PageSize CurrentIndex Frequency Keywords Source
+     * @returns 
+     */
+    getEdbList: params => {
+        return http.get('/datamanage/business_data/list',params)
+    },
+    
+    /**
+     * 校验指标是否存在
+     * @param {*} params 
+     * PageSize CurrentIndex Frequency Keywords Source ListAll IndexCodes
+     * @returns 
+     */
+    checkEdb: params => {
+        return http.post('/datamanage/business_data/add_check',params)
+    },
+
+    /**
+     * 校验指标名称
+     * @param {*} parmas 
+     * @returns 
+     */
+    checkName: parmas => {
+        return http.post('/datamanage/business_data/name_check',parmas)
+    },
+
+    /**
+     * 添加入指标库
+     * @param {*} parmas 
+     * [{Source EdbCode EdbName Frequency Unit ClassifyId}]
+     * @returns 
+     */
+    batchSaveEdb: parmas => {
+        return http.post('/datamanage/business_data/batch_add',parmas)
+    },
+
+    /**
+     * 数据列表
+     * @param {*} parmas 
+     * PageSize CurrentIndex IndexCode
+     * @returns 
+     */
+    getDataList: parmas => {
+        return http.get('/datamanage/business_data/data/list',parmas)
+    }
 }
 
 export {
-    apiDataSource
+    apiDataSource,
+    selfDataInterface
 }

+ 12 - 0
src/lang/modules/DataSources/En.js

@@ -195,6 +195,18 @@ export default {
     haved_some_msg:'The following indicators already exist in the indicator library and will be automatically filtered out!'
   },
 
+
+  /* 自有数据 */
+  SelftDataPage: {
+    ph_channel: 'Please select a channel',
+    col_channel:'Channel',
+    col_start_time:'Indicator Start Time',
+    col_newest_time:'Indicator Latest Time',
+    col_create:'Data Entry Time',
+  },
+
+
+  
   /* 彭博数据源 */
   BloombergPage:{
     operation_prompt:'Operation Prompt',

+ 15 - 0
src/lang/modules/DataSources/Zh.js

@@ -194,6 +194,21 @@ export default {
     haved_some_msg:'指标库中已存在以下指标,会自动过滤!'
   },
 
+  /* 自有数据 */
+  SelftDataPage: {
+    ph_channel: '请选择渠道',
+    col_channel:'渠道',
+    col_start_time:'指标开始时间',
+    col_newest_time:'指标最新时间',
+    col_create:'入库时间',
+    col_menu: '目录',
+    col_part_menu: '分目录',
+    col_same_menu: '同目录',
+
+  },
+
+
+  
   /* 彭博数据源 */
   BloombergPage:{
     operation_prompt:'操作提示',

+ 6 - 0
src/routes/modules/dataRoutes.js

@@ -245,6 +245,12 @@ export default [
         name: "煤炭江湖",
         hidden: false
       },
+      {
+        path: 'selfData',
+        component: () => import("@/views/dataEntry_manage/thirdBase/selfDataBase.vue"),
+        name: "自有数据",
+        hidden: false
+      },  
       {
         path: "bloomberg",
         component: () => import("@/views/dataEntry_manage/thirdBase/bloombergSource.vue"),

+ 2 - 0
src/utils/buttonConfig.js

@@ -269,6 +269,8 @@ export const dataSourcePermission = {
     coalWordData_export:'coalWord:export', // 导出
     /*--------彭博数据源--- */
     Bloomberg_add2edb:'Bloomberg:add2edb',//添加指标库
+    /* 自有数据 */
+    selfData_addEdb:'selfData:addEdb',//添加到指标库
 }
 
 /*

+ 244 - 0
src/views/dataEntry_manage/thirdBase/components/addToBaseDia.vue

@@ -0,0 +1,244 @@
+<template>
+  <!-- 添加到指标库弹窗 -->
+  <el-dialog
+    :title="$t('YsDataPage.add_base_btn')"
+    :visible.sync="isShow"
+    :close-on-click-modal="false"
+    :modal-append-to-body="false"
+    @close="cancelHandle"
+    width="1000px"
+    top="5vh"
+    v-dialogDrag
+    center
+  >
+    <div class="add-dialog-wrap">
+          <el-table 
+            :data="tableData" 
+            border 
+            height="500px"
+          >
+            <el-table-column :label="$t('Edb.Detail.e_id')" align="center" prop="IndexCode"/>
+            <el-table-column :label="$t('Edb.Detail.e_name')" align="center" width="210px">
+                <template slot-scope="scope">
+                  <div class="name-cell">
+                      <el-input 
+                        v-model="scope.row.IndexName" 
+                        placeholder="请填写指标名称" 
+                        style="width:100%;margin:5px 0;"
+                        :class="existNameArr.includes(scope.row.IndexName)&&'error-ipt'"
+                      />
+                    <div class="error" v-if="existNameArr.includes(scope.row.IndexName)">
+                      <span>指标名称已存在,请重新填写</span>
+                    </div>
+                  </div>
+                </template>
+            </el-table-column>
+            <el-table-column :label="$t('Edb.Detail.e_unit')" align="center" width="150px">
+                <template slot-scope="scope">
+                    <selectUnit v-model="scope.row.Unit"/>
+                </template>
+            </el-table-column>
+            <el-table-column :label="$t('Edb.Detail.e_fre')" align="center" width="120px">
+              <template slot-scope="scope">
+                <el-select
+                  v-model="scope.row.Frequency"
+                  placeholder="请选择频率"
+                >
+                  <el-option
+                    v-for="item in $parent.frequencyOptions"
+                    :key="item.val"
+                    :label="item.label"
+                    :value="item.val"
+                  >
+                  </el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" width="280px">
+                <template slot="header" slot-scope="scope">
+                    <span style="margin-right:40px;display:inline-block">目录</span>
+                    <el-radio-group 
+                      v-model="classifyType"
+                      @change="handleClassifyTypeChange"
+                    >
+                        <el-radio :label="0">分目录</el-radio>
+                        <el-radio :label="1">同目录</el-radio>
+                    </el-radio-group>
+                </template>
+                <template slot-scope="{row,$index}">
+                      <el-cascader
+                        v-model="row.ClassifyId"
+                        :options="classifyOpt"
+                        :props="levelProps"
+                        placeholder="请选择指标目录"
+                        :disabled="(classifyType===1&&$index>0)"
+                        @change="handleClassifyChange(row,$index)"
+                        class="cascader-wrapper"
+                      />
+                </template>
+            </el-table-column>
+          </el-table>
+    </div>
+
+    <div style="text-align: center; margin: 30px 0">
+      <el-button @click="cancelHandle">{{$t("Dialog.cancel_btn")}}</el-button>
+      <el-button
+        type="primary"
+        @click="handleCheckName"
+        :loading="saveLoading"
+      >
+        {{ $t("Dialog.confirm_save_btn") }}
+      </el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import { dataBaseInterface } from '@/api/api.js';
+import { selfDataInterface } from '@/api/modules/dataSource';
+export default {
+  props: {
+    isShow: {
+      type: Boolean
+    },
+    list: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      tableData:[],
+      saveLoading: false,
+
+      classifyType:0,
+      classifyOpt: [],
+
+      levelProps: {
+				label: 'ClassifyName',
+				value: 'ClassifyId',
+				children: 'Children',
+				checkStrictly: true,
+        emitPath:false
+			},
+
+      existNameArr:[]
+    };
+  },
+  watch: {
+    isShow(nval) {
+      if(!nval) return
+
+      this.getClassifyOpt()
+
+      this.tableData = this.list.map(_=>({
+        ..._,
+        ClassifyId: 0
+      }))
+    }
+  },
+  methods: {
+
+    filterNodes(arr) {
+			arr.length &&
+				arr.forEach((item) => {
+					item.Children.length && this.filterNodes(item.Children);
+					if (!item.Children.length) {
+						delete item.Children;
+					}
+				});
+		},
+    // 获取指标分类
+    async getClassifyOpt(){
+      const res=await dataBaseInterface.menuListV3()
+      if (res.Ret !== 200) return
+      this.filterNodes(res.Data.AllNodes||[]);
+			this.classifyOpt = res.Data.AllNodes || [];
+    },
+
+    cancelHandle() {
+      this.existNameArr = [];
+      this.$emit('update:isShow',false)
+    },
+
+    // 同目录修改
+    handleClassifyChange(e,index){
+        if(this.classifyType===1){
+          // 修改所有的指标的目录为第一个
+          this.tableData.forEach(item=>{
+              item.ClassifyId=e.ClassifyId
+          })
+        }
+    },
+
+    handleClassifyTypeChange(){
+      this.handleClassifyChange(this.tableData[0])
+    },
+
+    handleCheckName() {
+
+      //重名校验
+      this.existNameArr = []
+      selfDataInterface.checkName(
+          this.tableData.map(_=>({EdbCode:_.IndexCode,EdbName:_.IndexName}))
+      ).then(res=>{
+          if(res.Ret!==200) return 
+          this.existNameArr = res.Data.filter(i=>i.Exist).map(_=>_.EdbName)
+
+          if(this.existNameArr.length) return 
+          this.handleSave()
+      })
+    },
+
+    handleSave() {
+
+      let haveIncomplete = this.tableData.some(_ => !_.IndexName||!_.ClassifyId||!_.Unit)
+      if(haveIncomplete) return this.$message.warning('指标信息填写不完整')
+
+      this.saveLoading = true;
+      selfDataInterface.batchSaveEdb(
+          this.tableData.map(i=>({
+            EdbCode: i.IndexCode,
+            EdbName: i.IndexName,
+            Frequency: i.Frequency,
+            Unit: i.Unit,
+            ClassifyId: i.ClassifyId,
+            Source: i.Source
+          }))
+      ).then(res=>{
+          this.saveLoading = false
+
+          if(res.Ret!==200) return 
+          this.$message.success(this.$t('MsgPrompt.add_msg2'))
+
+          this.cancelHandle();
+          this.$emit('success')
+      })
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.add-dialog-wrap {
+  .name-cell {
+    position: relative;
+    .error {
+      position: absolute;
+      bottom: -16px;
+      color: #f00;
+    }
+  }
+}
+</style>
+<style lang="scss">
+.add-dialog-wrap {
+    .error-ipt .el-input__inner{
+      border-color: #f00;
+    }
+    .el-cascader .el-input{
+      width: 100%;
+    }
+    .el-table .cell {
+      overflow: visible;
+    }
+}
+</style>

+ 200 - 0
src/views/dataEntry_manage/thirdBase/components/lookEdbDataDia.vue

@@ -0,0 +1,200 @@
+<template>
+  <el-dialog
+    :visible.sync="isShow"
+		:close-on-click-modal="false"
+		:modal-append-to-body='false'
+    :title="$t('Edb.detail_lookdata_btn')"
+		@close="cancelHandle"
+		custom-class="look-edb-data-dialog"
+		center
+		width="1200px"
+		v-dialogDrag
+  >
+
+    <div class="main">
+      <el-table
+        :data="tableData"
+        style="box-shadow: 0px 3px 6px rgba(155, 170, 219, 0.2);"
+        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>
+        <div slot="empty">
+            <tableNoData :text="$t('Table.prompt_slogan')" size="mini"/>
+        </div>
+      </el-table>
+
+      <ul 
+        class="value-ul" 
+        ref="valueUl" 
+        @scroll="scrollHandle" 
+        v-show="dataList.length"
+      >
+        <li
+          class="value-item"
+          v-for="(item,index) in dataList"
+          :key="item.ID"
+        >
+          <span class="value-label">
+            <span style="position: relative;">
+              <i class="new-tag" v-if="index===0"></i>
+              {{item.DataTime}}
+            </span>
+          </span>
+          <span class="value-label" style="min-width:200px;text-align:center;">
+            <span class="value-style">{{item.Value}}</span>
+          </span>
+        </li>
+        <li class="nodata value-item" v-if="!dataList.length">{{$t('Table.prompt_slogan')}}</li>
+      </ul>
+    </div>
+
+  </el-dialog>
+</template>
+<script>
+import { selfDataInterface } from '@/api/modules/dataSource';
+export default {
+  props: {
+    isShow: {
+      type: Boolean
+    },
+    edbInfo: {
+      type: Object
+    }
+  },
+  computed: {
+    tableColums() {
+      return [
+         {
+            label: this.$t('Edb.Detail.e_id'),
+            key: 'IndexCode',
+          },
+         {
+            label: this.$t('Edb.Detail.e_name'),
+            key: 'IndexName',
+          },
+          {
+            label: /* '指标开始时间' */this.$t('SelftDataPage.col_start_time'),
+            key: 'StartDate',
+          },
+          {
+            label: /* '指标最新时间' */this.$t('SelftDataPage.col_newest_time'),
+            key: 'DataUpdateTime',
+          },
+      ]
+    }
+  },
+  watch: {
+    isShow(nval) {
+      if(!nval) return
+
+      console.log(this.edbInfo)
+      this.tableData = [this.edbInfo]
+      this.getData();
+    }
+  },
+  data() {
+    return {
+      tableData: [],
+      
+      dataList: [],
+      page_no: 1
+    }
+  },
+  mounted(){
+
+  },
+  methods:{
+    cancelHandle() {
+      this.page_no = 1;
+      this.$refs.valueUl.scrollTop=0
+      this.$emit('update:isShow',false)
+    },
+    
+    async getData() {
+      const res = await selfDataInterface.getDataList({
+        CurrentIndex: this.page_no,
+        PageSize: 10,
+        IndexCode: this.edbInfo.IndexCode
+      })
+
+      if(res.Ret!==200) return
+
+      this.haveMore = this.page_no  < res.Data.Paging.Pages ? true : false;
+      let data = res.Data.List||[];
+      this.dataList = this.page_no===1 ? data : this.dataList.concat(data)
+    },
+
+    scrollHandle(e) {
+      const dom = e.target
+			let scrollTop = dom.scrollTop; //滑入屏幕上方的高度
+			let windowHeitht = dom.clientHeight; //页面的高度
+			let scrollHeight = dom.scrollHeight; //整个div的高度
+			let total = scrollTop + windowHeitht
+			if(total >= scrollHeight && this.haveMore){
+				this.page_no ++;
+				this.getData();
+			}
+    }
+  },
+}
+</script>
+<style scoped lang='scss'>
+.look-edb-data-dialog{
+	display: flex;
+	flex-direction: column;
+	height: 100%;
+	.main {
+    padding: 20px 0;
+  }
+
+  .value-ul {
+    height: 300px;
+    margin-top: 10px;
+    border-bottom: 1px solid #EBEFF6;
+    overflow-y: auto;
+    .value-item {
+      padding: 10px 0;
+      border: 1px solid #dcdfe6;
+      border-bottom: none;
+      display: flex;
+      justify-content: space-around;
+      >span{
+        padding:0 16px;
+        box-sizing: border-box;
+      }
+      .value-label {
+        position: relative;
+        color: #666;
+      }
+     
+      .new-tag {
+        width: 6px;
+        height: 6px;
+        display: inline-block;
+        position: absolute;
+        left: -12px;
+        top: 50%;
+        transform: translateY(-50%);
+        border-radius: 50%;
+        background: #f00;
+      }
+    }
+    .nodata {
+      text-align: center;
+      padding: 40px 0;
+      color: #999;
+    }
+  }
+}
+</style>

+ 538 - 0
src/views/dataEntry_manage/thirdBase/selfDataBase.vue

@@ -0,0 +1,538 @@
+<template>
+  <div class="selfData-page">
+    <div class="header">
+      <div class="left">
+        <el-select
+          v-model="filterObj.source"
+          @change="filterChange"
+          :placeholder="$t('SelftDataPage.ph_channel')"
+          clearable
+        >
+          <el-option 
+            v-for="item in sourceOptions" 
+            :key="item.EdbBusinessSourceId" 
+            :label="item.SourceName" 
+            :value="item.EdbBusinessSourceId"
+          />
+        </el-select>
+
+        <el-select
+          v-model="filterObj.frequency"
+          @change="filterChange"
+          :placeholder="$t('Edb.InputHolderAll.input_fre')"
+          clearable
+        >
+          <el-option v-for="item in frequencyOptions" :key="item.val" :label="item.label" :value="item.val"/>
+        </el-select>
+
+        <el-input 
+          v-model="filterObj.keyWord" 
+          :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
+          style="width: 250px;"
+          @change="filterChange"
+          clearable
+          >
+          <i slot="prefix" class="el-input__icon el-icon-search"/>
+        </el-input>
+
+        <el-checkbox 
+            v-model="filterObj.checkAll"
+            :indeterminate="filterObj.checkSome"
+            :disabled="tableData.length===0"
+            style="margin-left:20px" 
+            @change="listCheckAllChange"
+          ><!-- 列表全选 -->{{$t('SystemManage.OperateAuth.all_select')}}</el-checkbox>
+      </div>
+
+      <el-button 
+        v-permission="permissionBtn.dataSourcePermission.selfData_addEdb"
+        type="primary" 
+        @click="handleCheckEdb('multiple')"
+      ><!-- 添加到指标库 -->{{$t('YsDataPage.add_base_btn')}}</el-button>
+    </div>
+
+    <div class="main">
+      <el-table
+        :data="tableData"
+        ref="table"
+        element-loading-text="加载中..."
+        v-loading="tableLoading"
+        border
+        style="margin:20px 0"
+        @selection-change="selectionChange"
+        @select="selectHandle" 
+        @select-all="selectAllPageHandle"
+        @sort-change="handleSortChange"
+      >
+          <el-table-column
+            type="selection"
+            width="55"
+          />
+          <el-table-column
+            v-for="item in tableColums"
+            :key="item.label"
+            :label="item.label"
+            :prop="item.key"
+            :width="item.widthsty"
+            :min-width="item.minwidthsty"
+            :sortable="item.sortable?true:false"
+            align="center"
+          >
+            <template slot-scope="{row}">
+              <template v-if="item.key==='handle'">
+                <span 
+                  class="editsty"
+                  @click="lookDataHandle(row)"
+                >
+                  <!-- 查看数据 -->{{$t('Edb.detail_lookdata_btn')}}
+                </span>
+
+                <span 
+                  class="editsty"
+                  v-if="!row.EdbInfoId" 
+                  @click="handleCheckEdb('single',row)"
+                >
+                  <!-- 添加到指标库 -->{{$t('YsDataPage.add_base_btn')}}
+                </span>
+              </template>
+
+              <span v-else>{{ row[item.key] }}</span>
+            </template>
+          </el-table-column>
+          
+          <div slot="empty" style="padding: 100px 0">
+            <tableNoData :text="$t('Table.prompt_slogan')" size="mini"/>
+          </div>
+      </el-table>
+
+      <div style="height:35px;margin: 20px 0;">
+        <m-page
+          :page_no="page_no"
+          :pageSize="pageSize"
+          :total="total"
+          @handleCurrentChange="pageChange"
+        />
+      </div>
+    </div>
+
+    <!-- 查看数据弹窗 -->
+    <lookEdbDataDia
+      :isShow.sync="isLookDataDia"
+      :edbInfo="lookEdbInfo"
+    />
+
+    <!-- 加入指标库弹窗 -->
+    <addToBaseDia
+      :isShow.sync="isAddToBaseDia"
+      :list="addToBaseList"
+      @success="pageChange(1)"
+    />
+
+    <!-- 操作提示弹窗 -->
+    <el-dialog 
+      :title="$t('BloombergPage.operation_prompt')"
+      :visible.sync="isHintDialogShow"
+      :close-on-click-modal="false"
+      :modal-append-to-body="false"
+      @close="isHintDialogShow=false"
+      width="578px"
+      v-dialogDrag
+      center>
+      <div class="hint-dialog-wrap">
+          <p style="margin-bottom: 20px;">{{ hintText }}</p>
+          <ul>
+              <li v-for="(item,index) in existEdbList" :key="index" class="hint-item" @click="goToEdbBase(item)">
+                  {{ index+1 }}、{{ item.IndexName }}({{ item.IndexCode }})
+              </li>
+          </ul>
+      </div>
+      <div style="text-align: center;margin-bottom: 30px;">
+          <el-button type="primary" @click="handleCloseHintDia">{{$t('Dialog.known')}}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { selfDataInterface } from '@/api/modules/dataSource';
+import mPage from '@/components/mPage.vue';
+import lookEdbDataDia from './components/lookEdbDataDia.vue';
+import addToBaseDia from './components/addToBaseDia.vue';
+export default {
+  components: { mPage,lookEdbDataDia,addToBaseDia },
+  computed: {
+    tableColums() {
+        return [
+          {
+            label: this.$t('Edb.Detail.e_id'),
+            key: 'IndexCode',
+          },
+         {
+            label: this.$t('Edb.Detail.e_name'),
+            key: 'IndexName',
+          },
+          {
+            label: this.$t('Edb.Detail.e_fre'),
+            key: 'Frequency',
+          },
+          {
+            label: this.$t('Edb.Detail.e_unit'),
+            key: 'Unit',
+          },
+          {
+            label: /* '渠道' */this.$t('SelftDataPage.col_channel'),
+            key: 'SourceName',
+          },
+          {
+            label: /* '指标开始时间' */this.$t('SelftDataPage.col_start_time'),
+            key: 'StartDate',
+            sortable:true,
+          },
+          {
+            label: /* '指标最新时间' */this.$t('SelftDataPage.col_newest_time'),
+            key: 'DataUpdateTime',
+            sortable:true,
+          },
+          {
+            label: /* '入库时间' */this.$t('SelftDataPage.col_create'),
+            sortable:true,
+            key: 'CreateTime'
+          },
+          {
+            label: this.$t('Table.column_operations'),
+            key: 'handle'
+          },
+
+        ]
+    },
+
+    frequencyOptions(){
+      return [
+        { label:'日度',val: '日度' },
+        { label:'周度',val: '周度' },
+        { label:'旬度',val: '旬度' },
+        { label:'月度',val: '月度' },
+        { label:'季度',val: '季度' },
+        { label:'半年度',val: '半年度' },
+        { label:'年度',val: '年度' },
+      ]
+    },
+
+    hintText(){
+        let key = 0
+        if(this.existEdbList.length) key++
+        if(!this.addToBaseList.length) key++
+
+        return {
+            0:'',
+            1:this.$t('YsDataPage.haved_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
+            2:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
+        }[key]
+    }
+  },
+  data() {
+    return {
+      tableLoading: false,
+      total: 0,
+      
+      tableData: [],
+
+      sourceOptions: [],
+
+      isSelectAll: false, //真正意义上的全选或不全选
+      checkedList: [], //不全选勾选中的 或 全选取消勾的
+      selectionReactCancel:false,//手动设置选中中
+
+      filterObj: {
+        page_no: 1,
+        pageSize: 10,
+        source: '',
+        frequency: '',
+        keyWord: '',
+        sortParam:'',
+        sortType:'',
+        checkAll: false, //控制全选显示状态
+        checkSome: false
+      },
+
+      /* 查看数据弹窗 */
+      isLookDataDia: false,
+      lookEdbInfo: {},
+
+      /* 加入指标库弹窗 */
+      isAddToBaseDia: false,
+      addToType: 'multiple',
+      addToBaseList: [],//可加入的指标
+      existEdbList: [],//已存在的指标
+
+      /* 提示弹窗 */
+      isHintDialogShow: false,
+
+    }
+  },
+  mounted(){
+    this.getSource();
+    this.getTableData('init');
+  },
+  methods:{
+    getSource() {
+      selfDataInterface.getSourceList().then(res => {
+        if(res.Ret!==200 ) return
+
+        this.sourceOptions = res.Data || [];
+      })
+    },
+
+    getTableData(type='pageChange') {
+      this.tableLoading = true;
+
+      const { frequency,page_no,pageSize,keyWord,source,sortParam,sortType } = this.filterObj;
+
+      let params = {
+        Frequency: frequency,
+        CurrentIndex: page_no,
+        PageSize: pageSize,
+        Keywords: keyWord,
+        Source: source,
+        SortField: sortParam,
+        SortRule: sortType
+      }
+			selfDataInterface.getEdbList(params).then(res => {
+        this.tableLoading = false;
+        if( res.Ret!==200 )return
+
+        const { Data } = res;
+
+        this.tableData = Data.List || [];
+        this.total = Data.Paging.Totals;
+        
+        if(type==='filter'){
+          this.listCheckAllChange(true)
+        }else {
+          //页码变化 选中项不做清空
+          this.checkedSomeSelection()
+
+        }
+			});
+    },
+
+    /* 设置当页数据勾选状态 */
+    checkedSomeSelection() {
+      this.selectionReactCancel=true
+
+      if(!this.isSelectAll){
+          this.checkedList.map(_ =>{
+              let row = this.tableData.find(item => item.IndexCode==_.IndexCode)
+              if(row){ //设置部分选中
+                  setTimeout(()=>{
+                      this.$refs.table.toggleRowSelection(row,true)
+                  },20)
+              }
+          })
+      }else{
+          this.$refs.table &&this.$refs.table.toggleAllSelection()
+          this.checkedList.map(_ =>{
+              let row = this.tableData.find(item => item.IndexCode==_.IndexCode)
+              if(row){ //设置部分不勾选
+                  setTimeout(()=>{
+                      this.$refs.table.toggleRowSelection(row,false)
+                  },20)
+              }
+          })
+      }
+      setTimeout(()=>{
+          this.selectionReactCancel=false
+      },30)
+    },
+
+    //列表全选或全不选
+    listCheckAllChange(value){
+      this.checkedList = []
+      this.isSelectAll = value
+      this.$refs.table && this.$refs.table.clearSelection()
+
+      value && this.$refs.table && this.$refs.table.toggleAllSelection()
+    },
+
+    selectionChange() {
+      if(this.selectionReactCancel) return
+
+        //设置全选框状态 选中 半选 不选
+        setTimeout(()=>{
+            let filterChecked = Array.from(new Set(this.checkedList))
+            //全选
+            if(
+              (filterChecked.length===this.total&&this.total>0 && (!this.isSelectAll))
+                || (filterChecked.length === 0 && this.isSelectAll)
+            ){
+                this.filterObj.checkAll = true
+                this.filterObj.checkSome = false
+            //不选
+            }else if(
+              (filterChecked.length === 0 && (!this.isSelectAll))
+              || (filterChecked.length === this.total && this.isSelectAll)
+            ){
+                this.filterObj.checkAll = false
+                this.filterObj.checkSome = false
+            //半选
+            }else{
+                this.filterObj.checkAll = false
+                this.filterObj.checkSome=true
+            }
+        },1)
+    },
+
+    //单选
+    selectHandle(selection,row){ //当前选中的项是进选中还是取消选中中
+        if(this.selectionReactCancel) return 
+
+        //当前项是选中还是取消选
+        let haveChecked = selection.some(_ => _.IndexCode === row.IndexCode);
+
+        //全选取消选和不全选选中才有意义
+        if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
+          this.checkedList.push(row)
+        }else {
+          this.checkedList=this.checkedList.filter(_ => _.IndexCode!==row.IndexCode)
+        }
+    },
+
+    //整列选
+    selectAllPageHandle(selection){
+        if(this.selectionReactCancel) return 
+        
+        //当前页是选中还是取消
+        let haveChecked = selection && selection.length>0;
+
+        //全选取消选和不全选选中才有意义
+        if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
+          this.checkedList = [...this.checkedList,...this.tableData]
+        }else {
+
+          let pageIds = this.tableData.map(_ => _.IndexCode);
+          this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_.IndexCode))
+        }
+    },
+
+    handleSortChange({prop,order}) {
+      const propMap={
+          'StartDate':1,
+          'EndDate':2,
+          'ModifyTime':3
+      }
+      this.filterObj.sortParam = order?propMap[prop]||'':''
+      this.filterObj.sortType = order?order==='ascending'?1:2:''
+
+      this.filterChange()
+    },
+
+    // 页码改变
+    pageChange(page) {
+      this.filterObj.page_no = page;
+      this.getTableData('pageChange')
+    },
+
+    filterChange(val) {
+      this.filterObj.page_no = 1;
+      if(!val) {
+        this.isSelectAll = false
+        this.checkedList = []
+        this.filterObj.checkAll = false
+        this.filterObj.checkSome = false
+      }
+      this.getTableData(val?'filter':'')
+    },
+
+    /* 查看数据 */
+    lookDataHandle(item) {
+
+      this.lookEdbInfo = item;
+      this.isLookDataDia =  true
+    },
+
+    handleCheckEdb(type='multiple',data={}){
+
+      if(type==='multiple' && !this.checkedList.length && !this.isSelectAll) return this.$message.warning('请选择指标')
+
+      const {frequence,keyWord,sortParam,sortType} = this.filterObj
+
+      selfDataInterface.checkEdb({
+          Frequency:frequence,
+          Keywords:keyWord,
+          SortField:sortParam||0,
+          SortRule:sortType||0,
+          ListAll:type==='single'?false:this.isSelectAll,
+          IndexCodes:type==='single'?[data.IndexCode]:this.checkedList.map(_=>_.IndexCode)
+      }).then(res=>{
+          if(res.Ret!==200) return 
+
+          const edbList = res.Data||[]
+          this.existEdbList = edbList.filter(i=>i.EdbExist===1)
+          this.addToBaseList = edbList.filter(i=>i.EdbExist===0)
+
+          this.existEdbList.length&&(this.isHintDialogShow=true)
+          !this.existEdbList.length&&this.handleCloseHintDia()
+      })
+    },
+
+    //提示弹窗关闭
+    handleCloseHintDia(){
+        this.isHintDialogShow = false
+        //判断是否要展示下一个弹窗
+        if(!this.addToBaseList.length) return
+        
+        if(this.addToBaseList.length>100) return this.$message.warning('批量添加指标数量不得超过100个!')
+
+        this.isAddToBaseDia = true
+    },
+
+    //跳转至指标详情
+    goToEdbBase(data){
+        const {EdbClassifyId,EdbInfoId,EdbUniqueCode} = data||{}
+        const { href } = this.$router.resolve({
+            path:'/database',
+            query:{
+                code:EdbUniqueCode,
+                id:EdbInfoId,
+                classifyId:EdbClassifyId,
+            }
+        })
+        window.open(href,"_blank")
+    }
+
+  },
+}
+</script>
+<style scoped lang='scss'>
+.selfData-page {
+    min-height: calc(100vh - 120px);
+    display: flex;
+    flex-direction: column;
+    background-color: #fff;
+    border: 1px solid #c8cdd9;
+    border-radius: 4px;
+    box-shadow: 0 3px 6px rgba(0, 0, 0, .05);
+    padding: 20px;
+    box-sizing: border-box;
+
+    .header {
+      display: flex;
+      justify-content: space-between;
+      .left {
+        display: flex;
+        align-items: center;
+        gap: 10px;
+      }
+    }
+}
+.hint-dialog-wrap{
+    padding-bottom:30px;
+    .hint-item{
+        cursor: pointer;
+        margin-bottom: 10px;
+        &:hover{
+            color:#409EFF;
+            text-decoration: underline;
+        }
+    }
+}
+</style>

+ 4 - 2
src/views/system_manage/dataOperaAuth.vue

@@ -582,8 +582,10 @@ export default {
     listCheckAllChange(value){
       this.checkedList = []
       this.isSelectAll = value
-    
-      value ? this.$refs.table && this.$refs.table.toggleAllSelection() : this.$refs.table && this.$refs.table.clearSelection()
+
+      this.$refs.table && this.$refs.table.clearSelection()
+
+      value && this.$refs.table && this.$refs.table.toggleAllSelection()
     },
 
     //筛选改变