新加开关

This commit is contained in:
zoujiandong 2025-12-24 15:11:26 +08:00
parent ea377d76b1
commit 0d48bf645c

View File

@ -10,6 +10,12 @@
</a-form-item>
<a-form-item label="项目开关">
<a-switch v-model:checked="caseSwitchForm.configValue" />
</a-form-item>
<a-form-item label="病例新增开关">
<a-switch v-model:checked="caseNewSwitchForm.configValue" />
</a-form-item>
<a-form-item label="病例修改开关">
<a-switch v-model:checked="caseUpdateSwitchForm.configValue" />
</a-form-item>
<a-form-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="save(1)" v-privilege="'case-support:config:update'">保存</a-button>
@ -63,6 +69,36 @@
<SmartWangeditor ref="privacyRef" :modelValue="privacyForm.configValue" :height="300" :toolbarConfig="privacyToolbarConfig"/>
</a-card>
<br>
<a-card class="employee-container" style="border-radius: 10px;">
<div class="header">
<a-row justify="space-around">
<a-col :span="12"><a-typography-title :level="5">隐私协议</a-typography-title></a-col>
<a-col :span="12" style="justify-content: end; display: flex;">
<a-space>
<a-button type="primary" @click="save(4)" v-privilege="'case-support:config:update'">保存</a-button>
<a-button @click="preview(4)">预览</a-button>
</a-space>
</a-col>
</a-row>
</div>
<SmartWangeditor ref="privacyRef" :modelValue="privacyForm.configValue" :height="300" :toolbarConfig="privacyToolbarConfig"/>
</a-card>
<br>
<a-card class="employee-container" style="border-radius: 10px;">
<div class="header">
<a-row justify="space-around">
<a-col :span="12"><a-typography-title :level="5">首页弹窗</a-typography-title></a-col>
<a-col :span="12" style="justify-content: end; display: flex;">
<a-space>
<a-button type="primary" @click="save(5)" v-privilege="'case-support:config:update'">保存</a-button>
<a-button @click="preview(5)">预览</a-button>
</a-space>
</a-col>
</a-row>
</div>
<SmartWangeditor ref="dialogRef" :modelValue="dialogForm.configValue" :height="300" :toolbarConfig="dialogToolbarConfig"/>
</a-card>
<br>
<Preview ref="previewRef"></Preview>
</template>
@ -91,6 +127,9 @@ function preview(type){
}else if(type == 4){
previewForm.contentHtml = privacyRef.value.getHtml();
previewForm.title = "隐私协议"
}else if(type == 5){
previewForm.contentHtml = dialogRef.value.getHtml();
previewForm.title = "首页弹窗"
}
previewRef.value.show(previewForm)
}
@ -103,6 +142,7 @@ const formState = reactive({
const rubricRef = ref();
const dealRef = ref();
const privacyRef = ref();
const dialogRef = ref();
const rubricToolbarConfig = {
toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList','uploadImage' ]
@ -115,6 +155,9 @@ const dealToolbarConfig = {
const privacyToolbarConfig = {
toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList']
}
const dialogToolbarConfig = {
toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList','uploadImage']
}
const rubricForm = reactive({
configId: undefined,
@ -123,6 +166,13 @@ const rubricForm = reactive({
configValue: '',
remark: '',
});
const dialogForm = reactive({
configId: undefined,
configKey: '',
configName: '',
configValue: '',
remark: '',
});
const dealForm = reactive({
configId: undefined,
@ -155,11 +205,27 @@ const caseSwitchForm = reactive({
configValue: '',
remark: '',
});
const caseNewSwitchForm = reactive({
configId: undefined,
configKey: '',
configName: '',
configValue: '',
remark: '',
});
const caseUpdateSwitchForm = reactive({
configId: undefined,
configKey: '',
configName: '',
configValue: '',
remark: '',
});
function save(type){
if(type == 1){
onSubmit(caseNumForm)
onSubmit(caseSwitchForm)
onSubmit(caseNewSwitchForm)
onSubmit(caseUpdateSwitchForm)
}else if(type == 2){
rubricForm.configValue = rubricRef.value.getHtml();
onSubmit(rubricForm)
@ -169,6 +235,9 @@ function save(type){
}else if(type == 4){
privacyForm.configValue = privacyRef.value.getHtml();
onSubmit(privacyForm)
}else if(type == 5){
dialogForm.configValue = dialogRef.value.getHtml();
onSubmit(dialogForm)
}
}
@ -207,6 +276,10 @@ async function getCaseNum(){
let response = await configApi.queryByKey("CaseNum")
Object.assign(caseNumForm, response.data);
}
async function getDialog(){
let response = await configApi.queryByKey("IndexNotice")
Object.assign(dialogForm, response.data);
}
async function getCaseSwitch(){
let response = await configApi.queryByKey("CaseSwitch")
if(response.data.configValue == "true"){
@ -216,6 +289,24 @@ async function getCaseSwitch(){
}
Object.assign(caseSwitchForm, response.data);
}
async function getCaseNewSwitch(){
let response = await configApi.queryByKey("CaseNewSwitch")
if(response.data.configValue == "true"){
response.data.configValue = true
}else{
response.data.configValue = false
}
Object.assign(caseNewSwitchForm, response.data);
}
async function getCaseUpdateSwitch(){
let response = await configApi.queryByKey("CaseUpdateSwitch")
if(response.data.configValue == "true"){
response.data.configValue = true
}else{
response.data.configValue = false
}
Object.assign(caseUpdateSwitchForm, response.data);
}
onMounted(()=>{
getRubric()
@ -223,6 +314,9 @@ onMounted(()=>{
getPrivacy()
getCaseNum()
getCaseSwitch()
getCaseNewSwitch()
getCaseUpdateSwitch()
getDialog()
});
</script>