Merge branch 'main' of https://git.mcnetmart.com/guoxiangbin/ocr-web
# Conflicts: # src/views/login/components/Forget.vue # src/views/login/components/Login.vue # src/views/login/index.vuebak
commit
e803af9e6e
After Width: | Height: | Size: 494 B |
@ -1,163 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import { computed, defineOptions, nextTick, onBeforeMount, onMounted, reactive, ref, unref } from 'vue'
|
|
||||||
import CustomFieldModalVue from '../modal/CustomFieldModal.vue'
|
|
||||||
import WorkSheetList from './WorkSheetList.vue'
|
|
||||||
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
||||||
import { getViewportOffset } from '@/utils/domUtils'
|
|
||||||
import type { PackageListItem } from '/#/workorder'
|
|
||||||
import { useWorkOrder } from '@/store/modules/workOrder'
|
|
||||||
|
|
||||||
defineOptions({ name: 'AsideContent' })
|
|
||||||
|
|
||||||
const collapse = ref(false)
|
|
||||||
const workStore = useWorkOrder()
|
|
||||||
const filterModalRef = ref(null)
|
|
||||||
|
|
||||||
function collapseHandler() {
|
|
||||||
collapse.value = !collapse.value
|
|
||||||
}
|
|
||||||
|
|
||||||
const asideWidth = computed(() => {
|
|
||||||
return collapse.value ? 0 : 308
|
|
||||||
})
|
|
||||||
|
|
||||||
const asideStyle = computed(() => {
|
|
||||||
return {
|
|
||||||
width: `${asideWidth.value}px`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const collapseIcon = computed(() => {
|
|
||||||
return collapse.value ? 'expand-cir' : 'collapse-cir'
|
|
||||||
})
|
|
||||||
|
|
||||||
const listHeight = ref(700)
|
|
||||||
|
|
||||||
function computeListHeight() {
|
|
||||||
const listEl = document.querySelector('.work-sheet-list')!
|
|
||||||
const { bottomIncludeBody } = getViewportOffset(listEl)
|
|
||||||
const height = bottomIncludeBody
|
|
||||||
listHeight.value = height - 25
|
|
||||||
}
|
|
||||||
|
|
||||||
const listStyle = computed(() => {
|
|
||||||
return {
|
|
||||||
height: `${listHeight.value}px`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
useWindowSizeFn(computeListHeight, 280)
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
nextTick(() => {
|
|
||||||
computeListHeight()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const data = ref<PackageListItem[]>([])
|
|
||||||
|
|
||||||
const pagination = reactive({
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
})
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
const orderList = await workStore.fetchOrderList(pagination)
|
|
||||||
data.value = orderList
|
|
||||||
})
|
|
||||||
|
|
||||||
const asideEnter = ref(false)
|
|
||||||
|
|
||||||
const showCollapse = computed(() => {
|
|
||||||
return collapse.value ? true : asideEnter.value
|
|
||||||
})
|
|
||||||
|
|
||||||
function showFilter() {
|
|
||||||
const modal = unref(filterModalRef)! as any
|
|
||||||
modal.showModal()
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
|
|
||||||
111fsfsf发送到发
|
|
||||||
|
|
||||||
<div v-show="showCollapse" class="aside-collapse">
|
|
||||||
<div class="aside-collapse-btn" @click="collapseHandler">
|
|
||||||
<SvgIcon :name="collapseIcon" size="40" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="aside-header">
|
|
||||||
<div class="aside-header-left">
|
|
||||||
<svg-icon name="all-worksheet" size="32" />
|
|
||||||
<span style="margin-left: 8px;">所有工单</span>
|
|
||||||
</div>
|
|
||||||
<div class="aside-header-right">
|
|
||||||
<SvgIcon style="cursor: pointer;margin-left: 10px;" size="18" name="magnifying-1" />
|
|
||||||
<SvgIcon style="cursor: pointer;margin-left: 10px;" size="18" name="filter" @click="showFilter" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<WorkSheetList :style="listStyle" class="work-sheet-list" :data="data" :active-id="workStore.getActiveId" />
|
|
||||||
<CustomFieldModalVue ref="filterModalRef" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.aside {
|
|
||||||
display: flex;
|
|
||||||
position: relative;
|
|
||||||
flex-direction: column;
|
|
||||||
background: #FFF;
|
|
||||||
border: 1px solid rgb(239, 239, 245);
|
|
||||||
border-radius: 3px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
&-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 12px 16px;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-divider {
|
|
||||||
margin-left: 16px;
|
|
||||||
width: 292px;
|
|
||||||
height: 1px;
|
|
||||||
background-color: #e8e8e8;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-collapse {
|
|
||||||
width: 2px;
|
|
||||||
height: 100%;
|
|
||||||
background: #507afd;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-collapse-btn {
|
|
||||||
position: absolute;
|
|
||||||
cursor: pointer;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
top: calc(15%);
|
|
||||||
right: -20px;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
../types
|
|
@ -1,37 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type { PackageListItem } from '/#/workorder'
|
|
||||||
import ListItem from './ListItem.vue'
|
|
||||||
import { useWorkOrder } from '@/store/modules/workOrder'
|
|
||||||
|
|
||||||
defineOptions({ name: 'WorkSheetList' })
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
activeId: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
type: Object as PropType<PackageListItem[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const workStore = useWorkOrder()
|
|
||||||
|
|
||||||
function selectHandler(id: string, index: number) {
|
|
||||||
workStore.setActive(index)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<n-scrollbar>
|
|
||||||
<ListItem
|
|
||||||
v-for="(item, index) in data" :key="item.id" :selected="activeId === item.id" :list-item="item"
|
|
||||||
@click="selectHandler(item.id, index)"
|
|
||||||
/>
|
|
||||||
</n-scrollbar>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
</style>
|
|
||||||
../types
|
|
@ -1,167 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import { computed, onBeforeMount, ref } from 'vue'
|
|
||||||
import { useDictionary } from '@/store/modules/dictonary'
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(e: 'commit', id: any, desc: null | string)
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const dictonaryStore = useDictionary()
|
|
||||||
|
|
||||||
const show = ref(false)
|
|
||||||
const cardStyle = {
|
|
||||||
'width': '520px',
|
|
||||||
'--n-padding-bottom': '10px',
|
|
||||||
'--n-padding-left': '0px',
|
|
||||||
}
|
|
||||||
|
|
||||||
function showModal() {
|
|
||||||
show.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeModal() {
|
|
||||||
show.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
showModal,
|
|
||||||
})
|
|
||||||
|
|
||||||
const options = ref<any[]>([])
|
|
||||||
|
|
||||||
const selectId = ref(null)
|
|
||||||
const otherValue = ref(null)
|
|
||||||
const showOther = computed(() => {
|
|
||||||
for (const item of options.value) {
|
|
||||||
if (item.value === selectId.value && item.label === '其他')
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
async function handleSumbit(e: MouseEvent) {
|
|
||||||
e.preventDefault()
|
|
||||||
closeModal()
|
|
||||||
emit('commit', selectId.value, otherValue.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
const tfList = await dictonaryStore.fetchTFList()
|
|
||||||
options.value = tfList
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<n-modal v-model:show="show" transform-origin="center">
|
|
||||||
<n-card :style="cardStyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
|
|
||||||
<div class="wrapper">
|
|
||||||
<div class="wrapper-header">
|
|
||||||
<span class="wrapper-left">选择判假原因</span>
|
|
||||||
<div class="wrapper-right">
|
|
||||||
<div class="wrapper-right-close" @pointerdown="closeModal">
|
|
||||||
<div class="wrapper-right-icon" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="wrapper-content">
|
|
||||||
<span>判假原因</span>
|
|
||||||
<n-select v-model:value="selectId" style="margin-top: 10px;" :options="options" />
|
|
||||||
<n-input v-show="showOther" v-model:value="otherValue" style="margin-top: 10px;" type="textarea" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="wrapper-footer">
|
|
||||||
<n-button type="info" @click="handleSumbit">
|
|
||||||
确认
|
|
||||||
</n-button>
|
|
||||||
<n-button secondary style="margin-left:15px" @click="closeModal">
|
|
||||||
取消
|
|
||||||
</n-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</n-card>
|
|
||||||
</n-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.wrapper {
|
|
||||||
&-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-left {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-right {
|
|
||||||
&-close {
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-icon {
|
|
||||||
background: #000;
|
|
||||||
display: inline-block;
|
|
||||||
width: 18px;
|
|
||||||
height: 1px;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
-webkit-transform: rotate(45deg);
|
|
||||||
margin-bottom: 8px;
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
width: 18px;
|
|
||||||
height: 1px;
|
|
||||||
background: #000;
|
|
||||||
transform: rotate(-90deg);
|
|
||||||
-webkit-transform: rotate(-90deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-content {
|
|
||||||
padding: 18px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-info {
|
|
||||||
font-weight: bold;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
background-color: #1980ff;
|
|
||||||
content: '';
|
|
||||||
width: 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(.n-card.n-card--content-segmented > .n-card__content:not(:first-child)) {
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(.n-card > .n-card-header) {
|
|
||||||
--n-padding-top: 0px;
|
|
||||||
--n-padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(.n-divider:not(.n-divider--vertical)) {
|
|
||||||
margin-top: 0px;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,384 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import { computed, ref, watch } from 'vue'
|
|
||||||
import { difference } from 'lodash-es'
|
|
||||||
import { VueDraggable } from 'vue-draggable-plus'
|
|
||||||
import { workPackageMap } from '@/config/workorder'
|
|
||||||
|
|
||||||
// 左侧隐藏列表
|
|
||||||
const offList = ref<any[]>([])
|
|
||||||
// 右侧显示列表
|
|
||||||
const onList = ref<any[]>([])
|
|
||||||
|
|
||||||
const allCount = computed(() => {
|
|
||||||
return `全部筛选(共${offList.value.length - 1}个)`
|
|
||||||
})
|
|
||||||
|
|
||||||
const selectCount = computed(() => {
|
|
||||||
return `全部筛选(共${onList.value.length}个)`
|
|
||||||
})
|
|
||||||
|
|
||||||
function generatList() {
|
|
||||||
const keys = Object.keys(workPackageMap)
|
|
||||||
let showList: object[] = []
|
|
||||||
const hideList: object[] = []
|
|
||||||
const showStr = 'status'
|
|
||||||
const showKeys = showStr.split(',').map((key: string) => key.toLowerCase())
|
|
||||||
|
|
||||||
for (const key of keys) {
|
|
||||||
const name = workPackageMap[key]?.label
|
|
||||||
const isDefault = workPackageMap[key]?.isDefault
|
|
||||||
|
|
||||||
// 系统配置为Y且不是默认配置
|
|
||||||
if (!isDefault) {
|
|
||||||
hideList.push({
|
|
||||||
id: key,
|
|
||||||
name: name || '未配置',
|
|
||||||
fix: isDefault,
|
|
||||||
checked: workPackageMap[key].isDefault,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showList = showKeys.reduce((acc, key) => {
|
|
||||||
const config = {
|
|
||||||
id: key,
|
|
||||||
name: workPackageMap[key].label || '未配置',
|
|
||||||
fix: workPackageMap[key].isDefault,
|
|
||||||
}
|
|
||||||
return [...acc, config]
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const fixedList = generateDefaultList()
|
|
||||||
|
|
||||||
hideList.unshift(...fixedList)
|
|
||||||
showList.unshift(...fixedList)
|
|
||||||
|
|
||||||
onList.value = showList
|
|
||||||
offList.value = hideList
|
|
||||||
return { showList, hideList }
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateDefaultList() {
|
|
||||||
return Object.keys(workPackageMap).reduce((acc, key) => {
|
|
||||||
const { label, isDefault } = workPackageMap[key]
|
|
||||||
|
|
||||||
if (isDefault) {
|
|
||||||
const config = {
|
|
||||||
id: key,
|
|
||||||
name: label || '未配置',
|
|
||||||
fix: true,
|
|
||||||
checked: true,
|
|
||||||
}
|
|
||||||
return [...acc, config]
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return acc
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
}
|
|
||||||
|
|
||||||
const show = ref(false)
|
|
||||||
const checkAll = ref(false)
|
|
||||||
|
|
||||||
function showModal() {
|
|
||||||
show.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeModal() {
|
|
||||||
show.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleSumbit(e: MouseEvent) {
|
|
||||||
e.preventDefault()
|
|
||||||
closeModal()
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
showModal,
|
|
||||||
})
|
|
||||||
|
|
||||||
generatList()
|
|
||||||
|
|
||||||
const selectIds = ref<string[]>([])
|
|
||||||
|
|
||||||
function onCheckAllChange(value) {
|
|
||||||
const ids: string[] = []
|
|
||||||
|
|
||||||
for (const item of offList.value) {
|
|
||||||
if (!item.fix) {
|
|
||||||
item.checked = value
|
|
||||||
ids.push(item.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
selectIds.value = value ? ids : []
|
|
||||||
}
|
|
||||||
|
|
||||||
function onCheckChange(checked: any, item: any) {
|
|
||||||
const index = selectIds.value.indexOf(item.id)
|
|
||||||
|
|
||||||
item.checked = checked
|
|
||||||
|
|
||||||
if (index === -1 && checked)
|
|
||||||
selectIds.value.push(item.id)
|
|
||||||
else
|
|
||||||
selectIds.value.splice(index, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
const showIds = computed(() => {
|
|
||||||
return onList.value.map((item) => {
|
|
||||||
return item.id
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => selectIds.value.length,
|
|
||||||
(newVal, oldVal) => {
|
|
||||||
if (newVal === oldVal)
|
|
||||||
return
|
|
||||||
|
|
||||||
const action = newVal > oldVal ? 'add' : 'remove'
|
|
||||||
const diff = action === 'add' ? difference(selectIds.value, showIds.value) : difference(showIds.value, selectIds.value)
|
|
||||||
|
|
||||||
if (diff.length === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (action === 'add') {
|
|
||||||
for (const item of offList.value) {
|
|
||||||
if (!item.fix && diff.includes(item.id)) {
|
|
||||||
onList.value.push({
|
|
||||||
id: item.id,
|
|
||||||
name: item.name || '未配置',
|
|
||||||
fix: item.fix || false,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const list = onList.value
|
|
||||||
for (let index = 0; index < list.length; index++) {
|
|
||||||
const item = list[index]
|
|
||||||
if (!item.fix && diff.includes(item.id)) {
|
|
||||||
list.splice(index, 1)
|
|
||||||
index--
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => showIds.value.length,
|
|
||||||
(newVal, oldVal) => {
|
|
||||||
if (newVal === oldVal)
|
|
||||||
return
|
|
||||||
|
|
||||||
const diff = difference(selectIds.value, showIds.value)
|
|
||||||
|
|
||||||
if (diff.length === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
for (const item of offList.value) {
|
|
||||||
if (!item.fix && diff.includes(item.id)) {
|
|
||||||
const index = selectIds.value.indexOf(item.id)
|
|
||||||
item.checked = false
|
|
||||||
selectIds.value.splice(index, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
function clearDragSource() {
|
|
||||||
onList.value = onList.value.filter((item) => {
|
|
||||||
return item.fix === true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeHandler(id: string) {
|
|
||||||
const index = onList.value.findIndex((item) => {
|
|
||||||
return item.id === id
|
|
||||||
})
|
|
||||||
|
|
||||||
if (index !== -1)
|
|
||||||
onList.value.splice(index, 1)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<n-modal v-model:show="show" transform-origin="center">
|
|
||||||
<n-card class="cardstyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
|
|
||||||
<div class="wrapper">
|
|
||||||
<span class="wrapper-title">自定义任务包字段</span>
|
|
||||||
<div class="wrapper-bar">
|
|
||||||
<div class="wrapper-info">
|
|
||||||
<span :style="{ 'margin-left': '18px' }">字段信息</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<n-grid cols="4" class="mt-4 proCard" responsive="screen" :x-gap="24">
|
|
||||||
<n-grid-item span="3">
|
|
||||||
<NCard
|
|
||||||
:title="allCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
|
|
||||||
:bordered="false"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<n-input placeholder="搜索关键字">
|
|
||||||
<template #suffix>
|
|
||||||
<SvgIcon size="14px" name="magnifying-1" />
|
|
||||||
</template>
|
|
||||||
</n-input>
|
|
||||||
<div class="draggable-ul">
|
|
||||||
<div class="draggable-li">
|
|
||||||
<n-checkbox v-model:checked="checkAll" label="全部" @update:checked="onCheckAllChange" />
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<div
|
|
||||||
v-for="item in offList" :key="item.id" style="width: 170px;"
|
|
||||||
:class="{ 'disable-check': item.fix }" class="draggable-li"
|
|
||||||
>
|
|
||||||
<n-checkbox
|
|
||||||
v-model:checked="item.checked" :label="item.name" :disabled="item.fix"
|
|
||||||
@update:checked="onCheckChange($event, item)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</NCard>
|
|
||||||
</n-grid-item>
|
|
||||||
<n-grid-item>
|
|
||||||
<NCard
|
|
||||||
:title="selectCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
|
|
||||||
:bordered="false"
|
|
||||||
>
|
|
||||||
<template #header-extra>
|
|
||||||
<span class="textbtnStyle" @click="clearDragSource">清空</span>
|
|
||||||
</template>
|
|
||||||
<div>
|
|
||||||
<n-input placeholder="搜索关键字">
|
|
||||||
<template #suffix>
|
|
||||||
<SvgIcon size="14px" name="magnifying-1" />
|
|
||||||
</template>
|
|
||||||
</n-input>
|
|
||||||
<VueDraggable v-model="onList" class="draggable-ul" :animation="150" group="shared">
|
|
||||||
<div
|
|
||||||
v-for="item in onList" :key="item.id" :class="{ fix: item.fix }"
|
|
||||||
class="cursor-move draggable-item"
|
|
||||||
>
|
|
||||||
<span class="ml-2">{{ item.name }}</span>
|
|
||||||
<SvgIcon
|
|
||||||
v-if="!item.fix" size="16px" style="display: block; margin-left: auto; cursor: pointer"
|
|
||||||
name="clear" @click="removeHandler(item.id)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</VueDraggable>
|
|
||||||
</div>
|
|
||||||
</NCard>
|
|
||||||
</n-grid-item>
|
|
||||||
</n-grid>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="wrapper-footer">
|
|
||||||
<n-button type="info" @click="handleSumbit">
|
|
||||||
确认
|
|
||||||
</n-button>
|
|
||||||
<n-button secondary style="margin-left:15px" @click="closeModal">
|
|
||||||
取消
|
|
||||||
</n-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</n-card>
|
|
||||||
</n-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.wrapper {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
&-title {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-bar {
|
|
||||||
background-color: #e8e8e8;
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-info {
|
|
||||||
font-weight: bold;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
background-color: #1980ff;
|
|
||||||
content: '';
|
|
||||||
width: 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dragcardStyle {
|
|
||||||
--n-padding-bottom: 0px !important;
|
|
||||||
--n-padding-left: 0px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cardstyle {
|
|
||||||
width: 820px;
|
|
||||||
--n-padding-bottom: 20px;
|
|
||||||
--n-padding-left: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.textbtnStyle {
|
|
||||||
cursor: pointer;
|
|
||||||
color: #1980ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.draggable-ul {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1px solid #cad2dd;
|
|
||||||
border-top: 0px;
|
|
||||||
border-radius: 2px;
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.draggable-li {
|
|
||||||
padding: 10px 16px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.draggable-item {
|
|
||||||
padding: 10px 16px;
|
|
||||||
color: #333;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.disable-check {
|
|
||||||
color: gainsboro;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(.n-card.n-card--content-segmented > .n-card__content:not(:first-child)) {
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(.n-card > .n-card-header) {
|
|
||||||
--n-padding-top: 0px;
|
|
||||||
--n-padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in new issue