Pārlūkot izejas kodu

fix: 修改组件以及注释没用代码

hanxiaohui 5 mēneši atpakaļ
vecāks
revīzija
f1ce52c6c9

+ 1 - 0
.env.development

@@ -4,3 +4,4 @@ VITE_APP_API_URL='/api'
 VITE_APP_FILE_URL='http://192.168.21.77:2024/upload'
 VITE_APP_API_BASE_URL='http://localhost:8081/#'
 VITE_APP_API_FILE_VIEW_URL='http://192.168.17.153:8812'
+VITE_APP_API_CUSTOM_URL='/base-api'

+ 2 - 1
.env.localhost

@@ -1,3 +1,4 @@
 NODE_ENV=development
 VITE_APP_TITLE='BoundLink-Plate 本地环境(Local)'
-VITE_APP_API_URL='/api'
+VITE_APP_API_URL='/api'
+VITE_APP_API_CUSTOM_URL='/common-api'

+ 1 - 0
.env.pre

@@ -1,3 +1,4 @@
 NODE_ENV=production
 VITE_APP_TITLE='BoundLink-Plate 预发布环境(Pre)'
 VITE_APP_API_URL='/api'
+VITE_APP_API_CUSTOM_URL='/common-api'

+ 1 - 0
.env.production

@@ -4,3 +4,4 @@ VITE_APP_API_URL=/prod-api
 VITE_APP_FILE_URL='http://192.168.21.77:2024/upload'
 VITE_APP_API_BASE_URL='http://27.223.11.42:9102/#'
 VITE_APP_API_FILE_VIEW_URL='http://27.223.11.42:8812'
+VITE_APP_API_CUSTOM_URL='/common-api'

+ 2 - 1
.env.test

@@ -1,3 +1,4 @@
 NODE_ENV=production
 VITE_APP_TITLE='BoundLink-Plate 测试环境(Test)'
-VITE_APP_API_URL='http://127.0.0.1:1024'
+VITE_APP_API_URL='http://127.0.0.1:1024'
+VITE_APP_API_CUSTOM_URL='/common-api'

+ 104 - 8
src/components/BsUi/Table/Table.vue

@@ -1,20 +1,56 @@
 <template>
-  <vxe-grid class="wrapper" v-bind="props.gridOptions" ref="gridRef">
+  <vxe-grid class="wrapper" v-bind="props.gridOptions" ref="gridRef" v-fullscreen>
     <template #form>
       <Search
         v-if="props?.searchConfig && props.searchConfig.enable && props.searchConfig?.fields && props.searchConfig?.data"
         :fields="props.searchConfig?.fields"
         :data="props.searchConfig?.data"
         v-bind="props.searchConfig"
-      />
-      <IndexData />
+        @reset="handleReset"
+        @search="handleSearch"
+      >
+        <template #searchRight>
+          <slot name="searchRight"></slot>
+        </template>
+      </Search>
+<!--      <IndexData />-->
     </template>
 
     <template #top>
-      <div class="top" v-if="props?.toolbarConfig && props?.toolbarConfig.enable">
-        <Toolbar :toolbarConfig="props.toolbarConfig">
-          <slot name="toolbar"></slot>
-        </Toolbar>
+      <div class="top">
+        <div class="top-left" v-if="props?.toolbarConfig && props?.toolbarConfig.enable">
+          <Toolbar :toolbarConfig="props.toolbarConfig">
+            <slot name="toolbarLeft"></slot>
+          </Toolbar>
+        </div>
+        <div class="top-right" v-if="props?.toolbarConfig && props?.toolbarConfig.enable">
+          <a-tooltip placement="top">
+            <template #title>
+              <span>刷新</span>
+            </template>
+            <a-button type="text" size="small" @click="handleRefresh">
+              <ReloadOutlined />
+            </a-button>
+          </a-tooltip>
+
+          <a-tooltip placement="top" v-if="isZoom">
+            <template #title>
+              <span>还原</span>
+            </template>
+            <a-button type="text" size="small" @click="toggleFullscreen">
+              <FullscreenExitOutlined />
+            </a-button>
+          </a-tooltip>
+
+          <a-tooltip placement="top" v-if="!isZoom">
+            <template #title>
+              <span>全屏</span>
+            </template>
+            <a-button type="text" size="small" @click="toggleFullscreen">
+              <FullscreenOutlined />
+            </a-button>
+          </a-tooltip>
+        </div>
       </div>
     </template>
 
@@ -45,12 +81,61 @@
   const props = defineProps(['gridOptions', 'searchConfig', 'pagerConfig', 'toolbarConfig', 'getGridRef']);
   const gridRef = ref(null);
 
