萤火科技 %!s(int64=5) %!d(string=hai) anos
pai
achega
aab9f373ce
Modificáronse 3 ficheiros con 5 adicións e 5 borrados
  1. 2 2
      src/views/page/Create.vue
  2. 1 1
      src/views/page/Index.vue
  3. 2 2
      src/views/page/Update.vue

+ 2 - 2
src/views/page/Create.vue

@@ -125,8 +125,8 @@ export default {
      */
     onCheckAddItem (type) {
       const { data } = this
-      // 验证关注公众号组件只能存在一个
-      if (type === 'officialAccount') {
+      // 验证xx组件只能存在一个
+      if (type === 'xxx') {
         const itemsTypes = data.items.map(item => item.type)
         if (inArray(type, itemsTypes)) {
           this.$message.warning('该组件最多存在一个')

+ 1 - 1
src/views/page/Index.vue

@@ -30,12 +30,12 @@
       </template>
       <!-- 操作 -->
       <span class="actions" slot="action" slot-scope="item">
+        <a v-if="$auth('/page/update')" @click="handleEdit(item)">编辑</a>
         <a
           v-action:setHome
           v-if="item.page_type != PageTypeEnum.HOME.value"
           @click="handleSetHome(item)"
         >设为首页</a>
-        <a v-if="$auth('/page/update')" @click="handleEdit(item)">编辑</a>
         <a
           v-action:delete
           v-if="item.page_type != PageTypeEnum.HOME.value"

+ 2 - 2
src/views/page/Update.vue

@@ -134,8 +134,8 @@ export default {
      */
     onCheckAddItem (type) {
       const { data } = this
-      // 验证关注公众号组件只能存在一个
-      if (type === 'officialAccount') {
+      // 验证xx组件只能存在一个
+      if (type === 'xxx') {
         const itemsTypes = data.items.map(item => item.type)
         if (inArray(type, itemsTypes)) {
           this.$message.warning('该组件最多存在一个')