From 79b9c73e0717c244391ab1e15c6f6da9975f2610 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 12 十一月 2024 15:58:30 +0800 Subject: [PATCH] 打包bug --- src/views/index.vue | 695 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 537 insertions(+), 158 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index 438c1af..6ca8bac 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,167 +1,546 @@ <template> - <div class="app-container home"> - <el-row :gutter="20"> - <el-col :sm="24" :lg="12" style="padding-left: 20px"> - <h2>RuoYi-Vue-Plus澶氱鎴风鐞嗙郴缁�</h2> - <p> - RuoYi-Vue-Plus 鏄熀浜� RuoYi-Vue 閽堝 鍒嗗竷寮忛泦缇� 鍦烘櫙鍗囩骇(涓嶅吋瀹瑰師妗嗘灦) - <br /> - * 鍓嶇寮�鍙戞鏋� Vue3銆乀S銆丒lement Plus<br /> - * 鍚庣寮�鍙戞鏋� Spring Boot<br /> - * 瀹瑰櫒妗嗘灦 Undertow 鍩轰簬 Netty 鐨勯珮鎬ц兘瀹瑰櫒<br /> - * 鏉冮檺璁よ瘉妗嗘灦 Sa-Token 鏀寔澶氱粓绔璇佺郴缁�<br /> - * 鍏崇郴鏁版嵁搴� MySQL 閫傞厤 8.X 鏈�浣� 5.7<br /> - * 缂撳瓨鏁版嵁搴� Redis 閫傞厤 6.X 鏈�浣� 4.X<br /> - * 鏁版嵁搴撴鏋� Mybatis-Plus 蹇�� CRUD 澧炲姞寮�鍙戞晥鐜�<br /> - * 鏁版嵁搴撴鏋� p6spy 鏇村己鍔茬殑 SQL 鍒嗘瀽<br /> - * 澶氭暟鎹簮妗嗘灦 dynamic-datasource 鏀寔涓讳粠涓庡绉嶇被鏁版嵁搴撳紓鏋�<br /> - * 搴忓垪鍖栨鏋� Jackson 缁熶竴浣跨敤 jackson 楂樻晥鍙潬<br /> - * Redis瀹㈡埛绔� Redisson 鎬ц兘寮哄姴銆丄PI涓板瘜<br /> - * 鍒嗗竷寮忛檺娴� Redisson 鍏ㄥ眬銆佽姹侷P銆侀泦缇D 澶氱闄愭祦<br /> - * 鍒嗗竷寮忛攣 Lock4j 娉ㄨВ閿併�佸伐鍏烽攣 澶氱澶氭牱<br /> - * 鍒嗗竷寮忓箓绛� Lock4j 鍩轰簬鍒嗗竷寮忛攣瀹炵幇<br /> - * 鍒嗗竷寮忛摼璺拷韪� SkyWalking 鏀寔閾捐矾杩借釜銆佺綉鏍煎垎鏋愩�佸害閲忚仛鍚堛�佸彲瑙嗗寲<br /> - * 鍒嗗竷寮忎换鍔¤皟搴� PowerJob 楂樻�ц兘 楂樺彲闈� 鏄撴墿灞�<br /> - * 鏂囦欢瀛樺偍 Minio 鏈湴瀛樺偍<br /> - * 鏂囦欢瀛樺偍 涓冪墰銆侀樋閲屻�佽吘璁� 浜戝瓨鍌�<br /> - * 鐩戞帶妗嗘灦 SpringBoot-Admin 鍏ㄦ柟浣嶆湇鍔$洃鎺�<br /> - * 鏍¢獙妗嗘灦 Validation 澧炲己鎺ュ彛瀹夊叏鎬� 涓ヨ皑鎬�<br /> - * Excel妗嗘灦 Alibaba EasyExcel 鎬ц兘浼樺紓 鎵╁睍鎬у己<br /> - * 鏂囨。妗嗘灦 SpringDoc銆乯avadoc 鏃犳敞瑙i浂鍏ヤ镜鍩轰簬java娉ㄩ噴<br /> - * 宸ュ叿绫绘鏋� Hutool銆丩ombok 鍑忓皯浠g爜鍐椾綑 澧炲姞瀹夊叏鎬�<br /> - * 浠g爜鐢熸垚鍣� 閫傞厤MP銆丼pringDoc瑙勮寖鍖栦唬鐮� 涓�閿敓鎴愬墠鍚庣浠g爜<br /> - * 閮ㄧ讲鏂瑰紡 Docker 瀹瑰櫒缂栨帓 涓�閿儴缃蹭笟鍔¢泦缇�<br /> - * 鍥介檯鍖� SpringMessage Spring鏍囧噯鍥介檯鍖栨柟妗�<br /> - </p> - <p><b>褰撳墠鐗堟湰:</b> <span>v5.1.0</span></p> - <p> - <el-tag type="danger">¥鍏嶈垂寮�婧�</el-tag> - </p> - <p> - <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://gitee.com/dromara/RuoYi-Vue-Plus')">璁块棶鐮佷簯</el-button> - <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://github.com/dromara/RuoYi-Vue-Plus')">璁块棶GitHub</el-button> - <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://plus-doc.dromara.org/#/ruoyi-vue-plus/changlog')" - >鏇存柊鏃ュ織</el-button - > - </p> - </el-col> + <div class="p-2"> + <!-- <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">--> + <!-- <div class="mb-[10px]" v-show="showSearch">--> + <!-- <el-card shadow="hover">--> + <!-- <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">--> - <el-col :sm="24" :lg="12" style="padding-left: 20px"> - <h2>RuoYi-Cloud-Plus澶氱鎴峰井鏈嶅姟绠$悊绯荤粺</h2> - <p> - RuoYi-Cloud-Plus 寰湇鍔¢�氱敤鏉冮檺绠$悊绯荤粺 閲嶅啓 RuoYi-Cloud 鍏ㄦ柟浣嶅崌绾�(涓嶅吋瀹瑰師妗嗘灦) - <br /> - * 鍓嶇寮�鍙戞鏋� Vue3銆乀S銆丒lement UI<br /> - * 鍚庣寮�鍙戞鏋� Spring Boot<br /> - * 寰湇鍔″紑鍙戞鏋� Spring Cloud銆丼pring Cloud Alibaba<br /> - * 瀹瑰櫒妗嗘灦 Undertow 鍩轰簬 XNIO 鐨勯珮鎬ц兘瀹瑰櫒<br /> - * 鏉冮檺璁よ瘉妗嗘灦 Sa-Token銆丣wt 鏀寔澶氱粓绔璇佺郴缁�<br /> - * 鍏崇郴鏁版嵁搴� MySQL 閫傞厤 8.X 鏈�浣� 5.7<br /> - * 鍏崇郴鏁版嵁搴� Oracle 閫傞厤 11g 12c<br /> - * 鍏崇郴鏁版嵁搴� PostgreSQL 閫傞厤 13 14<br /> - * 鍏崇郴鏁版嵁搴� SQLServer 閫傞厤 2017 2019<br /> - * 缂撳瓨鏁版嵁搴� Redis 閫傞厤 6.X 鏈�浣� 5.X<br /> - * 鍒嗗竷寮忔敞鍐屼腑蹇� Alibaba Nacos 閲囩敤2.X 鍩轰簬GRPC閫氫俊楂樻�ц兘<br /> - * 鍒嗗竷寮忛厤缃腑蹇� Alibaba Nacos 閲囩敤2.X 鍩轰簬GRPC閫氫俊楂樻�ц兘<br /> - * 鏈嶅姟缃戝叧 Spring Cloud Gateway 鍝嶅簲寮忛珮鎬ц兘缃戝叧<br /> - * 璐熻浇鍧囪 Spring Cloud Loadbalancer 璐熻浇鍧囪 澶勭悊<br /> - * RPC杩滅▼璋冪敤 Apache Dubbo 鍘熺敓鎬佷娇鐢ㄤ綋楠屻�侀珮鎬ц兘<br /> - * 鍒嗗竷寮忛檺娴佺啍鏂� Alibaba Sentinel 鏃犱镜鍏ャ�侀珮鎵╁睍<br /> - * 鍒嗗竷寮忎簨鍔� Alibaba Seata 鏃犱镜鍏ャ�侀珮鎵╁睍 鏀寔 鍥涚妯″紡<br /> - * 鍒嗗竷寮忔秷鎭槦鍒� Spring Cloud Stream 闂ㄩ潰妗嗘灦鍏煎鍚勭MQ闆嗘垚<br /> - * 鍒嗗竷寮忔秷鎭槦鍒� Apache Kafka 楂樻�ц兘楂橀�熷害<br /> - * 鍒嗗竷寮忔秷鎭槦鍒� Apache RocketMQ 楂樺彲鐢ㄥ姛鑳藉鏍�<br /> - * 鍒嗗竷寮忔秷鎭槦鍒� RabbitMQ 鏀寔鍚勭鎵╁睍鎻掍欢鍔熻兘澶氭牱鎬�<br /> - * 鍒嗗竷寮忔悳绱㈠紩鎿� ElasticSearch 涓氱晫鐭ュ悕<br /> - * 鍒嗗竷寮忛摼璺拷韪� Apache SkyWalking 閾捐矾杩借釜銆佺綉鏍煎垎鏋愩�佸害閲忚仛鍚堛�佸彲瑙嗗寲<br /> - * 鍒嗗竷寮忔棩蹇椾腑蹇� ELK 涓氱晫鎴愮啛瑙e喅鏂规<br /> - * 鍒嗗竷寮忕洃鎺� Prometheus銆丟rafana 鍏ㄦ柟浣嶆�ц兘鐩戞帶<br /> - * 鍏朵綑涓� Vue 鐗堟湰涓�鑷�<br /> - </p> - <p><b>褰撳墠鐗堟湰:</b> <span>v2.1.0</span></p> - <p> - <el-tag type="danger">¥鍏嶈垂寮�婧�</el-tag> - </p> - <p> - <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://gitee.com/dromara/RuoYi-Cloud-Plus')">璁块棶鐮佷簯</el-button> - <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://github.com/dromara/RuoYi-Cloud-Plus')">璁块棶GitHub</el-button> - <el-button type="primary" icon="Cloudy" plain @click="goTarget('https://plus-doc.dromara.org/#/ruoyi-cloud-plus/changlog')" - >鏇存柊鏃ュ織</el-button + <!-- <el-form-item label="鍘熷悕" prop="originalName">--> + <!-- <el-input v-model="queryParams.originalName" placeholder="璇疯緭鍏ュ師鍚�" clearable style="width: 200px" @keyup.enter="handleQuery" />--> + <!-- </el-form-item>--> + + <!-- <el-form-item>--> + <!-- <el-button type="primary" icon="search" @click="handleQuery">鎼滅储</el-button>--> + <!-- <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>--> + <!-- </el-form-item>--> + <!-- </el-form>--> + <!-- </el-card>--> + <!-- </div>--> + <!-- </transition>--> + + <el-card shadow="hover"> + <template #header> + <el-row style="text-align: center"> + <el-col style="display:flex;justify-content: center;align-items: center;min-height: calc(100vh - 160px)"> + <el-button + style="min-height: 5rem;min-width: 21rem;font-size: 2rem;border-radius: 40px" + type="primary" + plain + icon="Upload" + @click="handleFile" + v-if="isContains(useUserStore().permissions, 'system:oss:upload')" + >涓婁紶鏂囦欢</el-button + > + </el-col> + + <!-- <el-col :span="1.5">--> + <!-- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-if="isContains(useUserStore().permissions, 'system:oss:remove')">--> + <!-- 鍒犻櫎--> + <!-- </el-button>--> + <!-- </el-col>--> + <!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>--> + </el-row> + </template> + <!-- <el-table--> + <!-- v-loading="loading"--> + <!-- :data="ossList"--> + <!-- @selection-change="handleSelectionChange"--> + <!-- :header-cell-class-name="handleHeaderClass"--> + <!-- @header-click="handleHeaderCLick"--> + <!-- v-if="showTable"--> + <!-- >--> + <!-- <el-table-column type="index" />--> + <!--<!– <el-table-column type="selection" width="55" align="center" />–>--> + <!-- <el-table-column label="鍘熷悕" align="center" prop="originalName" />--> + <!-- <el-table-column label="涓婁紶鏃堕棿" align="center" prop="createTime" />--> + <!-- <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">--> + <!-- <template #default="scope">--> + <!-- <el-tooltip content="鏌ョ湅鎻愬彇鐮�" placement="top">--> + <!-- <el-button link type="primary" icon="Search" @click="handleCode(scope.row)" v-if="isContains(useUserStore().permissions, 'system:oss:view')"></el-button>--> + <!-- </el-tooltip>--> + <!-- <el-tooltip content="涓嬭浇" placement="top">--> + <!-- <el-button link type="primary" icon="Download" @click="handleDownload(scope.row)" v-if="isContains(useUserStore().permissions, 'system:oss:download')"></el-button>--> + <!-- </el-tooltip>--> + <!-- <el-tooltip content="鍒犻櫎" placement="top">--> + <!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-if="isContains(useUserStore().permissions, 'system:oss:remove')"></el-button>--> + <!-- </el-tooltip>--> + <!-- </template>--> + <!-- </el-table-column>--> + <!-- </el-table>--> + + <!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />--> + </el-card> + <!-- 娣诲姞鎴栦慨鏀筄SS瀵硅薄瀛樺偍瀵硅瘽妗� --> + <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> + <el-form ref="ossFormRef" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="鏂囦欢鍚�"> + <fileUpload + ref="childFile" + @closePopup="getList();lookPawsd($event)" + @openPopup="lookPawsd($event)" + v-model="form.file" + v-if="type === 0" + /> + <imageUpload v-model="form.file" v-if="type === 1" /> + <video-upload v-model="form.file" v-if="type === 2" /> + </el-form-item> + </el-form> + <template #footer> + <div class="dialog-footer"> + <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </template> + </el-dialog> + <el-dialog :title="titleDownload" v-model="visibleCode" width="500px" append-to-body> + <div style="width: 100%;text-align: center"> + <p style="color: red; font-size: 20px">鎻愬彇鐮佸皢浼氬湪24灏忔椂鍚庡け鏁堣灏藉揩涓嬭浇!</p> + <span v-show="titleDownload=='鏌ョ湅鎻愬彇鐮�'" style="font-size: 80px;">{{testtxt}}</span> + </div> + <el-input + style="margin: 10px 0" + ref="inputRef" + :style="inputSty" + v-show="titleDownload=='杈撳叆鎻愬彇鐮�'" + v-model="pasTxt" + v-if="isContains(useUserStore().permissions, 'system:oss:download')" + placeholder="璇疯緭鍏ユ枃浠舵彁鍙栫爜" + ></el-input> + <el-input + style="margin: 10px 0" + ref="inputRef" + :style="inputSty" + v-show="titleDownload=='璇疯緭鍏ユ彁鍙栫爜'" + v-model="pasTxt" + placeholder="璇疯緭鍏ユ枃浠舵彁鍙栫爜" + ></el-input> + <!-- <el-button link type="primary" v-show="titleDownload=='杈撳叆鎻愬彇鐮�'" icon="Download" @click="handleDownloadFile()" v-if="isContains(useUserStore().permissions, 'system:oss:download')">涓嬭浇</el-button>--> + <!-- <el-button link type="primary" v-show="titleDownload=='璇疯緭鍏ユ彁鍙栫爜'" icon="Delete" @click="delFile()" >鍒犻櫎</el-button>--> + <template #footer> + <div class="dialog-footer"> + <el-button + link + type="primary" + v-show="titleDownload=='杈撳叆鎻愬彇鐮�'" + icon="Download" + @click="handleDownloadFile()" + v-if="isContains(useUserStore().permissions, 'system:oss:download')" + >涓嬭浇</el-button > - </p> - </el-col> - </el-row> - <el-divider /> + <el-button link type="primary" v-show="titleDownload=='璇疯緭鍏ユ彁鍙栫爜'" icon="Delete" @click="delFile()">鍒犻櫎</el-button> + <el-button type="primary" @click="visibleCode = false">纭� 瀹�</el-button> + </div> + </template> + </el-dialog> + + <!-- 杩涘害鏉� --> + <el-dialog v-model="dialogVisible" title="" width="37%" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"> + <el-progress type="dashboard" :percentage="percentage2" style="display: flex;justify-content: center" :color="colors" /> + </el-dialog> </div> </template> -<script setup name="Index" lang="ts"> +<script setup name="Oss" lang="ts"> +import { listOss, delOss, createUser, examineIds } from '@/api/system/oss'; +import { OssForm, OssQuery, OssVO } from '@/api/system/oss/types'; +import { to as tos } from 'await-to-js'; +import useUserStore from '@/store/modules/user'; +import { getToken, setToken } from '@/utils/auth'; +import usePermissionStore from '@/store/modules/permission'; +import { isHttp } from '@/utils/validate'; +import router from '@/router'; +import { onMounted, ref } from 'vue'; +import { Minus, Plus } from '@element-plus/icons-vue'; +import { ElMessageBox } from 'element-plus'; -const goTarget = (url:string) => { - window.open(url, '__blank') +const dialogVisible = ref(false); + +const state = reactive({ + mytime: 0 //瀹氫箟瀹氭椂鍣� +}); +const percentage = ref(10); +const percentage2 = ref(0); + +const colors = [ + { color: '#f56c6c', percentage: 20 }, + { color: '#e6a23c', percentage: 40 }, + { color: '#5cb87a', percentage: 60 }, + { color: '#1989fa', percentage: 80 }, + { color: '#6f7ad3', percentage: 100 } +]; + +const increase = () => { + percentage.value += 10; + if (percentage.value > 100) { + percentage.value = 100; + } +}; +const decrease = () => { + percentage.value -= 10; + if (percentage.value < 0) { + percentage.value = 0; + } +}; +onMounted(() => {}); +watch(percentage2, (new1, new2) => { + console.log(new1, new2); + if (new1 == 95) { + clearInterval(state.mytime); + state.mytime = 0; + } +}); +const { proxy } = getCurrentInstance() as ComponentInternalInstance; + +const ossList = ref<OssVO[]>([]); +const showTable = ref(true); +const buttonLoading = ref(false); +const loading = ref(true); +const showSearch = ref(true); +const ids = ref<Array<string | number>>([]); +const single = ref(true); +const multiple = ref(true); +const total = ref(0); +const type = ref(0); +const previewListResource = ref(true); +const dateRangeCreateTime = ref<[DateModelType, DateModelType]>(['', '']); +const visibleCode = ref(false); +const dialog = reactive<DialogOption>({ + visible: false, + title: '' +}); +const testtxt = ref<any>(); +const pasTxt = ref<any>(); +const titleDownload = ref<any>(); +const downIds = ref<any>(); +const inputRef = ref<any>(); +const inputSty = ref<any>(); +const currentIp = ref(''); +const childFile = ref<any>(); +const figType = ref<any>(); +// 榛樿鎺掑簭 +const defaultSort = ref({ prop: 'createTime', order: 'ascending' }); + +const ossFormRef = ref<ElFormInstance>(); +const queryFormRef = ref<ElFormInstance>(); + +const initFormData = { + file: undefined +}; +const data = reactive<PageData<OssForm, OssQuery>>({ + form: { ...initFormData }, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + fileName: '', + originalName: '', + fileSuffix: '', + createTime: '', + service: '', + orderByColumn: defaultSort.value.prop, + isAsc: defaultSort.value.order + }, + rules: { + file: [{ required: true, message: '鏂囦欢涓嶈兘涓虹┖', trigger: 'blur' }] + } +}); + +const { queryParams, form, rules } = toRefs(data); +const sure = () => { + testtxt.value += 1; +}; +/** 鏌ヨOSS瀵硅薄瀛樺偍鍒楄〃 */ +const getList = async () => { + loading.value = true; + const res = await proxy?.getConfigKey('sys.oss.previewListResource'); + previewListResource.value = res?.data === undefined ? true : res.data === 'true'; + const response = await listOss(proxy?.addDateRange(queryParams.value, dateRangeCreateTime.value, 'CreateTime')); + ossList.value = response.rows; + total.value = response.total; + loading.value = false; + showTable.value = true; +}; +function checkFileSuffix(fileSuffix: string[]) { + let arr = ['png', 'jpg', 'jpeg']; + return arr.some((type) => { + return fileSuffix.indexOf(type) > -1; + }); } +/** 鍙栨秷鎸夐挳 */ +function cancel() { + dialog.visible = false; + reset(); +} +/** 琛ㄥ崟閲嶇疆 */ +function reset() { + form.value = { ...initFormData }; + ossFormRef.value?.resetFields(); +} +/** 鎼滅储鎸夐挳鎿嶄綔 */ +function handleQuery() { + queryParams.value.pageNum = 1; + getList(); +} +/** 閲嶇疆鎸夐挳鎿嶄綔 */ +function resetQuery() { + showTable.value = false; + dateRangeCreateTime.value = ['', '']; + queryFormRef.value?.resetFields(); + queryParams.value.orderByColumn = defaultSort.value.prop; + queryParams.value.isAsc = defaultSort.value.order; + handleQuery(); +} +/** 閫夋嫨鏉℃暟 */ +function handleSelectionChange(selection: OssVO[]) { + ids.value = selection.map((item) => item.ossId); + single.value = selection.length != 1; + multiple.value = !selection.length; +} +/** 璁剧疆鍒楃殑鎺掑簭涓烘垜浠嚜瀹氫箟鐨勬帓搴� */ +const handleHeaderClass = ({ column }: any): any => { + column.order = column.multiOrder; +}; +/** 鐐瑰嚮琛ㄥご杩涜鎺掑簭 */ +const handleHeaderCLick = (column: any) => { + if (column.sortable !== 'custom') { + return; + } + switch (column.multiOrder) { + case 'descending': + column.multiOrder = 'ascending'; + break; + case 'ascending': + column.multiOrder = ''; + break; + default: + column.multiOrder = 'descending'; + break; + } + handleOrderChange(column.property, column.multiOrder); +}; +const handleOrderChange = (prop: string, order: string) => { + let orderByArr = queryParams.value.orderByColumn ? queryParams.value.orderByColumn.split(',') : []; + let isAscArr = queryParams.value.isAsc ? queryParams.value.isAsc.split(',') : []; + let propIndex = orderByArr.indexOf(prop); + if (propIndex !== -1) { + if (order) { + //鎺掑簭閲屽凡瀛樺湪 鍙慨鏀规帓搴� + isAscArr[propIndex] = order; + } else { + //濡傛灉order涓簄ull 鍒欏垹闄ゆ帓搴忓瓧娈靛拰灞炴�� + isAscArr.splice(propIndex, 1); //鍒犻櫎鎺掑簭 + orderByArr.splice(propIndex, 1); //鍒犻櫎灞炴�� + } + } else { + //鎺掑簭閲屼笉瀛樺湪鍒欐柊澧炴帓搴� + orderByArr.push(prop); + isAscArr.push(order); + } + //鍚堝苟鎺掑簭 + queryParams.value.orderByColumn = orderByArr.join(','); + queryParams.value.isAsc = isAscArr.join(','); + getList(); +}; +/** 浠诲姟鏃ュ織鍒楄〃鏌ヨ */ +/** 鏂囦欢鎸夐挳鎿嶄綔 */ +const handleFile = () => { + percentage2.value = 0; + reset(); + type.value = 0; + dialog.visible = true; + dialog.title = '涓婁紶鏂囦欢'; +}; +/** 鍥剧墖鎸夐挳鎿嶄綔 */ +const handleImage = () => { + reset(); + type.value = 1; + dialog.visible = true; + dialog.title = '涓婁紶鍥剧墖'; +}; +const handleVideo = () => { + reset(); + type.value = 2; + dialog.visible = true; + dialog.title = '涓婁紶瑙嗛'; +}; +/** 鎻愪氦鎸夐挳 */ + +const submitForm = async () => { + const number = await childFile.value.handleCilck(); + if (number > 0) { + dialog.visible = false; + dialogVisible.value = true; + state.mytime = setInterval(() => { + percentage2.value = (percentage2.value % 100) + 5; + }, 500); + } +}; +const lookPawsd = async (row: any) => { + console.log(row); + // row.msg = ':/"123456' + + clearInterval(state.mytime); + state.mytime = 0; + // if(row == '123123'){ + // dialogVisible.value = true; + // state.mytime = setInterval(() => { + // percentage2.value = (percentage2.value % 100) + 5 + // }, 500) + // } + // else{ + dialogVisible.value = false; + clearInterval(state.mytime); + state.mytime = 0; + testtxt.value = row.msg; + // testtxt.value = row.msg.slice(2); + titleDownload.value = '鏌ョ湅鎻愬彇鐮�'; + pasTxt.value = ''; + visibleCode.value = true; + // } +}; +const handleCode = async (row: OssVO) => { + console.log(row, row.ossId); + + await examineIds(row.ossId).then((res) => { + console.log(res); + if (res.code == 200) { + testtxt.value = res.msg; + titleDownload.value = '鏌ョ湅鎻愬彇鐮�'; + pasTxt.value = ''; + // inputSty.value ={ + // border: '1px solid blue' + // } + visibleCode.value = true; + } else { + const message = res.msg; + proxy?.$modal.msgSuccess(message); + } + }); +}; +/** 涓嬭浇鎸夐挳鎿嶄綔 */ +const handleDownload = (row: OssVO) => { + titleDownload.value = '杈撳叆鎻愬彇鐮�'; + pasTxt.value = ''; + inputSty.value = { + border: '1px solid blue', + borderRadius: '5px' + }; + visibleCode.value = true; + downIds.value = ref(row.ossId); + console.log(toRaw(downIds.value.value)); +}; +const delFile = async () => { + let oss = figType.value + '/' + pasTxt.value; + await delOss(oss).finally(() => (loading.value = false)); + await getList(); + proxy?.$modal.msgSuccess('鍒犻櫎鎴愬姛'); + visibleCode.value = false; +}; +const handleDownloadFile = () => { + console.log(downIds.value); + if (pasTxt.value) { + proxy?.$download.ossDown(downIds.value.value, pasTxt.value); + } else { + console.log(inputRef.value); + inputSty.value = { + border: '1px solid red' + }; + // inputRef.value.style.border = '1px solid red' + } + visibleCode.value = false; +}; +/** 鐢ㄦ埛鐘舵�佷慨鏀� */ +/** 鍒犻櫎鎸夐挳鎿嶄綔 */ +const handleDelete = async (row?: OssVO) => { + let ossIds = row?.ossId || ids.value; + titleDownload.value = '璇疯緭鍏ユ彁鍙栫爜'; + pasTxt.value = ''; + inputSty.value = { + border: '1px solid blue', + borderRadius: '5px' + }; + visibleCode.value = true; + figType.value = ossIds; + console.log(figType); + // await proxy?.$modal.confirm('鏄惁纭鍒犻櫎OSS瀵硅薄瀛樺偍缂栧彿涓�"' + ossIds + '"鐨勬暟鎹」?'); + // loading.value = true; + // ossIds = ossIds+'/'+pasTxt.value; + // await delOss(ossIds).finally(() => loading.value = false); + // await getList(); + // proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); +}; +const refreshPage = async () => { + const accessRoutes = await usePermissionStore().generateRoutes(); + console.log(accessRoutes, 'accessRoutes', router); + // 鏍规嵁roles鏉冮檺鐢熸垚鍙闂殑璺敱琛� + accessRoutes.forEach((route) => { + if (!isHttp(route.path)) { + router.addRoute(route); // 鍔ㄦ�佹坊鍔犲彲璁块棶璺敱琛� + } + }); + // location.reload(); +}; +const isContains = (arr: string | any[], value: any) => { + // return arr.includes(value); + return true; +}; + +const setAddUser = async (val: any | number | (string | number)[]) => { + console.log(val); + const res = await createUser(val); + console.log(res); + if (res.code == 200) { + const data = res.data; + setToken(data.access_token); + const [err] = await tos(useUserStore().getInfo()); + console.log('useUserStore', useUserStore, err); + await getList(); + + // await refreshPage() + + console.log('permissions', useUserStore().permissions, 'system:oss:upload'); + // token.value = data.access_token; + } +}; +// watch(() => value.value, (newValue) => { +// if (newValue) { +// showValue.value = true; +// } else { +// showValue.value = false; +// } +// }); +onBeforeMount(async () => { + console.log('绗竴', useUserStore().permissions); + // try { + // // 浣跨敤fetch API鑾峰彇褰撳墠IP鍦板潃 + // await fetch('https://api.ipify.org/?format=json') + // .then(response => response.json()) + // .then(async data => { + // currentIp.value = data.ip; + // let obj = { + // username: data.ip + // } + // await setAddUser(obj) + // }) + // .catch(error => { + // console.error('鑾峰彇IP鍦板潃澶辫触锛�', error); + // }); + // } catch (error) { + // console.log(error); + // } +}); +onMounted(async () => { + console.log('绗簩aaaaaaa', useUserStore().permissions); + // 绛夊緟 useUserStore() 鏂规硶鐨� getInfo() 鏂规硶杩斿洖缁撴灉骞惰祴鍊肩粰 err 鍙橀噺 + // const [err] = await tos(useUserStore().getInfo()); + if (getToken()) { + console.log('鏈塼oken'); + await getList(); + } else { + console.log('鏃爐oken'); + + router.push('/login'); + } + // 璋冪敤 getList() 鏂规硶 +}); </script> - -<style scoped lang="scss"> -.home { - blockquote { - padding: 10px 20px; - margin: 0 0 20px; - font-size: 17.5px; - border-left: 5px solid #eee; - } - hr { - margin-top: 20px; - margin-bottom: 20px; - border: 0; - border-top: 1px solid #eee; - } - .col-item { - margin-bottom: 20px; - } - - ul { - padding: 0; - margin: 0; - } - - font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - color: #676a6c; - overflow-x: hidden; - - ul { - list-style-type: none; - } - - h4 { - margin-top: 0px; - } - - h2 { - margin-top: 10px; - font-size: 26px; - font-weight: 100; - } - - p { - margin-top: 10px; - - b { - font-weight: 700; - } - } - - .update-log { - ol { - display: block; - list-style-type: decimal; - margin-block-start: 1em; - margin-block-end: 1em; - margin-inline-start: 0; - margin-inline-end: 0; - padding-inline-start: 40px; - } - } -} -</style> -- Gitblit v1.8.0