|
@@ -1,8 +1,48 @@
|
|
|
<script setup>
|
|
|
+import {apiSystemCommon,apiSystemSet} from '@/api/system'
|
|
|
|
|
|
const chartWaterImgs=ref([])
|
|
|
async function handleUploadImg(e){
|
|
|
const file=e.raw
|
|
|
+ const res=await apiSystemCommon.uploadImg({
|
|
|
+ file:file
|
|
|
+ })
|
|
|
+ const resObj={
|
|
|
+ status:'',
|
|
|
+ error:'',
|
|
|
+ response:{
|
|
|
+ url:''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(res.Ret!==200){
|
|
|
+ resObj.status='fail'
|
|
|
+ resObj.error='上传失败'
|
|
|
+ }else{
|
|
|
+ resObj.status='success'
|
|
|
+ resObj.response.url=res.Data.ResourceUrl
|
|
|
+ chartWaterImgs.value=[{url:res.Data.ResourceUrl}]
|
|
|
+ }
|
|
|
+
|
|
|
+ return resObj
|
|
|
+}
|
|
|
+
|
|
|
+// 获取配置
|
|
|
+async function getConfigData(){
|
|
|
+ const res=await apiSystemSet.getConfigData()
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ if(res.Data.CompanyWatermark){
|
|
|
+ chartWaterImgs.value=[{url:res.Data.CompanyWatermark}]
|
|
|
+ }
|
|
|
+}
|
|
|
+getConfigData()
|
|
|
+
|
|
|
+// 保存配置
|
|
|
+async function handleSaveConfig(){
|
|
|
+ const res=await apiSystemSet.updateConfigData({
|
|
|
+ CompanyWatermark:chartWaterImgs.value[0]?.url||''
|
|
|
+ })
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ MessagePlugin.success('保存成功')
|
|
|
}
|
|
|
|
|
|
</script>
|
|
@@ -15,6 +55,7 @@ async function handleUploadImg(e){
|
|
|
theme="image"
|
|
|
tips="上传格式:png、jpg"
|
|
|
accept="image/png,image/jpeg"
|
|
|
+ :showImageFileName="false"
|
|
|
:request-method="handleUploadImg"
|
|
|
:locale="{
|
|
|
triggerUploadText: {
|
|
@@ -22,7 +63,7 @@ async function handleUploadImg(e){
|
|
|
},
|
|
|
}"
|
|
|
/>
|
|
|
- <t-button style="margin-top:30px">应用到全部社区图表</t-button>
|
|
|
+ <t-button style="margin-top:30px" @click="handleSaveConfig">应用到全部社区图表</t-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|