Pārlūkot izejas kodu

feat(ant-d): 3.0 vol.4

gemercheung 3 gadi atpakaļ
vecāks
revīzija
572e3dec2f

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 693 - 945
pnpm-lock.yaml


+ 3 - 4
src/views/dashboard/analysis/components/GrowCard.vue

@@ -5,15 +5,14 @@
         size="small"
         :loading="loading"
         :title="item.title"
-        class="md:w-1/4 w-full !md:mt-0 !mt-4"
-        :class="[index + 1 < 4 && '!md:mr-4']"
-        :canExpan="false"
+        class="md:w-1/4 w-full !md:mt-0"
+        :class="{ '!md:mr-4': index + 1 < 4, '!mt-4': index > 0 }"
       >
         <template #extra>
           <Tag :color="item.color">{{ item.action }}</Tag>
         </template>
 
-        <div class="py-4 px-4 flex justify-between">
+        <div class="py-4 px-4 flex justify-between items-center">
           <CountTo prefix="$" :startVal="1" :endVal="item.value" class="text-2xl" />
           <Icon :icon="item.icon" :size="40" />
         </div>

+ 1 - 0
src/views/dashboard/analysis/components/SalesProductPie.vue

@@ -22,6 +22,7 @@
 
   const chartRef = ref<HTMLDivElement | null>(null);
   const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
