网格动态
This commit is contained in:
		
							
								
								
									
										64
									
								
								project/biaopin/AppFormReview/AppFormReview.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								project/biaopin/AppFormReview/AppFormReview.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | |||||||
|  | <template> | ||||||
|  |   <div class="AppFormReview"> | ||||||
|  |     <keep-alive :include="['List']"> | ||||||
|  |       <component ref="component" :is="component" :permissions="permissions " @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||||
|  |     </keep-alive> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |   import List from './components/List' | ||||||
|  |   import Detail from './components/Detail' | ||||||
|  |  | ||||||
|  |   export default { | ||||||
|  |     name: 'AppFormReview', | ||||||
|  |     label: '网格动态', | ||||||
|  |  | ||||||
|  |     props: { | ||||||
|  |       instance: Function, | ||||||
|  |       dict: Object, | ||||||
|  |       permissions: Function | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     data () { | ||||||
|  |       return { | ||||||
|  |         component: 'List', | ||||||
|  |         params: {}, | ||||||
|  |         include: [] | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     components: { | ||||||
|  |       List, | ||||||
|  |       Detail | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     methods: { | ||||||
|  |       onChange (data) { | ||||||
|  |         if (data.type === 'Detail') { | ||||||
|  |           this.component = 'Detail' | ||||||
|  |           this.params = data.params | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         if (data.type === 'List') { | ||||||
|  |           this.component = 'List' | ||||||
|  |           this.params = data.params | ||||||
|  |  | ||||||
|  |           this.$nextTick(() => { | ||||||
|  |             if (data.isRefresh) { | ||||||
|  |               this.$refs.component.getList() | ||||||
|  |             } | ||||||
|  |           }) | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss"> | ||||||
|  | .AppFormReview { | ||||||
|  |   height: 100%; | ||||||
|  |   background: #F3F6F9; | ||||||
|  |   overflow: auto; | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										144
									
								
								project/biaopin/AppFormReview/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										144
									
								
								project/biaopin/AppFormReview/components/Detail.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,144 @@ | |||||||
|  | <template> | ||||||
|  |   <ai-detail class="AppDynamicDetail"> | ||||||
|  |     <template slot="title"> | ||||||
|  |       <ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||||
|  |         <template #rightBtn> | ||||||
|  |           <div class="title-btns"> | ||||||
|  |             <el-button type="primary" icon="iconfont iconRegister" @click="isShowExamine = true" v-if="info.status == 0">审核</el-button> | ||||||
|  |           </div> | ||||||
|  |         </template> | ||||||
|  |       </ai-title> | ||||||
|  |     </template> | ||||||
|  |     <template slot="content"> | ||||||
|  |       <ai-card title="基本信息"> | ||||||
|  |         <template #content> | ||||||
|  |           <ai-wrapper label-width="120px"> | ||||||
|  |             <ai-info-item label="内容" isLine :value="info.content"></ai-info-item> | ||||||
|  |             <ai-info-item label="类型" isLine >{{dict.getLabel("wyGirdNewsType", info.type)}}</ai-info-item> | ||||||
|  |             <ai-info-item label="所属网格" isLine :value="info.girdName"></ai-info-item> | ||||||
|  |             <ai-info-item label="网格员姓名" isLine :value="info.name"></ai-info-item> | ||||||
|  |             <ai-info-item label="状态" isLine >{{dict.getLabel("auditStatus", info.status)}}</ai-info-item> | ||||||
|  |             <ai-info-item label="发布时间" isLine :value="info.createTime"></ai-info-item> | ||||||
|  |             <ai-info-item label="图片" isLine> | ||||||
|  |               <div class="files"> | ||||||
|  |                 <div class="file-item" v-for="(item, index) in info.files" :key="index"> | ||||||
|  |                   <img :src="item.url" v-viewer="{movable: true}"> | ||||||
|  |                 </div> | ||||||
|  |               </div> | ||||||
|  |             </ai-info-item> | ||||||
|  |           </ai-wrapper> | ||||||
|  |         </template> | ||||||
|  |       </ai-card> | ||||||
|  |        <ai-dialog | ||||||
|  |         :visible.sync="isShowExamine" | ||||||
|  |         width="800px" | ||||||
|  |         title="审核" | ||||||
|  |         @closed="isShowExamine=false" | ||||||
|  |         @onConfirm="handleEvent"> | ||||||
|  |         <el-form class="ai-form" label-width="120px" :model="form" ref="form"> | ||||||
|  |           <el-form-item label="是否通过" prop="status" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过' }]"> | ||||||
|  |             <el-radio-group v-model="form.status"> | ||||||
|  |               <el-radio label="1">是</el-radio> | ||||||
|  |               <el-radio label="0">否</el-radio> | ||||||
|  |             </el-radio-group> | ||||||
|  |           </el-form-item> | ||||||
|  |           <!-- <el-form-item label="处理意见" prop="content" style="width: 100%;" :rules="[{ required: true, message: '请输入处理意见' }]"> | ||||||
|  |             <el-input type="textarea" :rows="5" :maxlength="500" v-model="form.content" clearable placeholder="请输入处理意见" show-word-limit></el-input> | ||||||
|  |           </el-form-item> | ||||||
|  |           <el-form-item label="图片" prop="files" style="width: 100%;"> | ||||||
|  |             <ai-uploader | ||||||
|  |                 :instance="instance" | ||||||
|  |                 isShowTip | ||||||
|  |                 v-model="form.files" | ||||||
|  |                 :limit="9"> | ||||||
|  |             </ai-uploader> | ||||||
|  |           </el-form-item> --> | ||||||
|  |         </el-form> | ||||||
|  |       </ai-dialog> | ||||||
|  |     </template> | ||||||
|  |   </ai-detail> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |   export default { | ||||||
|  |     name: 'Detail', | ||||||
|  |  | ||||||
|  |     props: { | ||||||
|  |       instance: Function, | ||||||
|  |       dict: Object, | ||||||
|  |       params: Object, | ||||||
|  |       moduleId: String | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     data () { | ||||||
|  |       return { | ||||||
|  |         info: {}, | ||||||
|  |         id: '', | ||||||
|  |         isShowExamine: false, | ||||||
|  |         form: {status: ''} | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     created () { | ||||||
|  |       this.dict.load('wyGirdNewsType', 'auditStatus').then(() => { | ||||||
|  |         this.getDetail() | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     methods: { | ||||||
|  |       getDetail () { | ||||||
|  |         this.instance.post(`/app/appgirdnews/queryDetailById?id=${this.params.id}`).then(res => { | ||||||
|  |           if (res.code === 0) { | ||||||
|  |             this.info = res.data | ||||||
|  |             this | ||||||
|  |             this.info = { | ||||||
|  |               ...res.data | ||||||
|  |             } | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       handleEvent() { | ||||||
|  |         this.$refs.form.validate(v => { | ||||||
|  |           if (v) { | ||||||
|  |             this.instance.post(`/app/appgirdnews/examine?id=${this.params.id}&pass=${this.form.status}`).then(res => { | ||||||
|  |               if (res?.code == 0) { | ||||||
|  |                 this.isShowExamine = false | ||||||
|  |                 this.getDetail() | ||||||
|  |                 this.$message.success('审核成功!') | ||||||
|  |               } | ||||||
|  |             }) | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       cancel (isRefresh) { | ||||||
|  |         this.$emit('change', { | ||||||
|  |           type: 'List', | ||||||
|  |           isRefresh: !!isRefresh | ||||||
|  |         }) | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style scoped lang="scss"> | ||||||
|  |   .AppDynamicDetail { | ||||||
|  |     .files { | ||||||
|  |       display: flex; | ||||||
|  |       align-items: center; | ||||||
|  |       flex-wrap: wrap; | ||||||
|  |       .file-item { | ||||||
|  |         width: 240px; | ||||||
|  |         height: 240px; | ||||||
|  |         margin: 0 20px 20px 0; | ||||||
|  |  | ||||||
|  |         img, video { | ||||||
|  |           width: 100%; | ||||||
|  |           height: 100%; | ||||||
|  |           object-fit: cover; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | </style> | ||||||
							
								
								
									
										193
									
								
								project/biaopin/AppFormReview/components/List.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								project/biaopin/AppFormReview/components/List.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,193 @@ | |||||||
|  | <template> | ||||||
|  |   <ai-list class="notice"> | ||||||
|  |     <ai-title slot="title" title="网格动态" isShowBottomBorder></ai-title> | ||||||
|  |     <template slot="content"> | ||||||
|  |       <ai-search-bar class="search-bar"> | ||||||
|  |         <template #left> | ||||||
|  |           <ai-select | ||||||
|  |             v-model="search.type" | ||||||
|  |             @change="(search.current = 1), getList()" | ||||||
|  |             placeholder="请选择类型" | ||||||
|  |             :selectList="dict.getDict('wyGirdNewsType')"> | ||||||
|  |           </ai-select> | ||||||
|  |           <ai-picker | ||||||
|  |             :instance="instance" | ||||||
|  |             :multiple="false" | ||||||
|  |             dialogTitle="选择网格" | ||||||
|  |             :ops="{ label: 'girdName' }" | ||||||
|  |             pageTitle="网格" | ||||||
|  |             action="/app/appgirdinfo/girdList" | ||||||
|  |             @pick="onGridChange"> | ||||||
|  |             <div class="userSelcet"> | ||||||
|  |               <span style="color: #606266;" v-if="search.girdId">{{ search.girdName }}</span> | ||||||
|  |               <span v-else>请选择网格</span> | ||||||
|  |               <i class="el-icon-arrow-up"  v-if="!search.girdId"></i> | ||||||
|  |               <i class="el-icon-circle-close" v-if="search.girdId" @click.stop="search.girdId = '', search.girdName = '', search.current = 1, getList()"></i> | ||||||
|  |             </div> | ||||||
|  |           </ai-picker> | ||||||
|  |         </template> | ||||||
|  |         <template #right> | ||||||
|  |           <el-input | ||||||
|  |             v-model="search.content" | ||||||
|  |             class="search-input" | ||||||
|  |             size="small" | ||||||
|  |             v-throttle="() => {search.current = 1, getList()}" | ||||||
|  |             placeholder="内容" | ||||||
|  |             clearable | ||||||
|  |             @clear="search.current = 1, search.content = '', 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="120px" fixed="right" label="操作" align="center"> | ||||||
|  |           <template slot-scope="{ row }"> | ||||||
|  |             <div class="table-options"> | ||||||
|  |               <el-button type="text" @click="toDetail(row.id)">详情</el-button> | ||||||
|  |             </div> | ||||||
|  |           </template> | ||||||
|  |         </el-table-column> | ||||||
|  |       </ai-table> | ||||||
|  |     </template> | ||||||
|  |   </ai-list> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script> | ||||||
|  |   import { mapState } from 'vuex' | ||||||
|  |   export default { | ||||||
|  |     name: 'List', | ||||||
|  |  | ||||||
|  |     props: { | ||||||
|  |       instance: Function, | ||||||
|  |       dict: Object | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     data() { | ||||||
|  |       return { | ||||||
|  |         search: { | ||||||
|  |           current: 1, | ||||||
|  |           size: 10, | ||||||
|  |           content: '', | ||||||
|  |           areaId: '', | ||||||
|  |           girdId: '', | ||||||
|  |           girdName: '' | ||||||
|  |         }, | ||||||
|  |         total: 0, | ||||||
|  |         colConfigs: [ | ||||||
|  |           { prop: 'content',  label: '内容', align: 'left', width: '200px' }, | ||||||
|  |           { prop: 'type', align: 'center', label: '类型', dict:"wyGirdNewsType"}, | ||||||
|  |           { prop: 'girdName', label: '所属网格', align: 'center' }, | ||||||
|  |           { prop: 'name',  label: '网格员姓名', align: 'center' }, | ||||||
|  |           { prop: 'status', align: 'center', label: '状态', dict:"auditStatus"}, | ||||||
|  |           { prop: 'createTime', label: '发布时间', align: 'center' } | ||||||
|  |         ], | ||||||
|  |         tableData: [], | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     computed: { | ||||||
|  |       ...mapState(['user']), | ||||||
|  |  | ||||||
|  |       hideLevel () { | ||||||
|  |         return this.user.info.areaList.length || 0 | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       params () { | ||||||
|  |         return { | ||||||
|  |           ...this.search | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     created() { | ||||||
|  |       this.dict.load('wyGirdNewsType', 'auditStatus').then(() => { | ||||||
|  |         this.getList() | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     methods: { | ||||||
|  |       getList () { | ||||||
|  |         this.instance.post(`/app/appgirdnews/list`, null, { | ||||||
|  |           params: { | ||||||
|  |             ...this.search | ||||||
|  |           } | ||||||
|  |         }).then(res => { | ||||||
|  |           if (res.code == 0) { | ||||||
|  |             this.tableData = res.data.records | ||||||
|  |             this.total = res.data.total | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       onGridChange (e) { | ||||||
|  |         if (e.length) { | ||||||
|  |           this.search.girdId = e[0].id | ||||||
|  |           this.search.girdName = e[0].girdName | ||||||
|  |           this.search.current = 1 | ||||||
|  |           this.getList() | ||||||
|  |         } | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       toDetail(id) { | ||||||
|  |         this.$emit('change', { | ||||||
|  |           type: 'Detail', | ||||||
|  |           params: { | ||||||
|  |             id: id || '' | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <style lang="scss" scoped> | ||||||
|  |   .userSelcet { | ||||||
|  |     display: flex; | ||||||
|  |     align-items: center; | ||||||
|  |     justify-content: space-between; | ||||||
|  |     width: 215px; | ||||||
|  |     height: 32px; | ||||||
|  |     line-height: 32px; | ||||||
|  |     border-radius: 4px; | ||||||
|  |     border: 1px solid #d0d4dc; | ||||||
|  |     overflow: hidden; | ||||||
|  |     cursor: pointer; | ||||||
|  |     transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); | ||||||
|  |  | ||||||
|  |     &:hover { | ||||||
|  |       border-color: $placeholderColor; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     i { | ||||||
|  |       display: flex; | ||||||
|  |       position: relative; | ||||||
|  |       align-items: center; | ||||||
|  |       justify-content: center; | ||||||
|  |       width: 30px; | ||||||
|  |       height: 100%; | ||||||
|  |       line-height: 32px; | ||||||
|  |       font-size: 14px; | ||||||
|  |       text-align: center; | ||||||
|  |       color: #d0d4dc; | ||||||
|  |       transform: rotateZ(180deg); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     .el-icon-circle-close:hover { | ||||||
|  |       opacity: 0.6; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     span { | ||||||
|  |       flex: 1; | ||||||
|  |       padding: 0 15px; | ||||||
|  |       font-size: 12px; | ||||||
|  |       color: $placeholderColor; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | </style> | ||||||
		Reference in New Issue
	
	Block a user