Merge branch 'main' of http://121.37.111.42:3000/zhengsl/WholeProcessPlatform into main_hzz
This commit is contained in:
commit
cc8c1e0647
@ -36,6 +36,12 @@ public class EngEqDataController {
|
||||
return ResponseResult.successData(engEqDataService.getKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/data/day/GetKendoListCust")
|
||||
@Operation(summary = "生态流量日数据")
|
||||
public ResponseResult getDayKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engEqDataService.getDayKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/interval/GetKendoListCust")
|
||||
@Operation(summary = "生态流量达标情况")
|
||||
public ResponseResult getIntervalKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
@ -0,0 +1,123 @@
|
||||
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "生态流量日数据")
|
||||
public class EngEqDayDataVo {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "工程名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "流域名称")
|
||||
private String rvcdName;
|
||||
|
||||
@Schema(description = "行政区名称")
|
||||
private String addvcdName;
|
||||
|
||||
@Schema(description = "入库流量")
|
||||
private BigDecimal qi;
|
||||
|
||||
@Schema(description = "出库流量")
|
||||
private BigDecimal qo;
|
||||
|
||||
@Schema(description = "坝上水位")
|
||||
private BigDecimal rz;
|
||||
|
||||
@Schema(description = "坝下水位")
|
||||
private BigDecimal dz;
|
||||
|
||||
@Schema(description = "生态流量限值(环保部)")
|
||||
private BigDecimal qecLimit;
|
||||
|
||||
@Schema(description = "生态流量")
|
||||
private BigDecimal qec;
|
||||
|
||||
@Schema(description = "生态流量限值(水利部)")
|
||||
private BigDecimal mwrLimit;
|
||||
|
||||
@Schema(description = "生态流量限值(多年平均)")
|
||||
private BigDecimal avqLimit;
|
||||
|
||||
@Schema(description = "生态流量系数(环保部)")
|
||||
private BigDecimal qecC;
|
||||
|
||||
@Schema(description = "生态流量系数(水利部)")
|
||||
private BigDecimal mwrC;
|
||||
|
||||
@Schema(description = "生态流量系数(多年平均)")
|
||||
private BigDecimal avqC;
|
||||
|
||||
@Schema(description = "生态流量是否达标")
|
||||
private Integer sfdb;
|
||||
|
||||
@Schema(description = "生态流量是否达标中文")
|
||||
private String sfdbName;
|
||||
|
||||
@Schema(description = "生态流量是否达标(环保部)")
|
||||
private Integer qecSfdb;
|
||||
|
||||
@Schema(description = "生态流量是否达标(水利部)")
|
||||
private Integer mwrSfdb;
|
||||
|
||||
@Schema(description = "生态流量是否达标(水利部)中文")
|
||||
private String mwrSfdbName;
|
||||
|
||||
@Schema(description = "生态流量是否达标(多年平均)")
|
||||
private Integer avqSfdb;
|
||||
|
||||
@Schema(description = "生态流量是否达标(多年平均)中文")
|
||||
private String avqSfdbName;
|
||||
|
||||
@Schema(description = "日期")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "环保部规则详情ID")
|
||||
private String qecRuleDid;
|
||||
|
||||
@Schema(description = "水利部规则详情ID")
|
||||
private String qecMwrruleDid;
|
||||
|
||||
@Schema(description = "去年同期生态流量")
|
||||
private BigDecimal beforeQec;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_eng.eq.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqHourIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqIntervalVo;
|
||||
@ -18,6 +19,8 @@ public interface EngEqDataService {
|
||||
|
||||
DataSourceResult getKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqDayDataVo> getDayKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqIntervalVo> getIntervalKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<EngEqMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
@ -12,6 +12,7 @@ import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.enums.QecIntervalEnum;
|
||||
import com.yfd.platform.common.enums.ShowEnum;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngFidVo;
|
||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqHourIntervalVo;
|
||||
@ -60,6 +61,15 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return queryGroupList(dataSourceRequest, loadOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<EngEqDayDataVo> getDayKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
if (CollUtil.isEmpty(dataSourceRequest == null ? null : dataSourceRequest.getGroup())) {
|
||||
return queryDayDetailList(dataSourceRequest, loadOptions);
|
||||
}
|
||||
return queryDayGroupList(dataSourceRequest, loadOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<EngEqIntervalVo> getIntervalKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
@ -1485,6 +1495,101 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private DataSourceResult<EngEqDayDataVo> queryDayDetailList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append(buildDayDetailSelectSql(dataSourceRequest == null ? null : dataSourceRequest.getSelect()))
|
||||
.append(" FROM (")
|
||||
.append(buildDayViewSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildDayFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
sql.append(buildDayDetailOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<EngEqDayDataVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, EngEqDayDataVo.class);
|
||||
DataSourceResult<EngEqDayDataVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private DataSourceResult<EngEqDayDataVo> queryDayGroupList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
List<DataSourceRequest.GroupDescriptor> groups = dataSourceRequest.getGroup();
|
||||
GroupingInfo[] groupInfos = loadOptions == null ? new GroupingInfo[0] : loadOptions.getGroup();
|
||||
List<String> selectItems = new ArrayList<>();
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groups) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapDayColumn(descriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
selectItems.add(column + " AS " + descriptor.getField().toUpperCase());
|
||||
selectItems.add("COUNT(*) AS COUNT_" + descriptor.getField().toUpperCase());
|
||||
if (CollUtil.isNotEmpty(descriptor.getAggregates())) {
|
||||
for (DataSourceRequest.AggregateDescriptor aggregate : descriptor.getAggregates()) {
|
||||
String aggregateColumn = mapDayColumn(aggregate.getField());
|
||||
if (StrUtil.isBlank(aggregateColumn) || StrUtil.isBlank(aggregate.getAggregate())) {
|
||||
continue;
|
||||
}
|
||||
selectItems.add(buildAggregateSql(aggregate.getAggregate(), aggregateColumn, aggregate.getField()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectItems.isEmpty()) {
|
||||
selectItems.add("t.STCD AS STCD");
|
||||
selectItems.add("COUNT(*) AS COUNT_STCD");
|
||||
}
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append(String.join(", ", selectItems))
|
||||
.append(" FROM (")
|
||||
.append(buildDayViewSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildDayFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
|
||||
List<String> groupByColumns = new ArrayList<>();
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groups) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapDayColumn(descriptor.getField());
|
||||
if (StrUtil.isNotBlank(column)) {
|
||||
groupByColumns.add(column);
|
||||
}
|
||||
}
|
||||
if (!groupByColumns.isEmpty()) {
|
||||
sql.append(" GROUP BY ").append(String.join(", ", groupByColumns)).append(" ");
|
||||
}
|
||||
sql.append(buildDayGroupOrderBySql(groups));
|
||||
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.pageAllList(null, sql.toString(), paramMap);
|
||||
DataSourceResult<EngEqDayDataVo> result = new DataSourceResult<>();
|
||||
if (Boolean.TRUE.equals(dataSourceRequest.getGroupResultFlat())) {
|
||||
result.setData((List<EngEqDayDataVo>) (List<?>) new GroupHelper().faltGroup(rows, Arrays.asList(groupInfos)));
|
||||
} else {
|
||||
result.setData((List<EngEqDayDataVo>) (List<?>) new GroupHelper().group(rows, Arrays.asList(groupInfos)));
|
||||
}
|
||||
result.setTotal((long) rows.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private DataSourceResult<EngEqIntervalVo> queryIntervalDetailList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
@ -2513,6 +2618,79 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
"LEFT JOIN SD_QEC_R bsqr ON bsqr.STCD = sqr.STCD AND ADD_MONTHS(bsqr.TM, 12) = sqr.TM AND NVL(bsqr.IS_DELETED, 0) = 0 ";
|
||||
}
|
||||
|
||||
private String buildDayViewSql() {
|
||||
return "SELECT " +
|
||||
"day.ID AS id, " +
|
||||
"eng.STCD AS stcd, " +
|
||||
"eng.ENNM AS stnm, " +
|
||||
"eng.ENNM AS ennm, " +
|
||||
"eng.BASE_ID AS baseId, " +
|
||||
"hb.BASENAME AS baseName, " +
|
||||
"eng.HBRVCD AS hbrvcd, " +
|
||||
"hbrv.HBRVNM AS hbrvcdName, " +
|
||||
"eng.RVCD AS rvcd, " +
|
||||
"rv.RVNM AS rvcdName, " +
|
||||
"addv.ADDVNM AS addvcdName, " +
|
||||
"runDay.QI AS qi, " +
|
||||
"runDay.QO AS qo, " +
|
||||
"runDay.RZ AS rz, " +
|
||||
"runDay.DZ AS dz, " +
|
||||
"day.QEC_LIMIT AS qecLimit, " +
|
||||
"day.QEC AS qec, " +
|
||||
"day.MWR_LIMIT AS mwrLimit, " +
|
||||
"day.AVQ_LIMIT AS avqLimit, " +
|
||||
"day.QEC_C AS qecC, " +
|
||||
"day.MWR_C AS mwrC, " +
|
||||
"day.AVQ_C AS avqC, " +
|
||||
"day.SFDB AS sfdb, " +
|
||||
"CASE NVL(day.SFDB, -1) WHEN 0 THEN '不达标' WHEN 1 THEN '达标' WHEN 2 THEN '无生态流量数据' WHEN 3 THEN '无生态流量限值要求' ELSE NULL END AS sfdbName, " +
|
||||
"day.SFDB AS qecSfdb, " +
|
||||
"day.MWR_SFDB AS mwrSfdb, " +
|
||||
"CASE NVL(day.MWR_SFDB, -1) WHEN 0 THEN '不达标' WHEN 1 THEN '达标' WHEN 2 THEN '无生态流量数据' WHEN 3 THEN '无生态流量限值要求' ELSE NULL END AS mwrSfdbName, " +
|
||||
"day.AVQ_SFDB AS avqSfdb, " +
|
||||
"CASE NVL(day.AVQ_SFDB, -1) WHEN 0 THEN '不达标' WHEN 1 THEN '达标' WHEN 2 THEN '无生态流量数据' WHEN 3 THEN '无生态流量限值要求' ELSE NULL END AS avqSfdbName, " +
|
||||
"day.DT AS dt, " +
|
||||
"day.QEC_RULE_DID AS qecRuleDid, " +
|
||||
"day.QEC_MWRRULE_DID AS qecMwrruleDid, " +
|
||||
"beforeDay.QEC AS beforeQec, " +
|
||||
"NVL(hb.ORDER_INDEX, 999999) AS baseStepSort, " +
|
||||
"NVL(along.ORDER_INDEX, 999999) AS rvcdStepSort, " +
|
||||
"NVL(rstSort.SORT, 999999) AS rstcdStepSort, " +
|
||||
"NVL(siteSort.SORT, 999999) AS siteStepSort " +
|
||||
"FROM SD_QECDAY_S day " +
|
||||
"INNER JOIN SD_ENGINFO_B_H eng ON eng.STCD = day.STCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.HBRVCD = eng.HBRVCD AND hbrv.BASEID = eng.BASE_ID " +
|
||||
" AND NVL(hbrv.IS_DELETED, 0) = 0 AND NVL(hbrv.ENABLED, 1) = 1 " +
|
||||
"LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = eng.RVCD " +
|
||||
"LEFT JOIN SD_ADDVCD_DIC addv ON addv.ADDVCD = eng.ADDVCD " +
|
||||
"LEFT JOIN MS_ALONG_B along ON along.RVCD = eng.HBRVCD AND along.CODE = 'common' AND NVL(along.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN ( " +
|
||||
" SELECT det.SORT, cfg.RVCD, det.STCD " +
|
||||
" FROM MS_ALONGDET_B det " +
|
||||
" INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID " +
|
||||
" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' " +
|
||||
") rstSort ON rstSort.RVCD = eng.HBRVCD AND rstSort.STCD = eng.STCD " +
|
||||
"LEFT JOIN ( " +
|
||||
" SELECT det.SORT, cfg.RVCD, det.STCD " +
|
||||
" FROM MS_ALONGDET_B det " +
|
||||
" INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID " +
|
||||
" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' " +
|
||||
") siteSort ON siteSort.RVCD = eng.HBRVCD AND siteSort.STCD = eng.STCD " +
|
||||
"LEFT JOIN (" + buildDayRunDaySql() + ") runDay ON runDay.STCD = day.STCD AND runDay.DT = day.DT " +
|
||||
"LEFT JOIN SD_QECDAY_S beforeDay ON beforeDay.STCD = day.STCD " +
|
||||
" AND ADD_MONTHS(beforeDay.DT, 12) = day.DT AND NVL(beforeDay.IS_DELETED, 0) = 0 " +
|
||||
"WHERE NVL(day.IS_DELETED, 0) = 0";
|
||||
}
|
||||
|
||||
private String buildDayRunDaySql() {
|
||||
return "SELECT run.STCD, TRUNC(run.TM) AS DT, " +
|
||||
"AVG(run.QI) AS QI, AVG(run.QO) AS QO, AVG(run.RZ) AS RZ, AVG(run.DZ) AS DZ " +
|
||||
"FROM SD_HYDROPW_R run " +
|
||||
"WHERE NVL(run.IS_DELETED, 0) = 0 " +
|
||||
"GROUP BY run.STCD, TRUNC(run.TM)";
|
||||
}
|
||||
|
||||
private String buildDetailSelectSql(List<String> selectFields) {
|
||||
Map<String, String> columns = detailFieldColumns();
|
||||
List<String> selected = new ArrayList<>();
|
||||
@ -2532,6 +2710,25 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return String.join(", ", selected);
|
||||
}
|
||||
|
||||
private String buildDayDetailSelectSql(List<String> selectFields) {
|
||||
Map<String, String> columns = dayFieldColumns();
|
||||
List<String> selected = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(selectFields)) {
|
||||
selected.addAll(columns.values());
|
||||
} else {
|
||||
for (String field : selectFields) {
|
||||
String column = columns.get(field);
|
||||
if (StrUtil.isNotBlank(column)) {
|
||||
selected.add(column);
|
||||
}
|
||||
}
|
||||
if (selected.isEmpty()) {
|
||||
selected.addAll(columns.values());
|
||||
}
|
||||
}
|
||||
return String.join(", ", selected);
|
||||
}
|
||||
|
||||
private Map<String, String> detailFieldColumns() {
|
||||
Map<String, String> columns = new LinkedHashMap<>();
|
||||
columns.put("id", "sqr.ID AS id");
|
||||
@ -2576,6 +2773,48 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return columns;
|
||||
}
|
||||
|
||||
private Map<String, String> dayFieldColumns() {
|
||||
Map<String, String> columns = new LinkedHashMap<>();
|
||||
columns.put("id", "t.id AS id");
|
||||
columns.put("stcd", "t.stcd AS stcd");
|
||||
columns.put("stnm", "t.stnm AS stnm");
|
||||
columns.put("ennm", "t.ennm AS ennm");
|
||||
columns.put("baseId", "t.baseId AS baseId");
|
||||
columns.put("baseName", "t.baseName AS baseName");
|
||||
columns.put("hbrvcd", "t.hbrvcd AS hbrvcd");
|
||||
columns.put("hbrvcdName", "t.hbrvcdName AS hbrvcdName");
|
||||
columns.put("rvcd", "t.rvcd AS rvcd");
|
||||
columns.put("rvcdName", "t.rvcdName AS rvcdName");
|
||||
columns.put("addvcdName", "t.addvcdName AS addvcdName");
|
||||
columns.put("qi", "t.qi AS qi");
|
||||
columns.put("qo", "t.qo AS qo");
|
||||
columns.put("rz", "t.rz AS rz");
|
||||
columns.put("dz", "t.dz AS dz");
|
||||
columns.put("qecLimit", "t.qecLimit AS qecLimit");
|
||||
columns.put("qec", "t.qec AS qec");
|
||||
columns.put("mwrLimit", "t.mwrLimit AS mwrLimit");
|
||||
columns.put("avqLimit", "t.avqLimit AS avqLimit");
|
||||
columns.put("qecC", "t.qecC AS qecC");
|
||||
columns.put("mwrC", "t.mwrC AS mwrC");
|
||||
columns.put("avqC", "t.avqC AS avqC");
|
||||
columns.put("sfdb", "t.sfdb AS sfdb");
|
||||
columns.put("sfdbName", "t.sfdbName AS sfdbName");
|
||||
columns.put("qecSfdb", "t.qecSfdb AS qecSfdb");
|
||||
columns.put("mwrSfdb", "t.mwrSfdb AS mwrSfdb");
|
||||
columns.put("mwrSfdbName", "t.mwrSfdbName AS mwrSfdbName");
|
||||
columns.put("avqSfdb", "t.avqSfdb AS avqSfdb");
|
||||
columns.put("avqSfdbName", "t.avqSfdbName AS avqSfdbName");
|
||||
columns.put("dt", "t.dt AS dt");
|
||||
columns.put("qecRuleDid", "t.qecRuleDid AS qecRuleDid");
|
||||
columns.put("qecMwrruleDid", "t.qecMwrruleDid AS qecMwrruleDid");
|
||||
columns.put("beforeQec", "t.beforeQec AS beforeQec");
|
||||
columns.put("baseStepSort", "t.baseStepSort AS baseStepSort");
|
||||
columns.put("rvcdStepSort", "t.rvcdStepSort AS rvcdStepSort");
|
||||
columns.put("rstcdStepSort", "t.rstcdStepSort AS rstcdStepSort");
|
||||
columns.put("siteStepSort", "t.siteStepSort AS siteStepSort");
|
||||
return columns;
|
||||
}
|
||||
|
||||
private String buildDetailOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY baseStepSort ASC, rvcdStepSort ASC, rstcdStepSort ASC, siteStepSort ASC, tm DESC";
|
||||
@ -3353,6 +3592,10 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return "tm".equalsIgnoreCase(field);
|
||||
}
|
||||
|
||||
private boolean isEqDayDateField(String field) {
|
||||
return "dt".equalsIgnoreCase(field) || "tm".equalsIgnoreCase(field);
|
||||
}
|
||||
|
||||
private String buildEqValueExpr(String paramKey, boolean dateField, Object value) {
|
||||
if (!dateField || value == null) {
|
||||
return "#{map." + paramKey + "}";
|
||||
@ -3364,6 +3607,83 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return "TO_DATE(#{map." + paramKey + "}, 'YYYY-MM-DD HH24:MI:SS')";
|
||||
}
|
||||
|
||||
private String buildDayFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
if (filter == null) {
|
||||
return "";
|
||||
}
|
||||
if (StrUtil.isNotBlank(filter.getField())) {
|
||||
return buildDayLeafCondition(filter, paramMap, indexHolder);
|
||||
}
|
||||
if (CollUtil.isEmpty(filter.getFilters())) {
|
||||
return "";
|
||||
}
|
||||
List<String> conditions = new ArrayList<>();
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
String childSql = buildDayFilterCondition(child, paramMap, indexHolder);
|
||||
if (StrUtil.isNotBlank(childSql)) {
|
||||
conditions.add("(" + childSql + ")");
|
||||
}
|
||||
}
|
||||
if (conditions.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||
return String.join(logic, conditions);
|
||||
}
|
||||
|
||||
private String buildDayLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
String column = mapDayColumn(filter.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
return "";
|
||||
}
|
||||
return buildGenericCondition(column, filter, paramMap, indexHolder, isEqDayDateField(filter.getField()));
|
||||
}
|
||||
|
||||
private String buildDayDetailOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY baseStepSort ASC, rvcdStepSort ASC, rstcdStepSort ASC, siteStepSort ASC, dt DESC";
|
||||
}
|
||||
List<String> orders = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sortList) {
|
||||
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapDayOrderColumn(sort.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orders.add(column + " " + dir);
|
||||
}
|
||||
if (orders.isEmpty()) {
|
||||
return " ORDER BY baseStepSort ASC, rvcdStepSort ASC, rstcdStepSort ASC, siteStepSort ASC, dt DESC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orders);
|
||||
}
|
||||
|
||||
private String buildDayGroupOrderBySql(List<DataSourceRequest.GroupDescriptor> groups) {
|
||||
if (CollUtil.isEmpty(groups)) {
|
||||
return "";
|
||||
}
|
||||
List<String> orders = new ArrayList<>();
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groups) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapDayColumn(descriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(descriptor.getDir()) || "des".equalsIgnoreCase(descriptor.getDir()) ? "DESC" : "ASC";
|
||||
orders.add(column + " " + dir);
|
||||
}
|
||||
return orders.isEmpty() ? "" : " ORDER BY " + String.join(", ", orders);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3825,6 +4145,51 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
};
|
||||
}
|
||||
|
||||
private String mapDayColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "id" -> "t.id";
|
||||
case "stcd" -> "t.stcd";
|
||||
case "stnm", "ennm" -> "t.ennm";
|
||||
case "baseId" -> "t.baseId";
|
||||
case "baseName" -> "t.baseName";
|
||||
case "hbrvcd" -> "t.hbrvcd";
|
||||
case "hbrvcdName" -> "t.hbrvcdName";
|
||||
case "rvcd" -> "t.rvcd";
|
||||
case "rvcdName" -> "t.rvcdName";
|
||||
case "addvcdName" -> "t.addvcdName";
|
||||
case "qi" -> "t.qi";
|
||||
case "qo" -> "t.qo";
|
||||
case "rz" -> "t.rz";
|
||||
case "dz" -> "t.dz";
|
||||
case "qecLimit" -> "t.qecLimit";
|
||||
case "qec" -> "t.qec";
|
||||
case "mwrLimit" -> "t.mwrLimit";
|
||||
case "avqLimit" -> "t.avqLimit";
|
||||
case "qecC" -> "t.qecC";
|
||||
case "mwrC" -> "t.mwrC";
|
||||
case "avqC" -> "t.avqC";
|
||||
case "sfdb" -> "t.sfdb";
|
||||
case "sfdbName" -> "t.sfdbName";
|
||||
case "qecSfdb" -> "t.qecSfdb";
|
||||
case "mwrSfdb" -> "t.mwrSfdb";
|
||||
case "mwrSfdbName" -> "t.mwrSfdbName";
|
||||
case "avqSfdb" -> "t.avqSfdb";
|
||||
case "avqSfdbName" -> "t.avqSfdbName";
|
||||
case "dt", "tm" -> "t.dt";
|
||||
case "qecRuleDid" -> "t.qecRuleDid";
|
||||
case "qecMwrruleDid" -> "t.qecMwrruleDid";
|
||||
case "beforeQec" -> "t.beforeQec";
|
||||
case "baseStepSort" -> "NVL(t.baseStepSort, 999999)";
|
||||
case "rvcdStepSort" -> "NVL(t.rvcdStepSort, 999999)";
|
||||
case "rstcdStepSort" -> "NVL(t.rstcdStepSort, 999999)";
|
||||
case "siteStepSort" -> "NVL(t.siteStepSort, 999999)";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String mapOrderColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
@ -3837,4 +4202,18 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String mapDayOrderColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "baseStepSort", "rvcdStepSort", "rstcdStepSort", "siteStepSort",
|
||||
"dt", "stcd", "stnm", "ennm", "qi", "qo", "qec", "sfdb",
|
||||
"rz", "dz", "qecLimit", "mwrLimit", "avqLimit", "baseName",
|
||||
"rvcdName", "hbrvcdName", "addvcdName", "beforeQec" -> field;
|
||||
case "tm" -> "dt";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,6 +226,9 @@ public class FpVmsstbprptVo implements Serializable {
|
||||
@Schema(description = "数据来源")
|
||||
private String vlsr;
|
||||
|
||||
@Schema(description = "LOGO")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "数据来源时间")
|
||||
private Date vlsrTm;
|
||||
|
||||
|
||||
@ -98,6 +98,7 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("fp.STCD AS stcd, ")
|
||||
.append("fp.LOGO AS logo, ")
|
||||
.append("fp.STNM AS stnm, ")
|
||||
.append("fp.STTP AS sttpCode, ")
|
||||
.append("sttp.STTP_NAME AS sttpName, ")
|
||||
@ -313,6 +314,7 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
columnMap.put("sttpName", "sttp.STTP_NAME");
|
||||
columnMap.put("sttpFullPath", "sttp.FULL_PATH");
|
||||
columnMap.put("rstcd", "fp.RSTCD");
|
||||
columnMap.put("logo", "fp.LOGO");
|
||||
columnMap.put("ennm", "eng.ENNM");
|
||||
columnMap.put("baseId", "eng.BASE_ID");
|
||||
columnMap.put("baseName", "hb.BASENAME");
|
||||
|
||||
@ -2,7 +2,14 @@ import request from '@/utils/request';
|
||||
//过鱼设施介绍
|
||||
export function vmsstbprptGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList',
|
||||
url: '/vd/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
export function fpVmsstbprptGetKendoList(data: any) {
|
||||
return request({
|
||||
url: '/fp/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -10,7 +17,7 @@ export function vmsstbprptGetKendoList(data: any) {
|
||||
//过鱼设施
|
||||
export function buildGetKendoListCust(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/env/fp/build/GetKendoListCust',
|
||||
url: '/fp/build/GetKendoListCust',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -18,7 +25,7 @@ export function buildGetKendoListCust(data: any) {
|
||||
//过鱼总量
|
||||
export function yearGetYearFpStatistics(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-env-server/env/fp/run/qgc/year/GetYearFpStatistics',
|
||||
url: '/fp/run/qgc/year/GetYearFpStatistics',
|
||||
method: 'get',
|
||||
params:data
|
||||
});
|
||||
|
||||
@ -179,6 +179,30 @@ const columnsConfig = ref([
|
||||
type: 'fp_point',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'FP',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'FP_1',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'FP_2',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'FP_3',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'FP_4',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'FP_5',
|
||||
columns: FPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'fb_point',
|
||||
columns: FBPointColumns
|
||||
|
||||
@ -361,27 +361,27 @@ const FPTabs: Array<any> =
|
||||
];
|
||||
|
||||
// // 过鱼设施在建状态
|
||||
// const FPTabs1: Array<any> = [
|
||||
// {
|
||||
// name: '基础信息',
|
||||
// key: 'basicInfo',
|
||||
// type: 'basic',
|
||||
// url: '/bbi/siteBipc/getSiteBasicInfo'
|
||||
// },
|
||||
// {
|
||||
// name: '实时视频',
|
||||
// key: 'videoInfo',
|
||||
// type: 'video',
|
||||
// url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
// },
|
||||
// {
|
||||
// name: '建设情况',
|
||||
// key: 'FishFacilityBuildState', //basicState
|
||||
// type: 'FishFacilityBuildState', //basicState
|
||||
// // url: "/env/fp/fpFacilities/getFpStcdConstructionInfo2",
|
||||
// url: '/wmp-env-server/env/fp/run/secondBuild/GetKendoListCust'
|
||||
// }
|
||||
// ]
|
||||
const FPTabs1: Array<any> = [
|
||||
{
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo'
|
||||
},
|
||||
{
|
||||
name: '实时视频',
|
||||
key: 'videoInfo',
|
||||
type: 'video',
|
||||
url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
},
|
||||
{
|
||||
name: '建设情况',
|
||||
key: 'FishFacilityBuildState', //basicState
|
||||
type: 'FishFacilityBuildState', //basicState
|
||||
// url: "/env/fp/fpFacilities/getFpStcdConstructionInfo2",
|
||||
url: '/wmp-env-server/env/fp/run/secondBuild/GetKendoListCust'
|
||||
}
|
||||
];
|
||||
//鱼类增殖站 √
|
||||
const FBTabs: Array<any> = [
|
||||
{
|
||||
@ -675,13 +675,13 @@ const WQFBTabs: Array<any> = [
|
||||
key: 'WaterQuality',
|
||||
type: 'WaterQuality',
|
||||
default: true // 默认显示
|
||||
},
|
||||
{
|
||||
name: '实时视频',
|
||||
key: 'videoInfo',
|
||||
type: 'video',
|
||||
url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
}
|
||||
// {
|
||||
// name: '实时视频',
|
||||
// key: 'videoInfo',
|
||||
// type: 'video',
|
||||
// url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
// }
|
||||
];
|
||||
const WQTabs: Array<any> = [
|
||||
...WQFBTabs,
|
||||
@ -1279,27 +1279,32 @@ const handleTabs = (modaldata: any) => {
|
||||
case 'DW_4':
|
||||
case 'DW_5':
|
||||
return DWTabs;
|
||||
// case 'FP': //todo,后续再删除多余代码
|
||||
// case 'FP_1': //todo,后续再删除多余代码
|
||||
// // case "FP_2": //todo,后续再删除多余代码
|
||||
// case 'FP_3': //todo,后续再删除多余代码
|
||||
// case 'FP_4': //todo,后续再删除多余代码
|
||||
// // case "FP_5": //todo,后续再删除多余代码
|
||||
// if (Session.getAppCode() === 'hbb') {
|
||||
// // mway为2的时侯显示在线监测数据
|
||||
// if (modaldata.bldsttCcode == '1' || modaldata.bldsttCcode == '0' || modaldata.bldstt == '1' || modaldata.bldstt == '0') {
|
||||
// return [
|
||||
// ...FPTabs1 //建设情况
|
||||
// ]
|
||||
// } else {
|
||||
// if (modaldata.mway != 2) {
|
||||
// return FPTabs.filter((item) => item.name !== '在线监测数据')
|
||||
// } else {
|
||||
// return [
|
||||
// ...FPTabs //有监测数据
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
case 'FP': //todo,后续再删除多余代码
|
||||
case 'FP_1': //todo,后续再删除多余代码
|
||||
// case "FP_2": //todo,后续再删除多余代码
|
||||
case 'FP_3': //todo,后续再删除多余代码
|
||||
case 'FP_4': //todo,后续再删除多余代码
|
||||
// case "FP_5": //todo,后续再删除多余代码
|
||||
// // if (Session.getAppCode() === 'hbb') {
|
||||
// mway为2的时侯显示在线监测数据
|
||||
if (
|
||||
modaldata.bldsttCcode == '1' ||
|
||||
modaldata.bldsttCcode == '0' ||
|
||||
modaldata.bldstt == '1' ||
|
||||
modaldata.bldstt == '0'
|
||||
) {
|
||||
return [
|
||||
...FPTabs1 //建设情况
|
||||
];
|
||||
} else {
|
||||
if (modaldata.mway != 2) {
|
||||
return FPTabs.filter(item => item.name !== '在线监测数据');
|
||||
} else {
|
||||
return [
|
||||
...FPTabs //有监测数据
|
||||
];
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// if (modaldata.bldsttCcode == '1' || modaldata.bldsttCcode == '0' || modaldata.bldstt == '1' || modaldata.bldstt == '0') {
|
||||
// return [
|
||||
@ -1323,13 +1328,18 @@ const handleTabs = (modaldata: any) => {
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
// case 'FP_2': //todo,后续再删除多余代码
|
||||
// case 'FP_5': //todo,后续再删除多余代码
|
||||
// if (modaldata.bldsttCcode == '1' || modaldata.bldsttCcode == '0' || modaldata.bldstt == '1' || modaldata.bldstt == '0') {
|
||||
// return FPTabs1
|
||||
// } else {
|
||||
// return FPTabs
|
||||
// }
|
||||
case 'FP_2': //todo,后续再删除多余代码
|
||||
case 'FP_5': //todo,后续再删除多余代码
|
||||
if (
|
||||
modaldata.bldsttCcode == '1' ||
|
||||
modaldata.bldsttCcode == '0' ||
|
||||
modaldata.bldstt == '1' ||
|
||||
modaldata.bldstt == '0'
|
||||
) {
|
||||
return FPTabs1;
|
||||
} else {
|
||||
return FPTabs;
|
||||
}
|
||||
// case 'ZQ':
|
||||
// return ZQTabs
|
||||
// case 'FB':
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
<a-select v-model:value="formState.dataDimensionVal" placeholder="请选择" style="width: 120px"
|
||||
show-search :filter-option="filterBaseOption" option-filter-prop="label"
|
||||
@change="handleBaseChange">
|
||||
<a-select-option v-for="item in baseList" :key="item.baseid" :value="item.baseid"
|
||||
:label="item.basename">
|
||||
{{ item.basename }}
|
||||
<a-select-option v-for="item in baseList" :key="item.wbsCode" :value="item.wbsCode"
|
||||
:label="item.wbsName">
|
||||
{{ item.wbsName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@ -115,7 +115,7 @@ dayjs.extend(isSameOrAfter)
|
||||
|
||||
// Props 定义
|
||||
const props = defineProps<{
|
||||
datas?: Array<{ baseid: string; basename: string }> // 基地列表
|
||||
datas?: Array<{ wbsCode: string; wbsName: string }> // 基地列表
|
||||
type?: string // 时间维度
|
||||
modalData?: string // 模态框数据
|
||||
dateValue?: string | Dayjs // 日期值
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<!-- 环境质量满足度弹框 -->
|
||||
<a-modal v-model:open="modalVisible" title="环境质量满足度" width="1536px" :footer="null" centered>
|
||||
<EnvironmentalQualityTwoLayers :datas="(baseid == 'all' ? jiDiList : stationListForModal)" :type="select.value"
|
||||
<EnvironmentalQualityTwoLayers :datas="(baseid == 'all' ? JidiSelectEventStore.jidiData : stationListForModal)" :type="select.value"
|
||||
:dateValue="datetimePicker.value" :dataDimensionVal="(clickedBarData?.selectedId || baseid)"
|
||||
:buildType="tabs" :typeOne="fieldOne" :baseid="baseid" />
|
||||
</a-modal>
|
||||
@ -80,83 +80,6 @@ const datetimePicker = ref({
|
||||
options: [],
|
||||
});
|
||||
const baseid = ref("")
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
])
|
||||
const fieldOne = ref('')
|
||||
// 解析API返回的嵌套数据(支持两种结构)
|
||||
const parseApiResponse = (items: any[], currentValueForApi: string, lastYearValue: string) => {
|
||||
|
||||
@ -27,16 +27,61 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 详情弹框 -->
|
||||
<a-modal
|
||||
v-model:open="modalVisible"
|
||||
:title="modalTitle"
|
||||
width="1650px"
|
||||
:footer="null"
|
||||
@cancel="handleModalClose"
|
||||
>
|
||||
<div class="modal-content">
|
||||
<a-descriptions bordered :column="2" size="small">
|
||||
<a-descriptions-item label="年份">
|
||||
{{ modalData.year }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="流域/设施">
|
||||
{{ modalData.basinName }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="鱼类总数">
|
||||
<span style="color: #1890ff; font-weight: bold;">
|
||||
{{ modalData.totalCount }} {{ getUnit() }}
|
||||
</span>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="">
|
||||
{{ modalData.baseid }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
|
||||
<a-divider orientation="left">鱼类分布详情</a-divider>
|
||||
|
||||
<a-table
|
||||
:columns="fishColumns"
|
||||
:data-source="modalData.fishList"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
:scroll="{ y: 300 }"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'percentage'">
|
||||
{{ record.percentage }}%
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</a-modal>
|
||||
</SidePanelItem>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue';
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch, computed } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import type { ECharts } from 'echarts';
|
||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||
import { yearGetYearFpStatistics } from '@/api/gyss';
|
||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||
import type { ColumnsType } from 'ant-design-vue/es/table/Table';
|
||||
|
||||
// API 数据类型定义
|
||||
interface FpFtpStatisticsVo {
|
||||
@ -88,7 +133,8 @@ const currentYear = ref<string>(''); // 当前选中的年份
|
||||
// 图表相关
|
||||
interface ChartDataItem {
|
||||
title: string;
|
||||
data: Array<{ name: string; value: number }>;
|
||||
baseid?: string; // 流域ID(用于标识该图表所属的流域)
|
||||
data: Array<{ name: string; value: number; baseId?: string }>; // 扩展数据项,支持存储流域ID
|
||||
}
|
||||
|
||||
// 原始图表数据(多组数据用于跑马灯)
|
||||
@ -103,6 +149,52 @@ const currentIndex = ref(1); // 从1开始,跳过克隆的首项
|
||||
// 定时器引用
|
||||
let timer: any = null;
|
||||
|
||||
// 弹框相关状态
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const modalData = ref<{
|
||||
year: string;
|
||||
basinName: string;
|
||||
baseid?: string; // 添加流域ID
|
||||
totalCount: number;
|
||||
fishTypes: number;
|
||||
fishList: Array<{
|
||||
name: string;
|
||||
value: number;
|
||||
percentage: string;
|
||||
}>;
|
||||
}>({
|
||||
year: '',
|
||||
basinName: '',
|
||||
baseid: '',
|
||||
totalCount: 0,
|
||||
fishTypes: 0,
|
||||
fishList: []
|
||||
});
|
||||
|
||||
// 鱼类列表表格列定义
|
||||
const fishColumns: ColumnsType = [
|
||||
{
|
||||
title: '鱼类名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
dataIndex: 'value',
|
||||
key: 'value',
|
||||
width: 120,
|
||||
customRender: ({ text }: any) => `${text} ${getUnit()}`
|
||||
},
|
||||
{
|
||||
title: '占比',
|
||||
dataIndex: 'percentage',
|
||||
key: 'percentage',
|
||||
width: 100
|
||||
}
|
||||
];
|
||||
|
||||
/**
|
||||
* 停止自动轮播
|
||||
*/
|
||||
@ -216,6 +308,12 @@ const initChart = (index: number) => {
|
||||
|
||||
const chartInstance = echarts.init(chartRef);
|
||||
chartInstances.value[index] = chartInstance;
|
||||
|
||||
// 添加点击事件监听
|
||||
chartInstance.on('click', (params: any) => {
|
||||
handleChartClick(renderChartData.value[index], index, params);
|
||||
});
|
||||
|
||||
updateChart(index);
|
||||
};
|
||||
|
||||
@ -443,6 +541,7 @@ onUnmounted(() => {
|
||||
const buildSingleBasinChartData = (basin: BasinData, year: string): ChartDataItem => {
|
||||
return {
|
||||
title: `${basin.baseName}`,
|
||||
baseid: basin.baseId, // 保存流域ID
|
||||
data: basin.fpFtpStatitcsVos.map((fish: FpFtpStatisticsVo) => ({
|
||||
name: fish.fishName,
|
||||
value: fish.fcnt
|
||||
@ -461,12 +560,14 @@ const buildAllBasinsChartData = (apiData: BasinData[], year: string): ChartDataI
|
||||
.filter(basin => basin.fpFtpStatitcsVos && basin.fpFtpStatitcsVos.length > 0)
|
||||
.map(basin => ({
|
||||
name: basin.baseName,
|
||||
value: basin.fpCount
|
||||
value: basin.fpCount,
|
||||
baseId: basin.baseId // 添加流域ID,用于点击事件传参
|
||||
}));
|
||||
|
||||
if (basinComparisonData.length > 0) {
|
||||
charts.push({
|
||||
title: `总量`,
|
||||
baseid: 'all', // 标记为总量图表
|
||||
data: basinComparisonData
|
||||
});
|
||||
}
|
||||
@ -647,6 +748,57 @@ const handlePanelChange1 = (data: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理图表点击事件
|
||||
* @param item 图表数据项
|
||||
* @param index 图表索引
|
||||
* @param params ECharts 点击事件参数(可选)
|
||||
*/
|
||||
const handleChartClick = (item: ChartDataItem, index: number, params?: any) => {
|
||||
// 计算总数量和百分比
|
||||
const totalCount = getTotalAmount(item.data);
|
||||
const fishList = item.data.map(fish => ({
|
||||
name: fish.name,
|
||||
value: fish.value,
|
||||
percentage: totalCount > 0 ? ((fish.value / totalCount) * 100).toFixed(2) : '0.00'
|
||||
}));
|
||||
|
||||
// 确定流域ID
|
||||
let clickedBaseId: string | undefined;
|
||||
|
||||
if (params && params.data && params.data.baseId) {
|
||||
// 情况1:总量对比图,点击了某个流域的数据项
|
||||
clickedBaseId = params.data.baseId;
|
||||
} else if (item.baseid && item.baseid !== 'all') {
|
||||
// 情况2:单一流域图,使用图表整体的 baseid
|
||||
clickedBaseId = item.baseid;
|
||||
} else {
|
||||
// 情况3:总量图表但未获取到具体数据项的 baseId(理论上不应该发生)
|
||||
clickedBaseId = item.baseid;
|
||||
}
|
||||
|
||||
// 设置弹框数据
|
||||
modalTitle.value = `${item.title} - 详情`;
|
||||
modalData.value = {
|
||||
year: currentYear.value || '-',
|
||||
basinName: params?.name || item.title, // 优先使用被点击的数据项名称
|
||||
baseid: clickedBaseId, // 保存正确的流域ID
|
||||
totalCount: totalCount,
|
||||
fishTypes: item.data.length,
|
||||
fishList: fishList
|
||||
};
|
||||
|
||||
// 打开弹框
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 关闭弹框
|
||||
*/
|
||||
const handleModalClose = () => {
|
||||
modalVisible.value = false;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => JidiSelectEventStore.selectedItem,
|
||||
(newVal) => {
|
||||
@ -661,6 +813,7 @@ watch(
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -731,4 +884,16 @@ watch(
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
.ant-descriptions {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.ant-divider {
|
||||
margin: 16px 0;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -76,86 +76,6 @@ const baseid = ref(''); // 当前选中的基地ID
|
||||
const modalVisible = ref(false); // 弹框显示状态
|
||||
const clickDataInfo = ref<any>(null); // 点击的数据点信息
|
||||
const stationName = ref(''); // 站点名称
|
||||
|
||||
// ==================== 基地列表数据(硬编码) ====================
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
])
|
||||
|
||||
// ==================== 数据处理函数 ====================
|
||||
|
||||
/**
|
||||
@ -735,8 +655,8 @@ const getselsectData = async () => {
|
||||
let treeData: any = []
|
||||
const dataMapNameArr: any = Object.entries(obj).map(([, v]) => v)
|
||||
treeData = dataMapNameArr?.sort((a: any, b: any) => {
|
||||
const indexA = jiDiList.value.findIndex(item => item.baseid === a.value);
|
||||
const indexB = jiDiList.value.findIndex(item => item.baseid === b.value);
|
||||
const indexA = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === a.value);
|
||||
const indexB = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === b.value);
|
||||
return indexA - indexB;
|
||||
})
|
||||
console.log('treeData', treeData)
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<a-form-item label="所属基地" name="dataDimensionVal">
|
||||
<a-select v-model:value="formState.dataDimensionVal" placeholder="请选择" style="width: 200px"
|
||||
@change="handleBaseChange">
|
||||
<a-select-option v-for="item in baseList" :key="item.baseid" :value="item.baseid">
|
||||
{{ item.basename }}
|
||||
<a-select-option v-for="item in baseList" :key="item.wbsCode" :value="item.wbsCode">
|
||||
{{ item.wbsName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@ -77,7 +77,7 @@ import { useModelStore } from "@/store/modules/model";
|
||||
const modelStore = useModelStore();
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
datas?: Array<{ baseid: string; basename: string }> // 基地列表
|
||||
datas?: Array<{ wbsCode: string; wbsName: string }> // 基地列表
|
||||
BID?: string // 基地ID
|
||||
data?: { name: string } // 设施类型名称
|
||||
res?: { bldstt: string; hydrodtin: string } // 初始筛选条件
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<a-modal v-model:open="modalVisible" title="设施类型及接入情况" width="1536px" :footer="null" @cancel="handleModalClose">
|
||||
<div class="modal-content">
|
||||
|
||||
<DiwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers ref="twoLayersRef" :datas="jiDiList" :BID="baseid"
|
||||
<DiwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers ref="twoLayersRef" :datas="JidiSelectEventStore.jidiData" :BID="baseid"
|
||||
:data="selectedItem" :res="res">
|
||||
</DiwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers>
|
||||
</div>
|
||||
@ -58,83 +58,6 @@ const iconMap: Record<string, string> = {
|
||||
'4': 'icon-dwsjhQita'
|
||||
};
|
||||
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
]);
|
||||
const res = ref({
|
||||
hydrodtin: '',
|
||||
bldstt: ''
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
import { ref, onMounted, onUnmounted, computed, watch } from 'vue';
|
||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||
import { vmsstbprptGetKendoList } from '@/api/gyss';
|
||||
import { fpVmsstbprptGetKendoList } from '@/api/gyss';
|
||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||
import { Empty } from 'ant-design-vue';
|
||||
|
||||
@ -75,7 +75,7 @@ defineOptions({
|
||||
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
const baseid = ref('all'); // 默认值为 'all'
|
||||
const baseUrl = import.meta.env.VITE_APP_PREVIEW_URL;
|
||||
const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
||||
// 弹框控制
|
||||
const modalVisible = ref(false);
|
||||
const currentItem = ref<any>(null);
|
||||
@ -259,7 +259,7 @@ const getCarouselData = async () => {
|
||||
sort: [{ field: 'rstcdStepSort', dir: 'asc' }]
|
||||
};
|
||||
|
||||
const res = await vmsstbprptGetKendoList(params);
|
||||
const res = await fpVmsstbprptGetKendoList(params);
|
||||
const data = res?.data?.data || [];
|
||||
|
||||
if (data.length > 0) {
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
:dataDimensionVal="detailModalData.baseid"
|
||||
:rvcd="detailModalData.rvcd"
|
||||
:stcd="detailModalData.stcd"
|
||||
:jdList="jiDiList" />
|
||||
:jdList="JidiSelectEventStore.jidiData" />
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
@ -98,86 +98,6 @@ const showChart = ref(true);
|
||||
// 详情弹框相关状态
|
||||
const detailModalVisible = ref(false);
|
||||
const detailModalData = ref<any>(null);
|
||||
|
||||
// 基地列表(与父组件保持一致)
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
]);
|
||||
|
||||
// 选择器相关 - 内部状态管理
|
||||
const selectValue = ref('');
|
||||
const selectOptions = ref<any[]>([]);
|
||||
@ -445,8 +365,8 @@ const getSelectConfig = async () => {
|
||||
if (dataOne.length > 0) {
|
||||
let dataMapNameMap: any = {}
|
||||
let jiDiListMap: any = {}
|
||||
jiDiList.value.forEach((item: any) => {
|
||||
jiDiListMap[item.baseid] = item.basename
|
||||
JidiSelectEventStore.jidiData.forEach((item: any) => {
|
||||
jiDiListMap[item.wbsCode] = item.wbsName
|
||||
})
|
||||
|
||||
dataOne.map((item: any, index: number) => {
|
||||
@ -475,8 +395,8 @@ const getSelectConfig = async () => {
|
||||
})
|
||||
})
|
||||
dataMapNameArr = dataMapNameArr.sort((a: any, b: any) => {
|
||||
const indexA = jiDiList.value.findIndex(item => item.baseid === a.value);
|
||||
const indexB = jiDiList.value.findIndex(item => item.baseid === b.value);
|
||||
const indexA = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === a.value);
|
||||
const indexB = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === b.value);
|
||||
return indexA - indexB;
|
||||
})
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<div v-if="modalData" class="modal-content">
|
||||
<MonthlyAverage
|
||||
:tm="modalData.date ? moment(modalData.date).format('YYYY-MM') + '-01 00:00:00' : moment().format('YYYY-MM') + '-01 23:59:59'"
|
||||
:dataDimensionVal="modalData.baseid" :rvcd='modalData.rvcd' :stcd="modalData.stcd" :jdList="jiDiList" />
|
||||
:dataDimensionVal="modalData.baseid" :rvcd='modalData.rvcd' :stcd="modalData.stcd" :jdList="JidiSelectEventStore.jidiData" />
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
@ -69,85 +69,6 @@ const stationName = ref('');
|
||||
// 图表放大展示弹框状态
|
||||
const zoomModalVisible = ref(false);
|
||||
|
||||
// 基地列表
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
]);
|
||||
|
||||
// 选择器配置
|
||||
const select = ref({
|
||||
show: true,
|
||||
@ -238,8 +159,8 @@ const getSelectConfig = async () => {
|
||||
if (dataOne.length > 0) {
|
||||
let dataMapNameMap: any = {}
|
||||
let jiDiListMap: any = {}
|
||||
jiDiList.value.forEach((item: any) => {
|
||||
jiDiListMap[item.baseid] = item.basename
|
||||
JidiSelectEventStore.jidiData.forEach((item: any) => {
|
||||
jiDiListMap[item.wbsCode] = item.wbsName
|
||||
})
|
||||
|
||||
dataOne.map((item: any, index: number) => {
|
||||
@ -268,8 +189,8 @@ const getSelectConfig = async () => {
|
||||
})
|
||||
})
|
||||
dataMapNameArr = dataMapNameArr.sort((a: any, b: any) => {
|
||||
const indexA = jiDiList.value.findIndex(item => item.baseid === a.value);
|
||||
const indexB = jiDiList.value.findIndex(item => item.baseid === b.value);
|
||||
const indexA = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === a.value);
|
||||
const indexB = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === b.value);
|
||||
return indexA - indexB;
|
||||
})
|
||||
select.value.options = filterSelectOptions(dataMapNameArr)
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<a-form-item label="基地名称" name="dataDimensionVal">
|
||||
<a-select v-model:value="formValue.dataDimensionVal" placeholder="请选择" style="width: 200px"
|
||||
@change="handleBaseChange">
|
||||
<a-select-option v-for="item in jdList" :key="item.baseid" :value="item.baseid">
|
||||
{{ item.basename }}
|
||||
<a-select-option v-for="item in jdList" :key="item.wbsCode" :value="item.wbsCode">
|
||||
{{ item.wbsName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
@ -69,7 +69,8 @@ import { ref, computed, watch, onMounted, nextTick } from 'vue';
|
||||
import { msstbprptGetKendoList, fhGetKendoListCust } from '@/api/qxd';
|
||||
import BasicTable from '@/components/BasicTable/index.vue';
|
||||
import { useModelStore } from '@/store/modules/model';
|
||||
|
||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
// ==================== Props 定义 ====================
|
||||
const props = defineProps<{
|
||||
baseId?: string;
|
||||
@ -89,68 +90,7 @@ const tableRef = ref();
|
||||
const stationOptions: any = ref([]);
|
||||
|
||||
// ==================== 基地列表数据(硬编码) ====================
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
value: 'all',
|
||||
label: '当前全部'
|
||||
},
|
||||
{
|
||||
value: '01',
|
||||
label: '金沙江干流'
|
||||
},
|
||||
{
|
||||
value: '02',
|
||||
label: '雅砻江干流'
|
||||
},
|
||||
{
|
||||
value: '03',
|
||||
label: '大渡河干流'
|
||||
},
|
||||
{
|
||||
value: '04',
|
||||
label: '乌江干流'
|
||||
},
|
||||
{
|
||||
value: '05',
|
||||
label: '长江上游干流'
|
||||
},
|
||||
{
|
||||
value: '10',
|
||||
label: '湘西'
|
||||
},
|
||||
{
|
||||
value: '08',
|
||||
label: '黄河上游干流'
|
||||
},
|
||||
{
|
||||
value: '09',
|
||||
label: '黄河中游干流'
|
||||
},
|
||||
{
|
||||
value: '06',
|
||||
label: '南盘江-红水河'
|
||||
},
|
||||
{
|
||||
value: '12',
|
||||
label: '东北'
|
||||
},
|
||||
{
|
||||
value: '07',
|
||||
label: '澜沧江干流'
|
||||
},
|
||||
{
|
||||
value: '13',
|
||||
label: '怒江干流'
|
||||
},
|
||||
{
|
||||
value: '11',
|
||||
label: '闽浙赣'
|
||||
},
|
||||
{
|
||||
value: 'other',
|
||||
label: '其他'
|
||||
}
|
||||
]);
|
||||
const jiDiList: any = ref([]);
|
||||
// 表格列定义
|
||||
const columns = [
|
||||
{
|
||||
@ -439,6 +379,12 @@ const handleViewDetail = (record: any, type: any) => {
|
||||
onMounted(() => {
|
||||
getselectTwo();
|
||||
handleSearch();
|
||||
JidiSelectEventStore.jidiData.forEach(element => {
|
||||
jiDiList.value.push({
|
||||
label: element.wbsName,
|
||||
value: element.wbsCode
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -49,68 +49,7 @@ defineOptions({
|
||||
// ==================== 响应式变量定义 ====================
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
// ==================== 基地列表数据(硬编码) ====================
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
value: 'all',
|
||||
label: '当前全部'
|
||||
},
|
||||
{
|
||||
value: '01',
|
||||
label: '金沙江干流'
|
||||
},
|
||||
{
|
||||
value: '02',
|
||||
label: '雅砻江干流'
|
||||
},
|
||||
{
|
||||
value: '03',
|
||||
label: '大渡河干流'
|
||||
},
|
||||
{
|
||||
value: '04',
|
||||
label: '乌江干流'
|
||||
},
|
||||
{
|
||||
value: '05',
|
||||
label: '长江上游干流'
|
||||
},
|
||||
{
|
||||
value: '10',
|
||||
label: '湘西'
|
||||
},
|
||||
{
|
||||
value: '08',
|
||||
label: '黄河上游干流'
|
||||
},
|
||||
{
|
||||
value: '09',
|
||||
label: '黄河中游干流'
|
||||
},
|
||||
{
|
||||
value: '06',
|
||||
label: '南盘江-红水河'
|
||||
},
|
||||
{
|
||||
value: '12',
|
||||
label: '东北'
|
||||
},
|
||||
{
|
||||
value: '07',
|
||||
label: '澜沧江干流'
|
||||
},
|
||||
{
|
||||
value: '13',
|
||||
label: '怒江干流'
|
||||
},
|
||||
{
|
||||
value: '11',
|
||||
label: '闽浙赣'
|
||||
},
|
||||
{
|
||||
value: 'other',
|
||||
label: '其他'
|
||||
}
|
||||
]);
|
||||
const jiDiList: any = ref([]);
|
||||
const select = ref({
|
||||
show: true,
|
||||
value: 'all',
|
||||
@ -420,6 +359,12 @@ const handlePanelChange1 = async data => {
|
||||
// 页面加载时执行
|
||||
onMounted(() => {
|
||||
// 延迟初始化,确保容器已渲染
|
||||
JidiSelectEventStore.jidiData.forEach(element => {
|
||||
jiDiList.value.push({
|
||||
label: element.wbsName,
|
||||
value: element.wbsCode
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
// 组件卸载时清理
|
||||
|
||||
@ -34,83 +34,7 @@ const showemit = ref(true)
|
||||
// 弹框相关状态
|
||||
const modalVisible = ref(false)
|
||||
const currentData = ref<any>({})
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
const chartRef = ref<HTMLElement | null>(null)
|
||||
let chartInstance: echarts.ECharts | null = null
|
||||
@ -258,10 +182,9 @@ const getselectData = async () => {
|
||||
}
|
||||
})
|
||||
|
||||
// 按 jiDiList 顺序排序普通基地
|
||||
dataMapNameArr.sort((a, b) => {
|
||||
const indexA = jiDiList.value.findIndex((item: any) => item.baseid === a.value)
|
||||
const indexB = jiDiList.value.findIndex((item: any) => item.baseid === b.value)
|
||||
const indexA = JidiSelectEventStore.jidiData.findIndex((item: any) => item.wbsCode === a.value)
|
||||
const indexB = JidiSelectEventStore.jidiData.findIndex((item: any) => item.wbsCode === b.value)
|
||||
return indexA - indexB
|
||||
})
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import { message } from 'ant-design-vue'
|
||||
import { useModelStore } from '@/store/modules/model'
|
||||
import { handleTabs } from '@/components/MapModal/setting.config'
|
||||
import { getKendoList, getKendoListCust, getIntroduce } from '@/api/shuidiankaifa'
|
||||
|
||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||
// ==================== 开发配置 ====================
|
||||
const USE_MOCK_DATA = true // 开发时使用模拟数据,生产时改为 false
|
||||
|
||||
@ -62,7 +62,7 @@ interface ModalData {
|
||||
|
||||
// 引入 modelStore 用于控制全局 MapModal
|
||||
const modelStore = useModelStore()
|
||||
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
// 基地相关
|
||||
const qid = ref<string>('')
|
||||
const jiDiList = ref<any[]>([])
|
||||
@ -1190,17 +1190,12 @@ watch(
|
||||
*/
|
||||
onMounted(() => {
|
||||
// 模拟加载基地列表(更真实的基地数据)
|
||||
jiDiList.value = [
|
||||
{ baseid: 'all', basename: '全部基地' },
|
||||
{ baseid: 'cj', basename: '长江流域' },
|
||||
{ baseid: 'hh', basename: '黄河流域' },
|
||||
{ baseid: 'zj', basename: '珠江流域' },
|
||||
{ baseid: 'hh2', basename: '淮河流域' },
|
||||
{ baseid: 'hj', basename: '海河流域' },
|
||||
{ baseid: 'sj', basename: '松花江流域' },
|
||||
{ baseid: 'lj', basename: '辽河流域' },
|
||||
{ baseid: 'other', basename: '其他' }
|
||||
]
|
||||
JidiSelectEventStore.jidiData.forEach(element => {
|
||||
jiDiList.value.push({
|
||||
label: element.wbsName,
|
||||
value: element.wbsCode
|
||||
})
|
||||
});
|
||||
|
||||
// 设置默认选中"全部基地"
|
||||
if (!qid.value) {
|
||||
|
||||
@ -53,83 +53,6 @@ const prompts = computed(() => ({
|
||||
show: true,
|
||||
value: `注:最新数据时间为${dataOne.value || getCurrentHourTime()}`,
|
||||
}));
|
||||
const jiDiList: any = ref([
|
||||
{
|
||||
"baseid": "all",
|
||||
"basename": "当前全部",
|
||||
"id": "9BFEC848-83EA-AD22-6DE2-10E969476693"
|
||||
},
|
||||
{
|
||||
"baseid": "01",
|
||||
"basename": "金沙江干流",
|
||||
"id": "A33040B7-8977-D9F1-5E02-D7F0241AB8AA"
|
||||
},
|
||||
{
|
||||
"baseid": "02",
|
||||
"basename": "雅砻江干流",
|
||||
"id": "C63D6020-995D-FE97-2F4A-F619A7142C79"
|
||||
},
|
||||
{
|
||||
"baseid": "03",
|
||||
"basename": "大渡河干流",
|
||||
"id": "CCB0766B-F1D4-7DD6-650F-5C556B7231B3"
|
||||
},
|
||||
{
|
||||
"baseid": "04",
|
||||
"basename": "乌江干流",
|
||||
"id": "E8A66641-B4F4-CC85-0815-38C5B2F93DBD"
|
||||
},
|
||||
{
|
||||
"baseid": "05",
|
||||
"basename": "长江上游干流",
|
||||
"id": "E02C11E9-CEA5-A030-202F-3BFE84465D03"
|
||||
},
|
||||
{
|
||||
"baseid": "10",
|
||||
"basename": "湘西",
|
||||
"id": "B1D1D52D-CEEF-6DC4-27DF-9990EB572F8D"
|
||||
},
|
||||
{
|
||||
"baseid": "08",
|
||||
"basename": "黄河上游干流",
|
||||
"id": "BC6AF135-263D-09A9-D5CA-C99B2598FE6E"
|
||||
},
|
||||
{
|
||||
"baseid": "09",
|
||||
"basename": "黄河中游干流",
|
||||
"id": "60EEEC28-128F-A2A8-44F3-6EAAC8FD8BB6"
|
||||
},
|
||||
{
|
||||
"baseid": "06",
|
||||
"basename": "南盘江-红水河",
|
||||
"id": "7BB9A8F4-34B5-42B4-A7FC-CE910AD7F203"
|
||||
},
|
||||
{
|
||||
"baseid": "12",
|
||||
"basename": "东北",
|
||||
"id": "47F8EF06-924E-E161-FCAF-62A66BBF252D"
|
||||
},
|
||||
{
|
||||
"baseid": "07",
|
||||
"basename": "澜沧江干流",
|
||||
"id": "A966A4C9-278C-B0DA-2B97-2D10B7A6E96A"
|
||||
},
|
||||
{
|
||||
"baseid": "13",
|
||||
"basename": "怒江干流",
|
||||
"id": "FA89E8CB-67A8-76DA-DC1E-23AE4C54F9E4"
|
||||
},
|
||||
{
|
||||
"baseid": "11",
|
||||
"basename": "闽浙赣",
|
||||
"id": "CD98F995-EEB2-1021-D807-DA1B1AD9E49A"
|
||||
},
|
||||
{
|
||||
"baseid": "other",
|
||||
"basename": "其他",
|
||||
"id": "AFBDFC67-B955-4EFD-959A-014CFB59EBFC"
|
||||
}
|
||||
])
|
||||
const showemit = ref(false)
|
||||
const loading = ref(false)
|
||||
// const selectOptions: any = ref([])
|
||||
@ -462,8 +385,8 @@ const getSelectConfig = async () => {
|
||||
if (dataOne.length > 0) {
|
||||
let dataMapNameMap: any = {}
|
||||
let jiDiListMap: any = {}
|
||||
jiDiList.value.forEach((item: any) => {
|
||||
jiDiListMap[item.baseid] = item.basename
|
||||
JidiSelectEventStore.jidiData.forEach((item: any) => {
|
||||
jiDiListMap[item.wbsCode] = item.wbsName
|
||||
})
|
||||
|
||||
dataOne.map((item: any, index: number) => {
|
||||
@ -492,8 +415,8 @@ const getSelectConfig = async () => {
|
||||
})
|
||||
})
|
||||
dataMapNameArr = dataMapNameArr.sort((a: any, b: any) => {
|
||||
const indexA = jiDiList.value.findIndex(item => item.baseid === a.value);
|
||||
const indexB = jiDiList.value.findIndex(item => item.baseid === b.value);
|
||||
const indexA = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === a.value);
|
||||
const indexB = JidiSelectEventStore.jidiData.findIndex(item => item.wbsCode === b.value);
|
||||
return indexA - indexB;
|
||||
})
|
||||
select.value.options = filterSelectOptions(dataMapNameArr)
|
||||
|
||||
@ -245,7 +245,7 @@ let columns = ref([
|
||||
title: '过鱼开始时间',
|
||||
width: 140,
|
||||
customRender: ({ text }) => {
|
||||
return text ? dayjs(text).format('YYYY-MM-DD') : '';
|
||||
return text && text!= '-' ? dayjs(text).format('YYYY-MM-DD') : '-';
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -254,7 +254,7 @@ let columns = ref([
|
||||
title: '过鱼结束时间',
|
||||
width: 140,
|
||||
customRender: ({ text }) => {
|
||||
return text ? dayjs(text).format('YYYY-MM-DD') : '';
|
||||
return text && text!= '-' ? dayjs(text).format('YYYY-MM-DD') : '-';
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -17,12 +17,22 @@
|
||||
<template v-if="column.key === 'action' || column.dataIndex === 'action'">
|
||||
<div class="flex">
|
||||
<template v-if="editingRowIndex === index">
|
||||
<a-button type="link" size="small" @click="saveEdit(index)">保存</a-button>
|
||||
<a-button type="link" size="small" @click="cancelEdit">取消</a-button>
|
||||
<a-button type="link" size="small" @click="saveEdit(index)"
|
||||
>保存</a-button
|
||||
>
|
||||
<a-button type="link" size="small" @click="cancelEdit"
|
||||
>取消</a-button
|
||||
>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-button type="link" size="small" @click="startEdit(index)">编辑</a-button>
|
||||
<a-button type="link" danger size="small" @click="handlePreviewDelete(index)"
|
||||
<a-button type="link" size="small" @click="startEdit(index)"
|
||||
>编辑</a-button
|
||||
>
|
||||
<a-button
|
||||
type="link"
|
||||
danger
|
||||
size="small"
|
||||
@click="handlePreviewDelete(index)"
|
||||
>删除</a-button
|
||||
>
|
||||
</template>
|
||||
@ -38,7 +48,9 @@
|
||||
"
|
||||
>
|
||||
<div style="color: red; display: flex; align-items: center">
|
||||
<span v-if="record[column.dataIndex]">{{ record[column.dataIndex] }}</span>
|
||||
<span v-if="record[column.dataIndex]">{{
|
||||
record[column.dataIndex]
|
||||
}}</span>
|
||||
<span v-else> 请添加{{ column.title }}</span>
|
||||
<exclamation-circle-outlined style="margin-left: 4px" />
|
||||
</div>
|
||||
@ -47,7 +59,9 @@
|
||||
<!-- 3. 编辑状态下的单元格 (绑定到 editingData) -->
|
||||
<template
|
||||
v-else-if="
|
||||
isEditing(index) && column.dataIndex != 'picpth' && column.dataIndex != 'vdpth'
|
||||
isEditing(index) &&
|
||||
column.dataIndex != 'picpth' &&
|
||||
column.dataIndex != 'vdpth'
|
||||
"
|
||||
>
|
||||
<!-- 基地 -->
|
||||
@ -82,8 +96,12 @@
|
||||
:filter-option="filterOption"
|
||||
:loading="rowStates[index]?.hbrvcdLoading"
|
||||
style="width: 100%"
|
||||
@change="(val) => handleHbrvcdChange(val, index, 'input')"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto', minWidth: '300px' }"
|
||||
@change="val => handleHbrvcdChange(val, index, 'input')"
|
||||
:dropdown-style="{
|
||||
maxHeight: '400px',
|
||||
overflow: 'auto',
|
||||
minWidth: '300px'
|
||||
}"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="opt in hbrvcdOptions"
|
||||
@ -107,7 +125,7 @@
|
||||
:loading="rowStates[index]?.engLoading"
|
||||
style="width: 100%"
|
||||
:disabled="!editingData.rvcd"
|
||||
@change="(val) => handleEngChange(val, index, 'input')"
|
||||
@change="val => handleEngChange(val, index, 'input')"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="opt in rowStates[index]?.engOptions || []"
|
||||
@ -131,7 +149,7 @@
|
||||
:loading="rowStates[index]?.fpssLoading"
|
||||
style="width: 100%"
|
||||
:disabled="!editingData.rstcd"
|
||||
@change="(val) => handleFpssChange(val, index)"
|
||||
@change="val => handleFpssChange(val, index)"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="opt in rowStates[index]?.fpssOptions || []"
|
||||
@ -151,7 +169,8 @@
|
||||
style="width: 100%"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
@change="(val) => delWarning(val, 'strdtStr')"
|
||||
:allow-clear="false"
|
||||
@change="val => delWarning(val, 'strdtStr')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@ -170,7 +189,7 @@
|
||||
v-model:value="editingData.direction"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
@change="(val) => delWarning(val, 'direction')"
|
||||
@change="val => delWarning(val, 'direction')"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in direction"
|
||||
@ -190,7 +209,7 @@
|
||||
:step="1"
|
||||
:precision="0"
|
||||
:min="0"
|
||||
@change="(val) => delWarning(val, column.dataIndex)"
|
||||
@change="val => delWarning(val, column.dataIndex)"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="['wt'].includes(column.dataIndex)">
|
||||
@ -204,7 +223,7 @@
|
||||
<template v-else-if="column.dataIndex === 'isfs'">
|
||||
<a-radio-group
|
||||
v-model:value="editingData.isfs"
|
||||
@change="(val) => delWarning(val, 'isfs')"
|
||||
@change="val => delWarning(val, 'isfs')"
|
||||
>
|
||||
<a-radio :value="1">是</a-radio>
|
||||
<a-radio :value="0">否</a-radio>
|
||||
@ -250,7 +269,9 @@
|
||||
<div class="preview" v-for="(item, index) in record.picpthList">
|
||||
<div
|
||||
class="text"
|
||||
:class="{ text_warning: record.picpthsWarnings.includes(item.name) }"
|
||||
:class="{
|
||||
text_warning: record.picpthsWarnings.includes(item.name)
|
||||
}"
|
||||
@click="emit('preview-click', record, 'image', index, 'delete')"
|
||||
>
|
||||
{{ item.name }}
|
||||
@ -275,28 +296,28 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import _ from "lodash";
|
||||
import { ref, reactive, onMounted, h } from "vue";
|
||||
import { message, Tag } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import fishSearch from "@/components/fishSearch/index.vue";
|
||||
import _ from 'lodash';
|
||||
import { ref, reactive, onMounted, h } from 'vue';
|
||||
import { message, Tag } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import fishSearch from '@/components/fishSearch/index.vue';
|
||||
import {
|
||||
getSelectForDropdown,
|
||||
getEngInfoDropdown,
|
||||
getFpssDropdown,
|
||||
revalidateAndUpdateRow,
|
||||
deleteRowById,
|
||||
} from "@/api/select";
|
||||
deleteRowById
|
||||
} from '@/api/select';
|
||||
|
||||
const props: any = defineProps({
|
||||
taskId: { type: String, default: "" },
|
||||
taskId: { type: String, default: '' },
|
||||
getFileList: { type: Function, default: () => {} },
|
||||
fileTableData: { type: Array, default: () => [] },
|
||||
fileLoading: { type: Boolean, default: false },
|
||||
direction: { type: Array, default: () => [] },
|
||||
direction: { type: Array, default: () => [] }
|
||||
});
|
||||
|
||||
const emit = defineEmits(["preview-click", "update:fileLoading"]);
|
||||
const emit = defineEmits(['preview-click', 'update:fileLoading']);
|
||||
|
||||
// --- 状态管理 ---
|
||||
const editingRowIndex = ref<number | null>(null);
|
||||
@ -308,91 +329,94 @@ const editingData = ref<any>(null);
|
||||
|
||||
const modalColumns = ref([
|
||||
{
|
||||
dataIndex: "rowIndex",
|
||||
key: "rowIndex",
|
||||
title: "序号",
|
||||
dataIndex: 'rowIndex',
|
||||
key: 'rowIndex',
|
||||
title: '序号',
|
||||
width: 60,
|
||||
dataIndexKey: "rowIndex",
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
dataIndexKey: 'rowIndex',
|
||||
align: 'center',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
dataIndex: "rvnm",
|
||||
key: "rvnm",
|
||||
dataIndexKey: "rvcd",
|
||||
title: "流域",
|
||||
width: 140,
|
||||
dataIndex: 'rvnm',
|
||||
key: 'rvnm',
|
||||
dataIndexKey: 'rvcd',
|
||||
title: '流域',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
dataIndex: "ennm",
|
||||
key: "ennm",
|
||||
dataIndexKey: "rstcd",
|
||||
title: "电站名称",
|
||||
width: 140,
|
||||
dataIndex: 'ennm',
|
||||
key: 'ennm',
|
||||
dataIndexKey: 'rstcd',
|
||||
title: '电站名称',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
dataIndex: "stnm",
|
||||
key: "stnm",
|
||||
dataIndexKey: "stcd",
|
||||
title: "过鱼设施名称",
|
||||
width: 150,
|
||||
dataIndex: 'stnm',
|
||||
key: 'stnm',
|
||||
dataIndexKey: 'stcd',
|
||||
title: '过鱼设施名称',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
dataIndex: "strdtStr",
|
||||
key: "strdtStr",
|
||||
dataIndexKey: "strdtStr",
|
||||
title: "过鱼时间",
|
||||
width: 190,
|
||||
dataIndex: 'strdtStr',
|
||||
key: 'strdtStr',
|
||||
dataIndexKey: 'strdtStr',
|
||||
title: '过鱼时间',
|
||||
width: 190
|
||||
},
|
||||
{
|
||||
dataIndex: "ftpName",
|
||||
key: "ftpName",
|
||||
dataIndexKey: "ftp",
|
||||
title: "鱼种类",
|
||||
width: 120,
|
||||
dataIndex: 'ftpName',
|
||||
key: 'ftpName',
|
||||
dataIndexKey: 'ftp',
|
||||
title: '鱼种类',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
dataIndex: "isfs",
|
||||
key: "isfs",
|
||||
title: "是否鱼苗",
|
||||
dataIndexKey: "isfs",
|
||||
dataIndex: 'isfs',
|
||||
key: 'isfs',
|
||||
title: '是否鱼苗',
|
||||
dataIndexKey: 'isfs',
|
||||
width: 130,
|
||||
customRender: ({ text }: any) => {
|
||||
const isYes = text === 1 || text === "1";
|
||||
return h(Tag, { color: isYes ? "success" : "error", style: { margin: 0 } }, () =>
|
||||
isYes ? "是" : "否"
|
||||
const isYes = text === 1 || text === '1';
|
||||
return h(
|
||||
Tag,
|
||||
{ color: isYes ? 'success' : 'error', style: { margin: 0 } },
|
||||
() => (isYes ? '是' : '否')
|
||||
);
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: "direction",
|
||||
dataIndexKey: "direction",
|
||||
key: "direction",
|
||||
title: "游向",
|
||||
dataIndex: 'direction',
|
||||
dataIndexKey: 'direction',
|
||||
key: 'direction',
|
||||
title: '游向',
|
||||
width: 120,
|
||||
customRender: ({ text }: any) =>
|
||||
props.direction.find((item: any) => item.itemCode === text)?.dictName || "-",
|
||||
props.direction.find((item: any) => item.itemCode === text)?.dictName ||
|
||||
'-'
|
||||
},
|
||||
{
|
||||
dataIndex: "fcnt",
|
||||
key: "fcnt",
|
||||
dataIndexKey: "fcnt",
|
||||
title: "过鱼数量(尾)",
|
||||
width: 120,
|
||||
dataIndex: 'fcnt',
|
||||
key: 'fcnt',
|
||||
dataIndexKey: 'fcnt',
|
||||
title: '过鱼数量(尾)',
|
||||
width: 120
|
||||
},
|
||||
{ dataIndex: "fsz", key: "fsz", title: "体长(cm)", width: 160 },
|
||||
{ dataIndex: "fwet", key: "fwet", title: "平均体重(g)", width: 160 },
|
||||
{ dataIndex: "wt", key: "wt", title: "水温(℃)", width: 80 },
|
||||
{ dataIndex: "picpth", key: "picpth", title: "图片", width: 160 },
|
||||
{ dataIndex: "vdpth", key: "vdpth", title: "视频", width: 160 },
|
||||
{ dataIndex: 'fsz', key: 'fsz', title: '体长(cm)', width: 160 },
|
||||
{ dataIndex: 'fwet', key: 'fwet', title: '平均体重(g)', width: 160 },
|
||||
{ dataIndex: 'wt', key: 'wt', title: '水温(℃)', width: 80 },
|
||||
{ dataIndex: 'picpth', key: 'picpth', title: '图片', width: 160 },
|
||||
{ dataIndex: 'vdpth', key: 'vdpth', title: '视频', width: 160 },
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
dataIndex: "action",
|
||||
fixed: "right",
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
align: "center",
|
||||
},
|
||||
align: 'center'
|
||||
}
|
||||
]);
|
||||
|
||||
// --- 初始化 ---
|
||||
@ -419,11 +443,11 @@ const loadHbrvcdOptions = async () => {
|
||||
const res = await getSelectForDropdown({});
|
||||
let list = res.data || [];
|
||||
if (list && list.length > 0) {
|
||||
list = list.filter((item: any) => item.rvcd !== "all");
|
||||
list = list.filter((item: any) => item.rvcd !== 'all');
|
||||
}
|
||||
hbrvcdOptions.value = list;
|
||||
} catch (e) {
|
||||
console.error("Load rvcd options failed", e);
|
||||
console.error('Load rvcd options failed', e);
|
||||
}
|
||||
};
|
||||
|
||||
@ -435,7 +459,7 @@ const ensureRowState = (index: number) => {
|
||||
baseLoading: false,
|
||||
hbrvcdLoading: false,
|
||||
engLoading: false,
|
||||
fpssLoading: false,
|
||||
fpssLoading: false
|
||||
};
|
||||
}
|
||||
return rowStates[index];
|
||||
@ -474,19 +498,19 @@ const ensureRowState = (index: number) => {
|
||||
const handleHbrvcdChange = async (
|
||||
rvcd: string,
|
||||
index: number,
|
||||
type = "start"
|
||||
type = 'start'
|
||||
) => {
|
||||
const state = ensureRowState(index);
|
||||
editingData.value.rvnm = hbrvcdOptions.value.find(
|
||||
(item: any) => item.rvcd == rvcd
|
||||
)?.rvnm;
|
||||
delWarning(rvcd, "rvcd");
|
||||
delWarning(rvcd, 'rvcd');
|
||||
if (rvcd == null) {
|
||||
delWarning(null, "rvcd");
|
||||
delWarning(null, "stcd");
|
||||
delWarning(null, 'rvcd');
|
||||
delWarning(null, 'stcd');
|
||||
}
|
||||
// 清空后续字段
|
||||
if (type != "start") {
|
||||
if (type != 'start') {
|
||||
editingData.value.rstcd = undefined;
|
||||
editingData.value.stcd = undefined;
|
||||
editingData.value.ennm = undefined;
|
||||
@ -499,23 +523,27 @@ const handleHbrvcdChange = async (
|
||||
const res = await getEngInfoDropdown({ rvcd });
|
||||
state.engOptions = res.data || [];
|
||||
} catch (e) {
|
||||
message.error("获取电站列表失败");
|
||||
message.error('获取电站列表失败');
|
||||
} finally {
|
||||
state.engLoading = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleEngChange = async (rstcd: string, index: number, type = "start") => {
|
||||
const handleEngChange = async (
|
||||
rstcd: string,
|
||||
index: number,
|
||||
type = 'start'
|
||||
) => {
|
||||
const state = ensureRowState(index);
|
||||
editingData.value.ennm = state.engOptions.find(
|
||||
(item: any) => item.stcd === rstcd
|
||||
)?.ennm;
|
||||
delWarning(rstcd, "rstcd");
|
||||
delWarning(rstcd, 'rstcd');
|
||||
if (rstcd == null) {
|
||||
delWarning(null, "stcd");
|
||||
delWarning(null, 'stcd');
|
||||
}
|
||||
// 清空后续字段
|
||||
if (type != "start") {
|
||||
if (type != 'start') {
|
||||
editingData.value.stcd = undefined;
|
||||
editingData.value.stnm = undefined;
|
||||
state.fpssOptions = [];
|
||||
@ -525,14 +553,14 @@ const handleEngChange = async (rstcd: string, index: number, type = "start") =>
|
||||
const res = await getFpssDropdown({ rstcd, rvcd: editingData.value.rvcd });
|
||||
state.fpssOptions = res.data || [];
|
||||
} catch (e) {
|
||||
message.error("获取设施列表失败");
|
||||
message.error('获取设施列表失败');
|
||||
} finally {
|
||||
state.fpssLoading = false;
|
||||
}
|
||||
};
|
||||
const handleFpssChange = (stcd: string, index: number) => {
|
||||
const state = ensureRowState(index);
|
||||
delWarning(stcd, "stcd");
|
||||
delWarning(stcd, 'stcd');
|
||||
editingData.value.stnm = state.fpssOptions.find(
|
||||
(item: any) => item.stcd === stcd
|
||||
)?.stnm;
|
||||
@ -548,7 +576,7 @@ const delWarning = (val: any, key: string) => {
|
||||
const warnings = editingData.value.warnings;
|
||||
const hasWarning = warnings.includes(key);
|
||||
|
||||
if (val !== null && val !== undefined && val !== "") {
|
||||
if (val !== null && val !== undefined && val !== '') {
|
||||
// 1. 如果有值,且存在警告,则移除警告
|
||||
if (hasWarning) {
|
||||
editingData.value.warnings = warnings.filter((w: string) => w !== key);
|
||||
@ -573,35 +601,38 @@ const startEdit = (index: number) => {
|
||||
processStringToMinMax(editingData.value);
|
||||
|
||||
editingRowIndex.value = index;
|
||||
if (editingData.value.warnings.includes("rvcd")) {
|
||||
if (editingData.value.warnings.includes('rvcd')) {
|
||||
editingData.value.rvcd = null;
|
||||
editingData.value.rvnm = null;
|
||||
editingData.value.rstcd = null;
|
||||
editingData.value.stcd = null;
|
||||
delWarning(null, "rstcd");
|
||||
delWarning(null, "stcd");
|
||||
delWarning(null, 'rstcd');
|
||||
delWarning(null, 'stcd');
|
||||
}
|
||||
if (editingData.value.warnings.includes("rstcd")) {
|
||||
if (editingData.value.warnings.includes('rstcd')) {
|
||||
editingData.value.stcd = null;
|
||||
delWarning(null, "stcd");
|
||||
delWarning(null, 'stcd');
|
||||
}
|
||||
if (editingData.value.warnings.includes("strdt")) {
|
||||
if (editingData.value.warnings.includes('strdt')) {
|
||||
editingData.value.strdt = null;
|
||||
delWarning(null, "strdt");
|
||||
delWarning(null, 'strdt');
|
||||
}
|
||||
|
||||
// 3. 预加载下拉选项 (基于 editingData 的值)
|
||||
if (editingData.value.rvcd == "" || editingData.value.rvcd == undefined) {
|
||||
if (editingData.value.rvcd == '' || editingData.value.rvcd == undefined) {
|
||||
if (editingData.value.rstcd) {
|
||||
handleHbrvcdChange("", index, "start").then(() => {
|
||||
handleEngChange(editingData.value.rstcd, index, "start");
|
||||
handleHbrvcdChange('', index, 'start').then(() => {
|
||||
handleEngChange(editingData.value.rstcd, index, 'start');
|
||||
});
|
||||
} else {
|
||||
handleEngChange("", index, "start");
|
||||
handleEngChange('', index, 'start');
|
||||
}
|
||||
} else if (editingData.value.rvcd != "" && editingData.value.rvcd != undefined) {
|
||||
handleHbrvcdChange(editingData.value.rvcd, index, "start").then(() => {
|
||||
handleEngChange(editingData.value.rstcd, index, "start");
|
||||
} else if (
|
||||
editingData.value.rvcd != '' &&
|
||||
editingData.value.rvcd != undefined
|
||||
) {
|
||||
handleHbrvcdChange(editingData.value.rvcd, index, 'start').then(() => {
|
||||
handleEngChange(editingData.value.rstcd, index, 'start');
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -609,45 +640,45 @@ const startEdit = (index: number) => {
|
||||
// 辅助:字符串转 Min/Max
|
||||
const processStringToMinMax = (data: any) => {
|
||||
if (data.fsz) {
|
||||
const sizes = String(data.fsz).split("~");
|
||||
data.bodyLengthMin = sizes[0] || "";
|
||||
data.bodyLengthMax = sizes[1] || sizes[0] || "";
|
||||
const sizes = String(data.fsz).split('~');
|
||||
data.bodyLengthMin = sizes[0] || '';
|
||||
data.bodyLengthMax = sizes[1] || sizes[0] || '';
|
||||
} else {
|
||||
data.bodyLengthMin = "";
|
||||
data.bodyLengthMax = "";
|
||||
data.bodyLengthMin = '';
|
||||
data.bodyLengthMax = '';
|
||||
}
|
||||
if (data.fwet) {
|
||||
const weights = String(data.fwet).split("~");
|
||||
data.weightMin = weights[0] || "";
|
||||
data.weightMax = weights[1] || weights[0] || "";
|
||||
const weights = String(data.fwet).split('~');
|
||||
data.weightMin = weights[0] || '';
|
||||
data.weightMax = weights[1] || weights[0] || '';
|
||||
} else {
|
||||
data.weightMin = "";
|
||||
data.weightMax = "";
|
||||
data.weightMin = '';
|
||||
data.weightMax = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 辅助:Min/Max 转字符串
|
||||
const processMinMaxToString = (data: any) => {
|
||||
// 处理体长
|
||||
if (data.bodyLengthMin !== "" || data.bodyLengthMax !== "") {
|
||||
if (data.bodyLengthMin !== '' || data.bodyLengthMax !== '') {
|
||||
if (data.bodyLengthMin == data.bodyLengthMax) {
|
||||
data.fsz = data.bodyLengthMin;
|
||||
} else {
|
||||
data.fsz = `${data.bodyLengthMin}~${data.bodyLengthMax}`;
|
||||
}
|
||||
} else {
|
||||
data.fsz = "";
|
||||
data.fsz = '';
|
||||
}
|
||||
|
||||
// 处理体重
|
||||
if (data.weightMin !== "" || data.weightMax !== "") {
|
||||
if (data.weightMin !== '' || data.weightMax !== '') {
|
||||
if (data.weightMin == data.weightMax) {
|
||||
data.fwet = data.weightMin;
|
||||
} else {
|
||||
data.fwet = `${data.weightMin}~${data.weightMax}`;
|
||||
}
|
||||
} else {
|
||||
data.fwet = "";
|
||||
data.fwet = '';
|
||||
}
|
||||
|
||||
// 清理临时字段,避免污染原数据
|
||||
@ -661,26 +692,34 @@ const saveEdit = async (index: number) => {
|
||||
// 1. 后处理:将 Min/Max 合并回 fsz/fwet
|
||||
processMinMaxToString(editingData.value);
|
||||
|
||||
// 2. 创建新数组,替换对应索引的数据
|
||||
// 2. 验证 strdtStr 不能为空
|
||||
if (!editingData.value.strdtStr) {
|
||||
message.error('过鱼时间不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. 创建新数组,替换对应索引的数据
|
||||
const newData = [...props.fileTableData];
|
||||
newData[index] = { ...editingData.value };
|
||||
newData[index].strdt = newData[index].strdtStr + " 00:00:00";
|
||||
emit("update:fileLoading", true);
|
||||
newData[index].strdt = newData[index].strdtStr
|
||||
? newData[index].strdtStr + ' 00:00:00'
|
||||
: newData[index].strdtStr;
|
||||
emit('update:fileLoading', true);
|
||||
try {
|
||||
const res: any = await revalidateAndUpdateRow({
|
||||
taskId: props.taskId,
|
||||
data: newData[index],
|
||||
data: newData[index]
|
||||
});
|
||||
if (res && res?.code == 0) {
|
||||
message.success("保存成功");
|
||||
message.success('保存成功');
|
||||
props.getFileList();
|
||||
editingRowIndex.value = null;
|
||||
editingData.value = null;
|
||||
}
|
||||
} catch (e) {
|
||||
message.error("保存失败");
|
||||
message.error('保存失败');
|
||||
} finally {
|
||||
emit("update:fileLoading", false);
|
||||
emit('update:fileLoading', false);
|
||||
}
|
||||
};
|
||||
|
||||
@ -692,29 +731,29 @@ const cancelEdit = () => {
|
||||
// 删除按钮点击事件
|
||||
const handlePreviewDelete = async (index: number) => {
|
||||
const newData = [...props.fileTableData];
|
||||
emit("update:fileLoading", true);
|
||||
emit('update:fileLoading', true);
|
||||
try {
|
||||
const res: any = await deleteRowById({
|
||||
taskId: props.taskId,
|
||||
data: newData[index],
|
||||
data: newData[index]
|
||||
});
|
||||
if (res && res?.code == 0) {
|
||||
message.success("删除成功");
|
||||
message.success('删除成功');
|
||||
|
||||
props.getFileList();
|
||||
editingRowIndex.value = null;
|
||||
editingData.value = null;
|
||||
}
|
||||
} catch (e) {
|
||||
message.error("删除失败");
|
||||
message.error('删除失败');
|
||||
} finally {
|
||||
emit("update:fileLoading", false);
|
||||
emit('update:fileLoading', false);
|
||||
}
|
||||
};
|
||||
// 鱼种类编辑 修改名称
|
||||
const handleFtpChange = (val: any, opt: any) => {
|
||||
editingData.value.ftpName = opt.name;
|
||||
delWarning(val, "ftp");
|
||||
delWarning(val, 'ftp');
|
||||
};
|
||||
|
||||
// --- 辅助函数 ---
|
||||
@ -723,7 +762,7 @@ const filterOption = (input: string, option: any) => {
|
||||
};
|
||||
defineExpose({
|
||||
editingRowIndex,
|
||||
editingData,
|
||||
editingData
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -37,7 +37,7 @@ const localTypeDate = ref<string>(null);
|
||||
const basicSearchRef = ref<any>();
|
||||
|
||||
const initSearchData = {
|
||||
rvcd: "rvcd",
|
||||
rvcd: "all",
|
||||
stcd: null,
|
||||
rstcd: null,
|
||||
strdt: [
|
||||
|
||||
@ -19,10 +19,7 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- 使用 bodyCell 插槽自定义单元格渲染 -->
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template
|
||||
v-if="column.key === 'action' || column.dataIndex === 'action'"
|
||||
>
|
||||
<template #action="{ column, record }">
|
||||
<div class="flex">
|
||||
<a-button type="link" size="small" @click="handleShowDetail(record)"
|
||||
>详情</a-button
|
||||
@ -36,13 +33,6 @@
|
||||
<!-- <a-button type="link" size="small" @click="handleShowChangeLog(record)">变更详情</a-button> -->
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'bizType'">
|
||||
{{ handName(record.bizType, yeWuType) }}
|
||||
</template>
|
||||
<!-- <template v-if="column.dataIndex === 'status'">
|
||||
{{ handName(record.status, shenStatus) }}
|
||||
</template> -->
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
<!-- 审批操作日志弹框 -->
|
||||
@ -65,11 +55,9 @@
|
||||
:list-url="getApprovalLogList"
|
||||
:scroll-y="500"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<template #action="{ column, record }">
|
||||
{{ handName(record.action, actionTypeDict) }}
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</a-modal>
|
||||
@ -94,19 +82,17 @@
|
||||
:list-url="getApprovalChangeLogList"
|
||||
:scroll-y="500"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'operationType'">
|
||||
<template #operationType="{ column, record }">
|
||||
{{ handName(record.operationType, operationTypeDict) }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'bizType'">
|
||||
<template #bizType="{ column, record }">
|
||||
{{ handName(record.bizType, yeWuType) }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'changeJson'">
|
||||
<template #changeJson="{ column, record }">
|
||||
<pre style="max-height: 200px; overflow: auto; margin: 0">{{
|
||||
record.changeJson
|
||||
}}</pre>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</a-modal>
|
||||
@ -136,8 +122,7 @@
|
||||
:scroll-y="'500px'"
|
||||
:transform-data="customTransform"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'isfs'">
|
||||
<template #isfs="{ column, record }">
|
||||
<a-tag
|
||||
:color="
|
||||
record.isfs === 1 || record.isfs === '1' ? 'success' : 'error'
|
||||
@ -146,17 +131,14 @@
|
||||
{{ record.isfs === 1 || record.isfs === '1' ? '是' : '否' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'direction'">
|
||||
<template #direction="{ column, record }">
|
||||
{{ handName(record.direction, direction) }}
|
||||
</template>
|
||||
<template
|
||||
v-if="column.key === 'action' || column.dataIndex === 'action'"
|
||||
>
|
||||
<template #action="{ column, record }">
|
||||
<a-button type="link" size="small" @click="handleView(record)"
|
||||
>查看</a-button
|
||||
>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</a-modal>
|
||||
@ -365,7 +347,8 @@ let columns = ref([
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
fixed: 'right'
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'action' }
|
||||
}
|
||||
]);
|
||||
const tableRef = ref();
|
||||
@ -378,11 +361,11 @@ const handleSearchFinish = (values: any) => {
|
||||
dataType: 'string',
|
||||
value: values.status
|
||||
},
|
||||
values.rvcd !== "all" && {
|
||||
field: "rvcd",
|
||||
operator: "eq",
|
||||
dataType: "string",
|
||||
value: values.rvcd,
|
||||
values.rvcd !== 'all' && {
|
||||
field: 'rvcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: values.rvcd
|
||||
},
|
||||
values.stcd && {
|
||||
field: 'stcd',
|
||||
@ -412,7 +395,8 @@ const approvalLogColumns = ref([
|
||||
dataIndex: 'action',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
{
|
||||
title: '操作人',
|
||||
@ -451,14 +435,16 @@ const changeLogColumns = ref([
|
||||
dataIndex: 'bizType',
|
||||
key: 'bizType',
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
slots: { customRender: 'bizType' }
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
dataIndex: 'operationType',
|
||||
key: 'operationType',
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
slots: { customRender: 'operationType' }
|
||||
},
|
||||
{
|
||||
title: '操作人',
|
||||
@ -541,13 +527,15 @@ const detailColumns = ref([
|
||||
dataIndex: 'isfs',
|
||||
key: 'isfs',
|
||||
title: '是否鱼苗',
|
||||
width: 74
|
||||
width: 74,
|
||||
slots: { customRender: 'isfs' }
|
||||
},
|
||||
{
|
||||
dataIndex: 'direction',
|
||||
key: 'direction',
|
||||
title: '游向',
|
||||
width: 80
|
||||
width: 80,
|
||||
slots: { customRender: 'direction' }
|
||||
},
|
||||
{ dataIndex: 'fcnt', key: 'fcnt', title: '过鱼数量(尾)', width: 120 },
|
||||
{ dataIndex: 'fsz', key: 'fsz', title: '体长(cm)', width: 110 },
|
||||
@ -560,7 +548,8 @@ const detailColumns = ref([
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
slots: { customRender: 'action' }
|
||||
}
|
||||
]);
|
||||
|
||||
@ -616,11 +605,11 @@ const handleDetailSearchFinish = (values: any) => {
|
||||
dataType: 'string',
|
||||
value: values.rstcd
|
||||
},
|
||||
values.rvcd !== "all" && {
|
||||
field: "rvcd",
|
||||
operator: "eq",
|
||||
dataType: "string",
|
||||
value: values.rvcd,
|
||||
values.rvcd !== 'all' && {
|
||||
field: 'rvcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: values.rvcd
|
||||
},
|
||||
approvalId.value && {
|
||||
field: 'approvalId', // 字段名
|
||||
|
||||
Loading…
Reference in New Issue
Block a user