Sfoglia il codice sorgente

Merge branch 'pre' of http://git.bjzxtw.org.cn:3000/zxt/admin_home into pre

LiuJ 1 settimana fa
parent
commit
0f6066b2f3

+ 0 - 26
plop-templates/component/index.hbs

@@ -1,26 +0,0 @@
-{{#if template}}
-<template>
-  <div />
-</template>
-{{/if}}
-
-{{#if script}}
-<script>
-export default {
-  name: '{{ properCase name }}',
-  props: {},
-  data() {
-    return {}
-  },
-  created() {},
-  mounted() {},
-  methods: {}
-}
-</script>
-{{/if}}
-
-{{#if style}}
-<style lang="scss" scoped>
-
-</style>
-{{/if}}

+ 0 - 55
plop-templates/component/prompt.js

@@ -1,55 +0,0 @@
-const { notEmpty } = require('../utils.js')
-
-module.exports = {
-  description: 'generate vue component',
-  prompts: [{
-    type: 'input',
-    name: 'name',
-    message: 'component name please',
-    validate: notEmpty('name')
-  },
-  {
-    type: 'checkbox',
-    name: 'blocks',
-    message: 'Blocks:',
-    choices: [{
-      name: '<template>',
-      value: 'template',
-      checked: true
-    },
-    {
-      name: '<script>',
-      value: 'script',
-      checked: true
-    },
-    {
-      name: 'style',
-      value: 'style',
-      checked: true
-    }
-    ],
-    validate(value) {
-      if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
-        return 'Components require at least a <script> or <template> tag.'
-      }
-      return true
-    }
-  }
-  ],
-  actions: data => {
-    const name = '{{properCase name}}'
-    const actions = [{
-      type: 'add',
-      path: `src/components/${name}/index.vue`,
-      templateFile: 'plop-templates/component/index.hbs',
-      data: {
-        name: name,
-        template: data.blocks.includes('template'),
-        script: data.blocks.includes('script'),
-        style: data.blocks.includes('style')
-      }
-    }]
-
-    return actions
-  }
-}

+ 0 - 16
plop-templates/store/index.hbs

@@ -1,16 +0,0 @@
-{{#if state}}
-const state = {}
-{{/if}}
-
-{{#if mutations}}
-const mutations = {}
-{{/if}}
-
-{{#if actions}}
-const actions = {}
-{{/if}}
-
-export default {
-  namespaced: true,
-  {{options}}
-}

+ 0 - 62
plop-templates/store/prompt.js

@@ -1,62 +0,0 @@
-const { notEmpty } = require('../utils.js')
-
-module.exports = {
-  description: 'generate store',
-  prompts: [{
-    type: 'input',
-    name: 'name',
-    message: 'store name please',
-    validate: notEmpty('name')
-  },
-  {
-    type: 'checkbox',
-    name: 'blocks',
-    message: 'Blocks:',
-    choices: [{
-      name: 'state',
-      value: 'state',
-      checked: true
-    },
-    {
-      name: 'mutations',
-      value: 'mutations',
-      checked: true
-    },
-    {
-      name: 'actions',
-      value: 'actions',
-      checked: true
-    }
-    ],
-    validate(value) {
-      if (!value.includes('state') || !value.includes('mutations')) {
-        return 'store require at least state and mutations'
-      }
-      return true
-    }
-  }
-  ],
-  actions(data) {
-    const name = '{{name}}'
-    const { blocks } = data
-    const options = ['state', 'mutations']
-    const joinFlag = `,
-  `
-    if (blocks.length === 3) {
-      options.push('actions')
-    }
-
-    const actions = [{
-      type: 'add',
-      path: `src/store/modules/${name}.js`,
-      templateFile: 'plop-templates/store/index.hbs',
-      data: {
-        options: options.join(joinFlag),
-        state: blocks.includes('state'),
-        mutations: blocks.includes('mutations'),
-        actions: blocks.includes('actions')
-      }
-    }]
-    return actions
-  }
-}

+ 0 - 2
plop-templates/utils.js

@@ -1,2 +0,0 @@
-exports.notEmpty = name => v =>
-  !v || v.trim() === '' ? `${name} is required` : true

+ 0 - 26
plop-templates/view/index.hbs

@@ -1,26 +0,0 @@
-{{#if template}}
-<template>
-  <div />
-</template>
-{{/if}}
-
-{{#if script}}
-<script>
-export default {
-  name: '{{ properCase name }}',
-  props: {},
-  data() {
-    return {}
-  },
-  created() {},
-  mounted() {},
-  methods: {}
-}
-</script>
-{{/if}}
-
-{{#if style}}
-<style lang="scss" scoped>
-
-</style>
-{{/if}}

+ 0 - 55
plop-templates/view/prompt.js

@@ -1,55 +0,0 @@
-const { notEmpty } = require('../utils.js')
-
-module.exports = {
-  description: 'generate a view',
-  prompts: [{
-    type: 'input',
-    name: 'name',
-    message: 'view name please',
-    validate: notEmpty('name')
-  },
-  {
-    type: 'checkbox',
-    name: 'blocks',
-    message: 'Blocks:',
-    choices: [{
-      name: '<template>',
-      value: 'template',
-      checked: true
-    },
-    {
-      name: '<script>',
-      value: 'script',
-      checked: true
-    },
-    {
-      name: 'style',
-      value: 'style',
-      checked: true
-    }
-    ],
-    validate(value) {
-      if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
-        return 'View require at least a <script> or <template> tag.'
-      }
-      return true
-    }
-  }
-  ],
-  actions: data => {
-    const name = '{{name}}'
-    const actions = [{
-      type: 'add',
-      path: `src/views/${name}/index.vue`,
-      templateFile: 'plop-templates/view/index.hbs',
-      data: {
-        name: name,
-        template: data.blocks.includes('template'),
-        script: data.blocks.includes('script'),
-        style: data.blocks.includes('style')
-      }
-    }]
-
-    return actions
-  }
-}

+ 3 - 2
src/views/dashboard/admin/index.vue

@@ -22,7 +22,8 @@
               <div class="twbIconbgBlue">
                 <img src="@/assets/index/twbIconbgRed.png" />
               </div>
-              文章发布数量
+              <!-- 文章发布数量 -->
+              资讯发布数量
             </div>
             <div class="twbNumber">{{ topData.article.count }}</div>
             <!-- <div class="twbStatus"><img src="@/assets/index/arrow-up.png"/> +18% <span>较昨天</span></div> -->
@@ -46,7 +47,7 @@
       <el-row :gutter="32">
         <el-col :xs="24" :sm="24" :lg="16">
           <div class="chartBox">
-            <div class="chartTitle">平台文章增长数量</div>
+            <div class="chartTitle">平台文章增长数量</div>
             <el-row style="background:#fff;padding:16px 16px 0;">
               <line-chart :chart-data="chartData.lineChartData" />
             </el-row>

+ 6 - 27
src/views/news/creatNews.vue

@@ -616,22 +616,11 @@ export default {
               this.returnPage()
             } else {
               
-               let the_message = res.message 
-               let the_word = (the_message.split(':'))[0]
-                
-               if(the_word==="发现违禁词"){
-
-                     this.$message({
+              this.$message({
                        type: 'error',
-                        message: "该内容存在非法信息,请修改后重新发布"
+                        message: res.message 
                      }); 
-                   
-               }else {
-                        this.$message({
-                              type: 'error',
-                              message: "资讯发布失败,请稍后再试!"
-                        }); 
-               }
+
  
             }
           }).catch(() => {
@@ -916,21 +905,11 @@ export default {
           //console.log(this.form)
           this.$store.dispatch('news/updateArticle', formData).then(res => {
             if (res.code != 200) {
-
-               let the_message_2 = res.message 
-               let the_word_2 = (the_message_2.split(':'))[0]
-                
-               if(the_word_2==="发现违禁词"){
-
-                     this.$message({
+ 
+               this.$message({
                        type: 'error',
-                        message: "该内容存在非法信息,请修改后重新发布"
+                        message: res.message 
                      }); 
-                   
-               }else { 
-
-                     this.$message.error("修改失败,请稍后再试!");
-               }
 
             } else {
               //汇报结果