|
@@ -18,10 +18,10 @@ import { useTable } from '@/hooks/useTable.ts'
|
|
import { useRequest } from '@/hooks/useRequest.ts'
|
|
import { useRequest } from '@/hooks/useRequest.ts'
|
|
import { computed, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
import { computed, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
|
|
|
|
-import TableFilterForm from '../form/TableFilterForm/TableFilterForm.vue'
|
|
|
|
-import TableFieldText from './TableFieldText.vue'
|
|
|
|
|
|
+import TableFilterForm from '@/components/table/TableFilterForm/TableFilterForm.vue'
|
|
import axiosInstance from '@/utils/axios/axiosInstance.ts'
|
|
import axiosInstance from '@/utils/axios/axiosInstance.ts'
|
|
import TableTools from './TableTools.vue'
|
|
import TableTools from './TableTools.vue'
|
|
|
|
+import TableColumn from './TableColumn/TableColumn.vue'
|
|
|
|
|
|
type TableFilterFormRef = InstanceType<typeof TableFilterForm>
|
|
type TableFilterFormRef = InstanceType<typeof TableFilterForm>
|
|
|
|
|
|
@@ -518,61 +518,11 @@ onMounted(() => {
|
|
:sortable="item.needSort ? 'custom' : false"
|
|
:sortable="item.needSort ? 'custom' : false"
|
|
>
|
|
>
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
- <!-- 头像类 -->
|
|
|
|
- <el-image
|
|
|
|
- v-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
|
|
|
|
- alt="头像"
|
|
|
|
- style="width: 35px; height: 35px"
|
|
|
|
- :src="blobUrlInfo.defaultHead"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- </el-image>
|
|
|
|
-
|
|
|
|
- <!-- 文字类 -->
|
|
|
|
- <!-- :value="tableTextFieldVal(item, scope)" -->
|
|
|
|
- <span v-else-if="item.specialEffect?.type === FieldSpecialEffectType.TEXT">
|
|
|
|
- <TableFieldText :special-effect="item.specialEffect" :value="scope.row[item.name]">
|
|
|
|
- </TableFieldText>
|
|
|
|
- </span>
|
|
|
|
-
|
|
|
|
- <!-- 开关类 -->
|
|
|
|
-
|
|
|
|
- <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>
|
|
|
|
-
|
|
|
|
- <span v-else-if="item.specialEffect?.type === FieldSpecialEffectType.CUSTOM">
|
|
|
|
- {{ item.specialEffect.otherInfo.render(scope.row[item.name]) }}
|
|
|
|
- </span>
|
|
|
|
-
|
|
|
|
- <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>
|
|
|
|
|
|
+ <TableColumn
|
|
|
|
+ :column-config="item"
|
|
|
|
+ :row="scope.row"
|
|
|
|
+ :need-average="props.needAverage"
|
|
|
|
+ ></TableColumn>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</template>
|
|
</template>
|