1
0
فهرست منبع

编辑/添加

suochencheng 7 سال پیش
والد
کامیت
0068e39c5d

+ 41 - 71
src/main/resources/templates/FormTemplate.vm

@@ -161,7 +161,7 @@
             <el-form-item>
                 <el-button @click="onSave" :loading="${esc.d}store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
-                <el-button @click="${esc.d}router.go(-1)">取消</el-button>
+                <el-button @click="changeEditDialogVisible(false)">取消</el-button>
             </el-form-item>
         </el-form>
     </div>
@@ -173,66 +173,52 @@ import { format } from 'date-fns'
 import zh from 'date-fns/locale/zh_cn'
 
 export default {
-    created() {
+    props:{
+        formData:{
+            type:Object,
+            default:{
+    #foreach($field in $model.fields)
+        #if(${field.formType}=="multiSelect")
 
-        if (this.${esc.d}route.query.column) {
-            this.subColumn = this.${esc.d}route.query.column.split(',')[1];
-            this.subValue = this.${esc.d}route.query.column.split(',')[0];
-        }
-
-        if (this.${esc.d}route.query.id) {
-            this.${esc.d}http.get({
-                url: '/${display.uncapitalize($model.className)}/getOne',
-                data: {
-                    id: this.${esc.d}route.query.id
-                }
-            }).then(res => {
-                if (res.success) {
+            ${field.modelName} : [],
 
-                #foreach($field in $model.fields)
-                    #if(${field.formType}=="multiSelect")
+        #end
+        #if(${field.formType}=="currentTime")
+            ${field.modelName} : format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
 
-                        if(res.data.${field.modelName}){
-                            res.data.${field.modelName} = res.data.${field.modelName}.split(',');
-                        }else{
-                            res.data.${field.modelName} = [];
-                        }
+        #end
+        #if(${field.formType}=="currentDate")
+            ${field.modelName} : format(new Date(), 'YYYY/MM/DD', { locale: zh }),
 
-                    #end
-                    #if(${field.formType}=="currentTime")
-                            res.data.${field.modelName} = format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh });
+        #end
+        #if(${field.formType}=="loginName")
+            ${field.modelName} : '',
 
-                    #end
-                    #if(${field.formType}=="currentDate")
-                            res.data.${field.modelName} = format(new Date(), 'YYYY/MM/DD', { locale: zh });
+        #end
+        #if(${field.formType}=="workNumber")
+            ${field.modelName} : '',
 
-                    #end
-                    #if(${field.formType}=="loginName")
-                            res.data.${field.modelName} = this.userInfo.username;
+        #end
+        #if(${field.formType}=="departId")
+            ${field.modelName} : '',
 
-                    #end
-                    #if(${field.formType}=="workNumber")
-                            res.data.${field.modelName} = this.userInfo.workNumber;
+        #end
+    #end
+            }
+        }
+    },
 
-                    #end
-                    #if(${field.formType}=="departId")
-                            res.data.${field.modelName} = this.userInfo.departId;
+    created() {
 
-                    #end
-                #end
+        if (this.${esc.d}route.query.column) {
+            this.subColumn = this.${esc.d}route.query.column.split(',')[1];
+            this.subValue = this.${esc.d}route.query.column.split(',')[0];
+        }
 
-                this.formData = res.data;
+    if (this.${esc.d}route.query.column) {
+        this.formData[this.subColumn] = this.subValue;
+    }
 
-                if (this.${esc.d}route.query.column) {
-                    this.formData[this.subColumn] = this.subValue;
-                }
-            }
-        })
-        }else {
-            if (this.${esc.d}route.query.column) {
-                this.formData[this.subColumn] = this.subValue;
-            }
-        }
 
         #foreach($field in $model.fields)
             #if(${field.formType}=="select"||${field.formType}=="multiSelect")
@@ -286,25 +272,6 @@ export default {
     data() {
         return {
             saving: false,
-            formData: {
-        #foreach($field in $model.fields)
-            #if(${field.formType}=="loginName")
-                ${field.modelName}:'',
-            #end
-            #if(${field.formType}=="workNumber")
-                ${field.modelName}:'',
-            #end
-            #if(${field.formType}=="departId")
-                ${field.modelName}:'',
-            #end
-            #if(${field.formType}=="currentTime")
-                ${field.modelName}:format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
-            #end
-            #if(${field.formType}=="currentDate")
-                ${field.modelName}:format(new Date(), 'YYYY/MM/DD', { locale: zh }),
-            #end
-        #end
-    },
         rules: {
             #foreach($field in $model.fields)
                 #if(${field.required}||${field.validate})
@@ -370,6 +337,9 @@ export default {
             ...mapState(['userInfo']),
 },
 methods: {
+    changeEditDialogVisible(value){
+        this.${esc.d}emit('changeEditDialogVisible',value)
+    },
     onSave() {
         this.${esc.d}refs.form.validate((valid) => {
             if (valid) {
@@ -443,7 +413,7 @@ methods: {
     }).then(res => {
         if (res.success) {
             this.${esc.d}message.success('成功');
-            this.${esc.d}router.go(-1);
+            this.${esc.d}emit('changeEdit')
         } else {
             this.${esc.d}message.warning('失败')
         }
@@ -457,7 +427,7 @@ methods: {
             })
         }).then(() => {
             this.${esc.d}message.success('删除成功');
-        this.${esc.d}router.go(-1);
+        this.${esc.d}emit('changeEdit')
     }).catch(action => {
             if (action === 'cancel') {
             this.${esc.d}message.info('删除取消');

+ 473 - 0
src/main/resources/templates/FormTemplate1.vm

@@ -0,0 +1,473 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small"
+                 style="max-width: 500px;">
+            <el-form-item>
+                <h2> ${model.remark}</h2>
+            </el-form-item>
+
+            #foreach($field in $model.fields)
+                #if(${field.showInForm})
+                    #if(${field.formType}=="singleLineText")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <el-input v-model="formData.${field.modelName}" :disabled="'${field.modelName}'==subColumn"></el-input>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="textarea")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <el-input type="textarea" v-model="formData.${field.modelName}" :disabled="'${field.modelName}'==subColumn"></el-input>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="number")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <el-input type="number" v-model="formData.${field.modelName}" :disabled="'${field.modelName}'==subColumn"></el-input>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="date")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <template>
+                    <div class="block">
+                        <el-date-picker
+                                v-model="formData.${field.modelName}"
+                                type="date"
+                                value-format="timestamp"
+                                placeholder="选择日期"
+                                :disabled="'${field.modelName}'==subColumn">
+                        </el-date-picker>
+                    </div>
+                </template>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="datetime")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <template>
+                                <div class="block">
+                                    <el-date-picker
+                                            v-model="formData.${field.modelName}"
+                                            type="datetime"
+                                            value-format="timestamp"
+                                            placeholder="选择日期"
+                                            :disabled="'${field.modelName}'==subColumn">
+                                    </el-date-picker>
+                                </div>
+                            </template>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="select")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <template>
+                    <el-select v-model="formData.${field.modelName}" clearable  placeholder="请选择" :disabled="'${field.modelName}'==subColumn">
+                        <el-option
+                                v-for="item in ${field.modelName}Options"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                        </el-option>
+                    </el-select>
+                </template>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="multiSelect")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <template>
+                    <el-select v-model="formData.${field.modelName}" multiple clearable placeholder="请选择" :disabled="'${field.modelName}'==subColumn">
+                        <el-option
+                                v-for="item in ${field.modelName}Options"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                        </el-option>
+                    </el-select>
+                </template>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="singleImage")
+             <el-form-item prop="${field.modelName}" label="${field.remark}">
+                 <single-upload v-model="formData.${field.modelName}" :disabled="'${field.modelName}'==subColumn"></single-upload>
+             </el-form-item>
+                    #end
+                    #if(${field.formType}=="multiImage")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <multi-upload v-model="formData.${field.modelName}" :disabled="'${field.modelName}'==subColumn"></multi-upload>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="fileUpload")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <el-upload
+                        class="upload-demo"
+                        action="../assets/uploadFile"
+                        :on-change="handleChange"
+                        :file-list="fileList3">
+                    <el-button size="small" type="primary" :disabled="'${field.modelName}'==subColumn" >点击上传</el-button>
+                    <div slot="tip" class="el-upload__tip">只能上传jpg/png文件 ,且不超过500kb</div>
+                </el-upload>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="tree")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <el-tree
+                        :props="props"
+                        :load="loadNode"
+                        lazy
+                        show-checkbox
+                        @check-change="handleCheckChange"
+                        :disabled="'${field.modelName}'==subColumn">
+                </el-tree>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="switch")
+            <el-form-item prop="${field.modelName}" label="${field.remark}">
+                <el-switch
+                        v-model="formData.${field.modelName}"
+                        :disabled="'${field.modelName}'==subColumn">
+                </el-switch>
+            </el-form-item>
+                    #end
+                    #if(${field.formType}=="richText")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <rich-text
+                                    v-model="formData.${field.modelName}"
+                                    :disabled="'${field.modelName}'==subColumn">
+                            </rich-text>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="loginName")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="workNumber")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="departId")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="currentTime")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="currentDate")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                #end
+            #end
+            <el-form-item>
+                <el-button @click="onSave" :loading="${esc.d}store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="${esc.d}router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+import formValidator from '../formValidator'
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
+
+export default {
+    created() {
+
+        if (this.${esc.d}route.query.column) {
+            this.subColumn = this.${esc.d}route.query.column.split(',')[1];
+            this.subValue = this.${esc.d}route.query.column.split(',')[0];
+        }
+
+        if (this.${esc.d}route.query.id) {
+            this.${esc.d}http.get({
+                url: '/${display.uncapitalize($model.className)}/getOne',
+                data: {
+                    id: this.${esc.d}route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
+
+                #foreach($field in $model.fields)
+                    #if(${field.formType}=="multiSelect")
+
+                        if(res.data.${field.modelName}){
+                            res.data.${field.modelName} = res.data.${field.modelName}.split(',');
+                        }else{
+                            res.data.${field.modelName} = [];
+                        }
+
+                    #end
+                    #if(${field.formType}=="currentTime")
+                            res.data.${field.modelName} = format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh });
+
+                    #end
+                    #if(${field.formType}=="currentDate")
+                            res.data.${field.modelName} = format(new Date(), 'YYYY/MM/DD', { locale: zh });
+
+                    #end
+                    #if(${field.formType}=="loginName")
+                            res.data.${field.modelName} = this.userInfo.username;
+
+                    #end
+                    #if(${field.formType}=="workNumber")
+                            res.data.${field.modelName} = this.userInfo.workNumber;
+
+                    #end
+                    #if(${field.formType}=="departId")
+                            res.data.${field.modelName} = this.userInfo.departId;
+
+                    #end
+                #end
+
+                this.formData = res.data;
+
+                if (this.${esc.d}route.query.column) {
+                    this.formData[this.subColumn] = this.subValue;
+                }
+            }
+        })
+        }else {
+            if (this.${esc.d}route.query.column) {
+                this.formData[this.subColumn] = this.subValue;
+            }
+        }
+
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="select"||${field.formType}=="multiSelect")
+                #if(${field.apiFlag}=="2")
+
+
+
+                    this.${esc.d}http.get({
+                        url:'${field.optionsMethod}'
+                    }).then(res => {
+                        if (res.success) {
+
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.${field.modelName}Options.push({label: item.${field.optionsLabel}, value:item.${field.optionsValue}});
+                    })
+                    }
+                }
+                });
+                #elseif(${field.apiFlag}=="3")
+                    this.${esc.d}http.get({
+                        url:'/commonQuery/all',
+                        data: {
+                            tableName: '${field.optionsMethod}',
+                            databasetype: '${field.optionsDataBaseType}',
+                            dataSourceCode: '${field.optionsDataSourceCode}',
+                        }
+                    }).then(res => {
+                        if (res.success) {
+
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.${field.modelName}Options.push({label: item.${field.optionsLabel}, value:item.${field.optionsValue}});
+                    })
+                    }
+                }
+                });
+                #end
+            #end
+            #if(${field.formType}=="loginName")
+                this.formData.${field.modelName} = this.userInfo.username;
+            #end
+            #if(${field.formType}=="workNumber")
+                this.formData.${field.modelName} = this.userInfo.workNumber;
+            #end
+            #if(${field.formType}=="departId")
+                this.formData.${field.modelName} = this.userInfo.departId;
+            #end
+        #end
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="loginName")
+                ${field.modelName}:'',
+            #end
+            #if(${field.formType}=="workNumber")
+                ${field.modelName}:'',
+            #end
+            #if(${field.formType}=="departId")
+                ${field.modelName}:'',
+            #end
+            #if(${field.formType}=="currentTime")
+                ${field.modelName}:format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
+            #end
+            #if(${field.formType}=="currentDate")
+                ${field.modelName}:format(new Date(), 'YYYY/MM/DD', { locale: zh }),
+            #end
+        #end
+    },
+        rules: {
+            #foreach($field in $model.fields)
+                #if(${field.required}||${field.validate})
+                    ${field.modelName}:
+                [
+                    #if(${field.required})
+                        {required: true, message: '请输入 $display.alt(${field.remark},${field.modelName})', trigger: 'blur'},
+                    #end
+                    #if(${field.validate})
+                        #if(${field.maxLength}&&${field.minLength})
+                            { min: ${field.minLength}, max: ${field.maxLength}, message: '长度在 ${field.minLength} 到 ${field.maxLength} 个字符', trigger: 'blur' },
+                        #end
+                        #if(${field.min}&&${field.max})
+                            {
+                                validator: (rule, value, callback) => {
+                                if (value) {
+                                    if (value <= ${field.max} && value >= ${field.min}) {
+                                        callback();
+                                    } else {
+                                        callback(new Error('值在 ${field.min} 到 ${field.max} 之间'));
+                                    }
+                                }
+                            }, trigger: 'blur'
+                        },
+                        #end
+                        #if(${field.validatorType}=="phone")
+                                formValidator.phone,
+                        #end
+                        #if(${field.validatorType}=="number")
+                                formValidator.number,
+                        #end
+                        #if(${field.validatorType}=="url")
+                                formValidator.url,
+                        #end
+                        #if(${field.validatorType}=="email")
+                                formValidator.email,
+                        #end
+                        #if(${field.validatorType}=="idCard")
+                                formValidator.idCard,
+                        #end
+                        #if(${field.validatorType}=="english")
+                                formValidator.english,
+                        #end
+                    #end
+                ],
+                #end
+            #end
+        },
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="select"||${field.formType}=="multiSelect")
+                #if(${field.apiFlag}=="2"||${field.apiFlag}=="3")
+                    ${field.modelName}Options:[],
+                #else
+                            ${field.modelName}Options:${field.optionsValue},
+                #end
+            #end
+        #end
+        subColumn: '',
+                subValue: '',
+    }
+    },
+    computed: {
+            ...mapState(['userInfo']),
+},
+methods: {
+    onSave() {
+        this.${esc.d}refs.form.validate((valid) => {
+            if (valid) {
+                this.logicalValidate();
+            } else {
+                return false;
+    }
+    });
+    },
+    logicalValidate() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+        var logicalData = {
+        #foreach($field in $model.fields)
+            #if(${field.logicalKey})
+                ${field.modelName}:data.${field.modelName},
+            #end
+        #end
+    }
+
+        if (JSON.stringify(logicalData) == '{}') {
+            this.submit();
+        } else {
+            this.${esc.d}http.get({
+                url: '/${display.uncapitalize($model.className)}/getOne',
+                data: logicalData
+            }).then(res => {
+                if (res.success) {
+
+                var logicalFlag = true;
+
+                if (res.data) {
+                    if (this.formData.id) {
+                        if (res.data.id != this.formData.id) {
+                            logicalFlag = false;
+                        }
+                    } else {
+                        logicalFlag = false;
+                    }
+
+                }
+
+                if (logicalFlag) {
+                    this.submit();
+                } else {
+                    this.${esc.d}message.warning('逻辑关键字:'+'#foreach($field in $model.fields)#if(${field.logicalKey})${field.remark},#end#end'+'验证失败')
+                }
+
+
+            } else {
+                this.${esc.d}message.warning('逻辑关键字:'+'#foreach($field in $model.fields)#if(${field.logicalKey})${field.remark},#end#end'+'验证失败')
+            }
+        });
+        }
+    },
+    submit() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="currentTime"||${field.formType}=="currentDate")
+                if(data.${field.modelName}){
+                    data.${field.modelName} = Date.parse(new Date(data.${field.modelName}));
+                }
+
+            #end
+        #end
+
+    this.${esc.d}http.post({
+        url: this.formData.id ? '/${display.uncapitalize($model.className)}/update' : '/${display.uncapitalize($model.className)}/save',
+        data: data
+    }).then(res => {
+        if (res.success) {
+            this.${esc.d}message.success('成功');
+            this.${esc.d}router.go(-1);
+        } else {
+            this.${esc.d}message.warning('失败')
+        }
+    });
+    },
+    onDelete() {
+        this.${esc.d}alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+            return this.${esc.d}http.post({
+                url: '/${display.uncapitalize($model.className)}/del',
+                data: { id: this.formData.id }
+            })
+        }).then(() => {
+            this.${esc.d}message.success('删除成功');
+        this.${esc.d}router.go(-1);
+    }).catch(action => {
+            if (action === 'cancel') {
+            this.${esc.d}message.info('删除取消');
+        } else {
+            this.${esc.d}message.error('删除失败');
+        }
+    })
+    },
+}
+}
+</script>
+<style lang="less" scoped>
+</style>

