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

文档管理克隆

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