|
@@ -11,7 +11,7 @@
|
|
<img slot="error" src="https://www.jianyu360.cn/common-module/public/image/auto.png" />
|
|
<img slot="error" src="https://www.jianyu360.cn/common-module/public/image/auto.png" />
|
|
</el-image>
|
|
</el-image>
|
|
</div>
|
|
</div>
|
|
- <span v-html="item.name" class="item-name"></span>
|
|
|
|
|
|
+ <span v-html="item.name.replace('/', '/<br>')" class="item-name"></span>
|
|
</div>
|
|
</div>
|
|
<div v-if="commonList && commonList.length < maxCount" class="list-add" @click="setCommonFun">
|
|
<div v-if="commonList && commonList.length < maxCount" class="list-add" @click="setCommonFun">
|
|
<span class="icon-add-img"></span>
|
|
<span class="icon-add-img"></span>
|
|
@@ -35,18 +35,18 @@
|
|
</SelectorCard>
|
|
</SelectorCard>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 改为抽屉式 -->
|
|
<!-- 改为抽屉式 -->
|
|
- <DrawerCard customClass="drawer-class" title="常用功能设置" percent="600px" :with-header="false" v-model="showDrawer" @close="onCloseDrawer" @saveData="onSaveDrawer">
|
|
|
|
|
|
+ <DrawerCard customClass="drawer-class" title="常用功能设置" percent="600px" :with-header="false" v-model="drawerShow" @close="onCloseDrawer" @saveData="onSaveDrawer">
|
|
<div class="function-drawer-content" @scroll="handleScroll($event)">
|
|
<div class="function-drawer-content" @scroll="handleScroll($event)">
|
|
<div class="added-function">
|
|
<div class="added-function">
|
|
<h3 class="added-title">已添加({{addedList.length}})</h3>
|
|
<h3 class="added-title">已添加({{addedList.length}})</h3>
|
|
<transition-group class="added-container" name="drag" tag="ul" v-if="addedList && addedList.length > 0">
|
|
<transition-group class="added-container" name="drag" tag="ul" v-if="addedList && addedList.length > 0">
|
|
- <li class="added-item" draggable v-for="(item, i) in addedList" :key="item.id" @dragstart="onDragstart(i)" @dragenter="onDragenter($event, i)" @dragover="onDragover($event, i)">
|
|
|
|
|
|
+ <li class="added-item" draggable v-for="(item, i) in addedList" :key="item.id" @dragover.prevent @dragstart="onDragstart($event, i)" @dragenter="onDragenter($event, i)" @dragend="onDragend($event, i)">
|
|
<div class="icon-box-container">
|
|
<div class="icon-box-container">
|
|
<el-image :src="item.icon" :alt="item.name">
|
|
<el-image :src="item.icon" :alt="item.name">
|
|
<img slot="error" src="https://www.jianyu360.cn/common-module/public/image/auto.png" />
|
|
<img slot="error" src="https://www.jianyu360.cn/common-module/public/image/auto.png" />
|
|
</el-image>
|
|
</el-image>
|
|
</div>
|
|
</div>
|
|
- <span v-html="item.name" class="item-name"></span>
|
|
|
|
|
|
+ <span v-html="item.name.replace('/', '/<br>')" class="item-name"></span>
|
|
<span class="remove-tag" @click.stop="onAddedRemove(item)">-</span>
|
|
<span class="remove-tag" @click.stop="onAddedRemove(item)">-</span>
|
|
</li>
|
|
</li>
|
|
</transition-group>
|
|
</transition-group>
|
|
@@ -64,9 +64,9 @@
|
|
<li class="insert-item" v-for="next in level.children" :key="next.id">
|
|
<li class="insert-item" v-for="next in level.children" :key="next.id">
|
|
<div class="insert-item-left">
|
|
<div class="insert-item-left">
|
|
<el-image :src="next.icon" :alt="next.name">
|
|
<el-image :src="next.icon" :alt="next.name">
|
|
- <img slot="error" src="/common-module/public/image/auto.png" />
|
|
|
|
|
|
+ <img slot="error" src="https://www.jianyu360.cn/common-module/public/image/auto.png" />
|
|
</el-image>
|
|
</el-image>
|
|
- <span v-html="next.name"></span>
|
|
|
|
|
|
+ <span v-html="next.name.replace('<br>', '')"></span>
|
|
</div>
|
|
</div>
|
|
<transition name="el-zoom-in-center">
|
|
<transition name="el-zoom-in-center">
|
|
<span v-if="next.status" class="handle-btn remove-btn" @click.stop="onRemoveFun(next)">移除</span>
|
|
<span v-if="next.status" class="handle-btn remove-btn" @click.stop="onRemoveFun(next)">移除</span>
|
|
@@ -113,7 +113,6 @@ export default {
|
|
mainFunList: [],
|
|
mainFunList: [],
|
|
dragIndex: '',
|
|
dragIndex: '',
|
|
enterIndex: '',
|
|
enterIndex: '',
|
|
- showDrawer: false,
|
|
|
|
tabActive: 0,
|
|
tabActive: 0,
|
|
tabFixed: false
|
|
tabFixed: false
|
|
}
|
|
}
|
|
@@ -125,7 +124,8 @@ export default {
|
|
allFunctions: state => state.workspace.commonUse.allFunctions, // 所有功能
|
|
allFunctions: state => state.workspace.commonUse.allFunctions, // 所有功能
|
|
transferCommonList: state => state.workspace.commonUse.transferCommonList,
|
|
transferCommonList: state => state.workspace.commonUse.transferCommonList,
|
|
commonList: state => state.workspace.commonUse.commonList, // 常用功能
|
|
commonList: state => state.workspace.commonUse.commonList, // 常用功能
|
|
- mainFunctions: state => state.workspace.commonUse.mainFunctions
|
|
|
|
|
|
+ mainFunctions: state => state.workspace.commonUse.mainFunctions,
|
|
|
|
+ drawerShow: state => state.workspace.commonUse.drawerShow
|
|
}),
|
|
}),
|
|
tabNames () {
|
|
tabNames () {
|
|
return this.mainFunctions.filter(item => item.level === 1)
|
|
return this.mainFunctions.filter(item => item.level === 1)
|
|
@@ -152,7 +152,8 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...mapMutations('workspace/commonUse', [
|
|
...mapMutations('workspace/commonUse', [
|
|
'changeDialogState',
|
|
'changeDialogState',
|
|
- 'transferSave'
|
|
|
|
|
|
+ 'transferSave',
|
|
|
|
+ 'changeDrawerState'
|
|
]),
|
|
]),
|
|
...mapActions('workspace/commonUse', [
|
|
...mapActions('workspace/commonUse', [
|
|
'getAllFunctions',
|
|
'getAllFunctions',
|
|
@@ -237,8 +238,10 @@ export default {
|
|
this.$toast(error)
|
|
this.$toast(error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onDragstart (index) {
|
|
|
|
|
|
+ onDragstart (e, index) {
|
|
this.dragIndex = index
|
|
this.dragIndex = index
|
|
|
|
+ const element = e.target
|
|
|
|
+ element.classList.add('drag-move-item')
|
|
},
|
|
},
|
|
onDragenter: debounce(function (e, index) {
|
|
onDragenter: debounce(function (e, index) {
|
|
e.preventDefault()
|
|
e.preventDefault()
|
|
@@ -251,11 +254,13 @@ export default {
|
|
return v.id
|
|
return v.id
|
|
})
|
|
})
|
|
this.transferSave(ids)
|
|
this.transferSave(ids)
|
|
- console.log(ids)
|
|
|
|
}
|
|
}
|
|
}, 200),
|
|
}, 200),
|
|
- onDragover (e, index) {
|
|
|
|
|
|
+ onDragend (e, index) {
|
|
e.preventDefault()
|
|
e.preventDefault()
|
|
|
|
+ const element = e.srcElement
|
|
|
|
+ element.classList.remove('drag-move-item')
|
|
|
|
+ this.$forceUpdate()
|
|
},
|
|
},
|
|
formatMainFunList (allList = [], addedList = []) {
|
|
formatMainFunList (allList = [], addedList = []) {
|
|
allList.forEach(v => {
|
|
allList.forEach(v => {
|
|
@@ -269,14 +274,15 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onCloseDrawer () {
|
|
onCloseDrawer () {
|
|
- this.showDrawer = false
|
|
|
|
|
|
+ this.changeDrawerState(false)
|
|
},
|
|
},
|
|
onSaveDrawer () {
|
|
onSaveDrawer () {
|
|
this.confirmSaveFn()
|
|
this.confirmSaveFn()
|
|
- this.showDrawer = false
|
|
|
|
},
|
|
},
|
|
setCommonFun () {
|
|
setCommonFun () {
|
|
- this.showDrawer = true
|
|
|
|
|
|
+ this.changeDrawerState(true)
|
|
|
|
+ this.addedList = JSON.parse(JSON.stringify(this.commonList))
|
|
|
|
+ this.formatMainFunList(this.mainFunList, this.addedList)
|
|
},
|
|
},
|
|
onRemoveFun (item) {
|
|
onRemoveFun (item) {
|
|
this.addedList.splice(this.addedList.findIndex(add => add.id === item.id), 1)
|
|
this.addedList.splice(this.addedList.findIndex(add => add.id === item.id), 1)
|
|
@@ -308,13 +314,17 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ const ids = this.addedList.map(v => {
|
|
|
|
+ return v.id
|
|
|
|
+ })
|
|
|
|
+ this.transferSave(ids)
|
|
},
|
|
},
|
|
goAnchor (item, index) {
|
|
goAnchor (item, index) {
|
|
this.tabActive = index
|
|
this.tabActive = index
|
|
const dom = this.$root.$el.querySelector('#' + item.name)
|
|
const dom = this.$root.$el.querySelector('#' + item.name)
|
|
const offsetTop = this.getOffsetTop(dom)
|
|
const offsetTop = this.getOffsetTop(dom)
|
|
|
|
+ // qiankun 子应用选择器获取不到document 改为this.$root.$el
|
|
const scrollDom = this.$root.$el.querySelector('.function-drawer-content')
|
|
const scrollDom = this.$root.$el.querySelector('.function-drawer-content')
|
|
- console.log(offsetTop, index)
|
|
|
|
scrollDom.scrollTo({
|
|
scrollDom.scrollTo({
|
|
/**
|
|
/**
|
|
* 抽屉header高度70px, tabs导航栏高度48px, 滚动子元素h3标题高度60px
|
|
* 抽屉header高度70px, tabs导航栏高度48px, 滚动子元素h3标题高度60px
|
|
@@ -422,17 +432,19 @@ $main: #2cb7ca;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
width: 104px;
|
|
width: 104px;
|
|
- min-height: 70px;
|
|
|
|
|
|
+ height: fit-content;
|
|
margin: 16px 0 0 0;
|
|
margin: 16px 0 0 0;
|
|
|
|
+ padding: 8px 0;
|
|
text-align: center;
|
|
text-align: center;
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
- cursor: move;
|
|
|
|
|
|
+ cursor: grabbing;
|
|
.item-name{
|
|
.item-name{
|
|
margin-top: 8px;
|
|
margin-top: 8px;
|
|
line-height: 22px;
|
|
line-height: 22px;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
color: #1D1D1D;
|
|
color: #1D1D1D;
|
|
|
|
+ pointer-events: none;
|
|
}
|
|
}
|
|
.remove-tag{
|
|
.remove-tag{
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -449,6 +461,19 @@ $main: #2cb7ca;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .drag-move-item{
|
|
|
|
+ // padding: 8px 0;
|
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.05);
|
|
|
|
+ box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.08);
|
|
|
|
+ // border-radius: 8px;
|
|
|
|
+ .remove-tag{
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .drag-init-hide{
|
|
|
|
+ transition: 0.01s;
|
|
|
|
+ transform: translateX(-9999px);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.classify-function{
|
|
.classify-function{
|
|
margin-top: 12px;
|
|
margin-top: 12px;
|
|
@@ -565,6 +590,7 @@ $main: #2cb7ca;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
width: 44px;
|
|
width: 44px;
|
|
height: 44px;
|
|
height: 44px;
|
|
|
|
+ pointer-events: none;
|
|
::before{
|
|
::before{
|
|
content: ''
|
|
content: ''
|
|
}
|
|
}
|