政策法规资料模块

This commit is contained in:
zyn
2023-10-26 13:37:44 +08:00
parent 63a325d8b9
commit 2755663693
8 changed files with 1739 additions and 2 deletions
+28
View File
@@ -635,6 +635,34 @@ export default {
})
},
// formData
_put (url, params = {}, config = {}) {
var _formData = formData(params)
// 参数包含this
let _this = config._this || false
// 参数包含loading
let loading = config.loading || false
// 是否显示操作提示
let showTips = config.showTips === undefined ? true : config.showTips
if (_this && loading) { _this[loading] = true }
return new Promise((resolve,reject) => {
_axios.put(api() + url + '?' + new Date().getTime(), _formData).then(res => {
if (res.data.ok !== undefined && showTips) {
let type = res.data.ok ? 'success' : 'warning'
if (_this && res.data.message !== '' && res.data.message !== null) {
Message[type](res.data.message)
}
}
resolve(res.data)
}).catch(err => {
reject(err)
}).finally(()=>{
if (_this && loading) { _this[loading] = false }
})
})
},
_downloadFile (url, params = {}, method = 'get', fileName = '导出文件') {
_axios({
method,