村民议事
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| <template> | <template> | ||||||
|   <ai-detail> |   <ai-detail> | ||||||
|     <template slot="title"> |     <template slot="title"> | ||||||
|       <ai-title :title="params.id ? '编辑本村简介' : '添加本村简介'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> |       <ai-title :title="params.id ? '编辑村民议事' : '添加村民议事'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||||
|       </ai-title> |       </ai-title> | ||||||
|     </template> |     </template> | ||||||
|     <template slot="content"> |     <template slot="content"> | ||||||
| @@ -9,62 +9,63 @@ | |||||||
|         <template #content> |         <template #content> | ||||||
|           <el-form class="ai-form" :model="form" label-width="120px" ref="form"> |           <el-form class="ai-form" :model="form" label-width="120px" ref="form"> | ||||||
|             <el-form-item label="主题" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入主题', trigger: 'blur'}]"> |             <el-form-item label="主题" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入主题', trigger: 'blur'}]"> | ||||||
|               <el-input type="textarea" :rows="5" v-model="form.title" clearable placeholder="请输入主题..." maxlength="30" show-word-limit></el-input> |               <el-input type="textarea" :rows="5" v-model="form.title" clearable placeholder="请输入主题..." :maxlength="500" show-word-limit></el-input> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item prop="areaId" style="width: 100%;" label="发布地区" :rules="[{required: true, message: '请选择地区', trigger: 'change'}]"> |             <el-form-item prop="areaId" style="width: 100%;" label="发布地区" :rules="[{required: true, pattern: /([^0]\d{2}|0[^0]\d|0\d[^0])$/, message: '请选择到村', trigger: 'change'}]"> | ||||||
|               <ai-area-select clearable always-show :instance="instance" v-model="form.areaId" :disabled-level="disabledLevel"></ai-area-select> |               <ai-area-select @fullname="form.areaName" clearable always-show :instance="instance" v-model="form.areaId" :disabled-level="disabledLevel"></ai-area-select> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="议事截止时间" prop="date" :rules="[{required: true, message: '请选择议事截止时间', trigger: 'change'}]"> |             <el-form-item label="议事截止时间" prop="discussDeadline" :rules="[{required: true, message: '请选择议事截止时间', trigger: 'change'}]"> | ||||||
|               <el-date-picker |               <el-date-picker | ||||||
|                 v-model="form.date" |                 v-model="form.discussDeadline" | ||||||
|                 type="datetime" |                 type="datetime" | ||||||
|                 style="width: 100%;" |                 style="width: 100%;" | ||||||
|                 size="small" |                 size="small" | ||||||
|  |                 value-format="yyyy-MM-dd hh:mm:ss" | ||||||
|                 placeholder="选择议事截止时间"> |                 placeholder="选择议事截止时间"> | ||||||
|               </el-date-picker> |               </el-date-picker> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="公示截止时间" prop="time" :rules="[{required: true, message: '请选择公示截止时间', trigger: 'change'}]"> |             <el-form-item label="公示截止时间" prop="publicityDeadline" :rules="[{required: true, message: '请选择公示截止时间', trigger: 'change'}]"> | ||||||
|               <el-date-picker |               <el-date-picker | ||||||
|                 v-model="form.time" |                 v-model="form.publicityDeadline" | ||||||
|                 size="small" |                 size="small" | ||||||
|                 style="width: 100%;" |                 style="width: 100%;" | ||||||
|                 type="datetime" |                 type="datetime" | ||||||
|  |                 value-format="yyyy-MM-dd hh:mm:ss" | ||||||
|                 placeholder="选择公示截止时间"> |                 placeholder="选择公示截止时间"> | ||||||
|               </el-date-picker> |               </el-date-picker> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="议事类型" prop="type" :rules="[{required: true, message: '请选择议事类型', trigger: 'change'}]"> |             <el-form-item label="议事类型" prop="type" :rules="[{required: true, message: '请选择议事类型', trigger: 'change'}]"> | ||||||
|               <el-radio-group v-model="form.type"> |               <el-radio-group v-model="form.type"> | ||||||
|                 <el-radio label="0">意见征集</el-radio> |                 <el-radio :label="item.dictValue" v-for="(item, index) in dict.getDict('discussType')" :key="index">{{ item.dictName }}</el-radio> | ||||||
|                 <el-radio label="1">投票表决</el-radio> |  | ||||||
|               </el-radio-group> |               </el-radio-group> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item class="vite-form__item" style="width: 100%;" label="投票选项" prop="type" :rules="[{required: true, message: '请添加投票选项', trigger: 'change'}]"> |             <el-form-item v-if="form.type === '1'" class="vite-form__item" style="width: 100%;" label="投票选项" prop="voteItems" :rules="[{required: true, message: '请添加投票选项', trigger: 'change'}]"> | ||||||
|               <el-form-item label-width="80px" :label="'选项' + index" v-for="(item, index) in form.voteList" :key="index + item.name"> |               <el-form-item label-width="80px" :label="'选项' + (index + 1)" v-for="(item, index) in form.voteItems" :key="'选项' + (index + 1)"> | ||||||
|                 <div class="form-flex"> |                 <div class="form-flex"> | ||||||
|                   <el-input v-model="item.name" size="small" clearable placeholder="请输入选项"></el-input> |                   <el-input v-model="item.content" size="small" clearable placeholder="请输入选项"></el-input> | ||||||
|                   <el-button type="danger" size="small" @click="removeVote(index)">删除</el-button> |                   <el-button type="danger" size="small" @click="removeVote(index)">删除</el-button> | ||||||
|                 </div> |                 </div> | ||||||
|               </el-form-item> |               </el-form-item> | ||||||
|               <el-button type="primary" size="small" @click="addVote">添加选项</el-button> |               <el-button type="primary" size="small" @click="addVote">添加选项</el-button> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="是否匿名投票" prop="anonymity" :rules="[{required: true, message: '请选择是否匿名投票', trigger: 'change'}]"> |             <el-form-item v-if="form.type === '1'" label="是否匿名投票" prop="anonymous" :rules="[{required: true, message: '请选择是否匿名投票', trigger: 'change'}]"> | ||||||
|               <el-switch |               <el-switch | ||||||
|                 v-model="form.anonymity" |                 v-model="form.anonymous" | ||||||
|                 active-value="1" |                 active-value="1" | ||||||
|                 inactive-value="0"> |                 inactive-value="0"> | ||||||
|             </el-switch> |               </el-switch> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="投票方式" prop="type" :rules="[{required: true, message: '请选择投票方式', trigger: 'change'}]"> |             <el-form-item v-if="form.type === '1'" label="投票方式" prop="voteType" :rules="[{required: true, message: '请选择投票方式', trigger: 'change'}]"> | ||||||
|               <el-radio-group v-model="form.type"> |               <el-radio-group v-model="form.voteType"> | ||||||
|                 <el-radio label="0">单选</el-radio> |                 <el-radio label="0">单选</el-radio> | ||||||
|                 <el-radio label="1">多选</el-radio> |                 <el-radio label="1">多选</el-radio> | ||||||
|               </el-radio-group> |               </el-radio-group> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
|             <el-form-item label="图片" style="width: 100%;" prop="thumbUrl"> |             <el-form-item label="图片" style="width: 100%;" prop="images"> | ||||||
|               <ai-uploader |               <ai-uploader | ||||||
|                 :instance="instance" |                 :instance="instance" | ||||||
|                 isShowTip |                 isShowTip | ||||||
|                 v-model="form.thumbUrl" |                 v-model="form.images" | ||||||
|                 :limit="9"> |                 :limit="9"> | ||||||
|               </ai-uploader> |               </ai-uploader> | ||||||
|             </el-form-item> |             </el-form-item> | ||||||
| @@ -95,18 +96,18 @@ | |||||||
|         info: {}, |         info: {}, | ||||||
|         form: { |         form: { | ||||||
|           title: '', |           title: '', | ||||||
|           content: '', |  | ||||||
|           areaId: '', |           areaId: '', | ||||||
|           date: '', |           areaName: '', | ||||||
|           type: '', |           anonymous: '0', | ||||||
|           voteList: [], |           discussDeadline: '', | ||||||
|           time: '', |           publicityDeadline: '', | ||||||
|  |           type: '0', | ||||||
|  |           voteType: '0', | ||||||
|  |           voteItems: [], | ||||||
|           anonymity: '1', |           anonymity: '1', | ||||||
|           createUnitName: '', |           images: [] | ||||||
|           createUserName: '', |  | ||||||
|           status: '', |  | ||||||
|           thumbUrl: [] |  | ||||||
|         }, |         }, | ||||||
|  |         keys: ['A', 'B', 'C', 'D', 'E', 'F', 'G'], | ||||||
|         id: '' |         id: '' | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
| @@ -117,6 +118,7 @@ | |||||||
|  |  | ||||||
|     created () { |     created () { | ||||||
|       this.form.areaId = this.user.info.areaId |       this.form.areaId = this.user.info.areaId | ||||||
|  |       this.form.areaName = this.user.info.areaName | ||||||
|       this.disabledLevel = this.user.info.areaList.length |       this.disabledLevel = this.user.info.areaList.length | ||||||
|       if (this.params && this.params.id) { |       if (this.params && this.params.id) { | ||||||
|         this.id = this.params.id |         this.id = this.params.id | ||||||
| @@ -126,34 +128,49 @@ | |||||||
|  |  | ||||||
|     methods: { |     methods: { | ||||||
|       getInfo (id) { |       getInfo (id) { | ||||||
|         this.instance.post(`/app/appcountrysidetourism/queryDetailById?id=${id}`).then(res => { |         this.instance.post(`/app/appvillagediscuss/queryDetailById?id=${id}`).then(res => { | ||||||
|           if (res.code === 0) { |           if (res.code === 0) { | ||||||
|             this.form = res.data |             this.form = res.data | ||||||
|             this.form.thumbUrl = res.data.thumbUrl ? JSON.parse(res.data.thumbUrl) : [] |             this.form.images = res.data.images ? JSON.parse(res.data.images) : [] | ||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       addVote () { |       addVote () { | ||||||
|         this.form.voteList.push({ |         if (this.form.voteItems > 7) { | ||||||
|           name: '' |           return this.$message.error('选项不能大于7个') | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         this.form.voteItems.push({ | ||||||
|  |           content: '' | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       removeVote (index) { |       removeVote (index) { | ||||||
|         this.form.voteList.splice(index, 1) |         this.form.voteItems.splice(index, 1) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       confirm () { |       confirm () { | ||||||
|         this.$refs.form.validate((valid) => { |         this.$refs.form.validate((valid) => { | ||||||
|           if (valid) { |           if (valid) { | ||||||
|             this.instance.post(`/app/appcountrysidetourism/addOrUpdate`, { |             if (this.form.type === '1' && this.form.voteItems.length < 2) { | ||||||
|  |               return this.$message.error('投票选项不能少于2') | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             if (this.form.type === '1') { | ||||||
|  |               this.form.voteItems = this.form.voteItems.map((v, index) => { | ||||||
|  |                 return { | ||||||
|  |                   content: v.content, | ||||||
|  |                   item: this.keys[index] | ||||||
|  |                 } | ||||||
|  |               }) | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             this.instance.post(`/app/appvillagediscuss/addOrUpdate`, { | ||||||
|               ...this.form, |               ...this.form, | ||||||
|               type: 0, |               createUserId: this.user.info.id, | ||||||
|               createUserName: this.user.info.name, |               createUserName: this.user.info.name, | ||||||
|               thumbUrl: this.form.thumbUrl.length ? JSON.stringify([{ |               images: this.form.images.length ? JSON.stringify(this.form.images) : '', | ||||||
|                 url: this.form.thumbUrl[0].url |  | ||||||
|               }]) : '' |  | ||||||
|             }).then(res => { |             }).then(res => { | ||||||
|               if (res.code == 0) { |               if (res.code == 0) { | ||||||
|                 this.$message.success('提交成功') |                 this.$message.success('提交成功') | ||||||
|   | |||||||
| @@ -5,15 +5,29 @@ | |||||||
|       </ai-title> |       </ai-title> | ||||||
|     </template> |     </template> | ||||||
|     <template slot="content"> |     <template slot="content"> | ||||||
|       <AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar> |       <AiSidebar :tabTitle="tabList" v-model="currIndex" @change="onChange"></AiSidebar> | ||||||
|       <ai-card title="议题信息" v-show="currIndex === 0"> |       <ai-card title="议题信息" v-show="currIndex === 0"> | ||||||
|         <template #content> |         <template #content> | ||||||
|           <ai-wrapper> |           <ai-wrapper> | ||||||
|             <ai-info-item label="主题" value="主题"></ai-info-item> |             <ai-info-item label="主题" :value="info.title" isLine></ai-info-item> | ||||||
|  |             <ai-info-item label="发布地区" :value="info.areaName" isLine></ai-info-item> | ||||||
|  |             <ai-info-item label="议事截止时间" :value="info.discussDeadline"></ai-info-item> | ||||||
|  |             <ai-info-item label="公示截止时间" :value="info.publicityDeadline"></ai-info-item> | ||||||
|  |             <ai-info-item label="议事类型" :value="dict.getLabel('discussType', info.type)" isLine></ai-info-item> | ||||||
|  |             <ai-info-item label="是否匿名投票" v-if="info.type === '1'" :value="info.anonymous === '1' ? '是' : '否'"></ai-info-item> | ||||||
|  |             <ai-info-item label="投票方式" v-if="info.type === '1'" :value="info.voteType === '0' ? '单选' : '多选'"></ai-info-item> | ||||||
|  |             <ai-info-item label="图片"> | ||||||
|  |               <ai-uploader | ||||||
|  |                 :instance="instance" | ||||||
|  |                 disabled | ||||||
|  |                 v-model="info.images" | ||||||
|  |                 :limit="9"> | ||||||
|  |               </ai-uploader> | ||||||
|  |             </ai-info-item> | ||||||
|           </ai-wrapper> |           </ai-wrapper> | ||||||
|         </template> |         </template> | ||||||
|       </ai-card> |       </ai-card> | ||||||
|       <ai-card title="意见征集" v-if="false" v-show="currIndex === 1"> |       <ai-card title="意见征集" v-if="info.type === '0'" v-show="currIndex === 1"> | ||||||
|         <template #right> |         <template #right> | ||||||
|           <el-button type="primary" size="small" @click="isShowAdd = true">发表意见</el-button> |           <el-button type="primary" size="small" @click="isShowAdd = true">发表意见</el-button> | ||||||
|         </template> |         </template> | ||||||
| @@ -31,14 +45,14 @@ | |||||||
|           </ai-table> |           </ai-table> | ||||||
|         </template> |         </template> | ||||||
|       </ai-card> |       </ai-card> | ||||||
|       <ai-card title="投票统计" v-show="currIndex === 1"> |       <ai-card title="投票统计" v-show="currIndex === 1 && info.type === '1'"> | ||||||
|         <template #content> |         <template #content> | ||||||
|           <div id="chart"></div> |           <div class="chart" style="wdith: 800px; height: 240px; margin: 0 auto;"></div> | ||||||
|           <ai-table |           <ai-table | ||||||
|             class="detail-table__table" |             class="detail-table__table" | ||||||
|             :border="true" |             :border="true" | ||||||
|             :tableData="tableData" |             :tableData="tableData" | ||||||
|             :col-configs="colConfigs" |             :col-configs="voteColConfigs" | ||||||
|             :total="total" |             :total="total" | ||||||
|             :current.sync="search.current" |             :current.sync="search.current" | ||||||
|             :size.sync="search.size" |             :size.sync="search.size" | ||||||
| @@ -65,6 +79,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
|  |   import * as echarts from 'echarts' | ||||||
|   export default { |   export default { | ||||||
|     name: 'Detail', |     name: 'Detail', | ||||||
|  |  | ||||||
| @@ -90,111 +105,92 @@ | |||||||
|         currIndex: 0, |         currIndex: 0, | ||||||
|         tableData: [], |         tableData: [], | ||||||
|         colConfigs: [ |         colConfigs: [ | ||||||
|           {slot: 'userinfo'}, |           {prop: 'content', label: '发言内容', align: 'center'}, | ||||||
|           {prop: 'addWay', label: '客户来源', align: 'center', formart: v => this.dict.getLabel('wxCustomerAddWay', v)}, |           {prop: 'suport', label: '获赞次数', align: 'center'}, | ||||||
|           {prop: 'createTime', label: '添加时间', align: 'center'} |           {prop: 'createTime', label: '发言时间', align: 'center'}, | ||||||
|  |           {prop: 'createUserName', label: '发言人', align: 'center'}, | ||||||
|  |           {prop: 'createUserId', label: '发言身份', align: 'center', formart: v => v === this.info.createUserId ? '话事人' : '村民'} | ||||||
|         ], |         ], | ||||||
|  |         voteColConfigs: [ | ||||||
|  |           {prop: 'createTime', label: '投票时间', align: 'center'}, | ||||||
|  |           {prop: 'userName', label: '投票人', align: 'center'}, | ||||||
|  |           {prop: 'item', label: '投票选项', align: 'center'} | ||||||
|  |         ], | ||||||
|  |         statistic: {}, | ||||||
|         tabList: ['议题信息', '意见征集'] |         tabList: ['议题信息', '意见征集'] | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     created () { |     created () { | ||||||
|       if (this.params && this.params.id) { |       this.getInfo(this.params.id) | ||||||
|         this.id = this.params.id |  | ||||||
|         this.getInfo(this.params.id) |  | ||||||
|       } |  | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     methods: { |     methods: { | ||||||
|  |       onChange (e) { | ||||||
|  |         if (e === 1 && this.info.type === '1') { | ||||||
|  |  | ||||||
|  |           this.$nextTick(() => { | ||||||
|  |             this.initChart(this.statistic) | ||||||
|  |           }) | ||||||
|  |         } | ||||||
|  |       }, | ||||||
|  |  | ||||||
|       getInfo (id) { |       getInfo (id) { | ||||||
|         this.instance.post(`/app/appeveryvillagecode/queryDetailById?id=${id}`).then(res => { |         this.instance.post(`/app/appvillagediscuss/queryDetailById?id=${id}`).then(res => { | ||||||
|           if (res.code === 0) { |           if (res.code === 0) { | ||||||
|             // this.form = res.data |             this.info = res.data | ||||||
|  |             this.info.images = res.data.images ? JSON.parse(res.data.images) : [] | ||||||
|  |             this.getList(this.params.id, res.data.type) | ||||||
|  |  | ||||||
|  |             if (res.data.type === '1') { | ||||||
|  |               this.statistic = res.data.statistic | ||||||
|  |               this.tabList = ['议题信息', '投票表决'] | ||||||
|  |             } | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       getList(id, type) { | ||||||
|  |         this.instance.post(`${type === '0' ? '/app/appvillagediscussmessage/list' : '/app/appvillagediscussvote/list'}`, null, { | ||||||
|  |           params: { | ||||||
|  |             discussId: id, | ||||||
|  |             ...this.search | ||||||
|  |           } | ||||||
|  |         }).then(res => { | ||||||
|  |           if (res.code == 0) { | ||||||
|  |             this.tableData = res.data.records | ||||||
|  |             this.total = res.data.total | ||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       initChart(data) { |       initChart(data) { | ||||||
|         const y = data.map(v => this.$dict.getLabel('fpRiskType', v.risk_type) || '其他') |         this.chart = echarts.init(document.querySelector('.chart')) | ||||||
|         const v = data.map(v => v.c) |  | ||||||
|         const option = { |         const option = { | ||||||
|           tooltip: {}, |           tooltip: {}, | ||||||
|           color: ['#2896FF', '#09DBFE', '#61FDB9', '#FFBB69', '#8429FF', '#ea7ccc'], |           color: ['#2896FF', '#09DBFE', '#61FDB9', '#FFBB69', '#8429FF', '#ea7ccc'], | ||||||
|           grid: { |           legend: { | ||||||
|             top: '4%', |             right: '5%', | ||||||
|             left: '4%', |             top: 'center', | ||||||
|             right: '6%', |             orient: 'vertical' | ||||||
|             bottom: '0%', |  | ||||||
|             containLabel: true |  | ||||||
|           }, |  | ||||||
|           xAxis: { |  | ||||||
|             type: 'value', |  | ||||||
|             splitLine: { |  | ||||||
|               show: true, |  | ||||||
|               lineStyle: { |  | ||||||
|                 width: 1, |  | ||||||
|                 type: 'solid', |  | ||||||
|                 color: '#f5f5f5' |  | ||||||
|               } |  | ||||||
|             }, |  | ||||||
|             axisTick: { |  | ||||||
|               length: 1, |  | ||||||
|               show: true |  | ||||||
|             }, |  | ||||||
|             axisLabel: { |  | ||||||
|               align: 'center', |  | ||||||
|               padding: [2, 0, 0, 0], |  | ||||||
|               interval: 0, |  | ||||||
|               fontSize: 14, |  | ||||||
|               color: '#999' |  | ||||||
|             }, |  | ||||||
|             boundaryGap: true, |  | ||||||
|             axisLine: { |  | ||||||
|               show: true, |  | ||||||
|               lineStyle: { |  | ||||||
|                 width: 1, |  | ||||||
|                 type: 'solid', |  | ||||||
|                 color: '#aaa' |  | ||||||
|               } |  | ||||||
|             }, |  | ||||||
|           }, |  | ||||||
|           yAxis: { |  | ||||||
|             type: 'category', |  | ||||||
|             data: y, |  | ||||||
|             boundaryGap: true, |  | ||||||
|             axisTick: { |  | ||||||
|               length: 0, |  | ||||||
|               show: false |  | ||||||
|             }, |  | ||||||
|             splitLine: { |  | ||||||
|               show: true, |  | ||||||
|               lineStyle: { |  | ||||||
|                 color: ['#e9e9e9'], |  | ||||||
|                 width: 1, |  | ||||||
|                 type: 'solid' |  | ||||||
|               } |  | ||||||
|             }, |  | ||||||
|             nameTextStyle: { |  | ||||||
|               color: '#999', |  | ||||||
|               align: 'left' |  | ||||||
|             }, |  | ||||||
|             axisLine: { |  | ||||||
|               show: true, |  | ||||||
|               lineStyle: { |  | ||||||
|                 width: 1, |  | ||||||
|                 type: 'solid', |  | ||||||
|                 color: '#aaa' |  | ||||||
|               } |  | ||||||
|             }, |  | ||||||
|             axisLabel: { |  | ||||||
|               color: '#999' |  | ||||||
|             } |  | ||||||
|           }, |           }, | ||||||
|           series: [ |           series: [ | ||||||
|             { |             { | ||||||
|               name: '2011', |               type: 'pie', | ||||||
|               type: 'bar', |               radius: '50%', | ||||||
|               data: v |               data: Object.keys(data).map(v => { | ||||||
|  |                 return { | ||||||
|  |                   value: data[v], | ||||||
|  |                   name: v | ||||||
|  |                 } | ||||||
|  |               }), | ||||||
|  |               emphasis: { | ||||||
|  |                 itemStyle: { | ||||||
|  |                   shadowBlur: 10, | ||||||
|  |                   shadowOffsetX: 0, | ||||||
|  |                   shadowColor: 'rgba(0, 0, 0, 0.5)' | ||||||
|  |                 } | ||||||
|  |               } | ||||||
|             } |             } | ||||||
|           ] |           ] | ||||||
|         } |         } | ||||||
| @@ -219,10 +215,6 @@ | |||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       getList () { |  | ||||||
|  |  | ||||||
|       }, |  | ||||||
|  |  | ||||||
|       onClose () { |       onClose () { | ||||||
|  |  | ||||||
|       }, |       }, | ||||||
|   | |||||||
| @@ -6,6 +6,8 @@ | |||||||
|     <template slot="content"> |     <template slot="content"> | ||||||
|       <ai-search-bar class="search-bar"> |       <ai-search-bar class="search-bar"> | ||||||
|         <template #left> |         <template #left> | ||||||
|  |           <ai-select v-model="search.type" clearable @change="search.current = 1, getList()" :selectList="dict.getDict('discussType')"></ai-select> | ||||||
|  |           <ai-select v-model="search.status" clearable @change="search.current = 1, getList()" :selectList="dict.getDict('discussStatus')"></ai-select> | ||||||
|           <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">发布议事</el-button> |           <el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">发布议事</el-button> | ||||||
|         </template> |         </template> | ||||||
|         <template #right> |         <template #right> | ||||||
| @@ -36,12 +38,12 @@ | |||||||
|             </div> |             </div> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column slot="options" width="240px" fixed="right" label="操作" align="center"> |         <el-table-column slot="options" width="160px" fixed="right" label="操作" align="center"> | ||||||
|           <template slot-scope="{ row }"> |           <template slot-scope="{ row }"> | ||||||
|             <div class="table-options"> |             <div class="table-options"> | ||||||
|               <el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button> |               <el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button> | ||||||
|               <el-button type="text" :title="row.status == 1 ? '取消发布' : '发布'" @click="changeStatus(row)">{{ row.status == 1 ? '取消发布' : '发布' }}</el-button> |               <el-button type="text" title="取消公示" @click="changeStatus(row)" :disabled="row.status !== '1'">取消公示</el-button> | ||||||
|               <el-button type="text" @click="toAdd(row.id)">编辑</el-button> |               <!-- <el-button type="text" @click="toAdd(row.id)">编辑</el-button> --> | ||||||
|               <el-button type="text" @click="remove(row.id)">删除</el-button> |               <el-button type="text" @click="remove(row.id)">删除</el-button> | ||||||
|             </div> |             </div> | ||||||
|           </template> |           </template> | ||||||
| @@ -66,19 +68,22 @@ | |||||||
|         search: { |         search: { | ||||||
|           current: 1, |           current: 1, | ||||||
|           size: 10, |           size: 10, | ||||||
|           title: '' |           status: '', | ||||||
|  |           type: '', | ||||||
|  |           title: '', | ||||||
|  |           areaId: '' | ||||||
|         }, |         }, | ||||||
|         currIndex: -1, |         currIndex: -1, | ||||||
|         areaList: [], |         areaList: [], | ||||||
|         total: 10, |         total: 10, | ||||||
|         colConfigs: [ |         colConfigs: [ | ||||||
|           { prop: 'title',  label: '议事主题', align: 'left', width: '200px' }, |           { prop: 'title',  label: '议事主题', align: 'left', width: '200px' }, | ||||||
|           { prop: 'areaName', label: '议事类型', align: 'center' }, |           { prop: 'type', label: '议事类型', align: 'center', formart: v => this.dict.getLabel('discussType', v) }, | ||||||
|           { prop: 'createUnitName', label: '话事人', align: 'center' }, |           { prop: 'createUserName', label: '话事人', align: 'center' }, | ||||||
|           { prop: 'createUserName', label: '观点数量', align: 'center' }, |           { prop: 'msgCount', label: '观点数量', align: 'center' }, | ||||||
|           { prop: 'createUserName', label: '投票数量', align: 'center' }, |           { prop: 'voteCount', label: '投票数量', align: 'center' }, | ||||||
|           { prop: 'status', label: '发布状态', align: 'center', formart: v => v === '1' ? '已发布' : '未发布' }, |           { prop: 'status', label: '发布状态', align: 'center', formart: v => this.dict.getLabel('discussStatus', v) }, | ||||||
|           { prop: 'createDate', label: '发布时间', align: 'center' }, |           { prop: 'createTime', label: '发布时间', align: 'center' }, | ||||||
|           { slot: 'options', label: '操作', align: 'center' } |           { slot: 'options', label: '操作', align: 'center' } | ||||||
|         ], |         ], | ||||||
|         areaName: '', |         areaName: '', | ||||||
| @@ -91,14 +96,16 @@ | |||||||
|       ...mapState(['user']) |       ...mapState(['user']) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     mounted() { |     created () { | ||||||
|       this.search.areaId = this.user.info.areaId |       this.search.areaId = this.user.info.areaId | ||||||
|       this.getList() |       this.dict.load(['discussType', 'discussStatus']).then(() => { | ||||||
|  |         this.getList() | ||||||
|  |       }) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     methods: { |     methods: { | ||||||
|       getList() { |       getList() { | ||||||
|         this.instance.post(`/app/appcountrysidetourism/list`, null, { |         this.instance.post(`/app/appvillagediscuss/list`, null, { | ||||||
|           params: { |           params: { | ||||||
|             type: 0, |             type: 0, | ||||||
|             ...this.search |             ...this.search | ||||||
| @@ -112,12 +119,13 @@ | |||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       changeStatus (item) { |       changeStatus (item) { | ||||||
|         let title = item.status == '1' ? '是否要取消发布?' : '是否要发布?'; |         this.$confirm('是否要结束公示', {type: 'warning'}).then(() => { | ||||||
|         this.$confirm(title, {type: 'warning'}).then(() => { |           this.instance.post('/app/appvillagediscuss/finishPublic', { | ||||||
|           item.status = item.status == '1' ? '0' : '1' |             stauts: '2', | ||||||
|           this.instance.post('/app/appcountrysidetourism/addOrUpdate', item).then(res => { |             id: item.id | ||||||
|  |           }).then(res => { | ||||||
|             if (res && res.code == 0) { |             if (res && res.code == 0) { | ||||||
|               title == '是否要发布?' ? this.$message.success('发布成功') : this.$message.success('取消发布成功') |               this.$message.success('结束公示') | ||||||
|               this.getList() |               this.getList() | ||||||
|             } |             } | ||||||
|           }) |           }) | ||||||
| @@ -126,7 +134,7 @@ | |||||||
|  |  | ||||||
|       remove(id) { |       remove(id) { | ||||||
|         this.$confirm('确定删除该数据?').then(() => { |         this.$confirm('确定删除该数据?').then(() => { | ||||||
|           this.instance.post(`/app/appcountrysidetourism/delete?ids=${id}`).then(res => { |           this.instance.post(`/app/appvillagediscuss/delete?ids=${id}`).then(res => { | ||||||
|             if (res.code == 0) { |             if (res.code == 0) { | ||||||
|               this.$message.success('删除成功!') |               this.$message.success('删除成功!') | ||||||
|               this.getList() |               this.getList() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user