Commit 16b2f89a authored by 骆瑛's avatar 骆瑛

修改拓展查看

parent 04223034
......@@ -95,7 +95,6 @@
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select
v-if="row.dataType == 3"
v-model="row.note"
......@@ -429,11 +428,32 @@ export default {
add: 0, //新增标识
};
this.checkList.push(obj);
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
var data={
base:this.checkList,
dtos:[
{
name:"新增",
code:"Create",
list:[]
},
{
name:"编辑",
code:"Eidt",
list:[]
},
{
name:"列表",
code:"List",
list:[]
},
]
}
this.entity.content = JSON.stringify(this.checkList);
Api.create(this.entity)
.then((r) => {
......
<template>
<div class="detail">
<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> -->
<Row v-if="upDrop">
<Filed :span="12" :name="l('name')">{{ entity.name }}</Filed>
<!-- <Filed :span="12" :name="l('upId')">{{ entity.upId }}</Filed> -->
<Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
<!-- <Filed :span="12" :name="l('tenantId')">{{ entity.tenantId }}</Filed> -->
<Filed :span="12" :name="l('type')">{{ entity.type }}</Filed>
<Filed :span="12" :name="l('englishFullName')">{{
entity.englishFullName
......@@ -32,19 +11,72 @@
entity.englishName
}}</Filed>
<Filed :span="12" :name="l('status')">{{ entity.status }}</Filed>
<Filed :span="12" :name="l('content')">{{ entity.content }}</Filed>
<!-- <Filed :span="12" :name="l('inheritCategoryId')">{{
entity.inheritCategoryId
}}</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="12" :name="l('projectId')">{{ entity.projectId }}</Filed> -->
<Filed :span="24" :name="l('description')">{{
<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>
......@@ -53,6 +85,65 @@ 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" }],
......@@ -66,15 +157,48 @@ export default {
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");
},
......@@ -91,4 +215,19 @@ export default {
},
},
};
</script>
\ No newline at end of file
</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
......@@ -365,8 +365,6 @@ export default {
}
});
});
console.log(this.checkList);
console.log(this.completeList);
});
},
handleSubmit() {
......
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('name')">{{ entity.name }}</Filed>
<Filed :span="12" :name="l('upId')">{{ entity.upId }}</Filed>
<Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
<Filed :span="12" :name="l('tenantId')">{{ entity.tenantId }}</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('inheritCategoryId')">{{
entity.inheritCategoryId
}}</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>
<div class="detail">
<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('upId')">{{entity.upId}}</Filed>
<Filed :span="12" :name="l('level')">{{entity.level}}</Filed>
<Filed :span="12" :name="l('tenantId')">{{entity.tenantId}}</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="24" :name="l('description')">{{entity.description}}</Filed>
<Filed :span="12" :name="l('inheritCategoryId')">{{entity.inheritCategoryId}}</Filed>
<Filed :span="12" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="12" :name="l('module')">{{entity.module}}</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);
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
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