+ 83 - 10
src/main/resources/templates/ListTemplate.vm

@@ -214,19 +214,53 @@
             <img width="100%" :src="imgSrc" alt="">
         </el-dialog>
 
+        <el-dialog title="编辑${model.remark}" top='10px' :visible.sync="editDialogVisible">
+            <${display.uncapitalize($model.className)} :formData='editRowInfo' @changeEditDialogVisible='changeEditDialogVisible' @changeEdit='changeEdit'></${display.uncapitalize($model.className)}>
+        </el-dialog>
+
     </div>
 </template>
 <script>
     import {mapState} from 'vuex'
     import {format} from 'date-fns'
     import zh from 'date-fns/locale/zh_cn'
-
+    import ${display.uncapitalize($model.className)} from '../pages/${model.className}'
     export default {
         created() {
             this.getData();
         },
         data() {
             return {
+                editRowInfo: {
+            #foreach($field in $model.fields)
+                #if(${field.formType}=="multiSelect")
+
+                    ${field.modelName} : [],
+
+                #end
+                #if(${field.formType}=="currentTime")
+                    ${field.modelName} : format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
+
+                #end
+                #if(${field.formType}=="currentDate")
+                    ${field.modelName} : format(new Date(), 'YYYY/MM/DD', { locale: zh }),
+
+                #end
+                #if(${field.formType}=="loginName")
+                    ${field.modelName} : '',
+
+                #end
+                #if(${field.formType}=="workNumber")
+                    ${field.modelName} : '',
+
+                #end
+                #if(${field.formType}=="departId")
+                    ${field.modelName} :'',
+
+                #end
+            #end
+                },
+                editDialogVisible: false,
                 totalNumber: 0,
                 totalPage: 10,
                 currentPage: 1,
@@ -268,12 +302,19 @@
             }
         },
         computed: {
-            ...mapState(['tableHeight']),
+            ...mapState(['tableHeight','userInfo']),
             selection() {
                 return this.${esc.d}refs.table.selection.map(i => i.id);
             }
         },
         methods: {
+            changeEditDialogVisible(value) {
+                this.editDialogVisible = value
+            },
+            changeEdit() {
+                this.editDialogVisible = false
+                this.getData();
+            },
             pageSizeChange(size) {
                 this.currentPage = 1;
                 this.pageSize = size;
@@ -319,13 +360,42 @@
                 }
             },
             editRow(row) {
-                this.${esc.d}router.push({
-                    path: '/${display.uncapitalize($model.className)}',
-                    query: {
-                        id: row.id,
-                        column: this.${esc.d}route.query.column,
-                    }
-                })
+                var jsonp = { ...row }
+
+                #foreach($field in $model.fields)
+                    #if(${field.formType}=="multiSelect")
+
+                        if(jsonp.${field.modelName}){
+                            jsonp.${field.modelName} = jsonp.${field.modelName}.split(',');
+                        }else{
+                            jsonp.${field.modelName} = [];
+                        }
+
+                    #end
+                    #if(${field.formType}=="currentTime")
+                        jsonp.${field.modelName} = format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh });
+
+                    #end
+                    #if(${field.formType}=="currentDate")
+                        jsonp.${field.modelName} = format(new Date(), 'YYYY/MM/DD', { locale: zh });
+
+                    #end
+                    #if(${field.formType}=="loginName")
+                        jsonp.${field.modelName} = this.userInfo.username;
+
+                    #end
+                    #if(${field.formType}=="workNumber")
+                        jsonp.${field.modelName} = this.userInfo.workNumber;
+
+                    #end
+                    #if(${field.formType}=="departId")
+                        jsonp.${field.modelName} = this.userInfo.departId;
+
+                    #end
+                #end
+
+                this.editRowInfo = jsonp
+                this.editDialogVisible = true
             },
             operation1() {
                 this.${esc.d}notify({
@@ -450,7 +520,10 @@
                 this.imageDialogVisible = true;
             },
 
-        }
+        },
+    components: {
+        ${display.uncapitalize($model.className)}
+    }
     }
 </script>
 <style lang="less" scoped>

