[add] 接口对接

This commit is contained in:
zhaomeijing
2022-05-12 10:57:13 +08:00
parent e45c015b6e
commit f26adf46a2
2 changed files with 39 additions and 22 deletions
@@ -125,11 +125,10 @@ export default {
confirmLoading: false, confirmLoading: false,
templatetitle: '', templatetitle: '',
selectedRowKeys: [], selectedRowKeys: [],
ParameterCollectionRow: {}
} }
}, },
props: { props: {
authenticationParameterCollection: { paramsManifest: {
type: Object, type: Object,
default: {}, default: {},
require: true require: true
@@ -142,9 +141,9 @@ export default {
loadData() { loadData() {
this.loading = true this.loading = true
let _tt = { let _tt = {
paramsManifestId: this.ParameterCollectionRow.id, paramsManifestId: this.paramsManifest.id,
paramsTemplateId: this.ParameterCollectionRow.paramsTemplateId, paramsTemplateId: this.paramsManifest.paramsTemplateId,
paramsTemplatePublishVersion: this.ParameterCollectionRow.paramsTemplatePublishVersion paramsTemplatePublishVersion: this.paramsManifest.paramsTemplatePublishVersion
} }
let params = { let params = {
...this.form, ...this.form,
@@ -295,12 +294,9 @@ export default {
} }
}, },
watch: { watch: {
authenticationParameterCollection(val) { paramsManifest(val) {
this.ParameterCollectionRow = val this.loadData()
}, },
selectedRowKeyS(val) {
this.selectedRowKeys = val
}
} }
} }
@@ -124,7 +124,7 @@
</div> </div>
<!-- 添加 --> <!-- 添加 -->
<a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null"> <a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null">
<parameter-library v-if='areaVisible' @addselectedRowKeys='addselectedRowKeys' :authenticationParameterCollection='authenticationParameterCollection'/> <parameter-library v-if='areaVisible' :paramsManifest='paramsManifest'/>
</a-modal> </a-modal>
</a-card> </a-card>
</template> </template>
@@ -133,6 +133,9 @@
import TableCollection from '@/components/tableCollection/index' import TableCollection from '@/components/tableCollection/index'
import { getAction,postAction } from '../../../api/manage' import { getAction,postAction } from '../../../api/manage'
import ParameterLibrary from '@/components/ParameterLibrary/index' import ParameterLibrary from '@/components/ParameterLibrary/index'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
export default { export default {
name: 'ParameterItemCollectionList', name: 'ParameterItemCollectionList',
components:{ components:{
@@ -213,7 +216,7 @@ export default {
version: 0, version: 0,
itemId: '', itemId: '',
selectedRowKeysValue: [], selectedRowKeysValue: [],
authenticationParameterCollection: {}, token:Vue.ls.get(ACCESS_TOKEN),
} }
}, },
props: { props: {
@@ -223,10 +226,7 @@ export default {
require: true require: true
} }
}, },
mounted() { mounted() {},
this.authenticationParameterCollection = JSON.parse(localStorage.getItem('paramsManifest'))
// console.log(JSON.parse(localStorage.getItem('paramsManifest')))
},
methods:{ methods:{
addselectedRowKeys() { addselectedRowKeys() {
console.log('llll') console.log('llll')
@@ -293,14 +293,35 @@ export default {
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmBatchDeletion'), content: _this.$t('ConfirmBatchDeletion'),
onOk() { onOk() {
postAction(_this.url.deleteAll, param).then((res) => { axios({
if (res.success) { url: '/jero-boot/params/paramsInfo/deleteBatch',
_this.$message.success(_this.$t('OperationSuccessful')) method: 'post',
// _this.getlist() data: param,
} else { transformRequest: [function (data) {
_this.$message.warning(_this.$t('operationFailed')) 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(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.$refs.CollectionTabel.getData()
_this.$refs.CollectionTabel.getTableList()
}else{
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch( (error) =>{
console.log(error);
});
} }
}) })
} else { } else {