|
@@ -6,6 +6,7 @@ import apiFutureChart from '@/api/futureChart'
|
|
|
import apiCorrelationChart from '@/api/correlationChart'
|
|
|
import apiLineEquationChart from '@/api/lineEquationChart'
|
|
|
import apiStatisticFeatureChart from '@/api/statisticFeatureChart'
|
|
|
+import apiCrossVarietyChart from '@/api/crossVarietyChart'
|
|
|
import { showToast } from 'vant';
|
|
|
const props = defineProps({
|
|
|
isShow:{
|
|
@@ -53,7 +54,7 @@ watch(
|
|
|
{immediate:true}
|
|
|
)
|
|
|
|
|
|
-function initForm(){
|
|
|
+async function initForm(){
|
|
|
const {EdbInfoList} = props.chartInfo
|
|
|
const {ChartName,ChartNameEn,ExtraConfig} = props.chartInfo.ChartInfo
|
|
|
//第一项固定为图表名称
|
|
@@ -286,6 +287,76 @@ function initForm(){
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ if(props.chartInfo.ChartInfo.Source===10) { //跨品种分析
|
|
|
+ let res = await apiCrossVarietyChart.chartLangOption({ChartInfoId: props.chartInfo.ChartInfo.ChartInfoId})
|
|
|
+
|
|
|
+ const { TagList,VarietyList } = res.Data;
|
|
|
+
|
|
|
+ let forwardFormList=[
|
|
|
+ {
|
|
|
+ label:'X轴名称',
|
|
|
+ id: TagList[0].ChartTagId,
|
|
|
+ cnValue:TagList[0].ChartTagName,
|
|
|
+ enValue:TagList[0].ChartTagNameEn,
|
|
|
+ Value:TagList[0].ChartTagName,
|
|
|
+ noEdit:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'英文X轴名称',
|
|
|
+ id: TagList[0].ChartTagId,
|
|
|
+ cnValue:TagList[0].ChartTagName,
|
|
|
+ enValue:TagList[0].ChartTagNameEn,
|
|
|
+ Value:TagList[0].ChartTagNameEn,
|
|
|
+ placeholder:'请输入英文X轴名称'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'Y轴名称',
|
|
|
+ id: TagList[1].ChartTagId,
|
|
|
+ cnValue:TagList[1].ChartTagName,
|
|
|
+ enValue:TagList[1].ChartTagNameEn,
|
|
|
+ Value:TagList[1].ChartTagName,
|
|
|
+ noEdit:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'英文Y轴名称',
|
|
|
+ id: TagList[1].ChartTagId,
|
|
|
+ cnValue:TagList[1].ChartTagName,
|
|
|
+ enValue:TagList[1].ChartTagNameEn,
|
|
|
+ Value:TagList[1].ChartTagNameEn,
|
|
|
+ placeholder:'请输入英文Y轴名称'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ formGroup.value[0].formList = formGroup.value[0].formList.concat(forwardFormList)
|
|
|
+
|
|
|
+ for(const item of VarietyList){
|
|
|
+ formGroup.value.push({
|
|
|
+ groupName:`${item.ChartVarietyName}`,
|
|
|
+ id:item.ChartVarietyId,
|
|
|
+ formList:[
|
|
|
+ {
|
|
|
+ label:'品种名称',
|
|
|
+ cnValue:item.ChartVarietyName,
|
|
|
+ enValue:item.ChartVarietyNameEn,
|
|
|
+ Value:item.ChartVarietyName,
|
|
|
+ noEdit:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'英文品种名称',
|
|
|
+ cnValue:item.ChartVarietyName,
|
|
|
+ enValue:item.ChartVarietyNameEn,
|
|
|
+ Value:item.ChartVarietyNameEn,
|
|
|
+ placeholder:'请输入英文品种名称'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ activeGroup.value = formGroup.value.map(i=>i.groupName)
|
|
|
+ return
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//普通图
|
|
|
for(const edb of EdbInfoList){
|
|
|
formGroup.value.push({
|
|
@@ -375,7 +446,22 @@ function handleSave(){
|
|
|
}
|
|
|
_ExtraConfig.value = {..._ExtraConfig.value,...suppleConfig}
|
|
|
params.ExtraConfig = JSON.stringify(_ExtraConfig.value)
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ else if(Number(props.chartInfo.ChartInfo.Source)===10) {
|
|
|
+ params = {
|
|
|
+ ChartInfoId:props.chartInfo.ChartInfo.ChartInfoId,
|
|
|
+ ChartNameEn:formGroup.value[0].formList[1].Value,
|
|
|
+ TagList: [
|
|
|
+ { ChartTagId: formGroup.value[0].formList[3].id,TagNameEn: formGroup.value[0].formList[3].Value },
|
|
|
+ { ChartTagId: formGroup.value[0].formList[5].id,TagNameEn: formGroup.value[0].formList[5].Value }
|
|
|
+ ],
|
|
|
+ VarietyList: formGroup.value.filter((_,index)=>index>0).map(_ => ({
|
|
|
+ ChartVarietyId: _.id,
|
|
|
+ VarietyNameEn: _.formList[1].Value
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
let ChartEdbInfoList = []
|
|
|
for(let index = 1;index<formGroup.value.length;index++){
|
|
|
ChartEdbInfoList.push({
|
|
@@ -416,8 +502,10 @@ async function saveChartEn(params){
|
|
|
ChartInfoId: params.ChartInfoId,
|
|
|
ChartNameEn: params.ChartNameEn,
|
|
|
})
|
|
|
+ }else if(props.chartInfo.ChartInfo.Source===10){//统计特征
|
|
|
+ res=await apiCrossVarietyChart.editChartEn(params)
|
|
|
}else{
|
|
|
- res = await apiChart.chartInfoEditEn(params)
|
|
|
+ res = await apiChart.chartInfoEditEn(params)
|
|
|
}
|
|
|
|
|
|
|