Merge pull request 'fix: 删除无效代码' (#187) from fix/20240412bug into test

Reviewed-on: #187
pull/188/head
刘释隆 1 year ago
commit 21ff0cfca4

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

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

Loading…
Cancel
Save