数字平昌
This commit is contained in:
		| @@ -0,0 +1,63 @@ | ||||
| <template> | ||||
|   <div class="AppHelp"> | ||||
|     <keep-alive :include="['List']"> | ||||
|       <component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component> | ||||
|     </keep-alive> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import List from './components/List' | ||||
|   import Add from './components/Add' | ||||
|  | ||||
|   export default { | ||||
|     name: 'AppIntegratingPublic', | ||||
|     label: '积分公示', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         component: 'List', | ||||
|         params: {}, | ||||
|         include: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     components: { | ||||
|       Add, | ||||
|       List | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onChange (data) { | ||||
|         if (data.type === 'Add') { | ||||
|           this.component = 'Add' | ||||
|           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"> | ||||
|   .AppHelp { | ||||
|     height: 100%; | ||||
|     background: #F3F6F9; | ||||
|     overflow: auto; | ||||
|   } | ||||
| </style> | ||||
| @@ -0,0 +1,138 @@ | ||||
| <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 label="所属网格" prop="girdId" style="width: 100%;" :rules="[{ required: true, message: '请选择所属网格', trigger: 'change' }]"> | ||||
|               <ai-picker :ops="{label: 'girdName'}" :instance="instance" v-model="form.girdId" @pick="e => onUserChange(e)" dialogTitle="选择所属网格" action="/app/appgirdinfo/girdList"> | ||||
|                 <div class="time-select"> | ||||
|                   <span class="dept-name" style="color:#999;" v-if="!form.girdName">选择所属网格</span> | ||||
|                   <span class="dept-name" v-else>{{ form.girdName }}</span> | ||||
|                   <i class="el-icon-arrow-down"></i> | ||||
|                 </div> | ||||
|               </ai-picker> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="一类" prop="classOne" style="width: 100%;" :rules="[{required: true, message: '请输入一类', trigger: 'change'}]"> | ||||
|               <el-input placeholder="请输入一类" size="small" v-model="form.classOne"></el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="二类" prop="classTwo" style="width: 100%;" :rules="[{required: true, message: '请输入二类', trigger: 'change'}]"> | ||||
|               <el-input placeholder="请输入二类" size="small" v-model="form.classTwo"></el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="三类" prop="classThree" style="width: 100%;" :rules="[{required: true, message: '请输入三类', trigger: 'change'}]"> | ||||
|               <el-input placeholder="请输入三类" size="small" v-model="form.classThree"></el-input> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="分值" prop="integral" style="width: 100%;" :rules="[{required: true, message: '请输入分值', trigger: 'change'}]"> | ||||
|               <el-input-number v-model="form.integral" :min="0"></el-input-number> | ||||
|             </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 | ||||
|     }, | ||||
|     data () { | ||||
|       return { | ||||
|         form: { | ||||
|           classOne: '', | ||||
|           classThree: '', | ||||
|           classTwo: '', | ||||
|           girdId: '', | ||||
|           girdName: '', | ||||
|           integral: '' | ||||
|         }, | ||||
|         id: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       if (this.params && this.params.id) { | ||||
|         this.id = this.params.id | ||||
|         this.getInfo(this.params.id) | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       getInfo (id) { | ||||
|         this.instance.post(`/app/appintegralpublicityinfo/queryDetailById?id=${id}`).then(res => { | ||||
|           if (res.code === 0) { | ||||
|             this.form = { | ||||
|               ...res.data, | ||||
|               girdId: [res.data.girdId] | ||||
|             } | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       confirm () { | ||||
|         this.$refs.form.validate((valid) => { | ||||
|           if (valid) { | ||||
|             this.isFlag = true | ||||
|             this.instance.post(`/app/appintegralpublicityinfo/addOrUpdate`, { | ||||
|               ...this.form, | ||||
|               girdId: this.form.girdId[0] | ||||
|             }).then(res => { | ||||
|               if (res.code == 0) { | ||||
|                 this.$message.success('提交成功') | ||||
|                 setTimeout(() => { | ||||
|                   this.cancel(true) | ||||
|                 }, 600) | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       cancel (isRefresh) { | ||||
|         this.$emit('change', { | ||||
|           type: 'List', | ||||
|           isRefresh: !!isRefresh | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       onUserChange (e) { | ||||
|         if (e.length) { | ||||
|           this.form.girdName = e[0].girdName | ||||
|         } else { | ||||
|           this.form.girdId = [] | ||||
|           this.form.girdName = '' | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   .time-select { | ||||
|     padding: 0 16px; | ||||
|     height: 36px; | ||||
|     line-height: 36px; | ||||
|     border: 1px solid #d0d4dc; | ||||
|     border-radius: 4px; | ||||
|     display: flex; | ||||
|     justify-content: space-between; | ||||
|     cursor: pointer; | ||||
|     .el-icon-arrow-down { | ||||
|       line-height: 36px; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
| @@ -0,0 +1,192 @@ | ||||
| <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-picker | ||||
|             :ops="{label: 'girdName'}" | ||||
|             dialogTitle="选择所属网格" | ||||
|             action="/app/appgirdinfo/girdList" | ||||
|             :instance="instance" | ||||
|             @change="search.current = 1, getList()" | ||||
|             @pick="onGirdChange" | ||||
|             v-model="search.girdId"> | ||||
|             <div class="userSelcet"> | ||||
|               <span style="color: #606266;" v-if="search.girdId.length">{{ search.girdName }}</span> | ||||
|               <span v-else>请选择网格</span> | ||||
|               <i class="el-icon-arrow-up"  v-if="!search.girdId.length"></i> | ||||
|               <i class="el-icon-circle-close" v-if="search.girdId.length" @click.stop="search.girdId = [], search.girdName, search.current = 1, getList()"></i> | ||||
|             </div> | ||||
|           </ai-picker> | ||||
|           <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button> | ||||
|           <ai-import | ||||
|             :instance="instance" | ||||
|             :dict="dict" | ||||
|             type="appintegralpublicityinfo" name="积分公示" | ||||
|             @success="search.current = 1, getList()"> | ||||
|           </ai-import> | ||||
|         </template> | ||||
|         <template #right> | ||||
|         </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="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> | ||||
|   import { mapState } from 'vuex' | ||||
|   export default { | ||||
|     name: 'List', | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         search: { | ||||
|           current: 1, | ||||
|           size: 10, | ||||
|           girdId: [], | ||||
|           girdName: '' | ||||
|         }, | ||||
|         total: 0, | ||||
|         colConfigs: [ | ||||
|           { prop: 'girdName',  label: '所属网格', align: 'left' }, | ||||
|           { prop: 'classOne',  label: '一类', align: 'center' }, | ||||
|           { prop: 'classTwo',  label: '二类', align: 'center' }, | ||||
|           { prop: 'classThree',  label: '三类', align: 'center' }, | ||||
|           { prop: 'integral',  label: '分值', align: 'center' }, | ||||
|           { slot: 'options'}, | ||||
|         ], | ||||
|         tableData: [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.getList() | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onGirdChange (e) { | ||||
|         if (e.length) { | ||||
|           this.search.girdName = e[0].girdName | ||||
|         } | ||||
|  | ||||
|         this.search.current = 1 | ||||
|         this.getList() | ||||
|       }, | ||||
|  | ||||
|       getList() { | ||||
|         this.instance.post(`/app/appintegralpublicityinfo/list`, null, { | ||||
|           params: { | ||||
|             ...this.search, | ||||
|             girdName: '', | ||||
|             girdId: this.search.girdId.length ? this.search.girdId[0] : '' | ||||
|           } | ||||
|         }).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/appintegralpublicityinfo/delete?ids=${id}`).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success('删除成功!') | ||||
|               this.getList() | ||||
|             } | ||||
|           }) | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toDetail (id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Detail', | ||||
|           params: { | ||||
|             id: id || '' | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|  | ||||
|       toAdd(id) { | ||||
|         this.$emit('change', { | ||||
|           type: 'Add', | ||||
|           params: { | ||||
|             id: id || '' | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
|   .notice .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