yangfeng
2023-07-10 8e7cd003414ea4ca8f42fb3171de18f8839ece17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<template>
  <div class="query-class-set">
    <el-dialog title="查询分类设置" :visible.sync="editConfig.visible" :width="dialogWidth" :before-close="handleClose">
      <el-table :data="tableData" style="width: 100%" :header-cell-style="{ background: '#f4f8fe' }">
        <el-table-column label="分类名称" prop="className"> </el-table-column>
        <el-table-column label="操作" width="200px">
          <template slot-scope="scope">
            <i class="el-icon-edit common-style first" title="编辑" @click="editClick(scope.$index, scope.row)"></i>
            <i class="el-icon-document-copy common-style" title="复制" @click="copyClick(scope.$index, scope.row)"></i>
            <i
              v-if="scope.$index !== 0 && scope.$index !== tableData.length - 1"
              class="el-icon-bottom common-style"
              title="下移"
              @click="moveDownClick(scope.$index, scope.row)"
            ></i>
            <i
              v-if="scope.$index !== 0 && scope.$index !== 1"
              class="el-icon-top common-style"
              title="上移"
              @click="moveUpClick(scope.$index, scope.row)"
            ></i>
            <i
              v-if="scope.$index !== 0"
              class="el-icon-delete common-style"
              title="删除"
              @click="deleteClick(scope.$index, scope.row)"
            ></i>
          </template>
        </el-table-column>
      </el-table>
      <div style="padding: 10px">
        <el-button type="primary" size="mini">新建分类</el-button>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="editConfig.visible = false">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
export default {
  name: "QueryClassSettingDialog",
  props: {
    editCommonConfig: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomation: {}
        }
      }
    }
  },
  components: {},
  computed: {},
  data() {
    return {
      dialogWidth: "30%",
      editConfig: this.editCommonConfig,
      tableData: [
        {
          className: "全部"
        },
        {
          className: "过期未满60天"
        },
        {
          className: "过期未满30天"
        },
        {
          className: "已过期"
        }
      ]
    }
  },
  created() {},
  methods: {
    handleClose() {
      this.editConfig.visible = false
    },
    // 编辑
    editClick(index, row) {
      console.log(index, row)
    },
    // 复制
    copyClick() {},
    // 上移
    moveUpClick(index) {
      var that = this
      if (index > 1) {
        const upData = that.tableData[index - 1]
        that.tableData.splice(index - 1, 1)
        that.tableData.splice(index, 0, upData)
      }
    },
    // 下移
    moveDownClick(index) {
      var that = this
      const downData = that.tableData[index + 1]
      that.tableData.splice(index + 1, 1)
      that.tableData.splice(index, 0, downData)
    },
    // 删除
    deleteClick() {}
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.query-class-set {
  .common-style {
    font-size: 16px;
    margin-left: 10px;
    cursor: pointer;
  }
  .first {
    margin-left: 0px;
  }
  .dialog-footer {
    background-color: #f5f5f5;
    height: 55px;
    line-height: 55px;
  }
}
::v-deep {
  .el-dialog__header {
    padding: 12.5px 10px;
    border-bottom: 1px solid #e5e5e5;
    .el-dialog__title {
      font-size: 15px;
      color: #323232;
      font-weight: bold;
    }
  }
  .el-dialog__body {
    padding: 0px;
  }
  .el-dialog__footer {
    padding: 0px;
    text-align: center;
    box-sizing: border-box;
    border-top: 1px solid #dadee5;
  }
}
</style>