Commit 0b56514a authored by 仇晓婷's avatar 仇晓婷

文档上传

parent 6f60bd0f
...@@ -1767,6 +1767,7 @@ export default { ...@@ -1767,6 +1767,7 @@ export default {
miji:"密级", miji:"密级",
status:'状态', status:'状态',
filePath:'上传文件', filePath:'上传文件',
img:'上传图片',
field:'字段', field:'字段',
dataType:'数据类型', dataType:'数据类型',
dataLength:'数据长度', dataLength:'数据长度',
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120"> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col span="18">
<Row> <Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name"> <FormItem :label="li.title" :prop="li.name">
...@@ -149,9 +151,18 @@ ...@@ -149,9 +151,18 @@
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</Col> </Col>
<!-- <Col :span="24"> </Row>
<div v-html="entity"></div> </Col>
</Col>--> <Col span="6">
<FormItem :label="l('img')" prop="img">
<inputFile class="tphoto" ref="refmovieFile1" v-model="imgName" :parms="parmsName" />
</FormItem>
<div class="img-touxiang" v-if="imgName">
<img :src="avatorPath" />
</div>
</Col>
</Row>
<Row>
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
...@@ -167,12 +178,15 @@ export default { ...@@ -167,12 +178,15 @@ export default {
name: "Add", name: "Add",
data() { data() {
return { return {
disabled: false, imgName: "",
avatorPath: "",
fileds: [], //扩展属性 fileds: [], //扩展属性
entity: { entity: {
creatorUserId: this.$store.state.userInfo.userId, creatorUserId: this.$store.state.userInfo.userId,
status: "0", status: "0",
categoryId: this.treeId, categoryId: this.treeId,
img: "",
// title: "", // title: "",
// field: "", // field: "",
// dataType: null, // dataType: null,
...@@ -198,6 +212,7 @@ export default { ...@@ -198,6 +212,7 @@ export default {
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parmsName: "app=material&eid=1&name=document",
parms: { parms: {
app: "material", app: "material",
eid: null, eid: null,
...@@ -294,14 +309,27 @@ export default { ...@@ -294,14 +309,27 @@ export default {
}, },
}, },
watch: { watch: {
// v() { imgName(newName, oldName) {
// this.entity = this.$u.clone(this.v); console.log(newName);
// }, const imgPathsArr = JSON.parse(newName);
// eid(v) { this.entity.img = imgPathsArr[0].filePath;
// if (v > 0) { this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
// this.load(v); },
// }
// },
}, },
}; };
</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
...@@ -54,6 +54,7 @@ export default { ...@@ -54,6 +54,7 @@ export default {
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:[],
parms: { parms: {
app: "material", app: "material",
eid: null, eid: null,
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120"> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col span="18">
<Row> <Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name"> <FormItem :label="li.title" :prop="li.name">
...@@ -150,6 +152,24 @@ ...@@ -150,6 +152,24 @@
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</Col> </Col>
<!-- <Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>-->
</Row>
</Col>
<Col span="6">
<FormItem :label="l('img')" prop="img">
<inputFile class="tphoto" ref="refmovieFile1" v-model="imgName" :parms="parmsName" />
</FormItem>
<div class="img-touxiang" v-if="imgName">
<img :src="avatorPath" />
</div>
</Col>
</Row>
<Row>
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
...@@ -165,12 +185,14 @@ export default { ...@@ -165,12 +185,14 @@ export default {
name: "Edit", name: "Edit",
data() { data() {
return { return {
disabled: false, imgName: "",
avatorPath: "",
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
fileds: [], //扩展属性 fileds: [], //扩展属性
parmsName: "app=material&eid=1&name=document",
parms: { parms: {
app: "material", app: "material",
eid: null, eid: null,
...@@ -229,6 +251,8 @@ export default { ...@@ -229,6 +251,8 @@ 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 = fileUrlDown + r.result.img;
this.imgName = r.result.img;
this.entity.status = r.result.status + ""; this.entity.status = r.result.status + "";
}); });
}, },
...@@ -270,6 +294,11 @@ export default { ...@@ -270,6 +294,11 @@ export default {
this.load(v); this.load(v);
} }
}, },
imgName(newName, oldName) {
const imgPathsArr = JSON.parse(newName);
this.entity.img = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
}, },
}; };
</script> </script>
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu?'con_bord':''">
<Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids='ids'/> <Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids="ids" />
</Content> </Content>
</Layout> </Layout>
</div> </div>
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
expand: false, expand: false,
treeId: 0, treeId: 0,
addShow: false, addShow: false,
ids:[] ids: [],
}; };
}, },
mounted() { mounted() {
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
}); });
} }
} }
console.log(ids) // console.log(ids)
this.ids = ids; this.ids = ids;
}, },
renderContent(h, { root, node, data }) { renderContent(h, { root, node, data }) {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<Row class="row-down" :gutter="10"> <Row class="row-down" :gutter="10">
<Col span="7"> <Col span="7">
<div class="img-i"> <div class="img-i">
<img :src="downUrl +row.filePath" v-if="row.filePath" /> <img :src="downUrl +row.img" v-if="row.img" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" --> <!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" /> <img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
</div> </div>
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
<Col span="17" class="c"> <Col span="17" class="c">
<div>版本:{{row.version}}</div> <div>版本:{{row.version}}</div>
<div>文档详细说明:{{row.description}}</div> <div>文档详细说明:{{row.description}}</div>
<p class="a-icon"> <p class="a-icon">
<a @click="edit(row.id)"> <a @click="edit(row.id)">
<Icon type="md-create" />编辑 <Icon type="md-create" />编辑
......
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