pull/174/head
贾博轩 1 year ago
commit cc6f0ce4c1

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -66,6 +66,15 @@ const viewLabel = computed(() => {
return item?.label return item?.label
}) })
const maxHeight = computed(() => {
let height = "800";
const screenWidth = window.screen.width;
if(screenWidth <= 1920) {
height = "600";
}
return height + 'px';
})
const masonryRef = ref<ComponentRef>(null) const masonryRef = ref<ComponentRef>(null)
const el = ref<HTMLDivElement | null>(null) const el = ref<HTMLDivElement | null>(null)
const elwc = ref<HTMLDivElement | null>(null) const elwc = ref<HTMLDivElement | null>(null)
@ -383,7 +392,8 @@ async function onChange() {
// orderbyname: val, // orderbyname: val,
orderByUptime: timeRange.value orderByUptime: timeRange.value
} }
pagination.pageNo = 1 pagination.pageNo = 1;
canloadMore = true;
const list = await featchList() const list = await featchList()
listData.value = list listData.value = list
layout() layout()
@ -399,7 +409,8 @@ async function onChangeView() {
// orderbyname: val, // orderbyname: val,
orderBySimilarity: similarRange.value orderBySimilarity: similarRange.value
} }
pagination.pageNo = 1 pagination.pageNo = 1;
canloadMore = true;
const list = await featchList() const list = await featchList()
listData.value = list listData.value = list
layout() layout()
@ -601,13 +612,13 @@ watch(() => show.value,
watch(() => pagination.pageNo, watch(() => pagination.pageNo,
(newVal, oldVal) => { (newVal, oldVal) => {
console.log("加载了22222222222222222---------------------------", newVal, oldVal, canloadMore);
if(newVal == oldVal) { if(newVal == oldVal) {
return return
} }
if((newVal == 1 || newVal == 2) && canloadMore) { if((newVal == 1 || newVal == 2) && canloadMore) {
setTimeout(() => { setTimeout(() => {
nextTick(() => { nextTick(() => {
console.log("加载了22222222222222222---------------------------", newVal);
loading = false loading = false
loadMore(); loadMore();
}) })
@ -695,7 +706,7 @@ watch(() => pagination.pageNo,
</div> </div>
</div> </div>
<div ref="el" class="scroll"> <div ref="el" class="scroll" :style="{height: maxHeight}">
<!-- <n-scrollbar :on-scroll="scrollHandler"> --> <!-- <n-scrollbar :on-scroll="scrollHandler"> -->
<div ref="masonryRef" class="grid"> <div ref="masonryRef" class="grid">
<div v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId" <div v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId"

@ -1,40 +1,111 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { store } from '@/store' import { store } from '@/store'
import { getFilter } from '@/api/home/filter' import { getFilter } from '@/api/home/filter'
import { getConfig } from '@/api/system/user'
import { asideMap } from "@/config/final";
import { cloneDeep, isEqual } from "lodash-es";
import type { AsideConfig } from '/#/api'
export interface ConfigState { export interface ConfigState {
systemConfig: AsideConfig | null
customConfig: string[] | null customConfig: string[] | null
asideValue: any asideValue: any
listKey: number listKey: number
searchValue: string
isAllowDownload: boolean
timeNum: number
filterConfig: string[] // 过滤筛选条件
} }
export const useFinalStore = defineStore({ export const useFinalStore = defineStore({
id: 'app-final', id: 'app-final',
state: (): ConfigState => ({ state: (): ConfigState => ({
systemConfig: null,
customConfig: null, customConfig: null,
asideValue: null, asideValue: null,
listKey: 0, listKey: 0,
searchValue: "",
isAllowDownload: true,
timeNum: 0,
filterConfig: [],
}), }),
getters: { getters: {
getSystemConfig(): AsideConfig | null {
return this.systemConfig
},
getCustomConfig(): string[] | null { getCustomConfig(): string[] | null {
return this.customConfig return this.customConfig
}, },
getAsideValue(): any { getAsideValue(): any {
return this.asideValue return this.asideValue
}, },
getSearchValue(): any {
return this.searchValue
},
getIsAllowDownload(): any {
return this.isAllowDownload
},
getTimeNum(): any {
return this.timeNum
},
getFilterConfig(): any {
return this.filterConfig
},
}, },
actions: { actions: {
setSystemConfig(config: AsideConfig) {
this.systemConfig = config
console.log("systemConfig----------", config);
},
setAsideValue(value) { setAsideValue(value) {
this.asideValue = value this.asideValue = value
}, },
setListKey() { setListKey() {
this.listKey = new Date().getTime() this.listKey = new Date().getTime()
}, },
setSearchValue(value) {
this.searchValue = value
},
setIsAllowDownload(value) {
this.isAllowDownload = value
},
setTimeNum(value) {
this.timeNum = value
},
// 设置个性化配置
setCustomConfig(value) {
this.customConfig = value
},
setFilterConfig(value) {
this.filterConfig = value
},
// 获取系统配置信息
async fetchConfig() {
const response = await getConfig()
console.log("response.data----------", response.data);
this.setSystemConfig(response.data)
return response.data
},
// // 获取终审个性化配置
// async fetchCustomConfig() {
// const res = await getFilter(1)
// const { data } = res
// const list = data && data.searchcount ? data.searchcount.split(',') : [];
// console.log("listkey---------------", list);
// this.customConfig = list
// return list
// },
// 获取终审个性化配置 // 获取终审个性化配置
async fetchCustomConfig() { async fetchCustomConfig() {
const res = await getFilter(1) let list: any = [];
const { data } = res let tempAsideMap = cloneDeep(asideMap);
const list = data && data.searchcount ? data.searchcount.split(',') : [] Object.keys(tempAsideMap).map(key => {
if(!tempAsideMap[key].isDefaultFilter) {
list.push(key);
}
});
console.log("listkey---------------", list);
this.customConfig = list this.customConfig = list
return list return list
}, },

@ -22,6 +22,8 @@ import type { AsideEntity } from "@/config/aside";
import { asideMap } from "@/config/final"; import { asideMap } from "@/config/final";
import type { AsideConfig } from "/#/api"; import type { AsideConfig } from "/#/api";
import emitter from "@/utils/mitt"; import emitter from "@/utils/mitt";
import { getFilterList } from "@/api/home/main";
import { cloneDeep, isEqual } from "lodash-es";
const emit = defineEmits(["inputChange"]); const emit = defineEmits(["inputChange"]);
const finalStore = useFinal(); const finalStore = useFinal();
@ -31,6 +33,16 @@ 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 }[]>([]);
const initAsideValueRef = ref<any>(null); // ()
const customObjRef = ref<any>(null); //
const customTempObjRef = ref<any>(null); // ()
initAsideValueRef.value = cloneDeep(asideMap);
onBeforeMount(async () => {
finalStore.fetchConfig();
finalStore.fetchCustomConfig();
});
Object.keys(asideMap).forEach((key) => { Object.keys(asideMap).forEach((key) => {
const { defaultValue, inFilterList } = asideMap[key]; const { defaultValue, inFilterList } = asideMap[key];
@ -99,38 +111,40 @@ onBeforeMount(async () => {
finalStore.fetchCustomConfig(); finalStore.fetchCustomConfig();
}); });
finalStore.$subscribe(() => { nextTick(()=>{
const customConfig = finalStore.getCustomConfig; finalStore.$subscribe(() => {
const customConfig = finalStore.getCustomConfig;
if (customConfig === null) return; console.log("customConfig111111111---------------", customConfig);
if (customConfig === null) return;
const showKeys: string[] = [...customConfig];
const defaultKeys = Object.keys(asideMap).filter( const showKeys: string[] = [...customConfig];
(key) => asideMap[key].isDefaultFilter const defaultKeys = Object.keys(asideMap).filter(
); (key) => asideMap[key].isDefaultFilter
showKeys.unshift(...defaultKeys); );
showKeys.unshift(...defaultKeys);
Object.keys(asideMap).forEach((key) => {
// Object.keys(asideMap).forEach((key) => {
if (key.startsWith("iz")) //
asideVisible[key] = if (key.startsWith("iz"))
asideMap[key] && (showKeys.includes(key) || asideMap[key].isDefaultFilter); asideVisible[key] =
asideMap[key] && (showKeys.includes(key) || asideMap[key].isDefaultFilter);
});
const items = showKeys.reduce((acc, key) => {
if (asideMap[key]) {
const config = {
key,
config: asideMap[key],
};
return [...acc, config];
} else {
return acc;
}
}, []);
console.log("showItems111111111---------------", items);
showItems.value = items;
}); });
})
const items = showKeys.reduce((acc, key) => {
if (asideMap[key]) {
const config = {
key,
config: asideMap[key],
};
return [...acc, config];
} else {
return acc;
}
}, []);
showItems.value = items;
});
watch(asideVisible, (newVal) => { watch(asideVisible, (newVal) => {
Object.keys(asideValue).forEach((key) => { Object.keys(asideValue).forEach((key) => {
@ -159,8 +173,22 @@ function scrollHandler(key: string) {
element?.scrollIntoView(true); element?.scrollIntoView(true);
} }
function filterHandler(searchId: string) { async function filterHandler(searchId: string) {
emitter.emit("filter-final", searchId); emitter.emit("filter-final", searchId);
const res = await getFilterList({ userSearchId: searchId });
// console.log("", res);
if (res.code == "OK") {
let obj = res.data;
customObjRef.value = res.data;
let showKeys: any[] = [];
Object.keys(obj).map((key) => {
if (asideMap.hasOwnProperty(key)) {
showKeys.push(key);
}
});
console.log("showKeys1111111111111111", showKeys);
finalStore.setCustomConfig(showKeys);
}
} }
function editFilter(filter: any) { function editFilter(filter: any) {

@ -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,37 +81,39 @@ 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
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key) if (!isDefaultFilter) {
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
offList.push({ offList.push({
id: key, id: key,
name: name || '未配置', name: name || '未配置',
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)
// onListcustomConfig
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
console.log('tempList.value-----------', tempList.value)
console.log('finalStore.getFilterConfig-----------', finalStore.getFilterConfig)
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
return return
const { showList, hideList } = generatList(customConfig) const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList)
console.log('克隆条件', tempList.value)
if (tempList.value.length > 0)
finalStore.setFilterConfig(tempList.value)
// 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) => {
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)
})
console.log('finalStore.sortList---------------', sortList)
// setTimeout(() => {
if (sortList.length > 0)
finalStore.setFilterConfig(sortList)
const param = onList.value // }, 500);
.filter(item => !asideMap[item.id].isDefaultFilter)
.map((item) => {
return item.id
})
.join(',')
await setFilter({ searchcount: param, type: 1 })
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,11 +255,13 @@ 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)) {
onList.value.push({ if (item.checked) {
id: item.id, onList.value.push({
name: item.name || '未配置', id: item.id,
fix: item.fix || false, name: item.name || '未配置',
}) fix: item.fix || false,
})
}
} }
} }
} }
@ -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>

@ -274,7 +274,7 @@ async function formatColumns() {
NButton, NButton,
{ {
'strong': true, 'strong': true,
'tertiary': true, // 'tertiary': true,
'text': true, 'text': true,
'size': 'small', 'size': 'small',
'text-color': '#507AFD', 'text-color': '#507AFD',

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import * as XLSX from 'xlsx'; import * as XLSX from "xlsx";
defineProps({ defineProps({
data: { data: {
@ -12,13 +12,13 @@ defineProps({
default: () => [[]], default: () => [[]],
}, },
}); });
const emit = defineEmits(["showModal","getrowValue"]); const emit = defineEmits(["showModal", "getrowValue"]);
function showActionsModal() { function showActionsModal() {
emit("showModal"); emit("showModal");
} }
function getrowvalue(row){ function getrowvalue(row) {
emit("getrowValue",row); emit("getrowValue", row);
} }
</script> </script>
@ -37,13 +37,27 @@ function getrowvalue(row){
<th v-if="item && item[0]"> <th v-if="item && item[0]">
{{ item[0].label }} {{ item[0].label }}
</th> </th>
<td v-if="item && item[0]" :class="item[0].blue ? 'blue' : ''" @click="getrowvalue(item[0])"> <td
v-if="item && item[0]"
:class="item[0].blue ? 'blue' : ''"
@click="getrowvalue(item[0])"
>
<span v-show="item[0].label == '定位信息'">
<SvgIcon class="icon" size="16" name="lctname"
/></span>
{{ item[0].value }} {{ item[0].value }}
</td> </td>
<th v-if="item && item.length > 1"> <th v-if="item && item.length > 1">
{{ item[1].label }} {{ item[1].label }}
</th> </th>
<td v-if="item && item.length > 1" :class="item[1].blue ? 'blue' : ''" @click="getrowvalue(item[1])"> <td
v-if="item && item.length > 1"
:class="item[1].blue ? 'blue' : ''"
@click="getrowvalue(item[1])"
>
<span v-show="item[1].label == '定位信息'">
<SvgIcon class="icon" size="16" name="lctname" />
</span>
{{ item[1].value }} {{ item[1].value }}
</td> </td>
</tr> </tr>

@ -32,6 +32,9 @@ function setAsideItemName(text) {
:deep(.wrapper){ :deep(.wrapper){
top:0 top:0
} }
:deep(.ip_box){
z-index: 105;
}
.main { .main {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

@ -163,11 +163,12 @@ function onCheckAllChange(value) {
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id); const index = selectIds.value.indexOf(item.id);
if (index == -1 && selectIds.value.length >= 6) { // TODO
item.checked = false; // if (index == -1 && selectIds.value.length >= 6) {
message.error("自定义任务卡片字段一共勾选数量不能超过6个"); // item.checked = false;
return; // message.error("6");
} // return;
// }
item.checked = checked; item.checked = checked;
const currentIndex = offList.value.findIndex((v) => v.id == item.id); const currentIndex = offList.value.findIndex((v) => v.id == item.id);
offList.value[currentIndex].checked = checked; offList.value[currentIndex].checked = checked;
@ -355,6 +356,10 @@ function queryData(value, type) {
} }
} }
} }
const moreThanSix = computed(() => {
return selectIds.value.length >= 6;
});
</script> </script>
<template> <template>
@ -411,7 +416,7 @@ function queryData(value, type) {
<n-checkbox <n-checkbox
v-model:checked="item.checked" v-model:checked="item.checked"
:label="item.name" :label="item.name"
:disabled="item.fix" :disabled="item.fix || (!item.checked && moreThanSix)"
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>

@ -905,7 +905,7 @@ defineExpose({
.left { .left {
flex: 0.6; flex: 0.6;
background-size: 632px 346px; background-size: auto 346px;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;

Loading…
Cancel
Save