Merge pull request 'fix:终审记忆' (#313) from fix/change_task into test

Reviewed-on: #313
pull/314/head
yaoshuli 1 year ago
commit 1f57625959

@ -1,11 +1,10 @@
import { defineStore } from 'pinia' import { getFilter } from '@/api/home/filter';
import { store } from '@/store'
import { getFilter } from '@/api/home/filter'
import { getConfig } from '@/api/system/user'
import { asideMap } from "@/config/final"; import { asideMap } from "@/config/final";
import { cloneDeep, isEqual } from "lodash-es"; import { store } from '@/store';
import { cloneDeep } from "lodash-es";
import { defineStore } from 'pinia';
import type { AsideConfig } from '/#/api' import type { AsideConfig } from '/#/api';
export interface ConfigState { export interface ConfigState {
systemConfig: AsideConfig | null systemConfig: AsideConfig | null
@ -59,6 +58,7 @@ export const useFinalStore = defineStore({
console.log("systemConfig----------", config); console.log("systemConfig----------", config);
}, },
setAsideValue(value) { setAsideValue(value) {
console.log(value)
this.asideValue = value this.asideValue = value
}, },
setListKey() { setListKey() {

@ -42,8 +42,11 @@ const configFilterRef = ref<any>([]) // 获取排序的值
initAsideValueRef.value = cloneDeep(asideMap) initAsideValueRef.value = cloneDeep(asideMap)
onBeforeMount(async () => { onBeforeMount(async () => {
finalStore.fetchConfig() finalStore.fetchConfig()
finalStore.fetchCustomConfig() finalStore.fetchCustomConfig()
}) })
Object.keys(asideMap).forEach((key) => { Object.keys(asideMap).forEach((key) => {
@ -74,6 +77,8 @@ const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler) mousetrap.bind('[', collapseHandler)
onMounted(() => { onMounted(() => {
//console.log(asideMap)
nextTick(() => { nextTick(() => {
computeSlideHeight() computeSlideHeight()
}) })
@ -110,9 +115,7 @@ function computeSlideHeight() {
useWindowSizeFn(computeSlideHeight, 280) useWindowSizeFn(computeSlideHeight, 280)
onBeforeMount(async () => {
finalStore.fetchCustomConfig()
})
nextTick(() => { nextTick(() => {
finalStore.$subscribe(() => { finalStore.$subscribe(() => {
@ -221,7 +224,7 @@ nextTick(() => {
} }
}) })
customTempObjRef.value = customObjRef.value customTempObjRef.value = customObjRef.value
console.log('asideValue直接处理后的结果', asideValue) console.log('asideValue直接处理后的结果q', asideValue)
console.log('customTempObjRef.value', customTempObjRef.value) console.log('customTempObjRef.value', customTempObjRef.value)
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
console.log('tempObj', tempobj) console.log('tempObj', tempobj)
@ -251,12 +254,17 @@ nextTick(() => {
}) })
watch(asideVisible, (newVal) => { watch(asideVisible, (newVal) => {
Object.keys(asideValue).forEach((key) => { Object.keys(asideValue).forEach((key) => {
if (newVal[key] === false) if (newVal[key] === false)
asideValue[key] = asideMap[key].defaultValue asideValue[key] = asideMap[key].defaultValue
}) })
}) })
watch(asideValue, (newVal) => {
console.log(newVal)
})
const asideEnter = ref(false) const asideEnter = ref(false)
const showCollapse = computed(() => { const showCollapse = computed(() => {
@ -335,7 +343,7 @@ function updateComponent(key, e) {
finalStore.setAsideValue(tempobj) finalStore.setAsideValue(tempobj)
} }
defineExpose({ defineExpose({
showSearch, showSearch,asideValue
}) })
useKeydown('s', () => setShowSearch(true)) useKeydown('s', () => setShowSearch(true))
</script> </script>

@ -57,7 +57,7 @@ const props = defineProps({
default: '', default: '',
}, },
}) })
const emit = defineEmits(['changeShow']) const emit = defineEmits(['changeShow','goDetailx'])
function changeContent() { function changeContent() {
emit('changeShow') emit('changeShow')
} }
@ -614,10 +614,8 @@ function validate(items: any[]) {
} }
function goDetail(row) { function goDetail(row) {
router.push({ emit('goDetailx',{ id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'table' })
name: 'final-detail',
query: { id: row.id, packageid: row.packageid, taskindex: row.taskIndex, type: 'table' },
})
} }
function resetHandler() { function resetHandler() {

@ -21,8 +21,12 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
asidevalue:{
type:Object,
default:{}
}
}) })
const emit = defineEmits(['changeShow']) const emit = defineEmits(['changeShow','goDetailx'])
const aa = ref(true) const aa = ref(true)
const haeaderstore = useDataHeaderStore() const haeaderstore = useDataHeaderStore()
const headerref = ref(null) const headerref = ref(null)
@ -239,10 +243,17 @@ function isValidTimestamp(value) {
// //
function goDetail(row) { function goDetail(row) {
router.push({ console.log(props.asidevalue.asideValue
)
const tempobj = cloneDeep(props.asidevalue.asideValue)
console.log('tempObj', tempobj)
finalStore.setAsideValue(tempobj)
emit('goDetailx',{ id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' })
/* router.push({
name: 'final-detail', name: 'final-detail',
query: { id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' }, query: { id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' },
}) })*/
} }
// //
function repeatBatchReject(items) { function repeatBatchReject(items) {

@ -4,15 +4,19 @@ import Aside from './aside/Aside.vue'
import Content from './content/Content.vue' import Content from './content/Content.vue'
import ListContent from './content/ListContent.vue' import ListContent from './content/ListContent.vue'
import Robot from '@/components/Robot/index.vue' import Robot from '@/components/Robot/index.vue'
import Task from"@/views/task/content/Content.vue"
defineOptions({ defineOptions({
name: 'FinalMain', name: 'FinalMain',
}) })
const showList = ref(true) const showList = ref(true)
const showDetail = ref(false)
const contentRef: any = ref(null) const contentRef: any = ref(null)
const ListRef: any = ref(null) const ListRef: any = ref(null)
const asideref = ref(null) const asideref = ref(null)
const taskvalue = ref('') const taskvalue = ref('')
const detaiitem = ref({})
function inputChange(keyword) { function inputChange(keyword) {
if (asideref.value?.showSearch) if (asideref.value?.showSearch)
taskvalue.value = keyword taskvalue.value = keyword
@ -25,32 +29,50 @@ function inputChange(keyword) {
else else
contentRef.value.filterTableData(keyword) contentRef.value.filterTableData(keyword)
} }
function goDetailx(item){
detaiitem.value=item
showDetail.value=true
if (item.type == 'table'){
showList.value = false
}
else{
showList.value = true
}
}
function goBack(){
showDetail.value=false
}
onMounted(() => { onMounted(() => {
const searchParams = new URLSearchParams(window.location.search) // const searchParams = new URLSearchParams(window.location.search)
const type = searchParams.get('type') /* const type = searchParams.get('type')
if (type == 'table') if (type == 'table')
showList.value = false showList.value = false
else else
showList.value = true showList.value = true
}) */})
</script> </script>
<template> <template>
<div class="main"> <div class="main">
<!-- 侧边 --> <!-- 侧边 -->
<Aside ref="asideref" @input-change="inputChange" /> <Aside v-show="!showDetail" ref="asideref" @input-change="inputChange" />
<!-- 任务管理 --> <!-- 任务管理 -->
<!-- TODO:本地演示即可 上传注释注释 --> <!-- TODO:本地演示即可 上传注释注释 -->
<ListContent v-if="showList" ref="ListRef" :taskvalue="taskvalue" @change-show="showList = false" /> <ListContent v-show="!showDetail" @goDetailx="goDetailx" v-if="showList" ref="ListRef" :taskvalue="taskvalue" @change-show="showList = false" :asidevalue="asideref"/>
<!-- 内容 --> <!-- 内容 -->
<Content v-if="!showList" ref="contentRef" :taskvalue="taskvalue" @change-show="showList = true" /> <Content v-show="!showDetail" @goDetailx="goDetailx" v-if="!showList" ref="contentRef" :taskvalue="taskvalue" @change-show="showList = true" />
<!-- 机器人 --> <!-- 机器人 -->
<Robot /> <Robot />
<Task v-show="showDetail" :detaiitem="detaiitem" @goBack="goBack"/>
</div> </div>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>

@ -2,7 +2,7 @@
import { import {
computed, computed,
onMounted, onMounted,
onUnmounted, onUnmounted,defineProps,
reactive, reactive,
ref, ref,
unref, unref,
@ -40,7 +40,16 @@ import { useKeydown } from '@/hooks/event/useKeydown'
import CheckingTaskModal from '@/views/home/content/modal/CheckingTaskModal.vue' import CheckingTaskModal from '@/views/home/content/modal/CheckingTaskModal.vue'
import { getCheckDuplicateStatus, getCheckDuplicateStatusx, getLastCheckNox, removeCheckDuplicate } from '@/api/home/main' import { getCheckDuplicateStatus, getCheckDuplicateStatusx, getLastCheckNox, removeCheckDuplicate } from '@/api/home/main'
const emit = defineEmits(['setAsideItemName']) const props = defineProps({
detaiitem:{
type:Object,
default:{}
}
})
const emit = defineEmits(['setAsideItemName','goBack'])
const timer = ref() const timer = ref()
const HeaderStore = useDataHeaderStore() const HeaderStore = useDataHeaderStore()
const router = useRouter() const router = useRouter()
@ -143,10 +152,10 @@ async function init() {
} }
} }
onMounted(() => { onMounted(() => {
if (route.query.id) { if (props.detaiitem.id) {
taskId.value = route.query.id taskId.value = props.detaiitem.id
packageId.value = route.query.packageid packageId.value = props.detaiitem.packageid
taskIndex.value = route.query.taskindex as string taskIndex.value = props.detaiitem.taskindex as string
isDetail.value = true isDetail.value = true
getDetail() getDetail()
} }
@ -519,6 +528,18 @@ watch(
} }
}, },
) )
watch(
() => [props.detaiitem],
() => {
console.log(props.detaiitem)
if (props.detaiitem.id) {
taskId.value = props.detaiitem.id
packageId.value = props.detaiitem.packageid
taskIndex.value = props.detaiitem.taskindex as string
isDetail.value = true
getDetail()
}}
)
// //
async function getDetail() { async function getDetail() {
@ -550,13 +571,14 @@ function reloadList(param, text) {
} }
function goBack() { function goBack() {
const searchParams = new URLSearchParams(window.location.search) emit('goBack')
/* const searchParams = new URLSearchParams(window.location.search)
const type = searchParams.get('type') const type = searchParams.get('type')
if (type) if (type)
router.push({ name: 'final', query: { type } }) router.push({ name: 'final', query: { type } })
else else
router.back() router.back()*/
} }
function switchBatch() { function switchBatch() {

@ -246,7 +246,9 @@ defineExpose({
fontWeight: 'bold', fontWeight: 'bold',
}" }"
> >
<n-ellipsis >
{{ item[0].label }} {{ item[0].label }}
</n-ellipsis>
</div> </div>
<div <div
:style="{ :style="{

Loading…
Cancel
Save