Переглянути джерело

feat(base): base save the page

gemercheung 3 роки тому
батько
коміт
b5f58f5358

+ 2 - 7
package.json

@@ -1,11 +1,6 @@
 {
-  "name": "vben-admin",
+  "name": "zfb-4.0",
   "version": "2.8.0",
-  "author": {
-    "name": "vben",
-    "email": "anncwb@126.com",
-    "url": "https://github.com/anncwb"
-  },
   "scripts": {
     "bootstrap": "yarn install",
     "serve": "npm run dev",
@@ -29,7 +24,7 @@
     "test:gzip": "npx http-server dist --cors --gzip -c-1",
     "test:br": "npx http-server dist --cors --brotli -c-1",
     "reinstall": "rimraf yarn.lock && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
-    "prepare": "husky install",
+    "prepare": "is-ci || husky install",
     "gen:icon": "esno ./build/generate/icon/index.ts"
   },
   "dependencies": {

+ 10 - 0
src/api/corporation/list.ts

@@ -3,6 +3,7 @@ import { PageParams, CorporationListGetResultModel } from './model';
 
 enum Api {
   selectCompanyNum = '/zfb/company/selectCompanyNum',
+  selectCompanyByType = '/zfb/company/selectCompanyByType',
 }
 
 /**
@@ -18,3 +19,12 @@ export const ListApi = (params: PageParams) =>
       ignoreCancelToken: true,
     },
   });
+export const ListVerifyApi = (params: PageParams) =>
+  defHttp.get<CorporationListGetResultModel>({
+    url: Api.selectCompanyByType,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 4 - 46
src/views/dashboard/corporation/index.vue

@@ -4,13 +4,10 @@
       <template #toolbar> </template>
       <template #sceneLogo="{ sceneLogo }">
         <CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="sceneLogo" />
-        <!-- </CollapseContainer> -->
       </template>
-
       <template #floorLogo="{ floorLogo }">
         <CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="floorLogo" />
       </template>
-
       <template #bgMusic="{ bgMusic }">
         <CropperAvatar :showBtn="false" :width="80" :uploadApi="uploadApi" :value="bgMusic" />
       </template>
@@ -18,31 +15,18 @@
   </div>
 </template>
 <script lang="ts">
-  import { defineComponent, ref } from 'vue';
-  import {
-    BasicTable,
-    ColumnChangeParam,
-    useTable,
-    BasicColumn,
-    FormProps,
-  } from '/@/components/Table';
+  import { defineComponent } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps } from '/@/components/Table';
   // import { CollapseContainer } from '/@/components/Container';
   import { CropperAvatar } from '/@/components/Cropper';
   import { uploadApi } from '/@/api/sys/upload';
   // import { Avatar } from 'ant-design-vue';
-
-  import { getBasicColumns, getBasicData } from './tableData';
+  // import { getBasicColumns, getBasicData } from './tableData';
   import { ListApi } from '/@/api/corporation/list';
 
   export default defineComponent({
     components: { BasicTable, CropperAvatar },
     setup() {
-      const canResize = ref(false);
-      const loading = ref(false);
-      const striped = ref(true);
-      const border = ref(true);
-      const pagination = ref<any>(true);
-
       const columns: BasicColumn[] = [
         {
           title: 'ID',
@@ -140,35 +124,9 @@
         showIndexColumn: false,
         rowKey: 'id',
       });
-      pagination.value = { pageSize: 20 };
-
-      function toggleCanResize() {
-        canResize.value = !canResize.value;
-      }
-      function toggleStriped() {
-        striped.value = !striped.value;
-      }
-
-      function toggleBorder() {
-        border.value = !border.value;
-      }
-
-      function handleColumnChange(data: ColumnChangeParam[]) {
-        console.log('ColumnChanged', data);
-      }
+      // pagination.value = { pageSize: 20 };
 
       return {
-        columns: getBasicColumns(),
-        data: getBasicData(),
-        canResize,
-        loading,
-        striped,
-        border,
-        toggleStriped,
-        toggleCanResize,
-        toggleBorder,
-        pagination,
-        handleColumnChange,
         registerTable,
         uploadApi: uploadApi as any,
       };

+ 0 - 322
src/views/dashboard/corporation/tableData.tsx

@@ -1,322 +0,0 @@
-import { FormProps, FormSchema } from '/@/components/Table';
-import { BasicColumn } from '/@/components/Table/src/types/table';
-
-// bgMusic: ""
-// cameraNum: 2
-// childName: null
-// expirationDate: null
-// expirationTime: 1622217599000
-// floorLogo: "http://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/companyLogo/1629431551712_00000010_2021-08-16.zip"
-// id: 1107
-// name: "南山居"
-// num: 6
-// point: 99
-// sceneLogo: "http://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/companyLogo/1629354038921_20210817162925_0_STITCH.jpg"
-// sceneNum: 0
-// subNum: 10
-// userName: "13112310255"
-
-export function getBasicColumns(): BasicColumn[] {
-  return [
-    {
-      title: 'ID',
-      dataIndex: 'id',
-      fixed: 'left',
-      width: 200,
-    },
-    {
-      title: '企业账户',
-      dataIndex: 'name',
-      width: 150,
-      filters: [
-        { text: 'Male', value: 'male' },
-        { text: 'Female', value: 'female' },
-      ],
-    },
-    {
-      title: '地址',
-      dataIndex: 'address',
-    },
-    {
-      title: '编号',
-      dataIndex: 'no',
-      width: 150,
-      sorter: true,
-      defaultHidden: true,
-    },
-    {
-      title: '开始时间',
-      width: 150,
-      sorter: true,
-      dataIndex: 'beginTime',
-    },
-    {
-      title: '结束时间',
-      width: 150,
-      sorter: true,
-      dataIndex: 'endTime',
-    },
-  ];
-}
-
-export function getBasicShortColumns(): BasicColumn[] {
-  return [
-    {
-      title: 'ID',
-      width: 150,
-      dataIndex: 'id',
-      sorter: true,
-      sortOrder: 'ascend',
-    },
-    {
-      title: '姓名',
-      dataIndex: 'name',
-      width: 120,
-    },
-    {
-      title: '地址',
-      dataIndex: 'address',
-    },
-    {
-      title: '编号',
-      dataIndex: 'no',
-      width: 80,
-    },
-  ];
-}
-
-export function getMultipleHeaderColumns(): BasicColumn[] {
-  return [
-    {
-      title: 'ID',
-      dataIndex: 'id',
-      width: 200,
-    },
-    {
-      title: '姓名',
-      dataIndex: 'name',
-      width: 120,
-    },
-    {
-      title: '地址',
-      dataIndex: 'address',
-      sorter: true,
-      children: [
-        {
-          title: '编号',
-          dataIndex: 'no',
-          width: 120,
-          filters: [
-            { text: 'Male', value: 'male', children: [] },
-            { text: 'Female', value: 'female', children: [] },
-          ],
-        },
-
-        {
-          title: '开始时间',
-          dataIndex: 'beginTime',
-          width: 120,
-        },
-        {
-          title: '结束时间',
-          dataIndex: 'endTime',
-          width: 120,
-        },
-      ],
-    },
-  ];
-}
-
-export function getCustomHeaderColumns(): BasicColumn[] {
-  return [
-    {
-      title: 'ID',
-      dataIndex: 'id',
-      width: 200,
-    },
-    {
-      // title: '姓名',
-      dataIndex: 'name',
-      width: 120,
-      slots: { title: 'customTitle' },
-    },
-    {
-      // title: '地址',
-      dataIndex: 'address',
-      width: 120,
-      slots: { title: 'customAddress' },
-      sorter: true,
-    },
-
-    {
-      title: '编号',
-      dataIndex: 'no',
-      width: 120,
-      filters: [
-        { text: 'Male', value: 'male', children: [] },
-        { text: 'Female', value: 'female', children: [] },
-      ],
-    },
-    {
-      title: '开始时间',
-      dataIndex: 'beginTime',
-      width: 120,
-    },
-    {
-      title: '结束时间',
-      dataIndex: 'endTime',
-      width: 120,
-    },
-  ];
-}
-const renderContent = ({ text, index }: { text: any; index: number }) => {
-  const obj: any = {
-    children: text,
-    attrs: {},
-  };
-  if (index === 9) {
-    obj.attrs.colSpan = 0;
-  }
-  return obj;
-};
-export function getMergeHeaderColumns(): BasicColumn[] {
-  return [
-    {
-      title: 'ID',
-      dataIndex: 'id',
-      width: 300,
-      customRender: renderContent,
-    },
-    {
-      title: '姓名',
-      dataIndex: 'name',
-      width: 300,
-      customRender: renderContent,
-    },
-    {
-      title: '地址',
-      dataIndex: 'address',
-      colSpan: 2,
-      width: 120,
-      sorter: true,
-      customRender: ({ text, index }: { text: any; index: number }) => {
-        const obj: any = {
-          children: text,
-          attrs: {},
-        };
-        if (index === 2) {
-          obj.attrs.rowSpan = 2;
-        }
-        if (index === 3) {
-          obj.attrs.colSpan = 0;
-        }
-        return obj;
-      },
-    },
-    {
-      title: '编号',
-      dataIndex: 'no',
-      colSpan: 0,
-      filters: [
-        { text: 'Male', value: 'male', children: [] },
-        { text: 'Female', value: 'female', children: [] },
-      ],
-      customRender: renderContent,
-    },
-    {
-      title: '开始时间',
-      dataIndex: 'beginTime',
-      width: 200,
-      customRender: renderContent,
-    },
-    {
-      title: '结束时间',
-      dataIndex: 'endTime',
-      width: 200,
-      customRender: renderContent,
-    },
-  ];
-}
-export const getAdvanceSchema = (itemNumber = 6): FormSchema[] => {
-  const arr: any = [];
-  for (let index = 0; index < itemNumber; index++) {
-    arr.push({
-      field: `field${index}`,
-      label: `字段${index}`,
-      component: 'Input',
-      colProps: {
-        xl: 12,
-        xxl: 8,
-      },
-    });
-  }
-  return arr;
-};
-export function getFormConfig(): Partial<FormProps> {
-  return {
-    labelWidth: 100,
-    schemas: [
-      ...getAdvanceSchema(5),
-      {
-        field: `field11`,
-        label: `Slot示例`,
-        component: 'Select',
-        slot: 'custom',
-        colProps: {
-          xl: 12,
-          xxl: 8,
-        },
-      },
-    ],
-  };
-}
-
-export function getBasicData() {
-  const data: any = (() => {
-    const arr: any = [];
-    for (let index = 0; index < 40; index++) {
-      arr.push({
-        id: `${index}`,
-        name: 'John Brown',
-        age: `1${index}`,
-        no: `${index + 10}`,
-        address: 'New York No. 1 Lake ParkNew York No. 1 Lake Park',
-        beginTime: new Date().toLocaleString(),
-        endTime: new Date().toLocaleString(),
-      });
-    }
-    return arr;
-  })();
-  return data;
-}
-
-export function getTreeTableData() {
-  const data: any = (() => {
-    const arr: any = [];
-    for (let index = 0; index < 40; index++) {
-      arr.push({
-        id: `${index}`,
-        name: 'John Brown',
-        age: `1${index}`,
-        no: `${index + 10}`,
-        address: 'New York No. 1 Lake ParkNew York No. 1 Lake Park',
-        beginTime: new Date().toLocaleString(),
-        endTime: new Date().toLocaleString(),
-        children: [
-          {
-            id: `l2-${index}`,
-            name: 'John Brown',
-            age: `1${index}`,
-            no: `${index + 10}`,
-            address: 'New York No. 1 Lake ParkNew York No. 1 Lake Park',
-            beginTime: new Date().toLocaleString(),
-            endTime: new Date().toLocaleString(),
-          },
-        ],
-      });
-    }
-    return arr;
-  })();
-
-  return data;
-}

+ 93 - 7
src/views/dashboard/corporation/verify.vue

@@ -1,14 +1,100 @@
 <template>
   <div class="p-4">
-    <div>xxxxxxxx</div>
+    <BasicTable @register="registerTable">
+      <template #toolbar> </template>
+      <template #no="{ state }">
+        <Tag color="green">
+          {{ state }}
+        </Tag>
+      </template>
+    </BasicTable>
   </div>
 </template>
-<script lang="ts" setup>
-  import { ref } from 'vue';
+<script lang="ts">
+  import { defineComponent } from 'vue';
+  import { BasicTable, useTable, BasicColumn, FormProps } from '/@/components/Table';
+  // import { CollapseContainer } from '/@/components/Container';
+  // import { CropperAvatar } from '/@/components/Cropper';
+  import { uploadApi } from '/@/api/sys/upload';
+  import { Tag } from 'ant-design-vue';
+  // import { getBasicColumns, getBasicData } from './tableData';
+  import { ListVerifyApi } from '/@/api/corporation/list';
 
-  const loading = ref(true);
+  export default defineComponent({
+    components: { BasicTable, Tag },
+    setup() {
+      // const pagination = ref<any>(true);
 
-  setTimeout(() => {
-    loading.value = false;
-  }, 1500);
+      const columns: BasicColumn[] = [
+        {
+          title: '提交日期',
+          dataIndex: 'startTime',
+          width: 180,
+        },
+        {
+          title: '企业名称',
+          dataIndex: 'name',
+          width: 230,
+        },
+        {
+          title: '手机号',
+          dataIndex: 'phone',
+          width: 120,
+        },
+        {
+          title: '状态',
+          dataIndex: 'state',
+          slots: { customRender: 'no' },
+          width: 180,
+        },
+        {
+          title: '操作',
+          dataIndex: 'bgMusic',
+          slots: { customRender: 'bgMusic' },
+          width: 180,
+        },
+      ];
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        schemas: [
+          {
+            field: 'id',
+            label: 'id',
+            component: 'Input',
+            colProps: {
+              xl: 3,
+              xxl: 3,
+            },
+          },
+          {
+            field: 'userName',
+            label: '企业账号',
+            component: 'Input',
+            colProps: {
+              xl: 12,
+              xxl: 8,
+            },
+          },
+        ],
+      };
+      // { getForm }
+      const [registerTable] = useTable({
+        title: '企业认证',
+        api: ListVerifyApi,
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        tableSetting: { fullScreen: true },
+        showIndexColumn: false,
+        rowKey: 'id',
+      });
+      // pagination.value = { pageSize: 20 };
+      return {
+        registerTable,
+        uploadApi: uploadApi as any,
+      };
+    },
+  });
 </script>

+ 25 - 9
src/views/sys/login/LoginForm.vue

@@ -25,6 +25,15 @@
       />
     </FormItem>
 
+    <FormItem name="drag" class="enter-x" :style="{ 'text-align': 'right' }">
+      <BasicDragVerify
+        ref="el3"
+        @success="handleSuccess"
+        text="拖动以进行校验"
+        successText="校验成功"
+      />
+    </FormItem>
+
     <ARow class="enter-x">
       <ACol :span="12">
         <FormItem>
@@ -52,6 +61,7 @@
         {{ t('sys.login.registerButton') }}
       </Button> -->
     </FormItem>
+
     <!-- <ARow class="enter-x">
       <ACol :md="8" :xs="24">
         <Button block @click="setLoginState(LoginStateEnum.MOBILE)">
@@ -83,17 +93,19 @@
 </template>
 <script lang="ts" setup>
   import { reactive, ref, unref, computed } from 'vue';
-
-  import { Checkbox, Form, Input, Row, Col, Button, Divider } from 'ant-design-vue';
-  import {
-    GithubFilled,
-    WechatFilled,
-    AlipayCircleFilled,
-    GoogleCircleFilled,
-    TwitterCircleFilled,
-  } from '@ant-design/icons-vue';
+  // Divider
+  import { Checkbox, Form, Input, Row, Col, Button } from 'ant-design-vue';
+  // import {
+  //   GithubFilled,
+  //   WechatFilled,
+  //   AlipayCircleFilled,
+  //   GoogleCircleFilled,
+  //   TwitterCircleFilled,
+  // } from '@ant-design/icons-vue';
   import LoginFormTitle from './LoginFormTitle.vue';
 
+  import { BasicDragVerify } from '/@/components/Verify/index';
+
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useMessage } from '/@/hooks/web/useMessage';
 
@@ -129,6 +141,10 @@
 
   const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN);
 
+  function handleSuccess() {
+    console.log('11');
+  }
+
   async function handleLogin() {
     const data = await validForm();
     if (!data) return;