info.php 7.7 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. diy_page_id:0
  128. },
  129. statistics:{},
  130. tableData: [],
  131. export_url:'',
  132. exportList:{},
  133. header:[],
  134. loading:true,
  135. }
  136. },
  137. created(){
  138. if(getQuery('template_id') ){
  139. this.search_data.template_id = getQuery('template_id')
  140. this.search_data.diy_page_id = getQuery('diy_page_id')
  141. this.getList()
  142. }
  143. },
  144. methods:{
  145. getList(){
  146. request({
  147. params: {
  148. r: 'smart-form/renovation/info',
  149. ...this.search_data
  150. },
  151. method: 'GET',
  152. }).then(res=>{
  153. this.header = res.data.data.header
  154. this.tableData = res.data.data.list.list
  155. this.statistics = res.data.data.statistics
  156. this.pageCount = res.data.data.list.page_count;
  157. this.loading = false
  158. })
  159. },
  160. exportInfo(){
  161. request({
  162. params: {
  163. r: 'smart-form/form/info'
  164. },
  165. data:{
  166. template_id:this.search_data.template_id,
  167. flag:'EXPORT'
  168. },
  169. method: 'post',
  170. }).then(res=>{
  171. this.$message.success('导出成功')
  172. })
  173. },
  174. changeName(){
  175. this.loading = true
  176. this.search_data.page = 1
  177. this.getList()
  178. // new Date().getDate()()
  179. },
  180. changeTime(e){
  181. if(e){
  182. this.search_data.date_start = e[0]
  183. this.search_data.date_end = e[1]
  184. this.search_data.page = 1
  185. this.loading = true
  186. this.getList()
  187. }
  188. else{
  189. this.search_data.page = 1
  190. this.loading = true
  191. this.getList()
  192. }
  193. },
  194. pagination(page){
  195. this.loading = true
  196. this.search_data.page = page
  197. this.getList()
  198. },
  199. deleteInfo(item){
  200. let that = this
  201. this.$confirm('是否确定删除?', '提示', {
  202. confirmButtonText: '确定',
  203. cancelButtonText: '取消',
  204. type: 'warning'
  205. }).then(() => {
  206. request({
  207. params: {
  208. r: 'smart-form/form/delete-info'
  209. },
  210. data:{
  211. id:item.id
  212. },
  213. method: 'post',
  214. }).then(res=>{
  215. console.log(res)
  216. this.loading = true
  217. this.getList()
  218. })
  219. })
  220. }
  221. }
  222. })
  223. </script>
  224. <style scoped>
  225. .b_box{
  226. min-height: 100vh;
  227. background: #f3f3f3;
  228. }
  229. .nav{
  230. background: #ffffff;
  231. border-radius: 5px;
  232. padding: 26px 24px;
  233. margin-bottom: 10px;
  234. }
  235. .form_info_box{
  236. padding: 25px;
  237. background: #fff;
  238. border-radius: 5px;
  239. box-sizing: border-box;
  240. }
  241. .data_info_box{
  242. width: 100%;
  243. display: flex;
  244. align-items: center;
  245. flex-wrap: wrap;
  246. }
  247. .data_item_box{
  248. width: 21%;
  249. height: 125px;
  250. margin-bottom: 10px;
  251. }
  252. .item_box{
  253. width: 255px;
  254. height: 100%;
  255. border: 1px solid #e5e5e5;
  256. padding: 10px;
  257. box-sizing: border-box;
  258. font-size: 14px;
  259. }
  260. .data_table_box{
  261. width: 100%;
  262. padding: 10px;
  263. box-sizing: border-box;
  264. border: 1px solid #e5e5e5;
  265. margin-top: 10px;
  266. }
  267. .search_data_box{
  268. width: 100%;
  269. display: flex;
  270. align-items: center;
  271. justify-content: space-between;
  272. }
  273. .data_pic_box{
  274. display: flex;
  275. align-items: center;
  276. justify-content: space-around;
  277. }
  278. .data_pic_img{
  279. width: 48px;
  280. height: 47px;
  281. border-radius: 3px;
  282. margin-right: 10px;
  283. cursor: pointer;
  284. }
  285. </style>