Browse Source

分页到底提示 打包配置

master-xiaowang
mk 2 months ago
parent
commit
5d322138cc
  1. 1
      .gitignore
  2. 13
      src/view/policy/index.vue
  3. 6
      vite.config.ts

1
.gitignore

@ -6,6 +6,7 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
*.zip
node_modules node_modules
epmet-apartment-front epmet-apartment-front

13
src/view/policy/index.vue

@ -86,7 +86,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from "vue"; import { ref, reactive, onMounted, onUnmounted } from "vue";
import { gePolicytList, getPolicyInfo } from "@/api/policy"; import { gePolicytList, getPolicyInfo } from "@/api/policy";
import { Message } from '@arco-design/web-vue'
// tabList // tabList
const tabList = reactive([ const tabList = reactive([
{ {
@ -123,14 +123,14 @@ interface PolicyResponse {
const showDetail = ref(false); const showDetail = ref(false);
const handleClickTab = (item: any) => { const handleClickTab = (item: any) => {
active.value = item.dictValue; active.value = item.dictValue;
joinIn.pageNo = 1; joinIn.pageNum = 1;
joinIn.dictCode = item.dictValue; joinIn.dictCode = item.dictValue;
list.value = []; list.value = [];
isLoading.value = true; isLoading.value = true;
getList(); getList();
}; };
const joinIn = { const joinIn = {
pageNo: 1, pageNum: 1,
pageSize: 5, pageSize: 5,
dictCode: active.value, dictCode: active.value,
}; };
@ -144,7 +144,10 @@ const isLoading = ref(true);
// getList // getList
const getList = async () => { const getList = async () => {
try { try {
if (!isLoading.value) return; if (!isLoading.value) {
Message.info('没有更多了')
return false;
};
// //
const res:PolicyResponse = await gePolicytList(joinIn); const res:PolicyResponse = await gePolicytList(joinIn);
list.value = [...list.value, ...res.data]; list.value = [...list.value, ...res.data];
@ -152,7 +155,7 @@ const getList = async () => {
isLoading.value = false; isLoading.value = false;
return false; return false;
} }
joinIn.pageNo++; joinIn.pageNum++;
} catch (err) { } catch (err) {
console.error("获取数据失败:", err); console.error("获取数据失败:", err);
} }

6
vite.config.ts

@ -7,10 +7,12 @@ import { ArcoResolver } from 'unplugin-vue-components/resolvers'
import { vitePluginForArco } from '@arco-plugins/vite-vue' import { vitePluginForArco } from '@arco-plugins/vite-vue'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
publicDir: 'epmet-apartment-front', // 添加基础路径配置
// Vite 配置中没有 outputDir 属性,应使用 build.outDir 来指定输出目录 base: '/epmet-apartment-front/',
publicDir: 'epmet-apartment-front',
build: { build: {
outDir: "epmet-apartment-front", outDir: "epmet-apartment-front",
assetsDir: 'static',
target:['edge90','chrome90','firefox90','safari15'] target:['edge90','chrome90','firefox90','safari15']
}, },
plugins: [ plugins: [

Loading…
Cancel
Save