+
   watch(
     () => props.loading,
     () => {

+ 4 - 21
src/views/dashboard/analysis/components/VisitAnalysis.vue

@@ -1,10 +1,12 @@
 <template>
   <div ref="chartRef" :style="{ height, width }"></div>
 </template>
+<script lang="ts">
+  import { basicProps } from './props';
+</script>
 <script lang="ts" setup>
   import { onMounted, ref, Ref } from 'vue';
   import { useECharts } from '/@/hooks/web/useECharts';
-  import { basicProps } from './props';
 
   defineProps({
     ...basicProps,
@@ -26,26 +28,7 @@
       xAxis: {
         type: 'category',
         boundaryGap: false,
-        data: [
-          '6:00',
-          '7:00',
-          '8:00',
-          '9:00',
-          '10:00',
-          '11:00',
-          '12:00',
-          '13:00',
-          '14:00',
-          '15:00',
-          '16:00',
-          '17:00',
-          '18:00',
-          '19:00',
-          '20:00',
-          '21:00',
-          '22:00',
-          '23:00',
-        ],
+        data: [...new Array(18)].map((_item, index) => `${index + 6}:00`),
         splitLine: {
           show: true,
           lineStyle: {

+ 4 - 15
src/views/dashboard/analysis/components/VisitAnalysisBar.vue

@@ -1,10 +1,12 @@
 <template>
   <div ref="chartRef" :style="{ height, width }"></div>
 </template>
+<script lang="ts">
+  import { basicProps } from './props';
+</script>
 <script lang="ts" setup>
   import { onMounted, ref, Ref } from 'vue';
   import { useECharts } from '/@/hooks/web/useECharts';
-  import { basicProps } from './props';
 
   defineProps({
     ...basicProps,
@@ -26,20 +28,7 @@
       grid: { left: '1%', right: '1%', top: '2  %', bottom: 0, containLabel: true },
       xAxis: {
         type: 'category',
-        data: [
-          '1月',
-          '2月',
-          '3月',
-          '4月',
-          '5月',
-          '6月',
-          '7月',
-          '8月',
-          '9月',
-          '10月',
-          '11月',
-          '12月',
-        ],
+        data: [...new Array(12)].map((_item, index) => `${index + 1}月`),
       },
       yAxis: {
         type: 'value',

+ 1 - 1
src/views/dashboard/analysis/components/VisitRadar.vue

@@ -19,9 +19,9 @@
       default: '300px',
     },
   });
-
   const chartRef = ref<HTMLDivElement | null>(null);
   const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
+
   watch(
     () => props.loading,
     () => {

+ 1 - 0
src/views/dashboard/analysis/components/VisitSource.vue

@@ -20,6 +20,7 @@
   });
   const chartRef = ref<HTMLDivElement | null>(null);
   const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
+
   watch(
     () => props.loading,
     () => {

+ 29 - 4
src/views/dashboard/product/drawer.data.ts

@@ -3,6 +3,7 @@ import { FormSchema, BasicColumn } from '/@/components/Table';
 import { h } from 'vue';
 import { Switch } from 'ant-design-vue';
 import { useMessage } from '/@/hooks/web/useMessage';
+import { Tinymce } from '/@/components/Tinymce/index';
 
 export const formSchema: FormSchema[] = [
   {
@@ -10,15 +11,39 @@ export const formSchema: FormSchema[] = [
     label: '商品名称',
     component: 'Input',
   },
+
   {
-    field: 'desc',
-    label: '商品描述',
+    field: 'link',
+    label: '购买链接',
     component: 'Input',
   },
   {
-    field: 'link',
-    label: '购买链接',
+    field: 'isLaunched',
+    label: '是否上架',
+    component: 'Switch',
+  },
+  {
+    field: 'isLaunched',
+    label: '是否上架',
+    component: 'Switch',
+  },
+
+  {
+    field: 'desc',
+    label: '商品描述',
     component: 'Input',
+    render: ({ model, field }) => {
+      return h(Tinymce, {
+        value: model[field],
+
+        onChange: (value: string) => {
+          model[field] = value;
+        },
+        // plugins: [],
+
+        showImageUpload: true,
+      });
+    },
   },
 ];
 export const columns: BasicColumn[] = [

+ 2 - 1
src/views/dashboard/product/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="p-4">
+  <div>
     <BasicTable @register="registerTable">
       <template #toolbar> </template>
       <template #link="{ record }">
@@ -47,6 +47,7 @@
   import { useGo } from '/@/hooks/web/usePage';
   import { useDrawer } from '/@/components/Drawer';
   import ProductDrawer from './productDrawer.vue';
+  // import { PageWrapper } from '/@/components/Page';
 
   export default defineComponent({
     components: { BasicTable, TableAction, ProductDrawer },

+ 2 - 2
src/views/dashboard/product/productDrawer.vue

@@ -2,9 +2,9 @@
   <BasicDrawer
     v-bind="$attrs"
     @register="registerDrawer"
+    :isDetail="true"
     showFooter
     :title="getTitle"
-    width="50%"
     @ok="handleSubmit"
   >
     <BasicForm @register="registerForm" />
@@ -29,7 +29,7 @@
         labelWidth: 100,
         schemas: formSchema,
         showActionButtonGroup: false,
-        baseColProps: { lg: 12, md: 24 },
+        baseColProps: { lg: 18, md: 18, offset: 1 },
       });
 
       const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {

+ 11 - 13
src/views/dashboard/workbench/components/ProjectCard.vue

@@ -4,19 +4,17 @@
       <a-button type="link" size="small">更多</a-button>
     </template>
 
-    <template v-for="item in items" :key="item">
-      <CardGrid class="!md:w-1/3 !w-full">
-        <span class="flex">
-          <Icon :icon="item.icon" :color="item.color" size="30" />
-          <span class="text-lg ml-4">{{ item.title }}</span>
-        </span>
-        <div class="flex mt-2 h-10 text-secondary">{{ item.desc }}</div>
-        <div class="flex justify-between text-secondary">
-          <span>{{ item.group }}</span>
-          <span>{{ item.date }}</span>
-        </div>
-      </CardGrid>
-    </template>
+    <CardGrid v-for="item in items" :key="item" class="!md:w-1/3 !w-full">
+      <span class="flex">
+        <Icon :icon="item.icon" :color="item.color" size="30" />
+        <span class="text-lg ml-4">{{ item.title }}</span>
+      </span>
+      <div class="flex mt-2 h-10 text-secondary">{{ item.desc }}</div>
+      <div class="flex justify-between text-secondary">
+        <span>{{ item.group }}</span>
+        <span>{{ item.date }}</span>
+      </div>
+    </CardGrid>
   </Card>
 </template>
 <script lang="ts">

+ 6 - 8
src/views/dashboard/workbench/components/QuickNav.vue

@@ -1,13 +1,11 @@
 <template>
   <Card title="快捷导航" v-bind="$attrs">
-    <template v-for="item in navItems" :key="item">
-      <CardGrid>
-        <span class="flex flex-col items-center">
-          <Icon :icon="item.icon" :color="item.color" size="20" />
-          <span class="text-md mt-2">{{ item.title }}</span>
-        </span>
-      </CardGrid>
-    </template>
+    <CardGrid v-for="item in navItems" :key="item">
+      <span class="flex flex-col items-center">
+        <Icon :icon="item.icon" :color="item.color" size="20" />
+        <span class="text-md mt-2">{{ item.title }}</span>
+      </span>
+    </CardGrid>
   </Card>
 </template>
 <script lang="ts" setup>

+ 0 - 6
types/module.d.ts

@@ -10,12 +10,6 @@ declare module 'ant-design-vue/es/locale/*' {
   export default locale as Locale & ReadonlyRecordable;
 }
 
-declare module 'moment/dist/locale/*' {
-  import { LocaleSpecification } from 'moment';
-  const locale: LocaleSpecification & ReadonlyRecordable;
-  export default locale;
-}
-
 declare module 'virtual:*' {
   const result: any;
   export default result;