[add] 认证参数收集

This commit is contained in:
zhaomeijing
2022-05-06 18:16:37 +08:00
parent 9cbc17ec4a
commit e3a509ecbb
2 changed files with 124 additions and 92 deletions
@@ -35,17 +35,31 @@
</div> </div>
<div style="width: 100%"> <div style="width: 100%">
<a-table <a-table
ref="table" class='table-area'
:loading="loading" ref='table'
:pagination="false" size='middle'
:scroll="{x: true}" rowKey='id'
rowKey="id" :columns='columns'
:data-source="dataSource" :dataSource='dataSource'
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination='false'
:columns="columns" :loading='loading'
> :scroll='{x: 600}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<!-- <a-table-->
<!-- ref="table"-->
<!-- :loading="loading"-->
<!-- :pagination="false"-->
<!-- :scroll="{x: true}"-->
<!-- rowKey="id"-->
<!-- :data-source="dataSource"-->
<!-- :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"-->
<!-- :columns="columns"-->
<!-- @change='handleTableChange'-->
<!-- >-->
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a> <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span> </span>
</a-table> </a-table>
</div> </div>
@@ -61,7 +75,7 @@
/> />
</div> </div>
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null"> <a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null">
<parameter-template v-if='areaVisible'></parameter-template> <parameter-template v-if='areaVisible' @areaVisible='handleCancel'></parameter-template>
</a-modal> </a-modal>
</a-card> </a-card>
</template> </template>
@@ -144,6 +158,16 @@
this.getlist() this.getlist()
}, },
methods:{ methods:{
deleteLib() {
},
handleTableChange() {
},
handleCancel(val) {
this.areaVisible = val
this.getlist()
},
searchQuery() { searchQuery() {
this.pageNo = 1 this.pageNo = 1
this.getlist() this.getlist()
@@ -153,8 +177,8 @@
this.pageNo = 1 this.pageNo = 1
this.getlist() this.getlist()
}, },
onSelectChange() { onSelectChange(val,valdate) {
this.selectedRowKeys = val
}, },
edit(edit){ edit(edit){
@@ -11,9 +11,9 @@
> >
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='9'> <a-col :span='9'>
<a-form-model-item :label="$t('title')" prop='title'> <a-form-model-item :label="$t('title')" prop='templatetitle' :rules='rules'>
<a-input style='width: 420px' <a-input style='width: 420px'
v-model='title' /> v-model='templatetitle' />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span='9'> <a-col :span='9'>
@@ -77,9 +77,11 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
templatetitle: '',
title: this.$t('add'), title: this.$t('add'),
total: 0, total: 0,
selectedRowKeys: [], selectedRowKeys: [],
selectedRowKeysDate: {},
loading: false, loading: false,
ipagination: true, ipagination: true,
editId: '', editId: '',
@@ -109,10 +111,9 @@ export default {
}, },
form: {}, form: {},
rules: { rules: {
title: [ // templatetitle: [
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' }, // { required: true, message: this.$t('enterTitle'), trigger: 'blur' }
{ min: 1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' } // ]
]
}, },
areaTable: [], areaTable: [],
flag: false, //表单提交标识 flag: false, //表单提交标识
@@ -147,17 +148,13 @@ export default {
this.loadData() this.loadData()
}, },
handleCancel() { handleCancel() {
this.$emit('areaVisible',false)
}, },
handleSubmit() { onSelectChange(selectedRowKeys,selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
},
onSelectChange(selectedRowKeys) {
// console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
}, },
handleTableChange() { handleTableChange(val) {
}, },
showModal() { showModal() {
this.title = this.$t('add') this.title = this.$t('add')
@@ -165,74 +162,85 @@ export default {
this.form = {} this.form = {}
}, },
//新增 //新增
hideModal() { handleSubmit() {
this.$refs.ruleForm.validate(valid => { if(this.selectedRowKeys.length == 0) {
if (valid) { this.$message.warning(this.$t('pleaseSelectData'))
this.flag = true } else if(this.selectedRowKeys.length > 1) {
this.spinLoading = true this.$message.warning(this.$t('OnlyOneSelected'))
//编辑 } else {
if (this.form.id) { this.$refs.ruleForm.validate(valid => {
putAction(`tag/onlCgformArea/edit`, this.form).then((res) => { if (valid) {
if (res.success) { this.flag = true
this.$message.success(this.$t('OperationSuccessful')) this.spinLoading = true
this.loadData() //编辑
this.form = { if (this.form.id) {
isModel: '', // putAction(`tag/onlCgformArea/edit`, this.form).then((res) => {
showArea: '', // if (res.success) {
enName: '', // this.$message.success(this.$t('OperationSuccessful'))
sort: '' // this.loadData()
} // this.form = {
} else { // isModel: '',
this.$message.warning(res.message) // showArea: '',
this.form = { // enName: '',
isModel: '', // sort: ''
showArea: '', // }
enName: '', // } else {
sort: '' // this.$message.warning(res.message)
} // this.form = {
} // isModel: '',
}).finally(() => { // showArea: '',
this.flag = false // enName: '',
this.spinLoading = false // sort: ''
this.newVisible = false // }
this.form = { // }
isModel: '', // }).finally(() => {
showArea: '', // this.flag = false
enName: '', // this.spinLoading = false
sort: '' // this.newVisible = false
} // this.form = {
}) // isModel: '',
} else { // showArea: '',
//新增 // enName: '',
postAction(`/tag/onlCgformArea/add`, this.form).then(res => { // sort: ''
if (res.success) { // }
this.$message.success(this.$t('OperationSuccessful')) // })
this.loadData() } else {
this.form = { // 新增之前 判断 标题唯一
isModel: '', getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}&title=${this.templatetitle}`, {}).then(res => {
showArea: '', if (res.success) {
enName: '', console.log(this.selectedRowKeys[0])
sort: '' let postDate = {
title: this.templatetitle,
paramsTemplateId : this.selectedRowKeysDate[0].id,
paramsTemplatePublishVersion: this.selectedRowKeysDate[0].version
}
//新增
postAction(`params/manifest/add`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible',false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
} else {
this.$message.warning(res.message)
} }
} else { }).finally(() => {
// this.$message.warning(this.$t('operationFailed')) this.loading = false
this.$message.warning(res.message) })
}
} } else {
} return false
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
} }
})
} else { }
// console.log('error submit!!');
return false
}
})
}, },
cancelModel() { cancelModel() {
this.newVisible = false this.newVisible = false