+  const isZoom = ref(false);
+
+  const handleReset = () => {
+    props.searchConfig.data = {};
+    props?.searchConfig &&
+      props?.searchConfig.onReset({
+        searchParams: {
+          ...props.searchConfig.data,
+        },
+        pageInfo: {
+          pageSize: props.pagerConfig?.pageSize,
+          pageNum: props.pagerConfig?.pageNum,
+        },
+      });
+  };
+
+  const handleSearch = () => {
+    props?.searchConfig &&
+      props?.searchConfig.onSearch({
+        searchParams: {
+          ...props.searchConfig.data,
+        },
+        pageInfo: {
+          pageSize: props.pagerConfig?.pageSize,
+          pageNum: props.pagerConfig?.pageNum,
+        },
+      });
+  };
+
+  // 刷新回调
+  const handleRefresh = () => {
+    props?.toolbarConfig &&
+      props.toolbarConfig.onRefresh({
+        searchParams: {
+          ...props.searchConfig.data,
+        },
+        pageInfo: {
+          pageSize: props.pagerConfig?.pageSize,
+          pageNum: props.pagerConfig?.pageNum,
+        },
+      });
+  };
+
   onMounted(() => {
     nextTick(() => {
       props.getGridRef && props.getGridRef(gridRef.value);
     });
   });
 
+  const toggleFullscreen = () => {
+    gridRef.value.zoom().then((zoom) => {
+      isZoom.value = zoom;
+    });
+  };
+
   defineExpose({ gridRef });
 </script>
 
@@ -62,6 +147,17 @@
       border-radius: 10px 10px 0 0;
       padding: 10px 20px;
       background: white;
+      display: flex;
+      align-items: center;
+
+      .top-left {
+        flex: 1;
+      }
+      .top-right {
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+      }
     }
     .pager {
       width: 100%;
@@ -72,7 +168,7 @@
       padding: 20px;
 
       :deep(.ant-select-in-form-item) {
-        width: auto!important;
+        width: auto !important;
       }
     }
     :deep(.vxe-grid--table-container) {

+ 61 - 16
src/components/BsUi/Table/component/search/index.vue

@@ -3,7 +3,7 @@
     <a-card>
       <a-form ref="formRef">
         <a-row :gutter="[10, 10]">
-          <a-col :span="item.span || 3" v-for="(item, index) in props.fields" :key="index" v-show="item.visible">
+          <a-col :span="fieldSpan || 3" v-for="(item, index) in props.fields" :key="index" v-show="item.visible">
             <a-form-item :label="item.label" :name="item.field">
               <component
                 :is="item?.component"
@@ -14,15 +14,21 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :span="props?.searchSpan || 6">
-            <a-space>
-              <a-button type="primary" :icon="h(SearchOutlined)" @click="searchHandler" >查询</a-button>
-              <a-button :icon="h(ClearOutlined)" @click="resetHandler" >重置</a-button>
+          <a-col :span="btnSpan">
+            <div class="search-btn">
               <a-space>
-                <a-button type="dashed" :icon="h(UpOutlined)" @click="toggleHandler" v-if="isZheDie">收起</a-button>
-                <a-button type="dashed" :icon="h(DownOutlined)"  @click="toggleHandler" v-if="!isZheDie">展开</a-button>
+                <a-button type="primary" :icon="h(SearchOutlined)" @click="searchHandler">查询</a-button>
+                <a-button :icon="h(ClearOutlined)" @click="resetHandler">重置</a-button>
+                <a-space v-if="props.fields.length > 1">
+                  <a-button type="dashed" :icon="h(UpOutlined)" @click="toggleHandler" v-if="isZheDie">收起</a-button>
+                  <a-button type="dashed" :icon="h(DownOutlined)" @click="toggleHandler" v-if="!isZheDie">展开</a-button>
+                </a-space>
               </a-space>
-            </a-space>
+
+              <div class="search-right">
+                <slot name="searchRight"></slot>
+              </div>
+            </div>
           </a-col>
         </a-row>
       </a-form>
@@ -30,24 +36,33 @@
   </div>
 </template>
 <script setup>
-  import { ref,  h } from 'vue';
+  import { ref, h, computed } from 'vue';
   import { ClearOutlined, SearchOutlined, UpOutlined, DownOutlined } from '@ant-design/icons-vue';
-  import { isEmpty } from 'lodash'
-  const props = defineProps(['fields', 'data', 'onSearch', 'onReset', 'onToggle', 'searchSpan']);
+  import { isEmpty } from 'lodash';
+  const props = defineProps(['fields', 'data', 'onSearch', 'onReset', 'onToggle', 'fieldSpan']);
+  const emits = defineEmits(['search', 'reset']);
+
   const formRef = ref(null);
   const isZheDie = ref(false);
   const searchHandler = () => {
-    props?.onSearch();
+    emits('search');
   };
 
   const resetHandler = () => {
-    props?.onReset();
-  }
+    emits('reset');
+  };
 
   const toggleHandler = () => {
     isZheDie.value = !isZheDie.value;
     props?.onToggle();
-  }
+  };
+
+  const btnSpan = computed(() => {
+    const num = props.fields.filter((item) => item.visible).length;
+    const fieldSpanNum = Number(props.fieldSpan || 3);
+    const totalFieldSpanNum = num * fieldSpanNum;
+    return 24 - totalFieldSpanNum % 24;
+  });
 
 </script>
 
