Browse Source

Merge branch 'zhangtao' of gitadmin/tuoheng_lc_web into develop

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
a8d979f00e
5 changed files with 19 additions and 13 deletions
  1. +4
    -3
      src/components/DataTable/tools/useDataSource.js
  2. +1
    -0
      src/views/task-manage/all-task/components/DemandDrawer.vue
  3. +7
    -3
      src/views/task-manage/question/index.vue
  4. +3
    -3
      src/views/task-manage/question/tools/search.js
  5. +4
    -4
      src/views/task-manage/question/tools/table.js

+ 4
- 3
src/components/DataTable/tools/useDataSource.js View File



export function useDataSource(propsRef, { getPaginationInfo, setPagination, setLoading, tableData }, emit) { export function useDataSource(propsRef, { getPaginationInfo, setPagination, setLoading, tableData }, emit) {
const dataSourceRef = ref([]) const dataSourceRef = ref([])
const paginationPage = ref(1)
async function fetch(opt) { async function fetch(opt) {
try { try {
/* 设置loading */ /* 设置loading */
pageParams = {} pageParams = {}
} else { } else {
pageParams[pageField] = (opt && opt[pageField]) || page pageParams[pageField] = (opt && opt[pageField]) || page
paginationPage.value = pageParams[pageField]
pageParams[sizeField] = pageSize pageParams[sizeField] = pageSize
} }
const params = { const params = {
await fetch(opt) await fetch(opt)
} }


async function reFetch(opt) {
async function reFetch(opt, reload = true) {
const { paginationSetting } = unref(propsRef) const { paginationSetting } = unref(propsRef)
const pageField = paginationSetting.pageField const pageField = paginationSetting.pageField
const sizeField = paginationSetting.sizeField const sizeField = paginationSetting.sizeField
const pageSize = paginationSetting.pageSize const pageSize = paginationSetting.pageSize
setPagination({ setPagination({
[pageField]: 1,
[pageField]: reload ? 1 : paginationPage.value,
[sizeField]: pageSize [sizeField]: pageSize
}) })
await fetch(opt) await fetch(opt)

+ 1
- 0
src/views/task-manage/all-task/components/DemandDrawer.vue View File

analyseRef.value?.disposeVideo() analyseRef.value?.disposeVideo()
data.videoInfo.origin.status = 'init' data.videoInfo.origin.status = 'init'
data.videoInfo.analyse.status = 'init' data.videoInfo.analyse.status = 'init'
data.videoShow = 'back'
data.mapData = null data.mapData = null
} }
}, { deep: true }) }, { deep: true })

+ 7
- 3
src/views/task-manage/question/index.vue View File

</template> </template>
</DataTable> </DataTable>


<ConfirmModal v-if="confirmModal" v-model:visible="confirmModal" :data="pageData" :select-row="rowData" @update-data="handleSearch" />
<ConfirmModal v-if="confirmModal" v-model:visible="confirmModal" :data="pageData" :select-row="rowData" @update-data="handleReload" />


<!-- 图片位置 --> <!-- 图片位置 -->
<position-drawer v-model:visible="positionDrawer" :data="rowData" /> <position-drawer v-model:visible="positionDrawer" :data="rowData" />
missionId: props.data.id, missionId: props.data.id,
...res ...res
} }
if (_params.status === 'all') _params.status = ''
if (_params.type === 'all') _params.type = null
return await getQuestionList(_params) return await getQuestionList(_params)
} }


} }
} }


function handleReload() {
data.handleSearch(data.searchParams, false)
}
return { return {
...toRefs(data), ...toRefs(data),
loadDataTable, loadDataTable,
handleRowsCheck, handleRowsCheck,
handleIgnoreBatch, handleIgnoreBatch,
handleConfirmBatch, handleConfirmBatch,
handleReported
handleReported,
handleReload


} }
} }

+ 3
- 3
src/views/task-manage/question/tools/search.js View File



const data = reactive([ const data = reactive([
{ {
label: '任务状态',
key: 'status',
label: '问题类型',
key: 'type',
type: 'select', type: 'select',
value: 'all', value: 'all',
props: { props: {
placeholder: '请选择任务状态',
placeholder: '请选择问题类型',
options: [ options: [
{ label: '全部', value: 'all' }, { label: '全部', value: 'all' },
...QUESTION_TYPE ...QUESTION_TYPE

+ 4
- 4
src/views/task-manage/question/tools/table.js View File

const tableRef = ref() const tableRef = ref()
const searchParams = ref() const searchParams = ref()


function handleSearch(params) {
function handleSearch(params, reload = true) {
searchParams.value = { ...params } searchParams.value = { ...params }
tableRef.value.reFetch({ searchParams })
tableRef.value.reFetch({ searchParams }, reload)
} }


/* 问题忽略 */ /* 问题忽略 */
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
data.selectRowKeys = [] data.selectRowKeys = []
handleSearch()
handleSearch(searchParams.value, false)
} }
}) })
} }
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
data.selectRowKeys = [] data.selectRowKeys = []
handleSearch()
handleSearch(searchParams.value, false)
} }
}) })
} }

Loading…
Cancel
Save