From 55abd749631340b7fca49325a1102e82f1bb8586 Mon Sep 17 00:00:00 2001
From: yunuo970428 <405378304@qq.com>
Date: Sat, 8 Oct 2022 11:57:58 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=95=B0=E6=8D=AE=E5=AD=97?=
=?UTF-8?q?=E5=85=B8--=E6=95=B0=E6=8D=AE=E6=98=A0=E5=B0=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/api/system/dictType/index.js | 8 ++--
.../src/views/dictManage/dictMap.vue | 40 +++++++++++--------
2 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/anrui-system-ui/src/api/system/dictType/index.js b/anrui-system-ui/src/api/system/dictType/index.js
index 0db9307174..501fea29e0 100644
--- a/anrui-system-ui/src/api/system/dictType/index.js
+++ b/anrui-system-ui/src/api/system/dictType/index.js
@@ -54,10 +54,12 @@ export function saveMappingList(data) {
}
// 数据字段--映射管理保存
-export function selectMappingListInfo(sid) {
+export function selectMappingListInfo(data) {
return request({
- url: '/portal/v1/sysmapping/selectMappingListInfo/' + sid,
- method: 'get',
+ url: '/portal/v1/sysmapping/selectMappingListInfo',
+ method: 'post',
+ data: data,
+ headers: { 'Content-Type': 'application/json', 'token': tokens }
})
}
diff --git a/anrui-system-ui/src/views/dictManage/dictMap.vue b/anrui-system-ui/src/views/dictManage/dictMap.vue
index 73d6ed96a3..ede63bc6ea 100644
--- a/anrui-system-ui/src/views/dictManage/dictMap.vue
+++ b/anrui-system-ui/src/views/dictManage/dictMap.vue
@@ -11,12 +11,12 @@
-
+
[{{ dictionariesKey }}+{{dictionariesValue}}]映射列表
添加
-
+
@@ -66,42 +66,43 @@ export default {
viewTitle: '数据字典-映射管理',
tableKey: 0,
index: 0,
- dictSid: '',
dictionariesKey: '',
dictionariesValue: '',
- list: [],
mappingsource_list: [],
- formobj: {},
+ formobj: {
+ userSid: '',
+ dictSid: '',
+ listDtos: []
+ },
submitdisabled: false
}
},
methods: {
showAdd(row) {
- this.dictSid = row.sid
+ this.formobj.dictSid = row.sid
this.dictionariesKey = row.dictType
this.dictionariesValue = row.dictValue
+ this.formobj.userSid = window.sessionStorage.getItem('userSid')
typeValues({ type: 'sys_mappingsource' }).then((resp) => {
if (resp.success) {
this.mappingsource_list = resp.data
}
})
- selectMappingListInfo(row.sid).then((resp) => {
+ selectMappingListInfo({ dictSid: row.sid }).then((resp) => {
if (resp.success) {
- this.list = resp.data
+ this.formobj.listDtos = resp.data
}
})
},
Add() {
- this.list.push({
- dictSid: this.dictSid,
+ this.formobj.listDtos.push({
map_item: '',
map_itemKey: '',
map_itemValue: '',
map_object: '',
map_sourceKey: '',
map_sourceValue: '',
- sid: '',
- userSid: window.sessionStorage.getItem('userSid')
+ sid: ''
})
},
changeSource(value, row) {
@@ -117,10 +118,14 @@ export default {
row.map_sourceKey = bb.key
},
dataDelete(index) {
- this.list.splice(index, 1)
+ this.formobj.listDtos.splice(index, 1)
},
save() {
- saveMappingList(this.list).then((res) => {
+ if (this.formobj.listDtos.length === 0) {
+ this.$message({ showClose: true, type: 'error', message: '映射列表不能为空' })
+ return
+ }
+ saveMappingList(this.formobj).then((res) => {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn()
@@ -128,8 +133,11 @@ export default {
})
},
handleReturn() {
- this.list = []
- this.dictSid = ''
+ this.formobj = {
+ userSid: '',
+ dictSid: '',
+ listDtos: []
+ }
this.$emit('doback')
}
}