文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 4ae22622 by 李严凡

lyf zidingyi

parent f904870f
...@@ -170,18 +170,33 @@ ...@@ -170,18 +170,33 @@
<el-form-item label="模板名称" :label-width="formLabelWidth"> <el-form-item label="模板名称" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off"></el-input> <el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<input v-model="mm" placeholder="输入实体或属性">{{mm}}</input>
<!-- 树状结构--> <!-- 树状结构-->
<div class="custom-tree-container"> <div class="block">
<div class="block"> <el-tree
<el-tree :data="data"
:data="data" show-checkbox
show-checkbox node-key="id"
node-key="id" default-expand-all
default-expand-all :expand-on-click-node="false">
:expand-on-click-node="false" <span class="custom-tree-node" slot-scope="{ node, data }">
:render-content="renderContent"> <span>{{ node.label }}</span>
</el-tree> <span>
</div> <el-button
type="text"
size="mini"
@click="() => append(data,mm)">
Append
</el-button>
<el-button
type="text"
size="mini"
@click="() => remove(node, data)">
Delete
</el-button>
</span>
</span>
</el-tree>
</div> </div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -250,14 +265,15 @@ ...@@ -250,14 +265,15 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 14px; font-size: 14px;
padding-right: 8px; padding-right: 2px;
height: 50px;
} }
</style> </style>
<script> <script>
let id = 100; let id = 100;
export default { export default {
data() { data() {
const data = [{ var data = [{
id: 1, id: 1,
label: '一级 1', label: '一级 1',
children: [{ children: [{
...@@ -293,6 +309,7 @@ ...@@ -293,6 +309,7 @@
}] }]
}]; }];
return { return {
m:'好的撒',
dialogFormVisible: false, dialogFormVisible: false,
form: { form: {
name: '', name: '',
...@@ -425,14 +442,20 @@ ...@@ -425,14 +442,20 @@
change(e){ change(e){
this.$forceUpdate(); this.$forceUpdate();
}, },
changeInput(e,a){
// input.focus();
//alert('111');
//alert(a);
this.$forceUpdate();
},
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
}, },
createModle(d){ createModle(m){
alert('111'); alert('111');
}, },
append(data) { append(data,mm) {
const newChild = { id: id++, label: 'testtest', children: [] }; const newChild = { id: id++, label: mm, children: [] };
if (!data.children) { if (!data.children) {
this.$set(data, 'children', []); this.$set(data, 'children', []);
} }
...@@ -445,18 +468,6 @@ ...@@ -445,18 +468,6 @@
const index = children.findIndex(d => d.id === data.id); const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1); children.splice(index, 1);
}, },
renderContent(h, { node, data, store }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={ () => this.append(data) }>Add</el-button>
<el-button size="mini" type="text" on-click={ () => this.remove(node, data) }>Delete</el-button>
</span>
</span>);
},
rePage(){ rePage(){
// alert("111"); // alert("111");
dialogFormVisible :false; dialogFormVisible :false;
......
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