chore: merge

refactor/project
LiZhong 1 year ago
commit 0ead08acb1

8
components.d.ts vendored

@ -12,21 +12,13 @@ declare module 'vue' {
DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar'] NAvatar: typeof import('naive-ui')['NAvatar']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']
NCollapse: typeof import('naive-ui')['NCollapse']
NCollapseItem: typeof import('naive-ui')['NCollapseItem']
NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider'] NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown'] 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']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NGridItem: typeof import('naive-ui')['NGridItem']
NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']

@ -122,6 +122,11 @@ const layout = debounce(() => {
// } // }
// el.value!.scrollTo({ top: height, behavior: 'instant' }) // el.value!.scrollTo({ top: height, behavior: 'instant' })
loading = false loading = false
<<<<<<< HEAD
=======
console.log('loading---------------', loading)
console.log('pagination.pageNo---------------', pagination.pageNo)
>>>>>>> test
if (pagination.pageNo == 3) { if (pagination.pageNo == 3) {
let timer let timer
if (timer) if (timer)
@ -129,6 +134,10 @@ const layout = debounce(() => {
timer = setTimeout(() => { timer = setTimeout(() => {
isTop.value = false isTop.value = false
<<<<<<< HEAD
=======
console.log('isTop.value---------------', isTop.value)
>>>>>>> test
}, 1000) }, 1000)
} }
}) })
@ -149,6 +158,10 @@ useInfiniteScroll(
el as any, el as any,
() => { () => {
loading = false loading = false
<<<<<<< HEAD
=======
console.log('加载了000000000000000---------------------------')
>>>>>>> test
loadMore() loadMore()
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
@ -157,9 +170,21 @@ useInfiniteScroll(
async function featchList() { async function featchList() {
loading = true loading = true
try { try {
<<<<<<< HEAD
const result = await dubiousfilelist({ ...pagination, ...sortObj }) const result = await dubiousfilelist({ ...pagination, ...sortObj })
const { data } = result const { data } = result
canloadMore = data.pages >= pagination.pageNo && data.pages > 0 canloadMore = data.pages >= pagination.pageNo && data.pages > 0
=======
// const result = await dubiousfilelist({ ...pagination, orderbyname: timeRange.value })
console.log('pagination.pageNo------------', pagination.pageNo)
const result = await dubiousfilelist({ ...pagination, ...sortObj })
// TODO
// result.data = Array.from({ length: 30 })
const { data, pageCount } = result
// canloadMore = pageCount >= pagination.pageNo && pageCount > 0;
canloadMore = data.pages >= pagination.pageNo && data.pages > 0
console.log('canloadMore------------', canloadMore)
>>>>>>> test
return result.data.records return result.data.records
} }
@ -170,12 +195,20 @@ async function featchList() {
} }
async function loadMore() { async function loadMore() {
<<<<<<< HEAD
=======
console.log('执行l------------------------', loading, el.value, pagination.pageNo)
>>>>>>> test
if (loading || el.value == null) if (loading || el.value == null)
return return
// loading = true // loading = true
pagination.pageNo = pagination.pageNo + 1 pagination.pageNo = pagination.pageNo + 1
const more = await featchList() const more = await featchList()
<<<<<<< HEAD
=======
console.log('more------------------------', more)
>>>>>>> test
listData.value.push(...more) listData.value.push(...more)
layout() layout()
} }
@ -306,7 +339,11 @@ function upHandler(event: MouseEvent) {
selectIds.value = [] selectIds.value = []
selectedApproveItems.value.forEach(item => (item.checked = false)) selectedApproveItems.value.forEach(item => (item.checked = false))
selectedApproveItems.value.length = 0 selectedApproveItems.value.length = 0
<<<<<<< HEAD
listData.value.map((item) => { listData.value.map((item) => {
=======
listData.value.forEach((item) => {
>>>>>>> test
item.checked = false item.checked = false
}) })
// batch.value = false; // batch.value = false;
@ -414,6 +451,7 @@ async function commit() {
const list = await featchList() const list = await featchList()
listData.value = list listData.value = list
layout() layout()
setBatch(false)
} }
} }
function remove() { function remove() {
@ -496,6 +534,10 @@ function approvalHandler(items?: any) {
// => => / // => => /
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent))
processItems = [items] processItems = [items]
<<<<<<< HEAD
=======
console.log('batch-------------', batch.value, selectedApproveItems.value, processItems)
>>>>>>> test
const msg = validate(processItems) const msg = validate(processItems)
if (msg !== null) { if (msg !== null) {
@ -568,6 +610,10 @@ async function refreshHandler(filtersearchId?: any) {
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
<<<<<<< HEAD
=======
console.log('加载了333333333333333333333333---------------------------')
>>>>>>> test
loadMore() loadMore()
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
@ -581,11 +627,19 @@ watch(() => show.value, async (newVal) => {
pagination.pageNo = 1 pagination.pageNo = 1
const list = await featchList() const list = await featchList()
listData.value = list listData.value = list
<<<<<<< HEAD
=======
console.log('加载了1111111111111---------------------------', listData.value)
>>>>>>> test
layout() layout()
} }
}) })
watch(() => pagination.pageNo, (newVal, oldVal) => { watch(() => pagination.pageNo, (newVal, oldVal) => {
<<<<<<< HEAD
=======
console.log('加载了22222222222222222---------------------------', newVal, oldVal, canloadMore)
>>>>>>> test
if (newVal == oldVal) if (newVal == oldVal)
return return
@ -685,7 +739,11 @@ watch(() => pagination.pageNo, (newVal, oldVal) => {
<!-- <n-scrollbar :on-scroll="scrollHandler"> --> <!-- <n-scrollbar :on-scroll="scrollHandler"> -->
<div ref="masonryRef" class="grid"> <div ref="masonryRef" class="grid">
<div <div
<<<<<<< HEAD
v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId" v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId"
=======
v-for="(item) in listData" :key="item.pictureId" :data-id="item.pictureId"
>>>>>>> test
:class="{ 'grid-item-selected': isSelected(item.pictureId) }" :style="{ height: gridHeight }" :class="{ 'grid-item-selected': isSelected(item.pictureId) }" :style="{ height: gridHeight }"
class="grid-item" class="grid-item"
> >

@ -115,6 +115,39 @@ onBeforeMount(async () => {
nextTick(() => { nextTick(() => {
finalStore.$subscribe(() => { finalStore.$subscribe(() => {
<<<<<<< HEAD
=======
// const customConfig = finalStore.getCustomConfig;
// console.log("customConfigaside---------------", customConfig);
// if (customConfig === null) return;
// const showKeys: string[] = [...customConfig];
// // const defaultKeys = Object.keys(asideMap).filter(
// // (key) => asideMap[key].isDefaultFilter
// // );
// // showKeys.unshift(...defaultKeys);
// Object.keys(asideMap).forEach((key) => {
// //
// if (key.startsWith("iz"))
// 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;
>>>>>>> test
const config = finalStore.getSystemConfig const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig const customConfig = finalStore.getCustomConfig
if ( if (
@ -122,6 +155,7 @@ nextTick(() => {
&& isEqual(configFilterRef.value, finalStore.getFilterConfig) && isEqual(configFilterRef.value, finalStore.getFilterConfig)
&& customObjRef.value && customObjRef.value
&& isEqual(customObjRef.value, customTempObjRef.value) && isEqual(customObjRef.value, customTempObjRef.value)
<<<<<<< HEAD
) { ) {
return return
} }
@ -129,6 +163,19 @@ nextTick(() => {
if (config == null || customConfig == null) { if (config == null || customConfig == null) {
return return
} }
=======
)
return
if (config == null || customConfig == null)
return
// console.log("config", config, "customConfig", customConfig);
/* rao
const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter
const defaultKeys = Object.keys(asideMap).filter(key => asideMap[key].isDefaultFilter)// asideMap isDefaultFilter
showKeys.unshift(...defaultKeys)
*/
>>>>>>> test
const sortKeyList: any = [] const sortKeyList: any = []
finalStore.getFilterConfig.forEach((item: any) => { finalStore.getFilterConfig.forEach((item: any) => {
@ -145,13 +192,24 @@ nextTick(() => {
if (customObjRef.value) { if (customObjRef.value) {
// //
Object.keys(customObjRef.value).forEach((key) => { Object.keys(customObjRef.value).forEach((key) => {
<<<<<<< HEAD
if (Object.prototype.hasOwnProperty.call(asideMap, key)) {
const str = key.toLowerCase()
=======
// if (asideMap.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(asideMap, key)) { if (Object.prototype.hasOwnProperty.call(asideMap, key)) {
const str = key.toLowerCase() const str = key.toLowerCase()
// console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]);
>>>>>>> test
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] //
<<<<<<< HEAD
=======
console.log('相似度2222222222', asideValue[key])
>>>>>>> test
} }
else if (str == 'izyear') { else if (str == 'izyear') {
if (typeof customObjRef.value[str] == 'string') { if (typeof customObjRef.value[str] == 'string') {
@ -159,10 +217,27 @@ nextTick(() => {
time[0] = new Date(time[0]).getTime() time[0] = new Date(time[0]).getTime()
time[1] = new Date(time[1]).getTime() time[1] = new Date(time[1]).getTime()
customObjRef.value[str] = time customObjRef.value[str] = time
<<<<<<< HEAD
}
asideValue[key] = customObjRef.value[str] //
}
else if (customObjRef.value[str]) {
if (typeof customObjRef.value[str] == 'string') {
customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] //
}
else {
asideValue[key] = customObjRef.value[str] //
}
=======
} }
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
console.log('时间2222222222', asideValue[key])
} }
else if (customObjRef.value[str]) { else if (customObjRef.value[str]) {
console.log('customObjRef.value[str]222222', customObjRef.value[str])
// let list = customObjRef.value[str].split(',');
// console.log("list222222", list);
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] //
@ -170,6 +245,7 @@ nextTick(() => {
else { else {
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
} }
>>>>>>> test
} }
else { else {
asideValue[key] = null asideValue[key] = null
@ -178,7 +254,14 @@ nextTick(() => {
} }
}) })
customTempObjRef.value = customObjRef.value customTempObjRef.value = customObjRef.value
<<<<<<< HEAD
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
=======
console.log('asideValue直接处理后的结果', asideValue)
console.log('customTempObjRef.value', customTempObjRef.value)
const tempobj = cloneDeep(asideValue)
console.log('tempObj', tempobj)
>>>>>>> test
finalStore.setAsideValue(tempobj) finalStore.setAsideValue(tempobj)
} }
const items = showKeys.reduce((acc, key) => { const items = showKeys.reduce((acc, key) => {
@ -192,11 +275,20 @@ nextTick(() => {
config: asideMap[str], config: asideMap[str],
} }
return [...acc, o] return [...acc, o]
<<<<<<< HEAD
}
else {
return acc
}
}, [])
=======
} }
else { else {
return acc return acc
} }
}, []) }, [])
console.log('showItems=================================', items)
>>>>>>> test
showItems.value = items showItems.value = items
configFilterRef.value = finalStore.getFilterConfig configFilterRef.value = finalStore.getFilterConfig
}) })
@ -230,16 +322,30 @@ function scrollHandler(key: string) {
} }
async function filterHandler(searchId: string) { async function filterHandler(searchId: string) {
<<<<<<< HEAD
emitter.emit('filter-final', searchId) emitter.emit('filter-final', searchId)
const res = await getFilterList({ userSearchId: searchId }) const res = await getFilterList({ userSearchId: searchId })
=======
// emitter.emit("filter-final", searchId);
const res = await getFilterList({ userSearchId: searchId })
// console.log("", res);
>>>>>>> test
if (res.code == 'OK') { if (res.code == 'OK') {
const obj = res.data const obj = res.data
customObjRef.value = res.data customObjRef.value = res.data
const showKeys: any[] = [] const showKeys: any[] = []
Object.keys(obj).forEach((key) => { Object.keys(obj).forEach((key) => {
<<<<<<< HEAD
if (Object.prototype.hasOwnProperty.call(asideMap, key)) if (Object.prototype.hasOwnProperty.call(asideMap, key))
showKeys.push(key) showKeys.push(key)
}) })
=======
// if (asideMap.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(asideMap, key))
showKeys.push(key)
})
console.log('showKeys1111111111111111', showKeys)
>>>>>>> test
finalStore.setCustomConfig(showKeys) finalStore.setCustomConfig(showKeys)
} }
} }
@ -258,6 +364,10 @@ function inputChange(keyword) {
emit('inputChange', keyword) emit('inputChange', keyword)
} }
function handleOk(item: any) { function handleOk(item: any) {
<<<<<<< HEAD
=======
console.log('handleOk', item)
>>>>>>> test
if (item) { if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname) AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id) filterHandler(item.id)
@ -269,11 +379,24 @@ function handleOk(item: any) {
} }
function updateComponent(key, e) { function updateComponent(key, e) {
<<<<<<< HEAD
// let tempAsideValue = finalStore.getAsideValue || asideValue;
const tempobj = cloneDeep(asideValue)
tempobj[key] = e
customObjRef.value = tempobj
// asideValue = Object.assign({}, asideValue, tempobj);
=======
console.log('跟新值', key, e)
console.log('tempAsideValue跟新值', finalStore.getAsideValue, asideValue)
// let tempAsideValue = finalStore.getAsideValue || asideValue; // let tempAsideValue = finalStore.getAsideValue || asideValue;
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
console.log(tempobj, 'tempobj')
tempobj[key] = e tempobj[key] = e
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)
>>>>>>> test
finalStore.setAsideValue(tempobj) finalStore.setAsideValue(tempobj)
} }
</script> </script>
@ -289,13 +412,29 @@ function updateComponent(key, e) {
<div class="aside-header"> <div class="aside-header">
<!-- 搜索跳转模块 --> <!-- 搜索跳转模块 -->
<Search <Search
<<<<<<< HEAD
v-show="showSearch" @select="scrollHandler" @close="setShowSearch(false)" @input-change="inputChange" v-show="showSearch" @select="scrollHandler" @close="setShowSearch(false)" @input-change="inputChange"
=======
v-show="showSearch"
@select="scrollHandler"
@close="setShowSearch(false)"
@input-change="inputChange"
>>>>>>> test
@show-search="setShowSearch(true)" @show-search="setShowSearch(true)"
/> />
<!-- 高级筛选 --> <!-- 高级筛选 -->
<AdvanceFilter <AdvanceFilter
<<<<<<< HEAD
v-show="!showSearch" ref="AdvanceFilterRef" :type="1" @select="filterHandler" v-show="!showSearch" ref="AdvanceFilterRef" :type="1" @select="filterHandler"
@update:search="setShowSearch(true)" @show-custom="showModal(customModalRef)" @update:search="setShowSearch(true)" @show-custom="showModal(customModalRef)"
=======
v-show="!showSearch"
ref="AdvanceFilterRef"
:type="1"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
>>>>>>> test
@show-filter="showModal(filterModalRef)" @show-filter="showModal(filterModalRef)"
/> />
</div> </div>
@ -310,7 +449,13 @@ function updateComponent(key, e) {
<CustomFilterModalVue ref="customModalRef" /> <CustomFilterModalVue ref="customModalRef" />
<!-- 过滤列表 --> <!-- 过滤列表 -->
<FilterModal <FilterModal
<<<<<<< HEAD
ref="filterModalRef" @edit-filter="editFilter" @show-new-filter="showModal(newFilterModalRef)" ref="filterModalRef" @edit-filter="editFilter" @show-new-filter="showModal(newFilterModalRef)"
=======
ref="filterModalRef"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
>>>>>>> test
@handle-ok="handleOk" @handle-ok="handleOk"
/> />
<!-- 新增过滤 --> <!-- 新增过滤 -->

Loading…
Cancel
Save