运营分析
This commit is contained in:
		
							
								
								
									
										158
									
								
								project/activeAnalysis/app/AppActivity/components/Add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										158
									
								
								project/activeAnalysis/app/AppActivity/components/Add.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,158 @@ | ||||
| <template> | ||||
|   <ai-detail class="content-add"> | ||||
|     <template slot="title"> | ||||
|       <ai-title :title="params.id ? '编辑风险区域' : '添加风险区域'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||
|       </ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
|       <ai-card title="基本信息"> | ||||
|         <template #content> | ||||
|           <el-form class="ai-form" :model="form" label-width="120px" ref="form"> | ||||
|             <el-form-item prop="areaId" style="width: 100%;" label="选择地区" :rules="[{required: true, message: '请选择地区', trigger: 'change'}]"> | ||||
|               <ai-area-select clearable @fullname="v => form.areaName = v" always-show :instance="instance" v-model="form.areaId"></ai-area-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item prop="address" style="width: 100%;" label="详细地址"> | ||||
|               <el-input size="small" type="textarea" :rows="5" placeholder="请输入详细地址" v-model="form.address"></el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="风险等级" style="width: 100%;" prop="level" :rules="[{required: true, message: '请选择风险等级', trigger: 'change'}]"> | ||||
|               <ai-select | ||||
|                 v-model="form.level" | ||||
|                 clearable | ||||
|                 placeholder="请选择风险等级" | ||||
|                 :selectList="dict.getDict('epidemicDangerousAreaLevel')"> | ||||
|               </ai-select> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </template> | ||||
|       </ai-card> | ||||
|     </template> | ||||
|     <template #footer> | ||||
|       <el-button @click="cancel">取消</el-button> | ||||
|       <el-button type="primary" @click="confirm">提交</el-button> | ||||
|     </template> | ||||
|   </ai-detail> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import { mapState } from 'vuex' | ||||
|   export default { | ||||
|     name: 'Add', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       params: Object, | ||||
|       moduleName: String | ||||
|     }, | ||||
|     data () { | ||||
|       return { | ||||
|         info: {}, | ||||
|         form: { | ||||
|           level: '', | ||||
|           areaId: '', | ||||
|           areaName: '', | ||||
|           address: '' | ||||
|         }, | ||||
|         id: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']) | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.dict.load('epidemicDangerousAreaLevel').then(() => { | ||||
|         if (this.params && this.params.id) { | ||||
|           this.id = this.params.id | ||||
|           this.getInfo(this.params.id) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getInfo (id) { | ||||
|         this.instance.post(`/app/appepidemicpreventionriskarea/queryDetailById?id=${id}`).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.form = res.data | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       confirm () { | ||||
|         this.$refs.form.validate((valid) => { | ||||
|           if (valid) { | ||||
|             this.instance.post(`/app/appepidemicpreventionriskarea/addOrUpdate`, { | ||||
|               ...this.form | ||||
|             }).then(res => { | ||||
|               if (res.code == 0) { | ||||
|                 this.$message.success('提交成功') | ||||
|                 setTimeout(() => { | ||||
|                   this.cancel(true) | ||||
|                 }, 600) | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       cancel (isRefresh) { | ||||
|         this.$emit('change', { | ||||
|           type: 'list', | ||||
|           isRefresh: !!isRefresh | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   .content-add { | ||||
|     .video { | ||||
|       width: 640px; | ||||
|       height: 360px; | ||||
|       border-radius: 4px; | ||||
|       border: 1px dashed #D0D4DC; | ||||
|       display: flex; | ||||
|       flex-direction: column; | ||||
|       align-items: center; | ||||
|       justify-content: center; | ||||
|  | ||||
|       .icon { | ||||
|         display: flex; | ||||
|         flex-direction: column; | ||||
|         align-items: center; | ||||
|         justify-content: center; | ||||
|  | ||||
|         span:nth-child(2) { | ||||
|           display: inline-block; | ||||
|           font-size: 16px; | ||||
|           color: #333333; | ||||
|           line-height: 30px; | ||||
|         } | ||||
|  | ||||
|         .iconfont { | ||||
|           display: inline-block; | ||||
|           font-size: 40px; | ||||
|           color: #2266FF; | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       .tips { | ||||
|         display: inline-block; | ||||
|         font-size: 12px; | ||||
|         color: #999999; | ||||
|         line-height: 26px; | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     .video-com { | ||||
|       width: 640px; | ||||
|       height: 360px; | ||||
|       background: rgba(0, 0, 0, 0.5); | ||||
|       border-radius: 2px; | ||||
|       border: 1px solid #D0D4DC; | ||||
|       margin-top: -40px; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
							
								
								
									
										136
									
								
								project/activeAnalysis/app/AppActivity/components/List.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										136
									
								
								project/activeAnalysis/app/AppActivity/components/List.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,136 @@ | ||||
| <template> | ||||
|   <ai-list class="notice"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="活动管理" isShowBottomBorder> | ||||
|       </ai-title> | ||||
|     </template> | ||||
|     <template slot="content"> | ||||
|       <ai-search-bar class="search-bar"> | ||||
|         <template #left> | ||||
|           <ai-select | ||||
|             v-model="search.level" | ||||
|             clearable | ||||
|             placeholder="请选择风险等级" | ||||
|             :selectList="dict.getDict('epidemicDangerousAreaLevel')" | ||||
|             @change="search.current = 1, getList()"> | ||||
|           </ai-select> | ||||
|           <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button> | ||||
|         </template> | ||||
|         <template #right> | ||||
|           <el-input | ||||
|             v-model="search.province" | ||||
|             class="search-input" | ||||
|             size="small" | ||||
|             v-throttle="() => {search.current = 1, getList()}" | ||||
|             placeholder="省级名称/市级名称/区级名称" | ||||
|             clearable | ||||
|             @clear="search.current = 1, search.province = '', getList()" | ||||
|             suffix-icon="iconfont iconSearch"> | ||||
|           </el-input> | ||||
|         </template> | ||||
|       </ai-search-bar> | ||||
|       <ai-table | ||||
|           :tableData="tableData" | ||||
|           :col-configs="colConfigs" | ||||
|           :total="total" | ||||
|           style="margin-top: 6px;" | ||||
|           :current.sync="search.current" | ||||
|           :size.sync="search.size" | ||||
|           @getList="getList"> | ||||
|         <el-table-column slot="options" width="140px" fixed="right" label="操作" align="center"> | ||||
|           <template slot-scope="{ row }"> | ||||
|             <div class="table-options"> | ||||
|               <el-button type="text" @click="toAdd(row.id)">编辑</el-button> | ||||
|               <el-button type="text" @click="remove(row.id)">删除</el-button> | ||||
|             </div> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </ai-table> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   export default { | ||||
|     name: 'List', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           level: '', | ||||
|           province: '' | ||||
|         }, | ||||
|         isLoading: false, | ||||
|         currIndex: -1, | ||||
|         areaList: [], | ||||
|         total: 10, | ||||
|         colConfigs: [ | ||||
|           { prop: 'province',  label: '省', align: 'left', width: '200px' }, | ||||
|           { prop: 'city', label: '地市', align: 'center' }, | ||||
|           { prop: 'district', label: '区县', align: 'center' }, | ||||
|           { prop: 'town', label: '镇街', align: 'center' }, | ||||
|           { prop: 'village', label: '村社区', align: 'center' }, | ||||
|           { prop: 'address', label: '详细地址', align: 'center' }, | ||||
|           { prop: 'level', label: '等级', align: 'center', format: v => this.dict.getLabel('epidemicDangerousAreaLevel', v) }, | ||||
|           { prop: 'createTime', label: '设置时间', align: 'center' }, | ||||
|           { prop: 'createUserName', label: '添加人', align: 'center' }, | ||||
|           { slot: 'options', label: '操作', align: 'center' } | ||||
|         ], | ||||
|         areaName: '', | ||||
|         unitName: '', | ||||
|         tableData: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created() { | ||||
|       this.dict.load('epidemicDangerousAreaLevel').then(() => { | ||||
|         this.getList() | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getList() { | ||||
|         this.instance.post(`/app/appepidemicpreventionriskarea/list`, null, { | ||||
|           params: { | ||||
|             ...this.search | ||||
|           } | ||||
|         }).then(res => { | ||||
|           if (res.code == 0) { | ||||
|             this.tableData = res.data.records | ||||
|             this.total = res.data.total | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       remove(id) { | ||||
|         this.$confirm('确定删除该数据?').then(() => { | ||||
|           this.instance.post(`/app/appepidemicpreventionriskarea/delete?ids=${id}`).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success('删除成功!') | ||||
|               this.getList() | ||||
|             } | ||||
|           }) | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toAdd(id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Add', | ||||
|           params: { | ||||
|             id: id || '' | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user