提交 490896a1 authored 作者: 龙菲's avatar 龙菲

feat:新增树形字典

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