Commit 736da3b1 authored by 骆瑛's avatar 骆瑛

页面组件化

parent 4bd186e6
export default {
name: 'ColumnSlot',
functional: true,
inject: ['tableRoot'],
props: {
row: Object,
index: Number,
column: {
type: Object,
default: null
}
},
render: (h, ctx) => {
return h('span', ctx.injections.tableRoot()[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
}));
}
};
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</template> </template>
</DataGrid> </DataGrid>
<!-- fullscreen --> <!-- fullscreen -->
<Modal v-model="modal" :title="title" width="1200" footer-hide fullscreen > <Modal v-model="modal" :title="title" width="1200" footer-hide fullscreen>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
...@@ -58,48 +58,6 @@ export default { ...@@ -58,48 +58,6 @@ export default {
align: "left", align: "left",
high: true, high: true,
}, },
// {
// key: "creationTime",
// title: this.l("creationTime"),
// align: "left",
// high: true,
// },
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// align: "left",
// high: true,
// },
// {
// key: "lastModificationTime",
// title: this.l("lastModificationTime"),
// align: "left",
// high: true,
// },
// {
// key: "lastModifierUserId",
// title: this.l("lastModifierUserId"),
// align: "left",
// high: true,
// },
// {
// key: "isDeleted",
// title: this.l("isDeleted"),
// align: "left",
// high: true,
// },
// {
// key: "deletionTime",
// title: this.l("deletionTime"),
// align: "left",
// high: true,
// },
// {
// key: "deleterUserId",
// title: this.l("deleterUserId"),
// align: "left",
// high: true,
// },
{ {
key: "name", key: "name",
title: this.l("name"), title: this.l("name"),
...@@ -114,16 +72,20 @@ export default { ...@@ -114,16 +72,20 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
{ key: "status", title: this.l("status"), align: "left", high: true , code:'base.project_atom.status'}, {
// { key: "upId", title: this.l("upId"), align: "left", high: true }, key: "status",
// { key: "level", title: this.l("level"), align: "left", high: true }, title: this.l("status"),
// { align: "left",
// key: "tenantId", high: true,
// title: this.l("tenantId"), code: "base.project_atom.status",
// align: "left", },
// high: true, {
// }, key: "type",
{ key: "type", title: this.l("type"), align: "left", high: true , code:'base.project_atom.type'}, title: this.l("type"),
align: "left",
high: true,
code: "base.project_atom.type",
},
{ {
key: "englishFullName", key: "englishFullName",
title: this.l("englishFullName"), title: this.l("englishFullName"),
...@@ -138,22 +100,9 @@ export default { ...@@ -138,22 +100,9 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
// {
// key: "inheritCategoryId",
// title: this.l("inheritCategoryId"),
// align: "left",
// high: true,
// },
{ key: "module", title: this.l("module"), align: "left", high: true }, { key: "module", title: this.l("module"), align: "left", high: true },
{ key: "version", title: this.l("version"), align: "left", high: true }, { key: "version", title: this.l("version"), align: "left", high: true },
// {
// key: "projectId",
// title: this.l("projectId"),
// align: "left",
// high: true,
// },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
...@@ -169,7 +118,6 @@ export default { ...@@ -169,7 +118,6 @@ export default {
}, },
"查看" "查看"
), ),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h( h(
"op", "op",
{ {
...@@ -192,9 +140,7 @@ export default { ...@@ -192,9 +140,7 @@ export default {
], ],
}; };
}, },
mounted() { mounted() {},
console.log(this);
},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
...@@ -276,5 +222,3 @@ export default { ...@@ -276,5 +222,3 @@ export default {
}, },
}; };
</script> </script>
<style lang="less">
</style>
\ No newline at end of file
This diff is collapsed.
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
<FormItem :label="l('code')" prop="code"> <FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"> </Input> </FormItem> <Input v-model="entity.code"> </Input> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<Dictionary code="base.project.type" v-model="entity.type" ></Dictionary> <Dictionary code="base.project.type" v-model="entity.type" ></Dictionary>
</FormItem> </FormItem>
</Col> </Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('englishFullName')" prop="englishFullName"> ><FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="entity.englishFullName"> </Input> </FormItem <Input v-model="entity.englishFullName"> </Input> </FormItem
...@@ -75,8 +75,10 @@ export default { ...@@ -75,8 +75,10 @@ export default {
props: { props: {
v: Object, v: Object,
eid: Number, eid: Number,
typeValue:Number
}, },
mounted() { mounted() {
this.entity.type=this.typeValue;
// if (this.eid > 0) { // if (this.eid > 0) {
// this.load(this.eid); // this.load(this.eid);
// } // }
......
...@@ -18,11 +18,17 @@ ...@@ -18,11 +18,17 @@
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add()">新增</Button>
</template> </template>
</TreeGrid> </TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component
:is="detail"
:typeValue="typeValue"
:eid="curId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -47,16 +53,12 @@ export default { ...@@ -47,16 +53,12 @@ export default {
easySearch: { easySearch: {
keys: { op: "name,englishFullName,englishName,code", value: null }, keys: { op: "name,englishFullName,englishName,code", value: null },
}, },
typeValue: 0,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
columns: [ columns: [
{
key: "label",
title: "分类名称",
align: "left",
},
{ {
key: "name", key: "name",
title: this.l("name"), title: this.l("name"),
...@@ -64,6 +66,7 @@ export default { ...@@ -64,6 +66,7 @@ export default {
hide: true, hide: true,
easy: true, easy: true,
high: true, high: true,
tree: true,
}, },
{ {
...@@ -162,6 +165,7 @@ export default { ...@@ -162,6 +165,7 @@ export default {
Api.treepaged(data).then((r) => { Api.treepaged(data).then((r) => {
this.treeData = []; this.treeData = [];
this.treeData = r.result; this.treeData = r.result;
this.treeList=r.result;
this.treeData = this.$u.toTree( this.treeData = this.$u.toTree(
r.result, r.result,
0, 0,
...@@ -178,18 +182,20 @@ export default { ...@@ -178,18 +182,20 @@ export default {
this.curId = 0; this.curId = 0;
}, },
search() { search() {
console.log(this.easySearch); // console.log(this.easySearch);
console.log(this.$refs.grid); // console.log(this.$refs.grid);
// this.init(); this.init();
// this.$refs.grid.reload(this.easySearch); // this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
this.typeValue = 0;
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
rowadd(id) { rowadd(id) {
this.typeValue = 1;
this.curId = id; this.curId = id;
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
...@@ -208,7 +214,14 @@ export default { ...@@ -208,7 +214,14 @@ export default {
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
Api.delete(id).then((r) => { var len=this.treeList.filter(u=>{
return u.upId==id
}).length;
if(len>0){
this.$Message.warning("包含子对象,不能删除!")
return;
}
Api.delete(id).then((r) => {
if (r.success) { if (r.success) {
this.init(); this.init();
this.$Message.success("删除成功"); this.$Message.success("删除成功");
......
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