Commit 247ad9d1 authored by 骆瑛's avatar 骆瑛

项目构建

parent a9bb9f04
...@@ -1220,5 +1220,50 @@ export default { ...@@ -1220,5 +1220,50 @@ export default {
type: '类型', type: '类型',
state: '状态', state: '状态',
size: '数据长度', size: '数据长度',
},
project: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
name: '分类名称',
upId: '上级id',
level: '层级',
tenantId: '租户id',
type: '类别',
englishFullName: '英文全称',
englishName: '英文简称',
status: '状态',
description: '描述',
inheritCategoryId: '继承分类id',
code: '编码',
module: '模块',
},
project_atom: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
name: '名称',
upId: '上级id',
level: '层级',
tenantId: '租户id',
type: '类别',
englishFullName: '英文全称',
englishName: '英文简称',
status: '状态',
description: '描述',
content: '内容',
inheritCategoryId: '继承分类id',
code: '编码',
module: '模块',
version: '版本',
projectId: '项目',
} }
} }
\ No newline at end of file
This diff is collapsed.
import Api from '@/plugins/request'
export default {
index: `${systemUrl}/projectatom/paged`,
paged(params) {
return Api.post(`${systemUrl}/projectatom/paged`, params);
},
list(params) {
return Api.post(`${systemUrl}/projectatom/list`, params);
},
get(params) {
return Api.get(`${systemUrl}/projectatom/get`, params);
},
create(params) {
return Api.post(`${systemUrl}/projectatom/create`, params);
},
update(params) {
return Api.post(`${systemUrl}/projectatom/update`, params);
},
delete(id) {
return Api.delete(`${systemUrl}/projectatom/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${systemUrl}/projectatom/batchdelete`, params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row v-if="upDrop">
<Filed :span="12" :name="l('name')">{{ entity.name }}</Filed>
<Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
<Filed :span="12" :name="l('type')">{{ entity.type }}</Filed>
<Filed :span="12" :name="l('englishFullName')">{{
entity.englishFullName
}}</Filed>
<Filed :span="12" :name="l('englishName')">{{
entity.englishName
}}</Filed>
<Filed :span="12" :name="l('status')">{{ entity.status }}</Filed>
<Filed :span="12" :name="l('code')">{{ entity.code }}</Filed>
<Filed :span="12" :name="l('module')">{{ entity.module }}</Filed>
<Filed :span="12" :name="l('version')">{{ entity.version }}</Filed>
<Filed :span="24" :name="l('description')">{{
entity.description
}}</Filed>
</Row>
<Row type="flex" justify="center" align="middle" >
<div class="textIcon" @click="upClick(upDrop)">
<Icon :type="iconType" />{{ textUp }}
</div>
</Row>
<Row>
<Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
<div>
{{ row.title }}
</div>
</template>
<template slot-scope="{ row, index }" slot="note">
<Select v-model="row.note" clearable transfer disabled>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
>
</Select>
<span>{{ row.note }}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
disabled
v-model="row.dataType"
code="materail.category.dataType"
type="select"
:value="row.dataType"
:key="row.dataType"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
disabled
v-model="row.unitName"
code="material.main.unitName"
type="select"
placeholder="请选择单位"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
{{row.required}}
<!-- <Checkbox v-model="row.required" disabled></Checkbox> -->
</template>
<template slot-scope="{ row, index }" slot="isUnique">
{{row.isUnique}}
<!-- <Checkbox v-model="row.isUnique" disabled></Checkbox> -->
</template>
<template slot-scope="{ row, index }" slot="action">
<a style="color: #ff7a8b" v-if="row.fieldType > 1">删除</a>
</template>
</Table>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
columns: [
{
title: "序号",
type: "index",
width: 80,
align: "center",
},
{
title: "属性名称",
key: "title",
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 200,
},
{
title: "设置",
key: "note",
align: "center",
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName",
width: "150",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80,
},
{
width: 80,
title: "操作",
slot: "action",
align: "center",
},
],
iconType: "ios-arrow-up",
textUp: "收起",
upDrop: true,
completeList: [],
codeList: [],
checkList: [],
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
this.seachChange();
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.checkList = JSON.parse(r.result.content);
console.log(this.checkList);
this.checkList.map((v) => {
if (v.fieldType > 1) {
v.fieldType = 1;
}
});
this.$emit("on-load");
});
},
seachChange() {
let data = {
conditions: [],
pageSize: 20,
};
Api.list(data)
.then((r) => {
if (r.success) {
this.completeList = r.result;
} else {
}
})
.catch((err) => {});
},
upClick(value) {
this.upDrop = !value;
if (value) {
this.textUp = "下拉";
this.iconType = "ios-arrow-down";
} else {
this.textUp = "收起";
this.iconType = "ios-arrow-up";
}
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_atom" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style scoped>
.textIcon {
margin-top: 10px;
width: 100%;
height: 20px;
line-height: 20px;
background: #2d8cf0;
border-radius: 4px;
text-align: center;
color: #ffffff;
}
.textIcon:hover {
opacity: 0.7;
}
</style>>
\ No newline at end of file
This diff is collapsed.
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action"
><template slot="easySearch"
><Form ref="formInline" :model="easySearch" inline
><FormItem prop="keys"
><Input
placeholder="请输入关键字名称/英文全称/英文简称/编码"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button></FormItem
>
</Form></template
>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<!-- 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>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "项目对象",
author: "henq",
description: "project_atom 10/14/2020 11:41:27 AM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "name,englishFullName,englishName,code", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
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"),
align: "left",
easy: true,
high: true,
},
{
key: "code",
title: this.l("code"),
align: "left",
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: "englishFullName",
title: this.l("englishFullName"),
align: "left",
easy: true,
high: true,
},
{
key: "englishName",
title: this.l("englishName"),
align: "left",
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",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
project_atom:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
upId:'上级id',
level:'层级',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'状态',
description:'描述',
content:'内容',
inheritCategoryId:'继承分类id',
code:'编码',
module:'模块',
version:'版本',
projectId:'项目',
}
*/
let vkey = "project_atom" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"><FormItem :label="$t('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.upId.show"><FormItem :label="l('upId')" prop="upId"> <Input v-model="condition.upId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.level.show"><FormItem :label="l('level')" prop="level"> <Input v-model="condition.level.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.tenantId.show"><FormItem :label="l('tenantId')" prop="tenantId"> <Input v-model="condition.tenantId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.type.show"><FormItem :label="l('type')" prop="type"> <Input v-model="condition.type.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.englishFullName.show"><FormItem :label="l('englishFullName')" prop="englishFullName"> <Input v-model="condition.englishFullName.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.englishName.show"><FormItem :label="l('englishName')" prop="englishName"> <Input v-model="condition.englishName.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.status.show"><FormItem :label="l('status')" prop="status"> <Input v-model="condition.status.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.description.show"><FormItem :label="l('description')" prop="description"> <Input v-model="condition.description.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.inheritCategoryId.show"><FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId"> <Input v-model="condition.inheritCategoryId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.code.show"><FormItem :label="l('code')" prop="code"> <Input v-model="condition.code.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.module.show"><FormItem :label="l('module')" prop="module"> <Input v-model="condition.module.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.version.show"><FormItem :label="l('version')" prop="version"> <Input v-model="condition.version.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.projectId.show"><FormItem :label="l('projectId')" prop="projectId"> <Input v-model="condition.projectId.value"> </Input>
</FormItem></Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:true},
creatorUserId:{op:"Equal",value:null,show:true},
lastModificationTime:{op:"Range",value:null,show:true},
lastModifierUserId:{op:"Equal",value:null,show:true},
deletionTime:{op:"Range",value:null,show:true},
name:{op:"Equal",value:null,show:true},
upId:{op:"Equal",value:null,show:true},
level:{op:"Equal",value:null,show:true},
tenantId:{op:"Equal",value:null,show:true},
type:{op:"Equal",value:null,show:true},
englishFullName:{op:"Equal",value:null,show:true},
englishName:{op:"Equal",value:null,show:true},
status:{op:"Equal",value:null,show:true},
description:{op:"Equal",value:null,show:true},
inheritCategoryId:{op:"Equal",value:null,show:true},
code:{op:"Equal",value:null,show:true},
module:{op:"Equal",value:null,show:true},
version:{op:"Equal",value:null,show:true},
projectId:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "project_atom" + "." + key;
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
<template >
<div id='sysproject'>
<div class="tree_left">
<Project></Project>
</div>
<div class="count_right">
<Atom></Atom>
</div>
</div>
</template>
<script>
import Atom from "./atom";
import Project from "./project";
export default {
// name: 'sysproject',
data() {
return {};
},
components:{
Project,
Atom
}
};
</script>
<style lang="less" scoped>
#sysproject{
display: flex;
}
.tree_left {
width: 300px;
height: 100%;
}
.count_right {
width: calc(100% - 300px);
}
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"
><FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"> </Input> </FormItem
></Col>
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"> </Input> </FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary code="base.project.type" v-model="entity.type" ></Dictionary>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="entity.englishFullName"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('englishName')" prop="englishName">
<Input v-model="entity.englishName"> </Input> </FormItem
></Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="base.project.status" v-model="entity.status" ></Dictionary>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('module')" prop="module">
<Input v-model="entity.module"> </Input> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('description')" prop="description">
<Input
v-model="entity.description"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled" >保存</Button >
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
entity: {
name: "",
upId: this.eid,
level: null,
tenantId: null,
type: null,
englishFullName: "",
englishName: "",
status: null,
description: "",
inheritCategoryId: null,
code: "",
module: "",
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
v: Object,
eid: Number,
},
mounted() {
// if (this.eid > 0) {
// this.load(this.eid);
// }
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "project" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
// if (v > 0) {
// this.load(v);
// }
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${systemUrl}/project/paged`,
treepaged(params) {
return Api.post(`${systemUrl}/project/list`, params);
},
paged(params) {
return Api.post(`${systemUrl}/project/paged`, params);
},
get(params) {
return Api.get(`${systemUrl}/project/get`, params);
},
create(params) {
return Api.post(`${systemUrl}/project/create`, params);
},
update(params) {
return Api.post(`${systemUrl}/project/update`, params);
},
delete(id) {
return Api.delete(`${systemUrl}/project/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${systemUrl}/project/batchdelete`, params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('name')">{{ entity.name }}</Filed>
<Filed :span="12" :name="l('type')"><state code="base.project.type" :value="entity.type" /></Filed>
<Filed :span="12" :name="l('englishFullName')">{{
entity.englishFullName
}}</Filed>
<Filed :span="12" :name="l('englishName')">{{
entity.englishName
}}</Filed>
<Filed :span="12" :name="l('status')"><state code="base.project.status" :value="entity.status" /></Filed>
<Filed :span="12" :name="l('code')"> {{ entity.code }}</Filed>
<Filed :span="12" :name="l('module')">{{ entity.module }}</Filed>
<Filed :span="24" :name="l('description')">{{ entity.description }}</Filed>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"
><FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"> </Input> </FormItem
></Col>
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary
code="base.project.type"
v-model="entity.type"
></Dictionary>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="entity.englishFullName"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('englishName')" prop="englishName">
<Input v-model="entity.englishName"> </Input> </FormItem
></Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="base.project.status"
v-model="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('module')" prop="module">
<Input v-model="entity.module"> </Input> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('description')" prop="description">
<Input
v-model="entity.description"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
let datas = {
creationTime: this.entity.creationTime,
creatorUserId: this.entity.creatorUserId,
description: this.entity.description,
code: this.entity.code,
id: this.entity.id,
englishFullName: this.entity.englishFullName,
englishName: this.entity.englishName,
inheritCategoryId: this.entity.inheritCategoryId,
lastModificationTime: this.entity.lastModificationTime,
lastModifierUserId: this.entity.lastModifierUserId,
level: this.entity.level,
module: this.entity.module,
name: this.entity.name,
status: this.entity.status,
tenantId: this.entity.tenantId,
type: this.entity.type,
upId: this.entity.upId,
};
Api.update(datas)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div style="padding-top: 10px">
<TreeGrid :columns="columns" :items="treeData" ref="grid">
<template slot="easySearch"
><Form ref="formInline" :model="easySearch" inline
><FormItem prop="keys"
><Input
placeholder="请输入关键字分类名称/英文全称/英文简称/编码"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button></FormItem
>
</Form></template
>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<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" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "项目",
author: "henq",
description: "project 10/14/2020 10:22:51 AM",
},
data() {
return {
treeList: [],
treeData: [],
// action: Api.index,
easySearch: {
keys: { op: "name,englishFullName,englishName,code", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "label",
title: "分类名称",
align: "left",
},
{
key: "name",
title: this.l("name"),
align: "left",
hide: true,
easy: true,
high: true,
},
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true,
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
code: "base.project.type",
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "base.project.status",
},
{
key: "englishFullName",
title: this.l("englishFullName"),
align: "left",
easy: true,
high: true,
},
{
key: "englishName",
title: this.l("englishName"),
align: "left",
easy: true,
high: true,
},
{ key: "module", title: this.l("module"), align: "left", high: true },
{
title: "操作",
key: "action",
width: 160,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
h(
"op",
{
attrs: { oprate: "add" },
on: { click: () => this.rowadd(params.row.id) },
},
"新增"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
this.init();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
init() {
let data = {
conditions: [],
};
Api.treepaged(data).then((r) => {
this.treeData = [];
this.treeData = r.result;
this.treeData = this.$u.toTree(
r.result,
0,
(u) => {
u.label = u.name;
},
"upId"
);
});
},
ok() {
this.init();
this.modal = false;
this.curId = 0;
},
search() {
console.log(this.easySearch);
console.log(this.$refs.grid);
// this.init();
// this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
rowadd(id) {
this.curId = id;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.init();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
project:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'分类名称',
upId:'上级id',
level:'层级',
tenantId:'租户id',
type:'类别',
englishFullName:'英文全称',
englishName:'英文简称',
status:'状态',
description:'描述',
inheritCategoryId:'继承分类id',
code:'编码',
module:'模块',
}
*/
let vkey = "project" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less"></style>
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"
><FormItem :label="$t('id')" prop="id">
<Input v-model="condition.id.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.creationTime.show"
><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker
type="daterange"
v-model="condition.creationTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"
><FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"
><FormItem
:label="l('lastModificationTime')"
prop="lastModificationTime"
>
<DatePicker
type="daterange"
v-model="condition.lastModificationTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"
><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value">
</Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.deletionTime.show"
><FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker
type="daterange"
v-model="condition.deletionTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.name.show"
><FormItem :label="l('name')" prop="name">
<Input v-model="condition.name.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.upId.show"
><FormItem :label="l('upId')" prop="upId">
<Input v-model="condition.upId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.level.show"
><FormItem :label="l('level')" prop="level">
<Input v-model="condition.level.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.tenantId.show"
><FormItem :label="l('tenantId')" prop="tenantId">
<Input v-model="condition.tenantId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.type.show"
><FormItem :label="l('type')" prop="type">
<Input v-model="condition.type.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.englishFullName.show"
><FormItem :label="l('englishFullName')" prop="englishFullName">
<Input v-model="condition.englishFullName.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.englishName.show"
><FormItem :label="l('englishName')" prop="englishName">
<Input v-model="condition.englishName.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.status.show"
><FormItem :label="l('status')" prop="status">
<Input v-model="condition.status.value"> </Input> </FormItem
></Col>
<Col :span="24" :v-if="condition.description.show"
><FormItem :label="l('description')" prop="description">
<Input v-model="condition.description.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.inheritCategoryId.show"
><FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId">
<Input v-model="condition.inheritCategoryId.value">
</Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.code.show"
><FormItem :label="l('code')" prop="code">
<Input v-model="condition.code.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.module.show"
><FormItem :label="l('module')" prop="module">
<Input v-model="condition.module.value"> </Input> </FormItem
></Col>
</Row>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
condition: {
id: { op: "Equal", value: null, show: true },
creationTime: { op: "Range", value: null, show: true },
creatorUserId: { op: "Equal", value: null, show: true },
lastModificationTime: { op: "Range", value: null, show: true },
lastModifierUserId: { op: "Equal", value: null, show: true },
deletionTime: { op: "Range", value: null, show: true },
name: { op: "Equal", value: null, show: true },
upId: { op: "Equal", value: null, show: true },
level: { op: "Equal", value: null, show: true },
tenantId: { op: "Equal", value: null, show: true },
type: { op: "Equal", value: null, show: true },
englishFullName: { op: "Equal", value: null, show: true },
englishName: { op: "Equal", value: null, show: true },
status: { op: "Equal", value: null, show: true },
description: { op: "Equal", value: null, show: true },
inheritCategoryId: { op: "Equal", value: null, show: true },
code: { op: "Equal", value: null, show: true },
module: { op: "Equal", value: null, show: true },
},
};
},
methods: {
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project" + "." + key;
return this.$t(key);
},
},
};
</script>
\ No newline at end of file
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