Merge pull request #8893 from ulleo/dev

pref(X-Pack): 优化数据填报表单管理页面的查询框触发查询效果
This commit is contained in:
ulleo 2024-04-02 18:10:24 +08:00 committed by GitHub
commit af0e6d87ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 74 additions and 28 deletions

View File

@ -602,7 +602,14 @@ export default {
datasource: 'Datasource', datasource: 'Datasource',
table: 'Table', table: 'Table',
creator: 'Creator', creator: 'Creator',
createTime: 'Create Time' createTime: 'Create Time',
operation: 'Operation',
operator: 'Operator',
operate_time: 'Operate Time',
modify: 'Modify',
show: 'Show',
delete: 'Delete',
show_data: 'Show Data'
}, },
data: { data: {
confirm_delete: 'Confirm delete?' confirm_delete: 'Confirm delete?'
@ -611,7 +618,8 @@ export default {
confirm_enable: 'Confirm enable task?', confirm_enable: 'Confirm enable task?',
confirm_disable: 'Confirm disable task?' confirm_disable: 'Confirm disable task?'
}, },
on_the_left: 'Please select a form on the left' on_the_left: 'Please select a form on the left',
search_by_commit_name: 'Search by operator name'
}, },
detabs: { detabs: {
custom_sort: 'Custom Sort', custom_sort: 'Custom Sort',

View File

@ -602,7 +602,14 @@ export default {
datasource: '數據源', datasource: '數據源',
table: '數據庫表', table: '數據庫表',
creator: '創建人', creator: '創建人',
createTime: '創建時間' createTime: '創建時間',
operation: '操作',
operator: '操作人',
operate_time: '操作時間',
modify: '修改',
show: '查看',
delete: '刪除',
show_data: '查看數據'
}, },
data: { data: {
confirm_delete: '確認刪除?' confirm_delete: '確認刪除?'
@ -611,7 +618,9 @@ export default {
confirm_enable: '確認啟動任務?(單次任務會新建下發任務)', confirm_enable: '確認啟動任務?(單次任務會新建下發任務)',
confirm_disable: '確認停止任務?' confirm_disable: '確認停止任務?'
}, },
on_the_left: '請在左側選擇表單' on_the_left: '請在左側選擇表單',
search_by_commit_name: '根據操作人名稱搜索'
}, },
detabs: { detabs: {
custom_sort: '自定義排序', custom_sort: '自定義排序',

View File

@ -601,7 +601,14 @@ export default {
datasource: '数据源', datasource: '数据源',
table: '数据库表', table: '数据库表',
creator: '创建人', creator: '创建人',
createTime: '创建时间' createTime: '创建时间',
operation: '操作',
operator: '操作人',
operate_time: '操作时间',
modify: '修改',
show: '查看',
delete: '删除',
show_data: '查看数据'
}, },
data: { data: {
confirm_delete: '确认删除?' confirm_delete: '确认删除?'
@ -610,7 +617,8 @@ export default {
confirm_enable: '确认启动任务?(单次任务会新建下发任务)', confirm_enable: '确认启动任务?(单次任务会新建下发任务)',
confirm_disable: '确认停止任务?' confirm_disable: '确认停止任务?'
}, },
on_the_left: '请在左侧选择表单' on_the_left: '请在左侧选择表单',
search_by_commit_name: '根据操作人名称搜索'
}, },
detabs: { detabs: {
custom_sort: '自定义排序', custom_sort: '自定义排序',

View File

@ -181,7 +181,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" :label="$t('data_fill.form.operation')"
width="160" width="160"
fixed="right" fixed="right"
> >
@ -190,19 +190,19 @@
type="text" type="text"
@click="updateRow(scope.row.data)" @click="updateRow(scope.row.data)"
> >
修改 {{ $t('data_fill.form.modify') }}
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
@click="openRow(scope.row.data)" @click="openRow(scope.row.data)"
> >
查看 {{ $t('data_fill.form.show') }}
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
@click="deleteRow(scope.row.data[paginationConfig.key])" @click="deleteRow(scope.row.data[paginationConfig.key])"
> >
删除 {{ $t('data_fill.form.delete') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -223,15 +223,16 @@
:offset="16" :offset="16"
> >
<el-input <el-input
ref="search" ref="search2"
v-model="operateName" v-model="operateName"
:placeholder="$t('user.search_by_name')" :placeholder="$t('data_fill.search_by_commit_name')"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
class="name-email-search" class="name-email-search"
size="small" size="small"
clearable clearable
@blur="searchTableRecordData" @blur="searchTableRecordData"
@clear="searchTableRecordData" @clear="entryKey('record')"
@keyup.enter.native="entryKey('record')"
/> />
</el-col> </el-col>
</el-row> </el-row>
@ -251,7 +252,7 @@
<el-table-column <el-table-column
key="operate" key="operate"
prop="operate" prop="operate"
label="操作" :label="$t('data_fill.form.operation')"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.operate === 'INSERT'"> <template v-if="scope.row.operate === 'INSERT'">
@ -271,7 +272,7 @@
<el-table-column <el-table-column
key="commitByName" key="commitByName"
prop="commitByName" prop="commitByName"
label="操作人" :label="$t('data_fill.form.operator')"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.commitByName ? scope.row.commitByName: scope.row.commitBy }} {{ scope.row.commitByName ? scope.row.commitByName: scope.row.commitBy }}
@ -280,7 +281,7 @@
<el-table-column <el-table-column
key="commitTime" key="commitTime"
prop="commitTime" prop="commitTime"
label="操作时间" :label="$t('data_fill.form.operate_time')"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ new Date(scope.row.commitTime).format("yyyy-MM-dd hh:mm:ss") }} {{ new Date(scope.row.commitTime).format("yyyy-MM-dd hh:mm:ss") }}
@ -288,7 +289,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
key="id" key="id"
label="操作" :label="$t('data_fill.form.operation')"
prop="id" prop="id"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -297,7 +298,7 @@
type="text" type="text"
@click="showData(scope.row)" @click="showData(scope.row)"
> >
查看数据 {{ $t('data_fill.form.show_data') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -325,7 +326,7 @@
:offset="8" :offset="8"
> >
<el-input <el-input
ref="search" ref="search3"
v-model="taskName" v-model="taskName"
:placeholder="$t('commons.search_by_name')" :placeholder="$t('commons.search_by_name')"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
@ -333,7 +334,8 @@
size="small" size="small"
clearable clearable
@blur="searchFormTaskData" @blur="searchFormTaskData"
@clear="searchFormTaskData" @clear="entryKey('task')"
@keyup.enter.native="entryKey('task')"
/> />
</el-col> </el-col>
</el-row> </el-row>
@ -400,7 +402,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
key="id" key="id"
label="操作" :label="$t('data_fill.form.operation')"
prop="id" prop="id"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -602,13 +604,31 @@ export default {
this.tasks = [] this.tasks = []
} }
this.initTable(this.param.id) this.initTable(this.param.id)
},
tabActive: function(newVal, oldVal) {
this.resetPage()
if (newVal === 'record') {
this.searchTableRecordData()
} else if (newVal === 'task') {
this.searchFormTaskData()
} else {
this.searchTableData()
}
} }
}, },
mounted() { mounted() {
this.initTable(this.param.id) this.initTable(this.param.id)
}, },
methods: { methods: {
entryKey(type) {
if (type === 'record') {
this.$refs.search2.focus()
this.$refs.search2.blur()
} else if (type === 'task') {
this.$refs.search3.focus()
this.$refs.search3.blur()
}
},
initTable(id) { initTable(id) {
this.resetPage() this.resetPage()
this.searchTableData() this.searchTableData()
@ -712,6 +732,7 @@ export default {
resetPage() { resetPage() {
this.operateName = '' this.operateName = ''
this.taskName = ''
this.paginationConfig = { this.paginationConfig = {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
@ -734,12 +755,12 @@ export default {
/* if (this.tabActive === 'dataPreview') { /* if (this.tabActive === 'dataPreview') {
this.initTable(this.param.id) this.initTable(this.param.id)
}*/ }*/
if (this.tabActive === 'record') { /* if (this.tabActive === 'record') {
this.searchTableRecordData() this.searchTableRecordData()
} }
if (this.tabActive === 'task') { if (this.tabActive === 'task') {
this.searchFormTaskData() this.searchFormTaskData()
} }*/
}, },
showData(row) { showData(row) {

View File

@ -54,8 +54,8 @@ export default {
}, },
watch: { watch: {
currentKey: { currentKey: {
handler(newVal, oldVla) { handler(newVal, oldVal) {
if (newVal !== oldVla) { if (newVal !== oldVal) {
this.myTaskName = '' this.myTaskName = ''
this.finishedTaskName = '' this.finishedTaskName = ''
this.expiredTaskName = '' this.expiredTaskName = ''
@ -436,7 +436,7 @@ export default {
</el-table-column> </el-table-column>
<el-table-column <el-table-column
key="id" key="id"
label="操作" :label="$t('data_fill.form.operation')"
prop="id" prop="id"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -520,7 +520,7 @@ export default {
</el-table-column> </el-table-column>
<el-table-column <el-table-column
key="id" key="id"
label="操作" :label="$t('data_fill.form.operation')"
prop="id" prop="id"
> >
<template slot-scope="scope"> <template slot-scope="scope">