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

文档管理克隆

parent 8cac88a5
...@@ -279,7 +279,7 @@ export default { ...@@ -279,7 +279,7 @@ export default {
props: { props: {
v: Object, v: Object,
treeId: Number, treeId: Number,
eid: Number, eid: String,
}, },
created() {}, created() {},
mounted() { mounted() {
...@@ -317,11 +317,17 @@ export default { ...@@ -317,11 +317,17 @@ export default {
this.$set(this.entity, u.filed, v); this.$set(this.entity, u.filed, v);
}); });
} }
if (this.eid) {
this.load(this.eid);
}
}); });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
if (this.entity.id) {
delete this.entity.id;
}
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePath = this.parms.eid; this.entity.filePath = this.parms.eid;
} else { } else {
...@@ -352,18 +358,31 @@ export default { ...@@ -352,18 +358,31 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
// 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.entity.id = 0; this.avatorPath = fileUrlDown + r.result.img;
// }); this.imgName = r.result.img;
// }, this.entity.status = r.result.status;
if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath;
} else {
this.parms.eid = this.$u.guid();
}
this.entity.filePath = this.parms.eid;
});
},
l(key) { l(key) {
key = "document_property_definition" + "." + key; key = "document_property_definition" + "." + key;
return this.$t(key); return this.$t(key);
}, },
}, },
watch: { watch: {
eid(v) {
if (v) {
this.load(v);
}
},
imgName(newName, oldName) { imgName(newName, oldName) {
console.log(newName); console.log(newName);
const imgPathsArr = JSON.parse(newName); const imgPathsArr = JSON.parse(newName);
......
...@@ -3,60 +3,50 @@ ...@@ -3,60 +3,50 @@
<div class="top-title"> <div class="top-title">
<div class="new-detail row-left"> <div class="new-detail row-left">
<Row> <Row>
<Filed :span="12" :name="l('creationTime')+':'">{{entity.creationTime}}</Filed> <Filed :span="12" :name="l('creationTime') + ':'">{{
<Filed :span="12" :name="l('creatorUserId')+':'"> entity.creationTime
}}</Filed>
<Filed :span="12" :name="l('creatorUserId') + ':'">
<User :value="entity.creatorUserId" /> <User :value="entity.creatorUserId" />
</Filed> </Filed>
<Filed :span="12" :name="l('status')+':'">{{entity.status==0?'草稿':'送审'}}</Filed> <Filed :span="12" :name="l('status') + ':'">
<state code="word.document.status" :value="entity.status" />
</Filed>
</Row> </Row>
</div> </div>
<ul> <ul>
<li> <li>
<a @click="edit"> <a @click="edit"> <Icon type="md-create" />&nbsp;编辑 </a>
<Icon type="md-create" />&nbsp;编辑
</a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
</li> </li>
<li> <li>
<a> <a> <Icon type="ios-log-in" />&nbsp;移动 </a>
<Icon type="ios-log-in" />&nbsp;移动
</a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
</li> </li>
<li> <li>
<a> <a @click="copy"> <Icon type="ios-photos" />&nbsp;克隆 </a>
<Icon type="ios-photos" />&nbsp;克隆
</a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
</li> </li>
<li> <li>
<a> <a> <Icon type="md-download" />&nbsp;下载 </a>
<Icon type="md-download" />&nbsp;下载
</a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
</li> </li>
<li> <li>
<a> <a> <Icon type="ios-link" />&nbsp;引用 </a>
<Icon type="ios-link" />&nbsp;引用
</a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
</li> </li>
<li> <li>
<a> <a> <Icon type="md-checkmark-circle" />&nbsp;使用 </a>
<Icon type="md-checkmark-circle" />&nbsp;使用
</a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
</li> </li>
<li> <li>
<a> <a> <Icon type="ios-alert-outline" />版本 </a>
<Icon type="ios-alert-outline" />版本
</a>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -66,20 +56,35 @@ ...@@ -66,20 +56,35 @@
<Col span="20"> <Col span="20">
<div class="new-detail detail-d"> <div class="new-detail detail-d">
<Row> <Row>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'"> <Filed
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" /> v-for="li in fileds"
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div> :key="li.field"
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div> :span="li.span"
<DTSpan v-else-if="li.dataType==4" :value="entity[li.field]" /> :name="li.title + ':'"
<span v-else>{{entity[li.field]}}</span> >
<State
v-if="li.dataType == 3"
:code="li.note"
:value="entity[li.field]"
/>
<div v-else-if="li.dataType == 8">{{ entity[li.field] }}</div>
<div
v-else-if="li.dataType == 5"
v-html="entity[li.field]"
></div>
<DTSpan
v-else-if="li.dataType == 4"
:value="entity[li.field]"
/>
<span v-else>{{ entity[li.field] }}</span>
<State <State
v-if="li.unitName&&(li.dataType==1||li.dataType==2)" v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:code="li.note" :code="li.note"
:value="entity[li.field]" :value="entity[li.field]"
/> />
</Filed> </Filed>
<Filed :span="24" :name="l('filePath')+':'" class="filed-d"> <Filed :span="24" :name="l('filePath') + ':'" class="filed-d">
<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>
...@@ -105,12 +110,32 @@ ...@@ -105,12 +110,32 @@
</Col> </Col>
<Col span="4" class="dcm-right"> <Col span="4" class="dcm-right">
<div class="img-touxiang"> <div class="img-touxiang">
<img :src="downUrl+avatorPath" v-if="avatorPath" /> <img :src="downUrl + avatorPath" v-if="avatorPath" />
<img src="@/assets/images/files_header.png" v-else width="100%" height="100%" /> <img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div> </div>
</Col> </Col>
</Row> </Row>
</div> </div>
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
>
<component
:is="detail"
:eid="curId"
:treeId="treeId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -119,6 +144,10 @@ export default { ...@@ -119,6 +144,10 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
modal: false,
title: "新增",
detail: null,
curId: this.eid,
avatorPath: "", avatorPath: "",
downUrl: fileUrlDown, downUrl: fileUrlDown,
entity: {}, entity: {},
...@@ -184,7 +213,23 @@ export default { ...@@ -184,7 +213,23 @@ export default {
this.$emit("on-close"); this.$emit("on-close");
}, },
edit() { edit() {
this.$emit("detailEdit",this.eid); this.curId = this.eid;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
copy() {
this.curId = this.eid;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
ok() {
this.modal = false;
this.$emit("on-ok");
},
cancel() {
this.modal = false;
}, },
l(key) { l(key) {
key = "document_property_definition" + "." + key; key = "document_property_definition" + "." + key;
......
...@@ -290,7 +290,7 @@ export default { ...@@ -290,7 +290,7 @@ export default {
this.entity = r.result; this.entity = r.result;
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 ;
if (r.result.filePath && r.result.filePath != "") { if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath; this.parms.eid = r.result.filePath;
} else { } else {
......
...@@ -102,7 +102,6 @@ ...@@ -102,7 +102,6 @@
:treeId="treeId" :treeId="treeId"
@on-close="cancel" @on-close="cancel"
@on-ok="ok" @on-ok="ok"
@detailEdit="detailEdit"
/> />
</Modal> </Modal>
</div> </div>
...@@ -269,13 +268,7 @@ export default { ...@@ -269,13 +268,7 @@ export default {
// } // }
} }
}, },
copy(id) {
this.fullscreen = false;
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) { view(id) {
this.fullscreen = true; this.fullscreen = true;
this.curId = id; this.curId = id;
...@@ -290,13 +283,7 @@ export default { ...@@ -290,13 +283,7 @@ export default {
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
detailEdit(val) {
this.fullscreen = false;
this.curId = val;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) { remove(id) {
Api.delete(id).then((r) => { Api.delete(id).then((r) => {
if (r.success) { if (r.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