Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java
Administrator před 4 roky
rodič
revize
605427c5dd

+ 8 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java

@@ -141,6 +141,14 @@ public class ObjectUtils {
         return !isEmpty(input);
     }
 
+    public static boolean isEmpty(String input) {
+        return input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input);
+    }
+
+    public static boolean isNotEmpty(String input) {
+        return !isEmpty(input);
+    }
+
     public static JSONArray requireNonNull(JSONArray input, String... errorMsg) {
         if (input == null || input.isEmpty()) {
             throw new IllegalArgumentException(errorMsg[0]);

+ 5 - 0
boman-common/boman-common-redis/src/main/java/com/boman/common/redis/RedisKey.java

@@ -22,4 +22,9 @@ public class RedisKey {
      * eg: relation:tableName
      */
     public static final String RELATION = "relation:";
+
+    /**
+     * gen_table_relation中的数据存到redis中的key
+     */
+    public static final String RELATION_INFO = "relation:info";
 }

+ 24 - 0
boman-modules/boman-gen/pom.xml

@@ -71,6 +71,13 @@
             <groupId>com.boman</groupId>
             <artifactId>boman-common-swagger</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>com.boman</groupId>
+            <artifactId>boman-modules-system</artifactId>
+            <version>2.5.0</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>
@@ -84,4 +91,21 @@
             </plugin>
         </plugins>
     </build>
+
+<!--    <build>-->
+<!--        <finalName>${project.artifactId}</finalName>-->
+<!--        <plugins>-->
+<!--            <plugin>-->
+<!--                <groupId>org.springframework.boot</groupId>-->
+<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <goals>-->
+<!--                            <goal>repackage</goal>-->
+<!--                        </goals>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
+<!--        </plugins>-->
+<!--    </build>-->
 </project>

+ 7 - 3
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/MyController.java

@@ -58,11 +58,13 @@ public class MyController extends BaseController {
         requiredNonNull(genTableColumns);
         packTableAndInsertToRedis(tableList, genTableColumns);
 
-        // load tableRelation
         List<GenTableRelation> relationList = genTableRelationService.selectGenTableRelationList(new GenTableRelation());
         requiredNonNull(relationList);
-        packRelationAndInsertToRedis(tableList, relationList);
+        // load gen_table_relation表数据到redis
+        redisService.setCacheObject(RedisKey.RELATION_INFO, relationList, 12L, TimeUnit.DAYS);
 
+        // load tableRelation
+        packRelationAndInsertToRedis(tableList, relationList, genTableColumns);
         return AjaxResult.success(tableList);
     }
 
@@ -72,13 +74,15 @@ public class MyController extends BaseController {
      * @param tableList    tableList
      * @param relationList 主表和附表的关联信息
      */
-    private void packRelationAndInsertToRedis(List<GenTable> tableList, List<GenTableRelation> relationList) {
+    private void packRelationAndInsertToRedis(List<GenTable> tableList, List<GenTableRelation> relationList
+            , List<GenTableColumn> tableColumns) {
         for (GenTable table : tableList) {
             List<GenTable> tableListTemp = new ArrayList<>(16);
             for (GenTableRelation relation : relationList) {
                 if (relation.getRelationParentId().equals(table.getTableId())) {
                     Long childId = relation.getRelationChildId();
                     // 存了附表的建表信息和表的所有字段信息
+                    // todo
                     List<GenTable> collect = tableList.stream()
                             .filter(genTable -> genTable.getTableId().equals(childId))
                             .collect(Collectors.toList());

+ 15 - 2
boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTableColumn.java

@@ -1,10 +1,12 @@
 package com.boman.gen.domain;
 
-import javax.validation.constraints.NotBlank;
-
+import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.web.domain.BaseEntity;
 
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
 /**
  * 代码生成业务字段表 gen_table_column
  * 
@@ -80,6 +82,9 @@ public class GenTableColumn extends BaseEntity
     /** 排序 */
     private Integer sort;
 
+    /** 如果是下拉框,单选,复选框 对应的子节点的值 */
+    private List<JSONObject> sysDictData;
+
     public String getForeignKey() {
         return foreignKey;
     }
@@ -390,4 +395,12 @@ public class GenTableColumn extends BaseEntity
             return this.columnComment;
         }
     }
+
+    public List<JSONObject> getSysDictData() {
+        return sysDictData;
+    }
+
+    public void setSysDictData(List<JSONObject> sysDictData) {
+        this.sysDictData = sysDictData;
+    }
 }

+ 11 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/DictConstant.java

@@ -0,0 +1,11 @@
+package com.boman.system.common;
+
+/**
+ * @author shiqian
+ * @date 2021年04月02日 14:52
+ **/
+public class DictConstant {
+
+    public static final String DICT_LABEL = "dictLabel";
+    public static final String DICT_VALUE = "dictValue";
+}

+ 23 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/FormDataConstant.java

@@ -1,5 +1,9 @@
 package com.boman.system.common;
 
+import com.google.common.collect.Lists;
+
+import java.util.List;
+
 /**
  * @author shiqian
  * @date 2021年03月26日 09:47
@@ -99,10 +103,29 @@ public class FormDataConstant {
     /**  数据库字段创建时间*/
     public static final String UPDATE_TIME = "UPDATE_TIME";
 
+    /**  数据库字段创建时间*/
+    public static final String CREATE_TIME = "create_time";
+
 
     /**  状态 */
     public static final String STATUS = "status";
 
 
+    /**  单选框 */
+    public static final String RADIO = "radio";
+
+
+    /**  复选框 */
+    public static final String CHECKBOX = "checkbox";
+
+
+    /**  下拉框 */
+    public static final String SELECT = "select";
+
+
+    /**  需要查字典表的框框 */
+    public static final List<String> NEED_QUERY_DICT_LIST = Lists.newArrayList(RADIO, CHECKBOX, SELECT);
+
+
 
 }

+ 112 - 28
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java

@@ -3,7 +3,7 @@ package com.boman.system.common;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.boman.common.core.utils.SecurityUtils;
+import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.collection.CollectionUtils;
 import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.web.domain.AjaxResult;
@@ -12,18 +12,18 @@ import com.boman.common.redis.service.RedisService;
 import com.boman.gen.controller.MyController;
 import com.boman.gen.domain.GenTable;
 import com.boman.gen.domain.GenTableColumn;
-import com.boman.system.mapper.StandardlyMapper;
+import com.boman.gen.domain.GenTableRelation;
+import com.boman.system.domain.SysDictData;
 import com.boman.system.service.*;
 import com.boman.system.utils.IdUtils;
+import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 
 import javax.annotation.Resource;
-import java.net.URI;
 import java.sql.Timestamp;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -54,6 +54,8 @@ public class TableServiceCmdService {
     private IBaseUpdateService updateService;
     @Resource
     private  RestTemplate restTemplate;
+    @Resource
+    private  ISysDictTypeService dictTypeService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
@@ -121,9 +123,16 @@ public class TableServiceCmdService {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
         String pkName = IdUtils.getPkName(genTable.getColumns());
 
-        RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
-        LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
-        return AjaxResult.success(rowResult);
+        List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
+        for (Long id : idArr) {
+            RowResult rowResult = deleteService.deleteById(dto.getTable(), pkName, id);
+            result.add(rowResult);
+            LOGGER.info(rowResult.getMessage() + ", id: {}", id);
+        }
+
+        // RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
+
+        return AjaxResult.success(result);
     }
 
 
@@ -142,12 +151,16 @@ public class TableServiceCmdService {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
         String pkName = IdUtils.getPkName(genTable.getColumns());
 
+        List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
         JSONObject jsonObject = new JSONObject();
         jsonObject.put(dto.getLogicDelName(), dto.getLogicDelValue());
+        for (Long id : idArr) {
+            RowResult rowResult = deleteService.objectLogicDelete(new Long[]{id}, dto.getTable(), pkName, jsonObject);
+            result.add(rowResult);
+            LOGGER.info(rowResult.getMessage() + ", id: {}", id);
+        }
 
-        RowResult rowResult = deleteService.objectLogicDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"), jsonObject);
-        LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
-        return AjaxResult.success(rowResult);
+        return AjaxResult.success(result);
     }
 
     /**
@@ -181,11 +194,42 @@ public class TableServiceCmdService {
 
         List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
                 , showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
+        handlerDate(result);
         result = isCustomized(dto.getTable(),result,"trigger_retrieve");
         rows.put(FormDataConstant.PAGE_ROWS, result);
         return AjaxResult.success(rows);
     }
 
+    /**
+     * 功能描述: 把timeStamp转为string
+     *
+     * @param result 被转的数据
+     */
+    private void handlerDate(List<JSONObject> result) {
+        if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
+            return;
+        }
+        for (JSONObject jsonObject : result) {
+            getStrByTimeStamp(jsonObject, FormDataConstant.CREATE_TIME);
+            getStrByTimeStamp(jsonObject, FormDataConstant.UPDATE_TIME.toLowerCase());
+        }
+    }
+
+    /**
+     * 功能描述: 把jsonObject中时间类型转为string,再放到jsonObject中,类型为: yyyy-mm-dd
+     *
+     * @param jsonObject jsonObject
+     * @param columnType create_time update_time...
+     */
+    private void getStrByTimeStamp(JSONObject jsonObject, String columnType) {
+        Date date = jsonObject.getTimestamp(columnType);
+        if (null != date) {
+
+            jsonObject.put(columnType, DateUtils.dateTime(date));
+        }
+    }
+
+
     /**
      * 功能描述: 获取单表单数据
      *
@@ -258,13 +302,19 @@ public class TableServiceCmdService {
         ArrayList<GenTableColumn> queryList = Lists.newArrayListWithCapacity(16);
         for (GenTableColumn column : columns) {
             if (GenTableColumn.IS_QUERY.equalsIgnoreCase(column.getIsQuery())) {
+                String dictType = column.getDictType();
+                if (ObjectUtils.isNotEmpty(dictType)) {
+                    List<SysDictData> sysDictData1 = dictTypeService.selectDictDataByType(dictType);
+                    column.setSysDictData(coverSysDictDataToJSONObject(sysDictData1));
+                }
+
                 queryList.add(column);
             }
         }
 
         jsonObject.put(FormDataConstant.QUERY_LIST, queryList);
         // genTable.getMenuRole() 暂时数据库没有数据,
-        jsonObject.put(FormDataConstant.BUTTON_LIST, genTable.getMenuRole());
+        jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
 
         // 表头
         List<GenTableColumn> tableHeadList = columns.stream()
@@ -274,21 +324,6 @@ public class TableServiceCmdService {
         return AjaxResult.success(jsonObject);
     }
 
-    /**
-     * 功能描述: 封装查询条件,在拼sql的时候按照此规则去取值
-     * {@link StandardlyMapper.SqlProvider#selectByCondition(java.util.Map)}
-     *
-     * @param value      查询的值
-     * @param queryType  queryType
-     * @param columnType columnType
-     * @return java.lang.String
-     */
-    public String packValue(String value, String queryType, String columnType) {
-        requireNonNull(value);
-        requireNonNull(queryType);
-        return value + "_" + queryType + "_" + columnType;
-    }
-
     /**
      * 功能描述: 获取表单子表
      *
@@ -301,9 +336,13 @@ public class TableServiceCmdService {
         List<GenTable> childTableList = genTable.getRelationList();
         // 此表没有关联子表,查啥查
         requireNonNull(childTableList);
-
+        // todo
         for (GenTable childTable : childTableList) {
             String childTableName = childTable.getTableName();
+            Long childTableTableId = childTable.getTableId();
+            List<GenTableColumn> childColumns = childTable.getColumns();
+            //  column_name = 先根据tableName查到id,再用id到relation中查到relation_child_id, 在用这个值去到tableColumn中查到column_name
+            // select * from childTableName where column_name = objId
 
 
         }
@@ -312,6 +351,27 @@ public class TableServiceCmdService {
         return AjaxResult.success();
     }
 
+    public String getChildColumnNameByParentTableName(GenTable parentGenTable, Long childTableTableId){
+        requireNonNull(parentGenTable.getTableName(), "主表名称为空");
+//        GenTable primaryTable = redisService.getCacheObject(RedisKey.TABLE_INFO + genTable.getTableName());
+        Long parentTableId = parentGenTable.getTableId();
+        List<GenTableRelation> relations = redisService.getCacheObject(RedisKey.RELATION_INFO);
+        relations = relations.stream()
+                .filter(relation -> relation.getRelationParentId().equals(parentTableId))
+                .collect(Collectors.toList());
+
+        for (GenTableRelation relation : relations) {
+            if (relation.getRelationChildId().equals(6L)) {
+               // tableColumnService.selectGenTableColumnListByTableId(childTableTableId);
+//                return
+            }
+        }
+
+
+        return "";
+
+    }
+
     /**
      * 功能描述: 表单提交接口
      *
@@ -429,7 +489,7 @@ public class TableServiceCmdService {
     // todo redis中未找到,要去查数据库,然后再塞进去
     private GenTable getTableFromRedisByTableName(String redisKeyPrefix, String tableName) {
         GenTable genTable = redisService.getCacheObject(redisKeyPrefix + requireNonNull(tableName));
-        return requireNonNull(genTable);
+        return requireNonNull(genTable, "未找到表对应的信息");
     }
 
     /**
@@ -445,7 +505,31 @@ public class TableServiceCmdService {
     public AjaxResult getByTableName(BaseTableSaveDTO condition) {
 //        requiredNonNull(condition.getTable(), "表名为空");
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
+        List<GenTableColumn> columns = genTable.getColumns();
+        for (GenTableColumn column : columns) {
+            String dictType = column.getDictType();
+            if (ObjectUtils.isNotEmpty(dictType)) {
+                List<SysDictData> sysDictData1 = dictTypeService.selectDictDataByType(dictType);
+                column.setSysDictData(coverSysDictDataToJSONObject(sysDictData1));
+            }
+        }
+
         return AjaxResult.success(genTable);
     }
+
+    public List<JSONObject> coverSysDictDataToJSONObject(List<SysDictData> sysDictData) {
+        List<JSONObject> result = Lists.newArrayListWithCapacity(sysDictData.size());
+        for (SysDictData data : sysDictData) {
+            JSONObject jsonObject = new JSONObject();
+            String dictLabel = data.getDictLabel();
+            String dictValue = data.getDictValue();
+            jsonObject.put(DictConstant.DICT_LABEL, dictLabel);
+            jsonObject.put(DictConstant.DICT_VALUE, dictValue);
+            result.add(jsonObject);
+        }
+
+        return result;
+
+    }
 }
 

+ 1 - 1
boman-modules/boman-system/src/main/java/com/boman/system/mapper/StandardlyMapper.java

@@ -50,7 +50,7 @@ public interface StandardlyMapper {
     int deleteByIds(@Param("tableName") String var1, @Param("ids") Long[] var2, @Param("pkName") String pkName);
 
     @Delete({"DELETE FROM ${tableName} where ID = #{id}"})
-    int deleteById(@Param("tableName") String var1, @Param("id") long var2);
+    int deleteById(@Param("tableName") String tableName, @Param("pkName") String pkName, @Param("id") long var2);
 
     @Select({"select * FROM ${tableName} where ID = #{id}"})
     JSONObject getById(@Param("tableName") String var1, @Param("id") long var2);

+ 11 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/IBaseDeleteService.java

@@ -20,6 +20,17 @@ public interface IBaseDeleteService {
      */
     RowResult objectDelete(Long[] idArr, String tableName, String pkName);
 
+
+    /**
+     * 功能描述: 在此不对入参进行校验,所以在调用此方法之前一定要对参数进行校验,以免报错
+     *
+     * @param id        需要删除的iD
+     * @param tableName 业务主表
+     * @param pkName    业务表的主键名
+     * @return com.boman.system.common.RowResult
+     */
+    RowResult deleteById(String tableName, String pkName, Long id);
+
     /**
      * 功能描述: 在此不对入参进行校验,所以在调用此方法之前一定要对参数进行校验,以免报错
      *

+ 14 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseDeleteServiceImpl.java

@@ -35,6 +35,20 @@ public class BaseDeleteServiceImpl implements IBaseDeleteService {
         return RowResult.ok("共删除了 " + delete + " 条记录");
     }
 
+    /**
+     * 功能描述: 在此不对入参进行校验,所以在调用此方法之前一定要对参数进行校验,以免报错
+     *
+     * @param id        需要删除的iD
+     * @param tableName 业务主表
+     * @param pkName    业务表的主键名
+     * @return com.boman.system.common.RowResult
+     */
+    @Override
+    public RowResult deleteById(String tableName, String pkName, Long id) {
+        int delete = mapper.deleteById(tableName, pkName, id);
+        return RowResult.ok("共删除了 " + delete + " 条记录");
+    }
+
     /**
      * 功能描述: 在此不对入参进行校验,所以在调用此方法之前一定要对参数进行校验,以免报错
      *

+ 3 - 1
boman-modules/boman-system/src/main/java/com/boman/system/utils/IdUtils.java

@@ -9,6 +9,8 @@ import org.apache.commons.collections.CollectionUtils;
 
 import java.util.List;
 
+import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
+
 /**
  * @author shiqian
  * @description
@@ -45,7 +47,7 @@ public class IdUtils {
 
         for (GenTableColumn tableColumn : columnList) {
             if ("1".equalsIgnoreCase(tableColumn.getIsPk())) {
-                return tableColumn.getColumnName();
+                return requireNonNull(tableColumn.getColumnName(), "主键名称为空");
             }
         }
 

+ 8 - 1
ruoyi-ui/src/api/system/config.js

@@ -13,7 +13,7 @@ export function listIndextwo(query) {
   return request({
     url: '/system/dict/data/type/' + query,
     method: 'get'
-    // params: query 
+    // params: query
   })
 }
 export function listIndextherr(query) {
@@ -62,6 +62,13 @@ export function listIndexfou(data) {
     data: data
   })
 }
+export function listIndextanl(data) {
+  return request({
+    url: '/boman-system/p/cs/table/getByTableName',
+    method: 'post',
+    data: data
+  })
+}
 // 修改参数配置
 export function updateConfig(data) {
   return request({

+ 167 - 11
ruoyi-ui/src/views/index.vue

@@ -143,9 +143,9 @@
       <el-col :sm="24" :lg="7" style="padding-left: 15px">
          <div class="index_nav">
           <div class="index_navTime">
-            <p class="index_navTimep">
+            <p class="index_navTimep" @click="handleAdd">
               <span>日程</span>
-              <span><i class="el-icon-date"></i>创建日程</span>
+              <span><i class="el-icon-date" ></i>创建日程</span>
             </p>
             <el-calendar id="calendar">
                 <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
@@ -175,7 +175,7 @@
             <div class="index_navTime ">
               <p class="index_navTimep">
                 <span>备忘录</span>
-                <span><i class="el-icon-date"></i>创建日程</span>
+                <span><i class="el-icon-date"></i>创建备忘录</span>
               </p>
               <ul >
                 <li v-for="(item,index) in getmemorandum" :key="index">
@@ -236,14 +236,80 @@
       </el-col>
     </el-row>
     <!-- <el-divider /> -->
-
+  <!-- 添加或修改公告对话框 -->
+  <el-dialog :title="title" :visible.sync="open" width="880px" append-to-body>
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-row>
+        <el-col :span="12" v-for="(item,index) in inputList" :key="index">
+          <el-form-item :label="item.columnComment" prop="noticeTitle">
+            <el-input :type="item.html_type" v-model="item.columnName" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12" v-for="(item,index) in dataList" :key="item.columnComment">
+          <el-form-item :label="item.columnComment" prop="noticeTitle">
+            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12" v-for="(item,index) in selectList" :key="item.columnComment">
+          <el-form-item label="公告类型" prop="noticeType">
+            <el-select v-model="form.noticeType" placeholder="请选择">
+              <!-- <el-option
+                v-for="dict in typeOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              ></el-option> -->
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" v-for="(item,index) in radiolist " :key="item.columnComment">
+          <el-form-item label="状态">
+            <el-radio-group v-model="form.status">
+              <el-radio
+                v-for="dict in statusOptions"
+                :key="dict.dictValue"
+                :label="dict.dictValue"
+              >{{dict.dictLabel}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" v-for="(item,index) in chekbosList " :key="item.columnComment">
+          <el-form-item label="状态">
+            <!-- <el-radio-group v-model="form.status">
+              <el-radio
+                v-for="dict in statusOptions"
+                :key="dict.dictValue"
+                :label="dict.dictValue"
+              >{{dict.dictLabel}}</el-radio>
+            </el-radio-group> -->
+             <el-checkbox-group v-model="form.type">
+                  <el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
+             </el-checkbox-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" v-for="(item,index) in editorList" :key="item.columnComment">
+          <el-form-item label="内容">
+            <editor v-model="form.noticeContent" :min-height="192"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="cancel">取 消</el-button>
+    </div>
+  </el-dialog>
   </div>
 </template>
-   
+
 <script>
-  import { listIndex, listIndextwo, listIndextherr, listIndexfou, getConfig, delConfig, addConfig, updateConfig, clearCache } from "@/api/system/config";
+  import { listIndex, listIndextwo, listIndextherr, listIndexfou, listIndextanl, getConfig, delConfig, addConfig, updateConfig, clearCache } from "@/api/system/config";
+import Editor from '@/components/Editor';
 export default {
   name: "index",
+  components: {
+    Editor
+  },
   data() {
     return {
       // 版本号
@@ -254,6 +320,10 @@ export default {
        totalali:0,
        pageSize:6,
        activeName: 'second',
+       // 是否显示弹出层
+       open: false,
+       // 弹出层标题
+       title: "",
        value: new Date(),
        editableTabs: [],
        editableTabsteo:[],
@@ -325,10 +395,31 @@ export default {
       alendarList:[],
       calendarData: [
             ],
-            ary:[],
-            tieku:'',
-            comg:'',
-            aekti:''
+      ary:[],
+      tieku:'',
+      comg:'',
+      aekti:'',
+      // 弹框数据
+      form:{
+      },
+      // 表单校验
+      rules: {
+      },
+      //日历弹框
+      calendaradd:{
+        table:'sys_schedule'
+      },
+      // input
+      inputList:[],
+      // 时间
+      dataList:[],
+      //单选框
+      radiolist:[],
+      // 复选框
+      chekbosList:[],
+      //下拉框
+      selectList:[],
+      editorList:[]
     };
   },
 
@@ -484,6 +575,31 @@ export default {
          this.loading = false;
        }
      );
+   },
+   //日历新增弹框数据
+   getLisalendaraddd() {
+     this.loading = true;
+     listIndextanl(this.calendaradd).then(response => {
+         if(response.data !== undefined){
+           this.form = response.data
+           this.form.columns.filter(route => {
+             // console.log(route)
+             if(route.htmlType == "input" || route.htmlType == 'textarea'){
+             this.inputList.push(route)
+             }else if(route.htmlType == "select"){
+             this.selectList.push(route)
+             }else if(route.htmlType == "datetime"){
+               this.dataList.push(route)
+             }else if(route.htmlType == "editor"){
+               this.editorList.push(route)
+             }
+         })
+        console.log(this.selectList)
+
+         }
+         this.loading = false;
+       }
+     );
    },
     goTarget(href) {
       window.open(href, "_blank");
@@ -529,7 +645,47 @@ export default {
       this.numprofile = index - 1
       this.queryParamstabprofile.condition.notice_type = index
       this.getLisprofile()
-    }
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+      };
+      this.resetForm("form");
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      console.log(this.open)
+      this.reset();
+      this.getLisalendaraddd()
+      this.open = true;
+      this.title = "添加日程";
+    },
+    /** 提交按钮 */
+    submitForm: function() {
+      console.log(this.inputList)
+      // this.$refs["form"].validate(valid => {
+      //   if (valid) {
+      //     if (this.form.id != undefined) {
+      //       updateNotice(this.form).then(response => {
+      //         this.msgSuccess("修改成功");
+      //         this.open = false;
+      //         this.getList();
+      //       });
+      //     } else {
+      //       addNotice(this.form).then(response => {
+      //         this.msgSuccess("新增成功");
+      //         this.open = false;
+      //         this.getList();
+      //       });
+      //     }
+      //   }
+      // });
+    },
   },
 };
 </script>