Commit b1f90b94 authored by 仇晓婷's avatar 仇晓婷

文档详情

parent 0b56514a
...@@ -144,6 +144,7 @@ export default { ...@@ -144,6 +144,7 @@ export default {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
} }
this.parms.eid = this.$u.guid();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -192,6 +193,13 @@ export default { ...@@ -192,6 +193,13 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.productUrlList = this.parms.eid;
} else {
this.entity.productUrl = "";
this.entity.productUrlList = "";
}
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
......
...@@ -229,22 +229,11 @@ export default { ...@@ -229,22 +229,11 @@ export default {
mounted() { mounted() {
this.initFiled(); this.initFiled();
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
}, },
methods: { methods: {
initFiled() { initFiled() {
// let conditions = [
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: this.eid,
// },
// ];
Api.listbyid({ Api.listbyid({
categoryId: this.treeId, categoryId: this.treeId,
// sortBy: "id",
// isDesc: false,
}).then((r) => { }).then((r) => {
if (r.result) { if (r.result) {
let result = []; let result = [];
......
<template> <template>
<div class="detail"> <div class=".detail-document">
<div class="top-title">
<div class="new-detail row-left">
<Row>
<Filed :span="12" :name="l('creationTime')+':'">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')+':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="12" :name="l('status')+':'">{{entity.status==0?'草稿':'送审'}}</Filed>
</Row>
</div>
<ul>
<li>
<a>
<Icon type="md-brush" />&nbsp;编辑
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a>
<Icon type="md-brush" />&nbsp;移动
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a>
<Icon type="md-brush" />&nbsp;克隆
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a>
<Icon type="md-brush" />&nbsp;下载
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a>
<Icon type="md-brush" />&nbsp;引用
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a>
<Icon type="md-brush" />&nbsp;使用
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a>
<Icon type="md-brush" />版本
</a>
</li>
</ul>
</div>
<div class="body-document">
<h4>详细信息</h4>
<Row>
<Col span="20">
<div class="new-detail detail-d">
<Row> <Row>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'"> <Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'">
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" /> <State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
...@@ -14,12 +79,7 @@ ...@@ -14,12 +79,7 @@
/> />
</Filed> </Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed> <Filed :span="24" :name="l('filePath')+':'" class="filed-d">
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="12" :name="l('status')">{{entity.status==0?'草稿':'送审'}}</Filed>
<Filed :span="12" :name="l('filePath')">
<files ref="refFile" :parms="parms" :showList="false" /> <files ref="refFile" :parms="parms" :showList="false" />
</Filed> </Filed>
<!-- <Filed :span="12" :name="l('field')">{{entity.field}}</Filed> <!-- <Filed :span="12" :name="l('field')">{{entity.field}}</Filed>
...@@ -42,6 +102,16 @@ ...@@ -42,6 +102,16 @@
<Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</Filed>--> <Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</Filed>-->
</Row> </Row>
</div> </div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<img :src="downUrl+avatorPath" v-if="avatorPath" />
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
</div>
</Col>
</Row>
</div>
</div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
...@@ -49,12 +119,14 @@ export default { ...@@ -49,12 +119,14 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
avatorPath: "",
downUrl: fileUrlDown,
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }], code: [{ required: true, message: "必填", trigger: "blur" }],
}, },
fileds:[], fileds: [],
parms: { parms: {
app: "material", app: "material",
eid: null, eid: null,
...@@ -72,6 +144,7 @@ export default { ...@@ -72,6 +144,7 @@ export default {
Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
this.entity = r.result; this.entity = r.result;
this.parms.eid = r.result.filePath; this.parms.eid = r.result.filePath;
this.avatorPath = r.result.img;
this.$emit("on-load"); this.$emit("on-load");
}); });
}, },
...@@ -84,7 +157,7 @@ export default { ...@@ -84,7 +157,7 @@ export default {
result = r.result.definie.concat(r.result.inherit); result = r.result.definie.concat(r.result.inherit);
console.log(result); console.log(result);
this.fileds = result.filter(function (item) { this.fileds = result.filter(function (item) {
item.span = 12; item.span = 6;
if (item.dataType > 4) { if (item.dataType > 4) {
item.span = 24; item.span = 24;
} }
...@@ -123,3 +196,66 @@ export default { ...@@ -123,3 +196,66 @@ export default {
}, },
}; };
</script> </script>
<style lang="less">
.top-title {
// margin: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
position: relative;
border-radius: 5px;
.row-left {
width: 1000px;
}
ul {
display: -webkit-inline-box;
display: inline-box;
position: absolute;
bottom: 5px;
right: 0px;
li {
width: 70px;
span {
color: #e0e0e0;
}
}
}
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
height: 80vh;
h4 {
height: 50px;
line-height: 50px;
background: #515a6e;
padding: 0 10px;
color: #f5f6fa;
border-radius: 5px 5px 0 0;
}
.img-touxiang {
width: 230px;
height: 230px;
background: #ccc;
border-radius: 5px;
float: right;
margin-top: 10px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.detail-d {
padding-left: 20px;
.filed-d {
border-top: 1px solid #e0e0e0;
}
}
}
.detail-document {
background-color: #f5f7f9 !important;
}
</style>
\ No newline at end of file
...@@ -204,6 +204,7 @@ export default { ...@@ -204,6 +204,7 @@ export default {
props: ["eid", "treeId"], props: ["eid", "treeId"],
mounted() { mounted() {
this.initFiled(); this.initFiled();
this.parms.eid = this.$u.guid();
}, },
methods: { methods: {
initFiled() { initFiled() {
...@@ -250,10 +251,10 @@ export default { ...@@ -250,10 +251,10 @@ 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.parms.eid = r.result.filePath;
this.avatorPath = fileUrlDown + r.result.img; this.avatorPath = fileUrlDown + r.result.img;
this.imgName = r.result.img; this.imgName = r.result.img;
this.entity.status = r.result.status + ""; this.entity.status = r.result.status + "";
this.parms.eid = r.result.filePath;
}); });
}, },
handleSubmit() { handleSubmit() {
...@@ -302,3 +303,18 @@ export default { ...@@ -302,3 +303,18 @@ export default {
}, },
}; };
</script> </script>
<style lang="less">
.img-touxiang {
width: 230px;
height: 230px;
background: #ccc;
border-radius: 5px;
margin-left: 58px;
margin-top: -35px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
</style>
\ No newline at end of file
...@@ -64,7 +64,14 @@ ...@@ -64,7 +64,14 @@
</div> </div>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component :is="detail" :eid="curId" :treeId="treeId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :treeId="treeId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
...@@ -75,6 +82,7 @@ export default { ...@@ -75,6 +82,7 @@ export default {
data() { data() {
return { return {
action: Api.index, action: Api.index,
fullscreen: false,
easySearch: { easySearch: {
keys: { op: "refName,name", value: null }, keys: { op: "refName,name", value: null },
categoryId: { categoryId: {
...@@ -292,6 +300,7 @@ export default { ...@@ -292,6 +300,7 @@ export default {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
this.fullscreen = false;
if (this.addShow == false) { if (this.addShow == false) {
this.$Message.error("请在分类最子集新增文档"); this.$Message.error("请在分类最子集新增文档");
} else { } else {
...@@ -302,18 +311,21 @@ export default { ...@@ -302,18 +311,21 @@ export default {
} }
}, },
copy(id) { copy(id) {
this.fullscreen = false;
this.curId = id; this.curId = id;
this.title = "克隆"; this.title = "克隆";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
view(id) { view(id) {
this.fullscreen = true;
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.detail = () => import("./detail"); this.detail = () => import("./detail");
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
this.fullscreen = false;
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./edit"); this.detail = () => import("./edit");
...@@ -394,14 +406,13 @@ export default { ...@@ -394,14 +406,13 @@ export default {
} }
.row-down { .row-down {
padding: 10px; // padding: 10px;
height: 113px;
.img-i { .img-i {
width: 90px; width: 90px;
background: #eee; background: #eee;
height: 90px; height: 90px;
margin-right: 15px; margin-right: 15px;
// overflow: hidden; // overflow: hidden;
img { img {
width: 90px; width: 90px;
...@@ -410,12 +421,12 @@ export default { ...@@ -410,12 +421,12 @@ export default {
} }
.c div { .c div {
margin-bottom: 14px;
margin-left: 10px; margin-left: 10px;
} }
.a-icon { .a-icon {
text-align: right; text-align: right;
margin-top: 24px;
} }
} }
} }
......
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