feat: 修改滚动bug

pull/185/head
raofuzi 1 year ago
commit 2aaa96fbcd

16
components.d.ts vendored

@ -10,10 +10,13 @@ declare module 'vue' {
Application: typeof import('./src/components/Application/Application.vue')['default'] Application: typeof import('./src/components/Application/Application.vue')['default']
BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default']
DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']
NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown']
NForm: typeof import('naive-ui')['NForm'] NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem'] NFormItem: typeof import('naive-ui')['NFormItem']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
@ -21,6 +24,19 @@ declare module 'vue' {
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default'] NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect']
NProgress: typeof import('naive-ui')['NProgress']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect']
NSlider: typeof import('naive-ui')['NSlider']
NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch']
NTag: typeof import('naive-ui')['NTag']
NTooltip: typeof import('naive-ui')['NTooltip']
NUpload: typeof import('naive-ui')['NUpload']
NUploadDragger: typeof import('naive-ui')['NUploadDragger']
Quill: typeof import('./src/components/RichEditor/Quill.vue')['default'] Quill: typeof import('./src/components/RichEditor/Quill.vue')['default']
Robot: typeof import('./src/components/Robot/index.vue')['default'] Robot: typeof import('./src/components/Robot/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']

@ -1,92 +1,92 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, inject, onMounted, ref } from "vue"; import { computed, inject, onMounted, ref } from 'vue'
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from 'vue-router'
import { useUser } from "@/store/modules/user"; import { useUser } from '@/store/modules/user'
import { getImgUrl } from "@/utils/urlUtils"; import { getImgUrl } from '@/utils/urlUtils'
import defaultAvatar from '@/assets/icons/avatar.svg'; import defaultAvatar from '@/assets/icons/avatar.svg'
const emit = defineEmits<{ const emit = defineEmits<{
(e: "logout"): void; (e: 'logout'): void
}>(); }>()
const router = useRouter(); const router = useRouter()
const userStore = useUser(); const userStore = useUser()
const useInfo = userStore.getUserInfo; const useInfo = userStore.getUserInfo
const aiDisabled = ref(false); const aiDisabled = ref(false)
function handleSelect(row) { function handleSelect(row) {
userStore.updateTenantId(row.key); userStore.updateTenantId(row.key)
location.reload(); location.reload()
} }
function logIt(e) { function logIt(e) {
return false; return false
} }
// //
function goHome(e) { function goHome(e) {
router.push({ name: "home" }); router.push({ name: 'home' })
} }
// //
function goTask(e) { function goTask(e) {
router.push({ name: "task-main" }); router.push({ name: 'task-main' })
} }
// AI // AI
function goWorksheet(e) { function goWorksheet(e) {
router.push({ name: "worksheet-main" }); router.push({ name: 'worksheet-main' })
} }
// //
function goFinal(e) { function goFinal(e) {
router.push({ name: "final-main" }); router.push({ name: 'final-main' })
} }
const mousetrap = inject("mousetrap") as any; const mousetrap = inject('mousetrap') as any
onMounted(() => { onMounted(() => {
mousetrap.bind("g h", goHome); mousetrap.bind('g h', goHome)
mousetrap.bind("g t", goTask); mousetrap.bind('g t', goTask)
mousetrap.bind("g a", goWorksheet); mousetrap.bind('g a', goWorksheet)
mousetrap.bind("g e", goFinal); mousetrap.bind('g e', goFinal)
}); })
const showPopover = ref(false); const showPopover = ref(false)
const popRef = ref(null); const popRef = ref(null)
const changeFlag = ref(false); const changeFlag = ref(false)
const iconName = computed(() => { const iconName = computed(() => {
return showPopover.value ? "expand" : "collapse"; return showPopover.value ? 'expand' : 'collapse'
}); })
function handleUpdateShow(show: boolean) { function handleUpdateShow(show: boolean) {
showPopover.value = show; showPopover.value = show
} }
function logOut() { function logOut() {
(popRef.value as any).setShow(false); (popRef.value as any).setShow(false)
emit("logout"); emit('logout')
} }
const currentCompanyName = computed(() => { const currentCompanyName = computed(() => {
const tenantList = useInfo.tenantList; const deptlist = useInfo.deptlist
const currentId = userStore.getTenantId; const currentId = userStore.getTenantId
const current = tenantList.find((item) => item.id === currentId); const current = deptlist.find(item => item.id === currentId)
return current.name || "name"; return current.name || 'name'
}); })
const options = computed(() => { const options = computed(() => {
const tenantList = useInfo.tenantList; const deptlist = useInfo.deptlist
return tenantList.map((item) => { return deptlist.map((item) => {
return { return {
label: item.name, label: item.departname,
key: item.id, key: item.deptno,
}; }
}); })
}); })
</script> </script>
<template> <template>
@ -119,24 +119,28 @@ const options = computed(() => {
</div> </div>
<div class="trigger"> <div class="trigger">
<span>{{ currentCompanyName }}</span> <span>{{ currentCompanyName }}</span>
<span @click="changeFlag = !changeFlag" style="cursor: pointer"><SvgIcon name="switchCompany" size="24" /></span> <span style="cursor: pointer" @click="changeFlag = !changeFlag"><SvgIcon name="switchCompany" size="24" /></span>
</div> </div>
<div class="item"> <div class="item">
<span>AI设置开关</span> <span>AI设置开关</span>
<n-switch v-model:value="aiDisabled" /> <n-switch v-model:value="aiDisabled" />
</div> </div>
<div class="trigger">联系我们</div> <div class="trigger">
联系我们
</div>
<n-divider style="margin-top: 0px; margin-bottom: 10px; padding: 0 22px" /> <n-divider style="margin-top: 0px; margin-bottom: 10px; padding: 0 22px" />
<div class="trigger" @click="logOut">退</div> <div class="trigger" @click="logOut">
退出登录
</div>
<div <div
class="container sub-container"
v-show="changeFlag" v-show="changeFlag"
class="container sub-container"
style="position: absolute; right: 17vw; width: 11.5vw; padding: 24px 0" style="position: absolute; right: 17vw; width: 11.5vw; padding: 24px 0"
> >
<div <div
class="trigger"
v-for="option in options" v-for="option in options"
:key="option.key" :key="option.key"
class="trigger"
@click="handleSelect(option)" @click="handleSelect(option)"
> >
{{ option.label }} {{ option.label }}

@ -15,7 +15,7 @@ const TOKEN_REFRESH_SECONDS = 20 * 60
export interface UserInfoType { export interface UserInfoType {
token: string token: string
tenantList: any[] deptlist: any[]
userInfo: any userInfo: any
} }
@ -122,8 +122,8 @@ export const useUserStore = defineStore({
if (code === ResultEnum.SUCCESS) { if (code === ResultEnum.SUCCESS) {
const ex = 7 * 24 * 60 * 60 const ex = 7 * 24 * 60 * 60
// 默认设置为第一个租户 // 默认设置为第一个租户
const firstTenant = data.tenantList.length > 0 ? data.tenantList[0] : null const firstTenant = data.deptlist.length > 0 ? data.deptlist[0] : null
const tenantId = firstTenant ? firstTenant.id : '' const tenantId = firstTenant ? firstTenant.deptno : ''
data.frontmenuTList.forEach((ele) => { data.frontmenuTList.forEach((ele) => {
if (ele.description === 'AI工单') if (ele.description === 'AI工单')
ele.description = '图审审批' ele.description = '图审审批'
@ -175,7 +175,7 @@ export const useUserStore = defineStore({
// 登出 // 登出
async logout() { async logout() {
this.setPermissions([]) this.setPermissions([])
this.setUserInfo({ tenantList: [], userInfo: {}, token: '' }) this.setUserInfo({ deptlist: [], userInfo: {}, token: '' })
this.setTenantId('') this.setTenantId('')
storage.remove(USER_ACCESS_TOKEN) storage.remove(USER_ACCESS_TOKEN)
storage.remove(CURRENT_USER) storage.remove(CURRENT_USER)

@ -41,9 +41,6 @@ import emitter from '@/utils/mitt'
import { formatToDateHMS } from '@/utils/dateUtil' import { formatToDateHMS } from '@/utils/dateUtil'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter' import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import DataHeader from '@/components/DataHeader/index.vue' import DataHeader from '@/components/DataHeader/index.vue'
import console from 'console'
const emit = defineEmits(['changeShow']) const emit = defineEmits(['changeShow'])
function changeContent() { function changeContent() {
@ -57,6 +54,7 @@ const route = useRoute()
const reviewType = 0 const reviewType = 0
const sortorder = ref('asc') const sortorder = ref('asc')
const sortname = ref('states') const sortname = ref('states')
const searchContent = route.query.searchContent as string
const actionsColumns = { const actionsColumns = {
title: '操作', title: '操作',
key: 'actions', key: 'actions',
@ -201,6 +199,7 @@ async function getColumns() {
width: 120, width: 120,
}) })
} }
return v
}) })
} }
else { else {
@ -212,6 +211,7 @@ async function getColumns() {
fixed: 'left', fixed: 'left',
width: 120, width: 120,
}) })
return v
}) })
userFieldUnFixed.map((v) => { userFieldUnFixed.map((v) => {
const item = allList.find(v2 => v2.name == v) const item = allList.find(v2 => v2.name == v)
@ -220,6 +220,7 @@ async function getColumns() {
key: item.name, key: item.name,
width: 120, width: 120,
}) })
return v
}) })
} }
// TODO: // TODO:
@ -421,6 +422,7 @@ async function formatColumns() {
const deviceHeight = ref(600) const deviceHeight = ref(600)
onMounted(() => { onMounted(() => {
// query(pagination.page, pagination.pageSize);
emitter.on('filter-final', refreshHandler) emitter.on('filter-final', refreshHandler)
getColumns() getColumns()
@ -481,6 +483,7 @@ const message = useMessage()
const finalStore = useFinal() const finalStore = useFinal()
async function query(page: number, pageSize: number, filterId?: any, taskName?: string) { async function query(page: number, pageSize: number, filterId?: any, taskName?: string) {
console.log('query', taskName)
const asideParmas = unref(finalStore.getAsideValue) const asideParmas = unref(finalStore.getAsideValue)
// 使使 // 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas // let params = filterId ? { userSearchId: filterId } : asideParmas
@ -586,10 +589,6 @@ const scrollX = computed(() => {
return width return width
}) })
onMounted(() => {
query(pagination.page, pagination.pageSize)
})
const customTabelRef = ref(null) const customTabelRef = ref(null)
const importExcelRef = ref(null) const importExcelRef = ref(null)
const notPassModalRef = ref(null) // const notPassModalRef = ref(null) //
@ -855,15 +854,23 @@ function reset() {
async function refreshHandler(searchId?: any) { async function refreshHandler(searchId?: any) {
reset() reset()
query(pagination.page, pagination.pageSize, searchId) let searchKeyword = ''
if (searchContent) {
const id_param = searchContent.match(/-\d+-/)
if (id_param)
searchKeyword = id_param[0].slice(1, -1)
}
console.log('refreshHandler', searchKeyword)
query(pagination.page, pagination.pageSize, searchId, searchKeyword)
} }
function filterTableData(keyword) { function filterTableData(keyword) {
pagination.page = 1 pagination.page = 1
pagination.pageSize = 10 pagination.pageSize = 10
if (keyword) { if (keyword)
query(pagination.page, pagination.pageSize, '', keyword) query(pagination.page, pagination.pageSize, '', keyword)
} else { query(pagination.page, pagination.pageSize) } else
query(pagination.page, pagination.pageSize)
} }
defineExpose({ defineExpose({
@ -876,10 +883,20 @@ defineExpose({
<div class="wrapper-header"> <div class="wrapper-header">
<div class="wrapper-header-left"> <div class="wrapper-header-left">
<span class="wrapper-header-font">任务管理列表</span> <span class="wrapper-header-font">任务管理列表</span>
<SvgIcon style="cursor: pointer" size="16" name="list-mode" @click="changeContent" /> <SvgIcon
style="cursor: pointer"
size="16"
name="list-mode"
@click="changeContent"
/>
</div> </div>
<div> <div>
<SvgIcon style="margin-right: 6px" size="13" name="summary" @click="showModal(repeatModalRef)" /> <SvgIcon
style="margin-right: 6px"
size="13"
name="summary"
@click="showModal(repeatModalRef)"
/>
<NButton class="xjcc" text @click="showModal(repeatModalRef)"> <NButton class="xjcc" text @click="showModal(repeatModalRef)">
小结查重 小结查重
</NButton> </NButton>
@ -898,14 +915,29 @@ defineExpose({
取消 取消
</NButton> </NButton>
<img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt="" <img
@click.stop="batchReject"> class="btn-approval btn-left"
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="batchReject"
>
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="batchApproval"> <img
class="btn-approval"
src="@/assets/images/task/btn-pass.png"
alt=""
@click.stop="batchApproval"
>
</div> </div>
<n-popover ref="popover" :style="{ padding: '0px' }" style="width: 148px" :show-arrow="false" <n-popover
placement="bottom-start" trigger="click"> ref="popover"
:style="{ padding: '0px' }"
style="width: 148px"
:show-arrow="false"
placement="bottom-start"
trigger="click"
>
<template #trigger> <template #trigger>
<div class="icon-wrap"> <div class="icon-wrap">
<SvgIcon size="20" name="more-blue" /> <SvgIcon size="20" name="more-blue" />
@ -945,20 +977,46 @@ defineExpose({
</div> </div>
</div> --> </div> -->
<div class="wrapper-settings"> <div class="wrapper-settings">
<SvgIcon style="cursor: pointer" size="18" name="column" @click="showModal(customTabelRef)" /> <SvgIcon
style="cursor: pointer"
size="18"
name="column"
@click="showModal(customTabelRef)"
/>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<NDataTable id="table" ref="tableRef" v-model:checked-row-keys="checkedRowKeys" remote :columns="columnsRef" <NDataTable
:scroll-x="scrollX" :max-height="maxHeight" :data="tableData" :loading="loading" :pagination="pagination" id="table"
:row-key="rowKey" @update:page="handlePageChange" @update-page-size="handlePageSizeChange" ref="tableRef"
@update:checked-row-keys="handleCheck" @update:sorter="handleSorterChange" /> v-model:checked-row-keys="checkedRowKeys"
remote
:columns="columnsRef"
:scroll-x="scrollX"
:max-height="maxHeight"
:data="tableData"
:loading="loading"
:pagination="pagination"
:row-key="rowKey"
@update:page="handlePageChange"
@update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck"
@update:sorter="handleSorterChange"
/>
</div> </div>
<CustomTabelModal ref="customTabelRef" @commit="commitHandler" /> <CustomTabelModal ref="customTabelRef" @commit="commitHandler" />
<ImportExcelModal ref="importExcelRef" :on-success="sucessHandler" :header-config="headRules" /> <ImportExcelModal
ref="importExcelRef"
:on-success="sucessHandler"
:header-config="headRules"
/>
<NotPassed ref="notPassModalRef" @success="reload" /> <NotPassed ref="notPassModalRef" @success="reload" />
<RepeatModal ref="repeatModalRef" @reject="repeatBatchReject" @viewrepeat="showModal(repeatTaskTableModalRef)" /> <RepeatModal
ref="repeatModalRef"
@reject="repeatBatchReject"
@viewrepeat="showModal(repeatTaskTableModalRef)"
/>
<RepeatTaskTableModal ref="repeatTaskTableModalRef" /> <RepeatTaskTableModal ref="repeatTaskTableModalRef" />
</div> </div>
</template> </template>

@ -10,110 +10,111 @@ import {
shallowRef, shallowRef,
unref, unref,
watch, watch,
} from "vue"; } from 'vue'
import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from "./comp/modals"; import dayjs from 'dayjs'
import Search from "./comp/Search.vue"; import { cloneDeep, isEqual } from 'lodash-es'
import AdvanceFilter from "./comp/AdvanceFilter.vue"; import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from './comp/modals'
import { getViewportOffset } from "@/utils/domUtils"; import Search from './comp/Search.vue'
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn"; import AdvanceFilter from './comp/AdvanceFilter.vue'
import { useConfig } from "@/store/modules/asideConfig"; import { getViewportOffset } from '@/utils/domUtils'
import type { Filter } from "/#/home"; import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import type { AsideEntity } from "@/config/aside"; import { useConfig } from '@/store/modules/asideConfig'
import { asideMap } from "@/config/aside"; import type { Filter } from '/#/home'
import type { AsideConfig } from "/#/api"; import type { AsideEntity } from '@/config/aside'
import emitter from "@/utils/mitt"; import { asideMap } from '@/config/aside'
import { getFilterList } from "@/api/home/main"; import type { AsideConfig } from '/#/api'
import dayjs from "dayjs"; import emitter from '@/utils/mitt'
import { cloneDeep, isEqual } from "lodash-es"; import { getFilterList } from '@/api/home/main'
const configStore = useConfig(); const configStore = useConfig()
// //
let asideValue: Record<keyof typeof asideMap, any> = reactive({}); const asideValue: Record<keyof typeof asideMap, any> = reactive({})
// : // :
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({}); const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({})
// //
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]); const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
Object.keys(asideMap).forEach((key) => { Object.keys(asideMap).forEach((key) => {
const entity = asideMap[key]; const entity = asideMap[key]
const { defaultValue } = entity; const { defaultValue } = entity
asideValue[key] = defaultValue; asideValue[key] = defaultValue
}); })
const filterModalRef: any = ref(null); const filterModalRef: any = ref(null)
const newFilterModalRef = ref(null); const newFilterModalRef = ref(null)
const customModalRef = ref(null); const customModalRef = ref(null)
const customObjRef = ref<any>(null); // const customObjRef = ref<any>(null) //
const customTempObjRef = ref<any>(null); // () const customTempObjRef = ref<any>(null) // ()
const configFilterRef = ref<any>([]); // const configFilterRef = ref<any>([]) //
const AdvanceFilterRef: any = ref(null); const AdvanceFilterRef: any = ref(null)
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any; const modal = unref(modalRef)! as any
modal.showModal(); modal.showModal()
} }
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
computeSlideHeight(); computeSlideHeight()
let tempAsideValue = cloneDeep(asideValue); const tempAsideValue = cloneDeep(asideValue)
// configStore.setAsideValue(tempAsideValue); // configStore.setAsideValue(tempAsideValue);
console.log("asideMap和asideValue", tempAsideValue); console.log('asideMap和asideValue', tempAsideValue)
}); })
}); })
const collapse = ref(false); const collapse = ref(false)
const mousetrap = inject("mousetrap") as any; const mousetrap = inject('mousetrap') as any
mousetrap.bind("[", collapseHandler); mousetrap.bind('[', collapseHandler)
function collapseHandler() { function collapseHandler() {
collapse.value = !collapse.value; collapse.value = !collapse.value
} }
const asideWidth = computed(() => { const asideWidth = computed(() => {
return collapse.value ? 0 : 308; return collapse.value ? 0 : 308
}); })
const asideHeight = ref(500); const asideHeight = ref(500)
const asideStyle = computed(() => { const asideStyle = computed(() => {
return { return {
width: `${asideWidth.value}px`, width: `${asideWidth.value}px`,
height: `${asideHeight.value}px`, height: `${asideHeight.value}px`,
}; }
}); })
const collapseIcon = computed(() => { const collapseIcon = computed(() => {
return collapse.value ? "expand-cir" : "collapse-cir"; return collapse.value ? 'expand-cir' : 'collapse-cir'
}); })
function computeSlideHeight() { function computeSlideHeight() {
const headEl = document.querySelector(".aside-header")!; const headEl = document.querySelector('.aside-header')!
const { bottomIncludeBody } = getViewportOffset(headEl); const { bottomIncludeBody } = getViewportOffset(headEl)
const height = bottomIncludeBody; const height = bottomIncludeBody
asideHeight.value = height - 24; asideHeight.value = height - 24
} }
useWindowSizeFn(computeSlideHeight, 280); useWindowSizeFn(computeSlideHeight, 280)
onBeforeMount(async () => { onBeforeMount(async () => {
configStore.fetchConfig(); configStore.fetchConfig()
configStore.fetchCustomConfig(); configStore.fetchCustomConfig()
}); })
nextTick(() => { nextTick(() => {
configStore.$subscribe(() => { configStore.$subscribe(() => {
const config = configStore.getConfig; const config = configStore.getConfig
const customConfig = configStore.getCustomConfig; const customConfig = configStore.getCustomConfig
if ( if (
configFilterRef.value.length > 0 && configFilterRef.value.length > 0
isEqual(configFilterRef.value, configStore.getFilterConfig) && && isEqual(configFilterRef.value, configStore.getFilterConfig)
customObjRef.value && && customObjRef.value
isEqual(customObjRef.value, customTempObjRef.value) && isEqual(customObjRef.value, customTempObjRef.value)
) { )
return; return
}
if (config == null || customConfig == null) return; if (config == null || customConfig == null)
return
// console.log("config", config, "customConfig", customConfig); // console.log("config", config, "customConfig", customConfig);
/* rao /* rao
const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter
@ -121,152 +122,169 @@ nextTick(()=>{
showKeys.unshift(...defaultKeys) showKeys.unshift(...defaultKeys)
*/ */
let sortKeyList: any = []; const sortKeyList: any = []
configStore.getFilterConfig.map((item: any) => { configStore.getFilterConfig.map((item: any) => {
sortKeyList.push(item?.id); sortKeyList.push(item?.id)
}); return item
const showKeys = [...sortKeyList]; })
const showKeys = [...sortKeyList]
Object.keys(config).forEach((key) => { Object.keys(config).forEach((key) => {
if (key.startsWith("iz") && asideMap[key] !== undefined) if (key.startsWith('iz') && asideMap[key] !== undefined) {
asideVisible[key] = asideVisible[key]
(showKeys.includes(key) || asideMap[key].isDefaultFilter) && config[key] === "Y"; = (showKeys.includes(key) || asideMap[key].isDefaultFilter)
}); && config[key] === 'Y'
}
})
if (customObjRef.value) { if (customObjRef.value) {
// //
Object.keys(customObjRef.value).map((key) => { Object.keys(customObjRef.value).map((key) => {
if (asideMap.hasOwnProperty(key)) { // TODO hasOwnProperty
const str = key.toLowerCase(); // if (asideMap.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(customObjRef.value, key)) {
const str = key.toLowerCase()
// console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]); // console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]);
if (str == "izsimilarity") { if (str == 'izsimilarity') {
if (typeof customObjRef.value[str] == "string") { if (typeof customObjRef.value[str] == 'string')
customObjRef.value[str] = customObjRef.value[str].split(","); customObjRef.value[str] = customObjRef.value[str].split(',')
}
asideValue[key] = customObjRef.value[str]; // asideValue[key] = customObjRef.value[str] //
console.log("相似度2222222222", asideValue[key]); console.log('相似度2222222222', asideValue[key])
} else if (str == "izyear") { }
if (typeof customObjRef.value[str] == "string") { else if (str == 'izyear') {
let time = customObjRef.value[str].split("-"); if (typeof customObjRef.value[str] == 'string') {
time[0] = new Date(time[0]).getTime(); const time = customObjRef.value[str].split('-')
time[1] = new Date(time[1]).getTime(); time[0] = new Date(time[0]).getTime()
customObjRef.value[str] = time; time[1] = new Date(time[1]).getTime()
} customObjRef.value[str] = time
asideValue[key] = customObjRef.value[str]; // }
console.log("时间2222222222", asideValue[key]); asideValue[key] = customObjRef.value[str] //
} else if (str != "izsimilarity" && str != "izyear" && customObjRef.value[str]) { console.log('时间2222222222', asideValue[key])
console.log("customObjRef.value[str]222222", customObjRef.value[str]); }
else if (
str != 'izsimilarity'
&& str != 'izyear'
&& customObjRef.value[str]
) {
console.log('customObjRef.value[str]222222', customObjRef.value[str])
// let list = customObjRef.value[str].split(','); // let list = customObjRef.value[str].split(',');
// console.log("list222222", list); // console.log("list222222", list);
asideValue[key] = customObjRef.value[str]; // asideValue[key] = customObjRef.value[str] //
} else { }
asideValue[key] = null; else {
asideValue[key] = null
} }
// asideMap[str].defaultValue = customObjRef.value[str];// // asideMap[str].defaultValue = customObjRef.value[str];//
} }
}); return key
customTempObjRef.value = customObjRef.value; })
console.log("asideValue直接处理后的结果", asideValue); customTempObjRef.value = customObjRef.value
console.log("customTempObjRef.value", customTempObjRef.value); console.log('asideValue直接处理后的结果', asideValue)
let tempobj = cloneDeep(asideValue); console.log('customTempObjRef.value', customTempObjRef.value)
console.log("tempObj", tempobj); const tempobj = cloneDeep(asideValue)
configStore.setAsideValue(tempobj); console.log('tempObj', tempobj)
configStore.setAsideValue(tempobj)
} }
// console.log("showKeys", showKeys); // console.log("showKeys", showKeys);
const items = showKeys.reduce((acc, key) => { const items = showKeys.reduce((acc, key) => {
const currentData = asideMap[key]; const currentData = asideMap[key]
const render = currentData?.render; const render = currentData?.render
if (render !== false) { if (render !== false) {
const str = key?.toLowerCase(); const str = key?.toLowerCase()
const o = { const o = {
key: str, key: str,
config: asideMap[str], config: asideMap[str],
};
return [...acc, o];
} else {
return acc;
} }
}, []); return [...acc, o]
console.log("showItems=================================", items); }
showItems.value = items; else {
configFilterRef.value = configStore.getFilterConfig; return acc
}); }
}, [])
console.log('showItems=================================', items)
showItems.value = items
configFilterRef.value = configStore.getFilterConfig
}) })
const asideEnter = ref(false); })
const asideEnter = ref(false)
const showCollapse = computed(() => { const showCollapse = computed(() => {
return collapse.value ? true : asideEnter.value; return collapse.value ? true : asideEnter.value
}); })
const showSearch = ref(false); const showSearch = ref(false)
function setShowSearch(value: boolean) { function setShowSearch(value: boolean) {
showSearch.value = value; showSearch.value = value
} }
const newFilterOk = () => { function newFilterOk() {
filterModalRef.value.query( filterModalRef.value.query(
filterModalRef.value.pagination.page, filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize filterModalRef.value.pagination.pageSize,
); )
filterModalRef.value.showModal(); filterModalRef.value.showModal()
}; }
// key // key
function scrollHandler(key: string) { function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`); const element = document.querySelector(`#${key}`)
element?.scrollIntoView(true); element?.scrollIntoView(true)
} }
// -> // ->
async function filterHandler(searchId: string) { async function filterHandler(searchId: string) {
// emitter.emit('filter', searchId) // emitter.emit('filter', searchId)
const res = await getFilterList({ userSearchId: searchId }); const res = await getFilterList({ userSearchId: searchId })
// console.log("", res); // console.log("", res);
if (res.code == "OK") { if (res.code == 'OK') {
let obj = res.data; const obj = res.data
customObjRef.value = res.data; customObjRef.value = res.data
let showKeys: any[] = []; const showKeys: any[] = []
Object.keys(obj).map((key) => { Object.keys(obj).map((key) => {
if (asideMap.hasOwnProperty(key)) { // TODO hasOwnProperty
showKeys.push(key); // if (asideMap.hasOwnProperty(key)) {
} if (Object.prototype.hasOwnProperty.call(asideMap, key))
}); showKeys.push(key)
return key
})
// console.log(showKeys); // console.log(showKeys);
configStore.setCustomConfig(showKeys); configStore.setCustomConfig(showKeys)
} }
} }
function editFilter(filter: any) { function editFilter(filter: any) {
const modal = unref(newFilterModalRef)! as any; const modal = unref(newFilterModalRef)! as any
modal.showModal(); modal.showModal()
modal.edit(filter); modal.edit(filter)
} }
function updateComponent(key, e) { function updateComponent(key, e) {
console.log("跟新值", key, e); console.log('跟新值', key, e)
console.log("tempAsideValue跟新值", configStore.getAsideValue, asideValue); console.log('tempAsideValue跟新值', configStore.getAsideValue, asideValue)
// let tempAsideValue = configStore.getAsideValue || asideValue; // let tempAsideValue = configStore.getAsideValue || asideValue;
let tempobj = cloneDeep(asideValue); const tempobj = cloneDeep(asideValue)
console.log(tempobj, "tempobj"); console.log(tempobj, 'tempobj')
tempobj[key] = e; tempobj[key] = e
console.log(tempobj, "tempobj After"); console.log(tempobj, 'tempobj After')
customObjRef.value = tempobj; customObjRef.value = tempobj
// asideValue = Object.assign({}, asideValue, tempobj); // asideValue = Object.assign({}, asideValue, tempobj);
console.log("asideValue跟新值", tempobj); console.log('asideValue跟新值', tempobj)
configStore.setAsideValue(tempobj); configStore.setAsideValue(tempobj)
} }
const handleOk = (item: any) => { function handleOk(item: any) {
console.log("handleOk", item); console.log('handleOk', item)
if (item) { if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname); AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id); filterHandler(item.id)
} else { }
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选"); else {
filterHandler(""); AdvanceFilterRef.value.setCurrentlySelectedAdvanced('高级筛选')
filterHandler('')
}
} }
};
// watch(asideValue, (newVal) => { // watch(asideValue, (newVal) => {
// console.log("asideValue", newVal); // console.log("asideValue", newVal);
@ -297,22 +315,22 @@ const handleOk = (item: any) => {
<!-- 高级筛选 --> <!-- 高级筛选 -->
<AdvanceFilter <AdvanceFilter
v-show="!showSearch" v-show="!showSearch"
ref="AdvanceFilterRef"
:type="0" :type="0"
@select="filterHandler" @select="filterHandler"
@update:search="setShowSearch(true)" @update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)" @show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)" @show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/> />
</div> </div>
<component <component
:is="item.config.component" :is="item.config?.component"
v-for="(item, index) in showItems" v-for="item in showItems"
:id="item.key" :id="item.key"
:key="item.key" :key="item.key"
v-model:value="asideValue[item.key]" v-model:value="asideValue[item.key]"
:label="item.config.label" :label="item.config?.label"
@update:value="(e) => updateComponent(item.key, e)" @update:value="(e) => updateComponent(item.key, e)"
/> />
@ -321,10 +339,10 @@ const handleOk = (item: any) => {
ref="filterModalRef" ref="filterModalRef"
@edit-filter="editFilter" @edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)" @show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk" @handle-ok="handleOk"
/> />
<!-- 新增过滤 --> <!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @onOk="newFilterOk" /> <NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
<!-- 筛选 --> <!-- 筛选 -->
<CustomFilterModalVue ref="customModalRef" /> <CustomFilterModalVue ref="customModalRef" />
</n-scrollbar> </n-scrollbar>

