|
@@ -25,7 +25,7 @@
|
|
|
</el-collapse-item>
|
|
|
</el-form>
|
|
|
<!-- 列表 -->
|
|
|
- <el-collapse-item :title="title" name="index" class="eitde" v-if="tabShoes">
|
|
|
+ <el-collapse-item :title="title" name="lised" class="eitde" v-if="tabShoes">
|
|
|
<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="numtab !== index">
|
|
@@ -34,27 +34,32 @@
|
|
|
</p>
|
|
|
</div>
|
|
|
<el-divider></el-divider>
|
|
|
- <el-form :model="queryParamstwoi" ref="queryForm" :inline="true" >
|
|
|
- <dynamic-forms :ref="item.columnName" :config="queryParamstwoi" @inputs="changeFn" :formConfig="item" v-for="(item,index) in queryDatatao.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-table stripe v-loading="loading" :data="postList.rows" @selection-change="handleSelectionChange">
|
|
|
+ <div style="display: flex; align-items: center; margin-bottom: 20px;" class="hiueo">
|
|
|
+ <el-form style="display: flex; align-items:center;" :model="queryParamstwoi" ref="queryForm" :inline="true" >
|
|
|
+ <dynamic-forms :ref="item.columnName" :config="queryParamstwoi" @inputs="changeFn" :formConfig="item" v-for="(item,index) in queryDatatao.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="item + indexss"
|
|
|
+ @click="handleQueryju(item)">{{item}}</el-button> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <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">
|
|
|
- <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="">
|
|
|
- <!-- :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>
|
|
|
- </template>
|
|
|
+ <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="">
|
|
|
+ <!-- :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>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</template>
|
|
|
- <!-- <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" v-for="(item,index) in postList.tableHeadList" :key="index" /> -->
|
|
|
</el-table>
|
|
|
<div class="index_haderPagin">
|
|
|
<pagination
|
|
@@ -99,7 +104,7 @@
|
|
|
loading:true,
|
|
|
tabList: {},
|
|
|
currentPage3: 0,
|
|
|
- activeNames: [0],
|
|
|
+ activeNames: [0,'lised'],
|
|
|
title: '列表',
|
|
|
objParams: {
|
|
|
table: '',
|
|
@@ -160,7 +165,12 @@
|
|
|
table:'',
|
|
|
idList:[]
|
|
|
},
|
|
|
- imgShoew:1
|
|
|
+ imgShoew:1,
|
|
|
+ jeigneu: [],
|
|
|
+ jeigneutwo: [],
|
|
|
+ single: true,
|
|
|
+ multiple: true,
|
|
|
+ tabName:''
|
|
|
};
|
|
|
},
|
|
|
filters:{
|
|
@@ -213,9 +223,6 @@
|
|
|
},
|
|
|
handleSizeChange() {
|
|
|
|
|
|
- },
|
|
|
- handleSelectionChange() {
|
|
|
-
|
|
|
},
|
|
|
headerBtn(item) {
|
|
|
switch(item) {
|
|
@@ -281,6 +288,7 @@
|
|
|
this.tabldie = response.data.ref
|
|
|
this.queryParamslist.table = this.tabldie[0].tableName
|
|
|
this.objParamstue.table = this.tabldie[0].tableName
|
|
|
+ this.tabName = this.tabldie[0].tableName
|
|
|
this.tabShoes = true
|
|
|
this.foremliseju()
|
|
|
this.foremlisejuque()
|
|
@@ -309,7 +317,49 @@
|
|
|
foremlisejuque(){
|
|
|
getObjectqure(this.objParamstue).then(res => {
|
|
|
console.log(res)
|
|
|
+ let data = res.data
|
|
|
this.queryDatatao = res.data
|
|
|
+ this.jeigneutwo = []
|
|
|
+ this.jeigneu = []
|
|
|
+ this.jeigneu = data.buttonList.split('')
|
|
|
+ this.jeigneu.filter(route => {
|
|
|
+ // route.dept_id = route.dept_id.value
|
|
|
+ console.log(route)
|
|
|
+ if (route == 'A') {
|
|
|
+
|
|
|
+ route = '新增'
|
|
|
+ this.jeigneutwo.push(route)
|
|
|
+ } else if (route == 'M') {
|
|
|
+ route = '修改'
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ console.log(this.jeigneutwo)
|
|
|
// let data = res.data
|
|
|
// this.queryData = data
|
|
|
// 图片的显示隐藏
|
|
@@ -322,6 +372,7 @@
|
|
|
enditTab(index) {
|
|
|
this.numtab = index
|
|
|
this.queryParamslist.table = this.tabldie[index].tableName
|
|
|
+ this.tabName = this.tabldie[index].tableName
|
|
|
this.foremliseju()
|
|
|
},
|
|
|
changeFn(obj) {
|
|
@@ -469,14 +520,100 @@
|
|
|
this.msgSuccess("删除成功");
|
|
|
this.$router.go(-1)
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 列表删除
|
|
|
+ handleDeletetwo(index){
|
|
|
+ index.idList = this.ids
|
|
|
+ index.table = this.tabName
|
|
|
+ this.$confirm('是否确认删除', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delMenutabform(index);
|
|
|
+ }).then(() => {
|
|
|
+ this.foremliseju();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ // this.$router.go(-1)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ console.log(this.ids)
|
|
|
+ this.single = selection.length != 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ handleQueryju(index){
|
|
|
+ console.log(index, 4)
|
|
|
+ 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 {
|
|
|
+ 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.handleDeletetwo(this.deledlid)
|
|
|
+ } else if(index == '新增'){
|
|
|
+ this.routerFn(-1, this.tabName)
|
|
|
+ }else if(index == '修改'){
|
|
|
+ if (this.single) {
|
|
|
+ this.msgInfo('请勾选一条信息')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const id = this.ids.join(',')
|
|
|
+ console.log(12346)
|
|
|
+ this.routerFn(id, this.tabName)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ routerFn(id, tables) {
|
|
|
+ console.log(157)
|
|
|
+ if (this.queryDatatao.viewType == 'crud') {
|
|
|
+ this.$router.push({
|
|
|
+ path: 'table',
|
|
|
+ query: {
|
|
|
+ id,
|
|
|
+ tables,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ } else if (this.queryDatatao.viewType == 'headTab') {
|
|
|
+ this.$router.push({
|
|
|
+ path: 'editing',
|
|
|
+ query: {
|
|
|
+ id,
|
|
|
+ tables,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- .tabForm {
|
|
|
+ .tabForm {
|
|
|
+ .hiueo{
|
|
|
+ .el-form-item{
|
|
|
+ margin-bottom: 0 !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.el-collapse-item__content {
|
|
|
padding: 0;
|
|
|
}
|