[update] 同步上报库

This commit is contained in:
zhaomeijing
2022-06-02 15:17:38 +08:00
parent 16828639b4
commit 17b4d5c17d
2 changed files with 226 additions and 16 deletions
@@ -0,0 +1,165 @@
<template>
<div class='diolag-area'>
<a-spin :spinning='spinLoading'>
<a-form-model
class='tag-module'
ref='ruleForm'
:model='formInline'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='20'>
<div>是否同步选中行数据至上报库?</div>
<div>同步后的参数项将不可修改,仅能重新下发收集,已更新参数</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class='drawer-bootom-button' style='margin-top: 20px'>
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>
</div>
</div>
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
selectedRowKeysDate: {},
loading: false,
editId: '',
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
formInline: {},
rules: {},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
fromDate: [],
fromDateTo: [],
}
},
props: {
paramsManifest: {
type: Object,
default: {},
require: true
},
selectedRowKeysArray: {
type: String,
default: '',
require: true
}
},
mounted() {},
methods: {
searchQuery() {
this.loadData()
},
searchReset() {
this.form = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisible', false)
},
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
},
handleTableChange(val) {
},
// 引用参数确定
handleSubmit() {
let _this = this
let param = {ids: this.selectedRowKeysArray, paramsManifestId: this.paramsManifest.id }
axios({
url: '/jero-boot/params/collectManifest/syncReport',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
if (res.data.success) {
_this.$message.success(res.data.result)
this.$emit('areaVisibsynchronous', false)
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
}
}
}
</script>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit {
margin-right: 10px;
}
}
.table-del {
color: red;
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
.page{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>