+
删除分组
@@ -360,7 +373,8 @@
params: Object,
type: String,
areaId: String,
- value: Array
+ value: Array,
+ appType: String
},
components: {
@@ -483,6 +497,9 @@
},
mounted () {
+ if (this.appType && !this.value.length) {
+ this.getInitFileds()
+ }
},
methods: {
@@ -509,6 +526,56 @@
})
},
+ getInitFileds () {
+ this.instance.post(`/app/appapplicationinfo/queryInitTable?appType=${this.appType}`).then(res => {
+ if (res.code === 0) {
+ let arr = res.data
+ let groups = this.unique(arr.map(v => v.groupName))
+ this.targetList = groups.map(groupName => {
+ const column = arr.filter(v => v.groupName === groupName).map(item => {
+ if (['select', 'checkbox', 'radio'].includes(item.type)) {
+ item.options = item.selectValues.split('`').map(v => {
+ return {
+ label: v,
+ value: ''
+ }
+ })
+ }
+
+ if (item.type === 'checkbox' && item.defaultValue) {
+ item.defaultValue = item.defaultValue.split('`')
+ }
+
+ if (item.grid) {
+ item.grid = Number(item.grid)
+ }
+
+ return item
+ })
+
+ return {
+ type: 'group',
+ fieldName: '卡片',
+ fixedLabel: '卡片',
+ icon: 'iconpic',
+ groupName,
+ column: column,
+ isInit: '1'
+ }
+ })
+
+ this.targetList.push({
+ type: 'group',
+ fieldName: '卡片',
+ fixedLabel: '卡片',
+ icon: 'iconpic',
+ groupName: '基础信息',
+ column: []
+ })
+ }
+ })
+ },
+
onConfirm () {
let result = []
this.targetList.forEach((group, i) => {