mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue
Conflicts: ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java ruoyi-generator/src/main/resources/vm/vue/index.vue.vm ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java ruoyi-ui/src/views/tool/gen/editTable.vue
This commit is contained in:
		@@ -74,6 +74,9 @@ public class GenConstants
 | 
			
		||||
    /** 日期控件 */
 | 
			
		||||
    public static final String HTML_DATETIME = "datetime";
 | 
			
		||||
 | 
			
		||||
    /** 富文本控件 */
 | 
			
		||||
    public static final String HTML_EDITOR = "editor";
 | 
			
		||||
 | 
			
		||||
    /** 字符串类型 */
 | 
			
		||||
    public static final String TYPE_STRING = "String";
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ public class GenTableColumn extends BaseEntity
 | 
			
		||||
    /** 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) */
 | 
			
		||||
    private String queryType;
 | 
			
		||||
 | 
			
		||||
    /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件) */
 | 
			
		||||
    /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、editor富文本控件) */
 | 
			
		||||
    private String htmlType;
 | 
			
		||||
 | 
			
		||||
    /** 字典类型 */
 | 
			
		||||
 
 | 
			
		||||
@@ -111,6 +111,11 @@ public class GenUtils
 | 
			
		||||
        {
 | 
			
		||||
            column.setHtmlType(GenConstants.HTML_SELECT);
 | 
			
		||||
        }
 | 
			
		||||
        // 内容字段设置富文本控件
 | 
			
		||||
        else if (StringUtils.endsWithIgnoreCase(columnName, "content"))
 | 
			
		||||
        {
 | 
			
		||||
            column.setHtmlType(GenConstants.HTML_EDITOR);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -139,6 +139,10 @@
 | 
			
		||||
        <el-form-item label="${comment}" prop="${field}">
 | 
			
		||||
          <el-input v-model="form.${field}" placeholder="请输入${comment}" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
#elseif($column.htmlType == "editor")
 | 
			
		||||
        <el-form-item label="${comment}">
 | 
			
		||||
          <editor v-model="form.${field}" :min-height="192"/>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
#elseif($column.htmlType == "select" && "" != $dictType)
 | 
			
		||||
        <el-form-item label="${comment}" prop="${field}">
 | 
			
		||||
          <el-select v-model="form.${field}" placeholder="请选择${comment}">
 | 
			
		||||
@@ -221,10 +225,24 @@
 | 
			
		||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
 | 
			
		||||
import Treeselect from "@riophae/vue-treeselect";
 | 
			
		||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 | 
			
		||||
#foreach($column in $columns)
 | 
			
		||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
 | 
			
		||||
import Editor from '@/components/Editor';
 | 
			
		||||
#break
 | 
			
		||||
#end
 | 
			
		||||
#end
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "${BusinessName}",
 | 
			
		||||
  components: { Treeselect },
 | 
			
		||||
  components: {
 | 
			
		||||
#foreach($column in $columns)
 | 
			
		||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
 | 
			
		||||
    Editor,
 | 
			
		||||
#break
 | 
			
		||||
#end
 | 
			
		||||
#end
 | 
			
		||||
    Treeselect
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 遮罩层
 | 
			
		||||
 
 | 
			
		||||
@@ -168,6 +168,10 @@
 | 
			
		||||
        <el-form-item label="${comment}" prop="${field}">
 | 
			
		||||
          <el-input v-model="form.${field}" placeholder="请输入${comment}" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
#elseif($column.htmlType == "editor")
 | 
			
		||||
        <el-form-item label="${comment}">
 | 
			
		||||
          <editor v-model="form.${field}" :min-height="192"/>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
#elseif($column.htmlType == "select" && "" != $dictType)
 | 
			
		||||
        <el-form-item label="${comment}" prop="${field}">
 | 
			
		||||
          <el-select v-model="form.${field}" placeholder="请选择${comment}">
 | 
			
		||||
@@ -248,9 +252,21 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
 | 
			
		||||
#foreach($column in $columns)
 | 
			
		||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
 | 
			
		||||
import Editor from '@/components/Editor';
 | 
			
		||||
#break
 | 
			
		||||
#end
 | 
			
		||||
#end
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "${BusinessName}",
 | 
			
		||||
#foreach($column in $columns)
 | 
			
		||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor")
 | 
			
		||||
  components: { Editor },
 | 
			
		||||
#break
 | 
			
		||||
#end
 | 
			
		||||
#end
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 遮罩层
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,7 @@ import com.ruoyi.common.constant.UserConstants;
 | 
			
		||||
import com.ruoyi.common.core.redis.RedisCache;
 | 
			
		||||
import com.ruoyi.common.core.text.Convert;
 | 
			
		||||
import com.ruoyi.common.enums.DataSourceType;
 | 
			
		||||
import com.ruoyi.common.exception.CustomException;
 | 
			
		||||
import com.ruoyi.common.utils.StringUtils;
 | 
			
		||||
import com.ruoyi.system.domain.SysConfig;
 | 
			
		||||
import com.ruoyi.system.mapper.SysConfigMapper;
 | 
			
		||||
@@ -138,6 +139,14 @@ public class SysConfigServiceImpl implements ISysConfigService
 | 
			
		||||
    @Override
 | 
			
		||||
    public int deleteConfigByIds(Long[] configIds)
 | 
			
		||||
    {
 | 
			
		||||
        for (Long configId : configIds)
 | 
			
		||||
        {
 | 
			
		||||
            SysConfig config = selectConfigById(configId);
 | 
			
		||||
            if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
 | 
			
		||||
            {
 | 
			
		||||
                throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        int count = configMapper.deleteConfigByIds(configIds);
 | 
			
		||||
        if (count > 0)
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
@@ -90,6 +90,7 @@
 | 
			
		||||
                <el-option label="单选框" value="radio" />
 | 
			
		||||
                <el-option label="复选框" value="checkbox" />
 | 
			
		||||
                <el-option label="日期控件" value="datetime" />
 | 
			
		||||
                <el-option label="富文本控件" value="editor" />
 | 
			
		||||
              </el-select>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user