[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 style="width: 100%">
<a-table
ref="table"
:loading="loading"
:pagination="false"
:scroll="{x: true}"
rowKey="id"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
class='table-area'
ref='table'
size='middle'
rowKey='id'
:columns='columns'
:dataSource='dataSource'
:pagination='false'
: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">
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span>
</a-table>
</div>
@@ -61,7 +75,7 @@
/>
</div>
<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-card>
</template>
@@ -144,6 +158,16 @@
this.getlist()
},
methods:{
deleteLib() {
},
handleTableChange() {
},
handleCancel(val) {
this.areaVisible = val
this.getlist()
},
searchQuery() {
this.pageNo = 1
this.getlist()
@@ -153,8 +177,8 @@
this.pageNo = 1
this.getlist()
},
onSelectChange() {
onSelectChange(val,valdate) {
this.selectedRowKeys = val
},
edit(edit){
@@ -11,9 +11,9 @@
>
<a-row :gutter='24'>
<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'
v-model='title' />
v-model='templatetitle' />
</a-form-model-item>
</a-col>
<a-col :span='9'>
@@ -77,9 +77,11 @@ export default {
components: {},
data() {
return {
templatetitle: '',
title: this.$t('add'),
total: 0,
selectedRowKeys: [],
selectedRowKeysDate: {},
loading: false,
ipagination: true,
editId: '',
@@ -109,10 +111,9 @@ export default {
},
form: {},
rules: {
title: [
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' },
{ min: 1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' }
]
// templatetitle: [
// { required: true, message: this.$t('enterTitle'), trigger: 'blur' }
// ]
},
areaTable: [],
flag: false, //表单提交标识
@@ -147,17 +148,13 @@ export default {
this.loadData()
},
handleCancel() {
this.$emit('areaVisible',false)
},
handleSubmit() {
},
onSelectChange(selectedRowKeys) {
// console.log('selectedRowKeys changed: ', selectedRowKeys);
onSelectChange(selectedRowKeys,selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
},
handleTableChange() {
handleTableChange(val) {
},
showModal() {
this.title = this.$t('add')
@@ -165,74 +162,85 @@ export default {
this.form = {}
},
//新增
hideModal() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
//编辑
if (this.form.id) {
putAction(`tag/onlCgformArea/edit`, this.form).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loadData()
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
} else {
this.$message.warning(res.message)
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
}
}).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
})
} else {
//新增
postAction(`/tag/onlCgformArea/add`, this.form).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loadData()
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
handleSubmit() {
if(this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if(this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
//编辑
if (this.form.id) {
// putAction(`tag/onlCgformArea/edit`, this.form).then((res) => {
// if (res.success) {
// this.$message.success(this.$t('OperationSuccessful'))
// this.loadData()
// this.form = {
// isModel: '',
// showArea: '',
// enName: '',
// sort: ''
// }
// } else {
// this.$message.warning(res.message)
// this.form = {
// isModel: '',
// showArea: '',
// enName: '',
// sort: ''
// }
// }
// }).finally(() => {
// this.flag = false
// this.spinLoading = false
// this.newVisible = false
// this.form = {
// isModel: '',
// showArea: '',
// enName: '',
// sort: ''
// }
// })
} else {
// 新增之前 判断 标题唯一
getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}&title=${this.templatetitle}`, {}).then(res => {
if (res.success) {
console.log(this.selectedRowKeys[0])
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 {
// this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
}).finally(() => {
this.loading = false
})
}
} else {
return false
}
} else {
// console.log('error submit!!');
return false
}
})
})
}
},
cancelModel() {
this.newVisible = false