|
@@ -1,217 +1,144 @@
|
|
|
<template>
|
|
|
- <el-dialog
|
|
|
- :visible.sync="isShow"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :modal-append-to-body="false"
|
|
|
- @close="handleClose"
|
|
|
- custom-class="batch-computed-dialog fit-screen-dialog"
|
|
|
- center
|
|
|
- top="5vh"
|
|
|
- v-dialogDrag
|
|
|
- title="批量选择指标"
|
|
|
- >
|
|
|
+ <el-dialog :visible.sync="isShow" :close-on-click-modal="false" :modal-append-to-body="false" @close="handleClose" custom-class="batch-computed-dialog fit-screen-dialog" center top="5vh" v-dialogDrag title="批量选择指标">
|
|
|
<div class="batch-computed-wrap">
|
|
|
<div class="filter-wrap" style="margin-top: 20px">
|
|
|
- <p style="margin-bottom: 10px">
|
|
|
- {{ $t("EtaBasePage.pending_metrics", { num: 100 }) }}
|
|
|
- </p>
|
|
|
+ <div style="position: relative;top: -20px;">
|
|
|
+ <el-radio-group v-model="edbType">
|
|
|
+ <el-radio :label="0" style="margin-right: 15px"><!-- ETA指标 -->{{ $t("Edb.eta_name") }}</el-radio>
|
|
|
+ <el-radio :label="1"><!-- ETA预测指标 -->{{ $t("Edb.eta_predictor_name") }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
<div>
|
|
|
- <el-cascader
|
|
|
- v-model="filter.classify"
|
|
|
- :options="classifyOpt"
|
|
|
- :props="classifyProps"
|
|
|
- clearable
|
|
|
- collapse-tags
|
|
|
- :placeholder="$t('EtaBasePage.label_classify')"
|
|
|
- style="width: 240px"
|
|
|
- @change="handleFilter"
|
|
|
- />
|
|
|
- <el-select
|
|
|
- v-model="filter.frequency"
|
|
|
- :placeholder="$t('EtaBasePage.select_frequency')"
|
|
|
- style="width: 140px"
|
|
|
- clearable
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
- @change="handleFilter"
|
|
|
- :disabled="[5, 61].includes(subComputedType)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in frequencyArr"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
+ <el-cascader key="isAssociativeSub" v-if="isAssociativeSub" v-model="filter.classify" :options="classifyOpt" :props="classifyProps" clearable collapse-tags :placeholder="$t('EtaBasePage.label_classify')" style="width: 200px" @change="handleFilter" />
|
|
|
+ <el-cascader key="notAssociativeSub" v-else v-model="filter.classify" :options="classifyOpt" :props="classifyProps" clearable collapse-tags :placeholder="$t('EtaBasePage.label_classify')" style="width: 200px" @change="handleFilter" />
|
|
|
+ <span>
|
|
|
+ <span>关联子分类</span>
|
|
|
+ <el-switch v-model="isAssociativeSub" @change="handleAssociativeSubChange"></el-switch>
|
|
|
+ </span>
|
|
|
+ <el-select v-model="filter.frequency" :placeholder="$t('EtaBasePage.select_frequency')" style="width: 140px" clearable multiple collapse-tags @change="handleFilter">
|
|
|
+ <el-option v-for="item in frequencyArr" :key="item.value" :label="item.value" :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-cascader
|
|
|
- v-model="filter.user"
|
|
|
- :placeholder="$t('EtaBasePage.table_col_creator')"
|
|
|
- :options="sysUserOpts"
|
|
|
- :props="sysUserProps"
|
|
|
- collapse-tags
|
|
|
- :show-all-levels="false"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- style="width: 240px"
|
|
|
- @change="handleFilter"
|
|
|
- />
|
|
|
- <el-input
|
|
|
- :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
|
|
|
- v-model="filter.keyword"
|
|
|
- style="width: 200px"
|
|
|
- @keydown.enter.native="handleFilter"
|
|
|
- >
|
|
|
+ <el-cascader v-model="filter.user" :placeholder="$t('EtaBasePage.table_col_creator')" :options="sysUserOpts" :props="sysUserProps" collapse-tags :show-all-levels="false" clearable filterable
|
|
|
+ style="width: 240px" @change="handleFilter" />
|
|
|
+ <el-input :placeholder="$t('Edb.InputHolderAll.input_name_orid')" v-model="filter.keyword" style="width: 200px" @keydown.enter.native="handleFilter">
|
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
</el-input>
|
|
|
- <el-checkbox
|
|
|
- :label="$t('EtaBasePage.label_all_check')"
|
|
|
- v-model="isCheckAll"
|
|
|
- :indeterminate="isCheckIndeterminate"
|
|
|
- style="margin-left: 10px"
|
|
|
- @change="listCheckAllChange"
|
|
|
- :disabled="operationForm.view"
|
|
|
- />
|
|
|
+ <el-checkbox :label="$t('EtaBasePage.label_all_check')" v-model="isCheckAll" :indeterminate="isCheckIndeterminate" style="margin-left: 10px" @change="listCheckAllChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="table-wrap">
|
|
|
<div class="left-box">
|
|
|
- <el-table
|
|
|
- :data="list"
|
|
|
- border
|
|
|
- @sort-change="sortChange"
|
|
|
- @selection-change="selectionChange"
|
|
|
- ref="edbDataRef"
|
|
|
- @select="selectHandle"
|
|
|
- @select-all="selectAllHandle"
|
|
|
- height="500px"
|
|
|
- v-loading="listLoading"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- min-width="50"
|
|
|
- align="center"
|
|
|
- :selectable="filterEdbAuth"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- :label="$t('EtaBasePage.full_metric_name')"
|
|
|
- show-overflow-tooltip
|
|
|
- align="center"
|
|
|
- :prop="$parent.currentLang === 'en' ? 'EdbNameEn' : 'EdbName'"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- :label="$t('Edb.Detail.e_latest_date')"
|
|
|
- align="center"
|
|
|
- prop="EndDate"
|
|
|
- width="120px"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- :label="$t('Edb.Detail.e_latest_value')"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- prop="EndValue"
|
|
|
- width="80px"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- :label="$t('EtaBasePage.table_col_creator')"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- prop="SysUserRealName"
|
|
|
- width="80px"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- :label="$t('Edb.Detail.e_fre')"
|
|
|
- align="center"
|
|
|
- prop="Frequency"
|
|
|
- width="50px"
|
|
|
- >
|
|
|
+ <el-table :data="list" border @sort-change="sortChange" @selection-change="selectionChange" ref="edbDataRef" @select="selectHandle" @select-all="selectAllHandle" height="500px" v-loading="listLoading">
|
|
|
+ <el-table-column type="selection" min-width="50" align="center" :selectable="filterEdbAuth" />
|
|
|
+ <el-table-column :label="$t('EtaBasePage.full_metric_name')" show-overflow-tooltip align="center" :prop="$parent.currentLang === 'en' ? 'EdbNameEn' : 'EdbName'" />
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_latest_date')" align="center" prop="EndDate" width="120px" />
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_latest_value')" align="center" show-overflow-tooltip prop="EndValue" width="80px" />
|
|
|
+ <el-table-column :label="$t('EtaBasePage.table_col_creator')" align="center" show-overflow-tooltip prop="SysUserRealName" width="80px" />
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_fre')" align="center" prop="Frequency" width="50px">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ getFrequencyTrans(scope.row.Frequency) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- :label="$t('Edb.Detail.e_unit')"
|
|
|
- show-overflow-tooltip
|
|
|
- align="center"
|
|
|
- :prop="$parent.currentLang === 'en' ? 'UnitEn' : 'Unit'"
|
|
|
- width="50px"
|
|
|
- >
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_unit')" show-overflow-tooltip align="center" :prop="$parent.currentLang === 'en' ? 'UnitEn' : 'Unit'" width="50px">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ getUnitTrans(scope.row.Unit) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <m-page
|
|
|
- style="margin-top: 10px"
|
|
|
- class="table-page"
|
|
|
- v-show="total"
|
|
|
- :total="total"
|
|
|
- :pageSize="pageSize"
|
|
|
- :page_no="page"
|
|
|
- :pagercount="5"
|
|
|
- @handleCurrentChange="pageNumberChange"
|
|
|
- />
|
|
|
+ <m-page style="margin-top: 10px" class="table-page" v-show="total" :total="total" :pageSize="pageSize" :page_no="page" :pagercount="5" @handleCurrentChange="pageNumberChange" />
|
|
|
</div>
|
|
|
<div style="padding-top: 200px; margin: 0 30px">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :disabled="operationForm.view"
|
|
|
- :loading="addLoading"
|
|
|
- @click="getAddEdbListData"
|
|
|
- >
|
|
|
- <!-- 加入已选指标 -->
|
|
|
+ <el-button type="primary" :loading="addLoading" @click="getAddEdbListData">
|
|
|
{{ $t("EtaBasePage.add_to_selections") }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="right-box">
|
|
|
<el-table :data="selectList" border height="500px">
|
|
|
- <el-table-column
|
|
|
- :label="$t('EtaBasePage.full_metric_name')"
|
|
|
- show-overflow-tooltip
|
|
|
- align="center"
|
|
|
- :prop="$parent.currentLang === 'en' ? 'EdbNameEn' : 'EdbName'"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- width="50px"
|
|
|
- align="center"
|
|
|
- v-if="!operationForm.view"
|
|
|
- >
|
|
|
+ <el-table-column :label="$t('EtaBasePage.full_metric_name')" show-overflow-tooltip align="center" :prop="$parent.currentLang === 'en' ? 'EdbNameEn' : 'EdbName'" />
|
|
|
+ <el-table-column width="50px" align="center">
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
- <img
|
|
|
- @click="handleDelSelect('all')"
|
|
|
- style="width: 15px; height: 15px; cursor: pointer"
|
|
|
- src="~@/assets/img/ai_m/delete.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <img @click="handleDelSelect('all')" style="width: 15px; height: 15px; cursor: pointer" src="~@/assets/img/ai_m/delete.png" alt="" />
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
|
- <img
|
|
|
- @click="handleDelSelect(scope)"
|
|
|
- style="width: 15px; height: 15px; cursor: pointer"
|
|
|
- src="~@/assets/img/ai_m/delete.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <img @click="handleDelSelect(scope)" style="width: 15px; height: 15px; cursor: pointer" src="~@/assets/img/ai_m/delete.png" alt="" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="text-align: center; margin: 60px 0 40px 0">
|
|
|
- <el-button type="primary" plain @click="handleCloseSelf">{{
|
|
|
+ <el-button type="primary" plain @click="handleClose">{{
|
|
|
$t("Dialog.cancel_btn")
|
|
|
}}</el-button>
|
|
|
- <el-button type="primary" @click="handleNextStep">{{
|
|
|
- $t("Dialog.next_step")
|
|
|
- }}</el-button>
|
|
|
+ <el-button type="primary" @click="handleNextStep">{{ $t("Dialog.confirm_btn") }}</el-button>
|
|
|
+ <div style="float:right;width: 300px;display: flex;align-items: center;">
|
|
|
+ <span style="flex-shrink: 0;">指标系列名称</span>
|
|
|
+ <el-input v-model="seriesName"></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { dataBaseInterface, departInterence } from '@/api/api.js';
|
|
|
+import mPage from '@/components/mPage.vue'
|
|
|
export default {
|
|
|
+ components:{mPage},
|
|
|
+ props: {
|
|
|
+ isShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ frequencyArr() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ value: '日度',
|
|
|
+ label: /* '日度' */this.$t('Edb.FreAll.day'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '周度',
|
|
|
+ label: /* '周度' */this.$t('Edb.FreAll.week'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '旬度',
|
|
|
+ label: /* '旬度' */this.$t('Edb.FreAll.dekad'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '月度',
|
|
|
+ label: /* '月度' */this.$t('Edb.FreAll.month'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '季度',
|
|
|
+ label: /* '季度' */ this.$t('Edb.FreAll.quarter'),
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ value: '年度',
|
|
|
+ label: /* '年度' */ this.$t('Edb.FreAll.year'),
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ classifyProps(){
|
|
|
+ return {
|
|
|
+ label: 'ClassifyName',
|
|
|
+ value: 'ClassifyId',
|
|
|
+ children: 'Children',
|
|
|
+ multiple: true,
|
|
|
+ emitPath: false,
|
|
|
+ checkStrictly:!this.isAssociativeSub
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ MAXAddNUM:100,
|
|
|
+
|
|
|
+ edbType: 0,//0指标库 1预测指标库
|
|
|
+
|
|
|
select_target: '',
|
|
|
searchOptions: [],//指标列表
|
|
|
search_have_more: false,
|
|
@@ -225,14 +152,8 @@ export default {
|
|
|
keyword: ''
|
|
|
},
|
|
|
|
|
|
+ isAssociativeSub: true,//是否关联子分类
|
|
|
classifyOpt: [],
|
|
|
- classifyProps: {
|
|
|
- label: 'ClassifyName',
|
|
|
- value: 'ClassifyId',
|
|
|
- children: 'Children',
|
|
|
- multiple: true,
|
|
|
- emitPath: false
|
|
|
- },
|
|
|
sysUserOpts: [],
|
|
|
sysUserProps: {
|
|
|
value: "AdminId",
|
|
@@ -259,10 +180,323 @@ export default {
|
|
|
selectList: [],//添加到右侧的数据
|
|
|
addLoading: false,
|
|
|
|
|
|
+ seriesName:'Series',
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.getClassifyOpt()
|
|
|
+ this.getSysUserList()
|
|
|
+ this.getEDBList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData(e){
|
|
|
+ this.selectList=e.edbList
|
|
|
+ this.seriesName=e.seriesName
|
|
|
+ },
|
|
|
+ handleNextStep(){
|
|
|
+ if(this.selectList.length===0){
|
|
|
+ this.$message.warning(/* "请选择指标" */this.$t('Edb.InputHolderAll.input_select_edb'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.seriesName){
|
|
|
+ this.$message.warning(this.$t('Chart.Vailds.serie_name_msg'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$emit('success',{
|
|
|
+ seriesName:this.seriesName,
|
|
|
+ edbList:this.selectList
|
|
|
+ })
|
|
|
+ this.$emit('close')
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ handleClose() {
|
|
|
+ this.$emit('close')
|
|
|
+ },
|
|
|
+
|
|
|
+ handleAssociativeSubChange(){
|
|
|
+ this.filter.classify=''
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击加入已选指标库
|
|
|
+ async getAddEdbListData() {
|
|
|
+ if (!(this.isCheckAll || this.isCheckIndeterminate) || (!(this.list && this.list.length > 0))) {
|
|
|
+ this.$message.warning(/* "请选择指标" */this.$t('Edb.InputHolderAll.input_select_edb'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.selectList.length >= this.MAXAddNUM) {
|
|
|
+ this.$message.warning(/* "已达批量添加指标数量上限" */this.$t('EtaBasePage.limit_indicators_msg'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ SysUserIds: this.filter.user ? this.filter.user.join(',') : '',
|
|
|
+ ClassifyIds: this.filter.classify ? this.filter.classify.join(',') : '',
|
|
|
+ Keyword: this.filter.keyword,
|
|
|
+ Frequency: this.filter.frequency ? this.filter.frequency.join(',') : '',
|
|
|
+ SelectAll: this.checkAllStatus,
|
|
|
+ EdbInfoIds: this.tableDataCheckedList.join(',')
|
|
|
+ }
|
|
|
+ this.addLoading = true
|
|
|
+ const res = await dataBaseInterface.getBatchFilterAddEdbList(params)
|
|
|
+ this.addLoading = false
|
|
|
+ if (res.Ret != 200) return
|
|
|
+ // 加入到已选指标中 要去重
|
|
|
+ const arr = res.Data.SearchItem || []
|
|
|
+ const temArr = this.mergeAndDistinct(this.selectList, arr)
|
|
|
+ // 截取数组 防止数量溢出
|
|
|
+ this.selectList = temArr.filter(_ => _.HaveOperaAuth).slice(0, this.MAXAddNUM)
|
|
|
+ },
|
|
|
+ mergeAndDistinct(arr1, arr2) {
|
|
|
+ // 合并两个数组
|
|
|
+ const mergedArray = arr1.concat(arr2);
|
|
|
+
|
|
|
+ // 根据 EdbInfoId 字段进行去重
|
|
|
+ const distinctArray = mergedArray.filter((item, index, self) => {
|
|
|
+ return index === self.findIndex(t => t.EdbInfoId === item.EdbInfoId);
|
|
|
+ });
|
|
|
+
|
|
|
+ return distinctArray;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除已选指标库指标
|
|
|
+ handleDelSelect(e) {
|
|
|
+ if (this.operationForm.view) return
|
|
|
+ if (e === 'all') {
|
|
|
+ this.selectList = []
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const index = e.$index
|
|
|
+ this.selectList.splice(index, 1)
|
|
|
+ },
|
|
|
+
|
|
|
+ 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 || [];
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取所有系统用户
|
|
|
+ async getSysUserList() {
|
|
|
+ const res = await departInterence.getQuestionAdminList();
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.sysUserOpts = res.Data.List || [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取指标列表
|
|
|
+ async getEDBList(type) {
|
|
|
+ this.listLoading = true
|
|
|
+ const res = await dataBaseInterface.getBatchAddEdbSearchList({
|
|
|
+ CurrentIndex: this.page,
|
|
|
+ PageSize: this.pageSize,
|
|
|
+ SysUserIds: this.filter.user ? this.filter.user.join(',') : '',
|
|
|
+ ClassifyIds: this.filter.classify ? this.filter.classify.join(',') : '',
|
|
|
+ Keyword: this.filter.keyword,
|
|
|
+ Frequency: this.filter.frequency ? this.filter.frequency.join(',') : '',
|
|
|
+ })
|
|
|
+ this.listLoading = false
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.list = res.Data.SearchItem || []
|
|
|
+ this.total = res.Data.Paging.Totals || 0
|
|
|
+
|
|
|
+ if (this.list.length > 0) {
|
|
|
+ this.tableDataIds = this.list.map(it => it.EdbInfoId)
|
|
|
+ } else {
|
|
|
+ this.tableDataIds = []
|
|
|
+ }
|
|
|
+
|
|
|
+ if (type == 'adjustSelection') {
|
|
|
+ this.adjustSelection()
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.isCheckAll = false
|
|
|
+ this.checkAllStatus = false
|
|
|
+ this.isCheckIndeterminate = false
|
|
|
+
|
|
|
+ this.listCheckAllChange(this.isCheckAll)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ pageNumberChange(e) {
|
|
|
+ this.page = e
|
|
|
+ this.getEDBList('adjustSelection')
|
|
|
+ },
|
|
|
+
|
|
|
+ handleFilter(e) {
|
|
|
+ this.page = 1
|
|
|
+ this.list = []
|
|
|
+ this.getEDBList()
|
|
|
+ },
|
|
|
+
|
|
|
+ // 切换列表全选按钮状态
|
|
|
+ listCheckAllChange(check) {
|
|
|
+ this.tableDataCheckedList = []
|
|
|
+ this.checkAllStatus = check
|
|
|
+ if (check) {
|
|
|
+ // 全选
|
|
|
+ this.$refs.edbDataRef && this.$refs.edbDataRef.clearSelection()
|
|
|
+ this.$refs.edbDataRef && this.$refs.edbDataRef.toggleAllSelection()
|
|
|
+ } else {
|
|
|
+ //全不选
|
|
|
+ this.$refs.edbDataRef && this.$refs.edbDataRef.clearSelection()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ selectionChange(val) {
|
|
|
+ if (this.selectionReactCancel) return
|
|
|
+
|
|
|
+ // selectAllHandle的触发在selectionChange后面,将selectionChange的逻辑延迟一下
|
|
|
+ setTimeout(() => {
|
|
|
+ // 去重
|
|
|
+ let duplicateArr = Array.from(new Set(this.tableDataCheckedList))
|
|
|
+
|
|
|
+ if ((duplicateArr.length == this.total && (!this.checkAllStatus))
|
|
|
+ || (duplicateArr.length == 0 && this.checkAllStatus)) {
|
|
|
+ this.isCheckAll = true
|
|
|
+ this.isCheckIndeterminate = false
|
|
|
+ } else if ((duplicateArr.length == 0 && (!this.checkAllStatus))
|
|
|
+ || (duplicateArr.length == this.total && this.checkAllStatus)) {
|
|
|
+ this.isCheckAll = false
|
|
|
+ this.isCheckIndeterminate = false
|
|
|
+ } else {
|
|
|
+ this.isCheckAll = false
|
|
|
+ this.isCheckIndeterminate = true
|
|
|
+ }
|
|
|
+ }, 1)
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ //用户手动勾选数据行的 Checkbox 时触发的事件
|
|
|
+ selectHandle(selection, row) {
|
|
|
+ if (this.selectionReactCancel) return
|
|
|
+
|
|
|
+ let check = false
|
|
|
+ if (selection.some(it => it.EdbInfoId == row.EdbInfoId)) {
|
|
|
+ // 勾选
|
|
|
+ // 勾选
|
|
|
+ if (this.checkAllStatus) {
|
|
|
+ check = false
|
|
|
+ } else {
|
|
|
+ check = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 取消勾选
|
|
|
+ if (this.checkAllStatus) {
|
|
|
+ check = true
|
|
|
+ } else {
|
|
|
+ check = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (check) {
|
|
|
+ this.tableDataCheckedList.push(row.EdbInfoId)
|
|
|
+ } else {
|
|
|
+ this.tableDataCheckedList = this.tableDataCheckedList.filter(it => it != row.EdbInfoId)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 用户手动勾选全选 Checkbox 时触发的事件
|
|
|
+ selectAllHandle(selection) {
|
|
|
+ if (this.selectionReactCancel) return
|
|
|
+ let check = false; // 从tableDataCheckedList 添加还是删除
|
|
|
+ if (selection && selection.length > 0) {
|
|
|
+ // 全选
|
|
|
+ if (this.checkAllStatus) {
|
|
|
+ check = false
|
|
|
+ } else {
|
|
|
+ check = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 全不选
|
|
|
+ if (this.checkAllStatus) {
|
|
|
+ check = true
|
|
|
+ } else {
|
|
|
+ check = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (check) {
|
|
|
+ this.tableDataCheckedList = [...this.tableDataCheckedList, ...this.tableDataIds]
|
|
|
+ } else {
|
|
|
+ this.tableDataCheckedList = this.tableDataCheckedList.filter(it => !this.tableDataIds.includes(it))
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ adjustSelection() {
|
|
|
+ this.selectionReactCancel = true
|
|
|
+ if (!this.checkAllStatus) {
|
|
|
+ this.tableDataCheckedList.map(it => {
|
|
|
+ let row = this.list.find(da => da.EdbInfoId == it)
|
|
|
+ if (row) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.edbDataRef.toggleRowSelection(row, true)
|
|
|
+ }, 10)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$refs.edbDataRef.toggleAllSelection()
|
|
|
+ this.tableDataCheckedList.map(it => {
|
|
|
+ let row = this.list.find(da => da.EdbInfoId == it)
|
|
|
+ if (row) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.edbDataRef.toggleRowSelection(row, false)
|
|
|
+ }, 50)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.selectionReactCancel = false
|
|
|
+ }, 50)
|
|
|
+ },
|
|
|
+
|
|
|
+ filterEdbAuth(row) {
|
|
|
+ return row.HaveOperaAuth
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
+<style lang="scss">
|
|
|
+.batch-computed-dialog {
|
|
|
+ max-width: 1200px;
|
|
|
+ width: 90vw;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ .el-input {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.batch-computed-wrap {
|
|
|
+ .type-wrap {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-wrap {
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .left-box {
|
|
|
+ width: 50%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-box {
|
|
|
+ flex: 1;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|