@@ -59,7 +74,37 @@
       padding: 20px;
     }
     :deep(.ant-form-item) {
-      margin-bottom: 0px;
+      margin-bottom: 0;
+    }
+
+    .search-btn {
+      display: flex;
+      justify-content:  space-between;
+      align-items: center;
+
+      .search-right {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        justify-content: flex-end;
+      }
+    }
+
+
+
+    .field-items {
+      display: flex;
+      flex-wrap: wrap;
+      gap: 10px;
+      width: 100%;
+      .field-item {
+        width: 200px;
+      }
+      .btn-list {
+        display: flex;
+        flex: 1;
+        justify-content: space-between;
+      }
     }
   }
 </style>

+ 0 - 4
src/components/BsUi/Table/index.js

@@ -134,10 +134,6 @@ export const useBsTable = (options, tableRef) => {
   const initSearchConfig = () => {
     handleSearchFields();
     isUndefined(tableOptions?.searchConfig?.data) && set(tableOptions, 'searchConfig.data', {});
-    set(tableOptions, 'searchConfig.onReset', async () => {
-      set(tableOptions, 'searchConfig.data', {});
-    });
-    set(tableOptions, 'searchConfig.onSearch', async () => {});
     set(tableOptions, 'searchConfig.onToggle', toggleSearchFields);
     const visible = get(tableOptions, 'searchConfig.enable', true);
     setSearchVisible(visible);

+ 12 - 3
src/lib/axios.js

@@ -22,7 +22,7 @@ const smartAxios = axios.create({
 });
 
 // 退出系统
-function logout () {
+function logout() {
   useUserStore().logout();
   location.href = '/';
 }
@@ -31,6 +31,15 @@ function logout () {
 
 smartAxios.interceptors.request.use(
   (config) => {
+    const {  url } = config;
+    if (url.includes(import.meta.env.VITE_APP_API_CUSTOM_URL)) {
+      config.url = url.replace(import.meta.env.VITE_APP_API_CUSTOM_URL, '');
+      config.baseURL = import.meta.env.VITE_APP_API_CUSTOM_URL;
+    } else {
+      config.url = url.replace(import.meta.env.VITE_APP_API_URL, '');
+      config.baseURL = import.meta.env.VITE_APP_API_URL;
+    }
+
     // 在发送请求之前消息头加入token token
     const token = localRead(LocalStorageKeyConst.USER_TOKEN);
     if (token) {
@@ -235,7 +244,7 @@ export const getDownload = function (url, params) {
     });
 };
 
-function handleDownloadError (error) {
+function handleDownloadError(error) {
   if (error instanceof Blob) {
     const fileReader = new FileReader();
     fileReader.readAsText(error);
@@ -251,7 +260,7 @@ function handleDownloadError (error) {
   }
 }
 
-function handleDownloadData (response) {
+function handleDownloadData(response) {
   if (!response) {
     return;
   }

+ 0 - 359
src/views/system/login2/login copy 3.vue

@@ -1,359 +0,0 @@
-<template>
-  <div>
-    <div v-if="sfb">{{ sfb.formData }}</div>
-
-    <div class="form" v-if="true">
-      <StFormBuild :value="jsonData" :defaultValue="defaultValue" @change="handleChange" ref="sfb" />
-
-      <a-button type="primary" @click="submitHandler">提交</a-button>
-      <a-button type="primary" @click="resetHandler">重置</a-button>
-    </div>
-  </div>
-</template>
-<script setup>
-  import { nextTick, onMounted, reactive, ref } from 'vue';
-  import { message } from 'ant-design-vue';
-
-  const mformData = reactive({
-    a: 123,
-  });
-
-  const mFormDataRef = ref(null);
-
-  const jsonData = reactive({
-    list: [
-      {
-        type: 'text',
-        label: '测试文字',
-        options: {
-          textAlign: 'center',
-          hidden: false,
-          showRequiredMark: false,
-          color: 'rgb(0, 0, 0)',
-          fontFamily: 'SimHei',
-          fontSize: '16pt',
-        },
-        key: 'text_1725676492575',
-        id: '8286e076-6cc1-11ef-bf24-f37feb2dd0ee',
-        model: 'text_1725676492575',
-        event: {
-          change: 'c2e06af0-6cc1-11ef-bf24-f37feb2dd0ee',
-          click: 'c2e06af1-6cc1-11ef-bf24-f37feb2dd0ee',
-          focus: 'c2e06af2-6cc1-11ef-bf24-f37feb2dd0ee',
-          blur: 'c2e06af3-6cc1-11ef-bf24-f37feb2dd0ee',
-        },
-      },
-      {
-        type: 'editor',
-        label: '富文本',
-        list: [],
-        options: {
-          height: 300,
-          placeholder: '请输入',
-          defaultValue: '',
-          chinesization: true,
-          hidden: false,
-          disabled: false,
-          showLabel: false,
-          width: '100%',
-        },
-        model: 'editor_test',
-        key: 'editor_1725691707335',
-        help: '',
-        rules: [
-          {
-            required: true,
-            message: '必填项',
-          },
-        ],
-        id: 'ade2cd12-6ce4-11ef-8324-d111cd53d89b',
-        event: {
-          change: '2f948d70-6ce5-11ef-8324-d111cd53d89b',
-          click: '2f948d71-6ce5-11ef-8324-d111cd53d89b',
-          focus: '2f948d72-6ce5-11ef-8324-d111cd53d89b',
-          blur: '2f948d73-6ce5-11ef-8324-d111cd53d89b',
-        },
-      },
-      {
-        type: 'grid',
-        label: '栅格布局',
-        columns: [
-          {
-            span: 8,
-            list: [
-              {
-                type: 'input',
-                label: '短文本',
-                icon: 'icon-write',
-                options: {
-                  type: 'text',
-                  width: '100%',
-                  defaultValue: '',
-                  placeholder: '请输入',
-                  clearable: false,
-                  maxLength: null,
-                  addonBefore: '',
-                  addonAfter: '',
-                  hidden: false,
-                  disabled: false,
-                },
-                model: 'inputTest',
-                key: 'input_1725676419721',
-                help: '',
-                rules: [
-                  {
-                    required: true,
-                    message: '必填项',
-                  },
-                ],
-                id: '8286e060-6cc1-11ef-bf24-f37feb2dd0ee',
-                event: {
-                  change: '9773c790-6cc1-11ef-bf24-f37feb2dd0ee',
-                  click: '9773c791-6cc1-11ef-bf24-f37feb2dd0ee',
-                  focus: '9773c792-6cc1-11ef-bf24-f37feb2dd0ee',
-                  blur: '9773c793-6cc1-11ef-bf24-f37feb2dd0ee',
-                },
-              },
-            ],
-          },
-          {
-            span: 8,
-            list: [],
-          },
-          {
-            span: 8,
-            list: [],
-          },
-        ],
-        options: {
-          gutter: 0,
-        },
-        key: 'grid_1725676416616',
-        model: 'grid_1725676416616',
-        id: '8286e07b-6cc1-11ef-bf24-f37feb2dd0ee',
-        event: {
-          change: '9599fe80-6cc1-11ef-bf24-f37feb2dd0ee',
-          click: '9599fe81-6cc1-11ef-bf24-f37feb2dd0ee',
-          focus: '9599fe82-6cc1-11ef-bf24-f37feb2dd0ee',
-          blur: '9599fe83-6cc1-11ef-bf24-f37feb2dd0ee',
-        },
-      },
-      {
-        type: 'divider',
-        label: '分割线',
-        options: {
-          orientation: 'left',
-        },
-        key: 'divider_1725676423946',
-        model: 'divider_1725676423946',
-        id: '8286e078-6cc1-11ef-bf24-f37feb2dd0ee',
-        event: {
-          change: '99f876a0-6cc1-11ef-bf24-f37feb2dd0ee',
-          click: '99f876a1-6cc1-11ef-bf24-f37feb2dd0ee',
-          focus: '99f876a2-6cc1-11ef-bf24-f37feb2dd0ee',
-          blur: '99f876a3-6cc1-11ef-bf24-f37feb2dd0ee',
-        },
-      },
-      {
-        type: 'tabs',
-        label: '标签页布局',
-        options: {
-          tabBarGutter: null,
-          type: 'line',
-          tabPosition: 'top',
-          size: 'default',
-          animated: true,
-        },
-        columns: [
-          {
-            value: '1',
-            label: '选项1',
-            list: [
-              {
-                type: 'batch',
-                label: '子表',
-                icon: 'icon-biaoge',
-                list: [
-                  {
-                    type: 'input',
-                    label: '短文本',
-                    icon: 'icon-write',
-                    options: {
-                      type: 'text',
-                      width: '100%',
-                      defaultValue: '',
-                      placeholder: '请输入',
-                      clearable: false,
-                      maxLength: null,
-                      addonBefore: '',
-                      addonAfter: '',
-                      hidden: false,
-                      disabled: false,
-                    },
-                    model: 'test1',
-                    key: 'input_1725676475644',
-                    help: '',
-                    rules: [
-                      {
-                        required: false,
-                        message: '必填项',
-                      },
-                    ],
-                    id: '8286e060-6cc1-11ef-bf24-f37feb2dd0ee',
-                    event: {
-                      change: 'b8c8f3c0-6cc1-11ef-bf24-f37feb2dd0ee',
-                      click: 'b8c8f3c1-6cc1-11ef-bf24-f37feb2dd0ee',
-                      focus: 'b8c8f3c2-6cc1-11ef-bf24-f37feb2dd0ee',
-                      blur: 'b8c8f3c3-6cc1-11ef-bf24-f37feb2dd0ee',
-                    },
-                  },
-                  {
-                    type: 'date',
-                    label: '日期选择',
-                    icon: 'icon-calendar',
-                    options: {
-                      width: '100%',
-                      defaultValue: '',
-                      rangeDefaultValue: [],
-                      range: false,
-                      showTime: false,
-                      disabled: false,
-                      hidden: false,
-                      clearable: false,
-                      placeholder: '请选择',
-                      rangePlaceholder: ['开始时间', '结束时间'],
-                      format: 'YYYY-MM-DD',
-                    },
-                    model: 'date1',
-                    key: 'date_1725676480321',
-                    help: '',
-                    rules: [
-                      {
-                        required: true,
-                        message: '必填项',
-                      },
-                    ],
-                    id: '8286e066-6cc1-11ef-bf24-f37feb2dd0ee',
-                    event: {
-                      change: 'bb929b10-6cc1-11ef-bf24-f37feb2dd0ee',
-                      click: 'bb929b11-6cc1-11ef-bf24-f37feb2dd0ee',
-                      focus: 'bb929b12-6cc1-11ef-bf24-f37feb2dd0ee',
-                      blur: 'bb929b13-6cc1-11ef-bf24-f37feb2dd0ee',
-                    },
-                  },
-                ],
-                options: {
-                  scrollY: 0,
-                  disabled: false,
-                  hidden: false,
-                  showLabel: true,
-                  hideSequence: false,
-                  width: '100%',
-                },
-                model: 'batchTest',
-                key: 'batch_1725676438533',
-                help: '',
-                id: '8286e070-6cc1-11ef-bf24-f37feb2dd0ee',
-                event: {
-                  change: 'a2aa4350-6cc1-11ef-bf24-f37feb2dd0ee',
-                  click: 'a2aa4351-6cc1-11ef-bf24-f37feb2dd0ee',
-                  focus: 'a2aa4352-6cc1-11ef-bf24-f37feb2dd0ee',
-                  blur: 'a2aa4353-6cc1-11ef-bf24-f37feb2dd0ee',
-                },
-              },
-            ],
-          },
-          {
-            value: '2',
-            label: '选项2',
-            list: [],
-          },
-        ],
-        key: 'tabs_1725676433747',
-        model: 'tabs_1725676433747',
-        id: '8286e07a-6cc1-11ef-bf24-f37feb2dd0ee',
-        event: {
-          change: '9fcffa30-6cc1-11ef-bf24-f37feb2dd0ee',
-          click: '9fcffa31-6cc1-11ef-bf24-f37feb2dd0ee',
-          focus: '9fcffa32-6cc1-11ef-bf24-f37feb2dd0ee',
-          blur: '9fcffa33-6cc1-11ef-bf24-f37feb2dd0ee',
-        },
-      },
-    ],
-    config: {
-      layout: 'horizontal',
-      labelCol: {
-        xs: 4,
-        sm: 4,
-        md: 4,
-        lg: 4,
-        xl: 4,
-        xxl: 4,
-      },
-      labelWidth: 100,
-      labelLayout: 'flex',
-      wrapperCol: {
-        xs: 18,
-        sm: 18,
-        md: 18,
-        lg: 18,
-        xl: 18,
-        xxl: 18,
-      },
-      hideRequiredMark: false,
-      customStyle: '',
-    },
-  });
-
-  const defaultValue = reactive({});
-
-  const sfb = ref({});
-
-  const handleChange = (value, key, record, tableInfo) => {
-    console.log('login---------------------->', value, key, record, tableInfo);
-  };
-
-  const msubmit = () => {
-    mFormDataRef.value
-      .validateFields()
-      .then((res) => {
-        console.log(res);
-      })
-      .catch((err) => {
-        console.log(err);
-      });
-  };
-
-  const countChange = (value) => {
-    console.log(value);
-  };
-
-  onMounted(() => {
-    nextTick(() => {
-      sfb.value.setData({ batchTest: [{ test1: '111' }, { date1: '2021-01-09' }], inputTest: '222', editor_test: `<p style="color:red">3p3p3p</p>` });
-    });
-  });
-
-  const submitHandler = () => {
-    sfb.value.getData().then(
-      (res) => {
-        console.log(res);
-        message.success('提交成功!');
-      },
-      (err) => {
-        console.log(err);
-        message.error('提交失败!');
-      }
-    );
-  };
-
-  const resetHandler = () => {
-    sfb.value.reset();
-  };
-</script>
-
-<style lang="less" scoped>
-  .form {
-    padding: 30px 200px;
-  }
-</style>

+ 0 - 9
src/views/system/login2/login copy 4.vue

@@ -1,9 +0,0 @@
-<template>
-  <div class="wrap">
-    <st-flow-design />
-  </div>
-</template>
-
-<script setup>
-import StFlowDesign from '/@/views/flow/stFlowDesign/index.vue'
-</script>

+ 0 - 365
src/views/system/login2/login copy 5.vue

@@ -1,365 +0,0 @@
-<template>
-  <div>
-    <StFormMobileBuild :value="jsonData" :defaultValue="defaultValue" @change="handleChange" ref="sfb" />
-  </div>
-</template>
-
-<script setup>
-
-  import { ref, reactive } from 'vue';
-
-  const jsonData = reactive({
-    list: [
-      {
-        type: 'text',
-        label: '演示用例',
-        options: {
-          textAlign: 'center',
-          hidden: false,
-          showRequiredMark: false,
-          color: 'rgb(0, 0, 0)',
-          fontFamily: 'SimHei',
-          fontSize: '24pt',
-        },
-        key: 'text_1727071707948',
-        id: '07ba4296-7970-11ef-9275-dfec7295b932',
-        model: 'text_1727071707948',
-        event: {
-          change: '400b26c0-7972-11ef-9275-dfec7295b932',
-          click: '400b26c1-7972-11ef-9275-dfec7295b932',
-          focus: '400b26c2-7972-11ef-9275-dfec7295b932',
-          blur: '400b26c3-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'input',
-        label: '短文本',
-        options: {
-          type: 'text',
-          width: '100%',
-          defaultValue: '',
-          placeholder: '请输入',
-          clearable: false,
-          maxLength: null,
-          addonBefore: '',
-          addonAfter: '',
-          hidden: false,
-          disabled: false,
-        },
-        model: 'input_1727071735900',
-        key: 'input_1727071735900',
-        help: '',
-        rules: [
-          {
-            required: true,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4280-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '50b449c0-7972-11ef-9275-dfec7295b932',
-          click: '50b449c1-7972-11ef-9275-dfec7295b932',
-          focus: '50b449c2-7972-11ef-9275-dfec7295b932',
-          blur: '50b449c3-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'textarea',
-        label: '长文本',
-        options: {
-          width: '100%',
-          minRows: 4,
-          maxRows: 6,
-          maxLength: null,
-          defaultValue: '',
-          clearable: false,
-          hidden: false,
-          disabled: false,
-          placeholder: '请输入',
-        },
-        model: 'textarea_1727071738882',
-        key: 'textarea_1727071738882',
-        help: '',
-        rules: [
-          {
-            required: false,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4281-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '527b4e20-7972-11ef-9275-dfec7295b932',
-          click: '527b4e21-7972-11ef-9275-dfec7295b932',
-          focus: '527b4e22-7972-11ef-9275-dfec7295b932',
-          blur: '527b4e23-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'number',
-        label: '数值框',
-        options: {
-          width: '100%',
-          defaultValue: 0,
-          min: null,
-          max: null,
-          precision: null,
-          step: 1,
-          hidden: false,
-          disabled: false,
-          placeholder: '请输入',
-        },
-        model: 'number_1727071742129',
-        key: 'number_1727071742129',
-        help: '',
-        rules: [
-          {
-            required: false,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4282-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '546ac210-7972-11ef-9275-dfec7295b932',
-          click: '546ac211-7972-11ef-9275-dfec7295b932',
-          focus: '546ac212-7972-11ef-9275-dfec7295b932',
-          blur: '546ac213-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'select',
-        label: '下拉框',
-        options: {
-          width: '100%',
-          multiple: false,
-          disabled: false,
-          clearable: false,
-          hidden: false,
-          placeholder: '请选择',
-          dynamicKey: '',
-          dynamic: false,
-          options: [
-            {
-              value: '1',
-              label: '下拉框1',
-            },
-            {
-              value: '2',
-              label: '下拉框2',
-            },
-          ],
-          showSearch: false,
-        },
-        model: 'select_1727071744426',
-        key: 'select_1727071744426',
-        help: '',
-        rules: [
-          {
-            required: true,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4283-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '55c940a0-7972-11ef-9275-dfec7295b932',
-          click: '55c940a1-7972-11ef-9275-dfec7295b932',
-          focus: '55c940a2-7972-11ef-9275-dfec7295b932',
-          blur: '55c940a3-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'checkbox',
-        label: '多选框',
-        options: {
-          disabled: false,
-          hidden: false,
-          defaultValue: [],
-          dynamicKey: '',
-          dynamic: false,
-          options: [
-            {
-              value: '1',
-              label: '选项1',
-            },
-            {
-              value: '2',
-              label: '选项2',
-            },
-            {
-              value: '3',
-              label: '选项3',
-            },
-          ],
-        },
-        model: 'checkbox_1727071746775',
-        key: 'checkbox_1727071746775',
-        help: '',
-        rules: [
-          {
-            required: false,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4284-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '572fae70-7972-11ef-9275-dfec7295b932',
-          click: '572fae71-7972-11ef-9275-dfec7295b932',
-          focus: '572fae72-7972-11ef-9275-dfec7295b932',
-          blur: '572fae73-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'radio',
-        label: '单选框',
-        options: {
-          disabled: false,
-          hidden: false,
-          defaultValue: '',
-          dynamicKey: '',
-          dynamic: false,
-          options: [
-            {
-              value: '1',
-              label: '选项1',
-            },
-            {
-              value: '2',
-              label: '选项2',
-            },
-            {
-              value: '3',
-              label: '选项3',
-            },
-          ],
-        },
-        model: 'radio_1727071749112',
-        key: 'radio_1727071749112',
-        help: '',
-        rules: [
-          {
-            required: false,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4285-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '58944780-7972-11ef-9275-dfec7295b932',
-          click: '58944781-7972-11ef-9275-dfec7295b932',
-          focus: '58944782-7972-11ef-9275-dfec7295b932',
-          blur: '58944783-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'date',
-        label: '日期选择',
-        options: {
-          width: '100%',
-          defaultValue: '',
-          rangeDefaultValue: [],
-          range: false,
-          showTime: false,
-          disabled: false,
-          hidden: false,
-          clearable: false,
-          placeholder: '请选择',
-          rangePlaceholder: ['开始时间', '结束时间'],
-          format: 'YYYY-MM-DD',
-        },
-        model: 'date_1727071777117',
-        key: 'date_1727071777117',
-        help: '',
-        rules: [
-          {
-            required: false,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4286-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '694580d0-7972-11ef-9275-dfec7295b932',
-          click: '694580d1-7972-11ef-9275-dfec7295b932',
-          focus: '694580d2-7972-11ef-9275-dfec7295b932',
-          blur: '694580d3-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'time',
-        label: '时间选择',
-        options: {
-          width: '100%',
-          defaultValue: '',
-          disabled: false,
-          hidden: false,
-          clearable: false,
-          placeholder: '请选择',
-          format: 'HH:mm:ss',
-        },
-        model: 'time_1727071779030',
-        key: 'time_1727071779030',
-        help: '',
-        rules: [
-          {
-            required: false,
-            message: '必填项',
-          },
-        ],
-        id: '07ba4287-7970-11ef-9275-dfec7295b932',
-        event: {
-          change: '6a696760-7972-11ef-9275-dfec7295b932',
-          click: '6a696761-7972-11ef-9275-dfec7295b932',
-          focus: '6a696762-7972-11ef-9275-dfec7295b932',
-          blur: '6a696763-7972-11ef-9275-dfec7295b932',
-        },
-      },
-      {
-        type: 'button',
-        label: '按钮',
-        options: {
-          type: 'primary',
-          handle: 'submit',
-          dynamicFun: '',
-          hidden: false,
-          disabled: false,
-        },
-        key: 'button_1727071784837',
-        id: '07ba4294-7970-11ef-9275-dfec7295b932',
-        model: 'button_1727071784837',
-        event: {
-          change: '6ddf7b50-7972-11ef-9275-dfec7295b932',
-          click: '6ddf7b51-7972-11ef-9275-dfec7295b932',
-          focus: '6ddf7b52-7972-11ef-9275-dfec7295b932',
-          blur: '6ddf7b53-7972-11ef-9275-dfec7295b932',
-        },
-      },
-    ],
-    config: {
-      layout: 'horizontal',
-      labelCol: {
-        xs: 4,
-        sm: 4,
-        md: 4,
-        lg: 4,
-        xl: 4,
-        xxl: 4,
-      },
-      labelWidth: 100,
-      labelLayout: 'flex',
-      wrapperCol: {
-        xs: 18,
-        sm: 18,
-        md: 18,
-        lg: 18,
-        xl: 18,
-        xxl: 18,
-      },
-      hideRequiredMark: false,
-      customStyle: '',
-    },
-  });
-
-  const defaultValue = reactive({});
-
-  const sfb = ref(null);
-
-  const handleChange = (key, value) => {};
-</script>
-<style lang="less" scoped></style>

+ 0 - 22
src/views/system/login2/login copy 6.vue

@@ -1,22 +0,0 @@
-<template>
-  <div>
-    <van-button @click="clkHandle">按钮</van-button>
-  </div>
-</template>
-<script setup lang="jsx">
-  import { useStPopup } from '/@/components/StMobile/StPopup/index.jsx';
-  const clkHandle = () => {
-    useStPopup(
-      {
-        position: 'bottom',
-        round: true,
-        style: { height: '300px' },
-      },
-      {
-        type: 'time',
-        modelValue: [ "01", "02"],
-        title: '选择时间',
-      }
-    );
-  };
-</script>

+ 0 - 25
src/views/system/login2/test.vue

@@ -1,25 +0,0 @@
-<template>
-    <div>
-        子:{{ test }}
-        <div>
-        <a-button @click="update(test.a)">修改通知</a-button>
-        </div>
-
-    </div>
-</template>
-<script setup>
-const props = defineProps({
-    test: {
-        type: Object,
-        default: () => ({})
-    }
-})
-
-const emit = defineEmits(["testUpdate"])
-
-// const { test } = props;
-
-const update = (a) => {
-    emit("testUpdate", a)
-}
-</script>

+ 121 - 0
src/views/table-demo/index.vue

@@ -0,0 +1,121 @@
+<template>
+  <div class="table-demo">
+    <bs-table v-bind="tableOptions">
+      <template #searchRight>
+        <a-space>
+          <a-button type="primary">按钮1</a-button>
+        </a-space>
+      </template>
+      <template #toolbarLeft>
+        <a-space>
+          累计客户:XXX|黑名单客户:XXX|S级客户
+        </a-space>
+      </template>
+    </bs-table>
+  </div>
+</template>
+
+<script setup>
+  import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
+  import { onMounted } from 'vue';
+  import { pick } from 'lodash';
+
+  const {
+    tableOptions,
+    setTablePropsValue: setValue,
+    getTablePropsValue: getValue,
+  } = useBsTable({
+    tableOptions: {
+      gridOptions: {
+        loading: false,
+        columns: [
+          {
+            type: 'seq',
+            width: 80,
+          },
+          {
+            field: 'id',
+            title: 'ID',
+          },
+          {
+            field: 'name',
+            title: '名称',
+          },
+        ],
+      },
+      searchConfig: {
+        enabled: true,
+        fieldSpan: 6,
+        fields: Array.from({ length: 10 }, (_, i) => {
+          return {
+            field: `name${i}`,
+            label: `名称${i}`,
+            component: 'a-input',
+            componentProps: {
+              placeholder: `请输入名称${i}`,
+            },
+          };
+        }),
+        onSearch() {
+          fetchTableData()
+        },
+        onReset() {
+          fetchTableData()
+        },
+      },
+      pagerConfig: {
+        enabled: true,
+        pageSize: 10,
+        pageNum: 1,
+        total: 100,
+        onChange: () => {
+          fetchTableData()
+        },
+      },
+      toolbarConfig: {
+        onRefresh() {
+          fetchTableData()
+        },
+      },
+    },
+  });
+
+  const getSearchParams = () => {
+    return getValue('searchConfig.data');
+  };
+  const getPageInfo = () => {
+    return pick(getValue('pagerConfig.pageInfo'), ['pageNum', 'pageSize']);
+  };
+
+  const fetchTableData = () => {
+    setValue('gridOptions.loading', true);
+
+    const params = {
+      ...getSearchParams(),
+      ...getPageInfo(),
+    };
+
+    setTimeout(() => {
+      setValue('gridOptions.data', [
+        {
+          id: '1111111',
+          name: 'John Doe',
+        },
+      ]);
+
+      setValue('gridOptions.loading', false);
+    }, 1000);
+  };
+
+  onMounted(() => {
+    console.log('表格已加载');
+    fetchTableData();
+  });
+</script>
+
+<style scoped lang="scss">
+  .table-demo {
+    width: 100%;
+    padding: 20px;
+  }
+</style>

+ 24 - 0
src/views/test/index.vue

@@ -0,0 +1,24 @@
+<template>
+  <div>111111111111</div>
+</template>
+
+<script setup>
+import { request } from '/@/lib/axios';
+
+request({
+  url: '/api/users',
+  method: 'GET',
+  params: {
+    a: 1
+  }
+})
+
+request({
+  url: '/base-api/test',
+  method: 'post',
+  data: {
+    a: 1
+  }
+})
+
+</script>

+ 7 - 0
vite.config.js

@@ -47,6 +47,13 @@ export default {
         // only https
         // secure: false
       },
+      '/base-api': { // 用于基础
+        target: 'http://localhost:2025',
+        // target: 'http://192.168.17.209:2024',
+        changeOrigin: true,
+        ws: true,
+        rewrite: (path) => path.replace(new RegExp(`^/base-api`), ''),
+      }
     },
     open: true, // 项目启动后,自动打开
   },