Commit 04223034 authored by 骆瑛's avatar 骆瑛

修改导入功能

parent 56e60186
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12" <Row v-if="upDrop">
><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker
type="date"
v-model="entity.creationTime"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem
:label="l('lastModificationTime')"
prop="lastModificationTime"
>
<DatePicker
type="date"
v-model="entity.lastModificationTime"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber
v-model="entity.lastModifierUserId"
></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker
type="date"
v-model="entity.deletionTime"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber> </FormItem
></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('name')" prop="name"> ><FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"> </Input> </FormItem <Input v-model="entity.name"> </Input> </FormItem
></Col> ></Col>
<!-- <Col :span="12"
><FormItem :label="l('level')" prop="level">
<Input v-model="entity.level"> </Input> </FormItem
></Col> -->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<Dictionary <Dictionary
...@@ -77,11 +30,6 @@ ...@@ -77,11 +30,6 @@
></Dictionary> ></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<!-- <Col :span="12"
><FormItem :label="l('content')" prop="content">
<Input v-model="entity.content"> </Input> </FormItem
></Col> -->
<Col :span="12" <Col :span="12"
><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
...@@ -90,29 +38,10 @@ ...@@ -90,29 +38,10 @@
><FormItem :label="l('module')" prop="module"> ><FormItem :label="l('module')" prop="module">
<Input v-model="entity.module"> </Input> </FormItem <Input v-model="entity.module"> </Input> </FormItem
></Col> ></Col>
<!-- <Col :span="12"
><FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('tenantId')" prop="tenantId">
<InputNumber v-model="entity.tenantId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId">
<InputNumber
v-model="entity.inheritCategoryId"
></InputNumber> </FormItem
></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('version')" prop="version"> ><FormItem :label="l('version')" prop="version">
<InputNumber v-model="entity.version"></InputNumber> </FormItem <InputNumber v-model="entity.version"></InputNumber> </FormItem
></Col> ></Col>
<!-- <Col :span="12"
><FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber> </FormItem
></Col> -->
<Col :span="24" <Col :span="24"
><FormItem :label="l('description')" prop="description"> ><FormItem :label="l('description')" prop="description">
<Input <Input
...@@ -121,18 +50,38 @@ ...@@ -121,18 +50,38 @@
:rows="5" :rows="5"
></Input> </FormItem ></Input> </FormItem
></Col> ></Col>
</Row>
<Col :span="12" v-if="eid != 0"> <Col :span="24">
<FormItem label="扩展属性" prop="inheritCategoryId"> <Row type="flex" justify="center" align="middle">
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> --> <div class="textIcon" @click="upClick(upDrop)">
<RadioGroup v-model="inherit"> <Icon :type="iconType" />{{ textUp }}
<Radio label="1">继承</Radio> </div>
<Radio label="0">自定义</Radio> </Row>
</RadioGroup>
</FormItem>
</Col>
<Col :span="24" v-if="inherit == '0'">
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
<Row style="margin-bottom: 10px" :gutter="10">
<Col :span="6">
<AutoComplete
v-model="completeValue"
icon="ios-search"
placeholder="请搜索"
style="width: 100%"
>
<Option
v-for="option in completeList"
:value="option.name"
:key="option.id"
>
<span class="demo-auto-complete-title">{{ option.name }}</span>
<span class="demo-auto-complete-count" style="float: right">{{
option.code
}}</span>
</Option>
</AutoComplete>
</Col>
<Col :span="2">
<Button type="primary" @click="importColumns">导入</Button>
</Col>
</Row>
<Table :columns="columns" :data="checkList" border> <Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType == 1 || row.fieldType == 2"> <div v-if="row.fieldType == 1 || row.fieldType == 2">
...@@ -207,25 +156,31 @@ ...@@ -207,25 +156,31 @@
> >
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10" <Button type="dashed" long @click="addNew('{}')" class="mt10"
>新增属性</Button >新增属性</Button
> >
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button >
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Form> </Form>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "Add", name: "Add",
data() { data() {
return { return {
iconType: "ios-arrow-up",
textUp: "收起",
upDrop: true,
completeValue: "",
completeList: [],
codeList: [], codeList: [],
checkList: [ checkList: [
{ {
...@@ -347,16 +302,8 @@ export default { ...@@ -347,16 +302,8 @@ export default {
align: "center", align: "center",
}, },
], ],
inherit: this.eid ? "1" : "0",
disabled: false, disabled: false,
entity: { entity: {
// creationTime: null,
// creatorUserId: null,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
name: "", name: "",
upId: null, upId: null,
level: null, level: null,
...@@ -375,6 +322,7 @@ export default { ...@@ -375,6 +322,7 @@ export default {
}, },
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
}, },
}; };
}, },
...@@ -383,15 +331,58 @@ export default { ...@@ -383,15 +331,58 @@ export default {
eid: Number, eid: Number,
}, },
mounted() { mounted() {
this.seachChange();
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
} }
}, },
methods: { methods: {
importColumns() {
//导入
let changeId = {};
if (this.completeList.length > 0) {
this.completeList.map((e, index) => {
if (e.name == this.completeValue) {
changeId = e;
this.completeList.splice(index, 1);
this.completeValue = "";
}
});
this.addNew(changeId);
}
},
upClick(value) {
this.upDrop = !value;
if (value) {
this.textUp = "下拉";
this.iconType = "ios-arrow-down";
} else {
this.textUp = "收起";
this.iconType = "ios-arrow-up";
}
},
seachChange() {
let data = {
conditions: [],
pageSize: 20,
};
Api.list(data).then((r) => {
if (r.success) {
this.completeList = r.result;
} else {
}
});
},
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
//新增的删除,直接删 //新增的删除,直接删
this.checkList.splice(index, 1); this.checkList.splice(index, 1);
let objArr = {
name: row.title,
code: row.code,
id: row.id,
};
this.completeList.push(objArr);
} else { } else {
row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台 row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
...@@ -402,7 +393,19 @@ export default { ...@@ -402,7 +393,19 @@ export default {
setRow(row, index) { setRow(row, index) {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew(e) {
let id = "",
code = "",
name = "";
if (e == "{}") {
id = "";
code = "";
name = "";
} else {
id = e.id;
code = e.code;
name = e.name;
}
let maxId = 0; let maxId = 0;
this.checkList.map((u) => { this.checkList.map((u) => {
if (u.mid > maxId) { if (u.mid > maxId) {
...@@ -410,9 +413,11 @@ export default { ...@@ -410,9 +413,11 @@ export default {
} }
}); });
let obj = { let obj = {
id: id,
code: code,
mid: maxId + 1, mid: maxId + 1,
field: "c" + maxId, field: "c" + maxId,
title: "", title: name,
note: "", note: "",
unitName: "", unitName: "",
dataType: 0, dataType: 0,
...@@ -429,7 +434,7 @@ export default { ...@@ -429,7 +434,7 @@ export default {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.entity.content=JSON.stringify(this.checkList); this.entity.content = JSON.stringify(this.checkList);
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false; this.disabled = false;
...@@ -443,7 +448,6 @@ export default { ...@@ -443,7 +448,6 @@ export default {
.catch((err) => { .catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err);
}); });
} }
}); });
...@@ -474,3 +478,17 @@ export default { ...@@ -474,3 +478,17 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.textIcon {
width: 100%;
height: 20px;
line-height: 20px;
background: #2d8cf0;
border-radius: 4px;
text-align: center;
color: #ffffff;
}
.textIcon:hover {
opacity: 0.7;
}
</style>>
...@@ -4,6 +4,9 @@ export default { ...@@ -4,6 +4,9 @@ export default {
paged(params) { paged(params) {
return Api.post(`${systemUrl}/projectatom/paged`, params); return Api.post(`${systemUrl}/projectatom/paged`, params);
}, },
list(params) {
return Api.post(`${systemUrl}/projectatom/list`, params);
},
get(params) { get(params) {
return Api.get(`${systemUrl}/projectatom/get`, params); return Api.get(`${systemUrl}/projectatom/get`, params);
}, },
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12" <Row v-if="upDrop">
><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker
type="date"
v-model="entity.creationTime"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem
:label="l('lastModificationTime')"
prop="lastModificationTime"
>
<DatePicker
type="date"
v-model="entity.lastModificationTime"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber
v-model="entity.lastModifierUserId"
></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker
type="date"
v-model="entity.deletionTime"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber> </FormItem
></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('name')" prop="name"> ><FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"> </Input> </FormItem <Input v-model="entity.name"> </Input> </FormItem
></Col> ></Col>
<Col :span="12"
><FormItem :label="l('level')" prop="level">
<Input v-model="entity.level"> </Input> </FormItem
></Col>
<Col :span="12"> <Col :span="12">
<!-- <FormItem :label="l('type')" prop="type">
<Input v-model="entity.type"> </Input> </FormItem
> -->
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<Dictionary <Dictionary
code="base.project_atom.type" code="base.project_atom.type"
...@@ -72,9 +23,6 @@ ...@@ -72,9 +23,6 @@
<Input v-model="entity.englishName"> </Input> </FormItem <Input v-model="entity.englishName"> </Input> </FormItem
></Col> ></Col>
<Col :span="12"> <Col :span="12">
<!-- <FormItem :label="l('status')" prop="status">
<Input v-model="entity.status"> </Input> </FormItem
> -->
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary <Dictionary
code="base.project_atom.status" code="base.project_atom.status"
...@@ -82,11 +30,6 @@ ...@@ -82,11 +30,6 @@
></Dictionary> ></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<!-- <Col :span="12"
><FormItem :label="l('content')" prop="content">
<Input v-model="entity.content"> </Input> </FormItem
></Col> -->
<Col :span="12" <Col :span="12"
><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
...@@ -95,29 +38,10 @@ ...@@ -95,29 +38,10 @@
><FormItem :label="l('module')" prop="module"> ><FormItem :label="l('module')" prop="module">
<Input v-model="entity.module"> </Input> </FormItem <Input v-model="entity.module"> </Input> </FormItem
></Col> ></Col>
<!-- <Col :span="12"
><FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('tenantId')" prop="tenantId">
<InputNumber v-model="entity.tenantId"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId">
<InputNumber
v-model="entity.inheritCategoryId"
></InputNumber> </FormItem
></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('version')" prop="version"> ><FormItem :label="l('version')" prop="version">
<InputNumber v-model="entity.version"></InputNumber> </FormItem <InputNumber v-model="entity.version"></InputNumber> </FormItem
></Col> ></Col>
<!-- <Col :span="12"
><FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber> </FormItem
></Col> -->
<Col :span="24" <Col :span="24"
><FormItem :label="l('description')" prop="description"> ><FormItem :label="l('description')" prop="description">
<Input <Input
...@@ -126,17 +50,40 @@ ...@@ -126,17 +50,40 @@
:rows="5" :rows="5"
></Input> </FormItem ></Input> </FormItem
></Col> ></Col>
<Col :span="12" v-if="eid != 0"> </Row>
<FormItem label="扩展属性" prop="inheritCategoryId"> <Col :span="24">
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> --> <Row type="flex" justify="center" align="middle">
<RadioGroup v-model="inherit"> <div class="textIcon" @click="upClick(upDrop)">
<Radio label="1">继承</Radio> <Icon :type="iconType" />{{ textUp }}
<Radio label="0">自定义</Radio> </div>
</RadioGroup> </Row>
</FormItem>
</Col>
<Col :span="24" v-if="inherit == '0'">
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
<Row style="margin-bottom: 10px" :gutter="10">
<Col :span="6">
<AutoComplete
v-model="completeValue"
icon="ios-search"
placeholder="请搜索"
style="width: 100%"
>
<Option
v-for="option in completeList"
:value="option.name"
:key="option.code"
>
<span class="demo-auto-complete-title">
{{ option.name }}
</span>
<span class="demo-auto-complete-count" style="float: right">{{
option.code
}}</span>
</Option>
</AutoComplete>
</Col>
<Col :span="2">
<Button type="primary" @click="importColumns">导入</Button>
</Col>
</Row>
<Table :columns="columns" :data="checkList" border> <Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType == 1 || row.fieldType == 2"> <div v-if="row.fieldType == 1 || row.fieldType == 2">
...@@ -150,7 +97,6 @@ ...@@ -150,7 +97,6 @@
/> />
</template> </template>
<template slot-scope="{ row, index }" slot="note"> <template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select <Select
v-if="row.dataType == 3" v-if="row.dataType == 3"
v-model="row.note" v-model="row.note"
...@@ -207,21 +153,22 @@ ...@@ -207,21 +153,22 @@
@click="remove(index, row)" @click="remove(index, row)"
style="color: #ff7a8b" style="color: #ff7a8b"
v-if="row.fieldType > 1" v-if="row.fieldType > 1"
>删除</a >删除</a>
>
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10" <Button type="dashed" long @click="addNew('{}')" class="mt10"
>新增属性</Button >新增属性</Button
> >
</Col> </Col>
</Row> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled" <Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button >保存</Button
> >
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col>
</Row>
</Form> </Form>
</template> </template>
<script> <script>
...@@ -230,74 +177,13 @@ export default { ...@@ -230,74 +177,13 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
iconType: "ios-arrow-up",
textUp: "收起",
upDrop: true,
completeValue: "",
completeList: [],
codeList: [], codeList: [],
checkList: [ checkList: [],
{
field: "code",
title: "编号",
note: "",
dataType: 0,
unitName: "",
required: false,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "version",
title: "版本",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
note: "",
dataType: 0,
unitName: "",
required: true,
isunique: false,
fieldType: 1, //共有属性(不能删除)
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "description",
title: "文档详细说明",
note: "",
dataType: 8,
unitName: "",
required: true,
isunique: false,
fieldType: 1, //共有属性(不能删除)
categoryId: 0,
action: 1,
add: 0, //新增标识
},
],
columns: [ columns: [
{ {
title: "序号", title: "序号",
...@@ -351,11 +237,11 @@ export default { ...@@ -351,11 +237,11 @@ export default {
align: "center", align: "center",
}, },
], ],
inherit: this.eid ? "1" : "0",
disabled: false, disabled: false,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
}, },
}; };
}, },
...@@ -365,13 +251,59 @@ export default { ...@@ -365,13 +251,59 @@ export default {
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
this.seachChange();
} }
}, },
methods: { methods: {
importColumns() {
//导入
let changeId = {};
if (this.completeList.length > 0) {
this.completeList.map((e, index) => {
if (e.name == this.completeValue) {
changeId = e;
this.completeList.splice(index, 1);
this.completeValue = "";
}
});
this.addNew(changeId);
}
},
upClick(value) {
this.upDrop = !value;
if (value) {
this.textUp = "下拉";
this.iconType = "ios-arrow-down";
} else {
this.textUp = "收起";
this.iconType = "ios-arrow-up";
}
},
seachChange() {
let data = {
conditions: [],
pageSize: 20,
};
Api.list(data)
.then((r) => {
if (r.success) {
this.completeList = r.result;
} else {
}
})
.catch((err) => {});
},
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
//新增的删除,直接删 //新增的删除,直接删
this.checkList.splice(index, 1); this.checkList.splice(index, 1);
let objArr = {
name: row.title,
code: row.code,
id: row.id,
};
this.completeList.push(objArr);
} else { } else {
row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台 row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
...@@ -382,7 +314,19 @@ export default { ...@@ -382,7 +314,19 @@ export default {
setRow(row, index) { setRow(row, index) {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew(e) {
let id = "",
code = "",
name = "";
if (e == "{}") {
id = "";
code = "";
name = "";
} else {
id = e.id;
code = e.code;
name = e.name;
}
let maxId = 0; let maxId = 0;
this.checkList.map((u) => { this.checkList.map((u) => {
if (u.mid > maxId) { if (u.mid > maxId) {
...@@ -390,9 +334,11 @@ export default { ...@@ -390,9 +334,11 @@ export default {
} }
}); });
let obj = { let obj = {
id: id,
code: code,
mid: maxId + 1, mid: maxId + 1,
field: "c" + maxId, field: "c" + maxId,
title: "", title: name,
note: "", note: "",
unitName: "", unitName: "",
dataType: 0, dataType: 0,
...@@ -408,12 +354,26 @@ export default { ...@@ -408,12 +354,26 @@ export default {
load(v) { load(v) {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result; this.entity = r.result;
this.checkList = JSON.parse(r.result.content);
this.checkList.map((v) => {
if (v.fieldType > 1) {
v.fieldType = 1;
}
this.completeList.map((e, index) => {
if (v.title == e.name) {
this.completeList.splice(index, 1);
}
});
});
console.log(this.checkList);
console.log(this.completeList);
}); });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.entity.content = JSON.stringify(this.checkList);
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
this.disabled = false; this.disabled = false;
...@@ -427,7 +387,6 @@ export default { ...@@ -427,7 +387,6 @@ export default {
.catch((err) => { .catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败"); this.$Message.error("保存失败");
console.warn(err);
}); });
} }
}); });
...@@ -449,3 +408,17 @@ export default { ...@@ -449,3 +408,17 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
.textIcon {
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
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
{ key: "status", title: this.l("status"), align: "left", 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: "upId", title: this.l("upId"), align: "left", high: true },
// { key: "level", title: this.l("level"), align: "left", high: true }, // { key: "level", title: this.l("level"), align: "left", high: true },
// { // {
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
// align: "left", // align: "left",
// high: true, // high: true,
// }, // },
{ key: "type", title: this.l("type"), align: "left", high: true }, { key: "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"),
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<Input v-model="entity.type"> </Input> </FormItem <Input v-model="entity.type"> </Input> </FormItem
> --> > -->
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<Dictionary code="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"
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<Input v-model="entity.status"> </Input> </FormItem <Input v-model="entity.status"> </Input> </FormItem
> --> > -->
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary code="project.status" v-model="entity.status" ></Dictionary> <Dictionary code="base.project.status" v-model="entity.status" ></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12" <Col :span="12"
......
<template> <template>
<div class="detail"> <div class="detail">
<Row> <Row>
<!-- <Filed :span="12" :name="l('creationTime')">{{
entity.creationTime
}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{
entity.creatorUserId
}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{
entity.lastModificationTime
}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{
entity.lastModifierUserId
}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{ entity.isDeleted }}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{
entity.deletionTime
}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{
entity.deleterUserId
}}</Filed> -->
<Filed :span="12" :name="l('name')">{{ entity.name }}</Filed> <Filed :span="12" :name="l('name')">{{ entity.name }}</Filed>
<Filed :span="12" :name="l('upId')">{{ entity.upId }}</Filed> <Filed :span="12" :name="l('upId')">{{ entity.upId }}</Filed>
<Filed :span="12" :name="l('level')">{{ entity.level }}</Filed> <Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
......
...@@ -116,15 +116,25 @@ export default { ...@@ -116,15 +116,25 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
{ key: "upId", title: this.l("upId"), align: "left", high: true }, // { key: "upId", title: this.l("upId"), align: "left", high: true },
{ key: "level", title: this.l("level"), 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: "tenantId", key: "code",
title: this.l("tenantId"), title: this.l("code"),
align: "left", align: "left",
code: "project.base.code",
easy: true,
high: true, high: true,
}, },
{ key: "type", title: this.l("type"), align: "left", high: true ,code: "project.base.type"}, { 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", key: "englishFullName",
title: this.l("englishFullName"), title: this.l("englishFullName"),
...@@ -139,21 +149,13 @@ export default { ...@@ -139,21 +149,13 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
{ key: "status", title: this.l("status"), align: "left", high: true ,code: "project.base.status"}, // {
{ // key: "inheritCategoryId",
key: "inheritCategoryId", // title: this.l("inheritCategoryId"),
title: this.l("inheritCategoryId"), // align: "left",
align: "left", // high: true,
high: true, // },
},
{
key: "code",
title: this.l("code"),
align: "left",
code: "project.base.code",
easy: true,
high: true,
},
{ key: "module", title: this.l("module"), align: "left", high: true }, { key: "module", title: this.l("module"), align: "left", high: true },
{ {
title: "操作", title: "操作",
......
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