info.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <div class=" b_box" id="app" v-loading="loading">
  6. <div class="nav">详情</div>
  7. <div class="form_info_box">
  8. <div class="data_info_box">
  9. <div class="data_item_box">
  10. <div class="item_box" >
  11. <p>今日填写次数</p>
  12. <p>{{statistics.today_filling_times || 0}}</p>
  13. </div>
  14. </div>
  15. <div class="data_item_box">
  16. <div class="item_box" >
  17. <p>今日访问人次</p>
  18. <p>{{statistics.today_view_times || 0}}</p>
  19. </div>
  20. </div>
  21. <div class="data_item_box">
  22. <div class="item_box" >
  23. <p>今日填写人数</p>
  24. <p>{{statistics.today_filling_people || 0}}</p>
  25. </div>
  26. </div>
  27. <div class="data_item_box">
  28. <div class="item_box" >
  29. <p>今日填写率</p>
  30. <p>{{statistics.today_rate || '0%'}}</p>
  31. </div>
  32. </div>
  33. <div class="data_item_box">
  34. <div class="item_box" >
  35. <p>总填写次数</p>
  36. <p>{{statistics.filling_times || 0}}</p>
  37. </div>
  38. </div>
  39. <div class="data_item_box">
  40. <div class="item_box" >
  41. <p>总访问人次</p>
  42. <p>{{statistics.view_times || 0}}</p>
  43. </div>
  44. </div>
  45. <div class="data_item_box">
  46. <div class="item_box" >
  47. <p>总填写人数</p>
  48. <p>{{statistics.filling_people || 0}}</p>
  49. </div>
  50. </div>
  51. <div class="data_item_box">
  52. <div class="item_box" >
  53. <p>总填写率</p>
  54. <p>{{statistics.all_rate || '0%'}}</p>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="data_table_box">
  59. <el-tabs v-model="activeName">
  60. <el-tab-pane label="用户数据" name="user">
  61. <div class="search_data_box">
  62. <el-form :inline="true" :model="search_data" size="small">
  63. <el-form-item label="用户昵称">
  64. <el-input placeholder="输入页面关键词搜索" v-model='search_data.keyword' suffix-icon="el-icon-search" @change="changeName"></el-input>
  65. </el-form-item>
  66. <el-form-item label="提交时间" style="margin-left: 50px;">
  67. <el-date-picker style="margin-top: 1px;" size="small" @change="changeTime" v-model="datetime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
  68. </el-form-item>
  69. </el-form>
  70. <el-col :span="1.5">
  71. <el-button type="danger" size="mini" @click="exportInfo">导出表格</el-button>
  72. </el-col>
  73. </div>
  74. <el-table
  75. :data="tableData"
  76. style="width: 100%">
  77. <el-table-column label="填表人" align="center" prop="nickname"> </el-table-column>
  78. <el-table-column
  79. :prop="'h.id'"
  80. :label="h.label" align="center"
  81. v-for="(h,hi) in header" :key="hi"
  82. :width="h.smart_form_components_code == 'upload-photo' ? 200 : ''">
  83. <template slot-scope="{row}" >
  84. <div class="data_pic_box" v-if="h.smart_form_components_code == 'upload-photo'">
  85. <el-image v-for="(m,mi) in row[h.type]" :key="m" :preview-src-list="row[h.type]" :src="m" class="data_pic_img" ></el-image>
  86. </div>
  87. <p v-else>{{row[h.type]}}</p>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="填表日期" align="center" prop="created_at">
  91. <template slot-scope="{row}" >
  92. {{(new Date( row.created_at * 1000).getFullYear())+'-'+(new Date( row.created_at * 1000).getMonth()+1)+'-'+
  93. (new Date( row.created_at * 1000).getDate())}}
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. label="操作"
  98. fixed="right" align="center">
  99. <template slot-scope="{row}" >
  100. <el-button type="text" size="mini" style="color: red;" @click="deleteInfo(row)">删除</el-button>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. <div style="text-align: right;margin: 20px 0;" ref="page">
  105. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  106. </div>
  107. </el-tab-pane>
  108. </el-tabs>
  109. </div>
  110. </div>
  111. </div>
  112. <script>
  113. new Vue({
  114. el:"#app",
  115. data(){
  116. return{
  117. activeName:'user',
  118. pageCount:0,
  119. datetime: [],
  120. search_data:{
  121. keyword:'',
  122. date_start:'',
  123. date_end:'',
  124. page:1,
  125. limit:10,
  126. template_id:null,
  127. },
  128. statistics:{},
  129. tableData: [],
  130. export_url:'',
  131. exportList:{},
  132. header:[],
  133. loading:true
  134. }
  135. },
  136. created(){
  137. if(getQuery('template_id')){
  138. this.search_data.template_id = getQuery('template_id')
  139. this.getList()
  140. }
  141. },
  142. methods:{
  143. uo(row){
  144. console.log(row)
  145. },
  146. getList(){
  147. request({
  148. params: {
  149. r: 'smart-form/form/info',
  150. ...this.search_data
  151. },
  152. method: 'GET',
  153. }).then(res=>{
  154. this.header = res.data.data.header
  155. this.tableData = res.data.data.list.list
  156. this.statistics = res.data.data.statistics
  157. this.pageCount = res.data.data.list.page_count;
  158. this.loading = false
  159. })
  160. },
  161. exportInfo(){
  162. request({
  163. params: {
  164. r: 'smart-form/form/info'
  165. },
  166. data:{
  167. template_id:this.search_data.template_id,
  168. flag:'EXPORT'
  169. },
  170. method: 'post',
  171. }).then(res=>{
  172. this.$message.success('导出成功')
  173. })
  174. },
  175. changeName(){
  176. this.loading = true
  177. this.search_data.page = 1
  178. this.getList()
  179. // new Date().getDate()()
  180. },
  181. changeTime(e){
  182. if(e){
  183. this.search_data.date_start = e[0]
  184. this.search_data.date_end = e[1]
  185. this.search_data.page = 1
  186. this.loading = true
  187. this.getList()
  188. }
  189. else{
  190. this.search_data.page = 1
  191. this.loading = true
  192. this.getList()
  193. }
  194. },
  195. pagination(page){
  196. this.loading = true
  197. this.search_data.page = page
  198. this.getList()
  199. },
  200. deleteInfo(item){
  201. let that = this
  202. this.$confirm('是否确定删除?', '提示', {
  203. confirmButtonText: '确定',
  204. cancelButtonText: '取消',
  205. type: 'warning'
  206. }).then(() => {
  207. request({
  208. params: {
  209. r: 'smart-form/form/delete-info'
  210. },
  211. data:{
  212. id:item.id
  213. },
  214. method: 'post',
  215. }).then(res=>{
  216. console.log(res)
  217. this.loading = true
  218. this.getList()
  219. })
  220. })
  221. }
  222. }
  223. })
  224. </script>
  225. <style scoped>
  226. .b_box{
  227. min-height: 100vh;
  228. background: #f3f3f3;
  229. }
  230. .nav{
  231. background: #ffffff;
  232. border-radius: 5px;
  233. padding: 26px 24px;
  234. margin-bottom: 10px;
  235. }
  236. .form_info_box{
  237. padding: 25px;
  238. background: #fff;
  239. border-radius: 5px;
  240. box-sizing: border-box;
  241. }
  242. .data_info_box{
  243. width: 100%;
  244. display: flex;
  245. align-items: center;
  246. flex-wrap: wrap;
  247. }
  248. .data_item_box{
  249. width: 21%;
  250. height: 125px;
  251. margin-bottom: 10px;
  252. }
  253. .item_box{
  254. width: 255px;
  255. height: 100%;
  256. border: 1px solid #e5e5e5;
  257. padding: 10px;
  258. box-sizing: border-box;
  259. font-size: 14px;
  260. }
  261. .data_table_box{
  262. width: 100%;
  263. padding: 10px;
  264. box-sizing: border-box;
  265. border: 1px solid #e5e5e5;
  266. margin-top: 10px;
  267. }
  268. .search_data_box{
  269. width: 100%;
  270. display: flex;
  271. align-items: center;
  272. justify-content: space-between;
  273. }
  274. .data_pic_box{
  275. display: flex;
  276. align-items: center;
  277. justify-content: space-around;
  278. }
  279. .data_pic_img{
  280. width: 48px;
  281. height: 47px;
  282. border-radius: 3px;
  283. margin-right: 10px;
  284. cursor: pointer;
  285. }
  286. </style>