|
|
@ -1,18 +1,43 @@
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { debounce, difference } from 'lodash-es'
|
|
|
|
import { debounce, difference } from 'lodash-es'
|
|
|
|
import { computed, ref, watch } from 'vue'
|
|
|
|
import { computed, ref, watch, onMounted } from 'vue'
|
|
|
|
import { VueDraggable } from 'vue-draggable-plus'
|
|
|
|
import { VueDraggable } from 'vue-draggable-plus'
|
|
|
|
import { setFilter } from '@/api/home/filter'
|
|
|
|
import { setFilter } from '@/api/home/filter'
|
|
|
|
import { asideMap } from '@/config/final'
|
|
|
|
import { asideMap } from '@/config/final'
|
|
|
|
import { useFinal } from '@/store/modules/final'
|
|
|
|
import { useFinal } from '@/store/modules/final'
|
|
|
|
|
|
|
|
import { cloneDeep, isEqual } from "lodash-es";
|
|
|
|
|
|
|
|
|
|
|
|
const show = ref(false)
|
|
|
|
const show = ref(false)
|
|
|
|
|
|
|
|
const finalStore = useFinal()
|
|
|
|
const checkAll = ref(false)
|
|
|
|
const checkAll = ref(false)
|
|
|
|
const selectIds = ref<string[]>([])
|
|
|
|
const selectIds = ref<string[]>([])
|
|
|
|
const finalStore = useFinal()
|
|
|
|
const tempList = ref<string[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
function showModal() {
|
|
|
|
function showModal() {
|
|
|
|
show.value = true
|
|
|
|
show.value = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重置左右列表数据
|
|
|
|
|
|
|
|
const config = finalStore.getSystemConfig
|
|
|
|
|
|
|
|
const customConfig = finalStore.getCustomConfig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',config, customConfig)
|
|
|
|
|
|
|
|
if (config == null || customConfig == null)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { showList, hideList } = generatList(config, customConfig)
|
|
|
|
|
|
|
|
tempList.value = cloneDeep(showList)
|
|
|
|
|
|
|
|
if (tempList.value.length > 0)
|
|
|
|
|
|
|
|
finalStore.setFilterConfig(tempList.value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onList.value = showList
|
|
|
|
|
|
|
|
offList.value = hideList
|
|
|
|
|
|
|
|
// 重置全选状态
|
|
|
|
|
|
|
|
checkAll.value = hideList.every(item => item.checked)
|
|
|
|
|
|
|
|
// 重置输入框查询条件
|
|
|
|
|
|
|
|
offKeyword.value = ''
|
|
|
|
|
|
|
|
onKeyword.value = ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function closeModal() {
|
|
|
|
function closeModal() {
|
|
|
@ -36,16 +61,16 @@ defineExpose({
|
|
|
|
showModal,
|
|
|
|
showModal,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
function generateDefaultList() {
|
|
|
|
function generateDefaultList(config) {
|
|
|
|
return Object.keys(asideMap).reduce((acc, key) => {
|
|
|
|
return Object.keys(asideMap).reduce((acc, key) => {
|
|
|
|
const { label, isDefaultFilter } = asideMap[key]
|
|
|
|
const { label, isDefaultFilter } = asideMap[key]
|
|
|
|
|
|
|
|
|
|
|
|
// 默认开启配置
|
|
|
|
// 个人配置开启且系统配置开启
|
|
|
|
if (isDefaultFilter) {
|
|
|
|
if (isDefaultFilter && config[key] === 'Y') {
|
|
|
|
const config = {
|
|
|
|
const config = {
|
|
|
|
id: key,
|
|
|
|
id: key,
|
|
|
|
name: label || '未配置',
|
|
|
|
name: label || '未配置',
|
|
|
|
fix: isDefaultFilter,
|
|
|
|
fix: true,
|
|
|
|
checked: true,
|
|
|
|
checked: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return [...acc, config]
|
|
|
|
return [...acc, config]
|
|
|
@ -56,20 +81,21 @@ function generateDefaultList() {
|
|
|
|
}, [])
|
|
|
|
}, [])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function generatList(customConfig) {
|
|
|
|
function generatList(config, customConfig) {
|
|
|
|
const keys = Object.keys(asideMap)
|
|
|
|
const keys = Object.keys(config)
|
|
|
|
let onList: object[] = []
|
|
|
|
let onList: object[] = []
|
|
|
|
const offList: object[] = []
|
|
|
|
const offList: object[] = []
|
|
|
|
const showKeys = customConfig.map((key: string) => key.toLowerCase())
|
|
|
|
const showKeys = [...customConfig]
|
|
|
|
|
|
|
|
|
|
|
|
for (const key of keys) {
|
|
|
|
for (const key of keys) {
|
|
|
|
if (!key.startsWith('iz') || asideMap[key] === undefined)
|
|
|
|
if (!key.startsWith('iz') || config[key] === 'N' || asideMap[key] === undefined)
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
const name = asideMap[key]?.label
|
|
|
|
const name = asideMap[key]?.label
|
|
|
|
const isDefaultFilter = asideMap[key]?.isDefaultFilter
|
|
|
|
const isDefaultFilter = asideMap[key]?.isDefaultFilter
|
|
|
|
|
|
|
|
|
|
|
|
// 不是默认配置
|
|
|
|
// 系统配置为Y,且不是默认配置
|
|
|
|
|
|
|
|
if (!isDefaultFilter) {
|
|
|
|
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
|
|
|
|
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
|
|
|
|
|
|
|
|
|
|
|
|
offList.push({
|
|
|
|
offList.push({
|
|
|
@ -78,15 +104,16 @@ function generatList(customConfig) {
|
|
|
|
fix: isDefaultFilter,
|
|
|
|
fix: isDefaultFilter,
|
|
|
|
checked: isChecked,
|
|
|
|
checked: isChecked,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
if (isChecked && !selectIds.value.includes(key))
|
|
|
|
isChecked && selectIds.value.push(key)
|
|
|
|
isChecked && selectIds.value.push(key)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onList = showKeys.reduce((acc, key) => {
|
|
|
|
onList = showKeys.reduce((acc, key) => {
|
|
|
|
const isDefaultFilter = asideMap[key]?.isDefaultFilter
|
|
|
|
const isDefaultFilter = asideMap[key]?.isDefaultFilter
|
|
|
|
|
|
|
|
|
|
|
|
// 把默认显示的过滤掉(理论上不会出现这种情况)
|
|
|
|
// 也需要系统配置开启(可能个人开启后,系统配置关闭) && 把默认显示的过滤掉(理论上不会出现这种情况)
|
|
|
|
if (isDefaultFilter === false) {
|
|
|
|
if (config[key] === 'Y' && isDefaultFilter === false) {
|
|
|
|
const config = {
|
|
|
|
const config = {
|
|
|
|
id: key,
|
|
|
|
id: key,
|
|
|
|
name: asideMap[key].label || '未配置',
|
|
|
|
name: asideMap[key].label || '未配置',
|
|
|
@ -99,34 +126,85 @@ function generatList(customConfig) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, [])
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
const fixedList = generateDefaultList()
|
|
|
|
const fixedList = generateDefaultList(config)
|
|
|
|
|
|
|
|
offList.unshift(...fixedList)
|
|
|
|
onList.unshift(...fixedList)
|
|
|
|
onList.unshift(...fixedList)
|
|
|
|
return { showList: onList, hideList: offList }
|
|
|
|
console.log('原始筛选条件customConfig', customConfig)
|
|
|
|
|
|
|
|
// onList按照customConfig排序
|
|
|
|
|
|
|
|
const tempOnList = cloneDeep(onList)
|
|
|
|
|
|
|
|
console.log('原始筛选条件tempOnList', tempOnList)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sortKeyList: any = []
|
|
|
|
|
|
|
|
finalStore.getFilterConfig.map((item: any) => {
|
|
|
|
|
|
|
|
sortKeyList.push(item.id)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log('原始筛选条件sortKeyList', sortKeyList)
|
|
|
|
|
|
|
|
const sortList: any = []
|
|
|
|
|
|
|
|
if (sortKeyList.length > 0) {
|
|
|
|
|
|
|
|
sortKeyList.map((key) => {
|
|
|
|
|
|
|
|
const tempItem = tempOnList.find(item => item.id == key)
|
|
|
|
|
|
|
|
sortList.push(tempItem)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
customConfig.map((key) => {
|
|
|
|
|
|
|
|
const tempItem = tempOnList.find(item => item.id == key)
|
|
|
|
|
|
|
|
if(tempItem) {
|
|
|
|
|
|
|
|
sortList.push(tempItem)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('原始筛选条件sortList', sortList)
|
|
|
|
|
|
|
|
console.log('原始筛选条件configStore.getFilterConfig', finalStore.getFilterConfig)
|
|
|
|
|
|
|
|
// return { showList: onList, hideList: offList }
|
|
|
|
|
|
|
|
return { showList: sortList, hideList: offList }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
finalStore.$subscribe(() => {
|
|
|
|
finalStore.$subscribe(() => {
|
|
|
|
|
|
|
|
const config = finalStore.getSystemConfig
|
|
|
|
const customConfig = finalStore.getCustomConfig
|
|
|
|
const customConfig = finalStore.getCustomConfig
|
|
|
|
|
|
|
|
|
|
|
|
if (customConfig === null)
|
|
|
|
if (config == null || customConfig == null)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
console.log('tempList.value-----------', tempList.value)
|
|
|
|
|
|
|
|
console.log('finalStore.getFilterConfig-----------', finalStore.getFilterConfig)
|
|
|
|
|
|
|
|
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { showList, hideList } = generatList(config, customConfig)
|
|
|
|
|
|
|
|
tempList.value = cloneDeep(showList)
|
|
|
|
|
|
|
|
console.log('克隆条件', tempList.value)
|
|
|
|
|
|
|
|
if (tempList.value.length > 0)
|
|
|
|
|
|
|
|
finalStore.setFilterConfig(tempList.value)
|
|
|
|
|
|
|
|
|
|
|
|
const { showList, hideList } = generatList(customConfig)
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// }, 500);
|
|
|
|
onList.value = showList
|
|
|
|
onList.value = showList
|
|
|
|
offList.value = hideList
|
|
|
|
offList.value = hideList
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
async function handleSumbit(e: MouseEvent) {
|
|
|
|
async function handleSumbit(e: MouseEvent) {
|
|
|
|
e.preventDefault()
|
|
|
|
e.preventDefault()
|
|
|
|
|
|
|
|
const param = onList.value.map((item) => {
|
|
|
|
const param = onList.value
|
|
|
|
|
|
|
|
.filter(item => !asideMap[item.id].isDefaultFilter)
|
|
|
|
|
|
|
|
.map((item) => {
|
|
|
|
|
|
|
|
return item.id
|
|
|
|
return item.id
|
|
|
|
|
|
|
|
}).join(',')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await setFilter({ searchcount: param, type: 0 })
|
|
|
|
|
|
|
|
const obj = await finalStore.fetchCustomConfig()
|
|
|
|
|
|
|
|
console.log('obj-------------------------------', obj)
|
|
|
|
|
|
|
|
const tempOnList = cloneDeep(onList.value)
|
|
|
|
|
|
|
|
console.log('原始筛选条件tempOnList', tempOnList)
|
|
|
|
|
|
|
|
const sortList: any = []
|
|
|
|
|
|
|
|
obj.map((key) => {
|
|
|
|
|
|
|
|
const tempItem = tempOnList.find(item => item.id == key)
|
|
|
|
|
|
|
|
sortList.push(tempItem)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.join(',')
|
|
|
|
console.log('finalStore.sortList---------------', sortList)
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
if (sortList.length > 0)
|
|
|
|
|
|
|
|
finalStore.setFilterConfig(sortList)
|
|
|
|
|
|
|
|
|
|
|
|
await setFilter({ searchcount: param, type: 1 })
|
|
|
|
// }, 500);
|
|
|
|
finalStore.fetchCustomConfig()
|
|
|
|
|
|
|
|
closeModal()
|
|
|
|
closeModal()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -147,16 +225,18 @@ function onCheckChange(checked: any, item: any) {
|
|
|
|
const index = selectIds.value.indexOf(item.id)
|
|
|
|
const index = selectIds.value.indexOf(item.id)
|
|
|
|
|
|
|
|
|
|
|
|
item.checked = checked
|
|
|
|
item.checked = checked
|
|
|
|
const currentIndex = offList.value.findIndex(v => v.id == item.id)
|
|
|
|
|
|
|
|
offList.value[currentIndex].checked = item.checked
|
|
|
|
|
|
|
|
if (index === -1 && checked)
|
|
|
|
if (index === -1 && checked)
|
|
|
|
selectIds.value.push(item.id)
|
|
|
|
selectIds.value.push(item.id)
|
|
|
|
else selectIds.value.splice(index, 1)
|
|
|
|
else
|
|
|
|
|
|
|
|
index !== -1 && selectIds.value.splice(index, 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkAll.value = offList.value.every(item => item.checked)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const showIds = computed(() => {
|
|
|
|
const showIds = computed(() => {
|
|
|
|
return onList.value.map((item) => {
|
|
|
|
return onList.value.map((item) => {
|
|
|
|
return item.id
|
|
|
|
return item?.id
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -167,10 +247,7 @@ watch(
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
const action = newVal > oldVal ? 'add' : 'remove'
|
|
|
|
const action = newVal > oldVal ? 'add' : 'remove'
|
|
|
|
const diff
|
|
|
|
const diff = action === 'add' ? difference(selectIds.value, showIds.value) : difference(showIds.value, selectIds.value)
|
|
|
|
= action === 'add'
|
|
|
|
|
|
|
|
? difference(selectIds.value, showIds.value)
|
|
|
|
|
|
|
|
: difference(showIds.value, selectIds.value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (diff.length === 0)
|
|
|
|
if (diff.length === 0)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -178,6 +255,7 @@ watch(
|
|
|
|
if (action === 'add') {
|
|
|
|
if (action === 'add') {
|
|
|
|
for (const item of offList.value) {
|
|
|
|
for (const item of offList.value) {
|
|
|
|
if (!item.fix && diff.includes(item.id)) {
|
|
|
|
if (!item.fix && diff.includes(item.id)) {
|
|
|
|
|
|
|
|
if (item.checked) {
|
|
|
|
onList.value.push({
|
|
|
|
onList.value.push({
|
|
|
|
id: item.id,
|
|
|
|
id: item.id,
|
|
|
|
name: item.name || '未配置',
|
|
|
|
name: item.name || '未配置',
|
|
|
@ -186,6 +264,7 @@ watch(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
const list = onList.value
|
|
|
|
const list = onList.value
|
|
|
|
for (let index = 0; index < list.length; index++) {
|
|
|
|
for (let index = 0; index < list.length; index++) {
|
|
|
@ -245,62 +324,59 @@ const leftInputHandler = debounce((keyword) => {
|
|
|
|
const rightInputHandler = debounce((keyword) => {
|
|
|
|
const rightInputHandler = debounce((keyword) => {
|
|
|
|
onKeyword.value = keyword
|
|
|
|
onKeyword.value = keyword
|
|
|
|
}, 300)
|
|
|
|
}, 300)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// async function getfield() {
|
|
|
|
|
|
|
|
// let res
|
|
|
|
|
|
|
|
// res = await getAllfieldList(3)
|
|
|
|
|
|
|
|
// const userStore = useUser()
|
|
|
|
|
|
|
|
// const userInfo = userStore.getUserInfo
|
|
|
|
|
|
|
|
// res = await getfieldList(3, userInfo.id)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
function onMove(e) {
|
|
|
|
|
|
|
|
// 这里的e表示即将停靠的元素。
|
|
|
|
|
|
|
|
if (e?.related?.className?.indexOf('fix') !== -1)
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
// getfield()
|
|
|
|
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<n-modal v-model:show="show" transform-origin="center" :mask-closable="false">
|
|
|
|
<n-modal v-model:show="show" transform-origin="center" :mask-closable="false">
|
|
|
|
<n-card
|
|
|
|
<n-card class="cardstyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
|
|
|
|
class="cardstyle"
|
|
|
|
|
|
|
|
:bordered="false"
|
|
|
|
|
|
|
|
size="huge"
|
|
|
|
|
|
|
|
role="dialog"
|
|
|
|
|
|
|
|
aria-modal="true"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="wrapper">
|
|
|
|
<div class="wrapper">
|
|
|
|
<span class="wrapper-title" style="color: #333333;">自定义筛选</span>
|
|
|
|
<span class="wrapper-title">自定义筛选</span>
|
|
|
|
<div class="wrapper-bar">
|
|
|
|
<div class="wrapper-bar">
|
|
|
|
<div class="wrapper-info" style="background-color: #F8F8F8;">
|
|
|
|
<div class="wrapper-info">
|
|
|
|
<span :style="{ 'margin-left': '18px', 'color': '#333333' }">筛选项信息</span>
|
|
|
|
<span :style="{ 'margin-left': '18px' }">筛选项信息</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<n-grid cols="24" class="mt-4 proCard" responsive="screen" :x-gap="24">
|
|
|
|
<n-grid cols="24" class="mt-4 proCard" responsive="screen" :x-gap="24">
|
|
|
|
<n-grid-item span="11">
|
|
|
|
<n-grid-item span="11">
|
|
|
|
<NCard
|
|
|
|
<NCard
|
|
|
|
:title="allCount"
|
|
|
|
:title="allCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
|
|
|
|
class="dragcardStyle"
|
|
|
|
|
|
|
|
:segmented="{ content: true, footer: true }"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
:bordered="false"
|
|
|
|
:bordered="false"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div>
|
|
|
|
<div class="input_wrap">
|
|
|
|
<n-input placeholder="搜索关键词" @input="leftInputHandler">
|
|
|
|
<n-input placeholder="搜索关键词" @input="leftInputHandler">
|
|
|
|
<template #suffix>
|
|
|
|
<template #suffix>
|
|
|
|
<SvgIcon size="14px" name="magnifying-1" color="#999999" />
|
|
|
|
<SvgIcon size="14px" name="magnifying-1-color999" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</n-input>
|
|
|
|
</n-input>
|
|
|
|
<n-scrollbar
|
|
|
|
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;">
|
|
|
|
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="draggable-ul">
|
|
|
|
<div class="draggable-ul">
|
|
|
|
<div class="draggable-li" style="color:#666666">
|
|
|
|
<div class="draggable-li">
|
|
|
|
<n-checkbox
|
|
|
|
<n-checkbox v-model:checked="checkAll" label="全选" :indeterminate="!checkAll" @update:checked="onCheckAllChange" />
|
|
|
|
v-model:checked="checkAll"
|
|
|
|
|
|
|
|
label="全选"
|
|
|
|
|
|
|
|
@update:checked="onCheckAllChange"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="item in offList"
|
|
|
|
v-for="item in offList" v-show="item.name.includes(offKeyword)" :key="item.id" :class="{ 'disable-check': item.fix }"
|
|
|
|
v-show="item.name.includes(offKeyword)"
|
|
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
|
|
:class="{ 'disable-check': item.fix }"
|
|
|
|
|
|
|
|
class="draggable-li"
|
|
|
|
class="draggable-li"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<n-checkbox
|
|
|
|
<n-checkbox
|
|
|
|
v-model:checked="item.checked"
|
|
|
|
v-model:checked="item.checked" :label="item.name" :disabled="item.fix"
|
|
|
|
:label="item.name"
|
|
|
|
|
|
|
|
:disabled="item.fix"
|
|
|
|
|
|
|
|
@update:checked="onCheckChange($event, item)"
|
|
|
|
@update:checked="onCheckChange($event, item)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -309,55 +385,31 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</NCard>
|
|
|
|
</NCard>
|
|
|
|
</n-grid-item>
|
|
|
|
</n-grid-item>
|
|
|
|
<n-grid-item style="display: flex; align-items: center" span="2">
|
|
|
|
<n-grid-item style="display: flex;align-items: center;" span="2">
|
|
|
|
<SvgIcon size="20" name="switchsvg" />
|
|
|
|
<SvgIcon size="20" name="switchsvg" />
|
|
|
|
</n-grid-item>
|
|
|
|
</n-grid-item>
|
|
|
|
<n-grid-item span="11">
|
|
|
|
<n-grid-item span="11">
|
|
|
|
<NCard
|
|
|
|
<NCard
|
|
|
|
:title="selectCount"
|
|
|
|
:title="selectCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
|
|
|
|
class="dragcardStyle"
|
|
|
|
|
|
|
|
:segmented="{ content: true, footer: true }"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
:bordered="false"
|
|
|
|
:bordered="false"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template #header-extra>
|
|
|
|
<template #header-extra>
|
|
|
|
<span class="textbtnStyle" @click="clearDragSource">清空</span>
|
|
|
|
<span class="textbtnStyle" @click="clearDragSource">清空</span>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<div>
|
|
|
|
<div class="input_wrap">
|
|
|
|
<!-- j -->
|
|
|
|
|
|
|
|
<n-input placeholder="搜索关键词" @input="rightInputHandler">
|
|
|
|
<n-input placeholder="搜索关键词" @input="rightInputHandler">
|
|
|
|
<template #suffix>
|
|
|
|
<template #suffix>
|
|
|
|
<SvgIcon size="14px" name="magnifying-1" color="#999999" />
|
|
|
|
<SvgIcon size="14px" name="magnifying-1-color999" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</n-input>
|
|
|
|
</n-input>
|
|
|
|
<n-scrollbar
|
|
|
|
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;" class="scroll">
|
|
|
|
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
|
|
|
|
<VueDraggable v-model="onList" class="draggable-ul" :animation="150" group="shared">
|
|
|
|
class="scroll"
|
|
|
|
<div v-for="item in onList" v-show="item.name.includes(onKeyword)" :key="item.id" :draggable="true" class="cursor-move draggable-li">
|
|
|
|
>
|
|
|
|
<SvgIcon name="drag" size="24" />
|
|
|
|
<VueDraggable
|
|
|
|
|
|
|
|
v-model="onList"
|
|
|
|
|
|
|
|
class="draggable-ul"
|
|
|
|
|
|
|
|
filter=".draggable-li[draggable='false']"
|
|
|
|
|
|
|
|
:animation="150"
|
|
|
|
|
|
|
|
group="shared"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-for="item in onList"
|
|
|
|
|
|
|
|
v-show="item.name.includes(onKeyword)"
|
|
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
|
|
:draggable="!item.fix"
|
|
|
|
|
|
|
|
:class="{ fix: item.fix }"
|
|
|
|
|
|
|
|
class="cursor-move draggable-li"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<!-- v-show="!item.fix" 判断是否为固定值 -->
|
|
|
|
|
|
|
|
<SvgIcon name="drag" size="14" />
|
|
|
|
|
|
|
|
<span class="ml-2">{{ item.name }}</span>
|
|
|
|
<span class="ml-2">{{ item.name }}</span>
|
|
|
|
<SvgIcon
|
|
|
|
<SvgIcon
|
|
|
|
v-if="!item.fix"
|
|
|
|
v-if="!item.fix" size="16px" style="display:block;margin-left: auto;cursor: pointer;"
|
|
|
|
size="16px"
|
|
|
|
name="clear" @click="removeHandler(item.id)"
|
|
|
|
style="display: block; margin-left: auto; cursor: pointer"
|
|
|
|
|
|
|
|
name="clear"
|
|
|
|
|
|
|
|
@click="removeHandler(item.id)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</VueDraggable>
|
|
|
|
</VueDraggable>
|
|
|
@ -372,7 +424,7 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
<n-button type="info" @click="handleSumbit">
|
|
|
|
<n-button type="info" @click="handleSumbit">
|
|
|
|
确定
|
|
|
|
确定
|
|
|
|
</n-button>
|
|
|
|
</n-button>
|
|
|
|
<n-button secondary style="margin-left: 15px" @click="closeModal">
|
|
|
|
<n-button secondary style="margin-left:15px; border: 1px solid #CAD2DD;" @click="closeModal">
|
|
|
|
取消
|
|
|
|
取消
|
|
|
|
</n-button>
|
|
|
|
</n-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -389,18 +441,25 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
&-title {
|
|
|
|
&-title {
|
|
|
|
font-weight: bold;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 16px;
|
|
|
|
font-size: 16px;
|
|
|
|
color: #333333;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-bar {
|
|
|
|
&-bar {
|
|
|
|
background-color: #e8e8e8;
|
|
|
|
background-color: #f8f8f8 !important;
|
|
|
|
width: 100%;
|
|
|
|
width: calc(100% + 12px);
|
|
|
|
margin-top: 20px;
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
|
|
color: #333333;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-footer {
|
|
|
|
&-footer {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: flex-end;
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
.n-button--info-type{
|
|
|
|
|
|
|
|
background: #507AFD !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.n-button--default-type{
|
|
|
|
|
|
|
|
background: #fff !important;
|
|
|
|
|
|
|
|
color: #333333;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&-info {
|
|
|
|
&-info {
|
|
|
@ -409,7 +468,7 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
font-size: 14px;
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
&:before {
|
|
|
|
background-color: #1980ff;
|
|
|
|
background-color: #1980FF;
|
|
|
|
content: "";
|
|
|
|
content: "";
|
|
|
|
width: 5px;
|
|
|
|
width: 5px;
|
|
|
|
border-radius: 2px;
|
|
|
|
border-radius: 2px;
|
|
|
@ -423,20 +482,23 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
.dragcardStyle {
|
|
|
|
.dragcardStyle {
|
|
|
|
--n-padding-bottom: 0px !important;
|
|
|
|
--n-padding-bottom: 0px !important;
|
|
|
|
--n-padding-left: 0px !important;
|
|
|
|
--n-padding-left: 0px !important;
|
|
|
|
|
|
|
|
::v-deep(.n-card__content) {
|
|
|
|
|
|
|
|
padding-left: 0 !important;
|
|
|
|
|
|
|
|
padding-right: 0 !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.cardstyle {
|
|
|
|
.cardstyle {
|
|
|
|
width: 620px;
|
|
|
|
width: 620px;
|
|
|
|
height: 800px;
|
|
|
|
height: 800px;
|
|
|
|
--n-padding-bottom: 16px;
|
|
|
|
--n-padding-bottom: 20px;
|
|
|
|
--n-padding-left: 24px;
|
|
|
|
--n-padding-left: 24px;
|
|
|
|
--n-padding-right: 24px;
|
|
|
|
// background-color: #f8f8f8 !important;
|
|
|
|
--n-padding-top: 20px;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textbtnStyle {
|
|
|
|
.textbtnStyle {
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
color: #1980ff;
|
|
|
|
color: #1980FF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.draggable-ul {
|
|
|
|
.draggable-ul {
|
|
|
@ -452,6 +514,10 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.fix {
|
|
|
|
|
|
|
|
cursor: default !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.disable-check {
|
|
|
|
.disable-check {
|
|
|
|
color: gainsboro;
|
|
|
|
color: gainsboro;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -465,23 +531,33 @@ const rightInputHandler = debounce((keyword) => {
|
|
|
|
--n-padding-top: 0px;
|
|
|
|
--n-padding-top: 0px;
|
|
|
|
--n-padding-bottom: 12px;
|
|
|
|
--n-padding-bottom: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::v-deep(.n-card > .n-card-header .n-card-header__main) {
|
|
|
|
::v-deep(.n-card > .n-card-header .n-card-header__main){
|
|
|
|
font-weight: lighter !important;
|
|
|
|
font-weight: lighter !important;
|
|
|
|
font-size: 14px;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #666666;
|
|
|
|
color: #666;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::v-deep(.n-scrollbar) {
|
|
|
|
::v-deep(.n-scrollbar){
|
|
|
|
border-top: none !important;
|
|
|
|
border-left: 1px solid #cad2dd !important;
|
|
|
|
|
|
|
|
border-right: 1px solid #cad2dd !important;
|
|
|
|
|
|
|
|
border-bottom: 1px solid #E8E8E8 !important;
|
|
|
|
|
|
|
|
border-top: 1px solid #E8E8E8 !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::v-deep(.n-button--info-type) {
|
|
|
|
::v-deep(.n-card__content){
|
|
|
|
background: #507afd !important;
|
|
|
|
padding: 20px 24px 0 24px !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::v-deep(.n-card__footer) {
|
|
|
|
::v-deep(.n-card__footer){
|
|
|
|
padding: 0 16px 16px 16px !important;
|
|
|
|
padding: 0 24px 16px 24px !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::v-deep(.n-button--default-type) {
|
|
|
|
::v-deep(.n-input .n-input-wrapper){
|
|
|
|
|
|
|
|
height: 44px !important;
|
|
|
|
border: 1px solid #cad2dd !important;
|
|
|
|
border: 1px solid #cad2dd !important;
|
|
|
|
color: #333333;
|
|
|
|
border-bottom: none !important;
|
|
|
|
background: #ffffff;
|
|
|
|
// margin-bottom: -3px;
|
|
|
|
|
|
|
|
.n-input__input input{
|
|
|
|
|
|
|
|
height: 44px !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
::v-deep(.n-button--info-type){
|
|
|
|
|
|
|
|
background: #507AFD !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|