|
@@ -16,7 +16,15 @@
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
- <div class="table_headerBtun" v-if="queryData.buttonList">
|
|
|
|
|
|
+ <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-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"
|
|
<el-button type="primary" size="small" plain v-for="(item,indexss) in jeigneutwo" :key="keyname + indexss"
|
|
@click="handleQuery(item)">{{item}}</el-button>
|
|
@click="handleQuery(item)">{{item}}</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -24,7 +32,7 @@
|
|
<!-- 内容 -->
|
|
<!-- 内容 -->
|
|
<div class="eniting_nav">
|
|
<div class="eniting_nav">
|
|
<el-collapse v-model="activeNames" @change="handleChange">
|
|
<el-collapse v-model="activeNames" @change="handleChange">
|
|
- <el-form :rules="queryData.rules" :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
|
|
|
|
|
|
+ <el-form v-show="num == 0" :rules="queryData.rules" :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
|
|
<el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index"
|
|
<el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index"
|
|
class="eitde">
|
|
class="eitde">
|
|
<el-row>
|
|
<el-row>
|
|
@@ -35,12 +43,38 @@
|
|
</el-row>
|
|
</el-row>
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
+ <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" >
|
|
|
|
+ <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>
|
|
|
|
+ <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>
|
|
</el-collapse>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
|
|
+ tableQuery,
|
|
getTableQuery,
|
|
getTableQuery,
|
|
delMenutab,
|
|
delMenutab,
|
|
getQueryList,
|
|
getQueryList,
|
|
@@ -49,11 +83,18 @@
|
|
tableSubimtanit,
|
|
tableSubimtanit,
|
|
addbjectSave
|
|
addbjectSave
|
|
} from '@/api/system/table.js';
|
|
} from '@/api/system/table.js';
|
|
|
|
+ import {
|
|
|
|
+ listIndex,
|
|
|
|
+ } from '@/api/system/form.js'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: "index",
|
|
name: "index",
|
|
inject: ['reload'],
|
|
inject: ['reload'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ // 总条数
|
|
|
|
+ total: 0,
|
|
|
|
+ loading:true,
|
|
activeNames: [0],
|
|
activeNames: [0],
|
|
title: '单表1',
|
|
title: '单表1',
|
|
// 查询参数
|
|
// 查询参数
|
|
@@ -77,6 +118,7 @@
|
|
table: 'sys_user'
|
|
table: 'sys_user'
|
|
},
|
|
},
|
|
queryData: {},
|
|
queryData: {},
|
|
|
|
+ queryDatatwo:{},
|
|
keyname: 'nu',
|
|
keyname: 'nu',
|
|
tabldie: [],
|
|
tabldie: [],
|
|
forme: {
|
|
forme: {
|
|
@@ -99,12 +141,26 @@
|
|
},
|
|
},
|
|
jeigneu: [],
|
|
jeigneu: [],
|
|
jeigneutwo: [],
|
|
jeigneutwo: [],
|
|
- imgShoew:1
|
|
|
|
|
|
+ imgShoew:1,
|
|
|
|
+ queryParamslist: {
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ orderBy:'create_time desc',
|
|
|
|
+ table: '',
|
|
|
|
+ fixedData:{
|
|
|
|
+ condition:{}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ postList: {},
|
|
|
|
+ single: true,
|
|
|
|
+ multiple: true,
|
|
|
|
+ taheus:'',
|
|
|
|
+ taheusid:0,
|
|
|
|
+ tabName:'',
|
|
|
|
+ queryParamstwoi:{}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- // this.edingelsie()
|
|
|
|
- // button
|
|
|
|
this.deledlid.idList = []
|
|
this.deledlid.idList = []
|
|
this.formeanti.table = this.$route.query.tables
|
|
this.formeanti.table = this.$route.query.tables
|
|
// this.formeanti.id = this.$route.query.id
|
|
// this.formeanti.id = this.$route.query.id
|
|
@@ -116,10 +172,15 @@
|
|
this.formy.id = this.$route.query.id
|
|
this.formy.id = this.$route.query.id
|
|
this.tableZbietabg.table = this.$route.query.tables
|
|
this.tableZbietabg.table = this.$route.query.tables
|
|
this.deledlid.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)
|
|
this.deledlid.idList.push(this.$route.query.id)
|
|
console.log(this.deledlid)
|
|
console.log(this.deledlid)
|
|
// tab
|
|
// tab
|
|
this.edingelsietab()
|
|
this.edingelsietab()
|
|
|
|
+ this.init()
|
|
|
|
+
|
|
},
|
|
},
|
|
filters: {},
|
|
filters: {},
|
|
methods: {
|
|
methods: {
|
|
@@ -131,13 +192,26 @@
|
|
},
|
|
},
|
|
enditTab(index) {
|
|
enditTab(index) {
|
|
this.num = index
|
|
this.num = index
|
|
- this.tabledeLise.table = this.tabldie[index].tableName
|
|
|
|
- this.formeanti.table = this.tabldie[index].tableName
|
|
|
|
- this.forme.table = this.tabldie[index].tableName
|
|
|
|
-
|
|
|
|
- this.tableZbie.table = this.tabldie[index].tableName
|
|
|
|
|
|
+ console.log(index)
|
|
|
|
+ if(this.num == 0){
|
|
|
|
+ console.log(34567)
|
|
|
|
+ this.tabledeLise.table = this.tabldie[index].tableName
|
|
|
|
+ this.formeanti.table = this.tabldie[index].tableName
|
|
|
|
+ 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()
|
|
|
|
+ }
|
|
|
|
+ // this.tableZbie.table = this.tabldie[index].tableName
|
|
|
|
+ // this.tableZbie.fixedData.id = this.tabldie[index].id
|
|
// this.edingelsie()
|
|
// this.edingelsie()
|
|
- this.init()
|
|
|
|
|
|
+ // this.init()
|
|
},
|
|
},
|
|
// 按钮
|
|
// 按钮
|
|
init() {
|
|
init() {
|
|
@@ -202,7 +276,7 @@
|
|
this.queryData.showData.filter(route => {
|
|
this.queryData.showData.filter(route => {
|
|
if(route.cssClass !== null){
|
|
if(route.cssClass !== null){
|
|
this.imgShoew = route.cssClass
|
|
this.imgShoew = route.cssClass
|
|
- if(route.cssClass == 2 || route.cssClass == 4){
|
|
|
|
|
|
+ if(route.cssClass == 2 || route.cssClass == 4 || route.mask.slice(3,4) == '0'){
|
|
console.log(34)
|
|
console.log(34)
|
|
route.hrChildren.filter(routers =>{
|
|
route.hrChildren.filter(routers =>{
|
|
routers.isonliy = true
|
|
routers.isonliy = true
|
|
@@ -220,6 +294,60 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ inittwo() {
|
|
|
|
+ tableQuery({
|
|
|
|
+ table: this.tabName,
|
|
|
|
+ }).then(res => {
|
|
|
|
+ let data = res.data
|
|
|
|
+ this.queryDatatwo = data
|
|
|
|
+ this.jeigneutwo = []
|
|
|
|
+ this.jeigneu = []
|
|
|
|
+ this.jeigneu = data.buttonList.split('')
|
|
|
|
+ console.log(data.buttonList)
|
|
|
|
+ console.log(this.jeigneu)
|
|
|
|
+ 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 = '修改'
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ // this.jeigneutwo.push('刷新')
|
|
|
|
+ // this.jeigneutwo.push('返回')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 数据信息
|
|
// 数据信息
|
|
edingelsie() {
|
|
edingelsie() {
|
|
console.log(1234)
|
|
console.log(1234)
|
|
@@ -235,10 +363,12 @@
|
|
edingelsietab() {
|
|
edingelsietab() {
|
|
console.log(4566)
|
|
console.log(4566)
|
|
geteditindeTab(this.tableZbietabg).then(response => {
|
|
geteditindeTab(this.tableZbietabg).then(response => {
|
|
- this.tabldie = response.data.ref
|
|
|
|
- if (this.tabldie.length !== 0) {
|
|
|
|
- this.tableZbie.table = this.tabldie[0].tableName
|
|
|
|
- this.init()
|
|
|
|
|
|
+ this.tabldie = [{tableComment:'主表数据',tableName:this.taheus}]
|
|
|
|
+ this.tabldie =this.tabldie.concat(response.data.ref)
|
|
|
|
+ if (this.tabldie.length !== 1) {
|
|
|
|
+ // this.tableZbie.table = this.tabldie[0].tableName
|
|
|
|
+ // this.tableZbie.fixedData.id = this.tabldie[0].id
|
|
|
|
+ // this.foremliseju()
|
|
} else {
|
|
} else {
|
|
this.msgSuccess("暂无tab数据");
|
|
this.msgSuccess("暂无tab数据");
|
|
this.$router.go(-1)
|
|
this.$router.go(-1)
|
|
@@ -248,6 +378,19 @@
|
|
// this.getList();
|
|
// this.getList();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 列表数据
|
|
|
|
+ foremliseju(){
|
|
|
|
+ listIndex(this.queryParamslist).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ let data = res.data
|
|
|
|
+ this.postList = data
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.total = res.data.total - 0
|
|
|
|
+ console.log(this.total)
|
|
|
|
+ console.log(this.postList,567)
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
changeFn(obj) {
|
|
changeFn(obj) {
|
|
for (let key in obj) {
|
|
for (let key in obj) {
|
|
this.queryParams[key] = obj[key]
|
|
this.queryParams[key] = obj[key]
|
|
@@ -311,6 +454,16 @@
|
|
} else if (index == '刷新') {
|
|
} else if (index == '刷新') {
|
|
// this.xidugje = 1
|
|
// this.xidugje = 1
|
|
this.reload()
|
|
this.reload()
|
|
|
|
+ }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)
|
|
}
|
|
}
|
|
|
|
|
|
console.log(this.forme)
|
|
console.log(this.forme)
|
|
@@ -356,18 +509,95 @@
|
|
},
|
|
},
|
|
//删除
|
|
//删除
|
|
handleDelete(index) {
|
|
handleDelete(index) {
|
|
- this.$confirm('是否确认删除', "警告", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning"
|
|
|
|
- }).then(function() {
|
|
|
|
- return delMenutab(index);
|
|
|
|
- }).then(() => {
|
|
|
|
- // this.getList();
|
|
|
|
- this.msgSuccess("删除成功");
|
|
|
|
- this.$router.go(-1)
|
|
|
|
- })
|
|
|
|
|
|
+ console.log(index)
|
|
|
|
+ if(this.num == 0){
|
|
|
|
+ this.$confirm('是否确认删除', "警告", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(function() {
|
|
|
|
+ return delMenutab(index);
|
|
|
|
+ }).then(() => {
|
|
|
|
+ // this.getList();
|
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
|
+ 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)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 多选框选中数据
|
|
|
|
+ handleSelectionChange(selection) {
|
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
|
+ console.log(this.ids)
|
|
|
|
+ this.single = selection.length != 1
|
|
|
|
+ this.multiple = !selection.length
|
|
|
|
+ },
|
|
|
|
+ routerFn(id, tables) {
|
|
|
|
+ console.log(157)
|
|
|
|
+ if (this.queryDatatwo.viewType == 'crud') {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: 'table',
|
|
|
|
+ query: {
|
|
|
|
+ id,
|
|
|
|
+ tables,
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ } else if (this.queryDatatwo.viewType == 'itemTab') {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '../form/index.vue',
|
|
|
|
+ query: {
|
|
|
|
+ id,
|
|
|
|
+ tables,
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 搜索
|
|
|
|
+ handleQueryiu(){
|
|
|
|
+ for(let item of this.queryDatatwo.queryList){
|
|
|
|
+ // for(var i = 0 ; i < item.hrChildren.length ; i++){
|
|
|
|
+ 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()
|
|
|
|
+ console.log(this.queryParamstwoi)
|
|
|
|
+ },
|
|
|
|
+ resetQuery(){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -378,6 +608,10 @@
|
|
.el-divider--horizontal {
|
|
.el-divider--horizontal {
|
|
margin-top: 0;
|
|
margin-top: 0;
|
|
}
|
|
}
|
|
|
|
+ .el-form-item{
|
|
|
|
+ margin-bottom: 0 !important;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.eniting_nav {
|
|
.eniting_nav {
|
|
@@ -459,6 +693,11 @@
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
+ .table_headerBtuntue{
|
|
|
|
+ display: flex;
|
|
|
|
+ height: 30px;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
.eniting {
|
|
.eniting {
|
|
p {
|
|
p {
|
|
margin: 0;
|
|
margin: 0;
|