init
This commit is contained in:
3
src/views/components/icons/element-icons.js
Normal file
3
src/views/components/icons/element-icons.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round']
|
||||
|
||||
export default elementIcons
|
||||
87
src/views/components/icons/index.vue
Normal file
87
src/views/components/icons/index.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div class="icons-container">
|
||||
<aside>
|
||||
<a href="#" target="_blank">Add and use
|
||||
</a>
|
||||
</aside>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="Icons">
|
||||
<div v-for="item of svgIcons" :key="item">
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
{{ generateIconCode(item) }}
|
||||
</div>
|
||||
<div class="icon-item">
|
||||
<svg-icon :icon-class="item" class-name="disabled" />
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="Element-UI Icons">
|
||||
<div v-for="item of elementIcons" :key="item">
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
{{ generateElementIconCode(item) }}
|
||||
</div>
|
||||
<div class="icon-item">
|
||||
<i :class="'el-icon-' + item" />
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import svgIcons from './svg-icons'
|
||||
import elementIcons from './element-icons'
|
||||
|
||||
export default {
|
||||
name: 'Icons',
|
||||
data() {
|
||||
return {
|
||||
svgIcons,
|
||||
elementIcons
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generateIconCode(symbol) {
|
||||
return `<svg-icon icon-class="${symbol}" />`
|
||||
},
|
||||
generateElementIconCode(symbol) {
|
||||
return `<i class="el-icon-${symbol}" />`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.icons-container {
|
||||
margin: 10px 20px 0;
|
||||
overflow: hidden;
|
||||
|
||||
.icon-item {
|
||||
margin: 20px;
|
||||
height: 85px;
|
||||
text-align: center;
|
||||
width: 100px;
|
||||
float: left;
|
||||
font-size: 30px;
|
||||
color: #24292e;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
10
src/views/components/icons/svg-icons.js
Normal file
10
src/views/components/icons/svg-icons.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const req = require.context('../../../assets/icons/svg', false, /\.svg$/)
|
||||
const requireAll = requireContext => requireContext.keys()
|
||||
|
||||
const re = /\.\/(.*)\.svg/
|
||||
|
||||
const svgIcons = requireAll(req).map(i => {
|
||||
return i.match(re)[1]
|
||||
})
|
||||
|
||||
export default svgIcons
|
||||
185
src/views/components/rankList/index.vue
Normal file
185
src/views/components/rankList/index.vue
Normal file
@@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<div class="header">
|
||||
<div class="title">{{ title }}</div>
|
||||
<div class="operation">
|
||||
<div :class="['btn', index === activeIndex ? 'active' : '']"
|
||||
v-for="({ prop, label }, index) in operation"
|
||||
:key="prop || index"
|
||||
@click="handleSwitch(label, prop, index)">{{ label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-content">
|
||||
<div class="list-item" v-for="(item, index) in 6">
|
||||
<div class="numerical">{{ index + 1 }}</div>
|
||||
<div class="detail">
|
||||
<div class="head_portrait">
|
||||
<img :src="require('../../../assets/icons/head_portrait.png')" alt="">
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="user-name">向天再借五百年</div>
|
||||
<div class="user-id">767D85</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="count">
|
||||
<slot v-if="$scopedSlots.default" :data="item" :$index="index"></slot>
|
||||
<count-to v-else :start-val="0" :end-val="900" :duration="2600" class="card-panel-num" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CountTo from 'vue-count-to';
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
CountTo
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
default: ()=> []
|
||||
},
|
||||
operation: {
|
||||
type: Array,
|
||||
default: ()=> ([{ label: '总', prop: '' }, { label: '日', prop: '' }])
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
activeIndex: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSwitch(label, prop, index) {
|
||||
console.log(label, prop)
|
||||
this.activeIndex = index;
|
||||
this.$emit('switch-change', { label, prop, index });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wrapper {
|
||||
padding: 16px;
|
||||
border-radius: 14px;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
.header {
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
margin-bottom: 16px;
|
||||
.title {
|
||||
float: left;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #202224;
|
||||
}
|
||||
.operation {
|
||||
float: right;
|
||||
display: flex;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
background: #F5F6FA;
|
||||
.btn {
|
||||
width: 26px;
|
||||
height: 22px;
|
||||
border-radius: 4px;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 550;
|
||||
transition: all 0.1s linear;
|
||||
cursor: pointer;
|
||||
color: #858585;
|
||||
&.active {
|
||||
background: #fff;
|
||||
color: #202224;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-content {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
.list-item {
|
||||
height: 37px;
|
||||
line-height: 37px;
|
||||
margin-bottom: 16px;
|
||||
&:nth-of-type(1) {
|
||||
.numerical {
|
||||
color: #F1691C;
|
||||
}
|
||||
}
|
||||
&:nth-of-type(2) {
|
||||
.numerical {
|
||||
color: #F5AB3C;
|
||||
}
|
||||
}
|
||||
&:nth-of-type(3) {
|
||||
.numerical {
|
||||
color: #4379EE;
|
||||
}
|
||||
}
|
||||
.numerical {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #202224;
|
||||
width: 20px;
|
||||
text-align: left;
|
||||
margin-right: 8px;
|
||||
float: left;
|
||||
}
|
||||
.detail {
|
||||
display: flex;
|
||||
float: left;
|
||||
.head_portrait {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
margin-top: 4.5px;
|
||||
margin-right: 4px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.user-info {
|
||||
line-height: normal;
|
||||
.user-name {
|
||||
font-size: 14px;
|
||||
color: #202224;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.user-id {
|
||||
font-size: 12px;
|
||||
color: #767D85;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.count {
|
||||
float: right;
|
||||
font-size: 14px;
|
||||
color: #202224;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user