From 75111c0ec04e2882010ffb9403ed47ecfeac2404 Mon Sep 17 00:00:00 2001
From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com>
Date: Thu, 20 Jun 2024 14:49:04 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=85=A5=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sgzb-ui/src/main.js | 5 +-
sgzb-ui/src/utils/ruoyi.js | 7 ++-
sgzb-ui/src/views/base/section/index.vue | 76 +++++++++++++++++++++++-
3 files changed, 84 insertions(+), 4 deletions(-)
diff --git a/sgzb-ui/src/main.js b/sgzb-ui/src/main.js
index 090086f4..9f7dd4d3 100644
--- a/sgzb-ui/src/main.js
+++ b/sgzb-ui/src/main.js
@@ -12,13 +12,13 @@ import store from './store'
import router from './router'
import directive from './directive' // directive
import plugins from './plugins' // plugins
-import { download,downloadJson } from '@/utils/request'
+import { download, downloadJson } from '@/utils/request'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
+import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, indexContinuation } from "@/utils/ruoyi";
// 分页组件
import Pagination from "@/components/Pagination";
// 自定义表格工具组件
@@ -56,6 +56,7 @@ Vue.prototype.download = download
Vue.prototype.downloadJson = downloadJson
Vue.prototype.handleTree = handleTree
Vue.prototype.globalUrl = global_
+Vue.prototype.indexContinuation = indexContinuation
// 全局组件挂载
Vue.component('DictTag', DictTag)
diff --git a/sgzb-ui/src/utils/ruoyi.js b/sgzb-ui/src/utils/ruoyi.js
index 44bf9c40..71046879 100644
--- a/sgzb-ui/src/utils/ruoyi.js
+++ b/sgzb-ui/src/utils/ruoyi.js
@@ -88,7 +88,7 @@ export function selectDictLabel(datas, value) {
// 回显数据字典(字符串、数组)
export function selectDictLabels(datas, value, separator) {
- if (value === undefined || value.length ===0) {
+ if (value === undefined || value.length === 0) {
return "";
}
if (Array.isArray(value)) {
@@ -231,3 +231,8 @@ export function tansParams(params) {
export function blobValidate(data) {
return data.type !== 'application/json'
}
+
+// 处理表格索引延续问题
+export function indexContinuation(num, size) {
+ return (num - 1) * size + 1
+}
diff --git a/sgzb-ui/src/views/base/section/index.vue b/sgzb-ui/src/views/base/section/index.vue
index 94ac59b1..5db0ed17 100644
--- a/sgzb-ui/src/views/base/section/index.vue
+++ b/sgzb-ui/src/views/base/section/index.vue
@@ -22,6 +22,9 @@