mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 03:22:56 +08:00
fix(数据集): 数据集增加分组字段功能
This commit is contained in:
parent
56783966d8
commit
639939790f
@ -394,7 +394,11 @@ const handleFieldMore = (ele, type) => {
|
|||||||
}
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'copy':
|
case 'copy':
|
||||||
copyField(ele)
|
if (ele.extField === 3) {
|
||||||
|
copyGroupField(ele)
|
||||||
|
} else {
|
||||||
|
copyField(ele)
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case 'delete':
|
case 'delete':
|
||||||
deleteField(ele)
|
deleteField(ele)
|
||||||
@ -452,6 +456,16 @@ const copyField = item => {
|
|||||||
allfields.value.splice(index + 1, 0, param)
|
allfields.value.splice(index + 1, 0, param)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selectable = row => ![3].includes(row.extField)
|
||||||
|
|
||||||
|
const copyGroupField = item => {
|
||||||
|
const param = cloneDeep(item)
|
||||||
|
param.id = guid()
|
||||||
|
param.name = getFieldName(dimensions.value.concat(quota.value), item.name)
|
||||||
|
const index = allfields.value.findIndex(ele => ele.id === item.id)
|
||||||
|
allfields.value.splice(index + 1, 0, param)
|
||||||
|
}
|
||||||
|
|
||||||
const delFieldById = arr => {
|
const delFieldById = arr => {
|
||||||
const delId = [...arr]
|
const delId = [...arr]
|
||||||
while (delId.length) {
|
while (delId.length) {
|
||||||
@ -1085,12 +1099,14 @@ const initGroupField = val => {
|
|||||||
Object.assign(currentGroupField, val)
|
Object.assign(currentGroupField, val)
|
||||||
const groupList = []
|
const groupList = []
|
||||||
val.groupList.forEach(ele => {
|
val.groupList.forEach(ele => {
|
||||||
const { name, text = [], startTime, endTime, min, max } = ele
|
const { name, text = [], startTime, endTime, min, max, minTerm, maxTerm } = ele
|
||||||
const obj = {
|
const obj = {
|
||||||
name,
|
name,
|
||||||
text,
|
text,
|
||||||
min,
|
min,
|
||||||
max,
|
max,
|
||||||
|
minTerm,
|
||||||
|
maxTerm,
|
||||||
time: []
|
time: []
|
||||||
}
|
}
|
||||||
if (currentGroupField.deTypeOrigin === 1) {
|
if (currentGroupField.deTypeOrigin === 1) {
|
||||||
@ -1108,12 +1124,14 @@ const confirmGroupField = () => {
|
|||||||
if (val) {
|
if (val) {
|
||||||
const groupList = []
|
const groupList = []
|
||||||
currentGroupField.groupList.forEach(ele => {
|
currentGroupField.groupList.forEach(ele => {
|
||||||
const { name, text = [], time, min, max } = ele
|
const { name, text = [], time, min, max, minTerm, maxTerm } = ele
|
||||||
const obj = {
|
const obj = {
|
||||||
name,
|
name,
|
||||||
text,
|
text,
|
||||||
min,
|
min,
|
||||||
max,
|
max,
|
||||||
|
minTerm,
|
||||||
|
maxTerm,
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: ''
|
endTime: ''
|
||||||
}
|
}
|
||||||
@ -1978,7 +1996,7 @@ const getDsIconName = data => {
|
|||||||
:height="quotaTableHeight"
|
:height="quotaTableHeight"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="40" />
|
<el-table-column :selectable="selectable" type="selection" width="40" />
|
||||||
<el-table-column prop="name" :label="t('dataset.field_name')" width="264">
|
<el-table-column prop="name" :label="t('dataset.field_name')" width="264">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="column-style">
|
<div class="column-style">
|
||||||
@ -2138,7 +2156,7 @@ const getDsIconName = data => {
|
|||||||
<el-tooltip effect="dark" :content="t('dataset.edit')" placement="top">
|
<el-tooltip effect="dark" :content="t('dataset.edit')" placement="top">
|
||||||
<template #default>
|
<template #default>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.extField === 2"
|
v-if="[2, 3].includes(scope.row.extField)"
|
||||||
text
|
text
|
||||||
@click="handleFieldMore(scope.row, 'editor')"
|
@click="handleFieldMore(scope.row, 'editor')"
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user