提交 e7576b28 编写于 作者: llz's avatar llz

avue-data 点亮

上级 ced30554
......@@ -68,9 +68,12 @@ export const getObj = (id) => {
url: url + `/bladevisuals/${id}`,
method: 'get'
}).then((response) => {
let data = {};
let config = response.data.config;
delete response.data.config;
let config = {
component: response.data.component,
detail: response.data.detail
};
delete response.data.component;
delete response.data.detail;
let visual = response.data;
resolve({ data: {data: { visual: visual, config: config } } });
}).catch((response) => {
......@@ -87,6 +90,9 @@ export const uploadImg = (file) => request({
export const addObj = (data) => {
return new Promise((resolve, reject) => {
if(!data.status){
data.status = 1;
}
request({
url: url + '/bladevisuals/save',
method: 'post',
......@@ -95,23 +101,28 @@ export const addObj = (data) => {
category: data.category,
status: data.status,
title: data.title,
config: {
detail: JSON.stringify({
name: data.title,
width: data.width,
height: data.height,
scale: 1,
backgroundImage: '/img/bg/bg1.png',
url: '',
mark: {},
gradeShow: false,
gradeLen: 30,
detail: JSON.stringify({
name: data.title,
width: data.width,
height: data.height,
scale: 1,
backgroundImage: '/img/bg/bg1.png',
url: '',
mark: {},
gradeShow: false,
gradeLen: 30,
}),
component: '[]'
}
}
}).then((response) => {
resolve(response);
let res = {};
if(response){
res.code = 200;
res.msg = "操作成功!";
res.success = response;
res.data = {id: data.id};
}
resolve({data: res});
}).catch((response) => {
reject(response);
});
......
......@@ -25,7 +25,9 @@ axios.interceptors.request.use((config) => {
}
if (window.localStorage.getItem('token')) {
const token = window.localStorage.getItem('token');
config.headers['Authorization'] = `Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJpYnphZG1pbiIsImV4cCI6MTYwNTY5NzQwOSwiaWF0IjoxNjA1NjkwMjA5fQ.axiduiQHZ9OTPkz7YM1XbCDCMBHwh8wxQ7PhcEBBtmK1dd8uSUrJ3n_lGpbxNnZfT7GyGnH3gkzrZSdWNUZStVduxAKEiqb6HoVQM5nqDwjvrvEUpuqSBRxMVrA-jnyH9hk1sSQo5CjY8SV7cju-bhyAdUMUvZAkBDcJjNwUmWM`;
config.headers['Authorization'] = `Bearer ${token}`;
}else{
config.headers['Authorization'] = 'Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJpYnphZG1pbiIsImV4cCI6MTYwNTc1NzM1OCwiaWF0IjoxNjA1NzUwMTU4fQ.o3wK61IYekbSAcZ37pdbpaHU2vLLybHySG0M0cGuktkHlA3ozgDmFOYtlBVQ-D14MWm9qWZNvaXNs3R4x3v0JkgBpTwa_ksocGaOZkc7IXvyDUW6qvObDL0BXq6QR47MinxMLuS1KyJiO2FuzXGC7GUERmTdLJKR6fDwWaps-Q0';
}
return config;
}, (error) => {
......
......@@ -109,6 +109,7 @@ export default {
background: 'rgba(0, 0, 0, 0.7)'
});
getObj(id).then(res => {
console.log(JSON.stringify(res));
const callback = () => {
//赋值属性
this.contain.config = JSON.parse(config.detail) || {};
......
......@@ -2,7 +2,6 @@ import Router from 'vue-router';
import Vue from 'vue';
Vue.use(Router)
const vueRouter = new Router({
mode: 'history',
routes: [{
path: '/',
name: '列表页',
......
module.exports = {
lintOnSave: false,
publicPath: './',
lintOnSave: false,
// 去除 map 文件 1
productionSourceMap: false,
outputDir:"../ibzlite-app/ibzlite-app-web/target/classes/META-INF/resources/avuedata/",
......
package cn.ibizlab.core.avuedata.extensions;
import cn.ibizlab.core.avuedata.domain.BladeVisual;
import cn.ibizlab.core.avuedata.domain.BladeVisualConfig;
import cn.ibizlab.core.avuedata.service.IBladeVisualConfigService;
import cn.ibizlab.core.avuedata.service.impl.BladeVisualServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
@Service
@Primary
public class BladeVisualServiceImplImpl extends BladeVisualServiceImpl {
@Autowired
IBladeVisualConfigService iBladeVisualConfigService;
@Override
public boolean saveOrUpdate(BladeVisual et) {
if (null == et) {
return false;
} else {
BladeVisualConfig bladeVisualConfig = new BladeVisualConfig();
bladeVisualConfig.setComponent(et.getComponent());
bladeVisualConfig.setDetail(et.getDetail());
return (iBladeVisualConfigService.save(bladeVisualConfig) && checkKey(et) ? this.update(et) : this.create(et));
}
}
@Override
public BladeVisual get(Long key) {
BladeVisual et = getById(key);
if(et == null){
et = new BladeVisual();
et.setId(key);
}
else {
BladeVisualConfig bladeVisualConfig =iBladeVisualConfigService.get(key);
et.setComponent(bladeVisualConfig.getComponent());
et.setDetail(bladeVisualConfig.getDetail());
}
return et;
}
}
......@@ -27,7 +27,7 @@ import lombok.Data;
@Data
public class BladeVisualCategoryDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
......@@ -42,8 +42,8 @@ public class BladeVisualCategoryDTO extends DTOBase implements Serializable {
* 属性 [CATEGORY_KEY]
*
*/
@JSONField(name = "categorykey")
@JsonProperty("categorykey")
@JSONField(name = "categoryKey")
@JsonProperty("categoryKey")
@Size(min = 0, max = 12, message = "内容长度必须小于等于[12]")
private String categorykey;
......@@ -51,8 +51,8 @@ public class BladeVisualCategoryDTO extends DTOBase implements Serializable {
* 属性 [CATEGORY_VALUE]
*
*/
@JSONField(name = "categoryvalue")
@JsonProperty("categoryvalue")
@JSONField(name = "categoryValue")
@JsonProperty("categoryValue")
@Size(min = 0, max = 64, message = "内容长度必须小于等于[64]")
private String categoryvalue;
......@@ -60,8 +60,8 @@ public class BladeVisualCategoryDTO extends DTOBase implements Serializable {
* 属性 [IS_DELETED]
*
*/
@JSONField(name = "isdeleted")
@JsonProperty("isdeleted")
@JSONField(name = "isDeleted")
@JsonProperty("isDeleted")
private Integer isdeleted;
......
......@@ -27,7 +27,7 @@ import lombok.Data;
@Data
public class BladeVisualConfigDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 属性 [ID]
......@@ -42,8 +42,8 @@ public class BladeVisualConfigDTO extends DTOBase implements Serializable {
* 属性 [VISUAL_ID]
*
*/
@JSONField(name = "visualid")
@JsonProperty("visualid")
@JSONField(name = "visualId")
@JsonProperty("visualId")
@JsonSerialize(using = ToStringSerializer.class)
private Long visualid;
......
......@@ -68,8 +68,8 @@ public class BladeVisualDTO extends DTOBase implements Serializable {
* 属性 [BACKGROUND_URL]
*
*/
@JSONField(name = "backgroundurl")
@JsonProperty("backgroundurl")
@JSONField(name = "backgroundUrl")
@JsonProperty("backgroundUrl")
@Size(min = 0, max = 2000, message = "内容长度必须小于等于[2000]")
private String backgroundurl;
......@@ -86,16 +86,16 @@ public class BladeVisualDTO extends DTOBase implements Serializable {
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createtime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createtime")
@JSONField(name = "createTime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createTime")
private Timestamp createtime;
/**
* 属性 [CREATE_DEPT]
*
*/
@JSONField(name = "createdept")
@JsonProperty("createdept")
@JSONField(name = "createDept")
@JsonProperty("createDept")
@JsonSerialize(using = ToStringSerializer.class)
private Long createdept;
......@@ -103,8 +103,8 @@ public class BladeVisualDTO extends DTOBase implements Serializable {
* 属性 [CREATE_USER]
*
*/
@JSONField(name = "createuser")
@JsonProperty("createuser")
@JSONField(name = "createUser")
@JsonProperty("createUser")
@JsonSerialize(using = ToStringSerializer.class)
private Long createuser;
......@@ -113,16 +113,16 @@ public class BladeVisualDTO extends DTOBase implements Serializable {
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatetime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatetime")
@JSONField(name = "updateTime" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updateTime")
private Timestamp updatetime;
/**
* 属性 [UPDATE_USER]
*
*/
@JSONField(name = "updateuser")
@JsonProperty("updateuser")
@JSONField(name = "updateUser")
@JsonProperty("updateUser")
@JsonSerialize(using = ToStringSerializer.class)
private Long updateuser;
......@@ -130,8 +130,8 @@ public class BladeVisualDTO extends DTOBase implements Serializable {
* 属性 [IS_DELETED]
*
*/
@JSONField(name = "isdeleted")
@JsonProperty("isdeleted")
@JSONField(name = "isDeleted")
@JsonProperty("isDeleted")
private Integer isdeleted;
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册