|
@@ -4,44 +4,29 @@
|
|
|
<p>单表</p>
|
|
|
<el-divider></el-divider>
|
|
|
<div class="table_headerBtun" v-if="queryData.buttonList">
|
|
|
- <el-button type="primary" plain v-for="(item,index) in queryData.buttonList.split('')" :key="index">{{item | btnConversion}}</el-button>
|
|
|
+ <el-button type="primary" plain v-for="(item,index) in queryData.buttonList.split('')" :key="index" @click="handleQuery()">{{item | btnConversion}}</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
<!-- 内容 -->
|
|
|
<div class="table_nav headertable_nav">
|
|
|
<el-collapse v-model="activeNames" @change="handleChange">
|
|
|
- <el-collapse-item :title="title" :name="index" v-for="(item,index) in 4" :key="index">
|
|
|
+ <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in taleLisst" :key="index">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
|
|
|
<el-row :gutter="0">
|
|
|
<el-col :span="24" :key="index">
|
|
|
- <dynamic-forms :config="queryParams" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
|
|
|
+ <dynamic-forms :ref="items.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren" :key='indexs' />
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="6" v-for="(item,index) in 12" :key="index">
|
|
|
- <el-form-item :label="labletit" prop="dictName">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.dictName"
|
|
|
- placeholder="请输入字典名称"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col> -->
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-collapse-item>
|
|
|
-
|
|
|
</el-collapse>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
-
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
import {
|
|
|
- getTableQuery
|
|
|
+ getTableQuery,
|
|
|
+ getQueryList
|
|
|
} from '@/api/system/table.js'
|
|
|
export default {
|
|
|
name: "index",
|
|
@@ -51,13 +36,21 @@
|
|
|
showSearch: true,
|
|
|
activeNames: ['1'],
|
|
|
title: '单表1',
|
|
|
+ tabledeLise:{
|
|
|
+ table:'obj_test',
|
|
|
+ isUi:true
|
|
|
+ },
|
|
|
queryData: {},
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
- labletit: '查询参数1233'
|
|
|
+ labletit: '查询参数1233',
|
|
|
+ tableZbie:{
|
|
|
+ table:'obj_test'
|
|
|
+ },
|
|
|
+ taleLisst:[]
|
|
|
};
|
|
|
},
|
|
|
filters:{
|
|
@@ -84,6 +77,7 @@
|
|
|
},
|
|
|
mounted() {
|
|
|
this.init()
|
|
|
+ this.tablsie()
|
|
|
},
|
|
|
methods: {
|
|
|
changeFn(obj) {
|
|
@@ -96,6 +90,14 @@
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
+ console.log(this.taleLisst,4)
|
|
|
+ for(let item of this.taleLisst){
|
|
|
+ if(item.htmlType == 'checkbox' || item.htmlType == 'imageUpload' || item.htmlType == 'fileUpload'){
|
|
|
+ this.queryParams[item.columnName] = this.$refs[item.columnName][0].config
|
|
|
+ } else{
|
|
|
+ this.queryParams[item.columnName] = this.$refs[item.columnName][0].config[item.columnName]
|
|
|
+ }
|
|
|
+ }
|
|
|
console.log(this.queryParams)
|
|
|
// this.getList();
|
|
|
},
|
|
@@ -103,24 +105,46 @@
|
|
|
|
|
|
},
|
|
|
init() {
|
|
|
- getTableQuery({
|
|
|
- table: 'obj_test'
|
|
|
- }).then(res => {
|
|
|
+ getTableQuery(
|
|
|
+ this.tableZbie
|
|
|
+ ).then(res => {
|
|
|
let data = res.data
|
|
|
this.queryData = data
|
|
|
- console.log( this.queryData.queryList)
|
|
|
- this.queryData.queryList.filter(route => {
|
|
|
- if(route.htmlType == 'checkbox'){
|
|
|
- route.sysDictDatatwo = []
|
|
|
- route.sysDictDatatwo.push(route.columnName)
|
|
|
- console.log(route.sysDictDatatwo,846)
|
|
|
- }
|
|
|
- })
|
|
|
- console.log(this.queryData.queryList)
|
|
|
+ console.log(this.queryData,567)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ tablsie(){
|
|
|
+ console.log(1234)
|
|
|
+ getQueryList(
|
|
|
+ this.tabledeLise
|
|
|
+ ).then(res => {
|
|
|
+ let data = res.data
|
|
|
+ this.taleLisst = data
|
|
|
+ // console.log(this.queryData.queryList)
|
|
|
})
|
|
|
},
|
|
|
handleChange(val) {
|
|
|
console.log(val);
|
|
|
+ },
|
|
|
+ // 按钮点击
|
|
|
+ delet(index){
|
|
|
+ console.log(index)
|
|
|
+ if(index == 'D'){
|
|
|
+ this.handleDelete(index)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ handleDelete(row) {
|
|
|
+ this.$confirm('是否确认删除名称为"' + row + '"的数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ // return delMenu(row.id);
|
|
|
+ }).then(() => {
|
|
|
+ // this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
};
|