+ 202 - 223
src/main/vue/src/pages/TestAaa.vue

@@ -1,61 +1,79 @@
 <template>
     <div>
-        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small" style="max-width: 500px;">
-            <!-- <el-form-item>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small"
+                 style="max-width: 500px;">
+            <el-form-item>
                 <h2> test_aaa</h2>
-            </el-form-item> -->
-
-            <el-form-item prop="imageUrl" label="图片">
-                <single-upload v-model="formData.imageUrl" :disabled="'imageUrl'==subColumn"></single-upload>
             </el-form-item>
-            <el-form-item prop="testName" label="枚举单选">
+
+                                                                                                                                                                                                                                                                 <el-form-item prop="imageUrl" label="图片">
+                 <single-upload v-model="formData.imageUrl" :disabled="'imageUrl'==subColumn"></single-upload>
+             </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                            <el-form-item prop="testName" label="枚举单选">
                 <template>
-                    <el-select v-model="formData.testName" clearable placeholder="请选择" :disabled="'testName'==subColumn">
-                        <el-option v-for="item in testNameOptions" :key="item.value" :label="item.label" :value="item.value">
+                    <el-select v-model="formData.testName" clearable  placeholder="请选择" :disabled="'testName'==subColumn">
+                        <el-option
+                                v-for="item in testNameOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
                         </el-option>
                     </el-select>
                 </template>
             </el-form-item>
-            <el-form-item prop="remark" label="接口单选">
+                                                                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="remark" label="接口单选">
                 <template>
-                    <el-select v-model="formData.remark" clearable placeholder="请选择" :disabled="'remark'==subColumn">
-                        <el-option v-for="item in remarkOptions" :key="item.value" :label="item.label" :value="item.value">
+                    <el-select v-model="formData.remark" clearable  placeholder="请选择" :disabled="'remark'==subColumn">
+                        <el-option
+                                v-for="item in remarkOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
                         </el-option>
                     </el-select>
                 </template>
             </el-form-item>
-            <el-form-item prop="multiSelect" label="表多选">
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <el-form-item prop="multiSelect" label="表多选">
                 <template>
                     <el-select v-model="formData.multiSelect" multiple clearable placeholder="请选择" :disabled="'multiSelect'==subColumn">
-                        <el-option v-for="item in multiSelectOptions" :key="item.value" :label="item.label" :value="item.value">
+                        <el-option
+                                v-for="item in multiSelectOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
                         </el-option>
                     </el-select>
                 </template>
             </el-form-item>
-            <el-form-item prop="testTime" label="时间">
+                                                                                                                                                                                                                                                                                                                                                                                        <el-form-item prop="testTime" label="时间">
                 <template>
                     <div class="block">
-                        <el-date-picker v-model="formData.testTime" type="date" value-format="timestamp" placeholder="选择日期" :disabled="'testTime'==subColumn">
+                        <el-date-picker
+                                v-model="formData.testTime"
+                                type="date"
+                                value-format="timestamp"
+                                placeholder="选择日期"
+                                :disabled="'testTime'==subColumn">
                         </el-date-picker>
                     </div>
                 </template>
             </el-form-item>
-            <el-form-item prop="loginUser" label="登录名">
-                <el-input v-model="formData.loginUser" disabled></el-input>
-            </el-form-item>
-            <el-form-item prop="testcTime" label="当前时间">
-                <el-input v-model="formData.testcTime" disabled></el-input>
-            </el-form-item>
-            <el-form-item prop="testcDate" label="当前日期">
-                <el-input v-model="formData.testcDate" disabled></el-input>
-            </el-form-item>
-            <el-form-item prop="workNumber" label="工号">
-                <el-input v-model="formData.workNumber" disabled></el-input>
-            </el-form-item>
-            <el-form-item prop="departId" label="部门">
-                <el-input v-model="formData.departId" disabled></el-input>
-            </el-form-item>
-            <el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <el-form-item prop="loginUser" label="登录名">
+                            <el-input v-model="formData.loginUser" disabled></el-input>
+                        </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <el-form-item prop="testcTime" label="当前时间">
+                            <el-input v-model="formData.testcTime" disabled></el-input>
+                        </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="testcDate" label="当前日期">
+                            <el-input v-model="formData.testcDate" disabled></el-input>
+                        </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="workNumber" label="工号">
+                            <el-input v-model="formData.workNumber" disabled></el-input>
+                        </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="departId" label="部门">
+                            <el-input v-model="formData.departId" disabled></el-input>
+                        </el-form-item>
+                                                                                                    <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="changeEditDialogVisible(false)">取消</el-button>
@@ -74,235 +92,196 @@ export default {
         formData:{
             type:Object,
             default:{
-                loginUser: '',
-                testcTime: format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
-                testcDate: format(new Date(), 'YYYY/MM/DD', { locale: zh }),
-                workNumber: '',
-                departId: '',
-            }
-        }
-    },
-    created() {
-
-        if (this.$route.query.column) {
-            this.subColumn = this.$route.query.column.split(',')[1];
-            this.subValue = this.$route.query.column.split(',')[0];
-        }
-
-          if (this.$route.query.column) {
-                this.formData[this.subColumn] = this.subValue;
-            }
-
-        // if (this.$route.query.id) {
-        //     this.$http.get({
-        //         url: '/testAaa/getOne',
-        //         data: {
-        //             id: this.$route.query.id
-        //         }
-        //     }).then(res => {
-        //         if (res.success) {
+                                                                                                                                                                                                                                                                                
+            multiSelect : [],
 
+                                                                                                                                                    loginUser : '',
 
-        //             if (res.data.multiSelect) {
-        //                 res.data.multiSelect = res.data.multiSelect.split(',');
-        //             } else {
-        //                 res.data.multiSelect = [];
-        //             }
+                                                        testcTime : format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
 
-        //             res.data.loginUser = this.userInfo.username;
+                                                                                testcDate : format(new Date(), 'YYYY/MM/DD', { locale: zh }),
 
-        //             res.data.testcTime = format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh });
+                                                                                        workNumber : '',
 
-        //             res.data.testcDate = format(new Date(), 'YYYY/MM/DD', { locale: zh });
+                                                                                departId : '',
 
-        //             res.data.workNumber = this.userInfo.workNumber;
-
-        //             res.data.departId = this.userInfo.departId;
+                        }
+        }
+    },
 
