Selaa lähdekoodia

perf: standard code format

xiaoxian521 2 vuotta sitten
vanhempi
commit
1cf82eb7a4

+ 1 - 0
src/components/ReBarcode/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import reBarcode from "./src/index.vue";
 
+/** 条形码组件 */
 export const ReBarcode = Object.assign(reBarcode, {
   install(app: App) {
     app.component(reBarcode.name, reBarcode);

+ 0 - 10
src/components/ReCard/index.ts

@@ -1,10 +0,0 @@
-import { App } from "vue";
-import reCard from "./src/index.vue";
-
-export const ReCard = Object.assign(reCard, {
-  install(app: App) {
-    app.component(reCard.name, reCard);
-  }
-});
-
-export default ReCard;

+ 0 - 36
src/components/ReCharts/index.ts

@@ -1,36 +0,0 @@
-import { App } from "vue";
-import reBar from "./src/Bar.vue";
-import reGithub from "./src/Github.vue";
-import reInfinite from "./src/Infinite.vue";
-import reLine from "./src/Line.vue";
-import rePie from "./src/Pie.vue";
-
-export const ReBar = Object.assign(reBar, {
-  install(app: App) {
-    app.component(reBar.name, reBar);
-  }
-});
-
-export const ReGithub = Object.assign(reGithub, {
-  install(app: App) {
-    app.component(reGithub.name, reGithub);
-  }
-});
-
-export const ReInfinite = Object.assign(reInfinite, {
-  install(app: App) {
-    app.component(reInfinite.name, reInfinite);
-  }
-});
-
-export const ReLine = Object.assign(reLine, {
-  install(app: App) {
-    app.component(reLine.name, reLine);
-  }
-});
-
-export const RePie = Object.assign(rePie, {
-  install(app: App) {
-    app.component(rePie.name, rePie);
-  }
-});

+ 6 - 2
src/components/ReCountTo/index.ts

@@ -2,14 +2,18 @@ import { App } from "vue";
 import reNormalCountTo from "./src/normal";
 import reboundCountTo from "./src/rebound";
 
-export const ReNormalCountTo = Object.assign(reNormalCountTo, {
+/** 普通数字动画组件 */
+const ReNormalCountTo = Object.assign(reNormalCountTo, {
   install(app: App) {
     app.component(reNormalCountTo.name, reNormalCountTo);
   }
 });
 
-export const ReboundCountTo = Object.assign(reboundCountTo, {
+/** 回弹式数字动画组件 */
+const ReboundCountTo = Object.assign(reboundCountTo, {
   install(app: App) {
     app.component(reboundCountTo.name, reboundCountTo);
   }
 });
+
+export { ReNormalCountTo, ReboundCountTo };

+ 1 - 0
src/components/ReCropper/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import reCropper from "./src";
 
+/** 图片裁剪组件 */
 export const ReCropper = Object.assign(reCropper, {
   install(app: App) {
     app.component(reCropper.name, reCropper);

+ 1 - 0
src/components/ReFlop/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import reFlop from "./src/index.vue";
 
+/** 时间翻牌组件 */
 export const ReFlop = Object.assign(reFlop, {
   install(app: App) {
     app.component(reFlop.name, reFlop);

+ 1 - 1
src/components/ReFlop/src/index.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { ref, unref, nextTick, onUnmounted } from "vue";
 import { templateRef } from "@vueuse/core";
-import flippers from "./Filpper";
+import flippers from "./filpper";
 
 let timer = ref(null);
 let flipObjs = ref([]);

+ 10 - 3
src/components/ReFlowChart/index.ts

@@ -3,20 +3,27 @@ import control from "./src/Control.vue";
 import nodePanel from "./src/NodePanel.vue";
 import dataDialog from "./src/DataDialog.vue";
 
-export const Control = Object.assign(control, {
+/** LogicFlow流程图-控制面板 */
+const Control = Object.assign(control, {
   install(app: App) {
     app.component(control.name, control);
   }
 });
 
-export const NodePanel = Object.assign(nodePanel, {
+/** LogicFlow流程图-拖拽面板 */
+const NodePanel = Object.assign(nodePanel, {
   install(app: App) {
     app.component(nodePanel.name, nodePanel);
   }
 });
 
-export const DataDialog = Object.assign(dataDialog, {
+/** LogicFlow流程图-查看数据 */
+const DataDialog = Object.assign(dataDialog, {
   install(app: App) {
     app.component(dataDialog.name, dataDialog);
   }
 });
+
+export { Control, NodePanel, DataDialog };
+
+// LogicFlow流程图文档:http://logic-flow.org/

+ 10 - 11
src/components/ReIcon/index.ts

@@ -1,16 +1,15 @@
 import iconifyIconOffline from "./src/iconifyIconOffline";
 import iconifyIconOnline from "./src/iconifyIconOnline";
+import iconSelect from "./src/Select.vue";
 import fontIcon from "./src/iconfont";
-import iconSelect from "./src/select.vue";
 
-export const IconifyIconOffline = iconifyIconOffline;
-export const IconifyIconOnline = iconifyIconOnline;
-export const FontIcon = fontIcon;
-export const IconSelect = iconSelect;
+/** 离线图标组件 */
+const IconifyIconOffline = iconifyIconOffline;
+/** 在线图标组件 */
+const IconifyIconOnline = iconifyIconOnline;
+/** 图标选择器组件 */
+const IconSelect = iconSelect;
+/** iconfont组件 */
+const FontIcon = fontIcon;
 
-export default {
-  IconifyIconOffline,
-  IconifyIconOnline,
-  FontIcon,
-  IconSelect
-};
+export { IconifyIconOffline, IconifyIconOnline, IconSelect, FontIcon };

+ 2 - 3
src/components/ReImageVerify/index.ts

@@ -1,12 +1,11 @@
 import { App } from "vue";
 import reImageVerify from "./src/index.vue";
 
+/** 图形验证码组件 */
 export const ReImageVerify = Object.assign(reImageVerify, {
   install(app: App) {
     app.component(reImageVerify.name, reImageVerify);
   }
 });
 
-export default {
-  ReImageVerify
-};
+export default ReImageVerify;

+ 2 - 3
src/components/ReMap/index.ts

@@ -1,12 +1,11 @@
 import { App } from "vue";
 import amap from "./src/Amap.vue";
 
+/** 高德地图组件 */
 export const Amap = Object.assign(amap, {
   install(app: App) {
     app.component(amap.name, amap);
   }
 });
 
-export default {
-  Amap
-};
+export default Amap;

+ 2 - 2
src/components/ReMap/src/Amap.vue

@@ -1,8 +1,8 @@
 <script setup lang="ts">
-import AMapLoader from "@amap/amap-jsapi-loader";
 import { reactive, getCurrentInstance, onBeforeMount, onUnmounted } from "vue";
-import { mapJson } from "/@/api/mock";
 import { deviceDetection } from "/@/utils/deviceDetection";
+import AMapLoader from "@amap/amap-jsapi-loader";
+import { mapJson } from "/@/api/mock";
 import car from "/@/assets/car.png";
 
 export interface MapConfigureInter {

+ 1 - 0
src/components/ReQrcode/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import reQrcode from "./src/index";
 
+/** 二维码组件 */
 export const ReQrcode = Object.assign(reQrcode, {
   install(app: App) {
     app.component(reQrcode.name, reQrcode);

+ 1 - 0
src/components/ReSeamlessScroll/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import reSeamlessScroll from "./src/index.vue";
 
+/** 无缝滚动组件 */
 export const ReSeamlessScroll = Object.assign(reSeamlessScroll, {
   install(app: App) {
     app.component(reSeamlessScroll.name, reSeamlessScroll);

+ 1 - 0
src/components/ReSelector/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import reSelector from "./src";
 
+/** 选择器组件 */
 export const ReSelector = Object.assign(reSelector, {
   install(app: App) {
     app.component(reSelector.name, reSelector);

+ 1 - 0
src/components/ReSplitPane/index.tsx

@@ -8,6 +8,7 @@ export interface ContextProps {
   split: string;
 }
 
+/** 切割面板组件 */
 export default defineComponent({
   name: "splitPane",
   components: { resizer },

+ 1 - 0
src/components/ReTable/index.ts

@@ -1,6 +1,7 @@
 import { App } from "vue";
 import epTableProBar from "./src/bar";
 
+/** table-crud组件 */
 export const EpTableProBar = Object.assign(epTableProBar, {
   install(app: App) {
     app.component(epTableProBar.name, epTableProBar);

+ 1 - 0
src/components/ReTreeLine/index.ts

@@ -9,6 +9,7 @@ import type {
   TreeNodeData
 } from "element-plus/es/components/tree-v2/src/types";
 
+/** 树形连接线组件 */
 export default defineComponent({
   name: "el-tree-line",
   props: {

+ 1 - 1
src/router/modules/home.ts

@@ -15,7 +15,7 @@ const homeRouter = {
     {
       path: "/welcome",
       name: "welcome",
-      component: () => import("/@/views/welcome.vue"),
+      component: () => import("/@/views/welcome/index.vue"),
       meta: {
         title: $t("menus.hshome")
       }

+ 1 - 1
src/views/able/print.vue

@@ -2,7 +2,7 @@
 import Print from "/@/utils/print";
 import { reactive, ref } from "vue";
 import { VxeTablePropTypes } from "vxe-table";
-import { ReLine } from "/@/components/ReCharts/index";
+import { ReLine } from "../welcome/components";
 
 interface User {
   date: string;

+ 0 - 0
src/components/ReCard/src/index.vue → src/views/list/card/components/Card.vue


+ 2 - 2
src/views/list/card/index.vue

@@ -6,7 +6,7 @@ export default {
 
 <script setup lang="ts">
 import { getCardList } from "/@/api/list";
-import ReCard from "/@/components/ReCard";
+import Card from "./components/Card.vue";
 import { ref, onMounted, nextTick } from "vue";
 import dialogForm from "./components/DialogForm.vue";
 import { ElMessage, ElMessageBox } from "element-plus";
@@ -152,7 +152,7 @@ const handleManageProduct = product => {
             :lg="6"
             :xl="4"
           >
-            <ReCard
+            <Card
               :product="product"
               @delete-item="handleDeleteItem"
               @manage-product="handleManageProduct"

+ 0 - 0
src/components/ReCharts/src/Bar.vue → src/views/welcome/components/Bar.vue


+ 0 - 0
src/components/ReCharts/src/Github.vue → src/views/welcome/components/Github.vue


+ 0 - 0
src/components/ReCharts/src/Infinite.vue → src/views/welcome/components/Infinite.vue


+ 0 - 0
src/components/ReCharts/src/Line.vue → src/views/welcome/components/Line.vue


+ 0 - 0
src/components/ReCharts/src/Pie.vue → src/views/welcome/components/Pie.vue


+ 38 - 0
src/views/welcome/components/index.ts

@@ -0,0 +1,38 @@
+import reInfinite from "./Infinite.vue";
+import reGithub from "./Github.vue";
+import reLine from "./Line.vue";
+import reBar from "./Bar.vue";
+import rePie from "./Pie.vue";
+import { App } from "vue";
+
+const ReInfinite = Object.assign(reInfinite, {
+  install(app: App) {
+    app.component(reInfinite.name, reInfinite);
+  }
+});
+
+const ReGithub = Object.assign(reGithub, {
+  install(app: App) {
+    app.component(reGithub.name, reGithub);
+  }
+});
+
+const ReLine = Object.assign(reLine, {
+  install(app: App) {
+    app.component(reLine.name, reLine);
+  }
+});
+
+const ReBar = Object.assign(reBar, {
+  install(app: App) {
+    app.component(reBar.name, reBar);
+  }
+});
+
+const RePie = Object.assign(rePie, {
+  install(app: App) {
+    app.component(rePie.name, rePie);
+  }
+});
+
+export { ReInfinite, ReGithub, ReLine, ReBar, RePie };

+ 1 - 7
src/views/welcome.vue → src/views/welcome/index.vue

@@ -1,11 +1,5 @@
 <script setup lang="ts">
-import {
-  ReGithub,
-  ReInfinite,
-  RePie,
-  ReLine,
-  ReBar
-} from "/@/components/ReCharts/index";
+import { ReGithub, ReInfinite, RePie, ReLine, ReBar } from "./components";
 import { ref, computed } from "vue";
 import avatars from "/@/assets/avatars.jpg";