Merge branch 'test' of https://git.mcnetmart.com/guoxiangbin/ocr-web into fix/updatesyspic

pull/314/head
raoyongjun 1 year ago
commit 05d3fca146

@ -1,11 +1,10 @@
import { defineStore } from 'pinia'
import { store } from '@/store'
import { getFilter } from '@/api/home/filter'
import { getConfig } from '@/api/system/user'
import { getFilter } from '@/api/home/filter';
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 {
systemConfig: AsideConfig | null
@ -59,6 +58,7 @@ export const useFinalStore = defineStore({
console.log("systemConfig----------", config);
},
setAsideValue(value) {
console.log(value)
this.asideValue = value
},
setListKey() {

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

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

@ -21,8 +21,12 @@ const props = defineProps({
type: String,
default: '',
},
asidevalue:{
type:Object,
default:{}
}
})
const emit = defineEmits(['changeShow'])
const emit = defineEmits(['changeShow','goDetailx'])
const aa = ref(true)
const haeaderstore = useDataHeaderStore()
const headerref = ref(null)
@ -239,10 +243,17 @@ function isValidTimestamp(value) {
//
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',
query: { id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' },
})
})*/
}
//
function repeatBatchReject(items) {

@ -4,15 +4,19 @@ import Aside from './aside/Aside.vue'
import Content from './content/Content.vue'
import ListContent from './content/ListContent.vue'
import Robot from '@/components/Robot/index.vue'
import Task from"@/views/task/content/Content.vue"
defineOptions({
name: 'FinalMain',
})
const showList = ref(true)
const showDetail = ref(false)
const contentRef: any = ref(null)
const ListRef: any = ref(null)
const asideref = ref(null)
const taskvalue = ref('')
const detaiitem = ref({})
function inputChange(keyword) {
if (asideref.value?.showSearch)
taskvalue.value = keyword
@ -25,32 +29,50 @@ function inputChange(keyword) {
else
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(() => {
const searchParams = new URLSearchParams(window.location.search)
const type = searchParams.get('type')
// const searchParams = new URLSearchParams(window.location.search)
/* const type = searchParams.get('type')
if (type == 'table')
showList.value = false
else
showList.value = true
})
*/})
</script>
<template>
<div class="main">
<!-- 侧边 -->
<Aside ref="asideref" @input-change="inputChange" />
<Aside v-show="!showDetail" ref="asideref" @input-change="inputChange" />
<!-- 任务管理 -->
<!-- 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 />
<Task v-show="showDetail" :detaiitem="detaiitem" @goBack="goBack"/>
</div>
</template>
<style lang="less" scoped>

@ -2,7 +2,7 @@
import {
computed,
onMounted,
onUnmounted,
onUnmounted,defineProps,
reactive,
ref,
unref,
@ -40,7 +40,16 @@ import { useKeydown } from '@/hooks/event/useKeydown'
import CheckingTaskModal from '@/views/home/content/modal/CheckingTaskModal.vue'
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 HeaderStore = useDataHeaderStore()
const router = useRouter()
@ -143,10 +152,10 @@ async function init() {
}
}
onMounted(() => {
if (route.query.id) {
taskId.value = route.query.id
packageId.value = route.query.packageid
taskIndex.value = route.query.taskindex as string
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()
}
@ -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() {
@ -550,13 +571,14 @@ function reloadList(param, text) {
}
function goBack() {
const searchParams = new URLSearchParams(window.location.search)
emit('goBack')
/* const searchParams = new URLSearchParams(window.location.search)
const type = searchParams.get('type')
if (type)
router.push({ name: 'final', query: { type } })
else
router.back()
router.back()*/
}
function switchBatch() {

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

Loading…
Cancel
Save