This commit is contained in:
Jane
2023-12-22 12:18:52 +08:00
parent 340f82a67e
commit 812109656a
746 changed files with 84928 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<template>
<div className="app-container">
<transition name="el-zoom-in-center">
<dc-db-config-list v-if="options.showList" @showCard="showCard" />
</transition>
</div>
</template>
<script>
import dcDbConfigList from './dcDbConfigList'
export default {
name: 'DcDbConfig',
components: { dcDbConfigList },
data() {
return {
options: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
}
}
},
methods: {
showCard(data) {
Object.assign(this.options, data)
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,395 @@
<template>
<el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="connectName" prop="id">
<el-input
v-model="queryParams.connectName"
placeholder="connectName"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleCreate"
>新增</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableDataList"
border
tooltip-effect="dark"
:size="tableSize"
:height="tableHeight"
style="width: 100%;margin: 15px 0;"
>
<el-table-column type="selection" width="55" align="center" />
<template v-for="(item, index) in tableColumns">
<el-table-column
v-if="item.show"
:key="index"
:prop="item.prop"
:label="item.label"
:formatter="item.formatter"
align="center"
show-overflow-tooltip
/>
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popover
placement="left"
trigger="click"
>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button slot="reference">操作</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 模态框添加数据-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="800px">
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="150px">
<el-form-item label="connectName" prop="connectName" required>
<el-input v-model="temp.connectName" placeholder="请输入connectName" style="width: 70%" />
</el-form-item>
<el-form-item label="type" prop="type" required>
<el-select v-model="temp.type" placeholder="请选择数据库类型">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="url" prop="url" required>
<el-input v-model="temp.url" placeholder="请输入url" style="width: 70%" />
</el-form-item>
<el-form-item label="userName" prop="userName" required>
<el-input v-model="temp.userName" placeholder="请输入userName" style="width: 70%" />
</el-form-item>
<el-form-item label="pwd" prop="pwd">
<el-input v-model="temp.pwd" placeholder="请输入pwd" style="width: 70%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
取消
</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
确认
</el-button>
</div>
</el-dialog>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
</template>
<script>
import { pageDataModel, delDataModel, addDataModel, updateDataModel } from '@/api/compare/dcDbConfig/datamodel'
export default {
name: 'DcDbConfigList',
data() {
return {
tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换
showOptions: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
},
options: [{
value: 'MySQL',
label: 'MySQL'
}, {
value: 'Hive',
label: 'Hive'
}, {
value: 'Doris',
label: 'Doris'
}],
// 遮罩层
loading: true,
dialogFormVisible: false,
dialogFormVisible2: false,
textMap: {
update: '编辑数据库配置',
create: '添加数据库配置'
},
dialogStatus: '',
temp: {
connectName: '',
type: '',
url: '',
userName: '',
pwd: ''
},
rules: {
id: [{ required: true, message: '不能为空', trigger: 'blur' }],
connectName: [{ required: true, message: '不能为空', trigger: 'blur' }],
type: [{ required: true, message: '不能为空', trigger: 'blur' }],
url: [{ required: true, message: '不能为空', trigger: 'blur' }]
},
// 表格头
tableColumns: [
{ prop: 'id', label: 'id', show: true },
{ prop: 'connectName', label: 'connectName', show: true },
{ prop: 'type', label: 'type', show: true },
{
prop: 'url',
label: 'url',
show: true
}
],
// 默认选择中表格头
checkedTableColumns: [],
tableSize: 'medium',
// 状态数据字典
statusOptions: [],
// 表格数据
tableDataList: [],
// 总数据条数
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
connectName: ''
},
// 流程状态数据字典
flowStatusOptions: []
}
},
created() {
this.getDicts('sys_common_status').then(response => {
if (response.success) {
this.statusOptions = response.data
}
})
this.getDicts('sys_flow_status').then(response => {
if (response.success) {
this.flowStatusOptions = response.data
}
})
this.getList()
},
mounted() {
this.initCols()
},
methods: {
/** 查询数据源列表 */
getList() {
const _this = this
// console.log("hello world1")
_this.loading = true
pageDataModel(this.queryParams).then(response => {
console.log(response)
_this.loading = false
if (response.code ===0) {
_this.tableDataList = response.rows
_this.total = response.total
}
})
},
initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop)
},
handleCheckedColsChange(val) {
this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false
} else {
col.show = true
}
})
},
handleCommand(command) {
this.tableSize = command
},
resetTemp() {
console.log('添加数据前,先清空之前输入的值')
this.temp = {
connectName: '',
type: '',
url: '',
userName: '',
pwd: ''
}
},
createData() {
console.log('开始添加数据')
this.$refs['dataForm'].validate((valid) => {
console.log(valid)
if (valid) {
console.log(this.temp)
addDataModel(this.temp).then((response) => {
console.log(response)
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '添加成功',
type: 'success',
duration: 2000
})
this.getList()
})
}
})
},
// 新增按钮操作
handleCreate() {
this.resetTemp()
this.dialogStatus = 'create'
this.dialogFormVisible = true
console.log('新增数据前。看是否已清空之前的数据', this.temp)
},
// 修改按钮操作
handleUpdate(row) {
// console.log(row)
this.temp = Object.assign({}, row) // copy obj
this.dialogStatus = 'update'
this.dialogFormVisible = true
},
updateData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
const tempData = Object.assign({}, this.temp)
console.log(tempData)
const tempData2 = {}
tempData2.id = tempData.id
tempData2.connectName = tempData.connectName
tempData2.type = tempData.type
tempData2.url = tempData.url
tempData2.userName = tempData.userName
tempData2.pwd = tempData.pwd
updateDataModel(tempData2).then(() => {
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '修改成功',
type: 'success',
duration: 2000
})
this.getList()
})
}
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 20,
connectName: ''
}
this.handleQuery()
},
/** 刷新列表 */
handleRefresh() {
this.getList()
},
/** 详情按钮操作 */
handleDetail(row) {
this.showOptions.data.id = row.id
this.showOptions.showList = false
this.showOptions.showAdd = false
this.showOptions.showEdit = false
this.showOptions.showDetail = true
this.$emit('showCard', this.showOptions)
},
/** 删除按钮操作 */
handleDelete(row) {
console.log('进入到删除按钮操作')
console.log(row.id)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.id).then(response => {
console.log(response)
if (response.code ===0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
/** 删除全部,按钮操作 */
handleDelAll(row) {
console.log('进入到删除按钮操作')
console.log(row)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.id).then(response => {
console.log(response)
if (response.code === 0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.queryParams.pageNum = 1
this.queryParams.pageSize = val
this.getList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.right-toolbar {
float: right;
}
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style>

View File

@@ -0,0 +1,37 @@
<template>
<div className="app-container">
<transition name="el-zoom-in-center">
<dc-job-list v-if="options.showList" @showCard="showCard" />
</transition>
</div>
</template>
<script>
import dcJobList from './dcJobList'
export default {
name: 'DcJob',
components: { dcJobList },
data() {
return {
options: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
}
}
},
methods: {
showCard(data) {
Object.assign(this.options, data)
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,449 @@
<template>
<el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="JobId" prop="id">
<el-input
v-model="queryParams.id"
placeholder="请输入JobId"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleCreate"
>新增</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableDataList"
border
tooltip-effect="dark"
:size="tableSize"
:height="tableHeight"
style="width: 100%;margin: 15px 0;"
>
<el-table-column type="selection" width="55" align="center" />
<template v-for="(item, index) in tableColumns">
<el-table-column
v-if="item.show"
:key="index"
:prop="item.prop"
:label="item.label"
:formatter="item.formatter"
align="center"
show-overflow-tooltip
/>
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popover
placement="left"
trigger="click"
>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button slot="reference">操作</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 模态框添加数据-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="800px">
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="150px">
<el-form-item label="任务编号" prop="jobId" required>
<el-input v-model="temp.jobId" placeholder="请输入任务编号" style="width: 70%" />
</el-form-item>
<el-form-item label="任务名称" prop="jobName" required>
<el-input v-model="temp.jobName" placeholder="请输入任务名称" style="width: 70%" />
</el-form-item>
<el-form-item label="任务分组" prop="jobGroup" required>
<el-input v-model="temp.jobGroup" placeholder="请输入任务分组" style="width: 70%" />
</el-form-item>
<el-form-item label="调用目标字符串" prop="invokeTarget">
<el-input v-model="temp.invokeTarget" placeholder="请输入任务目标字符串" style="width: 70%" />
</el-form-item>
<el-form-item label="执行表达式" prop="cronExpression">
<el-input v-model="temp.cronExpression" placeholder="请输入执行表达式" style="width: 70%" />
</el-form-item>
<el-form-item label="任务状态" prop="status" required>
<el-input v-model="temp.status" placeholder="任务状态" style="width: 70%" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" required>
<el-input v-model="temp.createTime" placeholder="创建时间" style="width: 70%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
取消
</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
确认
</el-button>
</div>
</el-dialog>
<!-- 模态框修改数据-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible2" width="800px">
<el-form ref="dataForm2" :rules="rules" :model="temp2" label-position="left" label-width="150px">
<el-form-item label="任务编号" prop="jobId" required>
<el-input v-model="temp2.jobId" placeholder="请输入任务编号" style="width: 70%" />
</el-form-item>
<el-form-item label="任务名称" prop="jobName" required>
<el-input v-model="temp2.jobName" placeholder="请输入任务名称" style="width: 70%" />
</el-form-item>
<el-form-item label="任务分组" prop="jobGroup" required>
<el-input v-model="temp2.jobGroup" placeholder="请输入任务分组" style="width: 70%" />
</el-form-item>
<el-form-item label="调用目标字符串" prop="invokeTarget">
<el-input v-model="temp2.invokeTarget" placeholder="请输入任务目标字符串" style="width: 70%" />
</el-form-item>
<el-form-item label="执行表达式" prop="cronExpression">
<el-input v-model="temp2.cronExpression" placeholder="请输入执行表达式" style="width: 70%" />
</el-form-item>
<el-form-item label="任务状态" prop="status" required>
<el-input v-model="temp2.status" placeholder="任务状态" style="width: 70%" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" required>
<el-input v-model="temp2.createTime" placeholder="创建时间" style="width: 70%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2 = false">
取消
</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
确认
</el-button>
</div>
</el-dialog>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
</template>
<script>
import { pageDataModel, delDataModel, addDataModel, updateDataModel } from '@/api/compare/dcJob/datamodel'
export default {
name: 'DcJobList',
data() {
return {
tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换
showOptions: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
},
// 遮罩层
loading: true,
dialogFormVisible: false,
dialogFormVisible2: false,
textMap: {
update: '编辑Job配置',
create: '添加Job配置'
},
dialogStatus: '',
temp: {
jobId: '',
jobName: '',
jobGroup: '',
invokeTarget: '',
cronExpression: '',
status: '',
createTime: ''
},
temp2: {
jobId: '',
jobName: '',
jobGroup: '',
invokeTarget: '',
cronExpression: '',
status: '',
createTime: ''
},
rules: {
jobId: [{ required: true, message: '不能为空', trigger: 'blur' }],
jobName: [{ required: true, message: '不能为空', trigger: 'blur' }],
jobGroup: [{ required: true, message: '不能为空', trigger: 'blur' }],
invokeTarget: [{ required: true, message: '不能为空', trigger: 'blur' }],
cronExpression: [{ required: true, message: '不能为空', trigger: 'blur' }],
status: [{ required: true, message: '不能为空', trigger: 'blur' }],
createTime: [{ required: true, message: '不能为空', trigger: 'blur' }]
},
// 表格头
tableColumns: [
{ prop: 'jobId', label: '任务编号', show: true },
{ prop: 'jobName', label: '任务名称', show: true },
{ prop: 'jobGroup', label: '任务分组', show: true },
{
prop: 'invokeTarget',
label: '调用目标字符串',
show: true
},
{
prop: 'cronExpression',
label: '执行表达式',
show: true
},
{ prop: 'status', label: '任务状态', show: true },
{ prop: 'createTime', label: '创建时间', show: true }
],
// 默认选择中表格头
checkedTableColumns: [],
tableSize: 'medium',
// 状态数据字典
statusOptions: [],
// 表格数据
tableDataList: [],
// 总数据条数
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
id: ''
},
// 流程状态数据字典
flowStatusOptions: []
}
},
created() {
this.getDicts('sys_common_status').then(response => {
if (response.success) {
this.statusOptions = response.data
}
})
this.getDicts('sys_flow_status').then(response => {
if (response.success) {
this.flowStatusOptions = response.data
}
})
this.getList()
},
mounted() {
this.initCols()
},
methods: {
/** 查询数据源列表 */
getList() {
const _this = this
// console.log("hello world1")
_this.loading = true
pageDataModel(this.queryParams).then(response => {
_this.loading = false
if (response.code ===0) {
_this.tableDataList = response.rows
_this.total = response.total
}
})
},
initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop)
},
handleCheckedColsChange(val) {
this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false
} else {
col.show = true
}
})
},
handleCommand(command) {
this.tableSize = command
},
resetTemp() {
console.log('添加数据前,先清空之前输入的值')
this.temp = {
jobId: '',
jobName: '',
jobGroup: '',
invokeTarget: '',
cronExpression: '',
status: '',
createTime: ''
}
},
createData() {
console.log('开始添加数据')
this.$refs['dataForm'].validate((valid) => {
console.log(valid)
if (valid) {
console.log(this.temp)
addDataModel(this.temp).then((response) => {
console.log(response)
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '添加成功',
type: 'success',
duration: 2000
})
this.getList()
})
}
})
},
// 新增按钮操作
handleCreate() {
this.resetTemp()
this.dialogStatus = 'create'
this.dialogFormVisible = true
console.log('新增数据前。看是否已清空之前的数据', this.temp)
},
// 修改按钮操作
handleUpdate(row) {
// console.log(row)
this.temp2 = Object.assign({}, row) // copy obj
this.dialogStatus = 'update'
this.dialogFormVisible2 = true
},
updateData() {
this.$refs['dataForm2'].validate((valid) => {
if (valid) {
const tempData = Object.assign({}, this.temp2)
console.log(tempData)
const tempData2 = {}
tempData2.id = tempData.id
tempData2.originTableName = tempData.originTableName
tempData2.originTablePrimary = tempData.originTablePrimary
tempData2.originTableFields = tempData.originTableFields
tempData2.originTableFilter = tempData.originTableFilter
tempData2.originTableGroup = tempData.originTableGroup
tempData2.toTableName = tempData.toTableName
tempData2.toTablePrimary = tempData.toTablePrimary
tempData2.toTableFields = tempData.toTableFields
tempData2.toTableFilter = tempData.toTableFilter
tempData2.toTableGroup = tempData.toTableGroup
updateDataModel(tempData2).then(() => {
this.dialogFormVisible2 = false
this.$notify({
title: '成功',
message: '修改成功',
type: 'success',
duration: 2000
})
this.getList()
})
}
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 20,
id: ''
}
this.handleQuery()
},
/** 刷新列表 */
handleRefresh() {
this.getList()
},
/** 详情按钮操作 */
handleDetail(row) {
this.showOptions.data.id = row.id
this.showOptions.showList = false
this.showOptions.showAdd = false
this.showOptions.showEdit = false
this.showOptions.showDetail = true
this.$emit('showCard', this.showOptions)
},
/** 删除按钮操作 */
handleDelete(row) {
console.log('进入到删除按钮操作')
console.log(row.id)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.id).then(response => {
console.log(response)
if (response.code ===0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
/** 删除全部,按钮操作 */
handleDelAll(row) {
console.log('进入到删除按钮操作')
console.log(row)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.id).then(response => {
console.log(response)
if (response.code === 0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.queryParams.pageNum = 1
this.queryParams.pageSize = val
this.getList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.right-toolbar {
float: right;
}
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style>

View File

@@ -0,0 +1,37 @@
<template>
<div className="app-container">
<transition name="el-zoom-in-center">
<dc-job-config-list v-if="options.showList" @showCard="showCard"/>
</transition>
</div>
</template>
<script>
import dcJobConfigList from './dcJobConfigList'
export default {
name: 'dcJobConfig',
components: {dcJobConfigList},
data() {
return {
options: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
}
}
},
methods: {
showCard(data) {
Object.assign(this.options, data)
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,526 @@
<template>
<el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="JobId" prop="id">
<el-input
v-model="queryParams.id"
placeholder="请输入JobId"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleCreate"
>新增</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableDataList"
border
tooltip-effect="dark"
:size="tableSize"
:height="tableHeight"
style="width: 100%;margin: 15px 0;"
>
<el-table-column type="selection" width="55" align="center" />
<template v-for="(item, index) in tableColumns">
<el-table-column
v-if="item.show"
:key="index"
:prop="item.prop"
:label="item.label"
:formatter="item.formatter"
align="center"
show-overflow-tooltip
/>
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popover
placement="left"
trigger="click"
>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-video-play"
@click="handleRun(scope.row)"
>运行</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button slot="reference">操作</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 模态框添加数据-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="800px">
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="150px">
<el-form-item label="connectName" prop="dbConfigId" required>
<el-select v-model="temp.dbConfigId" placeholder="请选择数据配置">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="源表" prop="originTableName" required>
<el-input v-model="temp.originTableName" placeholder="请填写库名和表名(例如:[db].[table])" style="width: 70%" />
</el-form-item>
<el-form-item label="源表主键" prop="originTablePrimary" required>
<el-input v-model="temp.originTablePrimary" placeholder="源表主键" style="width: 70%" />
</el-form-item>
<el-form-item label="源表字段" prop="originTableFields" required>
<el-input v-model="temp.originTableFields" placeholder="请填写字段名,用逗号分隔" style="width: 70%" />
</el-form-item>
<el-form-item label="源表过滤条件" prop="originTableFilter">
<el-input v-model="temp.originTableFilter" placeholder="源表过滤条件" style="width: 70%" />
</el-form-item>
<el-form-item label="源表分组条件" prop="originTableGroup">
<el-input v-model="temp.originTableGroup" placeholder="源表分组条件" style="width: 70%" />
</el-form-item>
<el-form-item label="目标表" prop="toTableName" required>
<el-input v-model="temp.toTableName" placeholder="目标表" disabled style="width: 70%" />
</el-form-item>
<el-form-item label="目标表主键" prop="toTablePrimary" required>
<el-input v-model="temp.toTablePrimary" placeholder="目标表主键" disabled style="width: 70%" />
</el-form-item>
<el-form-item label="目标表字段" prop="toTableFields" required>
<el-input v-model="temp.toTableFields" placeholder="目标表字段" disabled style="width: 70%" />
</el-form-item>
<el-form-item label="目标表过滤条件" prop="toTableFilter">
<el-input v-model="temp.toTableFilter" placeholder="目标表过滤条件" disabled style="width: 70%" />
</el-form-item>
<el-form-item label="目标表分组条件" prop="toTableGroup">
<el-input v-model="temp.toTableGroup" placeholder="目标表分组条件" disabled style="width: 70%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
取消
</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
确认
</el-button>
</div>
</el-dialog>
<!-- 模态框修改数据-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible2" width="800px">
<el-form ref="dataForm2" :rules="rules" :model="temp2" label-position="left" label-width="150px">
<el-form-item label="源表" prop="originTableName" required>
<el-input v-model="temp2.originTableName" placeholder="请填写库名和表名(例如:[db].[table])" style="width: 70%" />
</el-form-item>
<el-form-item label="源表主键" prop="originTablePrimary" required>
<el-input v-model="temp2.originTablePrimary" placeholder="源表主键" style="width: 70%" />
</el-form-item>
<el-form-item label="源表字段" prop="originTableFields" required>
<el-input v-model="temp2.originTableFields" placeholder="请填写字段名,用逗号分隔" style="width: 70%" />
</el-form-item>
<el-form-item label="源表过滤条件" prop="originTableFilter">
<el-input v-model="temp2.originTableFilter" placeholder="源表过滤条件" style="width: 70%" />
</el-form-item>
<el-form-item label="源表分组条件" prop="originTableGroup">
<el-input v-model="temp2.originTableGroup" placeholder="源表分组条件" style="width: 70%" />
</el-form-item>
<el-form-item label="目标表" prop="toTableName" required>
<el-input v-model="temp2.toTableName" placeholder="目标表" style="width: 70%" />
</el-form-item>
<el-form-item label="目标表主键" prop="toTablePrimary" required>
<el-input v-model="temp2.toTablePrimary" placeholder="目标表主键" style="width: 70%" />
</el-form-item>
<el-form-item label="目标表字段" prop="toTableFields" required>
<el-input v-model="temp2.toTableFields" placeholder="目标表字段" style="width: 70%" />
</el-form-item>
<el-form-item label="目标表过滤条件" prop="toTableFilter">
<el-input v-model="temp2.toTableFilter" placeholder="目标表过滤条件" style="width: 70%" />
</el-form-item>
<el-form-item label="目标表分组条件" prop="toTableGroup">
<el-input v-model="temp2.toTableGroup" placeholder="目标表分组条件" style="width: 70%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2 = false">
取消
</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
确认
</el-button>
</div>
</el-dialog>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
</template>
<script>
import { pageDataModel, delDataModel, addDataModel, updateDataModel, getDbConfig, dcJobConfigRun } from '@/api/compare/dcJobConfig/datamodel'
export default {
name: 'DcJobConfigList',
data() {
return {
options: [],
tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换
showOptions: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
},
// 遮罩层
loading: true,
dialogFormVisible: false,
dialogFormVisible2: false,
textMap: {
update: '编辑Job配置',
create: '添加Job配置'
},
dialogStatus: '',
temp: {
dbConfigId: '',
originTableName: '',
originTablePrimary: '',
originTableFields: '',
originTableFilter: '',
originTableGroup: '',
toTableName: '',
toTablePrimary: '',
toTableFields: '',
toTableFilter: '',
toTableGroup: ''
},
temp2: {
dbConfigId: '',
originTableName: '',
originTablePrimary: '',
originTableFields: '',
originTableFilter: '',
originTableGroup: '',
toTableName: '',
toTablePrimary: '',
toTableFields: '',
toTableFilter: '',
toTableGroup: ''
},
rules: {
name: [{ required: true, message: '不能为空', trigger: 'blur' }],
description: [{ required: true, message: '不能为空', trigger: 'blur' }]
},
// 表格头
tableColumns: [
{ prop: 'id', label: 'jobconfigId', show: true },
{ prop: 'originTableName', label: '源表', show: true },
{ prop: 'originTablePrimary', label: '源表主键', show: true },
{
prop: 'originTableFields',
label: '对比字段',
show: true
},
{
prop: 'toTableName',
label: '目标表',
show: true
},
{ prop: 'toTablePrimary', label: '目标主键', show: true },
{ prop: 'toTableFields', label: '目标对比字段', show: true },
{ prop: 'schduleStatus', label: '是否启动调度', show: true,
formatter: function (value, row, index) {
console.log(value)
if (value.schduleStatus =='1') {
return '是'
} else {
return '否'
}
} },
{ prop: 'createTime', label: '创建时间', show: true }
],
// 默认选择中表格头
checkedTableColumns: [],
tableSize: 'medium',
// 状态数据字典
statusOptions: [],
// 表格数据
tableDataList: [],
// 总数据条数
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
id: ''
},
// 流程状态数据字典
flowStatusOptions: []
}
},
watch: {
temp: {
handler(newName, oldName) {
this.temp.dbConfigId = newName.dbConfigId
this.temp.toTableName = newName.originTableName
this.temp.toTablePrimary = newName.originTablePrimary
this.temp.toTableFields = newName.originTableFields
this.temp.toTableFilter = newName.originTableFilter
this.temp.toTableGroup = newName.originTableGroup
},
immediate: true,
deep: true
}
},
created() {
this.getList()
this.getDbConfig()
},
mounted() {
this.initCols()
},
methods: {
/** 查询数据源列表 */
getList() {
const _this = this
// console.log("hello world1")
_this.loading = true
pageDataModel(this.queryParams).then(response => {
// console.log("hello world2")
// console.log(response.total)
// console.log(response.code)
_this.loading = false
if (response.code ===0) {
_this.tableDataList = response.rows
_this.total = response.total
// console.log("hello world3")
// console.log(_this.tableDataList)
// console.log(_this.total)
}
})
},
initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop)
},
// 获取DbconfigId
getDbConfig() {
let _this =this
console.log('添加数据时获取DbconfigId')
getDbConfig().then((response) => {
// console.log("response",response)
// console.log("total",response.total)
for(let i = 0; i < response.total; i++){
// console.log(response.rows[i].id)
let obj={ value :'', label : '' }
console.log(response.rows[i].connectName)
obj.value = response.rows[i].id
obj.label = response.rows[i].connectName
console.log(i)
console.log(obj)
_this.options.push(obj)
}
})
},
// 添加数据前,清空数据
resetTemp() {
console.log('添加数据前,先清空之前输入的值')
this.temp = {
dbConfigId: '',
originTableName: '',
originTablePrimary: '',
originTableFields: '',
originTableFilter: '',
originTableGroup: '',
toTableName: '',
toTablePrimary: '',
toTableFields: '',
toTableFilter: '',
toTableGroup: ''
}
},
// 开始添加数据
createData() {
console.log('开始添加数据')
this.$refs['dataForm'].validate((valid) => {
console.log(valid)
if (valid) {
console.log(this.temp)
addDataModel(this.temp).then((response) => {
console.log(response)
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '添加成功',
type: 'success',
duration: 2000
})
this.getList()
})
}
})
},
// 新增按钮操作
handleCreate() {
this.resetTemp()
this.dialogStatus = 'create'
this.dialogFormVisible = true
console.log('新增数据前。看是否已清空之前的数据', this.temp)
},
// 修改按钮操作
handleUpdate(row) {
// console.log(row)
this.temp2 = Object.assign({}, row) // copy obj
this.dialogStatus = 'update'
this.dialogFormVisible2 = true
},
updateData() {
this.$refs['dataForm2'].validate((valid) => {
if (valid) {
const tempData = Object.assign({}, this.temp2)
console.log(tempData)
const tempData2 = {}
tempData2.id = tempData.id
tempData2.originTableName = tempData.originTableName
tempData2.originTablePrimary = tempData.originTablePrimary
tempData2.originTableFields = tempData.originTableFields
tempData2.originTableFilter = tempData.originTableFilter
tempData2.originTableGroup = tempData.originTableGroup
tempData2.toTableName = tempData.toTableName
tempData2.toTablePrimary = tempData.toTablePrimary
tempData2.toTableFields = tempData.toTableFields
tempData2.toTableFilter = tempData.toTableFilter
tempData2.toTableGroup = tempData.toTableGroup
updateDataModel(tempData2).then(() => {
this.dialogFormVisible2 = false
this.$notify({
title: '成功',
message: '修改成功',
type: 'success',
duration: 2000
})
this.getList()
})
}
})
},
// 运行按钮操作
handleRun(data){
console.log(data.id)
dcJobConfigRun(data.id).then((response) => {
console.log("response",response)
if (response.code ===0) {
this.$message.success('运行成功')
this.getList()
}else{
this.$message.success('运行失败')
this.getList()
}
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 20,
id: ''
}
this.handleQuery()
},
/** 刷新列表 */
handleRefresh() {
this.getList()
},
/** 删除按钮操作 */
handleDelete(row) {
console.log('进入到删除按钮操作')
console.log(row.id)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.id).then(response => {
console.log(response)
if (response.code ===0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
/** 删除全部,按钮操作 */
handleDelAll(row) {
console.log('进入到删除按钮操作')
console.log(row)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.id).then(response => {
console.log(response)
if (response.code === 0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.queryParams.pageNum = 1
this.queryParams.pageSize = val
this.getList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.right-toolbar {
float: right;
}
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style>

View File

@@ -0,0 +1,37 @@
<template>
<div className="app-container">
<transition name="el-zoom-in-center">
<dc-job-instance-list v-if="options.showList" @showCard="showCard" />
</transition>
</div>
</template>
<script>
import dcJobInstanceList from './dcJobInstanceList'
export default {
name: 'DcJobInstance',
components: { dcJobInstanceList },
data() {
return {
options: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
}
}
},
methods: {
showCard(data) {
Object.assign(this.options, data)
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,447 @@
<template>
<el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="jobconfigId" prop="id">
<el-input
v-model="queryParams.jobconfigId"
placeholder="请输入JobconfigId"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableDataList"
border
tooltip-effect="dark"
:size="tableSize"
:height="tableHeight"
style="width: 100%;margin: 15px 0;"
>
<el-table-column type="selection" width="55" align="center" />
<template v-for="(item, index) in tableColumns">
<el-table-column
v-if="item.show"
:key="index"
:prop="item.prop"
:label="item.label"
:formatter="item.formatter"
align="center"
show-overflow-tooltip
/>
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="medium"
type="text"
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<!-- 模态框查看详情-->
<el-dialog title="Job实例列表详细" :visible.sync="dialogFormVisible" width="1000px">
<div style="text-align: center;font-size: 18pt;margin-bottom: 20px">量级对比</div>
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="180px">
<div style="display: flex;align-items: center;justify-content: center">
<el-form-item style="width: 70%;" label="源表" prop="originTableName" required>
</el-form-item>
<el-form-item style="width: 70%" label="目标表" prop="originTablePrimary" required>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 70%" label="originTablePv" prop="originTablePv" required>
<el-input v-model="temp.originTablePv" style="width: 85%" disabled/>
</el-form-item>
<el-form-item style="width: 70%" label="toTablePv" prop="toTablePv" required>
<el-input v-model="temp.toTablePv" style="width: 85%" disabled/>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 70%" label="originTableUv" prop="originTableUv" required>
<el-input v-model="temp.originTableUv" style="width: 85%" disabled/>
</el-form-item>
<el-form-item style="width: 70%" label="toTableUv" prop="toTableUv" required>
<el-input v-model="temp.toTableUv" style="width: 85%" disabled/>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 70%" label="pvDiff" prop="pvDiff" required>
<el-input v-model="temp.pvDiff" style="width: 85%" disabled/>
</el-form-item>
<el-form-item style="width: 70%" label="uvDiff" prop="uvDiff" required>
<el-input v-model="temp.uvDiff" style="width: 85%" disabled/>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 95%" label="magnitudeSql" prop="magnitudeSql" required>
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 8}"
disabled
height="150"
v-model="temp.magnitudeSql">
</el-input>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 95%" label="量级是否通过" prop="magnitudeSql" required>
<el-input
disabled
height="150"
style="color:red"
:value="temp.pvDiff==0 &&temp.uvDiff==0 ? 'true':'false'"
>
</el-input>
</el-form-item>
</div>
<!--一致性对比-->
<div style="text-align: center;font-size: 18pt;margin-bottom: 20px">一致性对比</div>
<div style="display: flex">
<el-form-item style="width: 70%" label="originTableCount" prop="originTableCount" required>
<el-input v-model="temp.originTableCount" style="width: 85%" disabled/>
</el-form-item>
<el-form-item style="width: 70%" label="uvDiff" prop="uvDiff" required>
<el-input v-model="temp.uvDiff" style="width: 85%" disabled/>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 50%" label="countDiff" prop="countDiff" required>
<el-input v-model="temp.countDiff" style="width: 85%" disabled/>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 95%" label="magnitudeSql" prop="magnitudeSql" required>
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 8}"
disabled
height="150"
v-model="temp.consistencySql">
</el-input>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item style="width: 95%" label="一致性是否通过" prop="magnitudeSql" required>
<el-input
disabled
height="150"
style="color:red"
:value="temp.countDiff == temp.originTableCount && temp.countDiff == temp.toTableCount ? 'true':'false'"
>
</el-input>
</el-form-item>
</div>
</el-form>
<div style="text-align: center;margin: 10px 0">
<el-button style="font-size: 16pt;background-color: #13ce66;border-radius: 5px" @click="getDiffDetail(temp.id)">
查看差异
</el-button>
</div>
</el-dialog>
<!-- 模态框查看差异-->
<el-dialog title="差异case" :visible.sync="dialogFormVisible2" width="1000px">
<el-table
:data="tableData"
style="width: 100%;"
height="250"
stripe
>
<el-table-column
prop="base_dict_code"
label="base_dict_code"
width="140">
</el-table-column>
<el-table-column
prop="base_dict_label"
label="base_dict_label"
width="140">
</el-table-column>
<el-table-column
prop="verify_dict_label"
label="verify_dict_label"
width="140">
</el-table-column>
<el-table-column
prop="dict_label_is_pass"
label="dict_label_is_pass"
width="140">
</el-table-column>
<el-table-column
prop="base_dict_value"
label="base_dict_value"
width="140">
</el-table-column>
<el-table-column
prop="verify_dict_value"
label="verify_dict_value"
width="140">
</el-table-column>
<el-table-column
prop="dict_value_is_pass"
label="dict_value_is_pass"
width="140">
</el-table-column>
</el-table>
</el-dialog>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
</template>
<script>
import { pageDataModel, getDiffDetail } from '@/api/compare/dcJobInstance/datamodel'
export default {
name: 'DcJobInstanceList',
data() {
return {
tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换
showOptions: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
},
// 遮罩层
loading: true,
dialogFormVisible: false,
dialogFormVisible2: false,
textMap: {
update: '编辑Job配置',
detail: 'Jobconfig详情'
},
dialogStatus: '',
// 表单提交内容
temp: {
id: '',
originTablePv: '',
toTablePv: '',
originTableUv: '',
toTableUv: '',
pvDiff: '',
uvDiff: '',
magnitudeSql: '',
countDiff: '',
originTableCount: '',
consistencySql: ''
},
// 规则
rules: {
name: [{ required: true, message: '不能为空', trigger: 'blur' }],
description: [{ required: true, message: '不能为空', trigger: 'blur' }]
},
// 表格头
tableColumns: [
{ prop: 'id', label: 'id', show: true },
{ prop: 'jobconfigId', label: 'jobconfigId', show: true },
{ prop: 'originTableName', label: 'originTableName', show: true },
{
prop: 'toTableName',
label: 'toTableName',
show: true
},
{ prop: 'countDiff', label: '量级校验通过', show: true,
formatter: function (value, row, index) {
if (value.pvDiff == '0' && value.uvDiff == '0') {
return '是'
} else {
return '否'
}
}
},
{ prop: 'countDiff', label: '一致性校验通过', show: true,
formatter: function (value, row, index) {
if (value.countDiff == value.originTableCount && value.countDiff == value.toTableCount) {
return '是'
} else {
return '否'
}
}
},
{ prop: 'createTime', label: '创建时间', show: true }
],
// 默认选择中表格头
checkedTableColumns: [],
tableSize: 'medium',
// 状态数据字典
statusOptions: [],
// 表格数据
tableDataList: [],
// 总数据条数
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
jobconfigId: ''
},
// 流程状态数据字典
flowStatusOptions: [],
// 查看差异数组
tableData: []
}
},
created() {
this.getDicts('sys_common_status').then(response => {
if (response.success) {
this.statusOptions = response.data
}
})
this.getDicts('sys_flow_status').then(response => {
if (response.success) {
this.flowStatusOptions = response.data
}
})
this.getList()
},
mounted() {
this.initCols()
},
methods: {
/** 查询数据源列表 */
getList() {
const _this = this
// console.log("hello world1")
_this.loading = true
pageDataModel(this.queryParams).then(response => {
_this.loading = false
if (response.code ===0) {
_this.tableDataList = response.rows
_this.total = response.total
}
})
},
initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop)
},
handleCheckedColsChange(val) {
this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false
} else {
col.show = true
}
})
},
handleCommand(command) {
this.tableSize = command
},
// 查看差异
getDiffDetail(id) {
console.log('查看差异', id)
const _this = this
// console.log("hello world1")
_this.loading = true
getDiffDetail(id).then(response => {
_this.loading = false
console.log('response', response)
if (response.code ===0) {
for (let i = 0; i < response.total; i++) {
let array = {
base_dict_code: '--',
base_dict_label: '--',
verify_dict_label: '--',
dict_label_is_pass: '--',
base_dict_value: '--',
verify_dict_value: '--',
dict_value_is_pass: '--'
}
array.base_dict_code = response.rows[i].base_dict_code || '--'
array.base_dict_label = response.rows[i].base_dict_label || '--'
array.verify_dict_label = response.rows[i].verify_dict_label || '--'
array.dict_label_is_pass = response.rows[i].dict_label_is_pass || '--'
array.base_dict_value = response.rows[i].base_dict_value || '--'
array.verify_dict_value = response.rows[i].verify_dict_value || '--'
array.dict_value_is_pass = response.rows[i].dict_value_is_pass || '--'
console.log('array', array)
_this.tableData.push(array)
}
this.dialogFormVisible2 = true
}
})
},
/** 详情按钮操作 */
handleDetail(row) {
console.log(row)
console.log('详情展开')
this.temp = Object.assign({}, row)
this.dialogStatus = 'detail'
this.dialogFormVisible = true
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 20,
jobconfigId: ''
}
this.handleQuery()
},
/** 刷新列表 */
handleRefresh() {
this.getList()
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.queryParams.pageNum = 1
this.queryParams.pageSize = val
this.getList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.right-toolbar {
float: right;
}
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@@ -0,0 +1,37 @@
<template>
<div className="app-container">
<transition name="el-zoom-in-center">
<dc-job-log-list v-if="options.showList" @showCard="showCard" />
</transition>
</div>
</template>
<script>
import dcJobLogList from './dcJobLogList'
export default {
name: 'DcJobLog',
components: { dcJobLogList },
data() {
return {
options: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
}
}
},
methods: {
showCard(data) {
Object.assign(this.options, data)
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,301 @@
<template>
<el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="jobLogId" prop="jobLogId">
<el-input
v-model="queryParams.jobLogId"
placeholder="jobLogId"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableDataList"
border
tooltip-effect="dark"
:size="tableSize"
:height="tableHeight"
style="width: 100%;margin: 15px 0;"
>
<el-table-column type="selection" width="55" align="center" />
<template v-for="(item, index) in tableColumns">
<el-table-column
v-if="item.show"
:key="index"
:prop="item.prop"
:label="item.label"
:formatter="item.formatter"
align="center"
show-overflow-tooltip
/>
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popover
placement="left"
trigger="click"
>
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button slot="reference">操作</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 模态框添加数据-->
<el-dialog title="调度日志详情" :visible.sync="dialogFormVisible" width="800px">
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="150px">
<el-form-item label="日志编号" prop="jobLogId" required>
<el-input v-model="temp.jobLogId" style="width: 70%" />
</el-form-item>
<el-form-item label="任务名称" prop="jobName" required>
<el-input v-model="temp.jobName" style="width: 70%" />
</el-form-item>
<el-form-item label="源表主键" prop="jobGroup" required>
<el-input v-model="temp.jobGroup" style="width: 70%" />
</el-form-item>
<el-form-item label="调用目标字符串" prop="invokeTarget">
<el-input v-model="temp.invokeTarget" style="width: 70%" />
</el-form-item>
<el-form-item label="日志信息" prop="jobMessage">
<el-input v-model="temp.jobMessage" style="width: 70%" />
</el-form-item>
<el-form-item label="状态" prop="status" required>
<el-input v-model="temp.status" placeholder="目标表" disabled style="width: 70%" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
确认
</el-button>
</div>
</el-dialog>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
</template>
<script>
import { pageDataModel, delDataModel } from '@/api/compare/dcJobLog/datamodel'
export default {
name: 'DcJobLogList',
data() {
return {
tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换
showOptions: {
data: {},
showList: true,
showAdd: false,
showEdit: false,
showDetail: false
},
// 遮罩层
loading: true,
dialogFormVisible: false,
dialogFormVisible2: false,
dialogStatus: '',
temp: {
jobLogId: '',
jobName: '',
jobGroup: '',
invokeTarget: '',
jobMessage: '',
status: ''
},
rules: {
name: [{ required: true, message: '不能为空', trigger: 'blur' }],
description: [{ required: true, message: '不能为空', trigger: 'blur' }]
},
// 表格头
tableColumns: [
{ prop: 'jobLogId', label: '日志编号', show: true },
{ prop: 'jobName', label: '任务名称', show: true },
{ prop: 'jobGroup', label: '源表主键', show: true },
{
prop: 'invokeTarget',
label: '调用目标字符串',
show: true
},
{
prop: 'jobMessage',
label: '日志信息',
show: true
},
{ prop: 'status', label: '状态', show: true,
formatter: function (value, row, index) {
if (value.status==0) {
return '成功'
} else {
return '失败'
}
}}
],
// 默认选择中表格头
checkedTableColumns: [],
tableSize: 'medium',
// 状态数据字典
statusOptions: [],
// 表格数据
tableDataList: [],
// 总数据条数
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
jobLogId: ''
},
// 流程状态数据字典
flowStatusOptions: []
}
},
created() {
this.getDicts('sys_common_status').then(response => {
if (response.success) {
this.statusOptions = response.data
}
})
this.getDicts('sys_flow_status').then(response => {
if (response.success) {
this.flowStatusOptions = response.data
}
})
this.getList()
},
mounted() {
this.initCols()
},
methods: {
/** 查询数据源列表 */
getList() {
const _this = this
// console.log("hello world1")
_this.loading = true
pageDataModel(this.queryParams).then(response => {
// console.log("hello world2")
// console.log(response.total)
// console.log(response.code)
_this.loading = false
if (response.code ===0) {
_this.tableDataList = response.rows
_this.total = response.total
// console.log("hello world3")
// console.log(_this.tableDataList)
// console.log(_this.total)
}
})
},
initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop)
},
handleCheckedColsChange(val) {
this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false
} else {
col.show = true
}
})
},
handleCommand(command) {
this.tableSize = command
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 20,
jobLogId: ''
}
this.handleQuery()
},
/** 刷新列表 */
handleRefresh() {
this.getList()
},
/** 详情按钮操作 */
handleDetail(row) {
this.temp = Object.assign({}, row) // copy obj
console.log(row)
if (row.status == 0) {
this.temp.status = '成功'
} else {
this.temp.status = '失败'
}
this.dialogStatus = 'detail'
this.dialogFormVisible = true
},
/** 删除按钮操作 */
handleDelete(row) {
console.log('进入到删除按钮操作')
console.log(row)
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataModel(row.jobLogId).then(response => {
console.log(response)
if (response.code ===0) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
this.queryParams.pageNum = 1
this.queryParams.pageSize = val
this.getList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.queryParams.pageNum = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.right-toolbar {
float: right;
}
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style>