Compare commits

...

2 Commits

Author SHA1 Message Date
ChenQiuYu 230f32c508 Merge branch 'main' of ssh://git.jizhiweb.cn:2222/clinic-v2/web 2025-05-17 10:29:14 +08:00
ChenQiuYu 54f61f0d86 dev 2025-05-17 10:29:01 +08:00
4 changed files with 133 additions and 68 deletions

View File

@ -15,8 +15,9 @@
<script setup lang="ts">
import {ElMessage} from 'element-plus'
import {Plus} from '@element-plus/icons-vue'
import {defineModel,ref} from 'vue'
import {defineModel, onMounted, ref} from 'vue'
import {loadConfig} from "@/utils/config.ts";
import {post} from "@/utils/request.ts";
const url = defineModel()
const imageUrl = ref<any>()
const getImageUrl = (url: any) => {
@ -41,6 +42,17 @@ const beforeUpload = (file:any) => {
}
return isLt2M;
}
const list = ref<any>([])
onMounted(async ()=>{
list.value = await post("common/config/list")
list.value.forEach((item: any) => {
if (item.k == "logoUrl") {
loadConfig().then((res: any) => {
imageUrl.value = res.base_url + 'file/getImage/' + item.val
})
}
})
})
defineExpose({getImageUrl})
</script>
<style scoped>

View File

@ -7,23 +7,24 @@ import {loadConfig} from "@/utils/config.ts";
const decryptedText = ref<any>({})
const ciphertext = ref<any>('')
const list = ref<any>([])
const init = async () => {
ciphertext.value = await post("common/auth/get");
decryptedText.value = await post("common/auth/check");
list.value = await post("common/config/list")
list.value.forEach((item: any) => {
if (item.k == "logoUrl") {
loadConfig().then((res: any) => {
imageUrl.value = res.base_url + 'file/getImage/' + item.val
})
}
})
}
onMounted(async () => {
await init()
if(localStorage.getItem('logoUrl')){
getImageUrl(localStorage.getItem('logoUrl'))
}
})
const userMessage = defineModel<any>()
const imageUrl = ref<any>()
const getImageUrl = (url: any) => {
loadConfig().then(res => {
imageUrl.value = res.base_url + 'file/getImage/' + url
})
}
</script>
<template>

View File

