Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
920cf86c
提交
920cf86c
authored
7月 14, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:修改文物年代选择器
上级
490896a1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
100 行增加
和
57 行删除
+100
-57
dict.js
src/store/modules/dict.js
+33
-20
InfoEditDialog.vue
src/views/culturalRelic/components/InfoEditDialog.vue
+67
-29
InfoEditDialog.vue
src/views/display/components/InfoEditDialog.vue
+0
-8
没有找到文件。
src/store/modules/dict.js
浏览文件 @
920cf86c
import
{
getDictTree
}
from
'@/api/dict'
const
state
=
{
dicts
:
{},
dicts
:
{},
//{ displayTypes: }
};
const
mutations
=
{
...
...
@@ -14,30 +17,40 @@ const actions = {
commit
},
data
)
{
let
dicts
=
[]
let
requestDicts
=
[]
data
.
forEach
(
i
=>
{
if
(
state
.
dicts
[
i
])
{
dicts
.
push
(
dicts
)
// 如果state中不存在的就需要重新获取
if
(
!
state
.
dicts
[
i
])
{
requestDicts
.
push
(
i
)
}
else
{
// 如果存在就直接存入dicts中
let
obj
=
{}
obj
[
i
]
=
state
.
dicts
[
i
]
dicts
.
push
(
obj
)
}
});
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
)
return
new
Promise
((
resolve
,
reject
)
=>
{
getDictTree
(
requestDicts
).
then
(
res
=>
{
console
.
log
(
res
.
data
);
let
dictsObj
=
{}
requestDicts
.
forEach
(
reqDict
=>
{
dictsObj
[
reqDict
]
=
[]
res
.
data
.
map
(
item
=>
{
if
(
item
.
dictType
==
reqDict
)
{
dictsObj
[
reqDict
].
push
(
item
)
}
})
commit
(
"SET_DICTS"
,
{
label
:
reqDict
,
value
:
Object
.
freeze
(
dictsObj
[
reqDict
]),
});
})
resolve
(
dictsObj
)
}).
catch
(
error
=>
{
reject
(
error
)
})
}
});
}
}
...
...
src/views/culturalRelic/components/InfoEditDialog.vue
浏览文件 @
920cf86c
...
...
@@ -76,19 +76,27 @@
></el-input>
</el-form-item>
<el-form-item
label=
"文物年代"
:label-width=
"formLabelWidth"
>
<el-select
<el-cascader
style=
"width: 100%"
v-model=
"dialogForm.years"
:options=
"culturalRelicYears"
:props=
"culturalRelicYearsProps"
placeholder=
"请选择文物年代"
>
</el-cascader>
<!--
<el-select
v-model=
"dialogForm.years"
placeholder=
"请选择文物年代"
style=
"width: 100%"
>
<el-option
v-for=
"(
value
, key) in culturalRelicYears"
v-for=
"(
item
, key) in culturalRelicYears"
:key=
"key"
:label=
"
value
"
:value=
"
key
"
:label=
"
item.label
"
:value=
"
item.value
"
>
</el-option>
<
/el-select
>
</el-option>
-->
<
!--
</el-select>
--
>
</el-form-item>
<el-form-item
label=
"文物数量"
:label-width=
"formLabelWidth"
>
<!--
<el-input
...
...
@@ -204,7 +212,7 @@
:fileLimit=
"6"
:fileSize=
"50"
:fileType=
"['mp4', 'wav']"
listType=
"
picture-card
"
listType=
"
text
"
ref=
"videos"
/>
</el-form-item>
...
...
@@ -233,7 +241,7 @@
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
<el-button
type=
"primary"
@
click=
"handleSubmit"
:loading=
"loading"
>
确定
<i
class=
"el-icon-right"
style=
"margin-left: 5px"
></i
></el-button>
</div>
...
...
@@ -296,11 +304,13 @@ export default {
// debugger
// 回填媒体
if
(
this
.
dialogForm
.
faceImageUrl
)
{
this
.
faceImage
=
[{
name
:
""
,
url
:
this
.
dialogForm
.
faceImageUrl
,
fileId
:
this
.
dialogForm
.
faceImage
,
}];
this
.
faceImage
=
[
{
name
:
""
,
url
:
this
.
dialogForm
.
faceImageUrl
,
fileId
:
this
.
dialogForm
.
faceImage
,
},
];
}
if
(
this
.
dialogForm
.
imagesVo
)
{
this
.
images
=
this
.
dialogForm
.
imagesVo
;
...
...
@@ -338,13 +348,7 @@ export default {
}
},
},
dicts
:
[
// "cultural_relic_texture",
"culturalRelicLevel"
,
// "cultural_relic_years",
"culturalRelicType"
,
"literature"
,
],
dicts
:
[
"culturalRelicLevel"
,
"culturalRelicType"
,
"literature"
],
data
()
{
return
{
dialogForm
:
{
...
...
@@ -366,14 +370,33 @@ export default {
images
:
[],
videos
:
[],
audios
:
[],
culturalRelicTexture
:
{
1
:
"铜"
,
1
:
"织绣"
},
//TODO:等后台字典更新后改回
culturalRelicYears
:
{
1
:
"元(1206~1368)"
},
culturalRelicTexture
:
""
,
culturalRelicYears
:
""
,
culturalRelicYearsProps
:
{
value
:
"value"
,
label
:
"label"
,
children
:
"children"
,
checkStrictly
:
true
,
//单选选择任意一级选项
},
};
},
async
created
()
{
setTimeout
(()
=>
{
console
.
log
(
"22222this.dict"
,
this
.
dict
);
});
// setTimeout(() => {
// console.log("22222this.dict", this.dict);
// });
},
mounted
()
{
this
.
$store
.
dispatch
(
"dict/getDictTree"
,
[
"culturalRelicTexture"
,
"culturalRelicYears"
,
])
.
then
((
res
)
=>
{
// debugger;
// console.log(res);
this
.
culturalRelicTexture
=
res
.
culturalRelicTexture
;
this
.
culturalRelicYears
=
res
.
culturalRelicYears
;
});
},
methods
:
{
// 关联文献查询
...
...
@@ -409,11 +432,12 @@ export default {
// 取消编辑
cancelForm
()
{
this
.
$emit
(
"handleClose"
);
this
.
literatureValues
=
[]
;
this
.
reset
()
;
},
async
handleSubmit
()
{
var
that
=
this
;
let
formData
=
new
FormData
();
this
.
loading
=
true
;
// 已存在的文件的对象
let
successFilesObj
=
[];
// 添加布展本身的媒体文件至formData
...
...
@@ -487,23 +511,38 @@ export default {
const
params
=
{
...
this
.
dialogForm
,
deptId
,
regionCode
};
params
.
literature
=
this
.
literatureValues
.
join
(
","
);
params
.
status
=
this
.
dialogForm
.
status
?
1
:
0
;
// 处理年份
params
.
years
=
params
.
years
[
params
.
years
.
length
-
1
];
// 处理质地TODO:
// params.texture = params.texture[params.texture.length - 1];
let
res
=
await
addCulturalRelic
(
params
);
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"提交成功!"
);
this
.
loading
=
false
;
this
.
$emit
(
"handleClose"
);
this
.
$emit
(
"refresh"
);
this
.
reset
();
}
}
else
{
const
params
=
{
...
this
.
dialogForm
};
params
.
literature
=
this
.
literatureValues
.
join
(
","
);
params
.
status
=
this
.
dialogForm
.
status
?
1
:
0
;
// return;
// 处理年份
if
(
params
.
years
instanceof
Array
)
{
params
.
years
=
params
.
years
[
params
.
years
.
length
-
1
];
}
// 处理质地
// if (params.texture instanceof Array) {
// params.texture = params.texture[params.texture.length - 1];
// }
let
res
=
await
editCulturalRelic
(
params
);
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"修改成功!"
);
this
.
loading
=
false
;
this
.
$emit
(
"handleClose"
);
this
.
$emit
(
"refresh"
);
this
.
reset
();
}
// const {
// exhibitionId,
...
...
@@ -550,12 +589,11 @@ export default {
.
then
((
_
)
=>
{
done
();
this
.
$emit
(
"handleClose"
);
this
.
reset
()
this
.
reset
();
})
.
catch
((
_
)
=>
{});
},
// 清空编辑组件中的所有值
// 清空编辑组件中的所有值
reset
()
{
//父组件将清空form绑定的值
// 清空文献
...
...
src/views/display/components/InfoEditDialog.vue
浏览文件 @
920cf86c
...
...
@@ -749,14 +749,6 @@ export default {
this
.
dialogForm
.
auidos
=
str
;
},
// startLoading() {
// this.loading = true;
// },
// endLoading() {
// this.loading = false;
// },
refresh
()
{
this
.
$emit
(
"refresh"
);
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论