mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-12 10:52:48 +00:00
update admin
This commit is contained in:
parent
f85d6ea0f2
commit
5984f9e880
@ -54,12 +54,12 @@
|
|||||||
"renew": "续费",
|
"renew": "续费",
|
||||||
"selectModel": "选择模版",
|
"selectModel": "选择模版",
|
||||||
"addMenu": "添加模块",
|
"addMenu": "添加模块",
|
||||||
"shortcutLink": "链接",
|
"shortcutLink": "模版",
|
||||||
"emptyMenu": "暂无快捷模块",
|
"emptyMenu": "暂无快捷模块",
|
||||||
"select": "选择",
|
"select": "选择",
|
||||||
"custom": "自定义",
|
"custom": "自定义",
|
||||||
"accessSite": "访问站点",
|
"accessSite": "访问站点",
|
||||||
"pathSelect": "选择链接",
|
"pathSelect": "选择模版",
|
||||||
"bgColorPlaceholder": "请选择背景色",
|
"bgColorPlaceholder": "请选择背景色",
|
||||||
"iconPlaceholder": "请选择图标",
|
"iconPlaceholder": "请选择图标",
|
||||||
"pathPlaceholder": "请选择链接",
|
"pathPlaceholder": "请选择链接",
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap" >
|
<div class="flex flex-wrap" >
|
||||||
<div class="flex flex-wrap" ref="shortcutModel" v-if="edit_menu">
|
<div class="flex flex-wrap" ref="shortcutModel" v-if="edit_menu">
|
||||||
<div v-for="(items, index) in shortcut_menu" :style="{backgroundColor : items.bg_color}" :data-id="items.id" class="design-field w-[180px] h-[120px] relative mt-[30px] rounded-[5px] mr-[30px] cursor-pointer">
|
<div v-for="(items, index) in shortcut_menu" :style="{backgroundColor : items.bg_color}" :id="items.id" class="design-field w-[180px] h-[120px] relative mt-[30px] rounded-[5px] mr-[30px] cursor-pointer">
|
||||||
<div class="flex items-center h-[88px]" @click="editModel(items)">
|
<div class="flex items-center h-[88px]" @click="editModel(items)">
|
||||||
<img class="ml-[24px] w-[40px]" :src="img(items.img)"/>
|
<img class="ml-[24px] w-[40px]" :src="img(items.img)"/>
|
||||||
<span class="text-item text-[16px] text-[#fff] ml-[12px] max-w-[120px]">{{ items.name }}</span>
|
<span class="text-item text-[16px] text-[#fff] ml-[12px] max-w-[120px]">{{ items.name }}</span>
|
||||||
@ -337,6 +337,7 @@ const remowMenu = (item) => {
|
|||||||
const primary = () => {
|
const primary = () => {
|
||||||
edit_menu.value = false;
|
edit_menu.value = false;
|
||||||
if(!is_remove.value) return
|
if(!is_remove.value) return
|
||||||
|
if(new_model_arr.value.length > 0) shortcut_menu.value = new_model_arr.value;
|
||||||
setShortcutMenu({
|
setShortcutMenu({
|
||||||
menu: shortcut_menu.value
|
menu: shortcut_menu.value
|
||||||
}).then(() =>{})
|
}).then(() =>{})
|
||||||
@ -364,6 +365,7 @@ const selectMenu = (item) => {
|
|||||||
showMenu.value = false
|
showMenu.value = false
|
||||||
}
|
}
|
||||||
const shortcutModel = ref()
|
const shortcutModel = ref()
|
||||||
|
const new_model_arr = ref([])
|
||||||
const optionModel = () =>{
|
const optionModel = () =>{
|
||||||
edit_menu.value = true
|
edit_menu.value = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -384,16 +386,50 @@ const optionModel = () =>{
|
|||||||
// evt.newIndex 当前位置下标
|
// evt.newIndex 当前位置下标
|
||||||
// console.log(evt.oldIndex+"原位置下标")
|
// console.log(evt.oldIndex+"原位置下标")
|
||||||
// console.log(evt.newIndex+"当前位置下标")
|
// console.log(evt.newIndex+"当前位置下标")
|
||||||
// for(let k = 0; k < evt.newIndex; k ++){
|
if(new_model_arr.value.length > 0){
|
||||||
// new_data.push(shortcut_menu.value[k])
|
let k = 0;
|
||||||
// }
|
let newIndex = evt.newIndex;
|
||||||
// new_data.push(shortcut_menu.value[evt.oldIndex])
|
if(evt.oldIndex < evt.newIndex) newIndex = evt.newIndex + 1; //向后
|
||||||
// let v = evt.newIndex + 1;
|
for(k; k < newIndex; k ++){
|
||||||
// for(v; v < shortcut_menu.value.length; v ++){
|
if(k != evt.oldIndex){
|
||||||
// new_data.push(shortcut_menu.value[v])
|
new_data.push(new_model_arr.value[k])
|
||||||
// }
|
}
|
||||||
// shortcut_menu.value = new_data
|
}
|
||||||
// is_remove.value = true
|
|
||||||
|
new_data.push(new_model_arr.value[evt.oldIndex])
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
|
if(evt.newIndex > 0 && evt.oldIndex > evt.newIndex) i = i+1
|
||||||
|
if(evt.oldIndex < evt.newIndex) i = evt.newIndex + 1; //向后
|
||||||
|
|
||||||
|
for(i; i < new_model_arr.value.length; i ++){
|
||||||
|
if(i != evt.oldIndex){
|
||||||
|
new_data.push(new_model_arr.value[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
let k2 = 0;
|
||||||
|
let newIndex = evt.newIndex;
|
||||||
|
if(evt.oldIndex < evt.newIndex) newIndex = evt.newIndex + 1; //向后
|
||||||
|
for(k2; k2 < newIndex; k2 ++){
|
||||||
|
if(k2 != evt.oldIndex){
|
||||||
|
new_data.push(shortcut_menu.value[k2])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new_data.push(shortcut_menu.value[evt.oldIndex])
|
||||||
|
let i2 = 0;
|
||||||
|
if(evt.newIndex > 0 && evt.oldIndex > evt.newIndex) i2 = i2+1
|
||||||
|
if(evt.oldIndex < evt.newIndex) i2 = evt.newIndex + 1; //向后
|
||||||
|
|
||||||
|
for( i2; i2 < shortcut_menu.value.length; i2 ++){
|
||||||
|
if(i2 != evt.oldIndex){
|
||||||
|
new_data.push(shortcut_menu.value[i2])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new_model_arr.value = new_data;
|
||||||
|
is_remove.value = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user