提交 8c06a77a authored 作者: 龙菲's avatar 龙菲

feat:新增树形字典

上级 74a0f59d
......@@ -12,7 +12,11 @@ export function getDictCode(data) {
})
}
// 获取树结构的字典 culturalRelicYears culturalRelicTexture
/**
* 获取树结构的字典
* @param {*} data 查询参数 data ['culturalRelicYears','culturalRelicTexture']
*
*/
export function getDictTree(data) {
return request({
url: '/sysDictTree/listByType',
......
const state = {
dicts: {},
};
const mutations = {
SET_DICTS(state, obj) {
state.dicts[obj.label] = obj.value;
},
};
export default {
namespaced: true,
state,
mutations,
};
\ No newline at end of file
dicts: {},
};
const mutations = {
SET_DICTS(state, obj) {
state.dicts[obj.label] = obj.value;
},
};
const actions = {
// user login
getDictTree({
commit
}, data) {
let dicts = []
data.forEach(i => {
if (state.dicts[i]) {
dicts.push(dicts)
}
});
if (dicts.length > 0) {
return dicts
} else {
return new Promise((resolve, reject) => {
getDictTree(data).then(response => {
const {
data
} = response
commit('SET_TOKEN', data.accessToken)
commit('SET_NAME', data.username)
commit('SET_USERINFO', data)
setToken(data.accessToken)
setUserInfo(data)
resolve()
}).catch(error => {
reject(error)
})
})
}
}
}
export default {
namespaced: true,
state,
actions,
mutations,
};
......@@ -464,7 +464,6 @@ export default {
successFilesObj[key].map((sf) => {
filesObj[key].push(sf.fileId);
});
// filesObj[key].push(successFilesObj[key].fileId);
} else {
let ids = [];
successFilesObj[key].map((sf) => {
......@@ -473,8 +472,6 @@ export default {
filesObj[key] = ids;
}
}
console.log("successFilesObj", successFilesObj);
console.log("filesObj", filesObj);
// return;
// 2、回填布展自带的媒体文件
mediaArr.forEach((media) => {
......@@ -494,10 +491,8 @@ export default {
if (res.code == 0) {
this.$message.success("提交成功!");
this.loading = false;
this.literatureValues = [];
this.$emit("handleClose");
this.$emit("refresh");
this.dialogForm = {};
}
} else {
const params = { ...this.dialogForm };
......@@ -507,10 +502,8 @@ export default {
if (res.code == 0) {
this.$message.success("修改成功!");
this.loading = false;
this.literatureValues = [];
this.$emit("handleClose");
this.$emit("refresh");
this.dialogForm = {};
}
// const {
// exhibitionId,
......@@ -545,7 +538,7 @@ export default {
// this.$message.success("提交成功!");
// this.loading = false;
// this.$emit("refresh");
// this.reload();
// this.reset();
// }
}
......@@ -557,9 +550,21 @@ export default {
.then((_) => {
done();
this.$emit("handleClose");
this.reset()
})
.catch((_) => {});
},
// 清空编辑组件中的所有值
reset() {
//父组件将清空form绑定的值
// 清空文献
this.literatureValues = [];
this.images = [];
this.videos = [];
this.audios = [];
this.faceImage = [];
},
refresh() {
this.$emit("refresh");
......
......@@ -397,9 +397,7 @@ export default {
cancelForm() {
this.reload();
},
// handleShowUnit() {
// this.showUnit = true;
// },
async handleSubmit() {
var that = this;
let formData = new FormData();
......@@ -425,7 +423,6 @@ export default {
// 只有待上传的才需要添加至formdata
});
});
// console.log('successFilesObj',successFilesObj);
let unitIds = [];
let unitData = [...this.$refs["exhibitionUnits"].getUnitData()];
......
......@@ -39,8 +39,8 @@ module.exports = {
},
proxy: {
'/api': {
target: 'http://172.24.100.189:8080',
// target:'http://222.85.214.245:9066/api',
// target: 'http://172.24.100.189:8080',
target:'http://222.85.214.245:9066/api',
changeOrigin: true,
pathRewrite: {
'^/api': ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论