[add] 提交

This commit is contained in:
zhaomeijing
2022-05-17 15:37:00 +08:00
parent 6def673d9e
commit c611c25bb4
@@ -127,6 +127,38 @@
<a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null">
<parameter-library v-if='areaVisible' :paramsManifest='paramsManifest'/>
</a-modal>
<!-- 冻结配置--->
<a-modal v-model="areaVisibleFreeze" :title="$t('FreezeConfiguration')" width='750px' :footer="null">
<a-form-model
class='tag-module'
ref='ruleForm'
:model='Dateline'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='12'>
<a-form-model-item ref='region' :label="$t('FreezeConfiguration')" prop='region'>
<a-select :placeholder="$t('PleaseSelect')+$t('FreezeConfiguration')" v-model="Dateline.querySdt">
<a-select-option v-for="(item, key) in querySdtList" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmitFreeze" v-has="'split:sarFileSplitItems:importSplitResult'">{{$t('preservation')}}</a-button>
<a-button class="imports-btn" type="primary" @click="cancleImportsFreeze">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
</a-card>
</template>
@@ -222,6 +254,17 @@ export default {
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
Dateline: {},
areaVisibleFreeze: false, // 冻结配置
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
rules: {}
}
},
props: {
@@ -283,11 +326,52 @@ export default {
},
// 冻结配置
freezeConfiguration() {
// 先判断是否有权限
let permission = this.permission()
if(permission) {
console.log('拥有冻结配置权限')
}
this.areaVisibleFreeze = true
// 获取冻结配置数据
this.getFreeze()
},
// 冻结配置提交
handleSubmitFreeze() {
this.areaVisibleFreeze = false
},
// 冻结配置取消
cancleImportsFreeze() {
this.areaVisibleFreeze = false
},
getFreeze() {
let _this = this
console.log(this.paramsManifest,'this.paramsManifest,')
let param = {paramsManifestId: this.$route.query.id, configFlag: 2}
axios({
url: '/jero-boot/params/collectManifest/getConfigLableList',
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) =>{
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
_this.areaVisible = false
_this.getTableList()
_this.selectedRowKeysValue=[]
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
},
// 下发收集
distributionAndCollection() {
@@ -346,8 +430,10 @@ export default {
this.selectedRowKeysValue.forEach((item, index) => {
let postDateobj = {}
Object.keys(item).forEach((itemIn, index) => {
if(item[itemIn] instanceof Object) {
postDateobj[itemIn] = item[itemIn]
if(itemIn !== 'sdt') {
if(item[itemIn] instanceof Object) {
postDateobj[itemIn] = item[itemIn]
}
}
})
postDateobj.id = item.id
@@ -360,7 +446,6 @@ export default {
postAction(this.url.add, configDataList).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
// _this.getlist()
} else {
this.$message.warning(this.$t('operationFailed'))
}