系统全局配置,支持在页面可视化配置
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
2c9c6d45e5
commit
942529718b
|
|
@ -422,4 +422,19 @@ export function updateSystemEmailConfig(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
// 获取前端配置
|
||||
export function getWebConfigInfo() {
|
||||
return request({
|
||||
url: `/DeployConfig/getWebConfigInfo`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 更新前端配置
|
||||
export function updateWebConfigInfo(data) {
|
||||
return request({
|
||||
url: `/DeployConfig/updateWebConfigInfo`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
COMPANY: process.env.VUE_APP_COMPANY_NAME,
|
||||
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL,
|
||||
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME,
|
||||
onlyOffice_url: window.webConfig.VUE_APP_ONLYOFFICE_URL,
|
||||
window,
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export default {
|
|||
title: null,
|
||||
documentType: null,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL
|
||||
onlyOffice_url: window.webConfig.VUE_APP_ONLYOFFICE_URL
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
108
src/main.js
108
src/main.js
|
|
@ -12,7 +12,7 @@ import './assets/css/iconfont/index.css' // 阿里巴巴图标库
|
|||
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
|
||||
import i18n from './lang'
|
||||
import '@/styles/index.scss' // global css
|
||||
|
||||
import { getWebConfigInfo } from '@/api/admin'
|
||||
import App from './App'
|
||||
import store from './store'
|
||||
import router from './router'
|
||||
|
|
@ -98,22 +98,29 @@ import DictData from '@/components/DictData'
|
|||
import { getBasicDataSelect } from '@/api/dictionary/dictionary'
|
||||
import { checkConfig } from '@/const/check/index'
|
||||
import { getTrialBodyPartList } from "@/api/trials/setting";
|
||||
// 全局方法挂载
|
||||
var $q = params
|
||||
Vue.prototype.checkConfig = checkConfig
|
||||
Vue.prototype.$q = $q()
|
||||
Vue.prototype.hasPermi = xfHasPermi
|
||||
Vue.prototype.getDicts = getBasicDataSelect
|
||||
Vue.prototype.selectDictLabel = selectDictLabel
|
||||
Vue.prototype.selectDictLabels = selectDictLabels
|
||||
Vue.component('DictTag', DictTag)
|
||||
// 全局方法挂载
|
||||
Vue.prototype.parseTime = parseTime
|
||||
Vue.prototype.resetForm = resetForm
|
||||
Vue.prototype.selectDictLabel = selectDictLabel
|
||||
// Vue.prototype.download = download
|
||||
Vue.prototype.handleTree = handleTree
|
||||
Vue.prototype.$getObjectName = (url) => {
|
||||
import global_ from './components/Global'
|
||||
var _vm
|
||||
getWebConfigInfo().then(res => {
|
||||
if (res.IsSuccess) {
|
||||
window.webConfig = JSON.parse(res.Result)
|
||||
}
|
||||
|
||||
// 全局方法挂载
|
||||
var $q = params
|
||||
Vue.prototype.checkConfig = checkConfig
|
||||
Vue.prototype.$q = $q()
|
||||
Vue.prototype.hasPermi = xfHasPermi
|
||||
Vue.prototype.getDicts = getBasicDataSelect
|
||||
Vue.prototype.selectDictLabel = selectDictLabel
|
||||
Vue.prototype.selectDictLabels = selectDictLabels
|
||||
Vue.component('DictTag', DictTag)
|
||||
// 全局方法挂载
|
||||
Vue.prototype.parseTime = parseTime
|
||||
Vue.prototype.resetForm = resetForm
|
||||
Vue.prototype.selectDictLabel = selectDictLabel
|
||||
// Vue.prototype.download = download
|
||||
Vue.prototype.handleTree = handleTree
|
||||
Vue.prototype.$getObjectName = (url) => {
|
||||
// console.log(url,'url')
|
||||
// console.log(Vue.prototype.OSSclientConfig.viewEndpoint,'url')
|
||||
var value = url;
|
||||
|
|
@ -122,8 +129,8 @@ Vue.prototype.$getObjectName = (url) => {
|
|||
basePath = Vue.prototype.OSSclientConfig.endPoint.split('https://').length > 1 ? Vue.prototype.OSSclientConfig.endPoint.split('https://')[1] : Vue.prototype.OSSclientConfig.endPoint;
|
||||
}
|
||||
return value.split(basePath)[1];
|
||||
}
|
||||
Vue.prototype.getGuid = (text) => {
|
||||
}
|
||||
Vue.prototype.getGuid = (text) => {
|
||||
text = md5(text)
|
||||
let t1, t2, t3, t4, t5, t6, t7, t8, t9, t10
|
||||
t1 = text.substr(0, 2)
|
||||
|
|
@ -138,34 +145,34 @@ Vue.prototype.getGuid = (text) => {
|
|||
t10 = text.substr(20, 12)
|
||||
// console.log(`${t4+t3+t2+t1}-${t6+t5}-${t8+t7}-${t9}-${t10}`)
|
||||
return `${t4 + t3 + t2 + t1}-${t6 + t5}-${t8 + t7}-${t9}-${t10}`
|
||||
}
|
||||
Vue.prototype.$validatePassword = (rule, value, callback) => {
|
||||
}
|
||||
Vue.prototype.$validatePassword = (rule, value, callback) => {
|
||||
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
|
||||
/* eslint-disable */
|
||||
var reg1 = eval(process.env.VUE_APP_PASSWORD_FOR_PERMISSION) ? new RegExp(`${process.env.VUE_APP_PASSWORD_FOR_REGULAR}`) : /.*/g; //密码必须是8位以上、必须含有字母、数字、特殊符号
|
||||
var reg1 = eval(window.webConfig.VUE_APP_PASSWORD_FOR_PERMISSION) ? new RegExp(`${window.webConfig.VUE_APP_PASSWORD_FOR_REGULAR}`) : /.*/g; //密码必须是8位以上、必须含有字母、数字、特殊符号
|
||||
if (!reg1.test(value)) {
|
||||
callback(
|
||||
new Error(_vm.$t('env:regExp:formatPassword')))
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DictData.install()
|
||||
DictData.install()
|
||||
|
||||
import global_ from './components/Global'
|
||||
Vue.prototype.GLOBAL = global_
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$upload = () => {
|
||||
|
||||
Vue.prototype.GLOBAL = global_
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$upload = () => {
|
||||
_vm.$forceUpdate()
|
||||
}
|
||||
Vue.prototype.$guid = () => {
|
||||
}
|
||||
Vue.prototype.$guid = () => {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
Vue.prototype.fileToBlob = (file) => {
|
||||
}
|
||||
Vue.prototype.fileToBlob = (file) => {
|
||||
// 创建 FileReader 对象
|
||||
const reader = new FileReader()
|
||||
return new Promise(resolve => {
|
||||
|
|
@ -182,10 +189,10 @@ Vue.prototype.fileToBlob = (file) => {
|
|||
// FileReader 以 ArrayBuffer 格式 读取 File 对象中数据
|
||||
reader.readAsArrayBuffer(file)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var _vm
|
||||
async function VueInit() {
|
||||
|
||||
async function VueInit() {
|
||||
var params
|
||||
var res
|
||||
if (~window.location.href.indexOf('/readingDicoms') || ~window.location.href.indexOf('/noneDicomReading') || ~window.location.href.indexOf('/criterionquestions') || ~window.location.href.indexOf('/petct') || ~window.location.href.indexOf('/fusion')) {
|
||||
|
|
@ -365,7 +372,8 @@ async function VueInit() {
|
|||
var isLock = zzSessionStorage.getItem('isLock')
|
||||
var isOpen = false
|
||||
let count = 0;
|
||||
if (eval(process.env.VUE_APP_LOGIN_FOR_PERMISSION)) {
|
||||
console.log(window.webConfig.VUE_APP_LOGIN_FOR_PERMISSION, 'window.webConfig.VUE_APP_LOGIN_FOR_PERMISSION')
|
||||
if (eval(window.webConfig.VUE_APP_LOGIN_FOR_PERMISSION)) {
|
||||
setInterval(() => {
|
||||
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
|
||||
if (WHITELIST.includes(_vm.$route.path)) {
|
||||
|
|
@ -425,12 +433,12 @@ async function VueInit() {
|
|||
}
|
||||
const h = _vm.$createElement
|
||||
/* eslint-disable */
|
||||
// eval(process.env.VUE_APP_LOGOUT_FOR_PERMISSION)
|
||||
// process.env.VUE_APP_LOGOUT_FOR_TIME
|
||||
// eval(process.env.VUE_APP_LOCK_FOR_PERMISSION)
|
||||
// process.env.VUE_APP_LOCK_FOR_TIME
|
||||
// window.VUE_APP_COMPANY_NAME = process.env.VUE_APP_COMPANY_NAME;
|
||||
waitOperate(eval(process.env.VUE_APP_LOGOUT_FOR_PERMISSION) ? () => {
|
||||
// eval(window.webConfig.VUE_APP_LOGOUT_FOR_PERMISSION)
|
||||
// window.webConfig.VUE_APP_LOGOUT_FOR_TIME
|
||||
// eval(window.webConfig.VUE_APP_LOCK_FOR_PERMISSION)
|
||||
// window.webConfig.VUE_APP_LOCK_FOR_TIME
|
||||
// window.VUE_APP_COMPANY_NAME = window.webConfig.VUE_APP_COMPANY_NAME;
|
||||
waitOperate(eval(window.webConfig.VUE_APP_LOGOUT_FOR_PERMISSION) ? () => {
|
||||
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
|
||||
if (_vm.$store.state.trials.unlock || WHITELIST.includes(_vm.$route.path)) {
|
||||
count = 0;
|
||||
|
|
@ -463,8 +471,8 @@ async function VueInit() {
|
|||
})
|
||||
})
|
||||
|
||||
} : () => { }, process.env.VUE_APP_LOGOUT_FOR_TIME,
|
||||
eval(process.env.VUE_APP_LOCK_FOR_PERMISSION)
|
||||
} : () => { }, window.webConfig.VUE_APP_LOGOUT_FOR_TIME,
|
||||
eval(window.webConfig.VUE_APP_LOCK_FOR_PERMISSION)
|
||||
? () => {
|
||||
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
|
||||
if (_vm.$store.state.trials.unlock || WHITELIST.includes(_vm.$route.path)) {
|
||||
|
|
@ -524,7 +532,7 @@ async function VueInit() {
|
|||
done()
|
||||
}, 500)
|
||||
}
|
||||
// if (eval(process.env.VUE_APP_LOCK_FOR_PERMISSION_MFA)) {
|
||||
// if (eval(window.webConfig.VUE_APP_LOCK_FOR_PERMISSION_MFA)) {
|
||||
// sendMFAEmail({ UserId: my_userid, MfaType: 1 }).then((res) => {
|
||||
// done();
|
||||
// Vue.prototype.$MFA({
|
||||
|
|
@ -622,14 +630,16 @@ async function VueInit() {
|
|||
])
|
||||
})
|
||||
} : () => { },
|
||||
process.env.VUE_APP_LOCK_FOR_TIME
|
||||
window.webConfig.VUE_APP_LOCK_FOR_TIME
|
||||
)
|
||||
}
|
||||
VueInit()
|
||||
}
|
||||
VueInit()
|
||||
})
|
||||
|
||||
// createVersionPolling({
|
||||
// appETagKey: "__APP_ETAG__",
|
||||
// pollingInterval: 5 * 60 * 1000, // 单位为毫秒
|
||||
// silent: process.env.NODE_ENV === false, // 开发环境下不检测
|
||||
// silent: window.webConfig.NODE_ENV === false, // 开发环境下不检测
|
||||
// onUpdate: (self) => {
|
||||
// // 当检测到有新版本时,执行的回调函数,可以在这里提示用户刷新页面
|
||||
// const result = confirm(_vm.$t("versionPolling:tip"));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,59 @@
|
|||
<div ref="leftContainer" class="left" style="padding: 20px;">
|
||||
<el-form :inline="true" :model="form" :rules="rules" ref="systemConfigForm"
|
||||
style="display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;">
|
||||
<h3>{{ $t("system:config:WebConfig") }}</h3>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_ONLYOFFICE_URL')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_ONLYOFFICE_URL">
|
||||
<el-input v-model="form.WebConfigInfo.VUE_APP_ONLYOFFICE_URL" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_LOGIN_FOR_PERMISSION')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_LOGIN_FOR_PERMISSION">
|
||||
<el-select v-model="form.WebConfigInfo.VUE_APP_LOGIN_FOR_PERMISSION" placeholder="">
|
||||
<el-option v-for="item in $d.YesOrNo" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_LOCK_FOR_PERMISSION_MFA')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_LOCK_FOR_PERMISSION_MFA">
|
||||
<el-select v-model="form.WebConfigInfo.VUE_APP_LOCK_FOR_PERMISSION_MFA" placeholder="">
|
||||
<el-option v-for="item in $d.YesOrNo" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_LOCK_FOR_PERMISSION')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_LOCK_FOR_PERMISSION">
|
||||
<el-select v-model="form.WebConfigInfo.VUE_APP_LOCK_FOR_PERMISSION" placeholder="">
|
||||
<el-option v-for="item in $d.YesOrNo" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_LOCK_FOR_TIME')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_LOCK_FOR_TIME">
|
||||
<el-input-number v-model="form.WebConfigInfo.VUE_APP_LOCK_FOR_TIME" clearable type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_LOGOUT_FOR_PERMISSION')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_LOGOUT_FOR_PERMISSION">
|
||||
<el-select v-model="form.WebConfigInfo.VUE_APP_LOGOUT_FOR_PERMISSION" placeholder="">
|
||||
<el-option v-for="item in $d.YesOrNo" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_LOGOUT_FOR_TIME')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_LOGOUT_FOR_TIME">
|
||||
<el-input-number v-model="form.WebConfigInfo.VUE_APP_LOGOUT_FOR_TIME" clearable type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:VUE_APP_PASSWORD_FOR_PERMISSION')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_PASSWORD_FOR_PERMISSION">
|
||||
<el-select v-model="form.WebConfigInfo.VUE_APP_PASSWORD_FOR_PERMISSION" placeholder="">
|
||||
<el-option v-for="item in $d.YesOrNo" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('system:config:VUE_APP_WORD_FOR_PERMISSION')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_WORD_FOR_PERMISSION">
|
||||
<el-select v-model="form.WebConfigInfo.VUE_APP_WORD_FOR_PERMISSION" placeholder="">
|
||||
<el-option v-for="item in $d.YesOrNo" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('system:config:VUE_APP_COMPANY_NAME')" style="width: 45%;"
|
||||
prop="WebConfigInfo.VUE_APP_COMPANY_NAME">
|
||||
<el-input v-model="form.WebConfigInfo.VUE_APP_COMPANY_NAME" clearable />
|
||||
</el-form-item>
|
||||
<h3>{{ $t("system:config:BasicSystemConfig") }}</h3>
|
||||
<el-form-item :label="$t('system:config:QcRiskControl')" style="width: 45%;">
|
||||
<el-select v-model="form.BasicSystemConfig.QCRiskControl" placeholder="">
|
||||
|
|
@ -84,7 +137,7 @@
|
|||
<el-input v-model="form.SystemEmailSendConfig.Port" clearable type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:Imap')" style="width: 45%;" prop="SystemEmailSendConfig.Imap">
|
||||
<el-input v-model="form.SystemEmailSendConfig.Imap" clearable />
|
||||
<el-input v-model="form.SystemEmailSendConfig.Imap" clearable />http://localhost:8080/trials/trials-list
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:config:ImapPort')" style="width: 45%;" prop="SystemEmailSendConfig.ImapPort">
|
||||
<el-input v-model="form.SystemEmailSendConfig.ImapPort" clearable type="number" />
|
||||
|
|
@ -157,7 +210,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getSystemBasicConfigInfo, getEmailConfigInfo, updateSystemBasicConfig, updateSystemEmailConfig } from '@/api/admin'
|
||||
import { getSystemBasicConfigInfo, getEmailConfigInfo, updateSystemBasicConfig, updateSystemEmailConfig, getWebConfigInfo, updateWebConfigInfo } from '@/api/admin'
|
||||
export default {
|
||||
name: "systemConfig",
|
||||
data() {
|
||||
|
|
@ -255,8 +308,53 @@ export default {
|
|||
'SystemEmailSendConfig.EmailRegexStr': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
|
||||
'WebConfigInfo.VUE_APP_ONLYOFFICE_URL': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_LOGIN_FOR_PERMISSION': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_LOCK_FOR_PERMISSION_MFA': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_LOCK_FOR_PERMISSION': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_LOCK_FOR_TIME': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
|
||||
{ type: 'number', message: this.$t('systemConfig:ruleMessage:mustNumber'), trigger: 'blur' },
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_LOGOUT_FOR_PERMISSION': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_LOGOUT_FOR_TIME': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
|
||||
{ type: 'number', message: this.$t('systemConfig:ruleMessage:mustNumber'), trigger: 'blur' },
|
||||
],
|
||||
'WebConfigInfo.VUE_APP_PASSWORD_FOR_PERMISSION': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
// 'WebConfigInfo.VUE_APP_WORD_FOR_PERMISSION': [
|
||||
// { required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
// ],
|
||||
'WebConfigInfo.VUE_APP_COMPANY_NAME': [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
form: {
|
||||
WebConfigInfo: {
|
||||
VUE_APP_ONLYOFFICE_URL: '', // onlyoffice地址
|
||||
VUE_APP_LOGIN_FOR_PERMISSION: false, // 是否开启登陆限制
|
||||
VUE_APP_LOCK_FOR_PERMISSION_MFA: false,// 是否开启长时间无操作锁定弹框MFA验证
|
||||
VUE_APP_LOCK_FOR_PERMISSION: false, // 是否开启长时间无操作锁定弹框
|
||||
VUE_APP_LOCK_FOR_TIME: 900, // 无操作锁定弹框判断时间
|
||||
VUE_APP_LOGOUT_FOR_PERMISSION: false,// 是否开启长时间无操作登出
|
||||
VUE_APP_LOGOUT_FOR_TIME: 1800, // 无操作登出判断时间
|
||||
VUE_APP_PASSWORD_FOR_PERMISSION: false, // 是否开启密码正则验证
|
||||
// VUE_APP_WORD_FOR_PERMISSION: false, // 是否开启文档签署验证,
|
||||
VUE_APP_COMPANY_NAME: '', // 公司名称
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
// 启用质控风险控制功能
|
||||
"QCRiskControl": true,
|
||||
|
|
@ -340,14 +438,14 @@ export default {
|
|||
methods: {
|
||||
handleSave() {
|
||||
this.loading = true
|
||||
Promise.all([this.updateSystemBasicConfig(), this.updateSystemEmailConfig()]).then(res => {
|
||||
Promise.all([this.updateSystemBasicConfig(), this.updateSystemEmailConfig(), this.updateWebConfigInfo()]).then(res => {
|
||||
this.loading = false
|
||||
this.getInfo()
|
||||
// this.getInfo()
|
||||
})
|
||||
},
|
||||
getInfo() {
|
||||
this.loading = true
|
||||
Promise.all([this.getSystemBasicConfigInfo(), this.getEmailConfigInfo()]).then(res => {
|
||||
Promise.all([this.getSystemBasicConfigInfo(), this.getEmailConfigInfo(), this.getWebConfigInfo()]).then(res => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
|
@ -383,6 +481,38 @@ export default {
|
|||
console.log(err)
|
||||
}
|
||||
},
|
||||
async updateWebConfigInfo() {
|
||||
try {
|
||||
let validate = await this.$refs.systemConfigForm.validate()
|
||||
if (!validate) return false
|
||||
let data = {}
|
||||
Object.keys(this.form.WebConfigInfo).forEach(key => {
|
||||
data[key] = this.form.WebConfigInfo[key]
|
||||
})
|
||||
let res = await updateWebConfigInfo({
|
||||
configStr: JSON.stringify(data)
|
||||
})
|
||||
if (res.IsSuccess) {
|
||||
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
async getWebConfigInfo() {
|
||||
try {
|
||||
let res = await getWebConfigInfo()
|
||||
if (res.IsSuccess) {
|
||||
let data = res.Result ? JSON.parse(res.Result) : {}
|
||||
Object.keys(this.form.WebConfigInfo).forEach(key => {
|
||||
this.form.WebConfigInfo[key] = data[key] ? data[key] : this.form.WebConfigInfo[key]
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
this.loading = false
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
async getSystemBasicConfigInfo() {
|
||||
try {
|
||||
let res = await getSystemBasicConfigInfo()
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ export default {
|
|||
moment,
|
||||
loading: false,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
COMPANY:process.env.VUE_APP_COMPANY_NAME
|
||||
COMPANY:window.webConfig.VUE_APP_COMPANY_NAME
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export default {
|
|||
fileList: [],
|
||||
loading: false,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
COMPANY: process.env.VUE_APP_COMPANY_NAME
|
||||
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export default {
|
|||
fileList: [],
|
||||
loading: false,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
COMPANY: process.env.VUE_APP_COMPANY_NAME
|
||||
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
COMPANY:process.env.VUE_APP_COMPANY_NAME
|
||||
COMPANY:window.webConfig.VUE_APP_COMPANY_NAME
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export default {
|
|||
fileList: [],
|
||||
loading: false,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
COMPANY: process.env.VUE_APP_COMPANY_NAME
|
||||
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue