Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303

This commit is contained in:
tianwenbo
2023-03-16 15:47:35 +08:00
4 changed files with 71 additions and 19 deletions
+24 -1
View File
@@ -1,13 +1,16 @@
<template>
<a-config-provider :locale="locale">
<div id="app">
<router-view/>
<a-spin :spinning="isImporting || isExporting" :tip="tipText" class="port-spin">
<router-view/>
</a-spin>
</div>
</a-config-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device'
import { mapState } from 'vuex'
export default {
data () {
@@ -15,6 +18,21 @@ export default {
locale: zhCN
}
},
computed: {
...mapState({
isImporting: state => state.app.isImporting,
isExporting: state => state.app.isExporting
}),
tipText () {
if (this.isImporting) {
return '正在导入,请稍候...'
}
if (this.isExporting) {
return '正在导出,请稍候...'
}
return ''
}
},
created () {
const that = this
enquireScreen(deviceType => {
@@ -37,4 +55,9 @@ export default {
#app {
height: 100%;
}
.port-spin > div > .ant-spin {
height: 100vh!important;
max-height: unset!important;
}
</style>
@@ -9977,6 +9977,7 @@
btnUrl: "/online/cgform/head/enhanceButton/",
btnList: [],
url: "/online/cgform/head/enhanceJava/",
addUrl: "/online/cgform/head/addEnhanceJava/",
urlByButtonCode: "/online/cgform/head/enhanceJavaByButtonCode/",
model: {
buttonCode: "add",
@@ -9995,7 +9996,7 @@
if (e.confirmLoading = !0, e.model.id) {
var a = Object.assign(e.model, n);
r = Object(o["g"])(e.url + e.code, a)
} else r = Object(o["f"])(e.url + e.code, n);
} else r = Object(o["f"])(e.addUrl + e.code, n);
r.then((function(t) {
e.confirmLoading = !1, t.success ? (e.visible = !1, e.$message.success(t.message)) : e.$message.warning(
t.message)
@@ -10275,7 +10276,8 @@
url: {
loadFormItems: "/online/cgform/api/getErpFormItem/",
loadEnhanceJs: "/online/cgform/api/getEnhanceJs/",
optPre: "/online/cgform/api/form/"
optPre: "/online/cgform/api/form/",
optPreUpdate: "/online/cgform/api/form/update/"
},
schema: {},
uiSchema: {
@@ -10408,8 +10410,8 @@
edit: function(e, t) {
var that = this;
this.titleText = "编辑", this.uiSchema.method = "post", this.uiSchema.formTemplate = e, this.uiSchema.url =
this.url.optPre + this.code, this.uiSchema = c({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
1, Object(o["c"])(this.url.optPre + this.code + "/" + t).then((function(e) {
this.url.optPreUpdate + this.code, this.uiSchema = c({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
1, Object(o["c"])(this.url.optPreUpdate + this.code + "/" + t).then((function(e) {
if (e.success) {
var t = e.result;
that.$refs.onlineForm.edit(t)
@@ -19301,6 +19303,7 @@
}
},
url: "/online/cgform/head/enhanceJs/",
addUrl: "/online/cgform/head/addEnhanceJs/",
model: {},
cgJsType: [],
cgJs: "",
@@ -19324,7 +19327,7 @@
if (this.model.id) {
var r = Object.assign({}, this.model, n);
t = Object(i["g"])(this.url + this.code, r)
} else t = Object(i["f"])(this.url + this.code, n);
} else t = Object(i["f"])(this.addUrl + this.code, n);
t.then((function(t) {
e.confirmLoading = !1, t.success ? (e.addLocalRecord(n), e.visible = !1, e.$message.success(t.message)) :
e.$message.warning(t.message)
@@ -20310,7 +20313,8 @@
url: {
loadFormItems: "/online/cgform/api/getFormItemBytbname/",
loadEnhanceJs: "/online/cgform/api/getEnhanceJs/",
optPre: "/online/cgform/api/form/"
optPre: "/online/cgform/api/form/",
optPreUpdateUrl: "/online/cgform/api/form/update/"
},
schema: {},
uiSchema: {},
@@ -20331,7 +20335,7 @@
var n = {
formTemplate: t.result.head.formTemplate,
method: "post",
url: e.url.optPre + t.result.head.id
url: e.url.optPreUpdateUrl + t.result.head.id
};
e.schema = Object.assign({}, t.result.schema, n);
var r = e.url.optPre + t.result.head.id + "/" + e.dataId;
@@ -26855,6 +26859,7 @@
loading: !1,
dataSource: w,
url: "/online/cgform/api/authData",
editUrl: "/online/cgform/api/editAuthData",
columnList: [],
columns: [{
title: "启用",
@@ -27024,7 +27029,7 @@
},
editAuthData: function(e) {
var t = this;
Object(_["g"])(this.url, e).then((function(e) {
Object(_["g"])(this.editUrl, e).then((function(e) {
e.success ? (t.visible = !1, t.loadAuthData(), t.$message.success(e.message)) : t.$message.warning(e.message)
})).finally((function() {
t.confirmLoading = !1
@@ -27649,6 +27654,7 @@
btnUrl: "/online/cgform/head/enhanceButton/",
btnList: [],
url: "/online/cgform/head/enhanceSql/",
addUrl: "/online/cgform/head/addEnhanceSql/",
model: {},
tableName: ""
}
@@ -27662,7 +27668,7 @@
if (e.confirmLoading = !0, e.model.id) {
var a = Object.assign(e.model, n);
r = Object(i["g"])(e.url + e.code, a)
} else r = Object(i["f"])(e.url + e.code, n);
} else r = Object(i["f"])(e.addUrl + e.code, n);
r.then((function(t) {
e.confirmLoading = !1, t.success ? (e.visible = !1, e.$message.success(t.message)) : e.$message.warning(
t.message)
@@ -40091,7 +40097,8 @@
urls: {
loadFormItems: "/online/cgform/api/getFormItem/",
loadEnhanceJs: "/online/cgform/api/getEnhanceJs/",
optPre: "/online/cgform/api/form/"
optPre: "/online/cgform/api/form/",
optPreUpdate: "/online/cgform/api/form/update/"
},
formSchema: {},
uiSchema: {
@@ -40154,8 +40161,8 @@
edit: function(e, t) {
var n = this;
this.titleText = "编辑", this.uiSchema.method = "post", this.uiSchema.formTemplate = e, this.uiSchema.url =
this.urls.optPre + this.code, this.uiSchema = v({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
1, Object(i["c"])(this.urls.optPre + this.code + "/" + t).then((function(e) {
this.urls.optPreUpdate + this.code, this.uiSchema = v({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
1, Object(i["c"])(this.urls.optPreUpdate + this.code + "/" + t).then((function(e) {
if (e.success) {
var t = e.result;
n.$refs.onlineFormTab.edit(t)
@@ -41620,6 +41627,7 @@
}
},
url: "/online/cgform/head/enhanceJava/",
addUrl: "/online/cgform/head/addEnhanceJava/",
model: {
buttonCode: "add",
event: "end",
@@ -41652,7 +41660,7 @@
if (e.confirmLoading = !0, e.model.id) {
var a = Object.assign(e.model, n);
r = Object(o["g"])(e.url + e.code, a)
} else r = Object(o["f"])(e.url + e.code, n);
} else r = Object(o["f"])(e.addUrl + e.code, n);
r.then((function(t) {
e.confirmLoading = !1, t.success ? (e.visible = !1, e.$message.success(t.message), e.$emit("ok")) :
e.$message.warning(t.message)
@@ -42888,6 +42896,7 @@
}
},
url: "/online/cgform/head/enhanceSql/",
addUrl: "/online/cgform/head/addEnhanceSql/",
model: {
buttonCode: "add",
cgbSql: "",
@@ -42923,7 +42932,7 @@
if (e.confirmLoading = !0, e.model.id) {
var a = Object.assign(e.model, n);
r = Object(o["g"])(e.url + e.code, a)
} else r = Object(o["f"])(e.url + e.code, n);
} else r = Object(o["f"])(e.addUrl + e.code, n);
r.then((function(t) {
e.confirmLoading = !1, t.success ? (e.visible = !1, e.$message.success(t.message), e.$emit("ok")) :
e.$message.warning(t.message)
@@ -73533,7 +73542,8 @@
url: {
loadFormItems: "/online/cgform/api/getFormItem/",
loadEnhanceJs: "/online/cgform/api/getEnhanceJs/",
optPre: "/online/cgform/api/form/"
optPre: "/online/cgform/api/form/",
optPreUpdate: "/online/cgform/api/form/update/"
},
schema: {},
uiSchema: {
@@ -73615,8 +73625,8 @@
edit: function(e, t) {
var n = this;
this.titleText = "编辑", this.uiSchema.method = "post", this.uiSchema.formTemplate = e, this.uiSchema.url =
this.url.optPre + this.code, this.uiSchema = c({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
1, Object(o["c"])(this.url.optPre + this.code + "/" + t).then((function(e) {
this.url.optPreUpdate + this.code, this.uiSchema = c({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
1, Object(o["c"])(this.url.optPreUpdate + this.code + "/" + t).then((function(e) {
if (e.success) {
var t = e.result;
n.$refs.onlineForm.edit(t)
+11
View File
@@ -270,6 +270,8 @@ export const JeroListMixin = {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 添加全局遮罩
this.$store.commit('SET_IS_EXPORTING', true)
downFile(this.url.exportXlsUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
@@ -288,15 +290,22 @@ export const JeroListMixin = {
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 去掉全局遮罩
this.$store.commit('SET_IS_EXPORTING', false)
})
},
/* 导入 */
handleImportExcel (info) {
this.loading = true
// 添加全局遮罩
this.$store.commit('SET_IS_IMPORTING', true)
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList)
}
if (info.file.status === 'done') {
// 去掉全局遮罩
this.$store.commit('SET_IS_IMPORTING', false)
this.loading = false
if (info.file.response.success) {
// this.$message.success(`${info.file.name} 文件上传成功`);
@@ -319,6 +328,8 @@ export const JeroListMixin = {
this.$message.error(`${info.file.name} ${info.file.response.message}.`)
}
} else if (info.file.status === 'error') {
// 去掉全局遮罩
this.$store.commit('SET_IS_IMPORTING', false)
this.loading = false
if (info.file.response.status === 500) {
const data = info.file.response
+9 -1
View File
@@ -27,7 +27,9 @@ const app = {
autoHideHeader: false,
color: null,
weak: false,
multipage: true // 默认多页签模式
multipage: true, // 默认多页签模式
isImporting: false, // 是否正在导入
isExporting: false // 是否正在导出
},
mutations: {
SET_SIDEBAR_TYPE: (state, type) => {
@@ -78,6 +80,12 @@ const app = {
SET_MULTI_PAGE (state, multipageFlag) {
Vue.ls.set(DEFAULT_MULTI_PAGE, multipageFlag)
state.multipage = multipageFlag
},
SET_IS_IMPORTING (state, isImporting) {
state.isImporting = isImporting
},
SET_IS_EXPORTING (state, isExporting) {
state.isExporting = isExporting
}
},
actions: {