|
@@ -34,20 +34,30 @@
|
|
|
<div class="select-table">
|
|
|
<el-table :data="edbList" border>
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
|
|
- <el-table-column label="指标ID" align="center" width="120" prop="edbId"></el-table-column>
|
|
|
- <el-table-column label="指标名称" align="center">
|
|
|
+ <el-table-column :label="$t('Edb.Detail.e_id')" align="center" width="120" prop="edbId"></el-table-column>
|
|
|
+ <el-table-column :label="$t('Table.edb_name')" align="center">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-input v-model="row.edbName"></el-input>
|
|
|
+ <el-input v-model="row.edbName" :placeholder="$t('Table.edb_name')"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('Edb.Detail.e_fre')" align="center" width="140">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-select v-model="row.frequency"></el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="row.frequency"
|
|
|
+ :placeholder="$t('CustomAnalysisPage.select_frequency')"
|
|
|
+ clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in frequencyArr"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('Edb.Detail.e_unit')" align="center" width="140">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-input v-model="row.unit"></el-input>
|
|
|
+ <selectUnit v-model="row.unit" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 操作 -->
|
|
@@ -58,6 +68,7 @@
|
|
|
<el-radio :label="1"><!-- 分目录 -->{{$t('EtaBasePage.subdirectory_radio')}}</el-radio>
|
|
|
<el-radio :label="2"><!-- 同目录 -->{{$t('EtaBasePage.directory_radio')}}</el-radio>
|
|
|
</el-radio-group>
|
|
|
+ <el-cascader v-if="classifyType===2"></el-cascader>
|
|
|
</template>
|
|
|
<template slot-scope="{row,$index}">
|
|
|
<el-cascader
|
|
@@ -70,16 +81,20 @@
|
|
|
checkStrictly: true,
|
|
|
emitPath:false
|
|
|
}"
|
|
|
- :disabled="classifyType===1&&$index>0"
|
|
|
+ style="width:100%;"
|
|
|
+ :disabled="classifyType===2&&$index>0"
|
|
|
></el-cascader>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <div class="no-data" slot="empty">
|
|
|
+ <tableNoData :text="$t('Table.prompt_slogan')"/>
|
|
|
+ </div>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer-container" slot="footer">
|
|
|
- <el-button type="primary" plain @click="$emit('close')">取消</el-button>
|
|
|
- <el-button type="primary" @click="handleAddEdb">加入指标库</el-button>
|
|
|
+ <el-button type="primary" plain @click="$emit('close')">{{ $t('Dialog.cancel_btn') }}</el-button>
|
|
|
+ <el-button type="primary" @click="handleAddEdb">{{ $t('ManualEdbListPage.add_tobase_btn') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
@@ -87,7 +102,10 @@
|
|
|
<script>
|
|
|
import { steelInterface } from "@/api/modules/thirdBaseApi";
|
|
|
import { dataBaseInterface } from '@/api/api.js';
|
|
|
+import selectUnit from '@/components/selectUnit.vue';
|
|
|
+import { frequencySelectList } from '@/utils/defaultOptions';
|
|
|
export default {
|
|
|
+ components:{ selectUnit },
|
|
|
props:{
|
|
|
isOpenDialog:{
|
|
|
type:Boolean,
|
|
@@ -107,14 +125,15 @@ export default {
|
|
|
searchName:'',
|
|
|
searchClassify:'',
|
|
|
classifyType:1,//1分目录 2同目录
|
|
|
+ frequencyArr:frequencySelectList(),
|
|
|
edbList:[
|
|
|
/* {
|
|
|
edbId:'123456',
|
|
|
edbName:'指标名称指标名称',
|
|
|
frequency:'日度',
|
|
|
unit:'吨',
|
|
|
- classify:''
|
|
|
- } */
|
|
|
+ classify:'',
|
|
|
+ }, */
|
|
|
],
|
|
|
edbClassifyList:[],//指标库目录
|
|
|
selectEdbList:[]
|
|
@@ -159,16 +178,67 @@ export default {
|
|
|
edbName:'指标名称指标名称',
|
|
|
frequency:'日度',
|
|
|
unit:'吨',
|
|
|
- classify:''
|
|
|
- }]
|
|
|
+ classify:'',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ edbId:'654321',
|
|
|
+ edbName:'22222',
|
|
|
+ frequency:'日度',
|
|
|
+ unit:'吨',
|
|
|
+ classify:'',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ edbId:'77777',
|
|
|
+ edbName:'11111',
|
|
|
+ frequency:'日度',
|
|
|
+ unit:'吨',
|
|
|
+ classify:'',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ edbId:'888888',
|
|
|
+ edbName:'指标名称指标名称',
|
|
|
+ frequency:'日度',
|
|
|
+ unit:'吨',
|
|
|
+ classify:'',
|
|
|
+ },]
|
|
|
},
|
|
|
handleClassifyTypeChange(){},
|
|
|
handleAddEdb(){
|
|
|
//校验所选指标
|
|
|
+ if(!this.selectEdbList.length){
|
|
|
+ return this.$message.warning(this.$t('InputHolderAll.input_select_edb'))
|
|
|
+ }
|
|
|
+ if(this.selectEdbList.length>30){
|
|
|
+ return this.$message.warning(this.$t('SteelChemicalPage.batch_add_max_msg'))
|
|
|
+ }
|
|
|
+ //校验所选指标信息是否完整
|
|
|
+ if(this.classifyType===2&&!this.selectClassify){
|
|
|
+ /* return this.$message.warning(this.) */
|
|
|
+ }
|
|
|
+
|
|
|
+ let messageList = [] //有问题的列表
|
|
|
+ this.selectEdbList.forEach((item)=>{
|
|
|
+ let checkResult = checkEdbData(item)
|
|
|
+ if(checkEdbData(item)){
|
|
|
+ messageList.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //message轻提示 同时标出不完整的行
|
|
|
+ if(messageList.length){
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //调用接口check是否有指标重名
|
|
|
+ //没有则batchAddEdb
|
|
|
+
|
|
|
+ },
|
|
|
+ checkEdbData(edbData){
|
|
|
+ return !(!edbData.edbName||!edbData.frequency||!edbData.unit||this.classifyType===1?(!edbData.classify):false)
|
|
|
},
|
|
|
batchAddEdb(){
|
|
|
//获取添加结果
|
|
|
- //有已存在的指标 弹窗提示
|
|
|
+ //有已存在的指标 emit将结果返回
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -190,6 +260,10 @@ export default {
|
|
|
.select-box{
|
|
|
margin-bottom:20px;
|
|
|
}
|
|
|
+ .select-table{
|
|
|
+ max-height:600px;
|
|
|
+ overflow-y:auto;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|