|
@@ -15,7 +15,7 @@
|
|
|
:src="$icons.computed"
|
|
|
style="color: #fff; width: 16px; height: 16px; marginright: 5px"
|
|
|
/>
|
|
|
- <span style="font-size: 16px"> 指标拼接</span>
|
|
|
+ <span style="font-size: 16px"> <!-- 指标拼接 -->{{$t('Edb.CalculatesAll.splic')}}</span>
|
|
|
</div>
|
|
|
|
|
|
<ul class="label-cont" v-if="!params.view && !params.edb_id">
|
|
@@ -26,28 +26,28 @@
|
|
|
ref="concatForm"
|
|
|
class="form-cont"
|
|
|
label-position="left"
|
|
|
- label-width="110px"
|
|
|
+ label-width="120px"
|
|
|
:model="formData"
|
|
|
:rules="formRules"
|
|
|
:disabled="params.view"
|
|
|
>
|
|
|
<template v-if="default_type === 1">
|
|
|
- <el-form-item label="拼接日期" prop="date">
|
|
|
+ <el-form-item :label="$t('EtaBasePage.label_concat_date')" prop="date">
|
|
|
<el-date-picker
|
|
|
v-model="formData.date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
type="date"
|
|
|
- placeholder="选择日期"
|
|
|
+ :placeholder="$t('EtaBasePage.input_date_msg')"
|
|
|
style="width: 70%">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="拼接日期之前" prop="pre_edb">
|
|
|
+ <el-form-item :label="$t('EtaBasePage.label_concat_date_before')" prop="pre_edb">
|
|
|
<el-select
|
|
|
v-model="formData.pre_edb"
|
|
|
v-loadMore="searchLoad"
|
|
|
:filterable="!formData.pre_edb"
|
|
|
clearable
|
|
|
- placeholder="指标ID/指标名称"
|
|
|
+ :placeholder="$t('EtaBasePage.search_placeholder')"
|
|
|
style="width: 70%"
|
|
|
:disabled="params.view"
|
|
|
remote
|
|
@@ -64,15 +64,15 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <span v-if="formData.pre_edb">(起始日期:{{ searchOptions.find(item => item.EdbInfoId === formData.pre_edb) ? searchOptions.find(item => item.EdbInfoId === formData.pre_edb).StartDate : ''}})</span>
|
|
|
+ <span v-if="formData.pre_edb">({{$t('Edb.Detail.e_start_time')}}:{{ searchOptions.find(item => item.EdbInfoId === formData.pre_edb) ? searchOptions.find(item => item.EdbInfoId === formData.pre_edb).StartDate : ''}})</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="拼接日期之后" prop="after_edb">
|
|
|
+ <el-form-item :label="$t('EtaBasePage.label_concat_date_after')" prop="after_edb">
|
|
|
<el-select
|
|
|
v-model="formData.after_edb"
|
|
|
v-loadMore="searchLoad"
|
|
|
:filterable="!formData.after_edb"
|
|
|
clearable
|
|
|
- placeholder="指标ID/指标名称"
|
|
|
+ :placeholder="$t('EtaBasePage.search_placeholder')"
|
|
|
style="width: 70%"
|
|
|
:disabled="params.view"
|
|
|
remote
|
|
@@ -89,17 +89,17 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <span v-if="formData.after_edb">(最新日期:{{ searchOptions.find(item => item.EdbInfoId === formData.after_edb) ? searchOptions.find(item => item.EdbInfoId === formData.after_edb).EndDate : ''}})</span>
|
|
|
+ <span v-if="formData.after_edb">({{$t('Edb.Detail.e_latest_date')}}:{{ searchOptions.find(item => item.EdbInfoId === formData.after_edb) ? searchOptions.find(item => item.EdbInfoId === formData.after_edb).EndDate : ''}})</span>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <el-form-item label="待拼接指标" prop="old_stay_edb">
|
|
|
+ <el-form-item :label="$t('EtaBasePage.label_concat_edb')" prop="old_stay_edb">
|
|
|
<el-select
|
|
|
v-model="formData.old_stay_edb"
|
|
|
v-loadMore="searchLoad2"
|
|
|
:filterable="!formData.old_stay_edb"
|
|
|
clearable
|
|
|
- placeholder="指标ID/指标名称"
|
|
|
+ :placeholder="$t('EtaBasePage.search_placeholder')"
|
|
|
style="width: 70%"
|
|
|
:disabled="params.view"
|
|
|
remote
|
|
@@ -116,15 +116,15 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <span v-if="formData.old_stay_edb">(截止日期:{{searchMonthOptions.find(item => item.EdbInfoId === formData.old_stay_edb) ? searchMonthOptions.find(item => item.EdbInfoId === formData.old_stay_edb).EndDate : ''}})</span>
|
|
|
+ <span v-if="formData.old_stay_edb">({{$t('EtaBasePage.label_end_date')}}:{{searchMonthOptions.find(item => item.EdbInfoId === formData.old_stay_edb) ? searchMonthOptions.find(item => item.EdbInfoId === formData.old_stay_edb).EndDate : ''}})</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="同比值指标" prop="concat_edb">
|
|
|
+ <el-form-item :label="$t('EtaBasePage.label_onyear_date')" prop="concat_edb">
|
|
|
<el-select
|
|
|
v-model="formData.concat_edb"
|
|
|
v-loadMore="searchLoad"
|
|
|
:filterable="!formData.concat_edb"
|
|
|
clearable
|
|
|
- placeholder="指标ID/指标名称"
|
|
|
+ :placeholder="$t('EtaBasePage.search_placeholder')"
|
|
|
style="width: 70%"
|
|
|
remote
|
|
|
:remote-method="query=>{searchHandle(query)}"
|
|
@@ -143,13 +143,13 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
- <el-form-item label="指标名称" prop="edb_name" class="target-form-cont">
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_name')" prop="edb_name" class="target-form-cont">
|
|
|
<el-input
|
|
|
v-model="formData.edb_name"
|
|
|
style="width: 70%"
|
|
|
- placeholder="指标名称"></el-input>
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_name')"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所属目录" prop="menu">
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_menu')" prop="menu">
|
|
|
<el-cascader
|
|
|
v-model="formData.menu"
|
|
|
:options="menuOptions"
|
|
@@ -161,12 +161,12 @@
|
|
|
}"
|
|
|
style="width: 70%"
|
|
|
clearable
|
|
|
- placeholder="请选择所属目录"/>
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_menu')"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="频度" prop="frequency">
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_fre')" prop="frequency">
|
|
|
<el-select
|
|
|
v-model="formData.frequency"
|
|
|
- placeholder="请选择频度"
|
|
|
+ :placeholder="$t('Edb.InputHolderAll.input_fre')"
|
|
|
style="width:70%"
|
|
|
clearable >
|
|
|
<el-option
|
|
@@ -177,7 +177,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="单位" prop="unit">
|
|
|
+ <el-form-item :label="$t('Edb.Detail.e_unit')" prop="unit">
|
|
|
<selectUnit v-model="formData.unit" style="width:70%" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -186,16 +186,16 @@
|
|
|
type="primary"
|
|
|
style="margin-right: 20px"
|
|
|
@click="saveHandle"
|
|
|
- >保存</el-button
|
|
|
+ ><!-- 保存 -->{{$t('Dialog.confirm_save_btn')}}</el-button
|
|
|
>
|
|
|
- <el-button type="primary" plain @click="cancelHandle('cancel')">取消</el-button>
|
|
|
+ <el-button type="primary" plain @click="cancelHandle('cancel')"><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
|
|
|
</div>
|
|
|
<el-popover
|
|
|
placement="top-start"
|
|
|
:width="default_type === 1 ? 360 : 550"
|
|
|
trigger="click">
|
|
|
<p style="padding:20px;line-height:25px;" v-html="tips.get(default_type)"/>
|
|
|
- <span slot="reference" class="tip-label">公式说明</span>
|
|
|
+ <span slot="reference" class="tip-label"><!-- 公式说明 -->{{$t('Edb.formula_instru')}}</span>
|
|
|
</el-popover>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -205,6 +205,7 @@
|
|
|
import { dataBaseInterface } from '@/api/api.js'
|
|
|
import * as preDictEdbInterface from '@/api/modules/predictEdbApi.js';
|
|
|
import { unitArr } from '@/utils/defaultOptions';
|
|
|
+import { frequencyArr } from './util'
|
|
|
export default {
|
|
|
props: {
|
|
|
isShow: {
|
|
@@ -268,16 +269,61 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ tips() {
|
|
|
+ return this.$i18n.locale === 'zh'
|
|
|
+ ? new Map([
|
|
|
+ [1,`
|
|
|
+ 直接拼接说明:<br>
|
|
|
+ 1、选取拼接日期<br>
|
|
|
+ 2、在拼接日期之前的数据选择指标A<br>
|
|
|
+ 3、拼接日期之后的数据选择指标B<br>
|
|
|
+ 4、新指标的起始日期为A的开始日期,更新时间跟随指标B进行更新<br>
|
|
|
+ 5、指标A和B可以是原始指标,也可以是计算指标
|
|
|
+ `],
|
|
|
+ [2,`
|
|
|
+ 累计值同比拼接说明:<br>
|
|
|
+ 1、只支持月频度的指标进行累计值同比拼接<br>
|
|
|
+ 2、如果出现有空值运算,则返回空值<br>
|
|
|
+ 3、选取待拼接指标A和同比值指标B<br>
|
|
|
+ 4、搜索到指标A最后一个12月31日有值的年份,并且向前回溯12个值(12个月),分别乘以下一年同期对应的同比增长率(B),公式为【A*(1+同期增长率(B)/100)】,得到下一年每个月的绝对值,再用新得到的下一年的12个月的值再乘以再下一年同期对应的同比增长率,得到再下一年每个月的绝对值<br>
|
|
|
+ 5、以此类推,直到运算至指标B的最新值,得到新的序列C<br>
|
|
|
+ 6、新指标是将序列C和指标A进行直接拼接,拼接日期选取指标A中有值的年份的年末最后一天即12月31日,再与序列C的起始日期做拼接<br>
|
|
|
+ 7、新指标跟随指标B进行更新
|
|
|
+ `],
|
|
|
+ ])
|
|
|
+ : new Map([
|
|
|
+ [1,`
|
|
|
+ Indicator Splicing Specification:<br>
|
|
|
+ 1、Select Splicing Date<br>
|
|
|
+ 2、Select A for data before splicing date <br>
|
|
|
+ 3、Select B for data after splicing date<br>
|
|
|
+ 4、The start date for the new metric is the start date of A, and its update time follows that of metric B.<br>
|
|
|
+ 5、Metrics A and B can be either original metrics or calculated metrics.
|
|
|
+ `],
|
|
|
+ [2,`
|
|
|
+ Cumulative Year-on-Year Splicing Specification:<br>
|
|
|
+ 1、Only indicators with monthly frequencies are supported for cumulative year-on-year splicing.<br>
|
|
|
+ 2、If a calculation results in null values, then null values will be returned.<br>
|
|
|
+ 3、Select indicator A, which is to be spliced, and year-on-year value indicator B.<br>
|
|
|
+ 4、Find the last December 31st for which indicator A has a value and trace back 12 values (12 months). Multiply these by the corresponding year-on-year growth rate (B) for the following year, using the formula [A*(1+year-on-year growth rate (B)/100)] to obtain the absolute value for each month of the next year. Then multiply the 12 values obtained for the next year by the year-on-year growth rates of the subsequent year to get the absolute monthly values for that subsequent year.<br>
|
|
|
+ 5、Continue this process up until you reach the latest value of indicator B, creating a new sequence C.<br>
|
|
|
+ 6、The new indicator is created by directly splicing sequence C with indicator A, selecting December 31st from years where indicator A has values as the splicing date, and then joining it with the start date of sequence C.<br>
|
|
|
+ 7、The new indicator updates alongside indicator B.
|
|
|
+ `],
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
default_type: 1,
|
|
|
tagList: [
|
|
|
{
|
|
|
- label: "直接拼接",
|
|
|
+ label:/* "直接拼接" */this.$t('EtaBasePage.concat_tab_1'),
|
|
|
key: 1
|
|
|
},
|
|
|
{
|
|
|
- label: "累计值同比拼接",
|
|
|
+ label: /* "累计值同比拼接" */this.$t('EtaBasePage.concat_tab_2'),
|
|
|
key: 2
|
|
|
}
|
|
|
],
|
|
@@ -294,59 +340,59 @@ export default {
|
|
|
},
|
|
|
formRules: {
|
|
|
date:[
|
|
|
- { required: true, message: '拼接日期不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.common_msg',{label: this.$t('EtaBasePage.label_concat_date')}), trigger: 'blur' },
|
|
|
],
|
|
|
pre_edb:[
|
|
|
- { required: true, message: '指标不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.no_edb'), trigger: 'blur' },
|
|
|
],
|
|
|
after_edb:[
|
|
|
- { required: true, message: '指标不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.no_edb'), trigger: 'blur' },
|
|
|
],
|
|
|
old_stay_edb:[
|
|
|
- { required: true, message: '待拼接指标不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.common_msg',{label: this.$t('EtaBasePage.label_concat_edb')}), trigger: 'blur' },
|
|
|
],
|
|
|
concat_edb:[
|
|
|
- { required: true, message: '指标不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.no_edb'), trigger: 'blur' },
|
|
|
],
|
|
|
edb_name:[
|
|
|
- { required: true, message: '指标名称不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.name_msg'), trigger: 'blur' },
|
|
|
],
|
|
|
menu:[
|
|
|
- { required: true, message: '所属目录不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.menu_msg'), trigger: 'blur' },
|
|
|
],
|
|
|
frequency:[
|
|
|
- { required: true, message: '频度不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.fre_msg'), trigger: 'blur' },
|
|
|
],
|
|
|
unit:[
|
|
|
- { required: true, message: '单位不能为空', trigger: ['blur','change'] },
|
|
|
+ { required: true, message: this.$t('Edb.Valids.unit_msg'), trigger: ['blur','change'] },
|
|
|
],
|
|
|
},
|
|
|
- tips: new Map([
|
|
|
- [1,`
|
|
|
- 直接拼接说明:<br>
|
|
|
- 1、选取拼接日期<br>
|
|
|
- 2、在拼接日期之前的数据选择指标A<br>
|
|
|
- 3、拼接日期之后的数据选择指标B<br>
|
|
|
- 4、新指标的起始日期为A的开始日期,更新时间跟随指标B进行更新<br>
|
|
|
- 5、指标A和B可以是原始指标,也可以是计算指标
|
|
|
- `],
|
|
|
- [2,`
|
|
|
- 累计值同比拼接说明:<br>
|
|
|
- 1、只支持月频度的指标进行累计值同比拼接<br>
|
|
|
- 2、如果出现有空值运算,则返回空值<br>
|
|
|
- 3、选取待拼接指标A和同比值指标B<br>
|
|
|
- 4、搜索到指标A最后一个12月31日有值的年份,并且向前回溯12个值(12个月),分别乘以下一年同期对应的同比增长率(B),公式为【A*(1+同期增长率(B)/100)】,得到下一年每个月的绝对值,再用新得到的下一年的12个月的值再乘以再下一年同期对应的同比增长率,得到再下一年每个月的绝对值<br>
|
|
|
- 5、以此类推,直到运算至指标B的最新值,得到新的序列C<br>
|
|
|
- 6、新指标是将序列C和指标A进行直接拼接,拼接日期选取指标A中有值的年份的年末最后一天即12月31日,再与序列C的起始日期做拼接<br>
|
|
|
- 7、新指标跟随指标B进行更新
|
|
|
- `],
|
|
|
- ]),
|
|
|
+ // tips: new Map([
|
|
|
+ // [1,`
|
|
|
+ // 直接拼接说明:<br>
|
|
|
+ // 1、选取拼接日期<br>
|
|
|
+ // 2、在拼接日期之前的数据选择指标A<br>
|
|
|
+ // 3、拼接日期之后的数据选择指标B<br>
|
|
|
+ // 4、新指标的起始日期为A的开始日期,更新时间跟随指标B进行更新<br>
|
|
|
+ // 5、指标A和B可以是原始指标,也可以是计算指标
|
|
|
+ // `],
|
|
|
+ // [2,`
|
|
|
+ // 累计值同比拼接说明:<br>
|
|
|
+ // 1、只支持月频度的指标进行累计值同比拼接<br>
|
|
|
+ // 2、如果出现有空值运算,则返回空值<br>
|
|
|
+ // 3、选取待拼接指标A和同比值指标B<br>
|
|
|
+ // 4、搜索到指标A最后一个12月31日有值的年份,并且向前回溯12个值(12个月),分别乘以下一年同期对应的同比增长率(B),公式为【A*(1+同期增长率(B)/100)】,得到下一年每个月的绝对值,再用新得到的下一年的12个月的值再乘以再下一年同期对应的同比增长率,得到再下一年每个月的绝对值<br>
|
|
|
+ // 5、以此类推,直到运算至指标B的最新值,得到新的序列C<br>
|
|
|
+ // 6、新指标是将序列C和指标A进行直接拼接,拼接日期选取指标A中有值的年份的年末最后一天即12月31日,再与序列C的起始日期做拼接<br>
|
|
|
+ // 7、新指标跟随指标B进行更新
|
|
|
+ // `],
|
|
|
+ // ]),
|
|
|
searchOptions: [],
|
|
|
searchMonthOptions: [],
|
|
|
searchMonthConcatOptions:[],
|
|
|
unitArr,
|
|
|
menuOptions: [],
|
|
|
- frequencyArr:['日度','周度','旬度','月度','季度','年度'],
|
|
|
+ frequencyArr,
|
|
|
|
|
|
search_page: 1,
|
|
|
search_have_more: false,
|
|
@@ -481,7 +527,8 @@ export default {
|
|
|
const res=this.isPredict?await preDictEdbInterface.operateEdbSave(params):await dataBaseInterface.calculateTargetSave(params)
|
|
|
// dataBaseInterface.calculateTargetSave(params).then(res => {
|
|
|
if (res.Ret !== 200) return
|
|
|
- this.$message.success('新增成功');
|
|
|
+ // this.$message.success('新增成功');
|
|
|
+ this.$message.success(this.$t('MsgPrompt.add_msg'));
|
|
|
|
|
|
this.$emit('addCallBack','add',{ code:res.Data.UniqueCode,id:res.Data.EdbInfoId,classifyId:params.ClassifyId });
|
|
|
this.init();
|
|
@@ -499,7 +546,8 @@ export default {
|
|
|
const res=this.isPredict?await preDictEdbInterface.operateEdbSave(edit_params):await dataBaseInterface.calculateTargetEdit(edit_params)
|
|
|
// dataBaseInterface.calculateTargetEdit(edit_params).then(res => {
|
|
|
if (res.Ret !== 200) return
|
|
|
- this.$message.success('编辑成功');
|
|
|
+ // this.$message.success('编辑成功');
|
|
|
+ this.$message.success(this.$t('MsgPrompt.edit_msg'));
|
|
|
|
|
|
this.$emit('addCallBack','edit');
|
|
|
this.init();
|