Commit b1c965af by zhengxiaokui

zxk

parent b002ec54
<template> <template>
<c-row> <c-row>
<c-col :span="21" style="margin-bottom: 18px" :offset="1"> <c-col :span="isAdd ? 21 : 22" style="margin-bottom: 18px" :offset="1">
<c-table <c-table
style="text-align: center" style="text-align: center"
:ref="urls" :ref="urls"
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<slot></slot> <slot></slot>
</c-table> </c-table>
</c-col> </c-col>
<c-col :span="1"> <c-col v-if="isAdd" :span="1">
<div class="button_contains"> <div class="button_contains">
<span class="add_del_button add_button" @click="handleAdd">+</span> <span class="add_del_button add_button" @click="handleAdd">+</span>
<span class="add_del_button" @click="handleDelete">-</span> <span class="add_del_button" @click="handleDelete">-</span>
...@@ -97,29 +97,35 @@ export default { ...@@ -97,29 +97,35 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isAdd: {
//添加删除列
type: true,
default: true,
},
}, },
computed: {}, computed: {},
watch: { // watch: {
dataSource: { // dataSource: {
handler(val, oldVal) { // handler(val, oldVal) {
_.set(this.model, this.urls, val); // console.log("数据变化:", val, this.model);
// console.log(this.model); // // _.set(this.model, this.urls, val);
}, // // console.log(this.model);
immediate: true, // },
deep: true, // immediate: true,
}, // deep: true,
}, // },
// },
methods: { methods: {
//获取表格数据索引,方便删除 //获取表格数据索引,方便删除
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
row.row_index = rowIndex; row.row_index = rowIndex;
}, },
//记录选中行索引 // 记录选中行索引
handleClick(row, column, event) { handleClick(row, column, event) {
this.rowIndex = row.row_index; this.rowIndex = row.row_index;
console.log(this.rowIndex); console.log("选择:" + this.rowIndex);
}, },
handleAdd() { handleAdd() {
......
...@@ -94,7 +94,18 @@ ...@@ -94,7 +94,18 @@
</el-form-item> </el-form-item>
</c-col> </c-col>
</c-col> </c-col>
<c-edit-table :model="model" v-bind="ptsaddg"> </c-edit-table> <c-edit-table :model="model" v-bind="ptsaddg">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEdit(scope.$index, scope.row)"
type="primary"
>详情</el-button
>
</template>
</el-table-column>
</c-edit-table>
</c-row> </c-row>
</template> </template>
<script> <script>
...@@ -123,6 +134,7 @@ export default { ...@@ -123,6 +134,7 @@ export default {
title: "机构实体", title: "机构实体",
width: "180px", width: "180px",
dataIndex: "ptyextkey", dataIndex: "ptyextkey",
show: "input",
}, },
{ {
title: "名称", title: "名称",
...@@ -139,7 +151,12 @@ export default { ...@@ -139,7 +151,12 @@ export default {
}, },
}; };
}, },
methods: { ...Event }, methods: {
...Event,
handleEdit() {
console.log("1111测试");
},
},
created: function () {}, created: function () {},
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment