fix: 首页刷新失败

bak
elseif 1 year ago
parent 7535771c45
commit f7e46e1e0e

3
components.d.ts vendored

@ -20,6 +20,7 @@ declare module 'vue' {
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']
NEmpty: typeof import('naive-ui')['NEmpty']
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'] NGi: typeof import('naive-ui')['NGi']
@ -38,6 +39,8 @@ declare module 'vue' {
NSpace: typeof import('naive-ui')['NSpace'] NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin'] NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch'] NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag'] NTag: typeof import('naive-ui')['NTag']
NTooltip: typeof import('naive-ui')['NTooltip'] NTooltip: typeof import('naive-ui')['NTooltip']
NUpload: typeof import('naive-ui')['NUpload'] NUpload: typeof import('naive-ui')['NUpload']

@ -312,8 +312,7 @@ export async function getBackList() {
method: 'get', method: 'get',
}) })
const list = res.data return res.data[0].distionaryList
return list
} }
/** /**

@ -216,7 +216,7 @@ export const useDictionaryStore = defineStore({
// 退回方式 // 退回方式
async fetchBackList() { async fetchBackList() {
const list = await getBackList() const list = await getBackList()
this.backList = generateOptions(list) this.backList = generateOptions(list, 'codeno', 'name')
return this.backList return this.backList
}, },
// 退回方式 // 退回方式

@ -20,7 +20,7 @@ const actionConfig = {
3: [{ label: '查看', key: 'view' }], 3: [{ label: '查看', key: 'view' }],
4: [{ label: '查看', key: 'view' }], 4: [{ label: '查看', key: 'view' }],
2: [{ label: '通过', key: 'approval' }, { label: '不通过', key: 'reject' }], 2: [{ label: '通过', key: 'approval' }, { label: '不通过', key: 'reject' }],
5: [{ label: '通过', key: 'approval' }, { label: '不通过', key: 'reject' }], 5: [{ label: '查看', key: 'view' }],
} }
const actions = computed(() => { const actions = computed(() => {

@ -242,7 +242,7 @@ async function refreshHandler(filtersearchId?: any) {
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
) )
}, 500) }, 300)
}) })
} }

@ -29,7 +29,7 @@ const CustomSettingModalRef = ref(null)
const taskTableData = ref<any[]>([]) const taskTableData = ref<any[]>([])
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: 'desc', orderbyname: 'asc',
orderbyvalue: 'pictureResult', orderbyvalue: 'pictureResult',
} }
@ -268,6 +268,10 @@ watch(
taskDetailPictureList.value = data taskDetailPictureList.value = data
totalCount.value = total totalCount.value = total
} }
else {
taskDetailPictureList.value.length = 0
totalCount.value = 0
}
}, },
) )
@ -314,8 +318,9 @@ function previewHandler(event: MouseEvent) {
function getPercent(pictureid: string) { function getPercent(pictureid: string) {
const { ocpictureid, pictureresult } = taskDetailInfo.value const { ocpictureid, pictureresult } = taskDetailInfo.value
const index = ocpictureid.split(',').indexOf(String(pictureid)) const splitId = ocpictureid || ''
const results = pictureresult.split(',') const index = splitId.split(',').indexOf(String(pictureid))
const results = (pictureresult || '').split(',')
const percent = results[index] || '0' const percent = results[index] || '0'
const val = Number.parseFloat(percent) const val = Number.parseFloat(percent)
return `${val}%` return `${val}%`
@ -412,8 +417,8 @@ function getPercent(pictureid: string) {
/> />
</div> </div>
<div class="status"> <div class="status">
<SvgIcon v-show="taskDetailInfo?.states === 4" width="134" height="129" name="p1" /> <SvgIcon v-show="taskDetailInfo?.userapprove?.statshis === 3" width="134" height="129" name="p1" />
<SvgIcon v-show="taskDetailInfo?.states === 3" width="134" height="129" name="p2" /> <SvgIcon v-show="taskDetailInfo?.userapprove?.statshis === 2" width="134" height="129" name="p2" />
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon <SvgIcon

@ -54,7 +54,7 @@ const loading = ref(false)
let _masonry: null | Masonry = null let _masonry: null | Masonry = null
const show = ref(false) const show = ref(false)
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: 'desc', orderbyname: 'asc',
orderbyvalue: 'fromuptime', orderbyvalue: 'fromuptime',
} }
const batch = ref(false) const batch = ref(false)

@ -51,7 +51,7 @@ const taskpagination = reactive({
pageSize: 10, pageSize: 10,
}) })
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: 'desc', orderbyname: 'asc',
orderbyvalue: 'pictureResult', orderbyvalue: 'pictureResult',
} }
const workStore = useWorkOrder() const workStore = useWorkOrder()
@ -264,8 +264,11 @@ onUpdated(() => {
watch(() => workStore.activeId, async (newValue, oldValue) => { watch(() => workStore.activeId, async (newValue, oldValue) => {
const packageid = workStore.getActiveId const packageid = workStore.getActiveId
if (isEmpty(packageid)) if (isEmpty(packageid)) {
listData.value.length = 0
totalCount.value = 0
return return
}
const res = await getPackageTaskList(newValue, packagepagination) const res = await getPackageTaskList(newValue, packagepagination)
const { data } = res const { data } = res
@ -286,8 +289,11 @@ async function handleSelect(item: any) {
const packageid = workStore.getActiveId const packageid = workStore.getActiveId
if (isEmpty(packageid)) if (isEmpty(packageid)) {
listData.value.length = 0
totalCount.value = 0
return return
}
refreshHandler() refreshHandler()
} }

Loading…
Cancel
Save