矿产 审核上一条下一条
parent
1d073ce14d
commit
ddb661e16e
|
|
@ -75,7 +75,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits, ref } from "vue"
|
||||
import { defineProps, defineEmits, ref, watch } from "vue"
|
||||
import {showDrawBack, drawBackSpan} from '@/views/demo/util'
|
||||
import { dataProcessing } from '@/views/demo/tiankongdi/util'
|
||||
import { message } from 'ant-design-vue'
|
||||
|
|
@ -83,24 +83,43 @@ import { useUserStore } from '@/store/modules/user'
|
|||
import { flowStore } from '@/store/modules/flow';
|
||||
import { getDetail } from '@/api/sys/WFSchemeInfo';
|
||||
import { Audit } from '@/views/demo/workflow/task/process/page';
|
||||
import dayjs from 'dayjs';
|
||||
import { usePageRequestUrl } from '@/components/illegalmining/util'
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
// TODO 更换接口
|
||||
import { addTaskFavorite,deleteTaskCase } from '@/api/tiankongdi/index';
|
||||
|
||||
const userStore = useUserStore()
|
||||
const flowWfDataStore = flowStore();
|
||||
|
||||
const props = defineProps(["dataList"])
|
||||
const emits = defineEmits(["changeTask","query"])
|
||||
const props = defineProps(["usePage","dataList","screenData","sortData","pageData","total"])
|
||||
const emits = defineEmits(["changeTask","query","flipChange"])
|
||||
|
||||
const mapNo = ref('')
|
||||
const searchList = ref([])
|
||||
const showDataId = ref()
|
||||
const auditOpen = ref(false);
|
||||
const processId = ref('');
|
||||
const taskId = ref('');
|
||||
const type = ref('');
|
||||
const isRead: any = ref(0);
|
||||
const handoffShow = ref(true)
|
||||
const showDataId = ref()
|
||||
const nextShowDataId = ref()
|
||||
const prevShowDataId = ref()
|
||||
|
||||
watch(() => showDataId.value, () => {
|
||||
let index = props.dataList.findIndex(item => item.id == showDataId.value)
|
||||
if(index < props.dataList.length - 1){
|
||||
nextShowDataId.value = props.dataList[index + 1].id
|
||||
}else{
|
||||
nextShowDataId.value = 0
|
||||
}
|
||||
if(index > 0){
|
||||
prevShowDataId.value = props.dataList[index - 1].id
|
||||
}else{
|
||||
prevShowDataId.value = 0
|
||||
}
|
||||
})
|
||||
|
||||
const locationFun = (record) => {
|
||||
console.log(record);
|
||||
|
|
@ -140,9 +159,102 @@ const cancelCollectItem = (item) => {
|
|||
emits('query')
|
||||
})
|
||||
}
|
||||
const prevData = () => {
|
||||
const prevData = async () => {
|
||||
if(prevShowDataId.value === 0){
|
||||
if(props.pageData.page === 1 || props.total == 0){
|
||||
message.warning('已经是第一条数据了')
|
||||
return
|
||||
}
|
||||
defHttp.get({ url: usePageRequestUrl[props.usePage], params: getParams({page: props.pageData.page - 1})}).then(async res => {
|
||||
emits('flipChange',res.items,res.total,props.pageData.page - 1)
|
||||
handoffShow.value = false
|
||||
let record = res.items[res.items.length -1]
|
||||
let data = await getDetail({ code: record.processcode });
|
||||
let scheme = JSON.parse(data.scheme.content);
|
||||
let wfData = scheme.wfData;
|
||||
flowWfDataStore.setWfDataAll(wfData);
|
||||
processId.value = record.processid;
|
||||
taskId.value = record.taskid;
|
||||
type.value = record.type;
|
||||
handoffShow.value = true
|
||||
showDataId.value = res.items[res.items.length -1].id
|
||||
})
|
||||
return
|
||||
}else{
|
||||
showDataId.value = prevShowDataId.value
|
||||
}
|
||||
handoffShow.value = false
|
||||
let record = props.dataList.find(item => item.id == showDataId.value)
|
||||
let data = await getDetail({ code: record.processcode });
|
||||
let scheme = JSON.parse(data.scheme.content);
|
||||
let wfData = scheme.wfData;
|
||||
flowWfDataStore.setWfDataAll(wfData);
|
||||
processId.value = record.processid;
|
||||
taskId.value = record.taskid;
|
||||
type.value = record.type;
|
||||
handoffShow.value = true
|
||||
}
|
||||
const nextData = () => {
|
||||
const nextData = async () => {
|
||||
if(nextShowDataId.value === 0){
|
||||
if((Math.ceil(props.total / props.pageData.limit) <= props.pageData.page) || props.total == 0){
|
||||
message.warning('已经是最后一条数据了')
|
||||
return
|
||||
}
|
||||
defHttp.get({ url: usePageRequestUrl[props.usePage], params: getParams({page: props.pageData.page + 1}) }).then(async res => {
|
||||
emits('flipChange',res.items,res.total,props.pageData.page + 1)
|
||||
handoffShow.value = false
|
||||
let record = res.items[0]
|
||||
let data = await getDetail({ code: record.processcode });
|
||||
let scheme = JSON.parse(data.scheme.content);
|
||||
let wfData = scheme.wfData;
|
||||
flowWfDataStore.setWfDataAll(wfData);
|
||||
processId.value = record.processid;
|
||||
taskId.value = record.taskid;
|
||||
type.value = record.type;
|
||||
handoffShow.value = true
|
||||
showDataId.value = res.items[0].id
|
||||
})
|
||||
return
|
||||
}else{
|
||||
showDataId.value = nextShowDataId.value
|
||||
}
|
||||
handoffShow.value = false
|
||||
let record = props.dataList.find(item => item.id == showDataId.value)
|
||||
let data = await getDetail({ code: record.processcode });
|
||||
let scheme = JSON.parse(data.scheme.content);
|
||||
let wfData = scheme.wfData;
|
||||
flowWfDataStore.setWfDataAll(wfData);
|
||||
processId.value = record.processid;
|
||||
taskId.value = record.taskid;
|
||||
type.value = record.type;
|
||||
handoffShow.value = true
|
||||
}
|
||||
const getParams = (data) => {
|
||||
let params = {
|
||||
...props.pageData,
|
||||
...props.sortData,
|
||||
}
|
||||
Object.keys(props.screenData).forEach(key => {
|
||||
switch(key){
|
||||
case 'time':
|
||||
if(props.screenData.time){
|
||||
params['startTime'] = dayjs(props.screenData.time[0]).format('YYYY-MM-DD')
|
||||
params['endTime'] = dayjs(props.screenData.time[1]).format('YYYY-MM-DD')
|
||||
}
|
||||
break
|
||||
case 'nowStatus':
|
||||
if(props.screenData.nowStatus.length > 0){
|
||||
params['nowStatus'] = props.screenData.nowStatus.join(',')
|
||||
}
|
||||
break
|
||||
default:
|
||||
if(props.screenData[key] && props.screenData[key] !== ''){
|
||||
params[key] = props.screenData[key]
|
||||
}
|
||||
break
|
||||
}
|
||||
})
|
||||
return {...params, ...data}
|
||||
}
|
||||
const closeMolder = () => {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,4 +70,7 @@ export const orderUtils = {
|
|||
0: null,
|
||||
1: 'asc',
|
||||
2: 'desc',
|
||||
}
|
||||
export const usePageRequestUrl = {
|
||||
'patternfilling': '/api/DroneCaseInfoSingle/LoadTasklList',
|
||||
}
|
||||
|
|
@ -11,9 +11,15 @@
|
|||
@changeSort="changeSort"
|
||||
@collectChange="collectChange"/>
|
||||
<ShowListComponent
|
||||
:usePage="'patternfilling'"
|
||||
:dataList="dataList"
|
||||
:screenData="screenData"
|
||||
:sortData="sortData"
|
||||
:pageData="pageData"
|
||||
:total="total"
|
||||
@changeTask="changeTask"
|
||||
@query="query"/>
|
||||
@query="query"
|
||||
@flipChange="flipChange"/>
|
||||
<PaginationComponent
|
||||
:pageData="pageData"
|
||||
:total="total"
|
||||
|
|
@ -109,6 +115,7 @@ const changeSort = (sortType, order) => {
|
|||
}
|
||||
const collectChange = (type) => {
|
||||
screenData.value.type = type
|
||||
pageData.value.page = 1
|
||||
query()
|
||||
}
|
||||
const resetScreenData = () => {
|
||||
|
|
@ -133,7 +140,11 @@ const changePageData = (page, limit) => {
|
|||
const changeTask = (id) => {
|
||||
emits('changeTask',id)
|
||||
}
|
||||
|
||||
const flipChange = (list, totalNumber, page) => {
|
||||
dataList.value = list
|
||||
total.value = totalNumber
|
||||
pageData.value.page = page
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue