feat: wow
This commit is contained in:
@@ -30,6 +30,7 @@ log-lottery是一个可配置可定制化的抽奖应用,炫酷3D球体,可
|
||||
- pinia
|
||||
- daisyui
|
||||
|
||||
> 项目思路来源于 https://github.com/moshang-xc/lottery
|
||||
## License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
"theme-change": "^2.5.0",
|
||||
"three": "^0.160.0",
|
||||
"three-css3d": "^1.0.6",
|
||||
"three-trackballcontrols": "^0.9.0",
|
||||
"vue": "^3.3.8",
|
||||
"vue-router": "^4.2.5",
|
||||
"vue-toast-notification": "^3",
|
||||
|
||||
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@@ -15,7 +15,6 @@ declare module 'vue' {
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
StarsBackground: typeof import('./components/StarsBackground/index.vue')['default']
|
||||
SvgIcon: typeof import('./components/SvgIcon/index.vue')['default']
|
||||
Table: typeof import('./components/Table/index.vue')['default']
|
||||
ToTop: typeof import('./components/ToTop/index.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue';
|
||||
import { TableItemType } from '@/types/table';
|
||||
const props = defineProps({
|
||||
tableHeader: {
|
||||
type: Array as PropType<TableItemType[]>,
|
||||
default: () => [],
|
||||
},
|
||||
tableData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
listLoading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
pagination: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 10,
|
||||
},
|
||||
currentPage: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
default: 100,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['handelSelect', 'handlePagination']);
|
||||
// 选择
|
||||
const handleSelectionChange = (val: []) => {
|
||||
emit('handelSelect', val);
|
||||
};
|
||||
// 改变分页
|
||||
const handleSizeChange = (val: number) => {
|
||||
emit('handlePagination', { pageSize: val, currentPage: props.currentPage });
|
||||
};
|
||||
const handleCurrentChange = (val: number) => {
|
||||
emit('handlePagination', {
|
||||
pageSize: props.pageSize,
|
||||
currentPage: val,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{
|
||||
background: '#f5f6fa',
|
||||
color: '#555',
|
||||
fontWeight: 'normal',
|
||||
fontSize: '12px',
|
||||
}"
|
||||
:cell-style="{ fontSize: '12px' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- 复选框 -->
|
||||
<el-table-column type="selection" width="55" />
|
||||
<!-- 数据 -->
|
||||
<template v-for="(item, index) in tableHeader" :key="index">
|
||||
<!-- 编辑按钮 -->
|
||||
<el-table-column
|
||||
v-if="item.actions"
|
||||
:prop="item.prop"
|
||||
:label="item.label"
|
||||
:width="item.width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<!-- 操作按钮 -->
|
||||
<div>
|
||||
<el-button
|
||||
text
|
||||
size="small"
|
||||
v-for="(action, index) in item.actions"
|
||||
:key="index"
|
||||
:type="action.type"
|
||||
@click="action.func(scope.row)"
|
||||
>{{ action.name }}</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 图片展示 -->
|
||||
<el-table-column
|
||||
v-else-if="item.image"
|
||||
:label="item.label"
|
||||
:width="item.width"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="row[item.prop]">
|
||||
<el-image
|
||||
preview-teleported
|
||||
:hide-on-click-modal="true"
|
||||
:preview-src-list="[row[item.prop!]]"
|
||||
:src="row[item.prop!]"
|
||||
fit="cover"
|
||||
style="width: 40px; height: 40px; border-radius: 8px"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>暂无图片</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- formatter信息展示-->
|
||||
<el-table-column
|
||||
v-else-if="item.formatter"
|
||||
:label="item.label"
|
||||
:width="item.width"
|
||||
:align="item.aligen || 'center'"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="item.getType!(row)"> {{ item.formatter(row) }}</el-tag>
|
||||
</template></el-table-column
|
||||
>
|
||||
<!--普通信息展示 -->
|
||||
<el-table-column
|
||||
v-else
|
||||
:label="item.label"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:align="item.aligen || 'center'"
|
||||
></el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<div v-if="pagination" class="float-right">
|
||||
<el-pagination
|
||||
background
|
||||
:small="true"
|
||||
layout="sizes,prev, pager, next"
|
||||
:total="total"
|
||||
:currentPage="currentPage"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style></style>
|
||||
@@ -13,8 +13,8 @@ import { Scene, PerspectiveCamera, Object3D, Vector3 } from 'three'
|
||||
// CSS3DRenderer, CSS3DObject
|
||||
// } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
|
||||
import { CSS3DRenderer, CSS3DObject } from 'three-css3d'
|
||||
// import { TrackballControls } from 'three/examples/jsm/controls/TrackballControls.js';
|
||||
import TrackballControls from 'three-trackballcontrols';
|
||||
import { TrackballControls } from 'three/examples/jsm/controls/TrackballControls.js';
|
||||
// import TrackballControls from 'three-trackballcontrols';
|
||||
// import TWEEN from 'three/examples/jsm/libs/tween.module.js';
|
||||
import * as TWEEN from '@tweenjs/tween.js'
|
||||
import useStore from '@/store'
|
||||
|
||||
Reference in New Issue
Block a user