Explorar o código

perfect_控件基础—_add_router_token

ananzhusen hai 1 ano
pai
achega
a8be369b5d
Modificáronse 3 ficheiros con 53 adicións e 9 borrados
  1. 38 9
      src/services/defaults.ts
  2. 3 0
      src/views/components/PenProps.vue
  3. 12 0
      src/views/components/View.vue

+ 38 - 9
src/services/defaults.ts

@@ -1013,12 +1013,12 @@ export const formComponents = [
       },
       {
         name: '图标',
-        icon: 'l-share',
+        icon: 'l-tubiao',
         data: {
           width: 100,
           height: 100,
           name: 'image',
-          icon: '\ue8c6',
+          icon: '\uea35',
           iconFamily: 'l-icon',
         },
       },
@@ -1039,7 +1039,7 @@ export const formComponents = [
           width: 100,
           height: 100,
           name: 'gif',
-          image: cdn + '/img/logo.png',
+          image: cdn + '/png/电信机房/防火墙.gif',
         },
       },
       {
@@ -1069,24 +1069,53 @@ export const formComponents = [
         name: '头像',
         icon: 'l-pc',
         data: {
-          width: 200,
-          height: 200,
+          width: 30,
+          height: 30,
+          disableAnchor: true,
+          name: 'square',
+          lineWidth: 0,
+          image: '/img/avatar.png',
+          imageRadius: 0.5,
+          background: '#689f38',
+          borderRadius: 0.5,
+          ratio: true,
         },
       },
       {
         name: '徽标',
         icon: 'l-pc',
         data: {
-          width: 200,
-          height: 200,
+          width: 35,
+          height: 20,
+          name: 'square',
+          borderRadius: 0.5,
+          lineWidth: 0,
+          background: '#d54941',
+          color: '#fff',
+          text: '99+',
         },
       },
       {
         name: '标签',
         icon: 'l-pc',
         data: {
-          width: 200,
-          height: 200,
+          text: 'success',
+          width: 80,
+          height: 24,
+          borderRadius: 0.1,
+          name: 'rectangle',
+          lineWidth: 1,
+          fontSize: 12,
+          icon: '\uea10',
+          iconFamily: 'l-icon',
+          iconColor: '#52c41a',
+          iconSize: 12,
+          iconAlign: 'left',
+          iconLeft: 8,
+          textAlign: 'right',
+          color: '#52c41a',
+          background: '#f6ffed',
+          textLeft: -6,
         },
       },
     ],

+ 3 - 0
src/views/components/PenProps.vue

@@ -1048,6 +1048,9 @@ onBeforeMount(() => {
   if (!d.groups) {
     d.groups = [];
   }
+  if (!d.iconUrls) {
+    d.iconUrls = [];
+  }
   data.iconUrls = d.iconUrls;
   data.groups = d.groups;
   initPenData();

+ 12 - 0
src/views/components/View.vue

@@ -750,6 +750,7 @@ import CodeEditor from './common/CodeEditor.vue';
 import ContextMenu from './ContextMenu.vue';
 import Network from './Network.vue';
 import ChargeCloudPublish from './ChargeCloudPublish.vue';
+import { setCookie } from '@/services/cookie';
 
 const router = useRouter();
 const route = useRoute();
@@ -822,6 +823,17 @@ const watcher = watch(
 );
 
 const open = async (flag: boolean = false) => {
+  if (route.query.token) {
+    localStorage.setItem('token', route.query.token + '');
+    setCookie('token', route.query.token + '');
+    const newQuery = { ...route.query };
+    delete newQuery.token;
+    router.replace({
+      path: '/',
+      query: newQuery,
+    });
+    return;
+  }
   if (route.query.id) {
     let ret: any;
     if (route.query.c) {