+    created() {
 
-        //             this.formData = res.data;
+        if (this.$route.query.column) {
+            this.subColumn = this.$route.query.column.split(',')[1];
+            this.subValue = this.$route.query.column.split(',')[0];
+        }
 
-        //             if (this.$route.query.column) {
-        //                 this.formData[this.subColumn] = this.subValue;
-        //             }
-        //         }
-        //     })
-        // } else {
-        //     if (this.$route.query.column) {
-        //         this.formData[this.subColumn] = this.subValue;
-        //     }
-        // }
+    if (this.$route.query.column) {
+        this.formData[this.subColumn] = this.subValue;
+    }
 
 
+                                                                                                                                                                                                                                                                                                
 
 
-        this.$http.get({
-            url: '/testBbb/all'
-        }).then(res => {
-            if (res.success) {
+                    this.$http.get({
+                        url:'/testBbb/all'
+                    }).then(res => {
+                        if (res.success) {
 
-                if (res.data.length > 0) {
-                    res.data.forEach(item => {
-                        this.remarkOptions.push({ label: item.nameAaa, value: item.nameBbb });
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.remarkOptions.push({label: item.nameAaa, value:item.nameBbb});
                     })
+                    }
                 }
-            }
-        });
-        this.$http.get({
-            url: '/commonQuery/all',
-            data: {
-                tableName: 'test_bbb',
-                databasetype: 'Mysql',
-                dataSourceCode: 'dataSource',
-            }
-        }).then(res => {
-            if (res.success) {
+                });
+                                                                                                                        this.$http.get({
+                        url:'/commonQuery/all',
+                        data: {
+                            tableName: 'test_bbb',
+                            databasetype: 'Mysql',
+                            dataSourceCode: 'dataSource',
+                        }
+                    }).then(res => {
+                        if (res.success) {
 
-                if (res.data.length > 0) {
-                    res.data.forEach(item => {
-                        this.multiSelectOptions.push({ label: item.name_bbb, value: item.name_ccc });
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.multiSelectOptions.push({label: item.name_bbb, value:item.name_ccc});
                     })
+                    }
                 }
-            }
-        });
-        this.formData.loginUser = this.userInfo.username;
-        this.formData.workNumber = this.userInfo.workNumber;
-        this.formData.departId = this.userInfo.departId;
-    },
+                });
+                                                                                                                                                                        this.formData.loginUser = this.userInfo.username;
+                                                                                                                                                                                                                this.formData.workNumber = this.userInfo.workNumber;
+                                                                                                this.formData.departId = this.userInfo.departId;
+                        },
     data() {
         return {
             saving: false,
-            // formData: {
-            //     loginUser: '',
-            //     testcTime: format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
-            //     testcDate: format(new Date(), 'YYYY/MM/DD', { locale: zh }),
-            //     workNumber: '',
-            //     departId: '',
-            // },
-            rules: {
-                testName:
-                    [
-                        { required: true, message: '请输入 枚举单选', trigger: 'blur' },
-                    ],
-                remark:
-                    [
-                        { required: true, message: '请输入 接口单选', trigger: 'blur' },
-                    ],
-                multiSelect:
-                    [
-                        { required: true, message: '请输入 表多选', trigger: 'blur' },
-                    ],
-            },
-            testNameOptions: [{ label: 'A', value: 'A' }, { label: 'B', value: 'B' }, { label: 'C', value: 'C' }],
-            remarkOptions: [],
-            multiSelectOptions: [],
-            subColumn: '',
-            subValue: '',
-        }
+        rules: {
+                                                                                                                                    testName:
+                [
+                                            {required: true, message: '请输入 枚举单选', trigger: 'blur'},
+                                                        ],
+                                                                remark:
+                [
+                                            {required: true, message: '请输入 接口单选', trigger: 'blur'},
+                                                        ],
+                                                                multiSelect:
+                [
+                                            {required: true, message: '请输入 表多选', trigger: 'blur'},
+                                                        ],
+                                                                                                                                                                                                            },
+                                                                                                                            testNameOptions:[{ label: 'A', value: 'A' }, { label: 'B', value: 'B' },{ label: 'C', value: 'C' }],
+                                                                                    remarkOptions:[],
+                                                                                    multiSelectOptions:[],
+                                                                                                                                                                    subColumn: '',
+                subValue: '',
+    }
     },
     computed: {
-        ...mapState(['userInfo']),
+            ...mapState(['userInfo']),
+},
+methods: {
+    changeEditDialogVisible(value){
+        this.$emit('changeEditDialogVisible',value)
     },
-    methods: {
-        changeEditDialogVisible(value){
-            this.$emit('changeEditDialogVisible',value)
-        },
-        onSave() {
-            this.$refs.form.validate((valid) => {
-                if (valid) {
-                    this.logicalValidate();
-                } else {
-                    return false;
-                }
-            });
-        },
-        logicalValidate() {
-            var data = JSON.parse(JSON.stringify(this.formData));
-
-            var logicalData = {
-                testName: data.testName,
-                remark: data.remark,
-            }
-
-            if (JSON.stringify(logicalData) == '{}') {
-                this.submit();
+    onSave() {
+        this.$refs.form.validate((valid) => {
+            if (valid) {
+                this.logicalValidate();
             } else {
-                this.$http.get({
-                    url: '/testAaa/getOne',
-                    data: logicalData
-                }).then(res => {
-                    if (res.success) {
-
-                        var logicalFlag = true;
-
-                        if (res.data) {
-                            if (this.formData.id) {
-                                if (res.data.id != this.formData.id) {
-                                    logicalFlag = false;
-                                }
-                            } else {
-                                logicalFlag = false;
-                            }
+                return false;
+    }
+    });
+    },
+    logicalValidate() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+        var logicalData = {
+                                                                                                testName:data.testName,
+                                                remark:data.remark,
+                                                                                                                                                                    }
+
+        if (JSON.stringify(logicalData) == '{}') {
+            this.submit();
+        } else {
+            this.$http.get({
+                url: '/testAaa/getOne',
+                data: logicalData
+            }).then(res => {
+                if (res.success) {
 
-                        }
+                var logicalFlag = true;
 
-                        if (logicalFlag) {
-                            this.submit();
-                        } else {
-                            this.$message.warning('逻辑关键字:' + '枚举单选,接口单选,' + '验证失败')
+                if (res.data) {
+                    if (this.formData.id) {
+                        if (res.data.id != this.formData.id) {
+                            logicalFlag = false;
                         }
-
-
                     } else {
-                        this.$message.warning('逻辑关键字:' + '枚举单选,接口单选,' + '验证失败')
+                        logicalFlag = false;
                     }
-                });
-            }
-        },
-        submit() {
-            var data = JSON.parse(JSON.stringify(this.formData));
 
-            if (data.testcTime) {
-                data.testcTime = Date.parse(new Date(data.testcTime));
-            }
+                }
 
-            if (data.testcDate) {
-                data.testcDate = Date.parse(new Date(data.testcDate));
-            }
+                if (logicalFlag) {
+                    this.submit();
+                } else {
+                    this.$message.warning('逻辑关键字:'+'枚举单选,接口单选,'+'验证失败')
+                }
 
 
-            this.$http.post({
-                url: this.formData.id ? '/testAaa/update' : '/testAaa/save',
-                data: data
-            }).then(res => {
-                if (res.success) {
-                    this.$message.success('成功');
-                    // this.$router.go(-1);
-                    this.$emit('changeEdit')
-                } else {
-                    this.$message.warning('失败')
+            } else {
+                this.$message.warning('逻辑关键字:'+'枚举单选,接口单选,'+'验证失败')
+            }
+        });
+        }
+    },
+    submit() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+                                                                                                                                                                                                    if(data.testcTime){
+                    data.testcTime = Date.parse(new Date(data.testcTime));
                 }
-            });
-        },
-        onDelete() {
-            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                return this.$http.post({
-                    url: '/testAaa/del',
-                    data: { id: this.formData.id }
-                })
-            }).then(() => {
-                this.$message.success('删除成功');
-                // this.$router.go(-1);
-                 this.$emit('changeEdit')
-            }).catch(action => {
-                if (action === 'cancel') {
-                    this.$message.info('删除取消');
-                } else {
-                    this.$message.error('删除失败');
+
+                                                if(data.testcDate){
+                    data.testcDate = Date.parse(new Date(data.testcDate));
                 }
+
+                                                            
+    this.$http.post({
+        url: this.formData.id ? '/testAaa/update' : '/testAaa/save',
+        data: data
+    }).then(res => {
+        if (res.success) {
+            this.$message.success('成功');
+            this.$emit('changeEdit')
+        } else {
+            this.$message.warning('失败')
+        }
+    });
+    },
+    onDelete() {
+        this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+            return this.$http.post({
+                url: '/testAaa/del',
+                data: { id: this.formData.id }
             })
-        },
-    }
+        }).then(() => {
+            this.$message.success('删除成功');
+        this.$emit('changeEdit')
+    }).catch(action => {
+            if (action === 'cancel') {
+            this.$message.info('删除取消');
+        } else {
+            this.$message.error('删除失败');
+        }
+    })
+    },
+}
 }
 </script>
 <style lang="less" scoped>

+ 463 - 378
src/main/vue/src/pages/TestAaas.vue

@@ -1,22 +1,25 @@
 <template>
     <div>
         <div class="filters-container">
-
+        
             <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
             <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
             </el-button>
-            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
+                       icon="el-icon-search" class="filter-item">高级查询
             </el-button>
-            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small" icon="el-icon-sort" class="filter-item">排序
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
+                       icon="el-icon-sort" class="filter-item">排序
             </el-button>
-            <el-button @click="$router.push({path:'/testAaa',query:{column:$route.query.column}})" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
+            <el-button @click="$router.push({path:'/testAaa',query:{column:$route.query.column}})" type="primary"
+                       size="small" icon="el-icon-edit"
+                       class="filter-item">添加
             </el-button>
             <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
             </el-button>
             <el-dropdown trigger="click" size="medium" class="table-column-filter">
                 <span>
-                    筛选数据
-                    <i class="el-icon-arrow-down el-icon--right"></i>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
                 </span>
                 <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
                     <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
