diff --git a/src/assets/icons/magnifying-1-color999.svg b/src/assets/icons/magnifying-1-color999.svg new file mode 100644 index 0000000..1a04d84 --- /dev/null +++ b/src/assets/icons/magnifying-1-color999.svg @@ -0,0 +1,23 @@ + + + 搜索 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/config/aside.ts b/src/config/aside.ts index 3d3aec4..6e339ea 100644 --- a/src/config/aside.ts +++ b/src/config/aside.ts @@ -45,7 +45,7 @@ export const asideMap: Recordable = { izsimilarity: { label: '相似度阈值', defaultValue: [0, 100], - isDefaultFilter: false, + isDefaultFilter: true, key: 'izsimilarity', component: SimilarityVue, }, diff --git a/src/config/home.ts b/src/config/home.ts index 93de47e..a6635ef 100644 --- a/src/config/home.ts +++ b/src/config/home.ts @@ -1,4 +1,8 @@ export const timeOptions = [ + { + label: '全部', + value: '', + }, { label: '近3个月', value: '3', diff --git a/src/views/home/aside/comp/AdvanceFilter.vue b/src/views/home/aside/comp/AdvanceFilter.vue index f6b0b62..55c1af3 100644 --- a/src/views/home/aside/comp/AdvanceFilter.vue +++ b/src/views/home/aside/comp/AdvanceFilter.vue @@ -272,10 +272,10 @@ const moveEnd = () => { />
+ ([]) function showModal() { show.value = true + + // 重置左右列表数据 + const config = configStore.getConfig + const customConfig = configStore.getCustomConfig + + if (config == null || customConfig == null) + return + const { showList, hideList } = generatList(config, customConfig) + onList.value = showList + offList.value = hideList + // 重置全选状态 + checkAll.value = hideList.every(item => item.checked); + // 重置输入框查询条件 + offKeyword.value = '' + onKeyword.value = '' } function closeModal() { @@ -29,7 +44,7 @@ const offList = ref([]) const onList = ref([]) const allCount = computed(() => { - return `全部筛选(共${offList.value.length - 1}个)` + return `全部筛选(共${offList.value.length}个)` }) const selectCount = computed(() => { @@ -83,8 +98,9 @@ function generatList(config, customConfig) { fix: isDefaultFilter, checked: isChecked, }) - - isChecked && selectIds.value.push(key) + if (isChecked && selectIds.value.indexOf(key) === -1) { + isChecked && selectIds.value.push(key) + } } } @@ -125,8 +141,7 @@ configStore.$subscribe(() => { async function handleSumbit(e: MouseEvent) { e.preventDefault() - - const param = onList.value.filter(item => !asideMap[item.id].isDefaultFilter).map((item) => { + const param = onList.value.map((item) => { return item.id }).join(',') @@ -156,7 +171,9 @@ function onCheckChange(checked: any, item: any) { if (index === -1 && checked) selectIds.value.push(item.id) else - selectIds.value.splice(index, 1) + index !== -1 && selectIds.value.splice(index, 1) + + checkAll.value = offList.value.every(item => item.checked); } const showIds = computed(() => { @@ -180,11 +197,13 @@ watch( 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, - }) + if (item.checked) { + onList.value.push({ + id: item.id, + name: item.name || '未配置', + fix: item.fix || false, + }) + } } } } @@ -248,15 +267,21 @@ const rightInputHandler = debounce((keyword) => { onKeyword.value = keyword }, 300) -async function getfield(){ +async function getfield() { let res; res = await getAllfieldList(3) const userStore = useUser(); const userInfo = userStore.getUserInfo; - res = await getfieldList(3,userInfo.id) + res = await getfieldList(3, userInfo.id) +} +function onMove(e) { + // 这里的e表示即将停靠的元素。 + if (e?.related?.className?.indexOf('fix') !== -1) { + return false; + } } -onMounted(()=>{ +onMounted(() => { getfield(); }) @@ -280,9 +305,9 @@ onMounted(()=>{ :bordered="false" >
- + @@ -316,23 +341,18 @@ onMounted(()=>{ 清空
- + - -
- + +
+ {{ item.name }} - +
@@ -366,9 +386,10 @@ onMounted(()=>{ } &-bar { - background-color: #e8e8e8; - width: 100%; + background-color: #f8f8f8; + width: calc(100% + 12px); margin-top: 20px; + color: #333333; } &-footer { @@ -422,6 +443,10 @@ onMounted(()=>{ align-items: center; } + .fix { + cursor: default !important; + } + .disable-check { color: gainsboro; } diff --git a/src/views/home/aside/comp/modals/FilterModal.vue b/src/views/home/aside/comp/modals/FilterModal.vue index 31e194f..6f47171 100644 --- a/src/views/home/aside/comp/modals/FilterModal.vue +++ b/src/views/home/aside/comp/modals/FilterModal.vue @@ -20,7 +20,7 @@ const show = ref(false); const cardStyle = { width: "800px", - height: "800px", + height: "830px", "--n-padding-bottom": "10px", "--n-padding-left": "10px", }; @@ -63,6 +63,7 @@ const columns: DataTableColumns = [ { title: "创建时间", key: "createtime", + width: 180 }, { title: "更新者", @@ -71,6 +72,7 @@ const columns: DataTableColumns = [ { title: "更新时间", key: "updatetime", + width: 180 }, ]; @@ -317,6 +319,7 @@ const inputHandler = debounce((word) => {
{ layout() }) -const timeRange = ref('99') +const timeRange = ref('') const timeLabel = computed(() => { const item = timeOptions.find((option) => { return option.value === timeRange.value @@ -333,14 +333,15 @@ function previewHandler(index: number,event: MouseEvent) { -
+
{{ totalCount }}