Explorar o código

feat():区域列表

geek %!s(int64=4) %!d(string=hai) anos
pai
achega
9ca366d0f5

+ 8 - 0
src/api/join.js

@@ -32,6 +32,14 @@ export function updateJoin(data) {
   })
 }
 
+export function dealJoin(data) {
+  return request({
+    url: '/Join/dealJoin',
+    method: 'post',
+    data
+  })
+}
+
 export function deleteJoin(id) {
   return request({
     url: '/Join/delete?id=' + id,

+ 11 - 11
src/views/advice/list.vue

@@ -15,7 +15,7 @@
       <el-table-column class-name="status-col" label="状态" width="80ß">
         <template slot-scope="{row}">
           <el-tag :type="row.status | statusFilter">
-            {{ row.status == '1' ? "正常" : "删除" }}
+            {{ row.status == '1' ? "未处理 " : "已处理" }}
           </el-tag>
         </template>
       </el-table-column>
@@ -26,15 +26,15 @@
           </router-link>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="Actions" width="190" class-name="small-padding fixed-width">
+      <el-table-column align="center" label="Actions" width="230" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <router-link :to="'/advice/edit/'+scope.row.id">
             <el-button type="primary" size="mini" icon="el-icon-edit">
               修改
             </el-button>
           </router-link>
-          <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
-            删除
+          <el-button type="danger" size="mini" icon="el-icon-s-check" style="margin-left: 10px;" :disabled="scope.row.status == '1' ? false : true" @click="handleDelete(scope)">
+            {{ scope.row.status == '1' ? "未处理 " : "已处理" }}
           </el-button>
         </template>
       </el-table-column>
@@ -45,7 +45,7 @@
 </template>
 
 <script>
-import { fetchList, deleteAdvice } from '@/api/advice'
+import { fetchList, deleteAdvice, fetchAdvice } from '@/api/advice'
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
 import waves from '@/directive/waves'
 
@@ -56,9 +56,8 @@ export default {
   filters: {
     statusFilter(status) {
       const statusMap = {
-        normal: 'success',
-        draft: 'info',
-        deleted: 'danger'
+        1: 'success',
+        2: 'info'
       }
       return statusMap[status]
     }
@@ -96,17 +95,18 @@ export default {
     },
     handleDelete({ $index, row }) {
       console.log(row.id)
-      this.$confirm('您确定要删除吗', '警告', {
+      this.$confirm('您确定要处理吗', '警告', {
         confirmButtonText: '是的',
         cancelButtonText: '取消',
         type: 'warning'
       })
         .then(async() => {
           await deleteAdvice(row.id)
-          this.list.splice($index, 1)
+          const rs = await fetchAdvice(row.id)
+          this.list.splice($index, 1, rs.data.info)
           this.$message({
             type: 'success',
-            message: '删除成功'
+            message: '处理成功'
           })
         })
     }

+ 1 - 1
src/views/banner/components/ArticleDetail.vue

@@ -14,7 +14,7 @@
         </el-row>
         <el-row>
           <div class="postInfo-container">
-            <div style="margin-bottom: 10px;">跳转路</div>
+            <div style="margin-bottom: 10px;">跳转路</div>
             <el-form-item prop="redirect" style="margin-bottom: 30px;" label="">
               <el-input v-model="postForm.redirect" placeholder="请输入路径" style="width: 300px;" />
             </el-form-item>

+ 11 - 9
src/views/city/list.vue

@@ -24,7 +24,7 @@
       <el-table-column class-name="status-col" label="状态" width="80ß">
         <template slot-scope="{row}">
           <el-tag :type="row.status | statusFilter">
-            {{ row.status == '1' ? "正常" : "删除" }}
+            {{ row.status == '1' ? "正常" : "隐藏" }}
           </el-tag>
         </template>
       </el-table-column>
@@ -38,8 +38,8 @@
           <el-button type="primary" size="mini" icon="el-icon-edit" @click="handleUpdate(scope)">
             修改
           </el-button>
-          <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
-            删除
+          <el-button :type="scope.row.status == '1' ? 'danger' : 'success'" size="mini" icon="el-icon-turn-off" style="margin-left: 10px;" @click="handleDelete(scope)">
+            {{ scope.row.status == '1' ? "隐藏" : "开启" }}
           </el-button>
         </template>
       </el-table-column>
@@ -75,9 +75,9 @@ export default {
   filters: {
     statusFilter(status) {
       const statusMap = {
-        normal: 'success',
+        1: 'success',
         draft: 'info',
-        deleted: 'danger'
+        2: 'danger'
       }
       return statusMap[status]
     }
@@ -123,19 +123,21 @@ export default {
         this.listLoading = false
       })
     },
-    handleDelete({ $index, row }) {
+    handleDelete: function({ $index, row }) {
       console.log(row.id)
-      this.$confirm('您确定要删除吗', '警告', {
+      const type = row.status === 1 ? '隐藏' : '开启'
+      this.$confirm('您确定要' + type + '吗', '警告', {
         confirmButtonText: '是的',
         cancelButtonText: '取消',
         type: 'warning'
       })
         .then(async() => {
           await deleteOpenArea(row.id)
-          this.list.splice($index, 1)
+          const rs = await fetchOpenArea(row.id)
+          this.list.splice($index, 1, rs.data.info)
           this.$message({
             type: 'success',
-            message: '删除成功'
+            message: type + '成功'
           })
         })
     },

+ 56 - 10
src/views/join/list.vue

@@ -50,26 +50,46 @@
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="Actions" width="190" class-name="small-padding fixed-width">
+      <el-table-column align="center" label="Actions" width="300" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <router-link :to="'/join/edit/'+scope.row.id">
-            <el-button type="primary" size="mini" icon="el-icon-edit">
-              查看
+          <el-row>
+            <router-link :to="'/join/edit/'+scope.row.id">
+              <el-button type="primary" size="mini" icon="el-icon-edit" style="margin-right: 10px;">
+                查看
+              </el-button>
+            </router-link>
+            <el-button type="info" size="mini" icon="el-icon-s-check" :disabled="scope.row.status == '1' ? true : false" @click="handleUpdate(scope)">
+              {{ scope.row.status == '1' ? '已处理' : '处理' }}
             </el-button>
-          </router-link>
-          <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
-            删除
-          </el-button>
+            <!--<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
+              删除
+            </el-button>-->
+          </el-row>
         </template>
       </el-table-column>
     </el-table>
 
     <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
+    <el-dialog title="处理备注" :visible.sync="dialogFormVisible">
+      <el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
+        <el-form-item label="备注" prop="mark">
+          <el-input v-model="temp.mark" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">
+          取消
+        </el-button>
+        <el-button type="primary" @click="updateData()">
+          确定
+        </el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { fetchList, deleteJoin } from '@/api/join'
+import { fetchList, deleteJoin, dealJoin, fetchJoin } from '@/api/join'
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
 import waves from '@/directive/waves'
 
@@ -103,7 +123,12 @@ export default {
       listQuery: {
         page: 1,
         pageSize: 10
-      }
+      },
+      temp: {
+        id: undefined,
+        mark: ''
+      },
+      dialogFormVisible: false
     }
   },
   created() {
@@ -141,6 +166,27 @@ export default {
             message: '隐藏成功'
           })
         })
+    },
+    async handleUpdate({ $index, row }) {
+      this.temp = Object.assign({}, row) // copy obj
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    async updateData() {
+      const tempData = Object.assign({}, this.temp)
+      await dealJoin(tempData)
+      const rs = await fetchJoin(tempData.id)
+      const index = this.list.findIndex(v => v.id === this.temp.id)
+      this.list.splice(index, 1, rs.data.info)
+      this.dialogFormVisible = false
+      this.$notify({
+        title: '成功',
+        message: '更新成功',
+        type: 'success',
+        duration: 2000
+      })
     }
   }
 }