123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930 |
- <!--
- * @Author: fxs bjnsfxs@163.com
- * @Date: 2024-08-20 18:16:18
- * @LastEditors: fxs bjnsfxs@163.com
- * @LastEditTime: 2024-09-18 12:00:45
- * @FilePath: \Game-Backstage-Management-System\src\components\Table.vue
- * @Description:
- *
- -->
- <script setup lang="ts">
- import type { PropsParams, TablePaginationSetting } from '@/types/table'
- import type { ReqConfig } from '@/types/dataAnalysis'
- import { FilterType, FieldSpecialEffectType } from '@/types/table'
- import { initLoadResouce } from '@/utils/resource'
- import { fuzzySearch } from '@/utils/common'
- import { computed, onMounted, reactive, ref, toRaw, watch } from 'vue'
- import { useTable } from '@/hooks/useTable'
- import FilterPopover from './toolsBtn/FilterPopover.vue'
- import RegreshBtn from './toolsBtn/RegreshBtn.vue'
- import { useRequest } from '@/hooks/useRequest'
- import type { FormInstance } from 'element-plus'
- import axiosInstance from '@/utils/axios/axiosInstance'
- const { analysisResCode } = useRequest()
- // 表格工具图标大小
- const toolsIconSize = ref(25)
- // 查询表单
- const queryFormRef = ref<FormInstance>()
- // 传过来的配置
- const props = withDefaults(defineProps<PropsParams>(), {
- needRowindex: true,
- needAverage: false,
- needLeftTools: false,
- needRightTools: false,
- openFilterQuery: false,
- openPageQuery: false,
- needUpload: false,
- needDownLoad: false
- })
- // 父组件触发的方法
- // 删除了一个事件触发,loadSuccess
- const emits = defineEmits(['addNewItem', 'upload', 'downLoad'])
- // 加载动画
- const loading = ref(false)
- // 表格数据
- const tableData: Array<any> = reactive([])
- // 备份表格数据,用于在不分页查询的时候,恢复数据
- const backupTableData: Array<any> = []
- // 查询表单的数据
- const queryFormData = reactive<{ [key: string]: any }>({})
- const backupQueryFormData = reactive<{ [key: string]: any }>({})
- // 分页数据
- const paginationConfig2 = reactive<TablePaginationSetting>({
- currentPage: 0,
- limit: 0,
- total: 0,
- pagesizeList: []
- })
- // 请求配置
- const reqconfig = reactive<ReqConfig>({
- url: '',
- otherOptions: {}
- })
- // 资源的加载路径
- const resourceInfo: Record<string, string> = {
- defaultHead: `/img/default/defaultHead.png`
- }
- // 使用blob的资源路径信息
- const blobUrlInfo = reactive<Record<string, string>>({})
- // 一些公用方法
- const { getTableData } = useTable(tableData, paginationConfig2)
- // 没有开启分页查询的时候使用的数据
- const tableDataNoPaging = computed(() => {
- let curPage = paginationConfig2.currentPage
- let limit = paginationConfig2.limit
- let begin = curPage * limit - limit
- //这里不减一是因为,slice方法裁切是左闭右开数组
- let end = curPage * limit
- return tableData.slice(begin, end)
- })
- // 所有类型为input的表单控件信息
- const inputFieldsList = computed(() => {
- return props.queryInfo?.filter((item) => item.type === FilterType.INPUT)
- })
- // 所有类型为select的表单控件信息
- const selectFieldsList = computed(() => {
- return props.queryInfo?.filter((item) => {
- return item.type === FilterType.SELECT
- })
- })
- // 所有类型为date的表单控件信息
- const dateFieldsList = computed(() => {
- return props.queryInfo?.filter((item) => item.type === FilterType.DATE)
- })
- // 计算行号
- const computedRowIndex = (index: number) => {
- return (paginationConfig2.currentPage - 1) * paginationConfig2.limit + index + 1
- }
- // 改变页码
- const handleCurrentChange = (val: number) => {
- paginationConfig2.currentPage = val
- }
- // 改变每页大小
- const handleSizeChange = (val: number) => {
- paginationConfig2.limit = val
- }
- /**
- * @description: 获取数据,如果没有直接传入数据,则去请求数据,有则直接用
- * @return {*}
- */
- const getData = () => {
- return new Promise(async (resolve, reject) => {
- try {
- Object.assign(queryFormData, JSON.parse(JSON.stringify(backupQueryFormData)))
- const loadTableData = async () => {
- return new Promise((resolve, reject) => {
- if (props.dataList) {
- tableData.splice(0, tableData.length, ...props.dataList)
- paginationConfig2.total = props.paginationConfig.total
- loading.value = false
- // emits('loadSuccess', tableData)
- resolve(true)
- } else {
- loading.value = true
- if (props.requestConfig) {
- if (props.openPageQuery) {
- // 如果开启了分页查询,那么要计算出需要展示的页码位置所对应的偏移量
- // 同时要将查询的条数改为对应的用户选择的展示条数
- reqconfig.otherOptions.offset =
- (paginationConfig2.currentPage - 1) * paginationConfig2.limit
- reqconfig.otherOptions.limit = paginationConfig2.limit
- }
- // 查询时要根据是否开启分页查询传入对应参数
- getTableData(reqconfig.url, reqconfig.otherOptions, props.openPageQuery)
- .then(() => {
- // emits('loadSuccess', tableData)
- backupTableData.splice(0, backupTableData.length, ...tableData)
- resolve(true)
- })
- .catch((err) => {
- console.log(err)
- reject(err)
- })
- .finally(() => {
- loading.value = false
- })
- } else {
- loading.value = false
- throw new Error('no match requestConfig')
- }
- }
- })
- }
- // 等待数据加载完成
- await loadTableData()
- .then(async () => {
- if (props.needAverage) {
- let rowData: any = {}
- let oldList: Array<any> = JSON.parse(JSON.stringify(tableData))
- Object.values(props.tableFieldsInfo).map((item, index) => {
- let sum = oldList
- .map((item) => item.count)
- .reduce((accumulator, currentValue) => accumulator + currentValue, 0)
- let averageList = oldList
- .map((val) => val[item.name])
- .filter((item) => item !== undefined)
- if (index === 0) rowData[item.name] = '均值'
- else if (item.name === 'count') rowData[item.name] = sum
- else {
- let num =
- averageList.reduce((accumulator, currentValue) => accumulator + currentValue, 0) /
- averageList.length
- rowData[item.name] = isNaN(num) ? 0 : num.toFixed(2)
- }
- })
- insertRow(0, rowData)
- }
- resolve(true)
- })
- .catch((err) => {
- console.log(err)
- reject(err)
- })
- } catch (err) {
- console.log(err)
- reject(err)
- }
- })
- }
- /**
- * @description: 清空表格数据
- * @return {*}
- */
- const resetTableData = () => {
- tableData.splice(0, tableData.length)
- }
- /**
- * @description: 按条件查询,如果开启了分页查询,那么会直接重新查询数据,否则,会根据现有数据进行查询
- * @return {*}
- */
- const queryTableData = () => {
- if (props.requestConfig) {
- reqconfig.otherOptions = { ...props.requestConfig.otherOptions, ...queryFormData }
- }
- if (props.openPageQuery) getData()
- else {
- let filteredTable = []
- // 过滤出来所有符合formData数据的条件
- filteredTable = backupTableData.filter((item) => {
- let state = true
- for (let [k, v] of Object.entries(queryFormData)) {
- // 模糊查询,看值是否跟表格中的数据匹配
- if (!fuzzySearch(v, item[k])) {
- state = false
- break
- }
- }
- return state
- })
- tableData.splice(0, tableData.length, ...filteredTable)
- }
- }
- /**
- * @description: 重置整个查询表单,重置后,再请求一次全部表格
- * @param {*} formEl 表单对象
- * @return {*}
- */
- const resetQueryForm = (formEl: FormInstance | undefined) => {
- if (!formEl) return
- // clearReactiveData(queryFormData)
- // queryFormData
- Object.assign(queryFormData, JSON.parse(JSON.stringify(backupQueryFormData)))
- queryTableData()
- }
- /**
- * @description: 在获取完数据后,插入均值行
- * @param {*} start 插入的位置
- * @param {*} rowData 插入的数据
- * @return {*}
- */
- const insertRow = (start: number, rowData: any) => {
- if (props.openPageQuery) {
- tableData[start].splice(0, 0, rowData)
- } else {
- tableData.splice(start, 0, rowData)
- }
- }
- /**
- * @description: 根据计算出来的值去返回对应的颜色深度
- * @return {*}
- */
- const getDecimalFromRange = (number: number) => {
- if (number === null || number === undefined) return 0
- if (number < 25) return 0.25
- else if (number < 50) return 0.5
- else if (number < 75) return 0.75
- else return 1.0 // 如果number >= 75,则直接返回1.00
- }
- /**
- * @description: 单独处理拥有均值行的表格每个单元格的样式,均值字段均加粗,其他需要比较的字段根据自身百分比显示颜色
- * 其中使用row-style无效,scope会导致无法覆盖样式
- * 同时由于我自定义了表格内容,哪里的样式会覆盖row的样式,所以只能单独对单元格设置
- * @param {*} info 每个单元格的信息
- * @return {*}
- */
- const tableCellStyle = (info: any) => {
- if (info.row.date === '均值')
- return {
- 'font-weight': 'bold'
- }
- else if (info.column.property != 'count' && info.column.property != 'date' && props.needAverage) {
- return {
- 'background-color': `rgba(59, 157, 247,${getDecimalFromRange(info.row[info.column.property])})`
- }
- } else return {}
- }
- /**
- * @description: 监听litmit,currentpage的变化,改变后去重新请求数据
- * 如果是limit的变化,则需要把当前页置为1
- *
- * 对于Gid需要去监听props的,而不是本地的,因为是外部的改变
- * @return {*}
- */
- const changePageLimit = watch(
- () => [paginationConfig2.limit, paginationConfig2.currentPage],
- ([newLimit, newCurPage], [oldLimit, oldCruPage]) => {
- if (newLimit != oldLimit) {
- // 需要给分页按钮加上:current-page.sync="current_page" 配置,不然不生效
- // 当改变每页大小时把之前的缓存全部清除,重新开始
- paginationConfig2.currentPage = 1
- // resetTableData()
- }
- if (newCurPage != oldCruPage) paginationConfig2.currentPage = newCurPage
- // if (newGid != oldGid) reqconfig.otherOptions.gid = newGid
- // || newGid != oldGid
- if (newLimit != oldLimit || !tableData[paginationConfig2.currentPage]) {
- getData()
- }
- },
- { deep: true }
- )
- /**
- * @description: 监听gid的变化,重新请求数据,这里很奇怪,跟上面的limit和page放到一起不起作用
- * @return {*}
- */
- watch(
- () => props.requestConfig?.otherOptions.gid,
- (newGid, oldGid) => {
- if (newGid != oldGid) {
- reqconfig.otherOptions.gid = newGid
- getData()
- }
- }
- )
- // 监听传入的datalist的变化,然后去更新数据
- const changeDataList = watch(
- () => [props.dataList],
- () => {
- getData()
- },
- {
- deep: true
- }
- )
- // 监听日期的变化,
- const watchDateChange = watch(
- () => [props.requestConfig?.otherOptions.startTime, props.requestConfig?.otherOptions.endTime],
- () => {
- getData()
- },
- { deep: true }
- )
- /**
- * @description: 创建row-key优化表格性能
- * @return {*}
- */
- const createRowKey = () => {
- return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
- }
- //如果没有日期就取消掉
- if (!props.requestConfig?.otherOptions.startTime && !props.requestConfig?.otherOptions.endTime) {
- watchDateChange()
- }
- // 没传入datalist则取消该监听
- if (!props.dataList) {
- changeDataList()
- }
- // 没有开启分页查询就关闭掉这个监听
- if (!props.openPageQuery) {
- changePageLimit()
- }
- /**
- * @description: 拷贝一份配置文件
- * @return {*}
- */
- const initpageConfig = () => {
- Object.assign(paginationConfig2, props.paginationConfig)
- }
- /**
- * @description: 初始化请求配置,用于把拷贝一份新的数据
- * @return {*}
- */
- const initReqConfig = () => {
- Object.assign(reqconfig, props.requestConfig)
- }
- /**
- * @description: 初始化查询框的数据
- * @return {*}
- */
- const initFormData = () => {
- props.queryInfo?.map((item: any) => {
- queryFormData[item.name] = item.default
- })
- // backupQueryFormData = JSON.parse(JSON.stringify(queryFormData))
- Object.assign(backupQueryFormData, JSON.parse(JSON.stringify(queryFormData)))
- }
- /**
- * @description: 表格排序
- * @param {*} data 获取到的数据
- * @return {*}
- */
- const tableSortChange = (data: { column: any; prop: string; order: any }) => {
- let { order } = { ...data }
- if (order === 'ascending') order = 'asc'
- else if (order === 'descending') order = 'desc'
- else order = ''
- reqconfig.otherOptions.order = order
- getData()
- }
- /**
- * @description: 删除行
- * @param {*} url 请求地址
- * @param {*} row 行数据
- * @return {*}
- */
- const deleteRow = (url: string, filedsInfo: any) => {
- axiosInstance
- .post(url, { ...filedsInfo })
- .then((data) => {
- analysisResCode(data).then(() => {
- getData()
- })
- })
- .catch((err) => {
- console.log(err)
- })
- }
- /**
- * @description: 下载表格数据
- * @return {*}
- */
- const downLoadTable = () => {
- emits('downLoad', JSON.parse(JSON.stringify(tableData)))
- }
- /**
- * @description: 外部获取数据
- * @return {*}
- */
- const outGetTableData = () => {
- return toRaw(tableData).flat()
- }
- // 定义暴露出去的方法
- defineExpose({
- getData,
- resetTableData,
- deleteRow,
- downLoadTable,
- outGetTableData
- })
- onMounted(() => {
- initpageConfig()
- initReqConfig()
- initFormData()
- if (props.loadingState !== undefined) {
- loading.value = props.loadingState
- }
- // if (!props.openPageQuery) {
- // getData()
- // }
- // 去加载所有需要的资源
- initLoadResouce(resourceInfo).then((data) => {
- Object.assign(blobUrlInfo, data)
- })
- })
- </script>
- <template>
- <div class="tableContent">
- <div class="filterBox" v-if="openFilterQuery">
- <!-- slot -->
- <div class="filterHeader">
- <span>查询条件</span>
- </div>
- <div class="filterBody">
- <el-form
- :inline="true"
- ref="queryFormRef"
- :model="queryFormData"
- class="queryForm"
- :label-position="'left'"
- >
- <!-- 所有的input查询框 -->
- <el-form-item :label="item.label" v-for="item in inputFieldsList" class="filterItem">
- <el-input
- v-model="queryFormData[item.name]"
- :placeholder="item.placeholder"
- clearable
- />
- </el-form-item>
- <!-- 所有选择框 -->
- <!-- <el-config-provider :value-on-clear="null" :empty-values="[undefined, null]"> -->
- <el-form-item :label="item.label" v-for="item in selectFieldsList" class="filterItem">
- <el-select
- :empty-values="[undefined, null]"
- v-model="queryFormData[item.name]"
- :placeholder="item.placeholder"
- :value-key="item.name"
- >
- <el-option v-for="val in item.otherOption" :label="val.cnName" :value="val.value" />
- </el-select>
- </el-form-item>
- <!-- </el-config-provider> -->
- <!-- 所有日期选择框 -->
- <el-form-item :label="item.label" v-for="item in dateFieldsList" class="filterItem">
- <el-date-picker
- v-model="queryFormData[item.name]"
- type="date"
- :placeholder="item.placeholder"
- clearable
- />
- </el-form-item>
- </el-form>
- <!-- 分割线 -->
- <!-- <el-divider class="queryPartition" content-position="center" direction="vertical" /> -->
- <div class="queryBox">
- <el-divider class="queryPartition" content-position="center" direction="vertical" />
- <div class="queryBtnBox">
- <el-button class="queryBtn" color="#165dff" @click="queryTableData">
- <el-icon><Search /></el-icon>查询
- </el-button>
- <el-button class="refreshBtn" color="#f2f3f5" @click="resetQueryForm(queryFormRef)">
- <el-icon><RefreshRight /></el-icon>重置
- </el-button>
- </div>
- </div>
- </div>
- </div>
- <!-- 分割线 -->
- <!-- <el-divider class="partition" content-position="center" /> -->
- <div class="tableTools">
- <div class="leftTools">
- <div class="leftToolsGroup" v-if="needLeftTools" style="display: flex">
- <el-button class="leftToolBtn" color="#165dff" @click="emits('addNewItem')">
- <el-icon><Plus /></el-icon>新增
- </el-button>
- <el-button
- class="leftToolBtn"
- color="#626aef"
- @click="emits('upload', outGetTableData())"
- v-if="needUpload"
- >
- <el-icon><Upload /></el-icon>上传
- </el-button>
- </div>
- </div>
- <div class="rightTools" v-if="needRightTools">
- <el-button
- v-if="needDownload"
- color="#f0f1f3"
- size="default"
- class="rightToolsItem"
- @click="downLoadTable"
- >
- <el-icon><Download /></el-icon>下载
- </el-button>
- <RegreshBtn @refresh-table="getData" :icon-size="toolsIconSize"></RegreshBtn>
- <FilterPopover
- :table-fields-info="tableFieldsInfo"
- :icon-size="toolsIconSize"
- ></FilterPopover>
- </div>
- </div>
- <div class="tableBox">
- <!-- 没有分页的时候需要重新计算一下data -->
- <el-table
- :data="openPageQuery ? tableData[paginationConfig2.currentPage] : tableDataNoPaging"
- style="width: 100%"
- class="tableBody"
- :cell-style="tableCellStyle"
- v-loading="loading"
- :row-key="createRowKey()"
- @sort-change="tableSortChange"
- >
- <el-table-column
- v-if="props.needRowindex"
- align="center"
- label="#"
- type="index"
- :index="computedRowIndex"
- />
- <template v-for="item in tableFieldsInfo">
- <el-table-column
- :prop="item.name"
- :label="item.cnName"
- :min-width="item.specialEffect?.type === FieldSpecialEffectType.DROPDOWN ? '170px' : ''"
- align="center"
- show-overflow-tooltip
- v-if="item.isShow"
- :sortable="item.needSort === true ? 'custorm' : false"
- >
- <template v-slot="scope">
- <!-- tag类 -->
- <el-tag
- v-if="item.specialEffect?.type === FieldSpecialEffectType.TAG"
- :type="scope.row[item.name] ? 'danger' : 'success'"
- >
- {{
- scope.row[item.name]
- ? item.specialEffect.othnerInfo.text[0]
- : item.specialEffect.othnerInfo.text[1]
- }}
- </el-tag>
- <!-- :src="loadResource(scope.row[item.name])" -->
- <!-- :src="scope.row[item.name]" -->
- <!-- 头像类 -->
- <el-image
- v-else-if="item.specialEffect?.type === FieldSpecialEffectType.IMG"
- :preview-teleported="true"
- :src="scope.row[item.name]"
- :preview-src-list="[scope.row[item.name]]"
- style="width: 35px; height: 35px"
- :fit="'fill'"
- :hide-on-click-modal="true"
- >
- <template #error>
- <!-- -->
- <img style="width: 35px; height: 35px" :src="blobUrlInfo.defaultHead" />
- </template>
- </el-image>
- <!-- 文字类 -->
- <el-text
- v-else-if="item.specialEffect?.type === FieldSpecialEffectType.TEXT"
- :type="
- scope.row[item.name]
- ? item.specialEffect.othnerInfo.color[0]
- : item.specialEffect.othnerInfo.color[1]
- "
- >
- {{ scope.row[item.name] }}
- </el-text>
- <!-- 翻译类 -->
- <el-text v-else-if="item.specialEffect?.type === FieldSpecialEffectType.TRANSLATE">
- <el-icon
- v-if="item.specialEffect.othnerInfo.icon"
- style="padding-right: 8px"
- :color="scope.row[item.name] ? '#409EFF' : '#F56C6C'"
- ><icon-tabler-point-filled></icon-tabler-point-filled
- ></el-icon>
- {{
- item.specialEffect.othnerInfo.translateText[scope.row[item.name]]
- ? item.specialEffect.othnerInfo.translateText[scope.row[item.name]]
- : '未知'
- }}
- </el-text>
- <!-- 状态类 -->
- <el-text v-else-if="item.specialEffect?.type === FieldSpecialEffectType.STATE">
- <span>
- <el-icon
- style="padding-right: 8px"
- :color="scope.row[item.name] ? '#409EFF' : '#F56C6C'"
- ><icon-tabler-point-filled></icon-tabler-point-filled
- ></el-icon>
- {{
- scope.row[item.name]
- ? item.specialEffect.othnerInfo.text[0]
- : item.specialEffect.othnerInfo.text[1]
- }}</span
- >
- </el-text>
- <!-- 开关类 -->
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-else-if="item.specialEffect?.type === FieldSpecialEffectType.SWITCH"
- v-model="scope.row[item.name]"
- :data="scope.row[item.name]"
- size="default"
- >
- </el-switch>
- <!-- 下拉菜单类 -->
- <el-dropdown
- trigger="click"
- v-else-if="item.specialEffect?.type === FieldSpecialEffectType.DROPDOWN"
- >
- <span
- class="el-dropdown-link"
- style="display: flex; align-items: center; cursor: pointer"
- >
- <el-icon
- style="padding-right: 8px"
- :color="scope.row[item.name] ? '#409EFF' : '#F56C6C'"
- ><icon-tabler-point-filled></icon-tabler-point-filled
- ></el-icon>
- {{
- scope.row[item.name]
- ? item.specialEffect.othnerInfo.text[0]
- : item.specialEffect.othnerInfo.text[1]
- }}
- <el-icon class="el-icon--right"><arrow-down /></el-icon>
- </span>
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item :command="{ value: true }">使用中</el-dropdown-item>
- <el-dropdown-item :command="{ value: false }">已弃用</el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- <el-text v-else>
- <!-- 其他列按默认方式显示 -->
- {{
- props.needAverage &&
- scope.row[item.name] !== undefined &&
- item.name !== 'count' &&
- item.name !== 'date'
- ? scope.row[item.name] + '%'
- : scope.row[item.name]
- }}
- </el-text>
- </template>
- </el-table-column>
- </template>
- <slot name="tableOperation"></slot>
- </el-table>
- <div class="userTablePaginationBox">
- <el-pagination
- class="userTablePagination"
- background
- :page-size="paginationConfig2.limit"
- :page-sizes="paginationConfig2.pagesizeList"
- table-layout="fixed"
- layout="prev, pager, next ,jumper ,sizes,total,"
- :total="paginationConfig2.total"
- :current-page.sync="paginationConfig2.currentPage"
- @current-change="handleCurrentChange"
- @size-change="handleSizeChange"
- />
- </div>
- </div>
- </div>
- </template>
- <style scoped>
- .tableContent {
- margin: 10px auto 20px;
- width: 100%;
- /* height: 100%; */
- box-shadow:
- 0 4px 8px 0 rgba(0, 0, 0, 0.02),
- 0 1px 3px 0 rgba(0, 0, 0, 0.02);
- }
- .filterBox,
- .tableBox {
- width: 100%;
- }
- .filterBox {
- margin-top: 1%;
- min-height: 18%;
- display: flex;
- flex-direction: column;
- }
- .filterHeader,
- .filterBody {
- width: 98%;
- margin: 0 auto;
- }
- .filterHeader {
- display: flex;
- align-items: center;
- color: black;
- font-size: 16px;
- font-weight: bold;
- /* background-color: lightblue; */
- /* margin-bottom: 1%; */
- }
- .filterBody {
- display: flex;
- }
- .queryBox {
- width: 10%;
- display: flex;
- justify-content: space-around;
- }
- .queryBtnBox {
- width: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .refreshBtn {
- margin-top: 10%;
- margin-bottom: 10%;
- }
- .queryPartition {
- height: 90%;
- }
- .queryForm {
- width: 90%;
- display: flex;
- flex-wrap: wrap;
- /* justify-content: space-between; */
- }
- .filterItem {
- width: 20%;
- display: flex;
- align-items: center;
- }
- .partition {
- width: 98%;
- margin: 0 auto;
- }
- .tableTools {
- width: 98%;
- margin: 0 auto;
- display: flex;
- justify-content: space-between;
- margin-top: 1%;
- }
- .leftTools,
- .rightTools {
- width: 10%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .rightTools {
- width: 5%;
- }
- .tableBox {
- width: 98%;
- /* height: 98%; */
- margin: 5px auto;
- box-shadow:
- 0 4px 8px 0 rgba(0, 0, 0, 0.02),
- 0 1px 3px 0 rgba(0, 0, 0, 0.02);
- /* margin-top: 0.5%;
- margin-bottom: 2%; */
- }
- .tableBody {
- box-shadow: 0 0 3px 0px rgba(0, 0, 0, 0.1);
- /* box-shadow:
- -4px -4px 8px 1px rgba(0, 0, 0, 0.02),
- -4px -4px 3px 1px rgba(0, 0, 0, 0.02); */
- }
- .userTablePaginationBox {
- box-sizing: border-box;
- width: 98%;
- margin: 0% auto;
- padding: 1% 0;
- display: flex;
- justify-content: center;
- }
- .averageItem {
- font-size: 14px;
- color: #515b6f;
- }
- .normalItem {
- font-size: 14px;
- color: #515b6f;
- font-weight: 400;
- }
- .leftToolBtn {
- margin-right: 5px;
- }
- </style>
|