@@ -24,57 +27,120 @@
                 </el-dropdown-menu>
             </el-dropdown>
         </div>
-        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
-            <el-table-column label="test_aaa" align="center">
-                <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
-                </el-table-column>
-                <el-table-column type="index" min-width="50" align="center">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('id')" prop="id" label="id" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('imageUrl')" prop="imageUrl" label="图片" min-width="100">
-                    <template slot-scope="{row}">
-                        <img :src="row.imageUrl" @click="showImg(row.imageUrl)" style="width: 100px;height: 100px;vertical-align: middle;" />
-                    </template>
-
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('testName')" prop="testName" label="枚举单选" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('remark')" prop="remark" label="接口单选" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('multiSelect')" prop="multiSelect" label="表多选" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('testTime')" prop="testTime" label="时间" :formatter="DateFormatter" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('loginUser')" prop="loginUser" label="登录名" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('testcTime')" prop="testcTime" label="当前时间" :formatter="DateTimeFormatter" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('testcDate')" prop="testcDate" label="当前日期" :formatter="DateFormatter" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('workNumber')" prop="workNumber" label="工号" min-width="100">
-                </el-table-column>
-
-                <el-table-column v-if="isColumnShow('departId')" prop="departId" label="部门" min-width="100">
-                </el-table-column>
-                <el-table-column label="操作" align="center" fixed="right" min-width="150">
-                    <template slot-scope="scope">
-                        <el-button @click="$router.push({path:'/TestBbbs',query:{column:scope.row.testName+',nameAaa'}})" type="primary" size="small" plain>子表bbb
-                        </el-button>
-                        <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
-                        <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
-                    </template>
-                </el-table-column>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column label="test_aaa" align="center" >
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                            
+                                            <el-table-column
+                                v-if="isColumnShow('id')"
+                                prop="id"
+                                label="id"
+                                min-width="100">
+                        </el-table-column>
+                                                                                            
+                                            <el-table-column
+                                v-if="isColumnShow('imageUrl')"
+                                prop="imageUrl"
+                                label="图片"
+                                min-width="100">
+                            <template slot-scope="{row}">
+                                <img :src="row.imageUrl" @click="showImg(row.imageUrl)" style="width: 100px;height: 100px;vertical-align: middle;" />
+                            </template>
+
+                        </el-table-column>
+                                                                    
+                                            <el-table-column
+                                v-if="isColumnShow('testName')"
+                                prop="testName"
+                                label="枚举单选"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('remark')"
+                                prop="remark"
+                                label="接口单选"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('multiSelect')"
+                                prop="multiSelect"
+                                label="表多选"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('testTime')"
+                                prop="testTime"
+                                label="时间"
+                                :formatter="DateFormatter"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('loginUser')"
+                                prop="loginUser"
+                                label="登录名"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('testcTime')"
+                                prop="testcTime"
+                                label="当前时间"
+                                :formatter="DateTimeFormatter"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('testcDate')"
+                                prop="testcDate"
+                                label="当前日期"
+                                :formatter="DateFormatter"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('workNumber')"
+                                prop="workNumber"
+                                label="工号"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('departId')"
+                                prop="departId"
+                                label="部门"
+                                min-width="100">
+                        </el-table-column>
+                                                            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150"
+            >
+                <template slot-scope="scope">
+                    <el-button @click="$router.push({path:'/TestBbbs',query:{column:scope.row.testName+',nameAaa'}})" type="primary" size="small" plain>子表bbb
+            </el-button>
+                            <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
             </el-table-column>
         </el-table>
         <div class="pagination-wrapper">
@@ -86,7 +152,15 @@
                     <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div>
-            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
             </el-pagination>
         </div>
         <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
@@ -107,14 +181,16 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
                 <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
                     <template slot-scope="{row}">
                         <el-select v-model="row.searchMethod">
-                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                            <el-option v-for="item in searchMethods" :label="item" :value="item"
+                                       :key="item"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -144,7 +220,8 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -174,6 +251,7 @@
         <el-dialog title="查看图片" :visible.sync="imageDialogVisible" size="small">
             <img width="100%" :src="imgSrc" alt="">
         </el-dialog>
+
         <el-dialog title="编辑test_aaa" top='10px' :visible.sync="editDialogVisible">
             <testAaa :formData='editRowInfo' @changeEditDialogVisible='changeEditDialogVisible' @changeEdit='changeEdit'></testAaa>
         </el-dialog>
@@ -181,358 +259,365 @@
     </div>
 </template>
 <script>
