提交临时界面

This commit is contained in:
wangchengming 2025-04-20 20:42:07 +08:00
parent 8241ccfc0a
commit 00ecdc80bf
10 changed files with 2010 additions and 0 deletions

View File

@ -0,0 +1,238 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
</a-col>
<!-- <a-col :md="6" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col> -->
</a-row>
</a-form>
</div>
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
export default {
name: "missingvalueRules",
components: {
rulesModel
},
data() {
return {
moment,
loading: false,
//
queryParam: {
dataType: 'biandui',
tableName: null,
pageNum: 1,
pageSize: 10
},
pagination: {
defaultCurrent: 1, //
defaultPageSize: 10, // total: 0, //
showSizeChanger: true,
showQuickJumper: false,
pageSizeOptions: ['10', '20', '30'],
showTotal: total => `总共 ${total} 个项目`, //
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
},
dataTypeList: [],
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '报文名称',
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
},
handleTypeChange(value) {
this.queryParam.dataType = value
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
this.queryParam.pageNum = pagination.current - 1
this.queryParam.pageSize = pagination.pageSize
this.getQueryPage()
},
getQueryPage() {
queryPage(this.queryParam).then(res => {
if (res.code == 200) {
const pagination = { ...this.pagination }
pagination.total = res.result.total
this.dataSource = res.result.rows
this.pagination = pagination
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -0,0 +1,164 @@
<template>
<a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
@cancel="handleCancel" okText="保存" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="ruleForm" :model="form" :rules="rules">
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
<a-input v-model="form.tableName" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="字符串策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
export default {
name: "rulesModal",
components: {
JCron,
JSelectMultiple
},
data() {
return {
title: "操作",
visible: false,
model: {},
confirmLoading: false,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
},
eidt(record) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.visible = true;
},
close() {
this.visible = false;
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true;
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
} else {
updateRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
}
}
});
},
handleCancel() {
this.close()
},
}
}
</script>
<style scoped></style>

View File

@ -0,0 +1,238 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
</a-col>
<!-- <a-col :md="6" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col> -->
</a-row>
</a-form>
</div>
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
export default {
name: "missingvalueRules",
components: {
rulesModel
},
data() {
return {
moment,
loading: false,
//
queryParam: {
dataType: 'biandui',
tableName: null,
pageNum: 1,
pageSize: 10
},
pagination: {
defaultCurrent: 1, //
defaultPageSize: 10, // total: 0, //
showSizeChanger: true,
showQuickJumper: false,
pageSizeOptions: ['10', '20', '30'],
showTotal: total => `总共 ${total} 个项目`, //
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
},
dataTypeList: [],
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '报文名称',
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
},
handleTypeChange(value) {
this.queryParam.dataType = value
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
this.queryParam.pageNum = pagination.current - 1
this.queryParam.pageSize = pagination.pageSize
this.getQueryPage()
},
getQueryPage() {
queryPage(this.queryParam).then(res => {
if (res.code == 200) {
const pagination = { ...this.pagination }
pagination.total = res.result.total
this.dataSource = res.result.rows
this.pagination = pagination
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -0,0 +1,164 @@
<template>
<a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
@cancel="handleCancel" okText="保存" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="ruleForm" :model="form" :rules="rules">
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
<a-input v-model="form.tableName" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="字符串策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
export default {
name: "rulesModal",
components: {
JCron,
JSelectMultiple
},
data() {
return {
title: "操作",
visible: false,
model: {},
confirmLoading: false,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
},
eidt(record) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.visible = true;
},
close() {
this.visible = false;
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true;
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
} else {
updateRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
}
}
});
},
handleCancel() {
this.close()
},
}
}
</script>
<style scoped></style>

View File

@ -0,0 +1,238 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
</a-col>
<!-- <a-col :md="6" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col> -->
</a-row>
</a-form>
</div>
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
export default {
name: "tempOne",
components: {
rulesModel
},
data() {
return {
moment,
loading: false,
//
queryParam: {
dataType: 'biandui',
tableName: null,
pageNum: 1,
pageSize: 10
},
pagination: {
defaultCurrent: 1, //
defaultPageSize: 10, // total: 0, //
showSizeChanger: true,
showQuickJumper: false,
pageSizeOptions: ['10', '20', '30'],
showTotal: total => `总共 ${total} 个项目`, //
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
},
dataTypeList: [],
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '报文名称',
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
},
handleTypeChange(value) {
this.queryParam.dataType = value
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
this.queryParam.pageNum = pagination.current - 1
this.queryParam.pageSize = pagination.pageSize
this.getQueryPage()
},
getQueryPage() {
queryPage(this.queryParam).then(res => {
if (res.code == 200) {
const pagination = { ...this.pagination }
pagination.total = res.result.total
this.dataSource = res.result.rows
this.pagination = pagination
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -0,0 +1,164 @@
<template>
<a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
@cancel="handleCancel" okText="保存" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="ruleForm" :model="form" :rules="rules">
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
<a-input v-model="form.tableName" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="字符串策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
export default {
name: "rulesModal",
components: {
JCron,
JSelectMultiple
},
data() {
return {
title: "操作",
visible: false,
model: {},
confirmLoading: false,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
},
eidt(record) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.visible = true;
},
close() {
this.visible = false;
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true;
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
} else {
updateRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
}
}
});
},
handleCancel() {
this.close()
},
}
}
</script>
<style scoped></style>

View File

@ -0,0 +1,238 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
</a-col>
<!-- <a-col :md="6" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col> -->
</a-row>
</a-form>
</div>
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
export default {
name: "missingvalueRules",
components: {
rulesModel
},
data() {
return {
moment,
loading: false,
//
queryParam: {
dataType: 'biandui',
tableName: null,
pageNum: 1,
pageSize: 10
},
pagination: {
defaultCurrent: 1, //
defaultPageSize: 10, // total: 0, //
showSizeChanger: true,
showQuickJumper: false,
pageSizeOptions: ['10', '20', '30'],
showTotal: total => `总共 ${total} 个项目`, //
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
},
dataTypeList: [],
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '报文名称',
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
},
handleTypeChange(value) {
this.queryParam.dataType = value
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
this.queryParam.pageNum = pagination.current - 1
this.queryParam.pageSize = pagination.pageSize
this.getQueryPage()
},
getQueryPage() {
queryPage(this.queryParam).then(res => {
if (res.code == 200) {
const pagination = { ...this.pagination }
pagination.total = res.result.total
this.dataSource = res.result.rows
this.pagination = pagination
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -0,0 +1,164 @@
<template>
<a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
@cancel="handleCancel" okText="保存" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="ruleForm" :model="form" :rules="rules">
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
<a-input v-model="form.tableName" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="字符串策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
export default {
name: "rulesModal",
components: {
JCron,
JSelectMultiple
},
data() {
return {
title: "操作",
visible: false,
model: {},
confirmLoading: false,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
},
eidt(record) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.visible = true;
},
close() {
this.visible = false;
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true;
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
} else {
updateRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
}
}
});
},
handleCancel() {
this.close()
},
}
}
</script>
<style scoped></style>

View File

@ -0,0 +1,238 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="30">
<a-col :md="20">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
</span>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据类型">
<a-select placeholder="选择数据类型" option-filter-prop="children" size="large"
v-model="queryParam.dataType" @change="handleTypeChange">
<a-select-option v-for="item in dataTypeList" :value="item.enName">
{{ item.cnName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" icon="search" @click="getQueryPage">查询</a-button>
</a-col>
<!-- <a-col :md="6" :sm="24" style="text-align: right;">
<a-button type="primary" style="right: 10px" icon="plus" @click="handleAdd">新建</a-button>
</a-col> -->
</a-row>
</a-form>
</div>
<a-row :gutter="30" style="padding: 0 10px;">
<a-col :md="24">
<div class="linese"></div>
<!-- 表格区域 -->
<div style="height:calc(100vh - 316px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
:pagination="pagination" :scroll="{ y: 'calc(100vh - 380px)' }" rowKey="id"
@change="handleTableChange">
<!-- <span slot="createTime" slot-scope="text, record">
{{ moment(text).format('YYYY-MM-DD') }}
</span> -->
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">配置</a>
<a-divider v-if="record.id" type="vertical" />
<a v-if="record.id" @click="handleRemove(record.id)">删除</a>
</span>
</a-table>
</div>
<div class="linese"></div>
</a-col>
</a-row>
<rulesModel ref="modalForm" @fatherMethod="getQueryPage" />
</a-card>
</template>
<script>
import moment from 'moment'
import { deleteRules, queryPage } from '@/api/missingvalueRules'
import { dataTypeQueryAll } from '@/api/dataType'
import rulesModel from './rulesModel.vue'
export default {
name: "missingvalueRules",
components: {
rulesModel
},
data() {
return {
moment,
loading: false,
//
queryParam: {
dataType: 'biandui',
tableName: null,
pageNum: 1,
pageSize: 10
},
pagination: {
defaultCurrent: 1, //
defaultPageSize: 10, // total: 0, //
showSizeChanger: true,
showQuickJumper: false,
pageSizeOptions: ['10', '20', '30'],
showTotal: total => `总共 ${total} 个项目`, //
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
},
dataTypeList: [],
dataSource: [],
columns: [
{
title: '序号',
width: 70,
customRender: (text, record, index) => `${index + 1}`,
},
{
title: '表名',
align: "center",
dataIndex: 'tableName',
},
{
title: '报文名称',
align: "center",
dataIndex: 'msgName',
},
// {
// title: '',
// align: "center",
// width: 110,
// dataIndex: 'stringStrategy',
// },
{
title: '字符串策略',
align: "center",
dataIndex: 'stringStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'digitStrategy',
// },
{
title: '数值策略',
align: "center",
dataIndex: 'digitStrategyDescribe',
},
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'dateTimeStrategy',
// },
{
title: '时间策略',
align: "center",
dataIndex: 'dateTimeStrategyDescribe',
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' },
},
{
title: '操作',
key: 'action',
width: 130,
align: "center",
scopedSlots: { customRender: 'action' },
},
]
}
},
mounted() {
},
computed: {
},
created() {
this.getQueryPage()
this.getDataType()
},
methods: {
getDataType() {
dataTypeQueryAll().then(res => {
if (res.code == 200) this.dataTypeList = res.result
})
},
handleTypeChange(value) {
this.queryParam.dataType = value
},
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
this.queryParam.pageNum = pagination.current - 1
this.queryParam.pageSize = pagination.pageSize
this.getQueryPage()
},
getQueryPage() {
queryPage(this.queryParam).then(res => {
if (res.code == 200) {
const pagination = { ...this.pagination }
pagination.total = res.result.total
this.dataSource = res.result.rows
this.pagination = pagination
} else {
this.$notification.error({
message: '系统提示',
description: res.message
})
}
})
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
},
handleEdit(record) {
this.$refs.modalForm.eidt(record);
this.$refs.modalForm.title = "配置";
},
handleRemove(recordId) {
console.log('dfs', recordId)
const _that = this
_that.$confirm({
title: '你确认执行删除操作吗?',
okText: '确认',
cancelText: '取消',
onOk() {
console.log('dfs', recordId)
deleteRules({ id: recordId }).then(res => {
if (res.code === 200) {
_that.$notification.success({
message: '系统提示',
description: res.message
})
_that.getQueryPage()
} else {
_that.$notification.warning({
message: '系统提示',
description: res.message
})
}
})
},
onCancel() { }
})
}
}
}
</script>

View File

@ -0,0 +1,164 @@
<template>
<a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
@cancel="handleCancel" okText="保存" cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="ruleForm" :model="form" :rules="rules">
<a-form-model-item label="表名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tableName">
<a-input v-model="form.tableName" placeholder="请输入"></a-input>
</a-form-model-item>
<a-form-model-item label="字符串策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stringStrategy">
<a-select v-model="form.stringStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4"></a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="数值策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="digitStrategy">
<a-select v-model="form.digitStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">复制上条数据</a-select-option>
<a-select-option :value="3">复制下条数据</a-select-option>
<a-select-option :value="4">前后均值填充</a-select-option>
<a-select-option :value="5">填0</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="时间策略" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateTimeStrategy">
<a-select v-model="form.dateTimeStrategy">
<a-select-option :value="1">直接删除</a-select-option>
<a-select-option :value="2">前后均值填充</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import JCron from "@/components/jeecg/JCron";
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import { createRules, updateRules, queryById } from '@/api/missingvalueRules'
export default {
name: "rulesModal",
components: {
JCron,
JSelectMultiple
},
data() {
return {
title: "操作",
visible: false,
model: {},
confirmLoading: false,
form: {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
},
rules: {
tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }],
stringStrategy: [{ required: true, message: '请选择字符串策略', trigger: 'change' }],
digitStrategy: [{ required: true, message: '请选择数值策略', trigger: 'change' }],
dateTimeStrategy: [{ required: true, message: '请选择时间策略', trigger: 'change' }]
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
treeData: []
}
},
created() {
},
methods: {
add() {
this.form = {
tableName: null,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
this.visible = true;
},
eidt(record) {
if (record.id) {
queryById({ id: record.id }).then(res => {
if (res.code == 200) {
this.form = res.result
}
})
} else {
this.form = {
id: null,
tableName: record.tableName,
stringStrategy: null,
digitStrategy: null,
dateTimeStrategy: null
}
}
this.visible = true;
},
close() {
this.visible = false;
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true;
if (!this.form.id) {
createRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
} else {
updateRules(this.form).then(res => {
if (res.code === 200) {
this.$notification.success({
message: '系统提示',
description: res.message
})
this.confirmLoading = false
this.$emit('fatherMethod')
this.handleCancel()
} else {
this.$notification.error({
message: '系统提示',
description: '操作失败'
})
this.confirmLoading = false
}
})
}
}
});
},
handleCancel() {
this.close()
},
}
}
</script>
<style scoped></style>