@ -1,16 +1,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onMounted, ref, watch } from 'vue' import { nextTick, onMounted, ref, watch } from 'vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { useRoute, useRouter } from 'vue-router'
import { asideMap } from '@/config/aside' import { asideMap } from '@/config/aside'
import type { SearchEntity } from '/#/home' import type { SearchEntity } from '/#/home'
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from '@/store/modules/asideConfig'
import { useRoute } from 'vue-router' import { useFinal } from '@/store/modules/final'
import { useFinal } from "@/store/modules/final";
const finalStore = useFinal();
const route = useRoute()
const searchContent = route.query.searchContent as string;
defineOptions({ name: 'Search' }) defineOptions({ name: 'Search' })
const emit = defineEmits<{ const emit = defineEmits<{
@ -20,13 +16,18 @@ const emit = defineEmits<{
(e: 'showSearch'): void (e: 'showSearch'): void
}>() }>()
const finalStore = useFinal()
const router = useRouter()
const route = useRoute()
const searchContent = route.query.searchContent as string
const data = ref<SearchEntity[]>([]) const data = ref<SearchEntity[]>([])
const popover = ref<ComponentRef | null>(null) const popover = ref<ComponentRef | null>(null)
const configStore = useConfig() const configStore = useConfig()
const searchKeyword = ref('') const searchKeyword = ref('')
const inputHandler = debounce((keyword) => { const inputHandler = debounce((keyword) => {
searchKeyword.value = keyword; searchKeyword.value = keyword
emit('inputChange', keyword) emit('inputChange', keyword)
}, 300) }, 300)
@ -42,7 +43,7 @@ configStore.$subscribe(() => {
return return
const list = keys.map((key) => { const list = keys.map((key) => {
const name = asideMap[key].label const name = asideMap[key]?.label
return { return {
key, key,
@ -59,30 +60,28 @@ function selectHandler(item: SearchEntity) {
} }
// //
const searchName = () => { function searchName() {
configStore.setSearchValue(searchKeyword.value); configStore.setSearchValue(searchKeyword.value)
finalStore.setSearchValue(searchKeyword.value); finalStore.setSearchValue(searchKeyword.value)
emit('inputChange', searchKeyword.value); emit('inputChange', searchKeyword.value)
} }
function close() {
searchKeyword.value = ''
configStore.setSearchValue(searchKeyword.value)
finalStore.setSearchValue(searchKeyword.value)
if (searchContent)
router.push(route.path)
emit('close')
const close = () => {
searchKeyword.value = "";
configStore.setSearchValue(searchKeyword.value);
finalStore.setSearchValue(searchKeyword.value);
emit('close');
} }
function initSerach() {
const initSerach = () => {
if (searchContent) { if (searchContent) {
emit('showSearch') emit('showSearch')
const id_param = searchContent.match(/-\d+-/); const id_param = searchContent.match(/-\d+-/)
if (id_param) { if (id_param) {
searchKeyword.value = id_param[0].slice(1, -1); searchKeyword.value = id_param[0].slice(1, -1)
emit('inputChange', searchKeyword.value) emit('inputChange', searchKeyword.value)
} }
} }
@ -94,13 +93,28 @@ onMounted(() => {
<template> <template>
<div class="wrapper"> <div class="wrapper">
<n-popover ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false" <n-popover
placement="bottom-start" trigger="focus"> ref="popover"
:style="{ padding: '0px' }"
style="width: 248px"
:show-arrow="false"
placement="bottom-start"
trigger="focus"
>
<template #trigger> <template #trigger>
<n-input v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容" <n-input
@input="inputHandler"> v-model:value="searchKeyword"
style="width: 260px; height: 32px"
placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<template #suffix> <template #suffix>
<SvgIcon size="14px" name="magnifying-1" @click="searchName" style="cursor: pointer;" /> <SvgIcon
size="14px"
name="magnifying-1"
style="cursor: pointer"
@click="searchName"
/>
</template> </template>
</n-input> </n-input>
</template> </template>
@ -113,7 +127,12 @@ onMounted(() => {
</div> --> </div> -->
</n-popover> </n-popover>
<SvgIcon size="16px" style="margin-left: 6px;cursor: pointer;" name="clear" @click="close" /> <SvgIcon
size="16px"
style="margin-left: 6px; cursor: pointer"
name="clear"
@click="close"
/>
</div> </div>
</template> </template>

@ -14,6 +14,13 @@ const configStore = useConfig()
const checkAll = ref(false) const checkAll = ref(false)
const selectIds = ref<string[]>([]) const selectIds = ref<string[]>([])
const tempList = ref<string[]>([]) const tempList = ref<string[]>([])
//
const offList = ref<any[]>([])
//
const onList = ref<any[]>([])
const offKeyword = ref('')
const onKeyword = ref('')
function showModal() { function showModal() {
show.value = true show.value = true
@ -27,7 +34,10 @@ function showModal() {
if (tempList.value.length > 0 && isEqual(tempList.value, configStore.getFilterConfig)) if (tempList.value.length > 0 && isEqual(tempList.value, configStore.getFilterConfig))
return return
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------', customConfig) console.log(
'开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',
customConfig,
)
const { showList, hideList } = generatList(config, customConfig) const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList) tempList.value = cloneDeep(showList)
if (tempList.value.length > 0) if (tempList.value.length > 0)
@ -46,11 +56,6 @@ function closeModal() {
show.value = false show.value = false
} }
//
const offList = ref<any[]>([])
//
const onList = ref<any[]>([])
const allCount = computed(() => { const allCount = computed(() => {
return `全部筛选(共${offList.value.length}个)` return `全部筛选(共${offList.value.length}个)`
}) })
@ -138,7 +143,8 @@ function generatList(config, customConfig) {
const sortKeyList: any = [] const sortKeyList: any = []
configStore.getFilterConfig.map((item: any) => { configStore.getFilterConfig.map((item: any) => {
sortKeyList.push(item.id) sortKeyList.push(item?.id)
return item
}) })
console.log('原始筛选条件sortKeyList', sortKeyList) console.log('原始筛选条件sortKeyList', sortKeyList)
const sortList: any = [] const sortList: any = []
@ -146,12 +152,14 @@ function generatList(config, customConfig) {
sortKeyList.map((key) => { sortKeyList.map((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
sortList.push(tempItem) sortList.push(tempItem)
return key
}) })
} }
else { else {
customConfig.map((key) => { customConfig.map((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
sortList.push(tempItem) sortList.push(tempItem)
return key
}) })
} }
console.log('原始筛选条件sortList', sortList) console.log('原始筛选条件sortList', sortList)
@ -185,9 +193,11 @@ configStore.$subscribe(() => {
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
e.preventDefault() e.preventDefault()
const param = onList.value.map((item) => { const param = onList.value
.map((item) => {
return item.id return item.id
}).join(',') })
.join(',')
await setFilter({ searchcount: param, type: 0 }) await setFilter({ searchcount: param, type: 0 })
const obj = await configStore.fetchCustomConfig() const obj = await configStore.fetchCustomConfig()
@ -198,6 +208,7 @@ async function handleSumbit(e: MouseEvent) {
obj.map((key) => { obj.map((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
sortList.push(tempItem) sortList.push(tempItem)
return key
}) })
console.log('configStore.sortList---------------', sortList) console.log('configStore.sortList---------------', sortList)
// setTimeout(() => { // setTimeout(() => {
@ -228,8 +239,7 @@ function onCheckChange(checked: any, item: any) {
if (index === -1 && checked) if (index === -1 && checked)
selectIds.value.push(item.id) selectIds.value.push(item.id)
else else index !== -1 && selectIds.value.splice(index, 1)
index !== -1 && selectIds.value.splice(index, 1)
checkAll.value = offList.value.every(item => item.checked) checkAll.value = offList.value.every(item => item.checked)
} }
@ -247,7 +257,10 @@ watch(
return return
const action = newVal > oldVal ? 'add' : 'remove' const action = newVal > oldVal ? 'add' : 'remove'
const diff = action === 'add' ? difference(selectIds.value, showIds.value) : difference(showIds.value, selectIds.value) const diff
= action === 'add'
? difference(selectIds.value, showIds.value)
: difference(showIds.value, selectIds.value)
if (diff.length === 0) if (diff.length === 0)
return return
@ -314,9 +327,6 @@ function removeHandler(id: string) {
onList.value.splice(index, 1) onList.value.splice(index, 1)
} }
const offKeyword = ref('')
const onKeyword = ref('')
const leftInputHandler = debounce((keyword) => { const leftInputHandler = debounce((keyword) => {
offKeyword.value = keyword offKeyword.value = keyword
}, 300) }, 300)
@ -345,7 +355,13 @@ onMounted(() => {
<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 class="cardstyle" :bordered="false" size="huge" role="dialog" aria-modal="true"> <n-card
class="cardstyle"
:bordered="false"
size="huge"
role="dialog"
aria-modal="true"
>
<div class="wrapper"> <div class="wrapper">
<span class="wrapper-title">自定义筛选</span> <span class="wrapper-title">自定义筛选</span>
<div class="wrapper-bar"> <div class="wrapper-bar">
@ -357,7 +373,10 @@ onMounted(() => {
<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" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small" :title="allCount"
class="dragcardStyle"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false" :bordered="false"
> >
<div class="input_wrap"> <div class="input_wrap">
@ -366,17 +385,29 @@ onMounted(() => {
<SvgIcon size="14px" name="magnifying-1-color999" /> <SvgIcon size="14px" name="magnifying-1-color999" />
</template> </template>
</n-input> </n-input>
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;"> <n-scrollbar
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
>
<div class="draggable-ul"> <div class="draggable-ul">
<div class="draggable-li"> <div class="draggable-li">
<n-checkbox v-model:checked="checkAll" label="全选" :indeterminate="!checkAll" @update:checked="onCheckAllChange" /> <n-checkbox
v-model:checked="checkAll"
label="全选"
:indeterminate="!checkAll"
@update:checked="onCheckAllChange"
/>
</div> </div>
<div <div
v-for="item in offList" v-show="item.name.includes(offKeyword)" :key="item.id" :class="{ 'disable-check': item.fix }" v-for="item in offList"
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" :label="item.name" :disabled="item.fix" v-model:checked="item.checked"
:label="item.name"
:disabled="item.fix"
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
@ -385,12 +416,15 @@ onMounted(() => {
</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" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small" :title="selectCount"
class="dragcardStyle"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false" :bordered="false"
> >
<template #header-extra> <template #header-extra>
@ -402,14 +436,31 @@ onMounted(() => {
<SvgIcon size="14px" name="magnifying-1-color999" /> <SvgIcon size="14px" name="magnifying-1-color999" />
</template> </template>
</n-input> </n-input>
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;" class="scroll"> <n-scrollbar
<VueDraggable v-model="onList" class="draggable-ul" :animation="150" group="shared"> style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
<div v-for="item in onList" v-show="item.name.includes(onKeyword)" :key="item.id" :draggable="true" class="cursor-move draggable-li"> class="scroll"
>
<VueDraggable
v-model="onList"
class="draggable-ul"
:animation="150"
group="shared"
>
<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" /> <SvgIcon name="drag" size="24" />
<span class="ml-2">{{ item.name }}</span> <span class="ml-2">{{ item.name }}</span>
<SvgIcon <SvgIcon
v-if="!item.fix" size="16px" style="display:block;margin-left: auto;cursor: pointer;" v-if="!item.fix"
name="clear" @click="removeHandler(item.id)" size="16px"
style="display: block; margin-left: auto; cursor: pointer"
name="clear"
@click="removeHandler(item.id)"
/> />
</div> </div>
</VueDraggable> </VueDraggable>
@ -424,7 +475,11 @@ onMounted(() => {
<n-button type="info" @click="handleSumbit"> <n-button type="info" @click="handleSumbit">
确定 确定
</n-button> </n-button>
<n-button secondary style="margin-left:15px; border: 1px solid #CAD2DD;" @click="closeModal"> <n-button
secondary
style="margin-left: 15px; border: 1px solid #cad2dd"
@click="closeModal"
>
取消 取消
</n-button> </n-button>
</div> </div>
@ -454,7 +509,7 @@ onMounted(() => {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
.n-button--info-type { .n-button--info-type {
background: #507AFD !important; background: #507afd !important;
} }
.n-button--default-type { .n-button--default-type {
background: #fff !important; background: #fff !important;
@ -468,7 +523,7 @@ onMounted(() => {
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;
@ -498,7 +553,7 @@ onMounted(() => {
.textbtnStyle { .textbtnStyle {
cursor: pointer; cursor: pointer;
color: #1980FF; color: #1980ff;
} }
.draggable-ul { .draggable-ul {
@ -539,8 +594,8 @@ onMounted(() => {
::v-deep(.n-scrollbar) { ::v-deep(.n-scrollbar) {
border-left: 1px solid #cad2dd !important; border-left: 1px solid #cad2dd !important;
border-right: 1px solid #cad2dd !important; border-right: 1px solid #cad2dd !important;
border-bottom: 1px solid #E8E8E8 !important; border-bottom: 1px solid #e8e8e8 !important;
border-top: 1px solid #E8E8E8 !important; border-top: 1px solid #e8e8e8 !important;
} }
::v-deep(.n-card__content) { ::v-deep(.n-card__content) {
padding: 20px 24px 0 24px !important; padding: 20px 24px 0 24px !important;
@ -558,6 +613,6 @@ onMounted(() => {
} }
} }
::v-deep(.n-button--info-type) { ::v-deep(.n-button--info-type) {
background: #507AFD !important; background: #507afd !important;
} }
</style> </style>

Loading…
Cancel
Save