-import { mapState } from 'vuex'
-import { format } from 'date-fns'
-import zh from 'date-fns/locale/zh_cn'
-import testAaa from '../pages/TestAaa'
-export default {
-    created() {
-        this.getData();
-    },
-    data() {
-        return {
-            editRowInfo: {
-                loginUser: '',
-                testcTime: format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
-                testcDate: format(new Date(), 'YYYY/MM/DD', { locale: zh }),
-                workNumber: '',
-                departId: '',
-            },
-            editDialogVisible: false,
-            totalNumber: 0,
-            totalPage: 10,
-            currentPage: 1,
-            pageSize: 20,
-            tableData: [],
-            filter1: '',
-            filter2: '',
-            tableColumns: [
-                {
-                    label: 'id',
-                    value: 'id',
-                    show: true
-                },
-                {
-                    label: '图片',
-                    value: 'imageUrl',
-                    show: true
-                },
-                {
-                    label: '枚举单选',
-                    value: 'testName',
-                    show: true
-                },
-                {
-                    label: '接口单选',
-                    value: 'remark',
-                    show: true
-                },
-                {
-                    label: '表多选',
-                    value: 'multiSelect',
-                    show: true
-                },
-                {
-                    label: '时间',
-                    value: 'testTime',
-                    show: true
-                },
-                {
-                    label: '登录名',
-                    value: 'loginUser',
-                    show: true
-                },
-                {
-                    label: '当前时间',
-                    value: 'testcTime',
-                    show: true
-                },
-                {
-                    label: '当前日期',
-                    value: 'testcDate',
-                    show: true
-                },
-                {
-                    label: '工号',
-                    value: 'workNumber',
-                    show: true
-                },
-                {
-                    label: '部门',
-                    value: 'departId',
-                    show: true
-                },
-            ],
-            multipleMode: false,
-            showAdvancedQueryDialog: false,
-            advancedQueryFields: [],
-            showTableSortDialog: false,
-            tableSortFields: [],
-            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
-            advancedQueryColumns: [
-                {
-                    label: 'id',
-                    value: 'id'
-                },
-                {
-                    label: '图片',
-                    value: 'image_url'
-                },
-                {
-                    label: '枚举单选',
-                    value: 'test_name'
-                },
-                {
-                    label: '接口单选',
-                    value: 'remark'
-                },
-                {
-                    label: '表多选',
-                    value: 'multi_select'
-                },
-                {
-                    label: '时间',
-                    value: 'test_time'
-                },
-                {
-                    label: '登录名',
-                    value: 'login_user'
-                },
-                {
-                    label: '当前时间',
-                    value: 'testc_time'
-                },
-                {
-                    label: '当前日期',
-                    value: 'testc_date'
-                },
-                {
-                    label: '工号',
-                    value: 'work_number'
-                },
-                {
-                    label: '部门',
-                    value: 'depart_id'
-                },
-            ],
-            advancedQuerySearchKey: '',
-            orderByStr: '',
-            imgSrc: '',
-            imageDialogVisible: false,
-        }
-    },
-    computed: {
-        ...mapState(['tableHeight','userInfo']),
-        selection() {
-            return this.$refs.table.selection.map(i => i.id);
-        }
-    },
-    methods: {
-        changeEditDialogVisible(value) {
-            this.editDialogVisible = value
-        },
-        changeEdit() {
-            this.editDialogVisible = false
-            this.getData();
-        },
-        pageSizeChange(size) {
-            this.currentPage = 1;
-            this.pageSize = size;
+    import {mapState} from 'vuex'
+    import {format} from 'date-fns'
+    import zh from 'date-fns/locale/zh_cn'
+    import testAaa from '../pages/TestAaa'
+    export default {
+        created() {
             this.getData();
         },
-        currentPageChange(page) {
-            this.currentPage = page;
-            this.getData();
+        data() {
+            return {
+                editRowInfo: {
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+                    multiSelect : [],
+
+                                                                                                                                                                                                                                                                                                            loginUser : '',
+
+                                                                                                                testcTime : format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
+
+                                                                                                                                                                testcDate : format(new Date(), 'YYYY/MM/DD', { locale: zh }),
+
+                                                                                                                                                                                workNumber : '',
+
+                                                                                                                                                                departId :'',
+
+                                            },
+                editDialogVisible: false,
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                                        {
+                                label: 'id',
+                                value: 'id',
+                                show: true
+                            },
+                                                                                                                                            {
+                                label: '图片',
+                                value: 'imageUrl',
+                                show: true
+                            },
+                                                                                                {
+                                label: '枚举单选',
+                                value: 'testName',
+                                show: true
+                            },
+                                                                                                {
+                                label: '接口单选',
+                                value: 'remark',
+                                show: true
+                            },
+                                                                                                {
+                                label: '表多选',
+                                value: 'multiSelect',
+                                show: true
+                            },
+                                                                                                {
+                                label: '时间',
+                                value: 'testTime',
+                                show: true
+                            },
+                                                                                                {
+                                label: '登录名',
+                                value: 'loginUser',
+                                show: true
+                            },
+                                                                                                {
+                                label: '当前时间',
+                                value: 'testcTime',
+                                show: true
+                            },
+                                                                                                {
+                                label: '当前日期',
+                                value: 'testcDate',
+                                show: true
+                            },
+                                                                                                {
+                                label: '工号',
+                                value: 'workNumber',
+                                show: true
+                            },
+                                                                                                {
+                                label: '部门',
+                                value: 'departId',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                        {
+                                label: 'id',
+                                value: 'id'
+                            },
+                                                                                                                                            {
+                                label: '图片',
+                                value: 'image_url'
+                            },
+                                                                                                {
+                                label: '枚举单选',
+                                value: 'test_name'
+                            },
+                                                                                                {
+                                label: '接口单选',
+                                value: 'remark'
+                            },
+                                                                                                {
+                                label: '表多选',
+                                value: 'multi_select'
+                            },
+                                                                                                {
+                                label: '时间',
+                                value: 'test_time'
+                            },
+                                                                                                {
+                                label: '登录名',
+                                value: 'login_user'
+                            },
+                                                                                                {
+                                label: '当前时间',
+                                value: 'testc_time'
+                            },
+                                                                                                {
+                                label: '当前日期',
+                                value: 'testc_date'
+                            },
+                                                                                                {
+                                label: '工号',
+                                value: 'work_number'
+                            },
+                                                                                                {
+                                label: '部门',
+                                value: 'depart_id'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+                orderByStr: '',
+                imgSrc: '',
+                imageDialogVisible: false,
+            }
         },
-        getData() {
-
-            var data = {
-                currentPage: this.currentPage,
-                pageNumber: this.pageSize,
-                searchKey: this.filter1,
-                advancedQuery: this.advancedQuerySearchKey,
-                orderByStr: this.orderByStr,
+        computed: {
+            ...mapState(['tableHeight','userInfo']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
             }
+        },
+        methods: {
+            changeEditDialogVisible(value) {
+                this.editDialogVisible = value
+            },
+            changeEdit() {
+                this.editDialogVisible = false
+                this.getData();
+            },
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+
+                var data = {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                    orderByStr: this.orderByStr,
+                }
 
-            if (this.$route.query.column) {
-                var tempColumn = this.$route.query.column;
-                data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
-            }
+                if (this.$route.query.column) {
+                    var tempColumn = this.$route.query.column;
+                    data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
+                }
 
-            this.$http.get({
-                url: '/testAaa/page',
-                data: data
-            }).then(res => {
-                if (res.success) {
-                    this.totalNumber = res.data.page.totalNumber;
-                    this.tableData = res.data.pp;
+                this.$http.get({
+                    url: '/testAaa/page',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
                 }
-            })
-        },
-        isColumnShow(column) {
-            var row = this.tableColumns.find(i => i.value === column);
-            return row ? row.show : false;
-        },
-        toggleMultipleMode(multipleMode) {
-            this.multipleMode = multipleMode;
-            if (!multipleMode) {
-                this.$refs.table.clearSelection();
-            }
-        },
-        editRow(row) {
-            // this.$router.push({
-            //     path: '/testAaa',
-            //     query: {
-            //         id: row.id,
-            //         column: this.$route.query.column,
-            //     }
-            // })
-            var jsonp = { ...row }
-            if (jsonp.multiSelect) {
-                jsonp.multiSelect = jsonp.multiSelect.split(',');
-            } else {
-                jsonp.multiSelect = [];
-            }
-            jsonp.loginUser = this.userInfo.username;
+            },
+            editRow(row) {
+                var jsonp = { ...row }
 
-            jsonp.testcTime = format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh });
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+                        if(jsonp.multiSelect){
+                            jsonp.multiSelect = jsonp.multiSelect.split(',');
+                        }else{
+                            jsonp.multiSelect = [];
+                        }
 
-            jsonp.testcDate = format(new Date(), 'YYYY/MM/DD', { locale: zh });
+                                                                                                                                                                                                                                                                                                                                                                                        jsonp.loginUser = this.userInfo.username;
 
-            jsonp.workNumber = this.userInfo.workNumber;
+                                                                                                                                            jsonp.testcTime = format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh });
 
-            jsonp.departId = this.userInfo.departId;
-            this.editRowInfo = jsonp
-            this.editDialogVisible = true
-        },
-        operation1() {
-            this.$notify({
-                title: '提示',
-                message: this.selection
-            });
-        },
-        operation2() {
-            this.$message('操作2');
-        },
-        addField() {
-            this.advancedQueryFields.push({
-                link: 'AND',
-                name: '',
-                searchMethod: '=',
-                value: '',
-            });
-        },
-        removeField(i) {
-            if (this.advancedQueryFields.length > 0) {
-                this.advancedQueryFields.splice(i, 1);
-            }
-        },
-        advancedQuery() {
+                                                                                                                                                                                                        jsonp.testcDate = format(new Date(), 'YYYY/MM/DD', { locale: zh });
 
-            this.advancedQuerySearchKey = '';
+                                                                                                                                                                                                                            jsonp.workNumber = this.userInfo.workNumber;
 
-            if (this.advancedQueryFields.length > 0) {
+                                                                                                                                                                                                        jsonp.departId = this.userInfo.departId;
 
-                var templist = [];
+                                    
+                this.editRowInfo = jsonp
+                this.editDialogVisible = true
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
 
-                this.advancedQueryFields.forEach(item => {
-                    if (item.link && item.name && item.searchMethod && item.value) {
-                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
-                        templist.push(tempItem);
-                    }
-                })
+                this.advancedQuerySearchKey = '';
 
-                if (templist.length > 0) {
+                if (this.advancedQueryFields.length > 0) {
 
-                    this.advancedQuerySearchKey = templist.join('_;');
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
                 }
-            }
 
-            this.getData();
-            this.showAdvancedQueryDialog = false;
-        },
-        addSortField() {
-            this.tableSortFields.push({
-                name: '',
-                order: 'asc',
-            });
-        },
-        removeSortField(i) {
-            if (this.tableSortFields.length > 0) {
-                this.tableSortFields.splice(i, 1);
-            }
-        },
-        tableSortQuery() {
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            addSortField() {
+                this.tableSortFields.push({
+                    name: '',
+                    order: 'asc',
+                });
+            },
+            removeSortField(i) {
+                if (this.tableSortFields.length > 0) {
+                    this.tableSortFields.splice(i, 1);
+                }
+            },
+            tableSortQuery() {
 
-            this.orderByStr = '';
+                this.orderByStr = '';
 
-            if (this.tableSortFields.length > 0) {
+                if (this.tableSortFields.length > 0) {
 
-                var templist = [];
+                    var templist = [];
 
-                this.tableSortFields.forEach(item => {
-                    if (item.name && item.order) {
-                        var tempItem = item.name + '_,' + item.order;
-                        templist.push(tempItem);
-                    }
-                })
+                    this.tableSortFields.forEach(item => {
+                        if (item.name && item.order) {
+                            var tempItem = item.name + '_,' + item.order;
+                            templist.push(tempItem);
+                        }
+                    })
 
-                if (templist.length > 0) {
+                    if (templist.length > 0) {
 
-                    this.orderByStr = templist.join('_;');
+                        this.orderByStr = templist.join('_;');
+                    }
                 }
-            }
 
-            this.getData();
-            this.showTableSortDialog = false;
-        },
-        exportExcel() {
-            window.location.href = this.$baseUrl + "/testAaa/exportExcel?searchKey="
-                + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey + "&orderByStr=" + this.orderByStr;
-        },
-        searchData() {
-            this.currentPage = 1;
-            this.getData();
-        },
-        deleteRow(row) {
-            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                return this.$http.post({
-                    url: '/testAaa/del',
-                    data: { id: row.id }
-                })
-            }).then(() => {
-                this.$message.success('删除成功');
                 this.getData();
-            }).catch(action => {
-                if (action === 'cancel') {
-                    this.$message.info('删除取消');
-                } else {
-                    this.$message.error('删除失败');
+                this.showTableSortDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testAaa/exportExcel?searchKey="
+                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post({
+                        url: '/testAaa/del',
+                        data: {id: row.id}
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+            DateTimeFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
                 }
-            })
-        },
-        DateTimeFormatter(row, column, cellValue) {
-            if (cellValue) {
-                return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh })
-            }
 
-        },
-        DateFormatter(row, column, cellValue) {
-            if (cellValue) {
-                return format(cellValue, 'YYYY/MM/DD', { locale: zh })
-            }
+            },
+            DateFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
+                }
 
-        },
-        showImg(img) {
-            this.imgSrc = img;
-            this.imageDialogVisible = true;
-        },
+            },
+            showImg(img) {
+                this.imgSrc = img;
+                this.imageDialogVisible = true;
+            },
 
-    },
+        },
     components: {
         testAaa
     }
-}
+    }
 </script>
 <style lang="less" scoped>
+
 </style>

+ 138 - 92
src/main/vue/src/pages/TestBbb.vue

@@ -1,126 +1,172 @@
 <template>
     <div>
-        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small"
                  style="max-width: 500px;">
+            <el-form-item>
+                <h2> 测试表BBB</h2>
+            </el-form-item>
+
                                                                                                                     <el-form-item prop="nameAaa" label="名称1">
                 <el-input v-model="formData.nameAaa" :disabled="'nameAaa'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="nameBbb" label="名称2">
+                                                                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="nameBbb" label="名称2">
                 <el-input v-model="formData.nameBbb" :disabled="'nameBbb'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="nameCcc" label="名称3">
+                                                                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="nameCcc" label="名称3">
                 <el-input v-model="formData.nameCcc" :disabled="'nameCcc'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="nameDdd" label="名称4">
+                                                                                                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="nameDdd" label="名称4">
                 <el-input v-model="formData.nameDdd" :disabled="'nameDdd'==subColumn"></el-input>
             </el-form-item>
-                                                                                                                                                                                                                                                                                        <el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
-                <el-button @click="$router.go(-1)">取消</el-button>
+                <el-button @click="changeEditDialogVisible(false)">取消</el-button>
             </el-form-item>
         </el-form>
     </div>
 </template>
 <script>
-    import formValidator from '../formValidator'
+import formValidator from '../formValidator'
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
 
-    export default {
-        created() {
-            if (this.$route.query.column) {
-                this.subColumn = this.$route.query.column.split(',')[1];
-                this.subValue = this.$route.query.column.split(',')[0];
-            }
+export default {
+    props:{
+        formData:{
+            type:Object,
+            default:{
+                                                                                                                                                                                                                                                                                                                                        }
+        }
+    },
 
-            if (this.$route.query.id) {
-                this.$http.get({
-                    url: '/testBbb/getOne',
-                    data: {
-                        id: this.$route.query.id
-                    }
-                }).then(res => {
-                    if (res.success) {
+    created() {
 
-                                                                                                                                                                                                                                                                                                                                                
-                        this.formData = res.data;
+        if (this.$route.query.column) {
+            this.subColumn = this.$route.query.column.split(',')[1];
+            this.subValue = this.$route.query.column.split(',')[0];
+        }
 
-                    if (this.$route.query.column) {
-                        this.formData[this.subColumn] = this.subValue;
-                    }
-                    }
-                })
-            }else {
-                if (this.$route.query.column) {
-                    this.formData[this.subColumn] = this.subValue;
-                }
-            }
+    if (this.$route.query.column) {
+        this.formData[this.subColumn] = this.subValue;
+    }
 
-                                                                                                                                                                                            },
-        data() {
-            return {
-                saving: false,
-                formData: {},
-                rules: {
+
+                                                                                                                                                                                                                                                                                                                                                            },
+    data() {
+        return {
+            saving: false,
+        rules: {
                                                                                                         nameAaa:
-                    [
-                                                {required: true, message: '请输入 名称1', trigger: 'blur'},
-                                                                    ],
+                [
+                                            {required: true, message: '请输入 名称1', trigger: 'blur'},
+                                                        ],
                                                                 nameBbb:
-                    [
-                                                {required: true, message: '请输入 名称2', trigger: 'blur'},
-                                                                    ],
+                [
+                                            {required: true, message: '请输入 名称2', trigger: 'blur'},
+                                                        ],
                                                                 nameCcc:
-                    [
-                                                {required: true, message: '请输入 名称3', trigger: 'blur'},
-                                                                    ],
+                [
+                                            {required: true, message: '请输入 名称3', trigger: 'blur'},
+                                                        ],
                                                                 },
-                                                            subColumn: '',
-            subValue: '',
-        }
-        },
-        methods: {
-            onSave() {
-                this.$refs.form.validate((valid) => {
-                    if (valid) {
-                        this.submit();
-                    } else {
-                        return false;
-                    }
-                });
-            },
-            submit() {
-                var data = JSON.parse(JSON.stringify(this.formData));
-                this.$http.post({
-                    url: this.formData.id ? '/testBbb/update' : '/testBbb/save',
-                    data: data
-                }).then(res => {
-                    if (res.success) {
-                        this.$message.success('成功');
-                        this.$router.go(-1);
-                    } else {
-                        this.$message.warning('失败')
-                    }
-                });
-            },
-            onDelete() {
-                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                    return this.$http.post({
-                    url: '/testBbb/del',
-                    data: { id: this.formData.id }
-                    })
-                }).then(() => {
-                    this.$message.success('删除成功');
-                    this.$router.go(-1);
-                }).catch(action => {
-                    if (action === 'cancel') {
-                        this.$message.info('删除取消');
+                                                                                                                                        subColumn: '',
+                subValue: '',
+    }
+    },
+    computed: {
+            ...mapState(['userInfo']),
+},
+methods: {
+    changeEditDialogVisible(value){
+        this.$emit('changeEditDialogVisible',value)
+    },
+    onSave() {
+        this.$refs.form.validate((valid) => {
+            if (valid) {
+                this.logicalValidate();
+            } else {
+                return false;
+    }
+    });
+    },
+    logicalValidate() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+        var logicalData = {
+                                                                                                                                    }
+
+        if (JSON.stringify(logicalData) == '{}') {
+            this.submit();
+        } else {
+            this.$http.get({
+                url: '/testBbb/getOne',
+                data: logicalData
+            }).then(res => {
+                if (res.success) {
+
+                var logicalFlag = true;
+
+                if (res.data) {
+                    if (this.formData.id) {
+                        if (res.data.id != this.formData.id) {
+                            logicalFlag = false;
+                        }
                     } else {
-                        this.$message.error('删除失败');
+                        logicalFlag = false;
                     }
-                })
-            },
+
+                }
+
+                if (logicalFlag) {
+                    this.submit();
+                } else {
+                    this.$message.warning('逻辑关键字:'+''+'验证失败')
+                }
+
+
+            } else {
+                this.$message.warning('逻辑关键字:'+''+'验证失败')
+            }
+        });
         }
-    }
+    },
+    submit() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+                                                                                                                                
+    this.$http.post({
+        url: this.formData.id ? '/testBbb/update' : '/testBbb/save',
+        data: data
+    }).then(res => {
+        if (res.success) {
+            this.$message.success('成功');
+            this.$emit('changeEdit')
+        } else {
+            this.$message.warning('失败')
+        }
+    });
+    },
+    onDelete() {
+        this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+            return this.$http.post({
+                url: '/testBbb/del',
+                data: { id: this.formData.id }
+            })
+        }).then(() => {
+            this.$message.success('删除成功');
+        this.$emit('changeEdit')
+    }).catch(action => {
+            if (action === 'cancel') {
+            this.$message.info('删除取消');
+        } else {
+            this.$message.error('删除失败');
+        }
+    })
+    },
+}
+}
 </script>
 <style lang="less" scoped>
 </style>

+ 315 - 251
src/main/vue/src/pages/TestBbbs.vue

@@ -1,22 +1,25 @@
 <template>
     <div>
         <div class="filters-container">
-
+        
             <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
             <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
             </el-button>
-            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
+                       icon="el-icon-search" class="filter-item">高级查询
             </el-button>
-            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small" icon="el-icon-sort" class="filter-item">排序
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
+                       icon="el-icon-sort" class="filter-item">排序
             </el-button>
-            <el-button @click="$router.push({path:'/testBbb',query:{column:$route.query.column}})" type="primary" size="small" icon="el-icon-edit" class="filter-item">添加
+            <el-button @click="$router.push({path:'/testBbb',query:{column:$route.query.column}})" type="primary"
+                       size="small" icon="el-icon-edit"
+                       class="filter-item">添加
             </el-button>
             <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
             </el-button>
             <el-dropdown trigger="click" size="medium" class="table-column-filter">
                 <span>
-                    筛选数据
-                    <i class="el-icon-arrow-down el-icon--right"></i>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
                 </span>
                 <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
                     <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
@@ -24,29 +27,63 @@
                 </el-dropdown-menu>
             </el-dropdown>
         </div>
-        <el-table :data="tableData" :height="tableHeight" row-key="id" ref="table">
-            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
-            </el-table-column>
-            <el-table-column type="index" min-width="50" align="center">
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column label="测试表BBB" align="center" >
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
             </el-table-column>
-
-            <el-table-column v-if="isColumnShow('nameAaa')" prop="nameAaa" label="名称1" min-width="100">
-            </el-table-column>
-
-            <el-table-column v-if="isColumnShow('nameBbb')" prop="nameBbb" label="名称2" min-width="100">
-            </el-table-column>
-
-            <el-table-column v-if="isColumnShow('nameCcc')" prop="nameCcc" label="名称3" min-width="100">
-            </el-table-column>
-
-            <el-table-column v-if="isColumnShow('nameDdd')" prop="nameDdd" label="名称4" min-width="100">
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
             </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right" min-width="150">
+                                                                                    
+                                            <el-table-column
+                                v-if="isColumnShow('nameAaa')"
+                                prop="nameAaa"
+                                label="名称1"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('nameBbb')"
+                                prop="nameBbb"
+                                label="名称2"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('nameCcc')"
+                                prop="nameCcc"
+                                label="名称3"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('nameDdd')"
+                                prop="nameDdd"
+                                label="名称4"
+                                min-width="100">
+                        </el-table-column>
+                                                            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150"
+            >
                 <template slot-scope="scope">
-                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                            <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
                     <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
+            </el-table-column>
         </el-table>
         <div class="pagination-wrapper">
             <div class="multiple-mode-wrapper" v-if="0">
@@ -57,7 +94,15 @@
                     <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div>
-            <el-pagination background @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalNumber">
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
             </el-pagination>
         </div>
         <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
@@ -78,14 +123,16 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
                 <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
                     <template slot-scope="{row}">
                         <el-select v-model="row.searchMethod">
-                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                            <el-option v-for="item in searchMethods" :label="item" :value="item"
+                                       :key="item"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -115,7 +162,8 @@
                     <template slot-scope="{row}">
                         <el-select v-model="row.name">
 
-                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
                         </el-select>
                     </template>
                 </el-table-column>
@@ -146,263 +194,279 @@
             <img width="100%" :src="imgSrc" alt="">
         </el-dialog>
 
+        <el-dialog title="编辑测试表BBB" top='10px' :visible.sync="editDialogVisible">
+            <testBbb :formData='editRowInfo' @changeEditDialogVisible='changeEditDialogVisible' @changeEdit='changeEdit'></testBbb>
+        </el-dialog>
+
     </div>
 </template>
 <script>
-import { mapState } from 'vuex'
-import { format } from 'date-fns'
-import zh from 'date-fns/locale/zh_cn'
-
-export default {
-    created() {
-        this.getData();
-    },
-    data() {
-        return {
-            totalNumber: 0,
-            totalPage: 10,
-            currentPage: 1,
-            pageSize: 20,
-            tableData: [],
-            filter1: '',
-            filter2: '',
-            tableColumns: [
-                {
-                    label: '名称1',
-                    value: 'nameAaa',
-                    show: true
-                },
-                {
-                    label: '名称2',
-                    value: 'nameBbb',
-                    show: true
-                },
-                {
-                    label: '名称3',
-                    value: 'nameCcc',
-                    show: true
-                },
-                {
-                    label: '名称4',
-                    value: 'nameDdd',
-                    show: true
-                },
-            ],
-            multipleMode: false,
-            showAdvancedQueryDialog: false,
-            advancedQueryFields: [],
-            showTableSortDialog: false,
-            tableSortFields: [],
-            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
-            advancedQueryColumns: [
-                {
-                    label: '名称1',
-                    value: 'name_aaa'
-                },
-                {
-                    label: '名称2',
-                    value: 'name_bbb'
-                },
-                {
-                    label: '名称3',
-                    value: 'name_ccc'
-                },
-                {
-                    label: '名称4',
-                    value: 'name_ddd'
-                },
-            ],
-            advancedQuerySearchKey: '',
-            orderByStr: '',
-            imgSrc: '',
-            imageDialogVisible: false,
-        }
-    },
-    computed: {
-        ...mapState(['tableHeight']),
-        selection() {
-            return this.$refs.table.selection.map(i => i.id);
-        }
-    },
-    methods: {
-        pageSizeChange(size) {
-            this.currentPage = 1;
-            this.pageSize = size;
+    import {mapState} from 'vuex'
+    import {format} from 'date-fns'
+    import zh from 'date-fns/locale/zh_cn'
+    import testBbb from '../pages/TestBbb'
+    export default {
+        created() {
             this.getData();
         },
-        currentPageChange(page) {
-            this.currentPage = page;
-            this.getData();
+        data() {
+            return {
+                editRowInfo: {
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    },
+                editDialogVisible: false,
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                                                                                                                                {
+                                label: '名称1',
+                                value: 'nameAaa',
+                                show: true
+                            },
+                                                                                                {
+                                label: '名称2',
+                                value: 'nameBbb',
+                                show: true
+                            },
+                                                                                                {
+                                label: '名称3',
+                                value: 'nameCcc',
+                                show: true
+                            },
+                                                                                                {
+                                label: '名称4',
+                                value: 'nameDdd',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                                                                                                                {
+                                label: '名称1',
+                                value: 'name_aaa'
+                            },
+                                                                                                {
+                                label: '名称2',
+                                value: 'name_bbb'
+                            },
+                                                                                                {
+                                label: '名称3',
+                                value: 'name_ccc'
+                            },
+                                                                                                {
+                                label: '名称4',
+                                value: 'name_ddd'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+                orderByStr: '',
+                imgSrc: '',
+                imageDialogVisible: false,
+            }
         },
-        getData() {
-
-            var data = {
-                currentPage: this.currentPage,
-                pageNumber: this.pageSize,
-                searchKey: this.filter1,
-                advancedQuery: this.advancedQuerySearchKey,
-                orderByStr: this.orderByStr,
+        computed: {
+            ...mapState(['tableHeight','userInfo']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
             }
+        },
+        methods: {
+            changeEditDialogVisible(value) {
+                this.editDialogVisible = value
+            },
+            changeEdit() {
+                this.editDialogVisible = false
+                this.getData();
+            },
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+
+                var data = {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                    orderByStr: this.orderByStr,
+                }
 
-            if (this.$route.query.column) {
-                var tempColumn = this.$route.query.column;
-                data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
-            }
+                if (this.$route.query.column) {
+                    var tempColumn = this.$route.query.column;
+                    data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
+                }
 
-            this.$http.get({
-                url: '/testBbb/page',
-                data: data
-            }).then(res => {
-                if (res.success) {
-                    this.totalNumber = res.data.page.totalNumber;
-                    this.tableData = res.data.pp;
+                this.$http.get({
+                    url: '/testBbb/page',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
                 }
-            })
-        },
-        isColumnShow(column) {
-            var row = this.tableColumns.find(i => i.value === column);
-            return row ? row.show : false;
-        },
-        toggleMultipleMode(multipleMode) {
-            this.multipleMode = multipleMode;
-            if (!multipleMode) {
-                this.$refs.table.clearSelection();
-            }
-        },
-        editRow(row) {
-            this.$router.push({
-                path: '/testBbb',
-                query: {
-                    id: row.id,
-                    column: this.$route.query.column,
+            },
+            editRow(row) {
+                var jsonp = { ...row }
+
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
+                this.editRowInfo = jsonp
+                this.editDialogVisible = true
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
                 }
-            })
-        },
-        operation1() {
-            this.$notify({
-                title: '提示',
-                message: this.selection
-            });
-        },
-        operation2() {
-            this.$message('操作2');
-        },
-        addField() {
-            this.advancedQueryFields.push({
-                link: 'AND',
-                name: '',
-                searchMethod: '=',
-                value: '',
-            });
-        },
-        removeField(i) {
-            if (this.advancedQueryFields.length > 0) {
-                this.advancedQueryFields.splice(i, 1);
-            }
-        },
-        advancedQuery() {
+            },
+            advancedQuery() {
 
-            this.advancedQuerySearchKey = '';
+                this.advancedQuerySearchKey = '';
 
-            if (this.advancedQueryFields.length > 0) {
+                if (this.advancedQueryFields.length > 0) {
 
-                var templist = [];
+                    var templist = [];
 
-                this.advancedQueryFields.forEach(item => {
-                    if (item.link && item.name && item.searchMethod && item.value) {
-                        var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
-                        templist.push(tempItem);
-                    }
-                })
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
 
-                if (templist.length > 0) {
+                    if (templist.length > 0) {
 
-                    this.advancedQuerySearchKey = templist.join('_;');
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
                 }
-            }
 
-            this.getData();
-            this.showAdvancedQueryDialog = false;
-        },
-        addSortField() {
-            this.tableSortFields.push({
-                name: '',
-                order: 'asc',
-            });
-        },
-        removeSortField(i) {
-            if (this.tableSortFields.length > 0) {
-                this.tableSortFields.splice(i, 1);
-            }
-        },
-        tableSortQuery() {
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            addSortField() {
+                this.tableSortFields.push({
+                    name: '',
+                    order: 'asc',
+                });
+            },
+            removeSortField(i) {
+                if (this.tableSortFields.length > 0) {
+                    this.tableSortFields.splice(i, 1);
+                }
+            },
+            tableSortQuery() {
 
-            this.orderByStr = '';
+                this.orderByStr = '';
 
-            if (this.tableSortFields.length > 0) {
+                if (this.tableSortFields.length > 0) {
 
-                var templist = [];
+                    var templist = [];
 
-                this.tableSortFields.forEach(item => {
-                    if (item.name && item.order) {
-                        var tempItem = item.name + '_,' + item.order;
-                        templist.push(tempItem);
-                    }
-                })
+                    this.tableSortFields.forEach(item => {
+                        if (item.name && item.order) {
+                            var tempItem = item.name + '_,' + item.order;
+                            templist.push(tempItem);
+                        }
+                    })
 
-                if (templist.length > 0) {
+                    if (templist.length > 0) {
 
-                    this.orderByStr = templist.join('_;');
+                        this.orderByStr = templist.join('_;');
+                    }
                 }
-            }
 
-            this.getData();
-            this.showTableSortDialog = false;
-        },
-        exportExcel() {
-            window.location.href = this.$baseUrl + "/testBbb/exportExcel?searchKey="
-                + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey + "&orderByStr=" + this.orderByStr;
-        },
-        searchData() {
-            this.currentPage = 1;
-            this.getData();
-        },
-        deleteRow(row) {
-            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                return this.$http.post({
-                    url: '/testBbb/del',
-                    data: { id: row.id }
-                })
-            }).then(() => {
-                this.$message.success('删除成功');
                 this.getData();
-            }).catch(action => {
-                if (action === 'cancel') {
-                    this.$message.info('删除取消');
-                } else {
-                    this.$message.error('删除失败');
+                this.showTableSortDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testBbb/exportExcel?searchKey="
+                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post({
+                        url: '/testBbb/del',
+                        data: {id: row.id}
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+            DateTimeFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
                 }
-            })
-        },
-        DateTimeFormatter(row, column, cellValue) {
-            if (cellValue) {
-                return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh })
-            }
 
-        },
-        DateFormatter(row, column, cellValue) {
-            if (cellValue) {
-                return format(cellValue, 'YYYY/MM/DD', { locale: zh })
-            }
+            },
+            DateFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
+                }
 
-        },
-        showImg(img) {
-            this.imgSrc = img;
-            this.imageDialogVisible = true;
-        },
+            },
+            showImg(img) {
+                this.imgSrc = img;
+                this.imageDialogVisible = true;
+            },
 
+        },
+    components: {
+        testBbb
+    }
     }
-}
 </script>
 <style lang="less" scoped>
+
 </style>