Bläddra i källkod

积分管理菜单下新增活跃度判定规则富文本

sunny 3 dagar sedan
förälder
incheckning
9703a8707f
3 ändrade filer med 85 tillägg och 0 borttagningar
  1. 1 0
      src/permission.js
  2. 1 0
      src/router/index.js
  3. 83 0
      src/views/pointManage/activityRules.vue

+ 1 - 0
src/permission.js

@@ -55,6 +55,7 @@ const myRoles = [
   'pointManage', 
   'pointIndateList',
   'pointInstructions', 
+  'activityRules',
   'pointRulesList', 
   'pointList', 
   'pointsDetailList',

+ 1 - 0
src/router/index.js

@@ -102,6 +102,7 @@ export const asyncRouterMap = [
     },
     children: [
       { path: 'pointInstructions', component: _import('pointManage/pointInstructions'), name: 'pointInstructions', meta: { title: '积分规则说明书', noCache: true }},
+      { path: 'activityRules', component: _import('pointManage/activityRules'), name: 'activityRules', meta: { title: '活跃度判定规则', noCache: true }},
       { path: 'pointRulesList', component: _import('pointManage/pointRulesList'), name: 'pointRulesList', meta: { title: '积分规则列表', noCache: true }},
       { path: 'pointIndateList', component: _import('pointManage/pointIndateList'), name: 'pointIndateList', meta: { title: '积分有效期列表', noCache: true }},
       { path: 'pointList', component: _import('pointManage/pointList'), name: 'pointList', meta: { title: '积分列表', noCache: true }},

+ 83 - 0
src/views/pointManage/activityRules.vue

@@ -0,0 +1,83 @@
+<template>
+    <div class="app-container calendar-list-container" style="padding-bottom: 80px;">
+        <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="100px" style='width: 85%; margin-left:50px;'>
+         <el-form-item  label="标题" prop="title">
+              <el-input v-model="dataForm.title"></el-input>
+            </el-form-item>
+            <el-form-item
+              style="width: 100%"
+              label="内容"
+              prop="content"
+            >
+              <tinymce v-model="dataForm.content" ref="tinymce"></tinymce>
+            </el-form-item>
+        </el-form>
+        <el-button style="float: right;margin-right: 120px;" type="primary" @click="updateData">修改</el-button>
+    
+        
+    </div>
+   
+  </template>
+  
+  <style>
+    
+  </style>
+  
+  
+  <script>
+   import {rulesDetail, updateRule} from "@/api/public";
+    import waves from "@/directive/waves"; // 水波纹指令
+    import Tinymce from '@/components/Tinymce'
+    export default {
+    name: 'pointInstructions',
+    components: { Tinymce },
+    directives: { waves },
+    data() {
+      return {
+        dataForm: {
+          id:'',
+          title: '',
+          content: "",
+        },
+        dialogFormVisible: false,
+        rules: {
+            title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
+            content: [{ required: true, message: "活跃度判定规则不能为空", trigger: "blur" }],
+        },
+      }
+    },
+    created() {
+        this.getDetail();
+    },
+    methods: {
+    
+      getDetail() {
+        this.listLoading = true
+        rulesDetail({noticeType:'activityRules'}).then(response => {
+          this.dataForm.title = response.data.data.title;
+          this.dataForm.content = response.data.data.content;
+          this.dataForm.id = response.data.data.id;
+        }).catch(() => {})
+      },
+      updateData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            updateRule(this.dataForm).then(() => {
+                this.dialogFormVisible = false
+                this.$notify({
+                  title: '成功',
+                  message: '更新成功',
+                  type: 'success',
+                  duration: 2000
+                })
+                this.getDetail()
+              }) 
+          }
+        })
+      },
+  
+      
+    }
+  }
+  </script>
+