index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!--网络组件-->
  2. <template>
  3. <div class="app-container networkComponent">
  4. <div class="title-box">
  5. <el-form :model="queryParams" class="form-box" ref="queryForm"
  6. :inline="true" style="width:100%;">
  7. <el-form-item label="关键词" prop="queryData1" label-width="90px">
  8. <el-input
  9. maxLength="30"
  10. v-model="queryParams.queryData1"
  11. placeholder="请输入关键词"
  12. clearable
  13. style="width: 200px"
  14. />
  15. </el-form-item>
  16. <el-form-item label="设备类型" prop="queryData2">
  17. <el-select v-model="queryParams.queryData2" clearable placeholder="请选择" style="width: 200px">
  18. <el-option
  19. v-for="dict in options"
  20. :key="dict.value"
  21. :label="dict.label"
  22. :value="dict.value"
  23. />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item>
  27. <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
  28. <p class="reset-button-one" @click="resetQuery">重置</p>
  29. </el-form-item>
  30. <el-form-item label="" prop="title" style="float: right">
  31. <el-col :span="1.5" style="margin-right:10px;">
  32. <p class="add-button-one-90"
  33. @click="dialogOpen"
  34. >新增</p>
  35. </el-col>
  36. </el-form-item>
  37. </el-form>
  38. </div>
  39. <div class="content-box">
  40. <el-table v-loading="loading" border :data="dataList">
  41. <el-table-column label="名称" width="80" align="left" prop="data1" />
  42. <el-table-column label="类型" align="left" prop="data2" show-overflow-tooltip/>
  43. <el-table-column label="详情" align="left" prop="data3" show-overflow-tooltip/>
  44. <el-table-column label="说明" align="left" prop="data4" show-overflow-tooltip/>
  45. <el-table-column label="状态" align="left" prop="data5" show-overflow-tooltip/>
  46. <el-table-column label="创建时间" align="left" prop="data6" show-overflow-tooltip>
  47. <template slot-scope="scope">
  48. <span>{{ parseTime(scope.row.data6) }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="操作" align="left" class-name="small-padding fixed-width">
  52. <template slot-scope="scope">
  53. <div class="table-button-box">
  54. <p class="table-button-null"></p>
  55. <p class="table-button-p"
  56. @click="tableButton(2,scope.row)"
  57. >详情</p>
  58. <p class="table-button-p"
  59. @click="tableButton(3,scope.row)"
  60. >编辑</p>
  61. <p class="table-button-p"
  62. @click="tableButton(4,scope.row)"
  63. >删除</p>
  64. <p class="table-button-null"></p>
  65. </div>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <pagination :page-sizes="[20, 30, 40, 50]"
  70. v-show="total>0"
  71. :total="total"
  72. :page.sync="queryParams.page"
  73. :limit.sync="queryParams.pageSize"
  74. @pagination="getList"
  75. />
  76. </div>
  77. <!--新增弹窗-->
  78. <el-dialog class="networkComponent-dialog" :title='dialogTitle' width="540px" append-to-body
  79. :visible.sync="dialogType" v-if="dialogType" @close="dialogOff()"
  80. :close-on-click-modal="false" :close-on-press-escape="false">
  81. <div slot="footer" class="dialog-footer dialog-footer-box" style="display: flex">
  82. <p class="dialog-footer-button-null"></p>
  83. <p class="dialog-footer-button-info" @click="dialogOff()">取消</p>
  84. <p class="dialog-footer-button-primary" @click="dialogSubmit">确定</p>
  85. <p class="dialog-footer-button-null"></p>
  86. </div>
  87. </el-dialog>
  88. </div>
  89. </template>
  90. <script>
  91. export default {
  92. name: 'index',
  93. data(){
  94. return{
  95. loading:false,
  96. options:[{label:'启用',value:true},{label:'停用',value:false}],
  97. queryParams:{
  98. page:1,
  99. pageSize:20,
  100. queryData1:"",
  101. jobGroup:null,
  102. queryData2:null,
  103. },
  104. dataList:[],
  105. total:0,
  106. dialogTitle:null,
  107. dialogType:false,
  108. dialogForm:{},
  109. }
  110. },
  111. created(){
  112. },
  113. mounted(){
  114. },
  115. methods:{
  116. //弹层关闭
  117. dialogOff(){
  118. this.$set(this,'dialogType',false);
  119. },
  120. //弹层开启
  121. dialogOpen(){
  122. this.dialogFormReset();
  123. this.$set(this,'dialogTitle','新增');
  124. this.$set(this,'dialogType',true);
  125. },
  126. //弹层确定
  127. dialogSubmit(){
  128. this.$set(this,'dialogType',false);
  129. },
  130. handleQuery(){
  131. this.$set(this.queryParams,'page',1);
  132. this.getList();
  133. },
  134. resetQuery(){
  135. this.$set(this,'queryParams',{
  136. page:1,
  137. pageSize:20,
  138. queryData1:"",
  139. queryData2:null,
  140. });
  141. this.getList();
  142. },
  143. dialogFormReset(){
  144. this.$set(this,'dialogForm',{
  145. });
  146. },
  147. //获取数据列表
  148. getList(){
  149. // this.$set(this,'loading',true);
  150. // listJobLog(this.queryParams).then(response => {
  151. // this.$set(this,'loading',false);
  152. // this.$set(this,'dataList',response.data.records);
  153. // this.$set(this,'total',response.data.total);
  154. // });
  155. },
  156. tableButton(type,row){
  157. if(type == 2){
  158. }else if(type == 3){
  159. this.dialogFormReset();
  160. }else if(type == 4){
  161. }
  162. },
  163. },
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .networkComponent{
  168. flex:1;
  169. display: flex;
  170. flex-direction: column;
  171. .title-box{
  172. padding-top:20px;
  173. border-bottom:1px solid #dedede;
  174. display: flex;
  175. }
  176. .content-box{
  177. flex: 1;
  178. display: flex;
  179. flex-direction: column;
  180. padding:20px;
  181. overflow: hidden;
  182. }
  183. }
  184. </style>