@ -51,7 +51,8 @@
:rowspan="2"
label="logo上传">
<el-form-item>
<UpLoad v-model="uploadURL" ref="uploadRef" @uploadSuccess="(url)=>{ruleForm.logourl=url}" style="margin-left: 24px"></UpLoad>
<UpLoad v-model="uploadURL" ref="uploadRef" @uploadSuccess="uploadSuccess"
style="margin-left: 24px"></UpLoad>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="数字签名">
@ -60,10 +61,6 @@
</el-form-item>
</el-descriptions-item>
</el-descriptions>
<el-row>
</el-row>
</el-form>
</div>
<div style="display: flex;justify-content: flex-end;padding: 0 24px">
@ -94,11 +91,10 @@ const ruleForm = reactive<any>({
logoUrl: "",
})
const uploadRef = ref<any>()
onMounted(() => {
onMounted(async () => {
loadConfig().then((res: any) => {
uploadURL.value = res.base_url + "file/upload";
})
uploadRef.value?.getImageUrl(localStorage.getItem('logoUrl'))
post("common/config/list", null).then((list: any) => {
for (let i = 0; i < list.length; i++) {
ruleForm[list[i].k] = list[i].val
@ -117,13 +113,10 @@ const rules = reactive<FormRules<any>>({
})
const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return
await formEl.validate((valid, fields) => {
await formEl.validate((valid) => {
if (valid) {
post("common/config/edit", ruleForm).then((res: any) => {
ElMessage.success("保存成功")
if (ruleForm.logourl) {
localStorage.setItem('logoUrl', ruleForm.logourl)
}
})
}
})
@ -140,7 +133,12 @@ const options = Array.from({length: 10000}).map((_, idx) => ({
}))
//
const uploadURL = ref<any>()
const uploadSuccess = (url: any) => {
ruleForm.logoUrl = url
post("common/config/edit", ruleForm).then(() => {
ElMessage.success("保存图片成功")
})
}
</script>
<style scoped lang="scss">
.container-wrapper {

View File

@ -63,14 +63,15 @@
</div>
</div>
</Mask>
<Mask :is-show="isUpdate1312" :width="540" :height="347" title="有效期更新" @close="close">
<Mask :is-show="false" :width="540" :height="347" title="有效期更新" @close="close">
<div class="content-new">
<div class="update_box">
<el-date-picker
v-model="updt_time"
type="date"
placeholder="选择一个起始日期"
size="default"
style="flex: 1;height: 42px"
style="flex: 1;height: 100%"
/>
<div class="default-btn" @click="update1312(1)"
:style="{background: showBtn ? '#EDEFF6' : '', color: showBtn ? '#333333' : ''}" style="margin-left: 24px">
@ -78,10 +79,19 @@
</div>
</div>
<div class="tip-body">
<div class="tip">{{ tip }}</div>
<div class="tip">
<div class="tip-title">
{{ tip }}
</div>
<div class="demo-progress">
<el-progress v-if="tip" :text-inside="true" :stroke-width="30" :percentage="percent"
/>
</div>
</div>
</div>
</div>
</Mask>
<Mask :is-show="isUpdate1318" :width="540" :height="347" title="有效期更新" @close="close">
<Mask :is-show="isUpdate1318" :width="540" :height="347" title="限价信息更新" @close="close">
<div class="update_box">
<el-date-picker
v-model="updt_time"
@ -90,13 +100,46 @@
size="default"
style="flex: 1;height: 42px"
/>
<div class="default-btn" @click="update1312(1)"
<div class="default-btn" @click="update1318()"
:style="{background: showBtn ? '#EDEFF6' : '', color: showBtn ? '#333333' : ''}" style="margin-left: 24px">
开始更新
</div>
</div>
<div class="tip-body">
<div class="tip">{{ tip }}</div>
<div class="tip">
<div class="tip-title">
{{ tip }}
</div>
<div class="demo-progress">
<el-progress v-if="tip" :text-inside="true" :stroke-width="30" :percentage="0"/>
</div>
</div>
</div>
</Mask>
<Mask :is-show="isUpdate1319" :width="540" :height="347" title="自付比例更新" @close="close">
<div class="update_box">
<el-date-picker
v-model="updt_time"
type="date"
placeholder="选择一个起始日期"
size="default"
style="flex: 1;height: 42px"
/>
<div class="default-btn" @click="update1319()"
:style="{background: showBtn ? '#EDEFF6' : '', color: showBtn ? '#333333' : ''}"
style="margin-left: 24px;height: 42px">
开始更新
</div>
</div>
<div class="tip-body">
<div class="tip">
<div class="tip-title">
{{ tip }}
</div>
<div class="demo-progress">
<el-progress v-if="tip" :text-inside="true" :stroke-width="30" :percentage="percent"/>
</div>
</div>
</div>
</Mask>
</div>
@ -136,11 +179,11 @@ const tabs = [
let tableData: any = ref([])
let content: any = ref(null);
const showBtn = ref(false)
const percent = ref(0)
let update1312 = (current_page: number) => {
showBtn.value = true
if (current_page == 1) {
tip.value = "开始更新第1页"
showBtn.value = false
}
post("social/directory_upinfo/get_page", {
updt_time: updt_time.value,
@ -150,7 +193,7 @@ let update1312 = (current_page: number) => {
let number = res.number;
if (current_page < pages && isUpdate1312.value) {
current_page++
let percent = Math.floor((current_page / pages) * 100)
percent.value = Math.floor((current_page / pages) * 100)
tip.value = "开始更新第:" + current_page + "/" + pages;
update1312(current_page);
} else {
@ -194,7 +237,6 @@ function init() {
}
function set_tab() {
console.log(current_tab.value)
post("social/directory/column_list", {type: current_tab.value})
.then((res: any) => {
column_list.value = res;
@ -236,11 +278,6 @@ let change_tab = (tab: TabsPaneContext, event: Event) => {
})
}
let UpdateDirectoryLoading = ref(false)
let uploadMsg = ref("正在更新目录,请稍后...")
const format = ((p: number) => {
return `正在更新`
})
let percentage = ref(0)
const tip_message = ref("正在更新目录,请稍后...")
const start_type = () => {
@ -250,6 +287,7 @@ const start_type = () => {
download(res.currentVersionName, current_tab.value);
}).catch((err: any) => {
UpdateDirectoryLoading.value = false;
close()
ElNotification({
title: '提示',
message: "当前是最新版本",
@ -261,6 +299,7 @@ let download = (ver: any, type: any) => {
post("social/directory/download", {ver: ver, type: type}).then((res: any) => {
if (res == null || res == "") {
UpdateDirectoryLoading.value = false;
close()
ElNotification({
title: '提示',
message: "当前是最新版本",
@ -270,8 +309,8 @@ let download = (ver: any, type: any) => {
}
get_data_list()
start_type()
}).catch((err: any) => {
close()
UpdateDirectoryLoading.value = false;
ElNotification({
title: '提示',
@ -287,16 +326,15 @@ const close = () => {
isUpdate1319.value = false
tip.value = ""
}
const update1318 = () => {
console.log(111)
}
const update1319 = () => {
console.log(111)
}
</script>
<style scoped lang="scss">
.update_box {
width: 100%;
height: 90px;
padding: 24px;
display: flex;
}
.container-wrapper {
box-sizing: border-box;
padding: 20px;
@ -365,22 +403,37 @@ const close = () => {
}
.tip-body {
.content-new{
height: 100%;
padding: 0 24px;
display: flex;
flex-direction: column;
.update_box {
width: 100%;
height: 90px;
padding: 24px 24px 0;
display: flex;
}
.tip-body {
flex: 1;
padding: 0 24px 24px;
min-height: 0;
.tip {
width: 492px;
height: 160px;
background: #F9FAFC;
width: 100%;
height: 100%;
background: #1458df;
border-radius: 8px;
padding: 24px;
font-weight: 500;
font-size: 16px;
color: #999999;
font-style: normal;
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
}
.updateDirectory {
height: 100%;
padding: 24px;
@ -389,6 +442,7 @@ const close = () => {
font-size: 16px;
color: #999999;
font-style: normal;
&-message {
margin-bottom: 24px;
}