项目初始化
This commit is contained in:
@@ -8,11 +8,10 @@ import java.io.Serializable;
|
||||
public class ChartConfig implements Serializable {
|
||||
|
||||
private Integer sort;
|
||||
private Integer oldSort;
|
||||
private String chartId;
|
||||
private String oldChartId;
|
||||
private String chartName;
|
||||
|
||||
private String chartCode;
|
||||
private Integer oldSort;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class MyChartInfo extends DataEntity<MyChartInfo> implements Serializable
|
||||
private String chartId; // 唯一标识
|
||||
private String chartName; // 图表名称
|
||||
private String chartCode; // 图表编号
|
||||
private Long sort; // 序号
|
||||
private Integer sort; // 序号
|
||||
private String vueName; // 组件名称
|
||||
private String grid; // 间距
|
||||
private String ustatus; // 状态
|
||||
|
||||
@@ -10,10 +10,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
@@ -163,7 +160,14 @@ public class MyChartInfoController extends BaseController {
|
||||
@ResponseBody
|
||||
public String setting(List<ChartConfig> configs) {
|
||||
for (ChartConfig config : configs) {
|
||||
System.out.println(config);
|
||||
MyChartInfo oldChartInfo = myChartInfoService.get(config.getOldChartId());
|
||||
oldChartInfo.setSort(-1);
|
||||
myChartInfoService.save(oldChartInfo);
|
||||
}
|
||||
for (ChartConfig config : configs) {
|
||||
MyChartInfo newChartInfo = myChartInfoService.get(config.getChartId());
|
||||
newChartInfo.setSort(config.getSort());
|
||||
myChartInfoService.save(newChartInfo);
|
||||
}
|
||||
return renderResult(Global.TRUE, text("配置图表成功!"));
|
||||
}
|
||||
|
||||
@@ -28,6 +28,18 @@ export interface MyChartInfo extends BasicModel<MyChartInfo> {
|
||||
updateTime?: string; // 更新时间
|
||||
}
|
||||
|
||||
export interface ChartConfig extends BasicModel<ChartConfig> {
|
||||
chartId: string; // 唯一标识
|
||||
oldChartId: string; // 唯一标识
|
||||
chartName?: string; // 图表名称
|
||||
chartCode?: string; // 图表编号
|
||||
sort?: number; // 新序号
|
||||
oldSort?: number; // 旧序号
|
||||
color?: string; // 颜色
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const myChartInfoList = (params?: MyChartInfo | any) =>
|
||||
defHttp.get<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/list', params });
|
||||
|
||||
@@ -43,8 +55,8 @@ export const myChartInfoForm = (params?: MyChartInfo | any) =>
|
||||
export const myChartInfoSave = (params?: any, data?: MyChartInfo | any) =>
|
||||
defHttp.postJson<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/save', params, data });
|
||||
|
||||
export const myChartSetting = (params?: any, data?: MyChartInfo | any) =>
|
||||
defHttp.postJson<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/setting', params, data });
|
||||
export const myChartSetting = (params?: ChartConfig[] | any) =>
|
||||
defHttp.postJson<MyChartInfo>({ url: adminPath + '/biz/myChartInfo/setting', params });
|
||||
|
||||
export const myChartInfoImportData = (
|
||||
params: UploadFileParams,
|
||||
|
||||
@@ -337,9 +337,8 @@
|
||||
.filter((item) => item.chartId);
|
||||
|
||||
try {
|
||||
console.log(saveData);
|
||||
// const res = await myChartSetting(saveData);
|
||||
// ElMessage.success(res?.msg);
|
||||
const res = await myChartSetting(saveData);
|
||||
ElMessage.success(res?.message);
|
||||
return saveData;
|
||||
} catch (error) {
|
||||
console.error('保存失败:', error);
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
|
||||
try {
|
||||
const res = await myChartSetting(saveData);
|
||||
ElMessage.success(res?.msg);
|
||||
ElMessage.success(res?.message);
|
||||
return saveData;
|
||||
} catch (error) {
|
||||
console.error('保存失败:', error);
|
||||
|
||||
@@ -328,7 +328,7 @@
|
||||
|
||||
try {
|
||||
const res = await myChartSetting(saveData);
|
||||
ElMessage.success(res?.msg);
|
||||
ElMessage.success(res?.message);
|
||||
return saveData;
|
||||
} catch (error) {
|
||||
console.error('保存失败:', error);
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
|
||||
try {
|
||||
const res = await myChartSetting(saveData);
|
||||
ElMessage.success(res?.msg);
|
||||
ElMessage.success(res?.message);
|
||||
return saveData;
|
||||
} catch (error) {
|
||||
console.error('保存失败:', error);
|
||||
|
||||
Reference in New Issue
Block a user