Purpose пре 4 месеци
родитељ
комит
469b98a535
3 измењених фајлова са 27 додато и 5 уклоњено
  1. 1 1
      src/assets/el-style.scss
  2. 24 2
      src/components/EditButton.vue
  3. 2 2
      src/views/TagDistribute.vue

+ 1 - 1
src/assets/el-style.scss

@@ -14,7 +14,7 @@
   .el-table__body {
     tr {
 
-      &.current-row>td.el-table__cell {
+      &.current-row > td.el-table__cell {
         .table-operator-item {
           > span {
             color: var(--table-row-highlight-color)

+ 24 - 2
src/components/EditButton.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="table-operator-item flex valign-center" @click="onClick(data)">
+  <div class="table-operator-item flex valign-center" :class="{
+    disabled
+  }" @click="onBtnClick">
     <slot name="icon"><i :class="icon"></i></slot><span><slot /></span>
   </div>
 </template>
@@ -22,8 +24,28 @@ export default {
       required: true,
       type: Function
     }
+  },
+  methods: {
+    onBtnClick () {
+      if (this.disabled) {
+        return
+      }
+
+      this.onClick(this.data)
+    }
   }
 }
 </script>
 
-<style lang="scss"></style>
+<style lang="scss">
+.table-operator-item {
+  &.disabled {
+    cursor: not-allowed;
+
+    * {
+      color: #CCCCCC !important;
+    }
+  }
+}
+
+</style>

+ 2 - 2
src/views/TagDistribute.vue

@@ -125,8 +125,8 @@
               >
                 <template v-slot="{ row }">
                   <div class="flex center layout-gap">
-                    <edit-button v-if="tagApplyStateId === '3'" :data="row" :on-click="onOpenDetailEditorBtnClick" icon="el-icon-tickets">详情</edit-button>
-                    <edit-button v-else :data="row" :on-click="onOpenDetailEditorBtnClick" icon="el-icon-share" :disabled="tagApplyStateId !== '2'">发放</edit-button>
+                    <edit-button v-if="row.tagApplyStateId === '3'" :data="row" :on-click="onOpenDetailEditorBtnClick" icon="el-icon-tickets">详情</edit-button>
+                    <edit-button v-else :data="row" :on-click="onOpenDetailEditorBtnClick" icon="el-icon-share" :disabled="row.tagApplyStateId !== '2'">发放</edit-button>
                   </div>
                 </template>
               </el-table-column>