fix: 删除无效代码

pull/187/head
zhouxiaoan 1 year ago
parent 8edc6d14ea
commit 5f65940c1b

@ -2,9 +2,7 @@
import { cloneDeep, difference } from 'lodash-es'
import { computed, defineEmits, defineProps, onMounted, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { useMessage } from 'naive-ui'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import { workPackageMap } from '@/config/workorder'
import { useUser } from '@/store/modules/user'
const props = defineProps({
@ -17,8 +15,6 @@ const props = defineProps({
const emit = defineEmits(['onOk'])
const message = useMessage()
//
const offList = ref<any[]>([])
//
@ -38,66 +34,6 @@ 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 = computed(() => {
let baseNum = 0
@ -137,8 +73,6 @@ defineExpose({
showModal,
})
// generatList();
const selectIds = ref<string[]>([])
function onCheckAllChange(value) {
@ -181,8 +115,7 @@ function onCheckChange(checked: any, item: any) {
offList.value[currentIndex].checked = checked
if (index === -1 && checked)
selectIds.value.push(item.id)
else
selectIds.value.splice(index, 1)
else selectIds.value.splice(index, 1)
}
const showIds = computed(() => {

@ -16,7 +16,7 @@ import { useInfiniteScroll } from '@vueuse/core'
import { format } from 'date-fns'
import imagesloaded from 'imagesloaded'
import { clone, cloneDeep, debounce, pickBy } from 'lodash-es'
import { useDialog, useMessage, useModal } from 'naive-ui'
import { useDialog, useMessage } from 'naive-ui'
import {
computed,
onMounted,
@ -37,7 +37,6 @@ const message = useMessage()
const dialog = useDialog()
const totalCount = ref(0)
let _imagesload: any
const modal = useModal()
function setBatch(value: boolean) {
if (value && batch.value)
@ -161,7 +160,6 @@ async function featchList() {
totalCount.value = total
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0
console.log(data, 'dataaaaaaaaaa')
return data
}
catch (error) {
@ -319,14 +317,13 @@ function onEsc(event) {
}
// x
if (code === 'KeyX') {
console.log('keyx')
const currentKTime = Date.now()
console.log(currentKTime - keyXLastTime)
if (currentKTime - keyXLastTime < 500)
handleRejectMainImage()
else keyXLastTime = currentKTime
else
keyXLastTime = currentKTime
}
// console.log('keyp')
}
function resizeImage() {

Loading…
Cancel
Save