index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div class="table_total">
  3. <div class="table_header">
  4. <p>单表</p>
  5. <el-divider></el-divider>
  6. <div class="table_headerBtun" v-if="queryData.buttonList">
  7. <el-button type="primary" plain v-for="(item,index) in queryData.buttonList.split('')" :key="index">{{item | btnConversion}}</el-button>
  8. </div>
  9. </div>
  10. <!-- 内容 -->
  11. <div class="table_nav headertable_nav">
  12. <el-collapse v-model="activeNames" @change="handleChange">
  13. <el-collapse-item :title="title" :name="index" v-for="(item,index) in 4" :key="index">
  14. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
  15. <el-row :gutter="0">
  16. <el-col :span="24" :key="index">
  17. <dynamic-forms :config="queryParams" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
  18. </el-col>
  19. <!-- <el-col :span="6" v-for="(item,index) in 12" :key="index">
  20. <el-form-item :label="labletit" prop="dictName">
  21. <el-input
  22. v-model="queryParams.dictName"
  23. placeholder="请输入字典名称"
  24. clearable
  25. size="small"
  26. @keyup.enter.native="handleQuery"
  27. />
  28. </el-form-item>
  29. </el-col> -->
  30. </el-row>
  31. </el-form>
  32. </el-collapse-item>
  33. </el-collapse>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import {
  39. getTableQuery
  40. } from '@/api/system/table.js'
  41. export default {
  42. name: "index",
  43. data() {
  44. return {
  45. // 显示搜索条件
  46. showSearch: true,
  47. activeNames: ['1'],
  48. title: '单表1',
  49. queryData: {},
  50. // 查询参数
  51. queryParams: {
  52. pageNum: 1,
  53. pageSize: 10,
  54. },
  55. labletit: '查询参数1233'
  56. };
  57. },
  58. filters:{
  59. btnConversion(val) {
  60. switch(val){
  61. case 'A':
  62. return '新增';
  63. case 'M':
  64. return '修改';
  65. case 'D':
  66. return '删除';
  67. case 'Q':
  68. return '查询';
  69. case 'S':
  70. return '提交';
  71. case 'U':
  72. return '反提交';
  73. case 'I':
  74. return '导入';
  75. case 'E':
  76. return '导出';
  77. }
  78. }
  79. },
  80. mounted() {
  81. this.init()
  82. },
  83. methods: {
  84. changeFn(obj) {
  85. for(let key in obj){
  86. this.queryParams[key] = obj[key]
  87. }
  88. },
  89. resetQuery() {
  90. },
  91. /** 搜索按钮操作 */
  92. handleQuery() {
  93. this.getList();
  94. },
  95. getList() {
  96. },
  97. init() {
  98. getTableQuery({
  99. table: 'obj_test'
  100. }).then(res => {
  101. let data = res.data
  102. this.queryData = data
  103. console.log( this.queryData.queryList)
  104. this.queryData.queryList.filter(route => {
  105. if(route.htmlType == 'checkbox'){
  106. route.sysDictDatatwo = []
  107. route.sysDictDatatwo.push(route.columnName)
  108. console.log(route.sysDictDatatwo,846)
  109. }
  110. })
  111. console.log(this.queryData.queryList)
  112. })
  113. },
  114. handleChange(val) {
  115. console.log(val);
  116. }
  117. },
  118. };
  119. </script>
  120. <style lang="scss">
  121. .table_header{
  122. .el-divider--horizontal{
  123. margin-top: 16px;
  124. }
  125. }
  126. .headertable_nav{
  127. .el-collapse-item__wrap{
  128. border-bottom: 0;
  129. }
  130. .el-collapse-item__header{
  131. border-bottom: 0;
  132. font-size: 15px;
  133. font-family: PingFang SC;
  134. font-weight: bold;
  135. color: #3C8DBC;
  136. line-height: 36px;
  137. }
  138. // .el-form-item__content{
  139. // width: 55%;
  140. // }
  141. .el-collapse{
  142. border-top: 0;
  143. }
  144. }
  145. </style>
  146. <style scoped lang="scss">
  147. .app-main{
  148. // background-color: #eef0ff !important;
  149. }
  150. .table_total{
  151. background-color: #eef0ff;
  152. height: 100%;
  153. padding: 20px;
  154. // 头部
  155. .table_header{
  156. background-color: #fff;
  157. border-radius: 6px;
  158. padding: 23px;
  159. margin-bottom: 20px;
  160. p{
  161. font-size: 15px;
  162. font-weight: bold;
  163. color: #3C8DBC;
  164. line-height: 36px;
  165. }
  166. p::before{
  167. content: "";
  168. display: block;
  169. width: 18px;
  170. height: 8px;
  171. background: #3C8DBC;
  172. border-radius: 3px;
  173. }
  174. }
  175. // 内容
  176. .headertable_nav{
  177. background-color: #fff;
  178. border-radius: 6px;
  179. padding: 23px;
  180. }
  181. }
  182. p{
  183. margin: 0;
  184. }
  185. </style>