forked from github/dataease
perf: 自动创建用户设置(xpack)
This commit is contained in:
parent
9a21b85f60
commit
4b9038f4f1
@ -2,16 +2,21 @@ package io.dataease.system.manage;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.dataease.api.system.vo.SettingItemVO;
|
import io.dataease.api.system.vo.SettingItemVO;
|
||||||
|
import io.dataease.license.config.XpackInteract;
|
||||||
import io.dataease.system.dao.auto.entity.CoreSysSetting;
|
import io.dataease.system.dao.auto.entity.CoreSysSetting;
|
||||||
import io.dataease.system.dao.auto.mapper.CoreSysSettingMapper;
|
import io.dataease.system.dao.auto.mapper.CoreSysSettingMapper;
|
||||||
import io.dataease.system.dao.ext.mapper.ExtCoreSysSettingMapper;
|
import io.dataease.system.dao.ext.mapper.ExtCoreSysSettingMapper;
|
||||||
import io.dataease.utils.BeanUtils;
|
import io.dataease.utils.BeanUtils;
|
||||||
|
import io.dataease.utils.CommonBeanFactory;
|
||||||
import io.dataease.utils.IDUtils;
|
import io.dataease.utils.IDUtils;
|
||||||
|
import io.dataease.utils.SystemSettingUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -71,26 +76,41 @@ public class SysParameterManage {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SettingItemVO> groupList(String groupKey) {
|
public List<CoreSysSetting> groupList(String groupKey) {
|
||||||
QueryWrapper<CoreSysSetting> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CoreSysSetting> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.likeRight("pkey", groupKey);
|
queryWrapper.likeRight("pkey", groupKey);
|
||||||
queryWrapper.orderByAsc("sort");
|
queryWrapper.orderByAsc("sort");
|
||||||
List<CoreSysSetting> sysSettings = coreSysSettingMapper.selectList(queryWrapper);
|
return coreSysSettingMapper.selectList(queryWrapper);
|
||||||
if (!CollectionUtils.isEmpty(sysSettings)) {
|
|
||||||
return sysSettings.stream().map(item -> BeanUtils.copyBean(new SettingItemVO(), item)).toList();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XpackInteract(value = "perSetting")
|
||||||
|
public List<SettingItemVO> convert(List<CoreSysSetting> sysSettings) {
|
||||||
|
return sysSettings.stream().sorted(Comparator.comparing(CoreSysSetting::getSort)).map(item -> BeanUtils.copyBean(new SettingItemVO(), item)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public void saveGroup(List<SettingItemVO> vos, String groupKey) {
|
public void saveGroup(List<SettingItemVO> vos, String groupKey) {
|
||||||
QueryWrapper<CoreSysSetting> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CoreSysSetting> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.likeRight("pkey", groupKey);
|
queryWrapper.likeRight("pkey", groupKey);
|
||||||
coreSysSettingMapper.delete(queryWrapper);
|
coreSysSettingMapper.delete(queryWrapper);
|
||||||
List<CoreSysSetting> sysSettings = vos.stream().map(item -> {
|
List<CoreSysSetting> sysSettings = vos.stream().filter(vo -> !SystemSettingUtils.xpackSetting(vo.getPkey())).map(item -> {
|
||||||
CoreSysSetting sysSetting = BeanUtils.copyBean(new CoreSysSetting(), item);
|
CoreSysSetting sysSetting = BeanUtils.copyBean(new CoreSysSetting(), item);
|
||||||
sysSetting.setId(IDUtils.snowID());
|
sysSetting.setId(IDUtils.snowID());
|
||||||
return sysSetting;
|
return sysSetting;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
extCoreSysSettingMapper.saveBatch(sysSettings);
|
extCoreSysSettingMapper.saveBatch(sysSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XpackInteract(value = "perSetting", before = false)
|
||||||
|
@Transactional
|
||||||
|
public void saveBasic(List<SettingItemVO> vos) {
|
||||||
|
String key = "basic.";
|
||||||
|
proxy().saveGroup(vos, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SysParameterManage proxy() {
|
||||||
|
return CommonBeanFactory.getBean(SysParameterManage.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package io.dataease.system.server;
|
|||||||
import io.dataease.api.system.SysParameterApi;
|
import io.dataease.api.system.SysParameterApi;
|
||||||
import io.dataease.api.system.request.OnlineMapEditor;
|
import io.dataease.api.system.request.OnlineMapEditor;
|
||||||
import io.dataease.api.system.vo.SettingItemVO;
|
import io.dataease.api.system.vo.SettingItemVO;
|
||||||
|
import io.dataease.system.dao.auto.entity.CoreSysSetting;
|
||||||
import io.dataease.system.manage.SysParameterManage;
|
import io.dataease.system.manage.SysParameterManage;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -36,11 +37,12 @@ public class SysParameterServer implements SysParameterApi {
|
|||||||
@Override
|
@Override
|
||||||
public List<SettingItemVO> queryBasicSetting() {
|
public List<SettingItemVO> queryBasicSetting() {
|
||||||
String key = "basic.";
|
String key = "basic.";
|
||||||
return sysParameterManage.groupList(key);
|
List<CoreSysSetting> coreSysSettings = sysParameterManage.groupList(key);
|
||||||
|
return sysParameterManage.convert(coreSysSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveBasicSetting(List<SettingItemVO> settingItemVOS) {
|
public void saveBasicSetting(List<SettingItemVO> settingItemVOS) {
|
||||||
sysParameterManage.saveGroup(settingItemVOS, "basic.");
|
sysParameterManage.saveBasic(settingItemVOS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2122,5 +2122,10 @@ export default {
|
|||||||
geometry: '地理信息',
|
geometry: '地理信息',
|
||||||
onlinemap: '在线地图',
|
onlinemap: '在线地图',
|
||||||
empty_desc: '请在左侧输入信息然后保存'
|
empty_desc: '请在左侧输入信息然后保存'
|
||||||
|
},
|
||||||
|
setting_basic: {
|
||||||
|
autoCreateUser: '禁止第三方自动创建用户',
|
||||||
|
dsIntervalTime: '数据源检测时间间隔',
|
||||||
|
dsExecuteTime: '数据源检测频率'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<div class="info-template-content">
|
<div class="info-template-content">
|
||||||
<div class="info-content-item" v-for="item in settingList" :key="item.pkey">
|
<div class="info-content-item" v-for="item in settingList" :key="item.pkey">
|
||||||
<div class="info-item-label">
|
<div class="info-item-label">
|
||||||
<span>{{ item.pkey }}</span>
|
<span>{{ t(item.pkey) }}</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
v-if="tooltipItem[item.pkey]"
|
v-if="tooltipItem[item.pkey]"
|
||||||
effect="dark"
|
effect="dark"
|
||||||
@ -33,7 +33,7 @@
|
|||||||
</el-icon>
|
</el-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<span v-else-if="item.pkey === '数据源检测时间间隔'">
|
<span v-else-if="item.pkey.includes('basic.dsIntervalTime')">
|
||||||
<span>{{ item.pval + ' ' + executeTime + '执行一次' }}</span>
|
<span>{{ item.pval + ' ' + executeTime + '执行一次' }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-else>{{ item.pval }}</span>
|
<span v-else>{{ item.pval }}</span>
|
||||||
@ -74,7 +74,7 @@ const loadList = () => {
|
|||||||
settingList.value = []
|
settingList.value = []
|
||||||
if (props.settingData?.length) {
|
if (props.settingData?.length) {
|
||||||
props.settingData.forEach(item => {
|
props.settingData.forEach(item => {
|
||||||
if (item.pkey === '数据源检测频率') {
|
if (item.pkey.includes('basic.dsExecuteTime')) {
|
||||||
executeTime.value = getExecuteTime(item.pval)
|
executeTime.value = getExecuteTime(item.pval)
|
||||||
} else {
|
} else {
|
||||||
settingList.value.push(item)
|
settingList.value.push(item)
|
||||||
@ -93,78 +93,6 @@ const getExecuteTime = val => {
|
|||||||
|
|
||||||
const settingList = ref([] as SettingRecord[])
|
const settingList = ref([] as SettingRecord[])
|
||||||
|
|
||||||
/* const loadBasic = () => {
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: '请求超时时间',
|
|
||||||
pval: '100',
|
|
||||||
type: 'text',
|
|
||||||
sort: 1
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: '数据源检测时间间隔',
|
|
||||||
pval: '100',
|
|
||||||
type: 'text',
|
|
||||||
sort: 2
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: '默认登录方式',
|
|
||||||
pval: '普通登录',
|
|
||||||
type: 'text',
|
|
||||||
sort: 3
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: '默认密码',
|
|
||||||
pval: 'DataEase@123456',
|
|
||||||
type: 'pwd',
|
|
||||||
sort: 4
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const loadEmail = () => {
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: 'SMTP主机',
|
|
||||||
pval: 'smtp.exmail.qq.com',
|
|
||||||
type: 'text',
|
|
||||||
sort: 1
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: 'SMTP端口',
|
|
||||||
pval: '465',
|
|
||||||
type: 'text',
|
|
||||||
sort: 2
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: 'SMTP账户',
|
|
||||||
pval: 'test@fit2cloud.com',
|
|
||||||
type: 'text',
|
|
||||||
sort: 3
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: 'SMTP密码',
|
|
||||||
pval: 'DataEase@123456',
|
|
||||||
type: 'pwd',
|
|
||||||
sort: 4
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: '测试收件人',
|
|
||||||
pval: 'yawen.chen@fit2cloud.com',
|
|
||||||
type: 'pwd',
|
|
||||||
sort: 5
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: 'SSL',
|
|
||||||
pval: '开启',
|
|
||||||
type: 'text',
|
|
||||||
sort: 6
|
|
||||||
})
|
|
||||||
settingList.value.push({
|
|
||||||
pkey: 'TSL',
|
|
||||||
pval: '未开启',
|
|
||||||
type: 'text',
|
|
||||||
sort: 7
|
|
||||||
})
|
|
||||||
} */
|
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
if (props.settingData?.length) {
|
if (props.settingData?.length) {
|
||||||
loadList()
|
loadList()
|
||||||
|
@ -12,17 +12,12 @@ const options = [
|
|||||||
{ value: 'minute', label: '分钟(执行时间:0秒)' },
|
{ value: 'minute', label: '分钟(执行时间:0秒)' },
|
||||||
{ value: 'hour', label: '小时(执行时间:0分0秒)' }
|
{ value: 'hour', label: '小时(执行时间:0分0秒)' }
|
||||||
]
|
]
|
||||||
interface BasicFrom {
|
|
||||||
autoCreateUser?: boolean
|
|
||||||
dsIntervalTime?: string
|
|
||||||
dsExecuteTime?: string
|
|
||||||
}
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
form: reactive<BasicFrom>({
|
form: reactive({
|
||||||
autoCreateUser: false,
|
|
||||||
dsIntervalTime: '30',
|
dsIntervalTime: '30',
|
||||||
dsExecuteTime: 'minute'
|
dsExecuteTime: 'minute'
|
||||||
})
|
}),
|
||||||
|
settingList: []
|
||||||
})
|
})
|
||||||
|
|
||||||
const rule = reactive<FormRules>({
|
const rule = reactive<FormRules>({
|
||||||
@ -35,44 +30,24 @@ const rule = reactive<FormRules>({
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const edit = row => {
|
|
||||||
state.form = {
|
|
||||||
autoCreateUser: row.autoCreateUser === 'true',
|
|
||||||
dsIntervalTime: row.dsIntervalTime,
|
|
||||||
dsExecuteTime: row.dsExecuteTime
|
|
||||||
}
|
|
||||||
dialogVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const emits = defineEmits(['saved'])
|
|
||||||
|
|
||||||
const buildSettingList = () => {
|
const buildSettingList = () => {
|
||||||
const param = { ...state.form }
|
return state.settingList.map(item => {
|
||||||
const item0 = {
|
const pkey = item.pkey.startsWith('basic.') ? item.pkey : `basic.${item.pkey}`
|
||||||
pkey: 'basic.autoCreateUser',
|
const sort = item.sort
|
||||||
pval: param.autoCreateUser.toString(),
|
const type = item.type
|
||||||
type: 'text',
|
const pval = state.form[item.pkey]
|
||||||
sort: 1
|
return { pkey, pval, type, sort }
|
||||||
}
|
})
|
||||||
const item1 = {
|
|
||||||
pkey: 'basic.dsIntervalTime',
|
|
||||||
pval: param.dsIntervalTime,
|
|
||||||
type: 'text',
|
|
||||||
sort: 2
|
|
||||||
}
|
|
||||||
const item2 = {
|
|
||||||
pkey: 'basic.dsExecuteTime',
|
|
||||||
pval: param.dsExecuteTime,
|
|
||||||
type: 'text',
|
|
||||||
sort: 3
|
|
||||||
}
|
|
||||||
return [item0, item1, item2]
|
|
||||||
}
|
}
|
||||||
|
const emits = defineEmits(['saved'])
|
||||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
await formEl.validate((valid, fields) => {
|
await formEl.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const param = buildSettingList()
|
const param = buildSettingList()
|
||||||
|
if (param.length < 2) {
|
||||||
|
return
|
||||||
|
}
|
||||||
showLoading()
|
showLoading()
|
||||||
request
|
request
|
||||||
.post({ url: '/sysParameter/basic/save', data: param })
|
.post({ url: '/sysParameter/basic/save', data: param })
|
||||||
@ -94,6 +69,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resetForm = (formEl: FormInstance | undefined) => {
|
const resetForm = (formEl: FormInstance | undefined) => {
|
||||||
|
state.settingList = []
|
||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
formEl.resetFields()
|
formEl.resetFields()
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
@ -109,6 +85,19 @@ const showLoading = () => {
|
|||||||
const closeLoading = () => {
|
const closeLoading = () => {
|
||||||
loadingInstance.value?.close()
|
loadingInstance.value?.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const edit = list => {
|
||||||
|
state.settingList = list.map(item => {
|
||||||
|
const pkey = item.pkey
|
||||||
|
item['label'] = `setting_${pkey}`
|
||||||
|
item['pkey'] = pkey.split('.')[1]
|
||||||
|
let pval = item.pval
|
||||||
|
state.form[item['pkey']] = pval || state.form[item['pkey']]
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
console.log(state.settingList)
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
edit
|
edit
|
||||||
})
|
})
|
||||||
@ -130,11 +119,48 @@ defineExpose({
|
|||||||
label-width="80px"
|
label-width="80px"
|
||||||
label-position="top"
|
label-position="top"
|
||||||
>
|
>
|
||||||
<el-form-item label="禁止扫码创建用户" prop="autoCreateUser">
|
<el-form-item
|
||||||
<el-switch v-model="state.form.autoCreateUser" />
|
v-for="item in state.settingList"
|
||||||
|
:key="item.pkey"
|
||||||
|
:prop="item.pkey"
|
||||||
|
:class="{ 'setting-hidden-item': item.pkey === 'dsExecuteTime' }"
|
||||||
|
:label="t(item.label)"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
v-if="item.pkey === 'autoCreateUser'"
|
||||||
|
active-value="true"
|
||||||
|
inactive-value="false"
|
||||||
|
v-model="state.form[item.pkey]"
|
||||||
|
/>
|
||||||
|
<div v-else-if="item.pkey === 'dsIntervalTime'" class="ds-task-form-inline">
|
||||||
|
<span>每</span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="state.form.dsIntervalTime"
|
||||||
|
autocomplete="off"
|
||||||
|
step-strictly
|
||||||
|
class="text-left"
|
||||||
|
:min="1"
|
||||||
|
:placeholder="t('common.inputText')"
|
||||||
|
controls-position="right"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<el-select v-model="state.form.dsExecuteTime">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<span class="ds-span">执行一次</span>
|
||||||
|
</div>
|
||||||
|
<div v-else />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="禁止扫码创建用户" prop="autoCreateUser">
|
||||||
|
<el-switch v-model="state.form.autoCreateUser" />
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
<el-form-item label="数据源检测时间间隔" prop="dsIntervalTime">
|
<!-- <el-form-item label="数据源检测时间间隔" prop="dsIntervalTime">
|
||||||
<div class="ds-task-form-inline">
|
<div class="ds-task-form-inline">
|
||||||
<span>每</span>
|
<span>每</span>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@ -157,7 +183,7 @@ defineExpose({
|
|||||||
</el-select>
|
</el-select>
|
||||||
<span class="ds-span">执行一次</span>
|
<span class="ds-span">执行一次</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
@ -171,6 +197,9 @@ defineExpose({
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
.setting-hidden-item {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
.ds-task-form-inline {
|
.ds-task-form-inline {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -17,6 +17,7 @@ import BasicEdit from './BasicEdit.vue'
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import { SettingRecord } from '@/views/system/common/SettingTemplate'
|
import { SettingRecord } from '@/views/system/common/SettingTemplate'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
const editor = ref()
|
const editor = ref()
|
||||||
const infoTemplate = ref()
|
const infoTemplate = ref()
|
||||||
const tooltips = [
|
const tooltips = [
|
||||||
@ -26,39 +27,25 @@ const tooltips = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
templateList: [
|
templateList: [] as SettingRecord[]
|
||||||
{
|
|
||||||
pkey: '禁止扫码创建用户',
|
|
||||||
pval: '未开启',
|
|
||||||
type: 'text',
|
|
||||||
sort: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pkey: '数据源检测时间间隔',
|
|
||||||
pval: '100',
|
|
||||||
type: 'text',
|
|
||||||
sort: 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pkey: '数据源检测频率',
|
|
||||||
pval: 'minute',
|
|
||||||
type: 'text',
|
|
||||||
sort: 3
|
|
||||||
}
|
|
||||||
] as SettingRecord[]
|
|
||||||
})
|
})
|
||||||
|
let originData = []
|
||||||
const search = cb => {
|
const search = cb => {
|
||||||
const url = '/sysParameter/basic/query'
|
const url = '/sysParameter/basic/query'
|
||||||
|
originData = []
|
||||||
|
state.templateList = []
|
||||||
request.get({ url }).then(res => {
|
request.get({ url }).then(res => {
|
||||||
|
originData = cloneDeep(res.data)
|
||||||
const data = res.data
|
const data = res.data
|
||||||
for (let index = 0; index < data.length; index++) {
|
for (let index = 0; index < data.length; index++) {
|
||||||
const item = data[index]
|
const item = data[index]
|
||||||
if (index === 0) {
|
if (item.pkey === 'basic.autoCreateUser') {
|
||||||
state.templateList[index].pval = item.pval === 'true' ? '开启' : '未开启'
|
item.pval = item.pval === 'true' ? '开启' : '未开启'
|
||||||
} else {
|
} else {
|
||||||
state.templateList[index].pval = item.pval
|
item.pval = item.pval
|
||||||
}
|
}
|
||||||
|
item.pkey = 'setting_' + item.pkey
|
||||||
|
state.templateList.push(item)
|
||||||
}
|
}
|
||||||
cb && cb()
|
cb && cb()
|
||||||
})
|
})
|
||||||
@ -68,14 +55,9 @@ const refresh = () => {
|
|||||||
infoTemplate?.value.init()
|
infoTemplate?.value.init()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
search(null)
|
refresh()
|
||||||
|
|
||||||
const edit = () => {
|
const edit = () => {
|
||||||
const param = {
|
editor?.value.edit(cloneDeep(originData))
|
||||||
autoCreateUser: state.templateList[0].pval === '开启' ? 'true' : 'false',
|
|
||||||
dsIntervalTime: state.templateList[1].pval,
|
|
||||||
dsExecuteTime: state.templateList[2].pval
|
|
||||||
}
|
|
||||||
editor?.value.edit(param)
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
|||||||
Subproject commit eb2b4924a5ada4969bcd633ef7e439dc5c5d810e
|
Subproject commit 8240c12452a97e2ed509a5cd067799de55fa7c30
|
@ -0,0 +1,17 @@
|
|||||||
|
package io.dataease.api.permissions.setting.api;
|
||||||
|
|
||||||
|
import io.dataease.api.permissions.setting.vo.PerSettingItemVO;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PerSettingApi {
|
||||||
|
|
||||||
|
@GetMapping("/basic/query")
|
||||||
|
List<PerSettingItemVO> basicSetting();
|
||||||
|
|
||||||
|
@PostMapping("/baisc/save")
|
||||||
|
void saveBasic(@RequestBody List<Object> settings);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package io.dataease.api.permissions.setting.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PerSettingItemVO implements Serializable {
|
||||||
|
|
||||||
|
private String pkey;
|
||||||
|
|
||||||
|
private String pval;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private Integer sort;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package io.dataease.constant;
|
||||||
|
|
||||||
|
public class XpackSettingConstants {
|
||||||
|
|
||||||
|
public static final String AUTO_CREATE_USER = "basic.autoCreateUser";
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package io.dataease.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import io.dataease.constant.XpackSettingConstants;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SystemSettingUtils {
|
||||||
|
|
||||||
|
public static boolean xpackSetting(String pkey) {
|
||||||
|
List<String> xpackSettingList = ListUtil.toList(XpackSettingConstants.AUTO_CREATE_USER);
|
||||||
|
return xpackSettingList.contains(pkey);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user