|
@@ -2,7 +2,7 @@
|
|
|
* @Author: fxs bjnsfxs@163.com
|
|
|
* @Date: 2024-08-20 18:16:18
|
|
|
* @LastEditors: fxs bjnsfxs@163.com
|
|
|
- * @LastEditTime: 2024-10-12 18:40:06
|
|
|
+ * @LastEditTime: 2024-10-14 11:06:43
|
|
|
* @FilePath: \Game-Backstage-Management-System\src\components\Table.vue
|
|
|
* @Description:
|
|
|
*
|
|
@@ -70,7 +70,7 @@ const backupQueryFormData = reactive<{ [key: string]: any }>({})
|
|
|
|
|
|
// 分页数据
|
|
|
const paginationConfig2 = reactive<TablePaginationSetting>({
|
|
|
- currentPage: 0,
|
|
|
+ currentPage: 1,
|
|
|
limit: 0,
|
|
|
total: 0,
|
|
|
pagesizeList: []
|
|
@@ -140,6 +140,7 @@ const handleSizeChange = (val: number) => {
|
|
|
* @return {*}
|
|
|
*/
|
|
|
const getData = () => {
|
|
|
+ console.trace()
|
|
|
return new Promise(async (resolve, reject) => {
|
|
|
try {
|
|
|
const loadTableData = async () => {
|
|
@@ -225,6 +226,9 @@ const getData = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 包装一下获取数据
|
|
|
+const throttleGetData = throttleFunc(getData, 1000)
|
|
|
+
|
|
|
/**
|
|
|
* @description: 清空表格数据
|
|
|
* @return {*}
|
|
@@ -370,6 +374,7 @@ watch(
|
|
|
(newGid, oldGid) => {
|
|
|
if (newGid != oldGid) {
|
|
|
reqconfig.otherOptions.gid = newGid
|
|
|
+
|
|
|
getData()
|
|
|
}
|
|
|
},
|
|
@@ -384,7 +389,8 @@ const watchPf = watch(
|
|
|
reqconfig.otherOptions.pf = newPf
|
|
|
getData()
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
)
|
|
|
|
|
|
// 监听传入的datalist的变化,然后去更新数据
|
|
@@ -511,6 +517,19 @@ const outGetTableData = () => {
|
|
|
return toRaw(tableData).flat()
|
|
|
}
|
|
|
|
|
|
+// const registerWatchProps = () => {
|
|
|
+// props.watchReqProps?.forEach((item) => {
|
|
|
+// watch(
|
|
|
+// () => props.requestConfig?.otherOptions?.[item],
|
|
|
+// () => {
|
|
|
+// // getData()
|
|
|
+// reqconfig.otherOptions[item] = props.requestConfig?.otherOptions?.[item]
|
|
|
+// },
|
|
|
+// { deep: true }
|
|
|
+// )
|
|
|
+// })
|
|
|
+// }
|
|
|
+
|
|
|
// 定义暴露出去的方法
|
|
|
defineExpose({
|
|
|
getData,
|
|
@@ -524,12 +543,13 @@ onMounted(() => {
|
|
|
initpageConfig()
|
|
|
initReqConfig()
|
|
|
initFormData()
|
|
|
+ // registerWatchProps()
|
|
|
if (props.loadingState !== undefined) {
|
|
|
loading.value = props.loadingState
|
|
|
}
|
|
|
- // if (!props.openPageQuery) {
|
|
|
- // getData()
|
|
|
- // }
|
|
|
+ // 这里会造成有的table页第一次进来刷新两次,因为有的页面gid或者平台等数据会变化,导致请求第二次
|
|
|
+ // 但是这里又必须请求一次,因为有的页面数据是没有变化的
|
|
|
+ getData()
|
|
|
// 去加载所有需要的资源
|
|
|
initLoadResouce(resourceInfo).then((data) => {
|
|
|
Object.assign(blobUrlInfo, data)
|
|
@@ -638,7 +658,7 @@ onMounted(() => {
|
|
|
<el-icon><Download /></el-icon>下载
|
|
|
</el-button>
|
|
|
<!-- throttleFunc(queryTableData, 200) -->
|
|
|
- <RegreshBtn @refresh-table="throttleQueryTableData" :icon-size="toolsIconSize"></RegreshBtn>
|
|
|
+ <RegreshBtn @refresh-table="throttleGetData" :icon-size="toolsIconSize"></RegreshBtn>
|
|
|
|
|
|
<FilterPopover
|
|
|
:table-fields-info="tableFieldsInfo"
|