|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="batch-opera-list">
|
|
<div class="batch-opera-list">
|
|
- <div class="header">
|
|
|
|
|
|
+ <div class="header" v-if="step===1">
|
|
<div class="left">
|
|
<div class="left">
|
|
|
|
|
|
<el-cascader
|
|
<el-cascader
|
|
@@ -10,10 +10,11 @@
|
|
label: 'ClassifyName',
|
|
label: 'ClassifyName',
|
|
value: 'ClassifyId',
|
|
value: 'ClassifyId',
|
|
children: 'Child',
|
|
children: 'Child',
|
|
- emitPath: false
|
|
|
|
|
|
+ emitPath: false,
|
|
|
|
+ multiple:true
|
|
}"
|
|
}"
|
|
style="width: 200px;"
|
|
style="width: 200px;"
|
|
- placeholder="品种"
|
|
|
|
|
|
+ :placeholder="$t('ManualEntryPage.label_vaiety')"
|
|
clearable
|
|
clearable
|
|
@change="filterChange"
|
|
@change="filterChange"
|
|
/>
|
|
/>
|
|
@@ -23,22 +24,25 @@
|
|
@change="filterChange"
|
|
@change="filterChange"
|
|
:placeholder="$t('Edb.InputHolderAll.input_fre')"
|
|
:placeholder="$t('Edb.InputHolderAll.input_fre')"
|
|
clearable
|
|
clearable
|
|
|
|
+ multiple
|
|
>
|
|
>
|
|
<el-option v-for="item in frequencyOptions" :key="item.val" :label="item.label" :value="item.val"/>
|
|
<el-option v-for="item in frequencyOptions" :key="item.val" :label="item.label" :value="item.val"/>
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
|
<el-cascader
|
|
<el-cascader
|
|
- v-model="filterObj.user"
|
|
|
|
|
|
+ v-model="filterObj.users"
|
|
:options="userOptions"
|
|
:options="userOptions"
|
|
:props="{
|
|
:props="{
|
|
- label: 'ChartClassifyName',
|
|
|
|
- value: 'ChartClassifyId',
|
|
|
|
|
|
+ label: 'NodeName',
|
|
|
|
+ value: 'NodeId',
|
|
children: 'Children',
|
|
children: 'Children',
|
|
- emitPath: false
|
|
|
|
|
|
+ emitPath: false,
|
|
|
|
+ multiple: true
|
|
}"
|
|
}"
|
|
style="width: 250px;"
|
|
style="width: 250px;"
|
|
placeholder="请选择创建人"
|
|
placeholder="请选择创建人"
|
|
clearable
|
|
clearable
|
|
|
|
+ @change="filterChange"
|
|
/>
|
|
/>
|
|
|
|
|
|
<el-input
|
|
<el-input
|
|
@@ -60,72 +64,170 @@
|
|
><!-- 列表全选 -->{{$t('SystemManage.OperateAuth.all_select')}}</el-checkbox>
|
|
><!-- 列表全选 -->{{$t('SystemManage.OperateAuth.all_select')}}</el-checkbox>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-button
|
|
|
|
- v-permission="permissionBtn.dataSourcePermission.selfData_addEdb"
|
|
|
|
- type="primary"
|
|
|
|
- @click="handleCheckEdb('multiple')"
|
|
|
|
|
|
+ <span>{{$t('SystemManage.OperateAuth.label_checked')}}:{{ isSelectAll ? (total-filterDuplicateChecked.length) : filterDuplicateChecked.length }}</span>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ v-if="$route.path==='/batchDelList'"
|
|
|
|
+ @click="handleBatchDel"
|
|
><!-- 批量删除 -->{{$t('ManualEntryPage.batch_del')}}</el-button>
|
|
><!-- 批量删除 -->{{$t('ManualEntryPage.batch_del')}}</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="main">
|
|
<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"
|
|
|
|
- >
|
|
|
|
- <el-table-column
|
|
|
|
- type="selection"
|
|
|
|
- width="55"
|
|
|
|
|
|
+ <template v-if="step===1">
|
|
|
|
+ <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"
|
|
|
|
+ >
|
|
|
|
+ <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"
|
|
|
|
+ align="center"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+
|
|
|
|
+ <template v-if="item.key==='SecName'">
|
|
|
|
+ <span style="white-space: pre-wrap;">{{ row.SecName }}</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"
|
|
/>
|
|
/>
|
|
- <el-table-column
|
|
|
|
- v-for="item in tableColums"
|
|
|
|
- :key="item.label"
|
|
|
|
- :label="item.label"
|
|
|
|
- :prop="item.key"
|
|
|
|
- :width="item.widthsty"
|
|
|
|
- :min-width="item.minwidthsty"
|
|
|
|
- align="center"
|
|
|
|
- >
|
|
|
|
- <template slot-scope="{row}">
|
|
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="add-handles-bot" v-if="$route.path==='/batchToBase'">
|
|
|
|
+ <el-button @click="$router.go(-1)" style="width:120px"><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
|
+ <el-button @click="handleNextStep" type="primary" style="width:120px;margin-left:5%;"><!-- 下一步 -->{{$t('Dialog.next_step')}}</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <!-- 第二步 -->
|
|
|
|
+ <template v-else>
|
|
|
|
+ <el-table
|
|
|
|
+ :data="addToBaseList"
|
|
|
|
+ border
|
|
|
|
+ height="500px"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_id')" align="center" prop="TradeCode">
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ {{$t('Edb.Detail.e_id')}}
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{scope.row.TradeCode}}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <template v-if="item.key==='IndexName'">
|
|
|
|
- <span style="white-space: pre-wrap;">{{ row.IndexName }}</span>
|
|
|
|
|
|
+ <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.SecName"
|
|
|
|
+ placeholder="请填写指标名称"
|
|
|
|
+ style="width:100%;margin:5px 0;"
|
|
|
|
+ :class="existNameArr.includes(scope.row.SecName)&&'error-ipt'"
|
|
|
|
+ />
|
|
|
|
+ <div class="error" v-if="existNameArr.includes(scope.row.SecName)">
|
|
|
|
+ <span>指标名称已存在,请重新填写</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
- <span v-else>{{ row[item.key] }}</span>
|
|
|
|
|
|
+ </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 frequencyOptions"
|
|
|
|
+ :key="item.val"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.val"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</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 class="add-handles-bot">
|
|
|
|
- <el-button @click="$router.go(-1)" style="width:120px"><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
|
- <el-button @click="saveMarker" type="primary" style="width:120px;margin-left:5%;"><!-- 下一步 -->{{$t('Dialog.next_step')}}</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <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.EtaClassifyId"
|
|
|
|
+ :options="edbBaseClassify"
|
|
|
|
+ :props="{
|
|
|
|
+ label: 'ClassifyName',
|
|
|
|
+ value: 'ClassifyId',
|
|
|
|
+ children: 'Children',
|
|
|
|
+ checkStrictly: true,
|
|
|
|
+ emitPath:false
|
|
|
|
+ }"
|
|
|
|
+ placeholder="请选择指标目录"
|
|
|
|
+ :disabled="(classifyType===1&&$index>0)"
|
|
|
|
+ @change="handleClassifyChange(row,$index)"
|
|
|
|
+ class="cascader-wrapper"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ <div style="text-align: center; margin: 30px 0">
|
|
|
|
+ <el-button @click="handlePrevStep">{{$t('Dialog.prev_step')}}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handleCheckName"
|
|
|
|
+ :loading="saveLoading"
|
|
|
|
+ >
|
|
|
|
+ {{ $t("Dialog.confirm_save_btn") }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { dataInterence } from '@/api/api.js';
|
|
|
|
|
|
+import { dataInterence,dataBaseInterface,departInterence } from '@/api/api.js';
|
|
import { selfDataInterface } from '@/api/modules/dataSource';
|
|
import { selfDataInterface } from '@/api/modules/dataSource';
|
|
import mPage from '@/components/mPage.vue';
|
|
import mPage from '@/components/mPage.vue';
|
|
export default {
|
|
export default {
|
|
@@ -135,11 +237,11 @@ export default {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
label: this.$t('Edb.Detail.e_id'),
|
|
label: this.$t('Edb.Detail.e_id'),
|
|
- key: 'IndexCode',
|
|
|
|
|
|
+ key: 'TradeCode',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: this.$t('Edb.Detail.e_name'),
|
|
label: this.$t('Edb.Detail.e_name'),
|
|
- key: 'IndexName',
|
|
|
|
|
|
+ key: 'SecName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: /* '最新日期' */this.$t('Edb.Detail.e_latest_date'),
|
|
label: /* '最新日期' */this.$t('Edb.Detail.e_latest_date'),
|
|
@@ -148,7 +250,7 @@ export default {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: /* '最新值' */this.$t('Edb.Detail.e_latest_value'),
|
|
label: /* '最新值' */this.$t('Edb.Detail.e_latest_value'),
|
|
- key: 'EndDate',
|
|
|
|
|
|
+ key: 'LatestValue',
|
|
sortable:true,
|
|
sortable:true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -193,6 +295,10 @@ export default {
|
|
1:this.$t('YsDataPage.haved_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
|
|
1:this.$t('YsDataPage.haved_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
|
|
2:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
|
|
2:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
|
|
}[key]
|
|
}[key]
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ filterDuplicateChecked() {
|
|
|
|
+ return Array.from(new Set(this.checkedList))
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -203,6 +309,7 @@ export default {
|
|
tableData: [],
|
|
tableData: [],
|
|
|
|
|
|
classifyList: [],
|
|
classifyList: [],
|
|
|
|
+ userOptions: [],
|
|
|
|
|
|
isSelectAll: false, //真正意义上的全选或不全选
|
|
isSelectAll: false, //真正意义上的全选或不全选
|
|
checkedList: [], //不全选勾选中的 或 全选取消勾的
|
|
checkedList: [], //不全选勾选中的 或 全选取消勾的
|
|
@@ -211,29 +318,76 @@ export default {
|
|
filterObj: {
|
|
filterObj: {
|
|
page_no: 1,
|
|
page_no: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- classify: '',
|
|
|
|
- frequency: '',
|
|
|
|
|
|
+ classify: [],
|
|
|
|
+ frequency: [],
|
|
|
|
+ users: [],
|
|
keyWord: '',
|
|
keyWord: '',
|
|
- sortParam:'',
|
|
|
|
- sortType:'',
|
|
|
|
checkAll: false, //控制全选显示状态
|
|
checkAll: false, //控制全选显示状态
|
|
checkSome: false
|
|
checkSome: false
|
|
},
|
|
},
|
|
|
|
|
|
- /* 加入指标库弹窗 */
|
|
|
|
- isAddToBaseDia: false,
|
|
|
|
- addToType: 'multiple',
|
|
|
|
|
|
+ step: 1,
|
|
|
|
+ classifyType:0,//目录方式
|
|
|
|
+ edbBaseClassify: [],
|
|
addToBaseList: [],//可加入的指标
|
|
addToBaseList: [],//可加入的指标
|
|
existEdbList: [],//已存在的指标
|
|
existEdbList: [],//已存在的指标
|
|
|
|
+ existNameArr:[]
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
this.getClassify();
|
|
this.getClassify();
|
|
this.getTableData('init');
|
|
this.getTableData('init');
|
|
|
|
+ this.getUserOptions()
|
|
|
|
+ this.$route.path === '/batchToBase'&& this.getEdbBaseClassify();
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- // 获取分类
|
|
|
|
|
|
+ /* 下一步 */
|
|
|
|
+ handleNextStep() {
|
|
|
|
+ if(!this.checkedList.length && !this.isSelectAll) return this.$message.warning('请选择指标')
|
|
|
|
+
|
|
|
|
+ const { frequency,keyWord,users,classify } = this.filterObj
|
|
|
|
+
|
|
|
|
+ dataInterence.checkAddListV2({
|
|
|
|
+ UserIdList: users,
|
|
|
|
+ FrequencyList:frequency,
|
|
|
|
+ ClassifyIdList: classify,
|
|
|
|
+ Keyword:keyWord,
|
|
|
|
+ ListAll:this.isSelectAll,
|
|
|
|
+ TradeCodeList:this.checkedList.map(_=>_.TradeCode)
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+
|
|
|
|
+ const edbList = res.Data||[]
|
|
|
|
+ this.existEdbList = edbList.filter(i=>i.IsJoinEdb===1)
|
|
|
|
+ this.addToBaseList = edbList.filter(i=>i.IsJoinEdb===0)
|
|
|
|
+
|
|
|
|
+ if(this.addToBaseList.length>30) return this.$message.warning('批量添加指标数量不得超过30个!')
|
|
|
|
+
|
|
|
|
+ this.step++
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ filterNodes(arr) {
|
|
|
|
+ arr.length &&
|
|
|
|
+ arr.forEach((item) => {
|
|
|
|
+ item.Children.length && this.filterNodes(item.Children);
|
|
|
|
+ if (!item.Children.length) {
|
|
|
|
+ delete item.Children;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 获取指标库分类
|
|
|
|
+ async getEdbBaseClassify(){
|
|
|
|
+ if(this.$route.path !== '/batchToBase') return
|
|
|
|
+
|
|
|
|
+ const res=await dataBaseInterface.menuListV3()
|
|
|
|
+ if (res.Ret !== 200) return
|
|
|
|
+ this.filterNodes(res.Data.AllNodes||[]);
|
|
|
|
+ this.edbBaseClassify = res.Data.AllNodes || [];
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取分类
|
|
getClassify() {
|
|
getClassify() {
|
|
dataInterence.getClassifyV2().then(res =>{
|
|
dataInterence.getClassifyV2().then(res =>{
|
|
if(res.Ret === 200 && res.Data.List) {
|
|
if(res.Ret === 200 && res.Data.List) {
|
|
@@ -242,21 +396,74 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 同目录修改
|
|
|
|
+ handleClassifyChange(e,index){
|
|
|
|
+ if(this.classifyType===1){
|
|
|
|
+ // 修改所有的指标的目录为第一个
|
|
|
|
+ this.addToBaseList.forEach(item=>{
|
|
|
|
+ item.EtaClassifyId=e.EtaClassifyId
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleClassifyTypeChange(){
|
|
|
|
+ this.handleClassifyChange(this.addToBaseList[0])
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleCheckName() {
|
|
|
|
+ //重名校验
|
|
|
|
+ this.existNameArr = []
|
|
|
|
+ dataInterence.checkAddListNameV2(
|
|
|
|
+ this.addToBaseList.map(_=>({EdbCode:_.TradeCode,EdbName:_.SecName}))
|
|
|
|
+ ).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.addToBaseList.some(_ => !_.SecName||!_.EtaClassifyId||!_.Unit)
|
|
|
|
+ if(haveIncomplete) return this.$message.warning('指标信息填写不完整')
|
|
|
|
+
|
|
|
|
+ this.saveLoading = true;
|
|
|
|
+ dataInterence.addToBaseBatchV2(
|
|
|
|
+ this.addToBaseList.map(i=>({
|
|
|
|
+ EdbCode: i.TradeCode,
|
|
|
|
+ EdbName: i.SecName,
|
|
|
|
+ Frequency: i.Frequency,
|
|
|
|
+ Unit: i.Unit,
|
|
|
|
+ ClassifyId: i.EtaClassifyId
|
|
|
|
+ }))
|
|
|
|
+ ).then(res=>{
|
|
|
|
+ this.saveLoading = false
|
|
|
|
+
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+ this.$message.success(this.$t('MsgPrompt.add_msg2'))
|
|
|
|
+
|
|
|
|
+ this.$router.replace({
|
|
|
|
+ path: '/dataList'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
getTableData(type='pageChange') {
|
|
getTableData(type='pageChange') {
|
|
this.tableLoading = true;
|
|
this.tableLoading = true;
|
|
|
|
|
|
- const { frequency,page_no,pageSize,keyWord,source,sortParam,sortType } = this.filterObj;
|
|
|
|
|
|
+ const { frequency,page_no,pageSize,keyWord,classify,users } = this.filterObj;
|
|
|
|
|
|
let params = {
|
|
let params = {
|
|
- Frequency: frequency,
|
|
|
|
|
|
+ UserIdList: users,
|
|
|
|
+ FrequencyList: frequency,
|
|
CurrentIndex: page_no,
|
|
CurrentIndex: page_no,
|
|
PageSize: pageSize,
|
|
PageSize: pageSize,
|
|
- Keywords: keyWord,
|
|
|
|
- Source: source,
|
|
|
|
- SortField: sortParam,
|
|
|
|
- SortRule: sortType
|
|
|
|
|
|
+ Keyword: keyWord,
|
|
|
|
+ ClassifyIdList: classify
|
|
}
|
|
}
|
|
- selfDataInterface.getEdbList(params).then(res => {
|
|
|
|
|
|
+ dataInterence.getBatchAddListV2(params).then(res => {
|
|
this.tableLoading = false;
|
|
this.tableLoading = false;
|
|
if( res.Ret!==200 )return
|
|
if( res.Ret!==200 )return
|
|
|
|
|
|
@@ -275,13 +482,31 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 获取所有用户
|
|
|
|
+ async getUserOptions() {
|
|
|
|
+ const res = await departInterence.getSystemUser()
|
|
|
|
+
|
|
|
|
+ if(res.Ret !== 200) return
|
|
|
|
+ this.userOptions = res.Data || []
|
|
|
|
+ this.filterUserEmpty(this.userOptions)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ filterUserEmpty(arr) {
|
|
|
|
+ arr.length && arr.forEach(item => {
|
|
|
|
+ item.Children && item.Children.length && this.filterUserEmpty(item.Children)
|
|
|
|
+ if (!item.Children || !item.Children.length) {
|
|
|
|
+ delete item.Children
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
/* 设置当页数据勾选状态 */
|
|
/* 设置当页数据勾选状态 */
|
|
checkedSomeSelection() {
|
|
checkedSomeSelection() {
|
|
this.selectionReactCancel=true
|
|
this.selectionReactCancel=true
|
|
|
|
|
|
if(!this.isSelectAll){
|
|
if(!this.isSelectAll){
|
|
this.checkedList.map(_ =>{
|
|
this.checkedList.map(_ =>{
|
|
- let row = this.tableData.find(item => item.IndexCode==_.IndexCode)
|
|
|
|
|
|
+ let row = this.tableData.find(item => item.TradeCode==_.TradeCode)
|
|
if(row){ //设置部分选中
|
|
if(row){ //设置部分选中
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.$refs.table.toggleRowSelection(row,true)
|
|
this.$refs.table.toggleRowSelection(row,true)
|
|
@@ -291,7 +516,7 @@ export default {
|
|
}else{
|
|
}else{
|
|
this.$refs.table &&this.$refs.table.toggleAllSelection()
|
|
this.$refs.table &&this.$refs.table.toggleAllSelection()
|
|
this.checkedList.map(_ =>{
|
|
this.checkedList.map(_ =>{
|
|
- let row = this.tableData.find(item => item.IndexCode==_.IndexCode)
|
|
|
|
|
|
+ let row = this.tableData.find(item => item.TradeCode==_.TradeCode)
|
|
if(row){ //设置部分不勾选
|
|
if(row){ //设置部分不勾选
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.$refs.table.toggleRowSelection(row,false)
|
|
this.$refs.table.toggleRowSelection(row,false)
|
|
@@ -346,13 +571,13 @@ export default {
|
|
if(this.selectionReactCancel) return
|
|
if(this.selectionReactCancel) return
|
|
|
|
|
|
//当前项是选中还是取消选
|
|
//当前项是选中还是取消选
|
|
- let haveChecked = selection.some(_ => _.IndexCode === row.IndexCode);
|
|
|
|
|
|
+ let haveChecked = selection.some(_ => _.TradeCode === row.TradeCode);
|
|
|
|
|
|
//全选取消选和不全选选中才有意义
|
|
//全选取消选和不全选选中才有意义
|
|
if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
this.checkedList.push(row)
|
|
this.checkedList.push(row)
|
|
}else {
|
|
}else {
|
|
- this.checkedList=this.checkedList.filter(_ => _.IndexCode!==row.IndexCode)
|
|
|
|
|
|
+ this.checkedList=this.checkedList.filter(_ => _.TradeCode!==row.TradeCode)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -368,8 +593,8 @@ export default {
|
|
this.checkedList = [...this.checkedList,...this.tableData]
|
|
this.checkedList = [...this.checkedList,...this.tableData]
|
|
}else {
|
|
}else {
|
|
|
|
|
|
- let pageIds = this.tableData.map(_ => _.IndexCode);
|
|
|
|
- this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_.IndexCode))
|
|
|
|
|
|
+ let pageIds = this.tableData.map(_ => _.TradeCode);
|
|
|
|
+ this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_.TradeCode))
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -381,54 +606,70 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
filterChange(val) {
|
|
filterChange(val) {
|
|
|
|
+ console.log(val)
|
|
this.filterObj.page_no = 1;
|
|
this.filterObj.page_no = 1;
|
|
- if(!val) {
|
|
|
|
|
|
+ if(!val||!val.length) {
|
|
this.isSelectAll = false
|
|
this.isSelectAll = false
|
|
this.checkedList = []
|
|
this.checkedList = []
|
|
this.filterObj.checkAll = false
|
|
this.filterObj.checkAll = false
|
|
this.filterObj.checkSome = false
|
|
this.filterObj.checkSome = false
|
|
}
|
|
}
|
|
- this.getTableData(val?'filter':'')
|
|
|
|
|
|
+ this.getTableData(val.length?'filter':'')
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /* 批量删除 */
|
|
|
|
+ handleBatchDel(data={}){
|
|
|
|
|
|
- handleCheckEdb(type='multiple',data={}){
|
|
|
|
|
|
+ if(!this.checkedList.length && !this.isSelectAll) return this.$message.warning('请选择指标')
|
|
|
|
|
|
- if(type==='multiple' && !this.checkedList.length && !this.isSelectAll) return this.$message.warning('请选择指标')
|
|
|
|
|
|
+ const { frequency,keyWord,users,classify } = this.filterObj
|
|
|
|
|
|
- const {frequence,keyWord,sortParam,sortType} = this.filterObj
|
|
|
|
|
|
+ let params = {
|
|
|
|
+ UserIdList: users,
|
|
|
|
+ FrequencyList:frequency,
|
|
|
|
+ ClassifyIdList: classify,
|
|
|
|
+ Keyword:keyWord,
|
|
|
|
+ ListAll:this.isSelectAll,
|
|
|
|
+ TradeCodeList:this.checkedList.map(_=>_.TradeCode)
|
|
|
|
+ }
|
|
|
|
|
|
- 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=>{
|
|
|
|
|
|
+ dataInterence.checkDelListV2(params).then(res=>{
|
|
if(res.Ret!==200) return
|
|
if(res.Ret!==200) return
|
|
|
|
|
|
const edbList = res.Data||[]
|
|
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()
|
|
|
|
|
|
+ this.existEdbList = edbList.filter(i=>i.IsJoinEdb===1)
|
|
|
|
+
|
|
|
|
+ if(this.existEdbList.length) {
|
|
|
|
+ let existCode = this.existEdbList.map(_ => _.TradeCode).join(',');
|
|
|
|
+ this.$alert(`${existCode}已加入指标库,不可删除`,this.$t('Confirm.prompt'),{
|
|
|
|
+ confirmButtonText: '知道了',
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ }).catch(()=>{})
|
|
|
|
+
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$confirm('删除操作不可撤销,确定删除吗?',this.$t('Dialog.warn_tit'),{
|
|
|
|
+ confirmButtonText:/* "确定" */this.$t('Dialog.confirm_btn'),
|
|
|
|
+ cancelButtonText:/* "取消" */this.$t('Dialog.cancel_btn'),
|
|
|
|
+ type:"warning"
|
|
|
|
+ }).then(()=>{
|
|
|
|
+ this.handleDelApi(params);
|
|
|
|
+ }).catch(()=>{})
|
|
|
|
+
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
- //跳转至指标详情
|
|
|
|
- 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")
|
|
|
|
|
|
+ async handleDelApi(params) {
|
|
|
|
+ const res = await dataInterence.delEdbBatchV2(params)
|
|
|
|
+ this.saveLoading = false
|
|
|
|
+
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+ this.$message.success(this.$t('MsgPrompt.delete_msg'))
|
|
|
|
+
|
|
|
|
+ this.$router.replace({
|
|
|
|
+ path: '/dataList'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -449,6 +690,7 @@ export default {
|
|
.header {
|
|
.header {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
.left {
|
|
.left {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|