系统全局配置,支持在页面可视化配置
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
|
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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
COMPANY: process.env.VUE_APP_COMPANY_NAME,
|
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME,
|
||||||
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL,
|
onlyOffice_url: window.webConfig.VUE_APP_ONLYOFFICE_URL,
|
||||||
window,
|
window,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export default {
|
||||||
title: null,
|
title: null,
|
||||||
documentType: null,
|
documentType: null,
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL
|
onlyOffice_url: window.webConfig.VUE_APP_ONLYOFFICE_URL
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
976
src/main.js
976
src/main.js
File diff suppressed because it is too large
Load Diff
|
|
@ -3,6 +3,59 @@
|
||||||
<div ref="leftContainer" class="left" style="padding: 20px;">
|
<div ref="leftContainer" class="left" style="padding: 20px;">
|
||||||
<el-form :inline="true" :model="form" :rules="rules" ref="systemConfigForm"
|
<el-form :inline="true" :model="form" :rules="rules" ref="systemConfigForm"
|
||||||
style="display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;">
|
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>
|
<h3>{{ $t("system:config:BasicSystemConfig") }}</h3>
|
||||||
<el-form-item :label="$t('system:config:QcRiskControl')" style="width: 45%;">
|
<el-form-item :label="$t('system:config:QcRiskControl')" style="width: 45%;">
|
||||||
<el-select v-model="form.BasicSystemConfig.QCRiskControl" placeholder="">
|
<el-select v-model="form.BasicSystemConfig.QCRiskControl" placeholder="">
|
||||||
|
|
@ -84,7 +137,7 @@
|
||||||
<el-input v-model="form.SystemEmailSendConfig.Port" clearable type="number" />
|
<el-input v-model="form.SystemEmailSendConfig.Port" clearable type="number" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('system:config:Imap')" style="width: 45%;" prop="SystemEmailSendConfig.Imap">
|
<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>
|
||||||
<el-form-item :label="$t('system:config:ImapPort')" style="width: 45%;" prop="SystemEmailSendConfig.ImapPort">
|
<el-form-item :label="$t('system:config:ImapPort')" style="width: 45%;" prop="SystemEmailSendConfig.ImapPort">
|
||||||
<el-input v-model="form.SystemEmailSendConfig.ImapPort" clearable type="number" />
|
<el-input v-model="form.SystemEmailSendConfig.ImapPort" clearable type="number" />
|
||||||
|
|
@ -157,7 +210,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getSystemBasicConfigInfo, getEmailConfigInfo, updateSystemBasicConfig, updateSystemEmailConfig } from '@/api/admin'
|
import { getSystemBasicConfigInfo, getEmailConfigInfo, updateSystemBasicConfig, updateSystemEmailConfig, getWebConfigInfo, updateWebConfigInfo } from '@/api/admin'
|
||||||
export default {
|
export default {
|
||||||
name: "systemConfig",
|
name: "systemConfig",
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -255,8 +308,53 @@ export default {
|
||||||
'SystemEmailSendConfig.EmailRegexStr': [
|
'SystemEmailSendConfig.EmailRegexStr': [
|
||||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
|
{ 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: {
|
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": {
|
"BasicSystemConfig": {
|
||||||
// 启用质控风险控制功能
|
// 启用质控风险控制功能
|
||||||
"QCRiskControl": true,
|
"QCRiskControl": true,
|
||||||
|
|
@ -340,14 +438,14 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
handleSave() {
|
handleSave() {
|
||||||
this.loading = true
|
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.loading = false
|
||||||
this.getInfo()
|
// this.getInfo()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getInfo() {
|
getInfo() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
Promise.all([this.getSystemBasicConfigInfo(), this.getEmailConfigInfo()]).then(res => {
|
Promise.all([this.getSystemBasicConfigInfo(), this.getEmailConfigInfo(), this.getWebConfigInfo()]).then(res => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -383,6 +481,38 @@ export default {
|
||||||
console.log(err)
|
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() {
|
async getSystemBasicConfigInfo() {
|
||||||
try {
|
try {
|
||||||
let res = await getSystemBasicConfigInfo()
|
let res = await getSystemBasicConfigInfo()
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ export default {
|
||||||
moment,
|
moment,
|
||||||
loading: false,
|
loading: false,
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
COMPANY:process.env.VUE_APP_COMPANY_NAME
|
COMPANY:window.webConfig.VUE_APP_COMPANY_NAME
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default {
|
||||||
fileList: [],
|
fileList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
COMPANY: process.env.VUE_APP_COMPANY_NAME
|
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default {
|
||||||
fileList: [],
|
fileList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
COMPANY: process.env.VUE_APP_COMPANY_NAME
|
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
COMPANY:process.env.VUE_APP_COMPANY_NAME
|
COMPANY:window.webConfig.VUE_APP_COMPANY_NAME
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default {
|
||||||
fileList: [],
|
fileList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
COMPANY: process.env.VUE_APP_COMPANY_NAME
|
COMPANY: window.webConfig.VUE_APP_COMPANY_NAME
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue