Procházet zdrojové kódy

修改前端请假类型显示和数据存储问题

junfeitang před 3 roky
rodič
revize
f320015fbb

binární
dist.zip


+ 9 - 0
src/api/tool/gen.js

@@ -232,3 +232,12 @@ export function listIndexfou(data) {
     data: data
   })
 }
+
+// 时间相差
+export function listIndextime(data) {
+  return request({
+    url: '/boman-web-core/attendance/calcTime',
+    method: 'post',
+    data: data
+  })
+}

+ 209 - 8
src/components/DynamicFormsteo/index.vue

@@ -23,6 +23,34 @@
      </el-option>
 
     </el-select>
+    <!-- 树形结构 -->
+   <div v-if="formConfig.htmlType == 'cascader'&&(!formConfig.fkInfo)">
+        <el-cascader
+           v-model="config[formConfig.columnName]"
+           :options="formConfig.sysDictData"
+           :placeholder="'请选择'+formConfig.columnComment"
+           @getCheckedNodes = 'getCheckedNodes'
+           @change="handleChangety(config[formConfig.columnName])"
+           :props="{checkStrictly: true,value:'dictValue',label:'dictLabel',children: 'children'}"
+           ></el-cascader>
+   </div>
+   <!-- <div class="head-container" > -->
+<!-- <div class="head-container">
+       <el-tree
+         :data="deptOptions"
+         :props="defaultProps"
+         :expand-on-click-node="false"
+         :filter-node-method="filterNode"
+         ref="tree"
+         node-key="id"
+         :current-node-key="5"
+         @node-click="handleNodeClick"
+         :highlight-current = 'true'
+         :default-expanded-keys="[2, 3]"
+       />
+     </div> -->
+     <!-- <treeselect  v-model="config[formConfig.columnName]" :options="deptOptionsthre" :normalizer="normalizerty" :flat="true" @select="djieskletwo" :maxHeight="350" :placeholder="'请输入'+formConfig.columnComment" /> -->
+
     <!-- 复选框 -->
     <el-checkbox-group :disabled="formConfig.disabshow" v-model="config" v-if="formConfig.htmlType == 'checkbox'">
       <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue"
@@ -40,7 +68,7 @@
     </el-date-picker>
     <!-- 时间控件小时分钟 -->
     <el-date-picker :disabled="formConfig.disabshow" @change="iChange" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'"
-                    type="datetime" :placeholder="'请输入'+formConfig.columnComment">
+                    type="datetime" :placeholder="'请输入'+formConfig.columnComment"  value-format="yyyy-MM-dd hh:mm:ss" >
     </el-date-picker>
     <!-- 上传图片 -->
     <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}"
@@ -70,12 +98,17 @@
   const defaultSettings = require('@/settings.js')
   import Editor from '@/components/Editor';
   import {
-    listIndexfou
+    listIndexfou,listIndextime
   } from "@/api/tool/gen";
+  import {getUserProfile, } from "@/api/system/config";
   import {
     getToken
   } from "@/utils/auth";
+  import { treeselect } from "@/api/system/dept";
+  import Treeselect from "@riophae/vue-treeselect";
+  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
   export default {
+    components: {  Treeselect},
     data() {
       return {
         fileList: [],
@@ -86,6 +119,7 @@
         disabled: false,
         loading: false,
         filterList: [],
+        value:[],
         config: {},
         aliemg: {
           table: '',
@@ -97,6 +131,23 @@
           },
           ieug:8
         },
+        // 部门名称
+        deptName: undefined,
+         defaultProps: {
+                  children: 'children',
+                  label: 'label'
+                },
+                huetge:{},
+                leavefrom_starttime:{
+                  leavefrom_start_time:undefined
+                },
+                leavefrom_end:{
+                  leavefrom_end_time:undefined
+                },
+        deptOptions: [],
+        oieutgs:[],
+        shoeuw:true,
+        jueg:0
       }
     },
     components: {
@@ -125,10 +176,12 @@
     },
     created() {
       this.config = {}
+
       if(this.type){
         if(this.formConfig.tableid == -1){
           // console.log(-1)
           // console.log(this.formConfig.mask.slice(1,2))
+          this.shoeuw = false
           if(this.formConfig.readonly == true){
             this.formConfig.disabshow = true
           }else if(this.formConfig.mask.slice(1,2) == '0' || this.formConfig.isonliy == true){
@@ -141,6 +194,7 @@
           }
         }else{
           // console.log(0)
+          this.shoeuw = true
           if(this.formConfig.readonly == true){
             this.formConfig.disabshow = true
           }else if(this.formConfig.mask.slice(3,4) == '0' || this.formConfig.isonliy == true){
@@ -183,27 +237,86 @@
          if (this.formConfig.extendedAttributes) {
            let extend = JSON.parse(this.formConfig.extendedAttributes)
            this.formConfig.extend=extend
-           console.log(this.formConfig.extend)
+           console.log(this.jueg,789)
            this.extFn(extend.col, extend.comp)
          }
        },
        deep: true
      },
+     // 根据名称筛选部门树
+     deptName(val) {
+       console.log(this.$refs.tree)
+       this.$refs.tree.filter(val);
+     }
    },
     mounted() {
+      // this.getUser()
       console.log(this.formConfig)
     },
     methods: {
       iChange(val){
-
+        console.log(val,45)
         if(this.formConfig.isUseExtend){
+          this.shoeuw = false
+          this.jueg = 1
+          // console.log( this.shoeuw)
           this.$emit('iChange',this.formConfig.columnName,val)
         }
       },
       extFn(col, comp) {
-        // console.log(3412)
-        let str = this.getDyn(col, this.queryData.showData,comp)
-        this.config[this.formConfig.columnName] = str
+        // console.log(col, this.queryData.showData,comp,45)
+        console.log(this.formConfig.tableName)
+         let str = this.getDyn(col, this.queryData.showData,comp)
+        console.log(str,457)
+        this.huetge.dept_id = this.formConfig.depdid
+        if(this.shoeuw == false){
+          console.log(this.shoeuw)
+          let str = this.getDyn(col, this.queryData.showData,comp)
+          if(str !== undefined){
+            let hue = []
+            hue = str.split('-')
+
+            this.huetge.leavefrom_end_time = str.substring(0,19)
+            this.huetge.leavefrom_start_time = str.substring(20)
+            listIndextime( this.huetge).then(response => {
+              if (response.code == 200) {
+                this.config[this.formConfig.columnName] = response.data
+                if(this.formConfig.tableName =='boman_temp_leaveform'){
+                  // consolelog(123456)
+                  // if(){
+
+                  // }
+                }
+              }
+              this.loading = false;
+            })
+            console.log(this.huetge)
+          }
+        }else{
+          console.log(this.jueg)
+          console.log(this.formConfig.columnName,12)
+          // let str = this.getDyn(col, this.queryData.showData,comp)
+           this.queryData.showData.filter(route => {
+             route.hrChildren.filter(routerst => {
+               if (routerst.columnName == 'leavefrom_start_time') {
+                 console.log(routerst.columnValue)
+                 this.huetge.leavefrom_start_time = routerst.columnValue
+               }
+               if(routerst.columnName == 'leavefrom_end_time'){
+                  this.huetge.leavefrom_end_time = routerst.columnValue
+               }
+
+             })
+           })
+           listIndextime( this.huetge).then(response => {
+             if (response.code == 200) {
+               this.config[this.formConfig.columnName] = response.data
+             }
+             this.loading = false;
+           })
+
+        }
+
       },
       eval(code){
         let fun = new Function(`return ${code}`)();
@@ -242,6 +355,15 @@
           this.$set(this.config, this.formConfig.columnName, ((this.formConfig.columnValue ? this.formConfig.columnValue :
             this.formConfig.defaultValue) || ''))
         }
+        if (this.formConfig.htmlType == 'cascader'){
+          console.log(this.formConfig.sysDictData,987)
+
+          for(var i = 0 ; i< this.formConfig.sysDictData.length; i++){
+            this.getChilds(this.formConfig.sysDictData[i])
+          }
+
+        }
+
 
         if (this.formConfig.fkInfo) {
           this.aliemg.table = this.formConfig.fkInfo.fkTableName
@@ -299,7 +421,86 @@
       },
       handleCheckedCitiesChange(value) {
         console.log(this.config)
-      }
+      },
+      /** 转换组数据结构 */
+      normalizerty(node) {
+        return {
+          id: node.id,
+          label: node.groupName,
+        };
+      },
+      djieskletwo(node, instanceId) {
+        // this.members(node.id);
+        // this.elezu = node.id
+        console.log(node, instanceId);
+      },
+      // 筛选节点
+      filterNode(value, data) {
+        console.log(value,data)
+        if (!value) return true;
+        return data.label.indexOf(value) !== -1;
+      },
+      // 节点单击事件
+      handleNodeClick(data) {
+        console.log(data);
+        // this.queryParams.deptId = data.id;
+        // this.staff(data.id);
+        // this.quandet = false
+        // this.getList();
+      },
+      handleChangety(value,ik){
+        // if(value.length ==1){
+        //   this.queryParams.referralList[1].sysDeptId = value.join(',')
+        // }else{
+        //   this.queryParams.referralList[1].sysDeptId = value[value.length-1]
+        // }
+        //1
+      console.log(value,ik)
+      },
+      getCheckedNodes(value){
+        // console.log(value)
+      },
+      formateDate(datetime) {
+          function addDateZero(num) {
+              return (num < 10 ? "0" + num : num);
+          }
+          let d = new Date(datetime);
+          let formatdatetime = d.getFullYear() + '-' + addDateZero(d.getMonth() + 1) + '-' + addDateZero(d.getDate()) + ' ' + addDateZero(d.getHours()) + ':' + addDateZero(d.getMinutes()) + ':' + addDateZero(d.getSeconds());
+          return formatdatetime;
+      },
+      // 递归
+      getChilds(data){
+        console.log(data,67)
+        if(data !== null){
+          console.log(7)
+          if(data.children.length == 0){
+            data.children = undefined
+          }else{
+            for(var i = 0 ; i< data.children.length; i++){
+              if(data.children[i].length == 0){
+                // data.children[i] = undefined
+                // console.log(data.children[i],8)
+              }else{
+                // console.log(data.children[i],9)
+                this.getChilds(data.children[i])
+              }
+              // console.log(data.children[i],10)
+            }
+          }
+
+        }
+
+        // if(data.children.length == 0){
+        //   data.children = null
+        // }else{
+        //   this.getChilds(data.children)
+        // }
+      },
+      getUser() {
+        getUserProfile().then(response => {
+          this.huetge.dept_id = response.data.deptId;
+        });
+      },
     }
   }
 </script>

+ 17 - 2
src/layout/components/Sidebar/SidebarItem.vue

@@ -4,6 +4,15 @@
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
           <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
+		   <!-- <template slot="title"> -->
+		       <!-- <i class="el-icon-menu"></i>
+		        <span slot="title">导航二</span> -->
+<!-- 				 <el-tooltip slot="title" class="item" effect="dark"  placement="top-start">
+					 <div slot="content">
+					               <span>Tidebuy International Limited</span>
+					             </div>
+				  </el-tooltip> -->
+		   <!-- </template> -->
         </el-menu-item>
       </app-link>
     </template>
@@ -11,8 +20,8 @@
     <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body >
      <template slot="title">
         <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
-      </template>
-      <sidebar-item
+     </template>
+    <sidebar-item
         v-for="child in item.children"
         :key="child.path"
         :is-nest="true"
@@ -95,3 +104,9 @@ export default {
   }
 }
 </script>
+<style>
+  .el-menu-vertical-demo:not(.el-menu--collapse) {
+    width: 200px;
+    min-height: 400px;
+  }
+</style>

+ 1 - 1
src/settings.js

@@ -2,7 +2,7 @@ module.exports = {
   title: '潜山市云数据中心',
   // urls: `http://118.178.139.79:7090`,
   // urls: `http://192.168.101.110:8090`,
-   urls: `http://192.168.101.11:8090`,
+   urls: `http://192.168.101.243:8090`,
 
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light

+ 12 - 2
src/utils/currencyFn.js

@@ -10,19 +10,28 @@ export function getDyn(col, arr, comp) {
         }
         if (colItem == itemChild.columnName) {
           if (itemChild.htmlType == "input") {
+			  console.log(3)
             type = 1
             str = str.replace(itemChild.columnName, itemChild.columnValue)
           } else if (itemChild.htmlType == "datetime") {
+			console.log(4)
             type = 2
             if(getTime(itemChild.columnValue)){
-              str = str.replace(itemChild.columnName, getTime(itemChild.columnValue))
+				
+              str = str.replace(itemChild.columnName, itemChild.columnValue)
+			  
+			  // str = itemChild.columnValue
+			  // console.log(itemChild.columnValue, itemChild.columnName,19)
+			  console.log(str)
             }else{
               is=true
             }
           }else if(itemChild.htmlType == "datetime-date") {
+			 console.log(5)
             type = 3
             if (getTime(itemChild.columnValue)) {
               str = str.replace(itemChild.columnName, getTime(itemChild.columnValue))
+			  console.log(str,29)
             } else {
               is = true
             }
@@ -35,7 +44,8 @@ export function getDyn(col, arr, comp) {
     return
   }
   if (type == 2) {
-    return setTimeH(evals(str))
+    // return setTimeH(evals(str))
+	return str
   }
   if(type==3){
     return setTime(evals(str))

+ 674 - 678
src/views/system/editing/index.vue

@@ -4,791 +4,787 @@
     <div class="eniting_header">
       <!-- <p class="p">表编辑</p> -->
       <div class="imge_tab">
-        <img src="../../../assets/images/pic_sy_ytj.png" alt="" v-if="imgShoew == 2" >
-        <img src="../../../assets/images/pic_sy_shz.png" alt="" v-if="imgShoew == 4" >
-        <img src="../../../assets/images/pic_sy_ybh.png" alt="" v-if="imgShoew == 3" >
+        <img src="../../../assets/images/pic_sy_ytj.png" alt="" v-if="imgShoew == 2" />
+        <img src="../../../assets/images/pic_sy_shz.png" alt="" v-if="imgShoew == 4" />
+        <img src="../../../assets/images/pic_sy_ybh.png" alt="" v-if="imgShoew == 3" />
       </div>
       <div class="ppl">
-        <p v-for="(item,index) in tabldie" :key="index" @click="enditTab(index)">
-          <img src="../../../assets/images/icon_tbtab_normal.png" alt="" class="index_headerImg" v-if="num !== index">
-          <img src="../../../assets/images/icon_tbtab_selected.png" alt="" class="index_headerImg" v-if="num == index">
-          <span :class="[index == num ? 'span' : '']">{{item.tableComment}}</span>
+        <p v-for="(item, index) in tabldie" :key="index" @click="enditTab(index)">
+          <img src="../../../assets/images/icon_tbtab_normal.png" alt="" class="index_headerImg" v-if="num !== index" />
+          <img src="../../../assets/images/icon_tbtab_selected.png" alt="" class="index_headerImg" v-if="num == index" />
+          <span :class="[index == num ? 'span' : '']">{{ item.tableComment }}</span>
         </p>
       </div>
       <el-divider></el-divider>
       <div class="table_headerBtun table_headerBtuntue" v-if="queryData.buttonList">
-        <el-form v-if="num !== 0" :model="queryParamstwoi" ref="queryForm" :inline="true" >
-          <dynamic-form :ref="item.columnName" :config="queryParamstwoi" @inputs="changeFn" :formConfig="item" v-for="(item,index) in queryDatatwo.queryList"
-            :key='index' />
+        <el-form v-if="num !== 0" :model="queryParamstwoi" ref="queryForm" :inline="true">
+          <dynamic-form :ref="item.columnName" :config="queryParamstwoi" @inputs="changeFn" :formConfig="item" v-for="(item, index) in queryDatatwo.queryList" :key="index" />
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryiu">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
           </el-form-item>
         </el-form>
-        <el-button type="primary" size="small" plain v-for="(item,indexss) in jeigneutwo" :key="keyname + indexss"
-          @click="handleQuery(item)">{{item}}</el-button>
+        <el-button type="primary" size="small" plain v-for="(item, indexss) in jeigneutwo" :key="keyname + indexss" @click="handleQuery(item)">{{ item }}</el-button>
       </div>
     </div>
     <!-- 内容 -->
     <div class="eniting_nav">
-      <el-collapse v-model="activeNames" @change="handleChange" >
-       <div class="table_forem">
-         <el-form v-show="num == 0" :rules="queryData.rules" :model="queryParams" ref="queryForm" :inline="true" :label-width="this.queryData.table_column == 6 ? '70px' :'120px'">
-            <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index"
-              class="eitde">
+      <el-collapse v-model="activeNames" @change="handleChange">
+        <div class="table_forem">
+          <el-form
+            v-show="num == 0"
+            :rules="queryData.rules"
+            :model="queryParams"
+            ref="queryForm"
+            :inline="true"
+            :label-width="this.queryData.table_column == 6 ? '70px' : '120px'"
+          >
+            <el-collapse-item :title="item.columnComment" :name="index" v-for="(item, index) in queryData.showData" :key="index" class="eitde">
               <el-row>
-                  <dynamic-formsteo @iChange="iChange" :queryData="queryData" @modelFn="modelFn" :ref="items.columnName" :config="queryParams" @inputs="changeFn" :formConfig="items"
-                    v-for="(items,indexs) in item.hrChildren" :key='indexs' />
+                <dynamic-formsteo
+                  @iChange="iChange"
+                  :queryData="queryData"
+                  @modelFn="modelFn"
+                  :ref="items.columnName"
+                  :config="queryParams"
+                  @inputs="changeFn"
+                  :formConfig="items"
+                  v-for="(items, indexs) in item.hrChildren"
+                  :key="indexs"
+                />
               </el-row>
             </el-collapse-item>
           </el-form>
-       </div>
-        <div v-show= "num !==0" style="background-color: #fff; padding-bottom: 40px; padding-left: 23px; padding-right: 23px; padding-top: 23px;" >
+        </div>
+        <div v-show="num !== 0" style="background-color: #fff; padding-bottom: 40px; padding-left: 23px; padding-right: 23px; padding-top: 23px;">
           <el-table v-loading="loading" :data="postList.rows" @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="55" style="color: red;" align="center" />
             <template v-for="(item, index) in postList.tableHeadList">
-              <el-table-column :label="item.columnComment"  align="center" :prop="item.columnName" :key="index" >
+              <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" :key="index">
                 <template slot-scope="scope">
-                  <img class="img_icon" v-if="item.htmlType=='imageUpload' && scope.row[scope.column.property]" @click="imgBtn(JSON.parse(scope.row[scope.column.property])[0].url)"
-                    :src="JSON.parse(scope.row[scope.column.property])[0].url" alt="">
+                  <img
+                    class="img_icon"
+                    v-if="item.htmlType == 'imageUpload' && scope.row[scope.column.property]"
+                    @click="imgBtn(JSON.parse(scope.row[scope.column.property])[0].url)"
+                    :src="JSON.parse(scope.row[scope.column.property])[0].url"
+                    alt=""
+                  />
                   <!-- :style="scope.row.list_class" scope.row[scope.column.property] -->
-                  <span  :style="scope.row.list_class" v-else-if="item.columnName == 'status' " >{{ scope.row[scope.column.property] }}</span>
-                  <span  v-else>{{ scope.row[scope.column.property] }}</span>
+                  <span :style="scope.row.list_class" v-else-if="item.columnName == 'status'">{{ scope.row[scope.column.property] }}</span>
+                  <span v-else>{{ scope.row[scope.column.property] }}</span>
                 </template>
               </el-table-column>
             </template>
           </el-table>
-              <div class="index_haderPagin">
-                <pagination
-                  v-show="total>0"
-                  :total="total"
-                  :page.sync="queryParamslist.pageNo"
-                  :limit.sync="queryParamslist.pageSize"
-                  @pagination="foremliseju"
-                />
-              </div>
+          <div class="index_haderPagin">
+            <pagination v-show="total > 0" :total="total" :page.sync="queryParamslist.pageNo" :limit.sync="queryParamslist.pageSize" @pagination="foremliseju" />
+          </div>
         </div>
       </el-collapse>
     </div>
   </div>
 </template>
 <script>
-  import {
-    tableQuery,
-    getTableQuery,
-    delMenutab,
-    getQueryList,
-    geteditindeTab,
-    tableSubimt,
-    tableSubimtanit,
-    addbjectSave,
-    getUserProfiletab,
-    tabsubm
-  } from '@/api/system/table.js';
-  import {
-    listIndex,
-  } from '@/api/system/form.js'
-
-  export default {
-    name: "index",
-    inject: ['reload'],
-    data() {
-      return {
-        // 总条数
-         total: 0,
-         loading:true,
-        activeNames: [0],
-        title: '单表1',
-        // 查询参数
-        queryParams: {},
-        labletit: '查询参数1233',
-        num: 0,
-        tabledeLise: {
-          table: '',
-          isUi: true
-        },
-        taleLisst: [], //列表数据
-        // 按钮参数
-        tableZbie: {
-          table: 'obj_test',
-          isUi: true,
-          fixedData: {
-            id: -1
-          }
-        },
-        tableZbietabg: {
-          table: 'sys_user'
-        },
-        queryData: {},
-        queryDatatwo:{},
-        keyname: 'nu',
-        tabldie: [],
-        forme: {
-          table: '',
-          objId: -1,
-          fixedData: {}
-        },
-        formeanti: {
-          table: '',
-          commitData: [],
-        },
-        formy: {
-          id: 0,
-          status: 1
-        },
-        // 删除参数
-        deledlid: {
-          table: '',
-          idList: []
-        },
-        jeigneu: [],
-        jeigneutwo: [],
-        imgShoew:1,
-        queryParamslist: {
-          pageNo: 1,
-          pageSize: 10,
-          orderBy:'create_time desc',
-          table: '',
-          fixedData:{
-            condition:{}
-          }
-        },
-        postList: {},
-         single: true,
-         multiple: true,
-         taheus:'',
-         taheusid:0,
-         tabName:'',
-         queryParamstwoi:{},
-         juegh:{}
-      };
-    },
-    mounted() {
-      this.deledlid.idList = []
-      this.formeanti.table = this.$route.query.tables
-      // this.formeanti.id = this.$route.query.id
-      this.forme.table = this.$route.query.tables
-      this.forme.objId = this.$route.query.id
-      this.tabledeLise.table = this.$route.query.tables
-      this.tableZbie.table = this.$route.query.tables
-      this.tableZbie.fixedData.id = this.$route.query.id
-      this.formy.id = this.$route.query.id
-      this.juegh.businessCodes = this.$route.query.id - 0
-      this.juegh.businessTypeName = this.$route.query.tables
-      this.juegh.dbname = this.$route.query.tables
-      this.tableZbietabg.table = this.$route.query.tables
-      this.deledlid.table = this.$route.query.tables
-      this.queryParamslist.table = this.$route.query.tables
-      this.taheus = this.$route.query.tables
-      this.taheusid = this.$route.query.id
-      this.deledlid.idList.push(this.$route.query.id)
-      // tab
-      this.edingelsietab()
-      this.init()
-      this.getUser()
-
-    },
-    filters: {},
-    methods: {
-      iChange(name,val){
-        for(let item of this.queryData.showData){
-          for(let itemChild of item.hrChildren){
-            if(itemChild.columnName == name){
-              itemChild.columnValue = (val?val:null)
-            }
-          }
+import { tableQuery, getTableQuery, delMenutab, getQueryList, geteditindeTab, tableSubimt, tableSubimtanit, addbjectSave, getUserProfiletab, tabsubm } from '@/api/system/table.js';
+import { listIndex } from '@/api/system/form.js';
+
+export default {
+  name: 'index',
+  inject: ['reload'],
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      loading: true,
+      activeNames: [0],
+      title: '单表1',
+      // 查询参数
+      queryParams: {},
+      labletit: '查询参数1233',
+      num: 0,
+      tabledeLise: {
+        table: '',
+        isUi: true
+      },
+      taleLisst: [], //列表数据
+      // 按钮参数
+      tableZbie: {
+        table: 'obj_test',
+        isUi: true,
+        fixedData: {
+          id: -1
         }
       },
-      modelFn(obj, cont) {
-        this.$set(this.queryParams,obj,cont)
+      tableZbietabg: {
+        table: 'sys_user'
+      },
+      queryData: {},
+      queryDatatwo: {},
+      keyname: 'nu',
+      tabldie: [],
+      forme: {
+        table: '',
+        objId: -1,
+        fixedData: {}
+      },
+      formeanti: {
+        table: '',
+        commitData: []
       },
-      handleChange(val) {
+      formy: {
+        id: 0,
+        status: 1
       },
-      enditTab(index) {
-        this.num = index
-        if(this.num == 0){
-          this.tabledeLise.table = this.tabldie[index].tableName
-          this.formeanti.table = this.tabldie[index].tableName
-          this.juegh.businessTypeName = this.$route.query.tables
-          this.juegh.dbname = this.$route.query.tables
-          this.forme.table = this.tabldie[index].tableName
-          this.tableZbie.table = this.taheus
-          this.tableZbie.fixedData.id = this.taheusid
-          this.init()
-          this.reload()
-        }else{
-          this.tabName = this.tabldie[index].tableName
-          this.queryParamslist.table = this.tabldie[index].tableName
-          this.inittwo()
-          this.foremliseju()
+      // 删除参数
+      deledlid: {
+        table: '',
+        idList: []
+      },
+      jeigneu: [],
+      jeigneutwo: [],
+      imgShoew: 1,
+      queryParamslist: {
+        pageNo: 1,
+        pageSize: 10,
+        orderBy: 'create_time desc',
+        table: '',
+        fixedData: {
+          condition: {}
         }
       },
-      // 按钮
-      init() {
-        getTableQuery(
-          this.tableZbie
-        ).then(res => {
-          let data = res.data
-          this.queryData = data
-          this.juegh.businessType = res.data.showData[0].tableId
-          this.jeigneutwo = []
-          this.jeigneu = []
-          this.jeigneu = data.buttonList.split('')
-          this.jeigneu.filter(route => {
-            if (route == 'A') {
-              if (this.formy.id == -1) {
-                route = '保存'
-                this.jeigneutwo.push(route)
-              } else {
-                route = '新增'
-              }
-
-            } else if (route == 'M') {
-              route = '保存'
-              // if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
-              // }
-            } else if (route == 'D') {
-              route = '删除'
-              // if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
-              // }
-            } else if (route == 'Q') {
-              route = '查询'
-              this.jeigneutwo.push(route)
-            } else if (route == 'S') {
-              route = '提交'
-              // if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
-              // }
-            } else if (route == 'U') {
-              route = '反提交'
-              // if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
-              // }
-            } else if (route == 'I') {
-              route = '导入'
-              this.jeigneutwo.push(route)
-            } else if (route == 'E') {
-              route = '导出'
-              this.jeigneutwo.push(route)
+      postList: {},
+      single: true,
+      multiple: true,
+      taheus: '',
+      taheusid: 0,
+      tabName: '',
+      queryParamstwoi: {},
+      juegh: {}
+    };
+  },
+  mounted() {
+    this.deledlid.idList = [];
+    this.formeanti.table = this.$route.query.tables;
+    // this.formeanti.id = this.$route.query.id
+    this.forme.table = this.$route.query.tables;
+    this.forme.objId = this.$route.query.id;
+    this.tabledeLise.table = this.$route.query.tables;
+    this.tableZbie.table = this.$route.query.tables;
+    this.tableZbie.fixedData.id = this.$route.query.id;
+    this.formy.id = this.$route.query.id;
+    this.juegh.businessCodes = this.$route.query.id - 0;
+    this.juegh.businessTypeName = this.$route.query.tables;
+    this.juegh.dbname = this.$route.query.tables;
+    this.tableZbietabg.table = this.$route.query.tables;
+    this.deledlid.table = this.$route.query.tables;
+    this.queryParamslist.table = this.$route.query.tables;
+    this.taheus = this.$route.query.tables;
+    this.taheusid = this.$route.query.id;
+    this.deledlid.idList.push(this.$route.query.id);
+    // tab
+    this.edingelsietab();
+    this.init();
+    this.getUser();
+  },
+  filters: {},
+  methods: {
+    iChange(name, val) {
+      for (let item of this.queryData.showData) {
+        for (let itemChild of item.hrChildren) {
+          if (itemChild.columnName == name) {
+            itemChild.columnValue = val ? val : null;
+          }
+        }
+      }
+    },
+    modelFn(obj, cont) {
+      this.$set(this.queryParams, obj, cont);
+    },
+    handleChange(val) {},
+    enditTab(index) {
+      this.num = index;
+      if (this.num == 0) {
+        this.tabledeLise.table = this.tabldie[index].tableName;
+        this.formeanti.table = this.tabldie[index].tableName;
+        this.juegh.businessTypeName = this.$route.query.tables;
+        this.juegh.dbname = this.$route.query.tables;
+        this.forme.table = this.tabldie[index].tableName;
+        this.tableZbie.table = this.taheus;
+        this.tableZbie.fixedData.id = this.taheusid;
+        this.init();
+        this.reload();
+      } else {
+        this.tabName = this.tabldie[index].tableName;
+        this.queryParamslist.table = this.tabldie[index].tableName;
+        this.inittwo();
+        this.foremliseju();
+      }
+    },
+    // 按钮
+    init() {
+      getTableQuery(this.tableZbie).then(res => {
+        let data = res.data;
+        this.queryData = data;
+        this.juegh.businessType = res.data.showData[0].tableId;
+        this.jeigneutwo = [];
+        this.jeigneu = [];
+        this.jeigneu = data.buttonList.split('');
+        this.jeigneu.filter(route => {
+          if (route == 'A') {
+            if (this.formy.id == -1) {
+              route = '保存';
+              this.jeigneutwo.push(route);
+            } else {
+              route = '新增';
             }
-
-          })
-          this.jeigneutwo.push('刷新')
-          this.jeigneutwo.push('返回')
-          // 图片的显示隐藏
-          if(this.queryData.showData.length !==0){
-           this.queryData.showData.filter(route => {
-             route.hrChildren.filter(routerst =>{
-               if(this.queryData.table_column == undefined){
-                 this.queryData.table_column = null
-               }
-               routerst.tableColumnuy = this.queryData.table_column
-             })
-               if(route.cssClass !== null){
-                 this.imgShoew = route.cssClass
-                 if(route.cssClass == 2 || route.cssClass == 4 ){
-                   route.hrChildren.filter(routers =>{
-                     routers.isonliy = true
-                   })
-                 }else{
-                   route.hrChildren.filter(routers =>{
-                     routers.isonliy = false
-                   })
-                 }
-               }
-           })
+          } else if (route == 'M') {
+            route = '保存';
+            // if (this.formy.id != -1) {
+            this.jeigneutwo.push(route);
+            // }
+          } else if (route == 'D') {
+            route = '删除';
+            // if (this.formy.id != -1) {
+            this.jeigneutwo.push(route);
+            // }
+          } else if (route == 'Q') {
+            route = '查询';
+            this.jeigneutwo.push(route);
+          } else if (route == 'S') {
+            route = '提交';
+            // if (this.formy.id != -1) {
+            this.jeigneutwo.push(route);
+            // }
+          } else if (route == 'U') {
+            route = '反提交';
+            // if (this.formy.id != -1) {
+            this.jeigneutwo.push(route);
+            // }
+          } else if (route == 'I') {
+            route = '导入';
+            this.jeigneutwo.push(route);
+          } else if (route == 'E') {
+            route = '导出';
+            this.jeigneutwo.push(route);
           }
-        })
-      },
-      inittwo() {
-        tableQuery({
-          table: this.tabName,
-        }).then(res => {
-          let data = res.data
-          this.queryDatatwo = data
-          this.jeigneutwo = []
-          this.jeigneu = []
-          this.jeigneu = data.buttonList.split('')
-          this.jeigneu.filter(route => {
-            if (route == 'A') {
-                route = '新增'
-                this.jeigneutwo.push(route)
-
-            } else if (route == 'M') {
-              route = '修改'
-              if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
-              }
-            } else if (route == 'D') {
-              route = '删除'
-              if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
-              }
-            } else if (route == 'Q') {
-              route = '查询'
-              this.jeigneutwo.push(route)
-            } else if (route == 'S') {
-              route = '提交'
-              if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
+        });
+        this.jeigneutwo.push('刷新');
+        this.jeigneutwo.push('返回');
+        // 图片的显示隐藏
+        if (this.queryData.showData.length !== 0) {
+          this.queryData.showData.filter(route => {
+            route.hrChildren.filter(routerst => {
+              if (this.queryData.table_column == undefined) {
+                this.queryData.table_column = null;
               }
-            } else if (route == 'U') {
-              route = '反提交'
-              if (this.formy.id != -1) {
-                this.jeigneutwo.push(route)
+              routerst.tableColumnuy = this.queryData.table_column;
+            });
+            if (route.cssClass !== null) {
+              this.imgShoew = route.cssClass;
+              if (route.cssClass == 2 || route.cssClass == 4) {
+                route.hrChildren.filter(routers => {
+                  routers.isonliy = true;
+                });
+              } else {
+                route.hrChildren.filter(routers => {
+                  routers.isonliy = false;
+                });
               }
-            } else if (route == 'I') {
-              route = '导入'
-              this.jeigneutwo.push(route)
-            } else if (route == 'E') {
-              route = '导出'
-              this.jeigneutwo.push(route)
             }
-
-          })
-        })
-      },
-      // 数据信息
-      edingelsie() {
-        getQueryList(
-          this.tabledeLise
-        ).then(res => {
-          let data = res.data
-          this.taleLisst = data
-        })
-      },
-      // tab数据
-      edingelsietab() {
-        geteditindeTab(this.tableZbietabg).then(response => {
-          this.tabldie = [{tableComment:'主表数据',tableName:this.taheus}]
-          this.tabldie =this.tabldie.concat(response.data.ref)
-          if (this.tabldie.length !== 1) {
-
-          } else {
-            this.msgSuccess("暂无tab数据");
-            this.$store.dispatch("tagsView/delView", this.$route);
-            this.$router.go(-1)
+          });
+        }
+      });
+    },
+    inittwo() {
+      tableQuery({
+        table: this.tabName
+      }).then(res => {
+        let data = res.data;
+        this.queryDatatwo = data;
+        this.jeigneutwo = [];
+        this.jeigneu = [];
+        this.jeigneu = data.buttonList.split('');
+        this.jeigneu.filter(route => {
+          if (route == 'A') {
+            route = '新增';
+            this.jeigneutwo.push(route);
+          } else if (route == 'M') {
+            route = '修改';
+            if (this.formy.id != -1) {
+              this.jeigneutwo.push(route);
+            }
+          } else if (route == 'D') {
+            route = '删除';
+            if (this.formy.id != -1) {
+              this.jeigneutwo.push(route);
+            }
+          } else if (route == 'Q') {
+            route = '查询';
+            this.jeigneutwo.push(route);
+          } else if (route == 'S') {
+            route = '提交';
+            if (this.formy.id != -1) {
+              this.jeigneutwo.push(route);
+            }
+          } else if (route == 'U') {
+            route = '反提交';
+            if (this.formy.id != -1) {
+              this.jeigneutwo.push(route);
+            }
+          } else if (route == 'I') {
+            route = '导入';
+            this.jeigneutwo.push(route);
+          } else if (route == 'E') {
+            route = '导出';
+            this.jeigneutwo.push(route);
           }
-
         });
-      },
-      // 列表数据
-      foremliseju(){
-       listIndex(this.queryParamslist).then(res => {
-         if(res.code == 200){
-           let data = res.data
-           this.postList = data
-           this.total = res.data.total - 0
-         }else{
-         }
-          this.loading = false
-
-       })
-      },
-      changeFn(obj) {
-        for (let key in obj) {
-          this.queryParams[key] = obj[key]
+      });
+    },
+    // 数据信息
+    edingelsie() {
+      getQueryList(this.tabledeLise).then(res => {
+        let data = res.data;
+        this.taleLisst = data;
+      });
+    },
+    // tab数据
+    edingelsietab() {
+      geteditindeTab(this.tableZbietabg).then(response => {
+        this.tabldie = [{ tableComment: '主表数据', tableName: this.taheus }];
+        this.tabldie = this.tabldie.concat(response.data.ref);
+        if (this.tabldie.length !== 1) {
+        } else {
+          this.msgSuccess('暂无tab数据');
+          this.$store.dispatch('tagsView/delView', this.$route);
+          this.$router.go(-1);
         }
-      },
-      handleQuery(index) {
-        for (let item of this.queryData.showData) {
-          for (var i = 0; i < item.hrChildren.length; i++) {
-            if (item.hrChildren[i].htmlType == 'checkbox') {
-              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config
-            }else if(item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload'){
-              if(this.$refs[item.hrChildren[i].columnName][0].config.length){
-                this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName][0].config)
-              }
-            } else if (item.hrChildren[i].htmlType == 'datetime') {
-              if (this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]) {
-                this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]
-              }else{
-                this.queryParams[item.hrChildren[i].columnName] = null
-              }
+      });
+    },
+    // 列表数据
+    foremliseju() {
+      listIndex(this.queryParamslist).then(res => {
+        if (res.code == 200) {
+          let data = res.data;
+          this.postList = data;
+          this.total = res.data.total - 0;
+        } else {
+        }
+        this.loading = false;
+      });
+    },
+    changeFn(obj) {
+      for (let key in obj) {
+        this.queryParams[key] = obj[key];
+      }
+    },
+    handleQuery(index) {
+      for (let item of this.queryData.showData) {
+        for (var i = 0; i < item.hrChildren.length; i++) {
+          if (item.hrChildren[i].htmlType == 'checkbox') {
+            this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config;
+          } else if (item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload') {
+            if (this.$refs[item.hrChildren[i].columnName][0].config.length) {
+              this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName][0].config);
+            }
+          } else if (item.hrChildren[i].htmlType == 'datetime') {
+            if (this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]) {
+              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName];
+            } else {
+              this.queryParams[item.hrChildren[i].columnName] = null;
+            }
+          } else if (item.hrChildren[i].htmlType == 'cascader') {
+            // console.log()
+            if (this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]) {
+              console.log(this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]);
+              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName][
+                this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName].length - 1
+              ];
             } else {
-              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]
+              this.queryParams[item.hrChildren[i].columnName] = null;
             }
+          } else {
+            this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName];
           }
         }
-        if (this.queryParams.pageNum !== undefined) {
-          this.queryParams.pageNum = undefined
-        }
-        if (this.queryParams.pageSize !== undefined) {
-          this.queryParams.pageSize = undefined
-        }
-        if (index == '删除') {
-          //删除
-          this.handleDelete(this.deledlid)
-        } else if (index == '提交') {
-          //提交  保存
-          this.formeanti.commitData = []
-          this.formy.status = 1
-          this.formeanti.commitData.push(this.formy)
-          this.antiSubmission()
-        } else if (index == '反提交') {
-          //反提交  保存
-          this.formeanti.commitData = []
-          this.formy.status = 2
-          this.formeanti.commitData.push(this.formy)
-          this.antiSubmission()
-        } else if (index == '保存') {
-          // 修改
-          this.forme.fixedData = this.queryParams
-          this.submitForm()
-        } else if (index == '返回') {
-          this.$store.dispatch("tagsView/delView", this.$route);
-          this.$router.go(-1)
-        } else if (index == '刷新') {
-          this.reload()
-        }else if(index == '新增'){
-            this.routerFn(-1, this.tabName)
-        }else if(index == '修改'){
-          if (this.single) {
-            this.msgInfo('请勾选一条信息')
-            return
-          }
-          const id = this.ids.join(',')
-          this.routerFn(id, this.tabName)
+      }
+      if (this.queryParams.pageNum !== undefined) {
+        this.queryParams.pageNum = undefined;
+      }
+      if (this.queryParams.pageSize !== undefined) {
+        this.queryParams.pageSize = undefined;
+      }
+      if (index == '删除') {
+        //删除
+        this.handleDelete(this.deledlid);
+      } else if (index == '提交') {
+        //提交  保存
+        this.formeanti.commitData = [];
+        this.formy.status = 1;
+        this.formeanti.commitData.push(this.formy);
+        this.antiSubmission();
+      } else if (index == '反提交') {
+        //反提交  保存
+        this.formeanti.commitData = [];
+        this.formy.status = 2;
+        this.formeanti.commitData.push(this.formy);
+        this.antiSubmission();
+      } else if (index == '保存') {
+        // 修改
+        this.forme.fixedData = this.queryParams;
+        this.submitForm();
+      } else if (index == '返回') {
+        this.$store.dispatch('tagsView/delView', this.$route);
+        this.$router.go(-1);
+      } else if (index == '刷新') {
+        this.reload();
+      } else if (index == '新增') {
+        this.routerFn(-1, this.tabName);
+      } else if (index == '修改') {
+        if (this.single) {
+          this.msgInfo('请勾选一条信息');
+          return;
         }
+        const id = this.ids.join(',');
+        this.routerFn(id, this.tabName);
+      }
 
-        // this.getList();
-      },
-      /** 新增 修改提交按钮 */
-      submitForm: function() {
-        this.$refs["queryForm"].validate(valid => {
-          if (valid) {
-            addbjectSave(this.forme).then(response => {
-              this.msgSuccess("保存成功");
-              this.open = false;
-              this.$store.dispatch("tagsView/delView", this.$route);
-              this.$router.go(-1)
+      // this.getList();
+    },
+    /** 新增 修改提交按钮 */
+    submitForm: function() {
+      this.$refs['queryForm'].validate(valid => {
+        if (valid) {
+          addbjectSave(this.forme).then(response => {
+            this.msgSuccess('保存成功');
+            this.open = false;
+            this.$store.dispatch('tagsView/delView', this.$route);
+            this.$router.go(-1);
+            // this.getList();
+          });
+        }
+      });
+    },
+    // 提交反提交
+    antiSubmission() {
+      this.$refs['queryForm'].validate(valid => {
+        if (valid) {
+          if (this.formy.status == 1) {
+            // 提交
+            tableSubimt(this.formeanti).then(response => {
+              // this.msgSuccess("提交成功");
+              this.$store.dispatch('tagsView/delView', this.$route);
+              this.$router.go(-1);
+              this.submoii();
+            });
+          } else if (this.formy.status == 2) {
+            // 反提交
+            tableSubimtanit(this.formeanti).then(response => {
+              this.msgSuccess('反提交成功');
+              this.$store.dispatch('tagsView/delView', this.$route);
+              this.$router.go(-1);
               // this.getList();
             });
           }
-        });
-      },
-      // 提交反提交
-      antiSubmission() {
-        this.$refs["queryForm"].validate(valid => {
-          if (valid) {
-            if (this.formy.status == 1) {
-              // 提交
-              tableSubimt(this.formeanti).then(response => {
-                // this.msgSuccess("提交成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1)
-                this.submoii();
-              });
-            } else if (this.formy.status == 2) {
-              // 反提交
-              tableSubimtanit(this.formeanti).then(response => {
-                this.msgSuccess("反提交成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1)
-                // this.getList();
-              });
-            }
-          }
-        });
-      },
-      // 提交2.0
-      submoii(){
-       tabsubm(this.juegh).then(response => {
-         if(response.resultCode == 0){
-           this.msgSuccess("提交成功");
-         }
-         this.$store.dispatch("tagsView/delView", this.$route);
-         this.$router.go(-1)
-         // this.formeanti.commitData = []
-         // this.formy.status = 1
-         // this.formeanti.commitData.push(this.formy)
-         // this.antiSubmission();
-       });
-      },
-      getUser() {
-        getUserProfiletab().then(response => {
-          this.juegh.initiator = response.data.id
-          this.juegh.userName = response.data.userName
-          console.log(response.data,877)
-        });
-      },
-      //删除
-      handleDelete(index) {
-        if(this.num == 0){
-          this.$confirm('是否确认删除', "警告", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          }).then(function() {
+        }
+      });
+    },
+    // 提交2.0
+    submoii() {
+      tabsubm(this.juegh).then(response => {
+        if (response.resultCode == 0) {
+          this.msgSuccess('提交成功');
+        }
+        this.$store.dispatch('tagsView/delView', this.$route);
+        this.$router.go(-1);
+        // this.formeanti.commitData = []
+        // this.formy.status = 1
+        // this.formeanti.commitData.push(this.formy)
+        // this.antiSubmission();
+      });
+    },
+    getUser() {
+      getUserProfiletab().then(response => {
+        this.juegh.initiator = response.data.id;
+        this.juegh.userName = response.data.userName;
+        console.log(response.data, 877);
+      });
+    },
+    //删除
+    handleDelete(index) {
+      if (this.num == 0) {
+        this.$confirm('是否确认删除', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(function() {
             return delMenutab(index);
-          }).then(() => {
-            // this.getList();
-            this.msgSuccess("删除成功");
-            this.$store.dispatch("tagsView/delView", this.$route);
-            this.$router.go(-1)
           })
-        }else{
-          if (this.single) {
-            this.msgInfo('请勾选一条信息')
-            return
-          }
-          // console.log(this.ids)
-          var that = this
-          index.idList  = this.ids
-          index.table = this.tabName
-         this.$confirm('是否确认删除', "警告", {
-           confirmButtonText: "确定",
-           cancelButtonText: "取消",
-           type: "warning"
-         }).then(function() {
-           return delMenutab(index);
-         }).then(() => {
-           this.foremliseju();
-           this.msgSuccess("删除成功");
-           // this.$router.go(-1)
-         })
+          .then(() => {
+            // this.getList();
+            this.msgSuccess('删除成功');
+            this.$store.dispatch('tagsView/delView', this.$route);
+            this.$router.go(-1);
+          });
+      } else {
+        if (this.single) {
+          this.msgInfo('请勾选一条信息');
+          return;
         }
-      },
-      // 多选框选中数据
-      handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.id)
-        this.single = selection.length != 1
-        this.multiple = !selection.length
-      },
-      routerFn(id, tables) {
-        // if (this.queryDatatwo.viewType == 'crud') {
-          this.$router.push({
-            path: 'table',
-            query: {
-              id,
-              tables,
-            },
+        // console.log(this.ids)
+        var that = this;
+        index.idList = this.ids;
+        index.table = this.tabName;
+        this.$confirm('是否确认删除', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(function() {
+            return delMenutab(index);
           })
-      },
-     // 搜索
-     handleQueryiu(){
-      for(let item of this.queryDatatwo.queryList){
-          if(item.htmlType == 'checkbox'){
-            this.queryParamstwoi[item.columnName] = this.$refs[item.columnName][0].config
-          }else if(item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
-            this.queryParamstwoi[item.columnName] = JSON.stringify(this.$refs[item.columnName][0].config)
-          } else{
-            this.queryParamstwoi[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
-          }
-
+          .then(() => {
+            this.foremliseju();
+            this.msgSuccess('删除成功');
+            // this.$router.go(-1)
+          });
       }
-      for(var items in this.queryParamstwoi){
-        if(this.queryParamstwoi[items] == ''){
-          this.queryParamstwoi[items] = undefined
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id);
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
+    },
+    routerFn(id, tables) {
+      // if (this.queryDatatwo.viewType == 'crud') {
+      this.$router.push({
+        path: 'table',
+        query: {
+          id,
+          tables
+        }
+      });
+    },
+    // 搜索
+    handleQueryiu() {
+      for (let item of this.queryDatatwo.queryList) {
+        if (item.htmlType == 'checkbox') {
+          this.queryParamstwoi[item.columnName] = this.$refs[item.columnName][0].config;
+        } else if (item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload') {
+          this.queryParamstwoi[item.columnName] = JSON.stringify(this.$refs[item.columnName][0].config);
+        } else {
+          this.queryParamstwoi[item.columnName] = this.$refs[item.columnName][0].config[item.columnName];
+        }
+      }
+      for (var items in this.queryParamstwoi) {
+        if (this.queryParamstwoi[items] == '') {
+          this.queryParamstwoi[items] = undefined;
         }
       }
-      this.queryParamslist.fixedData.condition = this.queryParamstwoi
-      this.foremliseju()
-     },
-     resetQuery(){
-      this.resetForm("queryParamstwoi");
+      this.queryParamslist.fixedData.condition = this.queryParamstwoi;
       this.foremliseju();
-     }
-
     },
-  };
+    resetQuery() {
+      this.resetForm('queryParamstwoi');
+      this.foremliseju();
+    }
+  }
+};
 </script>
 
 <style lang="scss">
-  .table_forem{
-    .el-form--inline .el-form-item{
-      width: 100% !important;
-    }
-    .el-select{
-      width: 100%;
-    }
-    .el-date-editor.el-input{
-      width: 100% !important;
-    }
-    .el-form-item--medium .el-form-item__content{
-      width: 70%;
-    }
+.table_forem {
+  .el-form--inline .el-form-item {
+    width: 100% !important;
   }
-  .eniting_header {
-    position: relative;
-    .el-divider--horizontal {
-      margin-top: 0;
-    }
-   .el-form-item{
-     margin-bottom: 0 !important;
-     margin-right: 10px;
-   }
+  .el-select {
+    width: 100%;
+  }
+  .el-date-editor.el-input {
+    width: 100% !important;
+  }
+  .el-form-item--medium .el-form-item__content {
+    width: 70%;
+  }
+}
+.eniting_header {
+  position: relative;
+  .el-divider--horizontal {
+    margin-top: 0;
+  }
+  .el-form-item {
+    margin-bottom: 0 !important;
+    margin-right: 10px;
+  }
+}
+
+.eniting_nav {
+  // .el-form-item{
+  //   width: 25% !important;
+  //   }
+  .el-collapse-item__content {
+    padding-bottom: 0;
   }
 
-  .eniting_nav {
-
-    // .el-form-item{
-    //   width: 25% !important;
-    //   }
-    .el-collapse-item__content {
-      padding-bottom: 0;
-    }
-
-    .el-collapse-item__wrap {
-      border-bottom: 0;
-    }
+  .el-collapse-item__wrap {
+    border-bottom: 0;
+  }
 
-    .el-collapse-item__header {
-      border-bottom: 0;
-      font-size: 15px;
-      font-family: PingFang SC;
-      font-weight: bold;
-      color: #3C8DBC;
-      line-height: 36px;
-    }
+  .el-collapse-item__header {
+    border-bottom: 0;
+    font-size: 15px;
+    font-family: PingFang SC;
+    font-weight: bold;
+    color: #3c8dbc;
+    line-height: 36px;
+  }
 
-    // .el-form-item__content{
-    //   width: 65%;
-    // }
-    .textarea_et {
-      width: 95%;
+  // .el-form-item__content{
+  //   width: 65%;
+  // }
+  .textarea_et {
+    width: 95%;
 
-      .el-form-item__content {
-        width: 80%;
-        height: 83px;
+    .el-form-item__content {
+      width: 80%;
+      height: 83px;
 
-        .el-textarea__inner {
-          height: 100%;
-        }
+      .el-textarea__inner {
+        height: 100%;
       }
     }
+  }
 
-    .textarea_etyju {
-      width: 90%;
+  .textarea_etyju {
+    width: 90%;
 
-      .el-form-item__content {
-        width: 75%;
+    .el-form-item__content {
+      width: 75%;
 
-        // height: 83px;
-        .el-textarea__inner {
-          // height: 100%;
-        }
+      // height: 83px;
+      .el-textarea__inner {
+        // height: 100%;
       }
     }
+  }
 
-    .textarea_ety {
-      width: 100%;
+  .textarea_ety {
+    width: 100%;
 
-      .el-form-item__content {
-        width: 88%;
-        height: 150px;
-        margin-bottom: 0;
+    .el-form-item__content {
+      width: 88%;
+      height: 150px;
+      margin-bottom: 0;
 
-        .el-textarea__inner {
-          height: 100%;
-        }
+      .el-textarea__inner {
+        height: 100%;
       }
     }
+  }
 
-    .el-collapse {
-      border-top: 0;
-    }
+  .el-collapse {
+    border-top: 0;
+  }
 
-    .eitde {
-      background-color: #fff;
-      border-radius: 6px;
-      padding: 23px;
-      padding-top: 0;
-      margin-bottom: 10px;
-    }
+  .eitde {
+    background-color: #fff;
+    border-radius: 6px;
+    padding: 23px;
+    padding-top: 0;
+    margin-bottom: 10px;
   }
+}
 </style>
 
 <style scoped lang="scss">
-  .table_headerBtuntue{
-    display: flex;
-    height: 30px;
-    align-items: center;
+.table_headerBtuntue {
+  display: flex;
+  height: 30px;
+  align-items: center;
+}
+.eniting {
+  p {
+    margin: 0;
   }
-  .eniting {
-    p {
-      margin: 0;
-    }
-
-    background-color: #eef0ff;
-    height: 100%;
-    padding: 20px;
 
-    .eniting_header {
-      background-color: #fff;
-      border-radius: 6px;
-      padding: 13px;
-      margin-bottom: 10px;
+  background-color: #eef0ff;
+  height: 100%;
+  padding: 20px;
 
-      .p {
-        font-size: 15px;
-        font-weight: bold;
-        color: #3C8DBC;
-        line-height: 36px;
-        margin-bottom: 0;
-      }
+  .eniting_header {
+    background-color: #fff;
+    border-radius: 6px;
+    padding: 13px;
+    margin-bottom: 10px;
 
-      .p::before {
-        content: "";
-        display: block;
-        width: 18px;
-        height: 8px;
-        background: #3C8DBC;
-        border-radius: 3px;
+    .p {
+      font-size: 15px;
+      font-weight: bold;
+      color: #3c8dbc;
+      line-height: 36px;
+      margin-bottom: 0;
+    }
 
-      }
+    .p::before {
+      content: '';
+      display: block;
+      width: 18px;
+      height: 8px;
+      background: #3c8dbc;
+      border-radius: 3px;
+    }
 
-      .ppl {
-        display: flex;
-        height: 54px;
+    .ppl {
+      display: flex;
+      height: 54px;
 
-        p {
-          position: relative;
-          width: 113px;
-          height: 38px;
+      p {
+        position: relative;
+        width: 113px;
+        height: 38px;
 
-          img {
-            position: absolute;
-            top: 0;
-            left: 0;
-            width: 100%;
-            height: 100%;
-            // z-index: -1;
-          }
+        img {
+          position: absolute;
+          top: 0;
+          left: 0;
+          width: 100%;
+          height: 100%;
+          // z-index: -1;
+        }
 
-          span {
-            width: 100%;
-            position: absolute;
-            top: 0;
-            left: 0;
-            // transform: translate(-50%);
-            text-align: center;
-            line-height: 38px;
-            font-size: 15px;
-            font-family: PingFang SC;
-            font-weight: bold;
-            color: #aaa;
-          }
+        span {
+          width: 100%;
+          position: absolute;
+          top: 0;
+          left: 0;
+          // transform: translate(-50%);
+          text-align: center;
+          line-height: 38px;
+          font-size: 15px;
+          font-family: PingFang SC;
+          font-weight: bold;
+          color: #aaa;
+        }
 
-          .span {
-            color: #3C8DBC;
-          }
+        .span {
+          color: #3c8dbc;
         }
       }
     }
-
-    // 内容
-    .eniting_nav {
-      // background-color: #fff;
-      // border-radius: 6px;
-      // padding: 23px;
-    }
   }
-  .imge_tab{
-    position: absolute;
-    right: 0;
-    top: 5px;
+
+  // 内容
+  .eniting_nav {
+    // background-color: #fff;
+    // border-radius: 6px;
+    // padding: 23px;
   }
+}
+.imge_tab {
+  position: absolute;
+  right: 0;
+  top: 5px;
+}
 </style>

+ 10 - 1
src/views/system/form/index.vue

@@ -627,7 +627,16 @@
              if(this.$refs[item.hrChildren[i].columnName][0].config.length){
                this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName][0].config)
              }
-           } else {
+           }else if (item.hrChildren[i].htmlType == 'cascader') {
+              // console.log()
+              if (this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]) {
+                console.log(this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName])
+                this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName][this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName].length - 1]
+              } else {
+                this.queryParams[item.hrChildren[i].columnName] = null
+              }
+            }
+            else {
              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[
                item.hrChildren[i].columnName]
            }

+ 29 - 3
src/views/system/table/index.vue

@@ -114,7 +114,8 @@
           businessCode:0
         },
         instanceId: 0,
-        modalShow:false
+        modalShow:false,
+        dietid:0
       };
     },
     mounted() {
@@ -143,7 +144,7 @@
         this.juegkae = undefined
         this.tabdiese = this.$route.query.tabik
       }
-      this.init()
+
       this.getUser()
       // this.tablsie()
     },
@@ -180,12 +181,25 @@
                 this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName][0].config)
               }
             } else if (item.hrChildren[i].htmlType == 'datetime') {
+              // console.log(this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName],this.queryParams[item.hrChildren[i].columnName])
+              // console.log(this.formateDate(this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]))
               if (this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]) {
+                // console.log(this.queryParams[item.hrChildren[i].columnName])
                 this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]
               } else {
                 this.queryParams[item.hrChildren[i].columnName] = null
               }
-            } else {
+
+            }else if (item.hrChildren[i].htmlType == 'cascader') {
+              // console.log()
+              if (this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]) {
+                console.log(this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName])
+                this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName][this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName].length - 1]
+              } else {
+                this.queryParams[item.hrChildren[i].columnName] = null
+              }
+            }
+             else {
               this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[
                 item.hrChildren[i].columnName]
             }
@@ -236,6 +250,14 @@
       },
       getList() {
 
+      },
+      formateDate(datetime) {
+          function addDateZero(num) {
+              return (num < 10 ? "0" + num : num);
+          }
+          let d = new Date(datetime);
+          let formatdatetime = d.getFullYear() + '-' + addDateZero(d.getMonth() + 1) + '-' + addDateZero(d.getDate()) + ' ' + addDateZero(d.getHours()) + ':' + addDateZero(d.getMinutes()) + ':' + addDateZero(d.getSeconds());
+          return formatdatetime;
       },
       init() {
         getTableQuery(
@@ -321,6 +343,8 @@
                 }
                 routerst.tableColumnuy = this.queryData.table_column
                 routerst.tableid = this.ojeuduj
+                routerst.depdid = this.dietid
+                routerst.tablename = this.forme.table
               })
               if (route.cssClass !== null) {
                 this.imgShoew = route.cssClass
@@ -420,7 +444,9 @@
       getUser() {
         getUserProfiletab().then(response => {
           this.juegh.initiator = response.data.id
+          this.dietid = response.data.deptId
           this.juegh.userName = response.data.userName
+          this.init()
           console.log(response.data,877)
         });
       },

+ 18 - 5
src/views/tool/gen/editTable.vue

@@ -31,8 +31,8 @@
           :max-height="tableHeight" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" align="center" />
-          <el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true" align="center" />
-          <el-table-column label="字段描述" min-width="10%" align="center">
+          <el-table-column label="字段列名" prop="columnName" min-width="15%" :show-overflow-tooltip="true" align="center" />
+          <el-table-column label="字段描述" min-width="20%" align="center">
             <template slot-scope="scope">
               <el-input v-model="scope.row.columnComment"></el-input>
             </template>
@@ -198,6 +198,7 @@
                     <el-option label="<" value="LT" />
                     <el-option label="<=" value="LTE" />
                     <el-option label="LIKE" value="LIKE" />
+                    <el-option label="IN" value="IN" />
                     <el-option label="BETWEEN" value="BETWEEN" />
                   </el-select>
                 </el-form-item>
@@ -208,6 +209,7 @@
                     <el-option label="文本框" value="input" />
                     <el-option label="文本域" value="textarea" />
                     <el-option label="下拉框" value="select" />
+                    <el-option label="层级选择" value="cascader" />
                     <el-option label="单选框" value="radio" />
                     <el-option label="复选框" value="checkbox" />
                     <el-option label="时间控件" value="datetime" />
@@ -464,7 +466,7 @@
         foreignKey: [],
         openZd: false,
         formZd: {
-          hrParentId:'2268'
+          hrParentId:2268
         },
         rulesZd: {
           columnName: [{
@@ -561,7 +563,8 @@
         relationType: [],
         // 内嵌编辑
         embedEdit: [],
-        jeuyf:'请选择关联HR字段'
+        jeuyf:'请选择关联HR字段',
+        jeugtw:0
       };
     },
     filters: {
@@ -594,7 +597,7 @@
       },
     },
     created() {
-      this.formZd.hrParentId = '2268'
+      this.formZd.hrParentId = 2268
       console.log(this.formZd.hrParentId)
       const tableId = this.$route.params && this.$route.params.tableId;
       if (tableId) {
@@ -628,6 +631,7 @@
           console.log(response.rows,46)
           this.columHRList = response.rows;
           this.jeuyf = this.columHRList[1].columnName
+          this.jeugtw = this.columHRList[1].id
           this.formZd.hrParentId = this.columHRList[1].id
           console.log(this.formZd.hrParentId,78)
         });
@@ -716,10 +720,15 @@
         );
       },
       submitFormZd() {
+        console.log(34)
+        console.log(this.jeugtw,45)
         this.$refs["formZd"].validate(valid => {
+           console.log(this.formZd)
+
           if (valid) {
             const tableId = this.$route.params && this.$route.params.tableId;
             this.formZd.tableId = tableId
+            console.log(this.formZd.hrParentId)
             if (this.formZd.id != undefined) {
               setGenTableColumn(this.formZd).then(response => {
                 this.msgSuccess("修改成功");
@@ -859,6 +868,7 @@
         this.reset();
         this.openZd = false;
         this.resetZd();
+        this.formZd.hrParentId = this.jeugtw
       },
       // 关联表数据
       tabList() {
@@ -898,6 +908,7 @@
       },
       resetZd() {
         this.formZd = {
+          hrParentId:this.jeugtw
         };
         this.resetForm("formZd");
       },
@@ -1019,6 +1030,8 @@
       },
       handleAdd() {
         this.resetZd();
+        // = this.columHRList[1].id
+        this.formZd.hrParentId = this.jeugtw
         this.openZd = true;
         this.title = "新增字段信息";
       }

+ 1 - 1
src/views/tool/gen/index.vue

@@ -54,7 +54,7 @@
    </transition>
 
     <!-- style="max-height: calc(100vh - 288px);overflow-y: auto;" -->
-    <el-table v-loading="loading" height="300" :data="tableList"
+    <el-table v-loading="loading" height="400" :data="tableList"
       @selection-change="handleSelectionChange">
       <el-table-column type="selection" align="center" width="55"></el-table-column>
       <el-table-column label="序号" type="index" width="50" align="center">