Browse Source

Merge remote-tracking branch 'origin/master'

shiqian 4 years ago
parent
commit
529951dca8

+ 28 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableColumnServiceImpl.java

@@ -16,8 +16,11 @@ import com.boman.gen.mapper.GenTableMapper;
 import com.boman.gen.mapper.TableSqlMapper;
 import com.google.common.collect.Maps;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -38,6 +41,8 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     @Autowired
     private TableSqlMapper tableSqlMapper;
 
+
+
     /**
      * 查询业务字段列表
      *
@@ -133,6 +138,8 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
         list.add(genTableColumn);
         isAk(list);
         insertCreateLog(list, BusinessType.INSERT);
+        //处理字段翻译器
+        fieldTranslator(list);
         return i;
     }
 
@@ -148,6 +155,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
         list.add(genTableColumn);
         isAk(list);
         insertCreateLog(list, BusinessType.UPDATE);
+        fieldTranslator(list);
         return genTableColumnMapper.updateGenTableColumn(genTableColumn);
     }
 
@@ -170,6 +178,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     /**
      * 插入表sql日志
      */
+    @Async
     public void insertCreateLog(List<GenTableColumn> genTableColumnList, BusinessType type) {
         GenTable genTable = genTableMapper.selectGenTableById(genTableColumnList.get(0).getTableId());
         TableSql tableSql = tableSqlMapper.selectTableSqlByTableId(genTableColumnList.get(0).getTableId());
@@ -203,6 +212,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
      *
      * @param genTableColumnList
      */
+    @Async
     public void isAk(List<GenTableColumn> genTableColumnList) {
         GenTable genTable = new GenTable();
         for (GenTableColumn genTableColumn : genTableColumnList) {
@@ -250,6 +260,24 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     }
 
 
+
+    /**
+     * 处理字段翻译器
+     * @param genTableColumnList
+     */
+    @Async
+    public void fieldTranslator (List<GenTableColumn> genTableColumnList) {
+        for (GenTableColumn genTableColumn : genTableColumnList) {
+            String fieldTranslator = genTableColumn.getFieldTranslator();
+            if (StringUtils.isNotBlank(fieldTranslator)){
+                RestTemplate restTemplate = new RestTemplate();
+                restTemplate.postForObject("http://" + fieldTranslator, genTableColumn, GenTableColumn.class);
+            }
+        }
+    }
+
+
+
     /**
      * 删除业务字段对象
      *

+ 0 - 8
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableServiceImpl.java

@@ -452,14 +452,6 @@ public class GenTableServiceImpl implements IGenTableService {
     public AjaxResult insertGenTable(GenTable genTable) {
         String menuRole = genTable.getMenuRole();
         genTable.setMenuRole(menuRole.toUpperCase());
-
-        Integer tableColumn = genTable.getTableColumn();
-        if (tableColumn != null && tableColumn > 0){
-            //判断表单有几列 用24进行除法
-            int num = 24 / tableColumn;
-            genTable.setTableColumn(num);
-
-        }
         //新增表成功的时候,新增字段公共字段
         int i = genTableMapper.insertGenTable(genTable);
         if (i > 0) {

+ 5 - 5
ruoyi-ui/package.json

@@ -37,7 +37,7 @@
   },
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
-    "axios": "0.21.0",
+    "axios": "^0.21.1",
     "burgeon-ui": "1.0.46",
     "clipboard": "2.0.6",
     "core-js": "3.8.1",
@@ -65,21 +65,21 @@
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.6",
     "@vue/cli-plugin-eslint": "4.4.6",
-    "@vue/cli-service": "4.4.6",
+    "@vue/cli-service": "^4.5.13",
     "babel-eslint": "10.1.0",
     "chalk": "4.1.0",
     "connect": "3.6.6",
     "eslint": "7.15.0",
     "eslint-plugin-vue": "7.2.0",
+    "less": "^4.1.1",
+    "less-loader": "^4.1.0",
     "lint-staged": "10.5.3",
     "runjs": "4.4.2",
     "sass": "1.32.0",
     "sass-loader": "10.1.0",
     "script-ext-html-webpack-plugin": "2.1.5",
     "svg-sprite-loader": "5.1.1",
-    "vue-template-compiler": "2.6.12",
-    "less": "^4.1.1",
-    "less-loader": "^4.1.0"
+    "vue-template-compiler": "2.6.12"
   },
   "engines": {
     "node": ">=8.9",

+ 94 - 53
ruoyi-ui/src/components/DynamicForms/index.vue

@@ -1,11 +1,11 @@
 <template>
   <el-form-item label-width="120px" :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
     <!-- 输入框 -->
-    <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-      clearable @keyup.enter.native="handleQuery"  :disabled="formConfig.disabshow" />
+    <el-input v-if="formConfig.htmlType == 'input'" @change="iChange" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
+      clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow" />
     <!-- 多行输入框 -->
-    <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]"
-      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow"/>
+    <el-input v-if="formConfig.htmlType == 'textarea'" @change="iChange" type="textarea" v-model="config[formConfig.columnName]"
+      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow" />
     <!-- 下拉框 -->
     <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo)"
       filterable :placeholder="'请输入'+formConfig.columnComment" :disabled="formConfig.disabshow">
@@ -13,10 +13,11 @@
         :value="itemChild.dictValue">
       </el-option>
     </el-select>
-    <!-- 下拉框搜索 -->
+    <!-- 下拉框搜索 -->
     <el-select :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo)"
-      filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
-      <el-option v-for="itemChild in filterList" :key="itemChild[formConfig.fkInfo.fkColumnName]" :label="itemChild[formConfig.fkInfo.dkColumnName]" :value="itemChild[formConfig.fkInfo.fkColumnName]">
+      filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
+      <el-option v-for="itemChild in filterList" :key="itemChild[formConfig.fkInfo.fkColumnName]" :label="itemChild[formConfig.fkInfo.dkColumnName]"
+        :value="itemChild[formConfig.fkInfo.fkColumnName]">
       </el-option>
     </el-select>
     <!-- 复选框 -->
@@ -31,27 +32,28 @@
       <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
     </el-radio-group>
     <!-- 时间控件 -->
-    <el-date-picker :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
-      :placeholder="'请输入'+formConfig.columnComment">
+    <el-date-picker :disabled="formConfig.disabshow" @change="iChange" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'"
+      type="date" :placeholder="'请输入'+formConfig.columnComment">
     </el-date-picker>
     <!-- 上传图片 -->
-    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
-      :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-success="upImageFn"
-      :on-remove="reseImage">
+    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}"
+      :action="process + '/boman-file/upload'" :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview"
+      :on-success="upImageFn" :on-remove="reseImage">
       <i class="el-icon-plus"></i>
     </el-upload>
     <el-dialog :disabled="formConfig.disabshow" :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
       <img :src="dialogImageUrl" alt="">
     </el-dialog>
     <!-- 上传文件 -->
-    <el-upload :disabled="formConfig.disabshow" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
-      :action="process + '/boman-file/upload'" :on-change="handleChange" :on-success="upImageFn" :on-remove="reseImage"
-      :file-list="config">
+    <el-upload :disabled="formConfig.disabshow" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
+      v-if="formConfig.htmlType == 'fileUpload'" :action="process + '/boman-file/upload'" :on-change="handleChange"
+      :on-success="upImageFn" :on-remove="reseImage" :file-list="config">
       <el-button size="small" type="primary">点击上传</el-button>
       <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
     </el-upload>
     <!-- 富文本 -->
-    <editor :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
+    <editor :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'"
+      :min-height="192" />
   </el-form-item>
 </template>
 
@@ -90,45 +92,83 @@
     components: {
       Editor
     },
-    props: {
+    props: {
+      queryData: {
+        type: Object,
+        default: res => {
+          return {
+            showData: []
+          }
+        }
+      },
       formConfig: {
         type: Object,
         required: true,
-        'default': {
-          sysDictData: []
+        default: res => {
+          return {
+            sysDictData: []
+          }
         }
-      },
+      },
       type: {
         type: Number,
         default: 1
       },
     },
     created() {
-      this.config = {}
-      if(this.type){
-        if(this.formConfig.readonly == true){
-          this.formConfig.disabshow = true
-        }else if(this.formConfig.mask.slice(3,4) == '0' || this.formConfig.isonliy == true){
-          this.formConfig.disabshow = true
-        }else{
-          this.formConfig.disabshow = false
-        }
-        if(this.formConfig.fkInfo == null){
-          this.formConfig.fkInfo=false
-        }
-      }
-      this.init()
-    },
-    watch: {
-      'config': {
-         handler: function() {
-             this.$emit('modelFn',this.formConfig.columnName,this.config[this.formConfig.columnName])
-         },
-         deep: true
-     }
+      this.config = {}
+      if (this.type) {
+        if (this.formConfig.readonly == true) {
+          this.formConfig.disabshow = true
+        } else if (this.formConfig.mask.slice(3, 4) == '0' || this.formConfig.isonliy == true) {
+          this.formConfig.disabshow = true
+        } else {
+          this.formConfig.disabshow = false
+        }
+        if (this.formConfig.fkInfo == null) {
+          this.formConfig.fkInfo = false
+        }
+      }
+      this.init()
+      if (this.formConfig.extendedAttributes) {
+        let extend = JSON.parse(this.formConfig.extendedAttributes)
+        this.extFn(extend.col, extend.comp)
+      }
+    },
+    watch: {
+      'config': {
+        handler: function() {
+          this.$emit('modelFn', this.formConfig.columnName, this.config[this.formConfig.columnName])
+        },
+        deep: true
+      },
+      'queryData': {
+        handler: function() {
+          if (this.formConfig.extendedAttributes) {
+            console.log(this.formConfig,222)
+            let extend = JSON.parse(this.formConfig.extendedAttributes)
+            this.extFn(extend.col, extend.comp)
+          }
+        },
+        deep: true
+      },
     },
     mounted() {},
-    methods: {
+    methods: {
+      iChange(val){
+        if(this.formConfig.isUseExtend){
+          console.log(this.formConfig.columnName)
+          this.$emit('iChange',this.formConfig.columnName,val)
+        }
+      },
+      extFn(col, comp) {
+        let str = this.getDyn(col, this.queryData.showData,comp)
+        this.config[this.formConfig.columnName] = str
+      },
+      eval(code){
+        let fun = new Function(`return ${code}`)();
+        return fun
+      },
       listIndexfouFn() {
         listIndexfou(this.aliemg).then(response => {
           if (response.data) {
@@ -154,15 +194,16 @@
           'fileUpload') {
           this.config = []
         } else {
-          this.$set(this.config, this.formConfig.columnName, ((this.formConfig.columnValue?this.formConfig.columnValue:this.formConfig.defaultValue) || ''))
-        }
-
-        if(this.formConfig.fkInfo){
-          this.aliemg.table = this.formConfig.fkInfo.fkTableName
-          if(this.formConfig.fkInfo.value){
-            this.aliemg.fixedData.condition[this.formConfig.fkInfo.dkColumnName] = this.formConfig.fkInfo.value
-          }
-          this.listIndexfouFn()
+          this.$set(this.config, this.formConfig.columnName, ((this.formConfig.columnValue ? this.formConfig.columnValue :
+            this.formConfig.defaultValue) || ''))
+        }
+
+        if (this.formConfig.fkInfo) {
+          this.aliemg.table = this.formConfig.fkInfo.fkTableName
+          if (this.formConfig.fkInfo.value) {
+            this.aliemg.fixedData.condition[this.formConfig.fkInfo.dkColumnName] = this.formConfig.fkInfo.value
+          }
+          this.listIndexfouFn()
         }
       },
       handleChange(file, fileList) {
@@ -197,7 +238,7 @@
           }
         }
       },
-      handlePictureCardPreview(file) {
+      handlePictureCardPreview(file) {
         console.log(file)
         this.dialogImageUrl = file.url;
         this.dialogVisible = true;

+ 77 - 29
ruoyi-ui/src/components/DynamicFormsteo/index.vue

@@ -1,13 +1,13 @@
 <template>
   <!-- <el-row  class="row-bg"> -->
-  <el-col :span="this.formConfig.tableColumnuy !== null? this.formConfig.tableColumnuy : 8 "  >
-  <el-form-item   :label="formConfig.columnComment"  :prop="formConfig.columnName">
+  <el-col :span="ieug !== null? ieug : 8 "  >
+  <el-form-item label-width="120px" :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
     <!-- 输入框 -->
-    <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-      clearable @keyup.enter.native="handleQuery"  :disabled="formConfig.disabshow" />
+    <el-input v-if="formConfig.htmlType == 'input'" @change="iChange" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
+      clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow" />
     <!-- 多行输入框 -->
-    <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]"
-      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow"/>
+    <el-input v-if="formConfig.htmlType == 'textarea'" @change="iChange" type="textarea" v-model="config[formConfig.columnName]"
+      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow" />
     <!-- 下拉框 -->
     <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo)"
       filterable :placeholder="'请输入'+formConfig.columnComment" :disabled="formConfig.disabshow">
@@ -18,7 +18,8 @@
     <!-- 下拉框搜索 -->
     <el-select :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo)"
       filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
-      <el-option v-for="itemChild in filterList" :key="itemChild[formConfig.fkInfo.fkColumnName]" :label="itemChild[formConfig.fkInfo.dkColumnName]" :value="itemChild[formConfig.fkInfo.fkColumnName]">
+      <el-option v-for="itemChild in filterList" :key="itemChild[formConfig.fkInfo.fkColumnName]" :label="itemChild[formConfig.fkInfo.dkColumnName]"
+        :value="itemChild[formConfig.fkInfo.fkColumnName]">
       </el-option>
     </el-select>
     <!-- 复选框 -->
@@ -33,27 +34,28 @@
       <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
     </el-radio-group>
     <!-- 时间控件 -->
-    <el-date-picker :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
-      :placeholder="'请输入'+formConfig.columnComment">
+    <el-date-picker :disabled="formConfig.disabshow" @change="iChange" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'"
+      type="date" :placeholder="'请输入'+formConfig.columnComment">
     </el-date-picker>
     <!-- 上传图片 -->
-    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
-      :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-success="upImageFn"
-      :on-remove="reseImage">
+    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}"
+      :action="process + '/boman-file/upload'" :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview"
+      :on-success="upImageFn" :on-remove="reseImage">
       <i class="el-icon-plus"></i>
     </el-upload>
     <el-dialog :disabled="formConfig.disabshow" :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
       <img :src="dialogImageUrl" alt="">
     </el-dialog>
     <!-- 上传文件 -->
-    <el-upload :disabled="formConfig.disabshow" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
-      :action="process + '/boman-file/upload'" :on-change="handleChange" :on-success="upImageFn" :on-remove="reseImage"
-      :file-list="config">
+    <el-upload :disabled="formConfig.disabshow" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
+      v-if="formConfig.htmlType == 'fileUpload'" :action="process + '/boman-file/upload'" :on-change="handleChange"
+      :on-success="upImageFn" :on-remove="reseImage" :file-list="config">
       <el-button size="small" type="primary">点击上传</el-button>
       <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
     </el-upload>
     <!-- 富文本 -->
-    <editor :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
+    <editor :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'"
+      :min-height="192" />
   </el-form-item>
   </el-col>
   <!-- </el-row> -->
@@ -87,7 +89,8 @@
           pageSize: 10,
           fixedData: {
             condition: {}
-          }
+          },
+          ieug:8
         },
       }
     },
@@ -95,6 +98,14 @@
       Editor
     },
     props: {
+      queryData: {
+        type: Object,
+        default: res => {
+          return {
+            showData: []
+          }
+        }
+      },
       formConfig: {
         type: Object,
         required: true,
@@ -121,20 +132,56 @@
           this.formConfig.fkInfo=false
         }
       }
+      if(this.formConfig.tableColumnuy == null){
+        this.ieug = null
+      }else{
+        this.ieug = 24 / (this.formConfig.tableColumnuy -0)
+      }
+
+
+      // console.log(this.formConfig.tableColumnuy -0)
       this.init()
+      if (this.formConfig.extendedAttributes) {
+        let extend = JSON.parse(this.formConfig.extendedAttributes)
+        this.extFn(extend.col, extend.comp)
+      }
     },
-    watch: {
-      'config': {
-         handler: function() {
-             this.$emit('modelFn',this.formConfig.columnName,this.config[this.formConfig.columnName])
-         },
-         deep: true
-     }
-    },
+   watch: {
+     'config': {
+       handler: function() {
+         this.$emit('modelFn', this.formConfig.columnName, this.config[this.formConfig.columnName])
+       },
+       deep: true
+     },
+     'queryData': {
+       handler: function() {
+         if (this.formConfig.extendedAttributes) {
+           console.log(this.formConfig,222)
+           let extend = JSON.parse(this.formConfig.extendedAttributes)
+           this.extFn(extend.col, extend.comp)
+         }
+       },
+       deep: true
+     },
+   },
     mounted() {
-      console.log(this.formConfig)
+      // console.log(this.formConfig)
     },
     methods: {
+      iChange(val){
+        if(this.formConfig.isUseExtend){
+          console.log(this.formConfig.columnName)
+          this.$emit('iChange',this.formConfig.columnName,val)
+        }
+      },
+      extFn(col, comp) {
+        let str = this.getDyn(col, this.queryData.showData,comp)
+        this.config[this.formConfig.columnName] = str
+      },
+      eval(code){
+        let fun = new Function(`return ${code}`)();
+        return fun
+      },
       listIndexfouFn() {
         listIndexfou(this.aliemg).then(response => {
           if (response.data) {
@@ -160,12 +207,13 @@
           'fileUpload') {
           this.config = []
         } else {
-          this.$set(this.config, this.formConfig.columnName, (this.formConfig.columnValue || ''))
+          this.$set(this.config, this.formConfig.columnName, ((this.formConfig.columnValue ? this.formConfig.columnValue :
+            this.formConfig.defaultValue) || ''))
         }
 
-        if(this.formConfig.fkInfo){
+        if (this.formConfig.fkInfo) {
           this.aliemg.table = this.formConfig.fkInfo.fkTableName
-          if(this.formConfig.fkInfo.value){
+          if (this.formConfig.fkInfo.value) {
             this.aliemg.fixedData.condition[this.formConfig.fkInfo.dkColumnName] = this.formConfig.fkInfo.value
           }
           this.listIndexfouFn()

+ 86 - 84
ruoyi-ui/src/main.js

@@ -1,98 +1,100 @@
-import Vue from 'vue'
-
+import Vue from 'vue'
+
 import Cookies from 'js-cookie'
 
 // import '@/assets/styles/theme.scss';
 import less from 'less'
-Vue.use(less)
-
-import Element from 'element-ui'
-import './assets/styles/element-variables.scss'
+Vue.use(less)
+
+import Element from 'element-ui'
+import './assets/styles/element-variables.scss'
 import 'burgeon-ui/dist/styles/burgeon-ui.css';
-
-import '@/assets/styles/index.scss' // global css
-import '@/assets/styles/ruoyi.scss' // ruoyi css
-import App from './App'
-import store from './store'
-import router from './router'
-import permission from './directive/permission'
+
+import '@/assets/styles/index.scss' // global css
+import '@/assets/styles/ruoyi.scss' // ruoyi css
+import App from './App'
+import store from './store'
+import router from './router'
+import permission from './directive/permission'
 import { download } from '@/utils/request'
+import { getDyn } from '@/utils/currencyFn'
+
+import '@/utils/dateApi'
 
-import '@/utils/dateApi'
-
-
-import './assets/icons' // icon
-import './permission' // permission control
-import { getDicts } from "@/api/system/dict/data";
-import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
-import Pagination from "@/components/Pagination";
-// 自定义表格工具扩展
-import RightToolbar from "@/components/RightToolbar"
-import DynamicForm from "@/components/DynamicForm"
-import DynamicForms from "@/components/DynamicForms"
-import DynamicFormsteo from "@/components/DynamicFormsteo"
+
+import './assets/icons' // icon
+import './permission' // permission control
+import { getDicts } from "@/api/system/dict/data";
+import { getConfigKey } from "@/api/system/config";
+import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
+import Pagination from "@/components/Pagination";
+// 自定义表格工具扩展
+import RightToolbar from "@/components/RightToolbar"
+import DynamicForm from "@/components/DynamicForm"
+import DynamicForms from "@/components/DynamicForms"
+import DynamicFormsteo from "@/components/DynamicFormsteo"
 import MemoranDum from "@/components/MemoranDum"
 import 'burgeon-ui/dist/styles/burgeon-ui.css';
 import 'burgeon-ui/dist/styles/bjIconfonts/iconfont.css';
 import BigPicture from "@/components/BigPicture";
 Vue.component('BigPicture', BigPicture)
 import BurgeonUi from 'burgeon-ui';
-
-// 全局方法挂载
-Vue.prototype.getDicts = getDicts
-Vue.prototype.getConfigKey = getConfigKey
-Vue.prototype.parseTime = parseTime
-Vue.prototype.resetForm = resetForm
-Vue.prototype.addDateRange = addDateRange
-Vue.prototype.selectDictLabel = selectDictLabel
-Vue.prototype.selectDictLabels = selectDictLabels
-Vue.prototype.download = download
-Vue.prototype.handleTree = handleTree
-
-Vue.prototype.msgSuccess = function (msg) {
-  this.$message({ showClose: true, message: msg, type: "success" });
-}
-
-Vue.prototype.msgError = function (msg) {
-  this.$message({ showClose: true, message: msg, type: "error" });
-}
-
-Vue.prototype.msgInfo = function (msg) {
-  this.$message.info(msg);
-}
-
-import directive from "@/components/Directives";
-Vue.use(directive)
-
-// 全局组件挂载
-Vue.component('Pagination', Pagination)
-Vue.component('RightToolbar', RightToolbar)
-Vue.component('DynamicForm', DynamicForm)
-Vue.component('DynamicForms', DynamicForms)
-Vue.component('DynamicFormsteo', DynamicFormsteo)
-Vue.component('MemoranDum', MemoranDum)
-
+
+// 全局方法挂载
+Vue.prototype.getDicts = getDicts
+Vue.prototype.getConfigKey = getConfigKey
+Vue.prototype.parseTime = parseTime
+Vue.prototype.resetForm = resetForm
+Vue.prototype.addDateRange = addDateRange
+Vue.prototype.selectDictLabel = selectDictLabel
+Vue.prototype.selectDictLabels = selectDictLabels
+Vue.prototype.download = download
+Vue.prototype.getDyn = getDyn
+Vue.prototype.handleTree = handleTree
+
+Vue.prototype.msgSuccess = function (msg) {
+  this.$message({ showClose: true, message: msg, type: "success" });
+}
+
+Vue.prototype.msgError = function (msg) {
+  this.$message({ showClose: true, message: msg, type: "error" });
+}
+
+Vue.prototype.msgInfo = function (msg) {
+  this.$message.info(msg);
+}
+
+import directive from "@/components/Directives";
+Vue.use(directive)
+
+// 全局组件挂载
+Vue.component('Pagination', Pagination)
+Vue.component('RightToolbar', RightToolbar)
+Vue.component('DynamicForm', DynamicForm)
+Vue.component('DynamicForms', DynamicForms)
+Vue.component('DynamicFormsteo', DynamicFormsteo)
+Vue.component('MemoranDum', MemoranDum)
+
 Vue.use(permission)
-
-/**
- * If you don't want to use mock-server
- * you want to use MockJs for mock api
- * you can execute: mockXHR()
- *
- * Currently MockJs will be used in the production environment,
- * please remove it before going online! ! !
- */
-
-Vue.use(Element, {
-  size: Cookies.get('size') || 'medium' // set element-ui default size
-})
-Vue.use(BurgeonUi);
-Vue.config.productionTip = false
-
-new Vue({
-  el: '#app',
-  router,
-  store,
-  render: h => h(App)
-})
+
+/**
+ * If you don't want to use mock-server
+ * you want to use MockJs for mock api
+ * you can execute: mockXHR()
+ *
+ * Currently MockJs will be used in the production environment,
+ * please remove it before going online! ! !
+ */
+
+Vue.use(Element, {
+  size: Cookies.get('size') || 'medium' // set element-ui default size
+})
+Vue.use(BurgeonUi);
+Vue.config.productionTip = false
+
+new Vue({
+  el: '#app',
+  router,
+  store,
+  render: h => h(App)
+})

+ 62 - 0
ruoyi-ui/src/utils/currencyFn.js

@@ -0,0 +1,62 @@
+export function getDyn(col, arr, comp) {
+  let str = comp
+  let is = true
+  let type = ''
+
+  for (let item of arr) {
+    for (let itemChild of item.hrChildren) {
+      for (let colItem of col) {
+        if (itemChild.columnValue) {
+          is = false
+        }
+        if (colItem == itemChild.columnName) {
+          if (itemChild.htmlType == "input") {
+            type = 1
+            str = str.replace(itemChild.columnName, itemChild.columnValue)
+          } else if (itemChild.htmlType == "datetime") {
+            type = 2
+            if(getTime(itemChild.columnValue)){
+              str = str.replace(itemChild.columnName, getTime(itemChild.columnValue))
+            }else{
+              is=true
+            }
+          }
+        }
+      }
+    }
+  }
+  if (is) {
+    return
+  }
+  if (type == 2) {
+    return setTime(evals(str))
+  }
+  return evals(str)
+}
+
+function evals(code) {
+  let fun = new Function(`return ${code}`)();
+  return fun
+}
+// 时间戳转成天
+function setTime(val) {
+  return Number(val) / (1000 * 3600 * 24)
+}
+// 转化成时间戳
+function getTime(val) {
+  var date = new Date(val);
+  return date.getTime()
+}
+export function setDyn(col, arr, comp) {
+  let str = comp
+  for (let item of arr) {
+    for (let itemChild of item.hrChildren) {
+      for (let colItem of col) {
+        if (colItem == itemChild.columnName) {
+          str = str.replace(itemChild.columnName, itemChild.columnValue)
+        }
+      }
+    }
+  }
+  return str
+}

+ 15 - 8
ruoyi-ui/src/views/system/editing/index.vue

@@ -184,6 +184,15 @@
     },
     filters: {},
     methods: {
+      iChange(name,val){
+        for(let item of this.queryData.showData){
+          for(let itemChild of item.hrChildren){
+            if(itemChild.columnName == name){
+              itemChild.columnValue = (val?val:null)
+            }
+          }
+        }
+      },
       modelFn(obj, cont) {
         this.$set(this.queryParams,obj,cont)
       },
@@ -262,22 +271,20 @@
           // 图片的显示隐藏
           if(this.queryData.showData.length !==0){
            this.queryData.showData.filter(route => {
+             route.hrChildren.filter(routerst =>{
+               if(this.queryData.table_column == undefined){
+                 this.queryData.table_column = null
+               }
+               routerst.tableColumnuy = this.queryData.table_column
+             })
                if(route.cssClass !== null){
                  this.imgShoew = route.cssClass
                  if(route.cssClass == 2 || route.cssClass == 4 ){
                    route.hrChildren.filter(routers =>{
-                    if(this.queryData.table_column == undefined){
-                      this.queryData.table_column = null
-                    }
-                    routers.tableColumnuy = this.queryData.table_column
                      routers.isonliy = true
                    })
                  }else{
                    route.hrChildren.filter(routers =>{
-                     if(this.queryData.table_column == undefined){
-                       this.queryData.table_column = null
-                     }
-                     routers.tableColumnuy = this.queryData.table_column
                      routers.isonliy = false
                    })
                  }

+ 17 - 4
ruoyi-ui/src/views/system/form/index.vue

@@ -224,6 +224,15 @@
 
     },
     methods: {
+      iChange(name,val){
+        for(let item of this.queryData.showData){
+          for(let itemChild of item.hrChildren){
+            if(itemChild.columnName == name){
+              itemChild.columnValue = (val?val:null)
+            }
+          }
+        }
+      },
       imgBtn(url) {
         this.pir_imgs = url
         this.$refs.BigPicture.hidden.status = true
@@ -280,7 +289,6 @@
                  if(route.cssClass == 2 || route.cssClass == 4){
                    route.hrChildren.filter(routers =>{
                      routers.isonliy = true
-
                    })
                  }else{
                    route.hrChildren.filter(routers =>{
@@ -598,11 +606,16 @@
          //删除
          this.handleDeletetwo(this.deledlid)
        }  else if(index == '新增'){
-         if(this.cielsshow == true){
-           this.routerFn(-1, this.tabName,this.oieufr,this.forme.table)
+         if(this.objParams.fixedData.id !== -1){
+            this.routerFn(-1, this.tabName,this.oieufr,this.forme.table)
          }else{
-           this.msgInfo('基本信息暂未保存')
+           if(this.cielsshow == true){
+             this.routerFn(-1, this.tabName,this.oieufr,this.forme.table)
+           }else{
+             this.msgInfo('基本信息暂未保存')
+           }
          }
+
        }else if(index == '修改'){
          if (this.single) {
            this.msgInfo('请勾选一条信息')

+ 19 - 16
ruoyi-ui/src/views/system/table/index.vue

@@ -14,17 +14,13 @@
     </div>
     <!-- 内容 -->
     <div class="table_nav headertable_nav table_forem" >
-      <el-collapse v-model="activeNames" @change="handleChange">
-        <el-form :model="queryParams" :rules="queryData.rules" ref="queryForm" :inline="true" :label-width=" this.queryData.table_column == 6 ? '70px' :'110px'" >
+      <el-collapse v-model="activeNames" @change="handleChange">
+        <el-form :model="queryParams" :rules="queryData.rules" ref="queryForm" :inline="true" :label-width="this.queryData.table_column == 6 ? '70px' :'110px'" >
           <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index">
-            <el-row    class="row-bg" >
-              <!-- <el-col :span="24" :key="index" > -->
-                <DynamicFormsteo @modelFn="modelFn" :ref="items.columnName" :config="queryParams" @inputs="changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren"
+                <dynamic-formsteo @iChange="iChange" :queryData="queryData" @modelFn="modelFn" :ref="items.columnName" :config="queryParams" @inputs="changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren"
                   :key='indexs' />
-              <!-- </el-col> -->
-            </el-row>
-          </el-collapse-item>
-        </el-form>
+          </el-collapse-item>
+        </el-form>
       </el-collapse>
     </div>
   </div>
@@ -116,11 +112,19 @@
         this.juegkae = undefined
         this.tabdiese = this.$route.query.tabik
       }
-      console.log(this.forme.fixedData)
       this.init()
       // this.tablsie()
     },
-    methods: {
+    methods: {
+      iChange(name,val){
+        for(let item of this.queryData.showData){
+          for(let itemChild of item.hrChildren){
+            if(itemChild.columnName == name){
+              itemChild.columnValue = (val?val:null)
+            }
+          }
+        }
+      },
       modelFn(obj, cont) {
         this.$set(this.queryParams,obj,cont)
       },
@@ -187,14 +191,13 @@
           //新增
           this.xidugje = 0
           this.reload()
-        } else if (index == '返回') {
-            this.$router.go(-1)
+        } else if (index == '返回') {
+          this.$store.dispatch("tagsView/delView", this.$route);
+          this.$router.go(-1)
         } else if (index == '刷新') {
           this.xidugje = 1
           this.reload()
         }
-
-
         // this.getList();
       },
       getList() {
@@ -268,7 +271,7 @@
                if(this.queryData.table_column == undefined){
                  this.queryData.table_column = null
                }
-               routerst.tableColumnuy = 34
+               routerst.tableColumnuy = this.queryData.table_column
              })
             if(route.cssClass !== null){
               this.imgShoew = route.cssClass