threethousanddream il y a 4 mois
Parent
commit
0fae9af295

+ 0 - 12
src/App.vue

@@ -6,15 +6,12 @@
 
 <script setup name="app">
 import {
-  defineAsyncComponent,
   computed,
   ref,
-  onBeforeMount,
   onMounted,
   onUnmounted,
   nextTick,
   watch,
-  provide
 } from 'vue';
 import {useRoute} from 'vue-router';
 import {useI18n} from 'vue-i18n';
@@ -24,7 +21,6 @@ import {useThemeConfig} from '/@/stores/themeConfig';
 import other from '/@/utils/other';
 import {Local, Session} from '/@/utils/storage';
 import mittBus from '/@/utils/mitt';
-import mgmtHelper from "mgmt-helper";
 // 定义变量内容
 const {messages, locale} = useI18n();
 const setingsRef = ref();
@@ -41,14 +37,6 @@ const getGlobalComponentSize = computed(() => {
 const getGlobalI18n = computed(() => {
   return messages.value[locale.value];
 });
-
-// 设置初始化,防止刷新时恢复默认
-// onBeforeMount(() => {
-// 	// 设置批量第三方 icon 图标
-// 	setIntroduction.cssCdn();
-// 	// 设置批量第三方 js
-// 	setIntroduction.jsCdn();
-// });
 // 页面加载时
 onMounted(() => {
   nextTick(() => {

+ 0 - 151
src/components/switch/switch.css

@@ -1,151 +0,0 @@
-:root{
-  --transition:all .2s;
-}
-.cpt-switch{
-  box-sizing: border-box;
-  margin: 0;
-  padding: 0;
-  color: rgba(0, 0, 0, 0.88);
-  font-size: 14px;
-  line-height: 22px;
-  list-style: none;
-  position: relative;
-  display: inline-block;
-  min-width: 44px;
-  height: 22px;
-  vertical-align: middle;
-  background: rgba(0, 0, 0, 0.25);
-  border: 0;
-  border-radius: 100px;
-  cursor: pointer;
-  transition: var(--transition);
-  user-select: none;
-  /* outline: #f00; */
-}
-
-.cpt-switch-small{
-  width: 28px !important;
-  height: 16px !important;
-}
-.cpt-switch .inner{
-  display: block;
-  overflow: hidden;
-  white-space: nowrap;
-  height: 100%;
-  padding-inline-start: 24px;
-  padding-inline-end: 9px;
-  border-radius: 100px;
-  font-size: 12px;
-  color: #fff;
-  transition: var(--transition);
-}
-.cpt-switch .inner span{
-  display: block;
-  transition: var(--transition);
-}
-.cpt-switch .handle{
-  position: absolute;
-  top: 2px;
-  inset-inline-start: 2px;
-  width: 18px;
-  transition:var(--transition);
-  height: 18px;
-}
-.cpt-switch .handle:before{
-  position: absolute;
-  top: 0;
-  inset-inline-end: 0;
-  bottom: 0;
-  inset-inline-start: 0;
-  background-color: #fff;
-  border-radius: 9px;
-  box-shadow: 0 2px 4px 0 rgba(0, 35, 11, 0.2);
-  content: "";
-
-}
-.cpt-switch .inner span:first-of-type{
-  margin-inline-start: calc(-100% + 22px - 48px);
-  margin-inline-end: calc(100% - 22px + 48px);
-}
-.cpt-switch .inner span:last-of-type{
-  margin-inline-start: 0;
-  margin-inline-end: 0;
-  margin-top: -22px;
-}
-.cpt-switch:active .handle{
-  width: 23px;
-}
-.cpt-switch:active .inner span:last-of-type{
-  margin-inline-end: -3px;
-  margin-inline-start: 3px;
-}
-
-.cpt-switch-checked{
-  background-color: #eb5a10;
-}
-.cpt-switch-checked .handle{
-  inset-inline-start: calc(100% - 20px);
-}
-.cpt-switch-checked:active .handle{
-  inset-inline-start: calc(100% - 23px - 2px);
-}
-
-.cpt-switch-checked .inner {
-  padding-inline-start: 9px ;
-  padding-inline-end: 24px ;
-  display: block;
-}
-
-.cpt-switch-checked .inner span:first-of-type{
-  margin-inline-start: 0;
-  margin-inline-end: 0;
-}
-.cpt-switch-checked .inner span:last-of-type{
-  margin-inline-start: calc(100% - 22px + 48px);
-  margin-inline-end: calc(-100% + 22px - 48px);
-}
-.cpt-switch-checked:active .inner span:first-of-type{
-  margin-inline-end: 3px;
-  margin-inline-start: -3px;
-}
-.cpt-switch-checked:active .inner span:last-of-type{
-  margin-inline-start: calc(100% - 22px + 48px);
-  margin-inline-end: calc(-100% + 22px - 48px);
-}
-
-.cpt-switch-disabled{
-  cursor: not-allowed;
-  opacity: 0.5;
-}
-.cpt-switch-loading{
-  pointer-events: none;
-  position: absolute;
-  width: 18px;
-  height: 18px;
-  left: -1px;
-  top: -1px;
-  z-index: 10;
-  cursor: no-drop;
-}
-.cpt-switch-loading::after{
-  position: absolute;
-  content: '';
-  width: calc(18px - 4px);
-  height: calc(18px - 4px);
-  right: 2px;
-  top: 2px;
-  border: 1px solid #000;
-  border-top: transparent;
-  border-right: transparent;
-  border-bottom: transparent;
-  border-radius: 50%;
-  animation: cpt-switch-loading 1s infinite linear;
-}
-@keyframes cpt-switch-loading {
-  0%{
-    transform: rotate(360deg);
-  }
-  100%{
-    transform: rotate(0deg);
-  }
-}

+ 164 - 20
src/components/switch/switch.vue

@@ -21,47 +21,47 @@
   </button>
 </template>
 <script lang="ts">
-import {defineComponent, ref,watch,onMounted} from 'vue';
+import {defineComponent, ref, watch, onMounted} from 'vue';
 import {SwitchProps} from "./attribute.ts";
 export default defineComponent({
-  name:"CptSwitch",
-  props:SwitchProps,
-  emits:['update:modelValue'],
-  setup(props,{emit:e}){
+  name: "CptSwitch",
+  props: SwitchProps,
+  emits: ['update:modelValue'],
+  setup(props, {emit: e}) {
     const switchs = ref();
 
     const click = () => {
-      if(props.loading) return;
-      if(!props.modelValue){
-        e('update:modelValue',true)
-      }else{
-        e('update:modelValue',false)
+      if (props.loading) return;
+      if (!props.modelValue) {
+        e('update:modelValue', true)
+      } else {
+        e('update:modelValue', false)
       }
     }
-    const initSwitch = (val:boolean) => {
+    const initSwitch = (val: boolean) => {
       val ? switchs.value.classList.add("cpt-switch-checked") : switchs.value.classList.remove("cpt-switch-checked");
     }
-    const switchLoading = (val:boolean) => {
-      if(val){
+    const switchLoading = (val: boolean) => {
+      if (val) {
         switchs.value.classList.add("cpt-switch-disabled");
         switchs.value.children[0].classList.add("cpt-switch-loading");
-      }else{
+      } else {
         switchs.value.classList.remove("cpt-switch-disabled");
         switchs.value.children[0].classList.remove("cpt-switch-loading");
       }
     }
     onMounted(() => {
       initSwitch(props.modelValue);
-      if(!props.disabled){
+      if (!props.disabled) {
         switchLoading(props.loading);
       }
     })
-    watch(() => props.modelValue,(newV) => {
-      if(!props.loading){
+    watch(() => props.modelValue, (newV) => {
+      if (!props.loading) {
         initSwitch(newV)
       }
     })
-    watch(() => props.loading,(newV) => {
+    watch(() => props.loading, (newV) => {
       switchLoading(newV)
     })
 
@@ -73,6 +73,150 @@ export default defineComponent({
   }
 })
 </script>
-<style>
-@import url("./switch.css");
+<style lang="css" scoped>
+:root {
+  --transition: all .2s;
+}
+.cpt-switch {
+  box-sizing: border-box;
+  margin: 0;
+  padding: 0;
+  color: rgba(0, 0, 0, 0.88);
+  font-size: 14px;
+  line-height: 22px;
+  list-style: none;
+  position: relative;
+  display: inline-block;
+  min-width: 44px;
+  height: 22px;
+  vertical-align: middle;
+  background: rgba(0, 0, 0, 0.25);
+  border: 0;
+  border-radius: 100px;
+  cursor: pointer;
+  transition: var(--transition);
+  user-select: none;
+  /* outline: #f00; */
+}
+.cpt-switch-small {
+  width: 28px !important;
+  height: 16px !important;
+}
+.cpt-switch .inner {
+  display: block;
+  overflow: hidden;
+  white-space: nowrap;
+  height: 100%;
+  padding-inline-start: 24px;
+  padding-inline-end: 9px;
+  border-radius: 100px;
+  font-size: 12px;
+  color: #fff;
+  transition: var(--transition);
+}
+.cpt-switch .inner span {
+  display: block;
+  transition: var(--transition);
+}
+.cpt-switch .handle {
+  position: absolute;
+  top: 2px;
+  inset-inline-start: 2px;
+  width: 18px;
+  transition: var(--transition);
+  height: 18px;
+}
+.cpt-switch .handle:before {
+  position: absolute;
+  top: 0;
+  inset-inline-end: 0;
+  bottom: 0;
+  inset-inline-start: 0;
+  background-color: #fff;
+  border-radius: 9px;
+  box-shadow: 0 2px 4px 0 rgba(0, 35, 11, 0.2);
+  content: "";
+}
+.cpt-switch .inner span:first-of-type {
+  margin-inline-start: calc(-100% + 22px - 48px);
+  margin-inline-end: calc(100% - 22px + 48px);
+}
+.cpt-switch .inner span:last-of-type {
+  margin-inline-start: 0;
+  margin-inline-end: 0;
+  margin-top: -22px;
+}
+.cpt-switch:active .handle {
+  width: 23px;
+}
+.cpt-switch:active .inner span:last-of-type {
+  margin-inline-end: -3px;
+  margin-inline-start: 3px;
+}
+.cpt-switch-checked {
+  background-color: #eb5a10;
+}
+.cpt-switch-checked .handle {
+  inset-inline-start: calc(100% - 20px);
+}
+.cpt-switch-checked:active .handle {
+  inset-inline-start: calc(100% - 23px - 2px);
+}
+.cpt-switch-checked .inner {
+  padding-inline-start: 9px;
+  padding-inline-end: 24px;
+  display: block;
+}
+.cpt-switch-checked .inner span:first-of-type {
+  margin-inline-start: 0;
+  margin-inline-end: 0;
+}
+.cpt-switch-checked .inner span:last-of-type {
+  margin-inline-start: calc(100% - 22px + 48px);
+  margin-inline-end: calc(-100% + 22px - 48px);
+}
+.cpt-switch-checked:active .inner span:first-of-type {
+  margin-inline-end: 3px;
+  margin-inline-start: -3px;
+}
+.cpt-switch-checked:active .inner span:last-of-type {
+  margin-inline-start: calc(100% - 22px + 48px);
+  margin-inline-end: calc(-100% + 22px - 48px);
+}
+.cpt-switch-disabled {
+  cursor: not-allowed;
+  opacity: 0.5;
+}
+.cpt-switch-loading {
+  pointer-events: none;
+  position: absolute;
+  width: 18px;
+  height: 18px;
+  left: -1px;
+  top: -1px;
+  z-index: 10;
+  cursor: no-drop;
+}
+.cpt-switch-loading::after {
+  position: absolute;
+  content: '';
+  width: calc(18px - 4px);
+  height: calc(18px - 4px);
+  right: 2px;
+  top: 2px;
+  border: 1px solid #000;
+  border-top: transparent;
+  border-right: transparent;
+  border-bottom: transparent;
+  border-radius: 50%;
+  animation: cpt-switch-loading 1s infinite linear;
+}
+@keyframes cpt-switch-loading {
+  0% {
+    transform: rotate(360deg);
+  }
+  100% {
+    transform: rotate(0deg);
+  }
+}
 </style>

+ 1 - 20
src/layouts/index.vue

@@ -15,35 +15,16 @@
   </div>
 </template>
 <script setup lang="ts" name="layout">
-import {reactive, computed} from 'vue';
+import {computed} from 'vue';
 import {useRoute} from "vue-router";
-import {useThemeConfig} from "/@/stores/themeConfig";
-import {storeToRefs} from "pinia";
 const route = useRoute();
-const storesThemeConfig = useThemeConfig();
-const {themeConfig} = storeToRefs(storesThemeConfig);
-const state = reactive<ParentViewState>({
-  refreshRouterViewKey: "", // 非 iframe tagsview 右键菜单刷新时
-  iframeRefreshKey: "", // iframe tagsview 右键菜单刷新时
-  keepAliveNameList: [],
-  iframeList: [],
-});
-// 设置 iframe 显示/隐藏
-const isIframePage = computed(() => {
-  return route.meta.isIframe;
-});
 const cachedPages = computed(() => {
   const tagsViewStore = window.__routesCache__.tagsViewStore;
-  // || useTagsViewStore();
   return tagsViewStore?.cachedViews || [];
 });
 const simplekey = computed(() => {
   return route.path;
 });
-// 设置主界面切换动画
-const setTransitionName = computed(() => {
-  return themeConfig.value.animation;
-});
 </script>
 <style lang="scss">
 @import "./layout.scss";

+ 5 - 73
src/views/backup/list.vue

@@ -57,11 +57,6 @@
         </el-table-column>
         <el-table-column label="操作" width="120px">
           <template v-slot="scope">
-            <!--            <el-button size="small" type="text" @click="recoverBackups(scope.row.id)"-->
-            <!--                       v-auth="'1823265205765976073'">-->
-            <!--              恢复-->
-            <!--            </el-button>-->
-            <!--            <span class="btn-split" v-auth="'1823265230537535511'">|</span>-->
             <el-button size="small" type="text" @click="downloadBackups(scope.row)"
                        v-auth="'1823265230537535511'">
               下载
@@ -163,10 +158,6 @@
         </el-table-column>
         <el-table-column label="操作" width="120px">
           <template v-slot="scope">
-            <!--            <el-button size="small" type="success" :icon="Refresh" plain @click="executeSql(scope.row.id)"-->
-            <!--                       v-auth="'1823265160173891607'">-->
-            <!--              执行sql-->
-            <!--            </el-button>-->
             <el-button size="small" type="text" @click="downloadBackups(scope.row)"
                        v-auth="'1823265181954912325'">
               下载
@@ -195,10 +186,10 @@
   </div>
 </template>
 <script setup name="pageBackup">
-import {onMounted, ref} from 'vue';
-import {backupsList, backups, sqlList, recover, download, upload} from '@/api/backup';
-import {ElLoading, ElMessage, ElMessageBox} from 'element-plus'
-import {Download, Refresh, Search} from "@element-plus/icons-vue";
+import {onMounted} from 'vue';
+import {backupsList, backups, sqlList, upload} from '@/api/backup';
+import {ElLoading, ElMessage,} from 'element-plus'
+import {Search} from "@element-plus/icons-vue";
 const setting = reactive({
   sqlData: [],
   date: [],
@@ -314,38 +305,6 @@ const handBackups = () => {
   })
 
 };
-// 恢复备份
-const recoverBackups = (id) => {
-  ElMessageBox.confirm('此操作将还原数据库, 是否继续?', '提示', {
-    confirmButtonText: '确定',
-    cancelButtonText: '取消',
-    type: 'warning'
-  }).then(() => {
-    ElMessageBox.confirm('此操作将还原数据库', '请再次确认', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-      type: 'warning'
-    }).then(() => {
-      const loading = ElLoading.service({
-        lock: true,
-        text: '数据恢复中...',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)',
-      });
-      recover({id: id}).then(res => {
-        loading.close();
-        if (res.code == 200) {
-          ElMessage.success('恢复成功');
-        }
-      }).catch(err => {
-        loading.close();
-        ElMessage.error('恢复失败');
-      })
-    }).catch(() => {
-    });
-  }).catch(() => {
-  });
-}
 // 下载备份
 const downloadBackups = (row) => {
   let {filePath, remarks} = row
@@ -358,33 +317,6 @@ const downloadBackups = (row) => {
   document.body.removeChild(a);
   ElMessage({type: 'success', message: '已开始下载'})
 }
-// 文件上传
-const fileUploadClick = () => {
-  setting.fileShow = true
-  const fileForm = {...setting.sqlForm}
-  // 获取备份列表
-  fileForm.dataSource = 1
-  fileForm.size = 999999
-  fileForm.current = 1
-  backupsList(fileForm).then(res => {
-    setting.fileData = res.data.records || [];
-  })
-}
-// 执行sql executeSql
-const executeSql = (id) => {
-  setting.innerVisible = true
-  const loading = setInterval(() => {
-    if (setting.progressNum < 99) {
-      setting.progressNum += 1
-    }
-  }, 500)
-  recover({id: id}).then(res => {
-    ElMessage.success('执行成功');
-    setting.innerVisible = false
-  }).finally(() => {
-    clearInterval(loading)
-  })
-}
 const handleSelectionChange = (val) => {
   setting.backupsForm.tableNames = val.map(item => item.tableName).join(',')
 }
@@ -451,7 +383,7 @@ const uploadFile = () => {
   })
 }
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .backup-upload-dialog {
   .el-upload-list {
     display: none;

+ 1 - 1
src/views/charts/customCharts.vue

@@ -269,7 +269,7 @@ import "codemirror/addon/display/placeholder.js";
 import "codemirror/mode/javascript/javascript.js";
 import "codemirror/theme/idea.css";
 import Switch from "@/components/switch/switch.vue";
-import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
+import {ElMessage, ElMessageBox} from "element-plus";
 import {searchTenantByIds} from "@/api/system";
 import {hasAuth} from "/@/utils/auth";
 import UserSelect from "@/components/UserSelect";

+ 1 - 1
src/views/charts/systemCharts.vue

@@ -119,7 +119,7 @@ const chartStore = useChartStore()
 const page = reactive({total: 0, size: 10, current: 1})
 const params = reactive({name: '', categoryId: '', status: ''})
 import {hasAuth} from '@/utils/auth'
-import {ElMessage} from "element-plus";
+import {ElMessage, ElMessageBox} from "element-plus";
 const state = reactive({
   list: [],
   showEdit: false,

+ 1 - 1
src/views/ctrl/analyse.vue

@@ -240,7 +240,7 @@ const apiCurrentChange = current => {
   getApiData()
 }
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .page-ctrl-analyse {
   .top, .bottom {
     height: calc((100% - 20px) / 2);

+ 0 - 1
src/views/ctrl/ds.vue

@@ -73,7 +73,6 @@ import * as echarts from "echarts";
 import {ElMessage} from "element-plus";
 import UserSelect from "/@/components/UserSelect/index.vue";
 import router from '/@/router'
-import {dsTableExport} from "@/api/ctrl";
 import {objectToParam} from "/@/utils";
 let dataLoading = ref(false)
 const params = reactive({

+ 1 - 3
src/views/ctrl/visit.vue

@@ -63,11 +63,9 @@ import moment from "moment";
 import * as api from "@/api/statistics";
 import {visitTop} from '@/api/ctrl'
 import * as echarts from "echarts";
-import {exportExcel, objectToParam} from "@/utils";
-import * as XLSX from 'xlsx';
+import {objectToParam} from "@/utils";
 import {ElMessage} from "element-plus";
 import TenantSelect from "/@/components/TenantSelect/index.vue";
-import {visualLine, visualTable} from "@/api/statistics";
 let dataLoading = ref(false)
 const params = reactive({
   date: [],

+ 1 - 2
src/views/statistics/chart.vue

@@ -69,8 +69,7 @@
 import moment from "moment";
 import * as api from "@/api/statistics";
 import * as echarts from "echarts";
-import * as XLSX from 'xlsx';
-import {exportExcel, objectToParam} from '@/utils'
+import {objectToParam} from '@/utils'
 import {ElMessage} from "element-plus";
 import TenantSelect from "/@/components/TenantSelect/index.vue";
 let dataLoading = ref(false)

+ 1 - 2
src/views/statistics/chartTemp.vue

@@ -62,8 +62,7 @@
 import moment from "moment";
 import * as api from "@/api/statistics";
 import * as echarts from "echarts";
-import {exportExcel, objectToParam} from "@/utils";
-import * as XLSX from 'xlsx';
+import { objectToParam} from "@/utils";
 import {ElMessage} from "element-plus";
 import TenantSelect from "/@/components/TenantSelect/index.vue";
 import useTempStore from "/@/stores/modules/temp";

+ 1 - 2
src/views/statistics/temp.vue

@@ -68,8 +68,7 @@
 import moment from "moment";
 import * as api from "@/api/statistics";
 import * as echarts from "echarts";
-import {copyContent, exportExcel, objectToParam} from "@/utils";
-import * as XLSX from 'xlsx';
+import {copyContent, objectToParam} from "@/utils";
 import {ElMessage} from "element-plus";
 import TenantSelect from "/@/components/TenantSelect/index.vue";
 let dataLoading = ref(false)

+ 1 - 2
src/views/statistics/visual.vue

@@ -68,8 +68,7 @@
 import moment from "moment";
 import * as api from "@/api/statistics";
 import * as echarts from "echarts";
-import {exportExcel, objectToParam} from "@/utils";
-import * as XLSX from 'xlsx';
+import {objectToParam} from "@/utils";
 import {ElMessage} from "element-plus";
 import TenantSelect from "/@/components/TenantSelect/index.vue";
 import {copyContent} from '@/utils'

+ 0 - 6
src/views/visual/reportList.vue

@@ -62,12 +62,6 @@
               </template>
             </template>
           </el-table-column>
-          <!--          <el-table-column label="备注" show-overflow-tooltip>-->
-          <!--            <template v-slot="{row}">-->
-          <!--              <span v-if="row.status===0">{{ row.disableReason || '-'  }}</span>-->
-          <!--              <span v-else>{{ row.disableReason || '-' }}</span>-->
-          <!--            </template>-->
-          <!--          </el-table-column>-->
           <el-table-column label="审核状态" width="90px">
             <template v-slot="{row}">
               <div class="status-box" v-if="row.reviewStatus===0">

+ 0 - 6
src/views/visual/visualList.vue

@@ -62,12 +62,6 @@
               </template>
             </template>
           </el-table-column>
-          <!--          <el-table-column label="备注" show-overflow-tooltip>-->
-          <!--            <template v-slot="{row}">-->
-          <!--              <span v-if="row.status===0">{{ row.disableReason || '-'  }}</span>-->
-          <!--              <span v-else>{{ row.disableReason || '-' }}</span>-->
-          <!--            </template>-->
-          <!--          </el-table-column>-->
           <el-table-column label="审核状态" width="90px">
             <template v-slot="{row}">
               <div class="status-box" v-if="row.reviewStatus===0">