田源
2024-09-06 bf70f3cf825f44c457dba2bebd26e7af73e4b2a8
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
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogVisible"
    append-to-body
    class="avue-dialog avue-dialog--top"
    style="max-height: 800px;"
    title="批量修改"
    top="-5vh"
    @opened="openDialog"
  >
    <el-table class="cus-table" ref="dataTable" :data="EditTableList"   @cell-click="handleCellClicks" border>
      <el-table-column v-if="EditTableList.length != 0"  type="selection" width="55"></el-table-column>
      <el-table-column v-if="EditTableList.length != 0"  label="序号" type="index" width="55">
      </el-table-column>
      <el-table-column v-for="item in this.tableHeadFindData"
                       :key="item.id"
                       :formatter="item.formatter"
                       :label="item.label" :prop="item.prop"
                       :show-overflow-tooltip="true"
                       :sortable="item.sortable"
                       :width="item.width"
                       align="center">
        <template  slot-scope="{ row }">
          <el-input>
 
          </el-input>
        </template>
      </el-table-column>
 
    </el-table>
  </el-dialog>
</template>
 
<script>
import {getFormTemplate} from "@/api/formTemplate.js";
 
export default {
  name: "FormBulkEdit",
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    codeClassifyOid: {
      type: String,
      default: "",
    },
    templateOid: {
      type: String,
      default: "",
    },
    tableData: {
      type: Array,
      default: []
    },
    selectRow: {
      type: Array,
      default: []
    },
    tableHeadFindData: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
      EditTableList: []
    }
  },
  created() {
 
  },
  computed: {
    dialogVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        this.$emit("update:visible", val);
      },
    },
  },
  methods: {
    //表格单元格编辑
    handleCellClicks(){
 
    },
    openDialog() {
      this.EditTableList = this.tableData.filter(item => {
        return this.selectRow.some(key => {
          return item.oid === key.oid;
        });
      });
      console.log(this.EditTableList)
      console.log(this.tableHeadFindData)
    },
    getFormTemplate() {
      getFormTemplate({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
      }).then(res => {
        console.log(res)
      })
    }
  }
}
</script>
 
<style scoped>
 
</style>