Browse Source

回复配置对话框

chao 3 years ago
parent
commit
b691b54df5
1 changed files with 21 additions and 1 deletions
  1. 21 1
      src/views/wechat/components/replyForm.vue

+ 21 - 1
src/views/wechat/components/replyForm.vue

@@ -39,7 +39,7 @@
       <el-table row-key="id" :data="textData">
       <el-table row-key="id" :data="textData">
         <el-table-column prop="title" label="标题">
         <el-table-column prop="title" label="标题">
           <template slot-scope="{row}">
           <template slot-scope="{row}">
-            <el-radio v-model="reply.relateId" :label="row.id">{{ limitString(row.title, 8) }}</el-radio>
+            <el-radio v-model="reply.relateId" :label="row.id" @change="setReplyTitle(row.title)">{{ limitString(row.title, 8) }}</el-radio>
           </template>>
           </template>>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="content" label="内容">
         <el-table-column prop="content" label="内容">
@@ -52,6 +52,10 @@
         <el-table-column prop="updateTime" label="最后更新时间" width="100" />
         <el-table-column prop="updateTime" label="最后更新时间" width="100" />
       </el-table>
       </el-table>
       <pagination v-show="textTotal>0" :total="textTotal" :page.sync="textQuery.pageNum" :limit.sync="textQuery.pageSize" @pagination="getTextData" />
       <pagination v-show="textTotal>0" :total="textTotal" :page.sync="textQuery.pageNum" :limit.sync="textQuery.pageSize" @pagination="getTextData" />
+      <div class="dialog-footer">
+        <el-button @click="resetReplyTitle">取 消</el-button>
+        <el-button type="primary" @click="dialogTableVisible = false">确 定</el-button>
+      </div>
     </el-dialog>
     </el-dialog>
   </div>
   </div>
 </template>
 </template>
@@ -143,6 +147,22 @@ export default {
       }
       }
       return str
       return str
     },
     },
+    setReplyTitle(title) {
+      this.reply.title = title
+    },
+    resetReplyTitle() {
+      if (this.$route.query.id) {
+        this.reply.id = this.$route.query.id
+        getReply(this.reply.id).then(response => {
+          this.reply.title = response.data.title
+          this.reply.relateId = response.data.relateId
+        })
+      } else {
+        this.reply.title = ''
+        this.reply.relateId = 0
+      }
+      this.dialogTableVisible = false
+    },
     resetForm(formName) {
     resetForm(formName) {
       this.$refs[formName].resetFields()
       this.$refs[formName].resetFields()
       this.reply = Object.assign({}, defaultReply)
       this.reply = Object.assign({}, defaultReply)