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 @@
</template>
</DataGrid>
<!-- 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" />
</Modal>
</div>
......@@ -58,48 +58,6 @@ export default {
align: "left",
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",
title: this.l("name"),
......@@ -114,16 +72,20 @@ export default {
easy: 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: "level", title: this.l("level"), align: "left", high: true },
// {
// key: "tenantId",
// title: this.l("tenantId"),
// align: "left",
// high: true,
// },
{ key: "type", title: this.l("type"), align: "left", high: true , code:'base.project_atom.type'},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "base.project_atom.status",
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
code: "base.project_atom.type",
},
{
key: "englishFullName",
title: this.l("englishFullName"),
......@@ -138,22 +100,9 @@ export default {
easy: true,
high: true,
},
// {
// key: "inheritCategoryId",
// title: this.l("inheritCategoryId"),
// 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: "projectId",
// title: this.l("projectId"),
// align: "left",
// high: true,
// },
{
title: "操作",
key: "action",
......@@ -169,7 +118,6 @@ export default {
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
......@@ -192,9 +140,7 @@ export default {
],
};
},
mounted() {
console.log(this);
},
mounted() {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
......@@ -276,5 +222,3 @@ export default {
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
This diff is collapsed.
......@@ -9,11 +9,11 @@
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"> </Input> </FormItem>
</Col>
<Col :span="12">
<!-- <Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary code="base.project.type" v-model="entity.type" ></Dictionary>
</FormItem>
</Col>
</Col> -->
<Col :span="12"
><FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="entity.englishFullName"> </Input> </FormItem
......@@ -75,8 +75,10 @@ export default {
props: {
v: Object,
eid: Number,
typeValue:Number
},
mounted() {
this.entity.type=this.typeValue;
// if (this.eid > 0) {
// this.load(this.eid);
// }
......
......@@ -18,11 +18,17 @@
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button type="primary" @click="add()">新增</Button>
</template>
</TreeGrid>
<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>
</div>
</template>
......@@ -47,16 +53,12 @@ export default {
easySearch: {
keys: { op: "name,englishFullName,englishName,code", value: null },
},
typeValue: 0,
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "label",
title: "分类名称",
align: "left",
},
{
key: "name",
title: this.l("name"),
......@@ -64,6 +66,7 @@ export default {
hide: true,
easy: true,
high: true,
tree: true,
},
{
......@@ -162,6 +165,7 @@ export default {
Api.treepaged(data).then((r) => {
this.treeData = [];
this.treeData = r.result;
this.treeList=r.result;
this.treeData = this.$u.toTree(
r.result,
0,
......@@ -178,18 +182,20 @@ export default {
this.curId = 0;
},
search() {
console.log(this.easySearch);
console.log(this.$refs.grid);
// this.init();
// console.log(this.easySearch);
// console.log(this.$refs.grid);
this.init();
// this.$refs.grid.reload(this.easySearch);
},
add() {
this.typeValue = 0;
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
rowadd(id) {
this.typeValue = 1;
this.curId = id;
this.title = "新增";
this.detail = () => import("./add");
......@@ -208,7 +214,14 @@ export default {
this.modal = true;
},
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) {
this.init();
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