diff --git a/public/人口登记表-zhCn.xlsx b/public/人口登记表-zhCn.xlsx index 7e88377..01e1384 100644 Binary files a/public/人口登记表-zhCn.xlsx and b/public/人口登记表-zhCn.xlsx differ diff --git a/src/components/DaiysuiTable/index.vue b/src/components/DaiysuiTable/index.vue index 30c0fa6..86d4f4d 100644 --- a/src/components/DaiysuiTable/index.vue +++ b/src/components/DaiysuiTable/index.vue @@ -49,7 +49,7 @@ const actionsColumns = computed(() => { {{ item.id }} - {{ column.formatValue(item) }} + {{ item[column.props] }} diff --git a/src/hooks/useElement.ts b/src/hooks/useElement.ts index 4322c9a..abacabc 100644 --- a/src/hooks/useElement.ts +++ b/src/hooks/useElement.ts @@ -49,7 +49,12 @@ export function useElementStyle(element: any, person: IPersonConfig, index: numb element.children[2].innerHTML = `${person.department ? person.department : ''}
${person.identity ? person.identity : ''}` } - return element + element.children[2].style.fontSize = textSize * 0.5 + 'px' + if (person.department || person.identity) { + element.children[2].innerHTML = `${person.department ? person.department : ''}
${person.identity ? person.identity : ''}` + } + element.children[3].src = person.avatar + return element } /** diff --git a/src/locales/en.ts b/src/locales/en.ts index a1b698b..e304819 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -79,6 +79,7 @@ export default { highlightColor: 'HighLight Color', patternSetting: 'Pattern Setting', alwaysDisplay: 'Always Display Prize List', + avatarDisplay: 'Show avatars or not', selectPicture: 'Select a Picture', backgroundImage: 'Select Background Image', }, @@ -132,6 +133,7 @@ export default { no: 'No', number: 'Number', isWin: 'isWin', + avatar: 'avatar', department: 'Department', name: 'Name', identity: 'Identity', diff --git a/src/locales/zhCn.ts b/src/locales/zhCn.ts index 1adf959..94b741d 100644 --- a/src/locales/zhCn.ts +++ b/src/locales/zhCn.ts @@ -79,6 +79,7 @@ export default { highlightColor: '高亮颜色', patternSetting: '图案设置', alwaysDisplay: '常显奖项列表', + avatarDisplay: '是否显示头像', selectPicture: '选择一张图片', backgroundImage: '选择背景图片', }, @@ -132,6 +133,7 @@ export default { no: '否', number: '编号', isWin: '是否中奖', + avatar: '头像', department: '部门', name: '姓名', identity: '身份', diff --git a/src/store/data.ts b/src/store/data.ts index 0ef5de1..259aa1b 100644 --- a/src/store/data.ts +++ b/src/store/data.ts @@ -2,43 +2,8 @@ import type { IPersonConfig, IPrizeConfig } from '@/types/storeType' export const defaultPersonList = [ - { uid: 'U100156001', name: '朱厚熜', department: '皇室', identity: '万岁爷', x: 1, y: 1, id: 0, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156002', name: '朱载垕', department: '皇室', identity: '裕王', x: 2, y: 1, id: 1, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156003', name: '朱翊钧 ', department: '皇室', identity: '裕王世子', x: 3, y: 1, id: 2, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156004', name: '严嵩', department: '内阁', identity: '首辅', x: 4, y: 1, id: 3, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156005', name: '徐阶', department: '内阁', identity: '次辅、户部尚书', x: 5, y: 1, id: 4, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156006', name: '张居正', department: '内阁', identity: '阁臣、兵部侍郞', x: 6, y: 1, id: 5, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156007', name: '高拱', department: '内阁', identity: '阁臣、户部侍郞', x: 7, y: 1, id: 6, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156008', name: '严世蕃', department: '内阁', identity: '吏部侍郞', x: 8, y: 1, id: 7, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156009', name: '胡宗宪', department: '大臣', identity: '浙直总督', x: 9, y: 1, id: 8, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156010', name: '戚继光', department: '大臣', identity: '都督佥事', x: 10, y: 1, id: 9, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156011', name: '高瀚文', department: '大臣', identity: '杭州知府', x: 11, y: 1, id: 10, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156012', name: '赵贞吉', department: '大臣', identity: '江苏巡抚', x: 12, y: 1, id: 11, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156013', name: '海瑞', department: '大臣', identity: '淳安知县', x: 13, y: 1, id: 12, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156014', name: '何茂才', department: '大臣', identity: '浙江布政使兼按察使', x: 14, y: 1, id: 13, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156015', name: '郑泌昌', department: '大臣', identity: '浙江巡抚', x: 15, y: 1, id: 14, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156016', name: '王用汲', department: '大臣', identity: '建德知县', x: 16, y: 1, id: 15, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156017', name: '谭纶', department: '大臣', identity: '浙直总督府参军', x: 17, y: 1, id: 16, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156018', name: '朱七', department: '大臣', identity: '北镇抚司', x: 1, y: 2, id: 17, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156019', name: '罗龙文', department: '大臣', identity: '通政使司通政使', x: 2, y: 2, id: 18, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156020', name: '马宁远', department: '大臣', identity: '杭州知府', x: 3, y: 2, id: 19, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156021', name: '田有禄 ', department: '大臣', identity: '淳安县丞', x: 4, y: 2, id: 20, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156022', name: '周云逸', department: '大臣', identity: '钦天监监正', x: 5, y: 2, id: 21, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156023', name: '蒋千户', department: '大臣', identity: '浙江按察使司', x: 6, y: 2, id: 22, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156024', name: '徐千户', department: '大臣', identity: '浙江按察使司', x: 7, y: 2, id: 23, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156025', name: '王牢头 ', department: '大臣', identity: '牢头', x: 8, y: 2, id: 24, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156026', name: '赵班头', department: '大臣', identity: '班头', x: 9, y: 2, id: 25, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156027', name: '吕芳', department: '太监', identity: '掌印太监', x: 10, y: 2, id: 26, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156028', name: '杨金水', department: '太监', identity: '织造局', x: 11, y: 2, id: 27, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156029', name: '陈洪', department: '太监', identity: '首席秉笔太监', x: 12, y: 2, id: 28, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156030', name: '黄锦', department: '太监', identity: '秉笔太监', x: 13, y: 2, id: 29, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156031', name: '李玄', department: '太监', identity: '新安江河道监管', x: 14, y: 2, id: 30, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156032', name: '冯保', department: '太监', identity: '世子大伴', x: 15, y: 2, id: 31, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156033', name: '李时珍', department: '江湖', identity: '名医', x: 16, y: 2, id: 32, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156034', name: '沈一石 ', department: '江湖', identity: '商人', x: 17, y: 2, id: 33, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156035', name: '井上十四郎', department: '江湖', identity: '倭寇', x: 1, y: 3, id: 34, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - { uid: 'U100156036', name: '芸娘', department: '江湖', x: 2, y: 3, id: 35, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, - ] + { uid: 'U100156001', name: '朱厚熜', department: '皇室', identity: '万岁爷', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500", x: 1, y: 1, id: 0, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156002', name: '朱载垕', department: '皇室', identity: '裕王', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500", x: 2, y: 1, id: 1, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156003', name: '朱翊钧 ', department: '皇室', identity: '裕王世子', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 3, y: 1, id: 2, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156004', name: '严嵩', department: '内阁', identity: '首辅', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 4, y: 1, id: 3, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156005', name: '徐阶', department: '内阁', identity: '次辅、户部尚书', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 5, y: 1, id: 4, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156006', name: '张居正', department: '内阁', identity: '阁臣、兵部侍郞', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 6, y: 1, id: 5, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156007', name: '高拱', department: '内阁', identity: '阁臣、户部侍郞', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 7, y: 1, id: 6, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156008', name: '严世蕃', department: '内阁', identity: '吏部侍郞', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 8, y: 1, id: 7, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156009', name: '胡宗宪', department: '大臣', identity: '浙直总督', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 9, y: 1, id: 8, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156010', name: '戚继光', department: '大臣', identity: '都督佥事', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 10, y: 1, id: 9, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156011', name: '高瀚文', department: '大臣', identity: '杭州知府', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 11, y: 1, id: 10, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156012', name: '赵贞吉', department: '大臣', identity: '江苏巡抚', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 12, y: 1, id: 11, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156013', name: '海瑞', department: '大臣', identity: '淳安知县', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 13, y: 1, id: 12, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156014', name: '何茂才', department: '大臣', identity: '浙江布政使兼按察使', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 14, y: 1, id: 13, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156015', name: '郑泌昌', department: '大臣', identity: '浙江巡抚', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 15, y: 1, id: 14, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156016', name: '王用汲', department: '大臣', identity: '建德知县', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 16, y: 1, id: 15, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156017', name: '谭纶', department: '大臣', identity: '浙直总督府参军', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 17, y: 1, id: 16, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156018', name: '朱七', department: '大臣', identity: '北镇抚司', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 1, y: 2, id: 17, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156019', name: '罗龙文', department: '大臣', identity: '通政使司通政使', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 2, y: 2, id: 18, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156020', name: '马宁远', department: '大臣', identity: '杭州知府', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 3, y: 2, id: 19, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156021', name: '田有禄 ', department: '大臣', identity: '淳安县丞', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 4, y: 2, id: 20, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156022', name: '周云逸', department: '大臣', identity: '钦天监监正', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 5, y: 2, id: 21, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156023', name: '蒋千户', department: '大臣', identity: '浙江按察使司', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 6, y: 2, id: 22, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156024', name: '徐千户', department: '大臣', identity: '浙江按察使司', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 7, y: 2, id: 23, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156025', name: '王牢头 ', department: '大臣', identity: '牢头', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 8, y: 2, id: 24, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156026', name: '赵班头', department: '大臣', identity: '班头', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 9, y: 2, id: 25, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156027', name: '吕芳', department: '太监', identity: '掌印太监', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 10, y: 2, id: 26, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156028', name: '杨金水', department: '太监', identity: '织造局', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 11, y: 2, id: 27, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156029', name: '陈洪', department: '太监', identity: '首席秉笔太监', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 12, y: 2, id: 28, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156030', name: '黄锦', department: '太监', identity: '秉笔太监', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 13, y: 2, id: 29, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156031', name: '李玄', department: '太监', identity: '新安江河道监管', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 14, y: 2, id: 30, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156032', name: '冯保', department: '太监', identity: '世子大伴', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 15, y: 2, id: 31, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156033', name: '李时珍', department: '江湖', identity: '名医', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 16, y: 2, id: 32, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156034', name: '沈一石 ', department: '江湖', identity: '商人', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 17, y: 2, id: 33, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156035', name: '井上十四郎', department: '江湖', identity: '倭寇', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 1, y: 3, id: 34, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }, { uid: 'U100156036', name: '芸娘', department: '江湖', avatar: "https://img1.baidu.com/it/u=2165937980,813753762&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",x: 2, y: 3, id: 35, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: [], prizeTime: [], prizeId: [] }] + export const defaultMusicList = [ { id: `Geoff Knorr - China (The Industrial Era).ogg${new Date().getTime().toString()}`, diff --git a/src/store/globalConfig.ts b/src/store/globalConfig.ts index 205e2e9..a483522 100644 --- a/src/store/globalConfig.ts +++ b/src/store/globalConfig.ts @@ -9,6 +9,7 @@ export const useGlobalConfig = defineStore('global', { globalConfig: { rowCount: 17, isSHowPrizeList: true, + isShowAvatar: true, topTitle: i18n.global.t('data.defaultTitle'), language: browserLanguage, theme: { @@ -105,6 +106,10 @@ export const useGlobalConfig = defineStore('global', { getBackground(state) { return state.globalConfig.theme.background }, + // 获取是否显示头像 + getIsShowAvatar(state) { + return state.globalConfig.isShowAvatar; + } }, actions: { // 设置rowCount @@ -226,12 +231,17 @@ export const useGlobalConfig = defineStore('global', { // 设置背景图片 setBackground(background: any) { this.globalConfig.theme.background = background + }, + // 设置是否显示头像 + setIsShowAvatar(isShowAvatar: boolean) { + this.globalConfig.isShowAvatar = isShowAvatar; }, // 重置所有配置 reset() { this.globalConfig = { rowCount: 17, isSHowPrizeList: true, + isShowAvatar: false, topTitle: i18n.global.t('data.defaultTitle'), language: browserLanguage, theme: { diff --git a/src/style/style.scss b/src/style/style.scss index 7f6c735..ec96d54 100644 --- a/src/style/style.scss +++ b/src/style/style.scss @@ -4,8 +4,9 @@ user-select: none; .card-id { position: absolute; - top: 20px; + top: 10px; right: 20px; + z-index: 2; } .card-name { @@ -17,6 +18,15 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + z-index: 2; + } + + .card-avatar-name{ + top: auto; + bottom: 0; + left: 0px; + right: 0; + line-height: 2 !important; } .card-detail { @@ -24,12 +34,24 @@ left: 0; right: 0; bottom: 15px; + z-index: 2; + } + + .card-avatar{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1; + width: 140px !important; + height: auto !important; + object-fit: cover; } } .lucky-element-card { cursor: default; - text-align: center; &::before { background-color: linear-gradient(-45deg, #e81cff 0%, #40c9ff 100%); border: 1px solid linear-gradient(-45deg, #e81cff 0%, #40c9ff 100%); @@ -39,9 +61,12 @@ position: absolute; top: 20px; right: 20px; + z-index: 2; } .card-name { + text-align: center; + z-index: 2; position: absolute; top: 40px; left: 0px; @@ -59,6 +84,20 @@ position: absolute; left: 0; right: 0; + text-align: center; + z-index: 2; bottom: 15px; } + + .card-avatar{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1; + width: 280px !important; + height: auto !important; + object-fit: cover; + } } diff --git a/src/types/storeType.ts b/src/types/storeType.ts index fc9e781..799d4b8 100644 --- a/src/types/storeType.ts +++ b/src/types/storeType.ts @@ -1,17 +1,18 @@ export interface IPersonConfig { - id: number - uid: string - name: string - department: string - identity: string - isWin: boolean - x: number - y: number - createTime: string - updateTime: string - prizeName: string[] - prizeId: string[] - prizeTime: string[] + id: number; + uid: string; + name: string; + department: string; + identity: string; + avatar: string; + isWin: boolean; + x: number; + y: number + createTime: string; + updateTime: string; + prizeName: string[]; + prizeId: string[]; + prizeTime: string[]; } export interface Separate { id: string diff --git a/src/views/Config/Global/FaceConfig.vue b/src/views/Config/Global/FaceConfig.vue index d817065..480af30 100644 --- a/src/views/Config/Global/FaceConfig.vue +++ b/src/views/Config/Global/FaceConfig.vue @@ -17,7 +17,7 @@ const { t } = useI18n() const globalConfig = useStore().globalConfig const personConfig = useStore().personConfig const prizeConfig = useStore().prizeConfig -const { getTopTitle: topTitle, getTheme: localTheme, getPatterColor: patternColor, getPatternList: patternList, getCardColor: cardColor, getLuckyColor: luckyCardColor, getTextColor: textColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getIsShowPrizeList: isShowPrizeList, getLanguage: userLanguage, getBackground: backgroundImage, getImageList: imageList, +const { getTopTitle: topTitle, getTheme: localTheme, getPatterColor: patternColor, getPatternList: patternList, getCardColor: cardColor, getLuckyColor: luckyCardColor, getTextColor: textColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getIsShowPrizeList: isShowPrizeList, getLanguage: userLanguage, getBackground: backgroundImage, getImageList: imageList, getIsShowAvatar: isShowAvatar } = storeToRefs(globalConfig) const { getAlreadyPersonList: alreadyPersonList, getNotPersonList: notPersonList } = storeToRefs(personConfig) const colorPickerRef = ref() @@ -36,6 +36,7 @@ const textSizeValue = ref(structuredClone(textSize.value)) const rowCountValue = ref(structuredClone(rowCount.value)) const languageValue = ref(structuredClone(userLanguage.value)) const isShowPrizeListValue = ref(structuredClone(isShowPrizeList.value)) +const isShowAvatarValue = ref(structuredClone(isShowAvatar.value)) const patternColorValue = ref(structuredClone(patternColor.value)) const themeList = ref(Object.keys(daisyuiThemes)) const daisyuiThemeList = ref(daisyuiThemes) @@ -156,6 +157,9 @@ watch(backgroundImageValue, (val) => { watch(languageValue, (val: string) => { globalConfig.setLanguage(val) }) +watch(isShowAvatarValue, () => { + globalConfig.setIsShowAvatar(isShowAvatarValue.value) +}) onMounted(() => { }) @@ -344,6 +348,14 @@ onMounted(() => { @change="isShowPrizeListValue = !isShowPrizeListValue" > + + diff --git a/src/views/Config/Person/PersonAll.vue b/src/views/Config/Person/PersonAll.vue index 3b8402e..f2732c6 100644 --- a/src/views/Config/Person/PersonAll.vue +++ b/src/views/Config/Person/PersonAll.vue @@ -95,6 +95,13 @@ const tableColumns = [ label: i18n.global.t('data.department'), props: 'department', }, + { + label: i18n.global.t('data.avatar'), + props: 'avatar', + formatValue(row: any) { + return row.avatar ? `avatar` : '-'; + } + }, { label: i18n.global.t('data.identity'), props: 'identity', diff --git a/src/views/Config/Person/PersonAlready.vue b/src/views/Config/Person/PersonAlready.vue index fb68e6a..04335d3 100644 --- a/src/views/Config/Person/PersonAlready.vue +++ b/src/views/Config/Person/PersonAlready.vue @@ -35,6 +35,13 @@ const tableColumnsList = [ label: i18n.global.t('data.name'), props: 'name', }, + { + label: i18n.global.t('data.avatar'), + props: 'avatar', + formatValue(row: any) { + return row.avatar ? `avatar` : '-'; + } + }, { label: i18n.global.t('data.department'), props: 'department', @@ -71,6 +78,13 @@ const tableColumnsDetail = [ label: i18n.global.t('data.number'), props: 'name', }, + { + label: i18n.global.t('data.avatar'), + props: 'avatar', + formatValue(row: any) { + return row.avatar ? `avatar` : '-'; + } + }, { label: i18n.global.t('data.department'), props: 'department', diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index 154c6f3..e14d16c 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -30,7 +30,7 @@ const prizeConfig = useStore().prizeConfig const { getAllPersonList: allPersonList, getNotPersonList: notPersonList, getNotThisPrizePersonList: notThisPrizePersonList, } = storeToRefs(personConfig) const { getCurrentPrize: currentPrize } = storeToRefs(prizeConfig) -const { getTopTitle: topTitle, getCardColor: cardColor, getPatterColor: patternColor, getPatternList: patternList, getTextColor: textColor, getLuckyColor: luckyColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getBackground: homeBackground } = storeToRefs(globalConfig) +const { getTopTitle: topTitle, getCardColor: cardColor, getPatterColor: patternColor, getPatternList: patternList, getTextColor: textColor, getLuckyColor: luckyColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getBackground: homeBackground, getIsShowAvatar: isShowAvatar } = storeToRefs(globalConfig) const tableData = ref([]) const currentStatus = ref(0) // 0为初始状态, 1为抽奖准备状态,2为抽奖中状态,3为抽奖结束状态 const ballRotationY = ref(0) @@ -119,18 +119,30 @@ function init() { const number = document.createElement('div') number.className = 'card-id' number.textContent = tableData.value[i].uid + if(isShowAvatar.value) number.style.display = 'none' element.appendChild(number) const symbol = document.createElement('div') symbol.className = 'card-name' symbol.textContent = tableData.value[i].name + if(isShowAvatar.value) symbol.className = 'card-name card-avatar-name' element.appendChild(symbol) const detail = document.createElement('div') detail.className = 'card-detail' detail.innerHTML = `${tableData.value[i].department}
${tableData.value[i].identity}` + if(isShowAvatar.value) detail.style.display = 'none' element.appendChild(detail) + const avatar = document.createElement('img'); + avatar.className = 'card-avatar'; + avatar.src = tableData.value[i].avatar; + avatar.alt = 'avatar'; + avatar.style.width = '140px'; + avatar.style.height = '140px'; + if(!isShowAvatar.value) avatar.style.display = 'none' + element.appendChild(avatar); + element = useElementStyle(element, tableData.value[i], i, patternList.value, patternColor.value, cardColor.value, cardSize.value, textSize.value) const object = new CSS3DObject(element) object.position.x = Math.random() * 4000 - 2000