guhongwei há 2 anos atrás
pai
commit
fbb14c66fd
4 ficheiros alterados com 65 adições e 1 exclusões
  1. 9 0
      components.d.ts
  2. 15 0
      src/components/index.ts
  3. 6 0
      src/main.ts
  4. 35 1
      src/views/home/index.vue

+ 9 - 0
components.d.ts

@@ -0,0 +1,9 @@
+// import cButton from '@common/src/components/frame/btn-1.vue';
+// import cDialog from '@common/src/components/frame/c-dialog.vue';
+
+// declare module '@vue/runtime-core' {
+//   export interface GlobalComponents {
+//     cButton: typeof cButton;
+//     cDialog: typeof cDialog;
+//   }
+// }

+ 15 - 0
src/components/index.ts

@@ -0,0 +1,15 @@
+import type { Component } from 'vue';
+import cButton from '@common/src/components/frame/btn-1.vue';
+import cDialog from '@common/src/components/frame/c-dialog.vue';
+import cSearch from '@common/src/components/frame/c-search.vue';
+import cForm from '@common/src/components/frame/c-form.vue';
+import cTable from '@common/src/components/frame/c-table.vue';
+import cUpload from '@common/src/components/frame/c-upload.vue';
+import cEditor from '@common/src/components/frame/wang-editor.vue';
+import cFile from '@common/src/components/frame/c-file.vue';
+
+const components: {
+  [propName: string]: Component;
+} = { cButton, cDialog, cSearch, cForm, cTable, cUpload, cEditor, cFile };
+
+export default components;

+ 6 - 0
src/main.ts

@@ -9,6 +9,9 @@ import moment from 'moment';
 import '@/assets/main.css';
 import 'animate.css';
 import * as ElementPlusIconsVue from '@element-plus/icons-vue';
+// 组件
+// 组件
+import frameComponents from '@/components/index';
 const app = createApp(App);
 app.use(createPinia());
 app.use(router);
@@ -16,6 +19,9 @@ app.use(ElementPlus, { locale });
 for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
   app.component(key, component);
 }
+for (const componentItme in frameComponents) {
+  app.component(componentItme, frameComponents[componentItme]);
+}
 
 app.config.globalProperties.$moment = moment;
 app.config.globalProperties.$limit = parseInt(import.meta.env.VITE_APP_PAGE_SIZE) || 10;

+ 35 - 1
src/views/home/index.vue

@@ -3,13 +3,47 @@
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <component :is="web1"></component>
+        <!-- <el-col :span="24" class="one">
+          <cButton></cButton>
+        </el-col>
+        <el-col :span="24" class="one">
+          <cSearch></cSearch>
+        </el-col>
+        <el-col :span="24" class="one">
+          <cForm :fields="[]" :rules="{}" :form="{}" @save="toSave"></cForm>
+        </el-col>
+        <el-col :span="24" class="one">
+          <cTable></cTable>
+        </el-col>
+        <el-col :span="24" class="one">
+          <cUpload model="file" :limit="1" url="/files/studioadmin/other/upload" :list="[]"></cUpload>
+        </el-col>
+        <el-col :span="24" class="one">
+          <cEditor></cEditor>
+        </el-col>
+        <el-col :span="24" class="one">
+          <cFile :form="{ file: [] }"></cFile>
+        </el-col> -->
       </el-col>
     </el-row>
+    <!-- <cDialog :dialog="{ show: false, title: '弹框' }">
+      <template v-slot:info>弹框</template>
+    </cDialog> -->
   </div>
 </template>
 
 <script setup lang="ts">
 import web1 from '@/components/common/web/index.vue';
+// 提交保存
+// const toSave = () => {
+//   console.log('保存');
+// };
 </script>
 
-<style scoped></style>
+<style scoped lang="scss">
+// .main {
+//   .one {
+//     margin: 0 0 10px 0;
+//   }
+// }
+</style>