Commit 198fa1b1 by 李伟康

修改工作台图标为可配置

1 parent a56d87f1
.sprite-icon { background-image: url(../images/sprite.png);background-size: 194px 144px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 77px 66px;}
.icon-6 { width: 40px; height: 40px; background-position: -54px 0px;}
.icon-9 { width: 40px; height: 40px; background-position: 0px -54px;}
.icon-activity { width: 40px; height: 40px; background-position: -50px -54px;}
.icon-attractCustomer { width: 40px; height: 40px; background-position: -104px 0px;}
.icon-coupon_verificationList { width: 40px; height: 40px; background-position: -104px -50px;}
.icon-coupon { width: 40px; height: 40px; background-position: 0px -104px;}
.icon-default-avatar { width: 44px; height: 44px; background-position: 0px 0px;} .icon-default-avatar { width: 44px; height: 44px; background-position: 0px 0px;}
.icon-down { width: 12px; height: 12px; background-position: -154px -83px;}
.icon-index-tips { width: 23px; height: 23px; background-position: -154px -50px;}
.icon-merchant_goods { width: 40px; height: 40px; background-position: -50px -104px;}
.icon-merchant { width: 40px; height: 40px; background-position: -100px -104px;}
.icon-tag { width: 40px; height: 40px; background-position: -154px 0px;}
\ No newline at end of file \ No newline at end of file
.icon-down { width: 12px; height: 12px; background-position: 0px -54px;}
.icon-index-tips { width: 23px; height: 23px; background-position: -54px 0px;}
\ No newline at end of file \ No newline at end of file

48.6 KB | W: | H:

1.79 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -15,7 +15,12 @@ ...@@ -15,7 +15,12 @@
class="item" class="item"
@click="jump(i)" @click="jump(i)"
> >
<div :class="['sprite-icon',`icon-${i.icon}`]"></div> <div class="icon">
<img
:src="i.icon"
:alt="i.label"
>
</div>
{{i.label}} {{i.label}}
</div> </div>
</template> </template>
...@@ -43,13 +48,13 @@ const { subsystemInfo } = window.$fetchConfig ...@@ -43,13 +48,13 @@ const { subsystemInfo } = window.$fetchConfig
import { ssoApi } from '@/api' import { ssoApi } from '@/api'
export default { export default {
name: '', name: '',
data() { data () {
return { return {
list: [], list: [],
flag: false flag: false
} }
}, },
activated() { activated () {
ssoApi.getPermission().then(data => { ssoApi.getPermission().then(data => {
let [merchantProTreeResponses] = data[0].products[0].merchantProTreeResponses let [merchantProTreeResponses] = data[0].products[0].merchantProTreeResponses
if (merchantProTreeResponses) { if (merchantProTreeResponses) {
...@@ -58,29 +63,33 @@ export default { ...@@ -58,29 +63,33 @@ export default {
list.map(e => { list.map(e => {
if (e.children) { if (e.children) {
e.children.map(i => { e.children.map(i => {
let [link, target] = i.menuUrl.split('@') let [url, item] = i.menuUrl.split('@')
i.icon = link.replace(/\//g, '_').split('?')[0] let [target, icon] = item.split('|')
let [link, query] = url.split('?')
i.icon = icon
i.link = link i.link = link
i.target = target i.target = target
i.query = query
}) })
} }
}) })
console.log(list)
this.list = list this.list = list
} }
} }
this.flag = true this.flag = true
}) })
}, },
mounted() {}, mounted () { },
methods: { methods: {
jump(e) { jump (e) {
let sessionId = this.getSessionId() let sessionId = this.getSessionId()
let { corpId } = this.getLocalStorage('dj_scrm_corpId') let { corpId } = this.getLocalStorage('dj_scrm_corpId')
let { link, params, target } = e let { link, query, target } = e
if (!link) return if (!link) return
let { path } = subsystemInfo[target] let { path } = subsystemInfo[target]
let url = `${path}${link}?sessionId=${sessionId}&corpId=${corpId}` let url = `${path}${link}?sessionId=${sessionId}&corpId=${corpId}`
if (params) url = `${url}&${params}` if (query) url = `${url}&${query}`
window.location.href = url window.location.href = url
} }
} }
...@@ -111,7 +120,9 @@ export default { ...@@ -111,7 +120,9 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
.sprite-icon { .icon {
width: 40px;
height: 40px;
margin-bottom: 7px; margin-bottom: 7px;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!