Commit 8cac88a5 authored by 仇晓婷's avatar 仇晓婷

文档管理上传优化

parent 05c8e5ad
<template> <template>
<div> <div>
<Input v-model="newName" placeholder="请选择上传文件"> <Input v-model="newName" placeholder="请选择上传文件" v-if="inputShow">
<Button v-if="view" icon="ios-eye" slot="prepend" @click="downFile(newName)"> </Button> <Button
<Button type="primary" icon="ios-cloud-upload-outline" slot="append" @click="handler">上传</Button> v-if="view"
icon="ios-eye"
slot="prepend"
@click="downFile(newName)"
>
</Button>
<Button
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
</Input> </Input>
<Button
v-else
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
<Upload <Upload
v-model="name" v-model="name"
:action="postUrl" :action="postUrl"
...@@ -18,8 +38,9 @@ ...@@ -18,8 +38,9 @@
:files="files" :files="files"
:on-progress="onProgress" :on-progress="onProgress"
> >
<Button v-show="1==2" type="primary" ref="upload">上传</Button> <Button v-show="1 == 2" type="primary" ref="upload">上传</Button>
</Upload> </Upload>
<Progress :percent="per" :stroke-width="5" v-show="vshowPro" /> <Progress :percent="per" :stroke-width="5" v-show="vshowPro" />
</div> </div>
</template> </template>
...@@ -29,10 +50,11 @@ export default { ...@@ -29,10 +50,11 @@ export default {
name: "inputFile", name: "inputFile",
model: { model: {
prop: "value", prop: "value",
event: "on-change" event: "on-change",
}, },
data() { data() {
return { return {
inputShow: true,
file: null, file: null,
name: this.value, name: this.value,
downUrl: fileUrlDown, downUrl: fileUrlDown,
...@@ -48,7 +70,7 @@ export default { ...@@ -48,7 +70,7 @@ export default {
newName: "", newName: "",
newPath: "", newPath: "",
per: 0, per: 0,
vshowPro: false vshowPro: false,
}; };
}, },
created() {}, created() {},
...@@ -56,20 +78,20 @@ export default { ...@@ -56,20 +78,20 @@ export default {
value: [String, Number, Array, Object], value: [String, Number, Array, Object],
maxSize: { maxSize: {
type: Number, type: Number,
default: 10240 default: 10240,
}, },
files: { files: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
parms: { parms: {
type: String, type: String,
default: "" default: "",
}, },
showButton: { showButton: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
methods: { methods: {
onProgress(event, file, fileList) { onProgress(event, file, fileList) {
...@@ -138,7 +160,7 @@ export default { ...@@ -138,7 +160,7 @@ export default {
"jpg", "jpg",
"gif", "gif",
"zip", "zip",
"rar" "rar",
]; ];
} }
return this.formatList; return this.formatList;
...@@ -156,7 +178,7 @@ export default { ...@@ -156,7 +178,7 @@ export default {
window.open(this.fileUrlPath, "_blank"); window.open(this.fileUrlPath, "_blank");
} }
} }
} },
}, },
mounted() { mounted() {
this.formatL(); this.formatL();
...@@ -165,15 +187,15 @@ export default { ...@@ -165,15 +187,15 @@ export default {
nativeInputValue() { nativeInputValue() {
return this.value === null || this.value === undefined ? "" : this.value; return this.value === null || this.value === undefined ? "" : this.value;
}, },
view(){ view() {
return true return true;
} },
}, },
watch: { watch: {
value(v) { value(v) {
this.name = v; this.name = v;
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -171,10 +171,14 @@ ...@@ -171,10 +171,14 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<RadioGroup v-model="entity.status"> <Dictionary
code="word.document.status"
v-model="entity.status"
></Dictionary>
<!-- <RadioGroup v-model="entity.status">
<Radio label="0">草稿</Radio> <Radio label="0">草稿</Radio>
<Radio label="1">送审</Radio> <Radio label="1">送审</Radio>
</RadioGroup> </RadioGroup> -->
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -189,7 +193,12 @@ ...@@ -189,7 +193,12 @@
/> />
</FormItem> </FormItem>
<div class="img-touxiang"> <div class="img-touxiang">
<img :src="avatorPath" v-if="imgName" /> <img
:src="avatorPath"
v-if="imgName"
@click="imgUrl"
class="img1"
/>
<img <img
src="@/assets/images/files_header.png" src="@/assets/images/files_header.png"
v-else v-else
...@@ -230,7 +239,7 @@ export default { ...@@ -230,7 +239,7 @@ export default {
fileds: [], //扩展属性 fileds: [], //扩展属性
entity: { entity: {
creatorUserId: this.$store.state.userInfo.userId, creatorUserId: this.$store.state.userInfo.userId,
status: "0", status: "",
categoryId: this.treeId, categoryId: this.treeId,
img: "", img: "",
// title: "", // title: "",
...@@ -272,11 +281,16 @@ export default { ...@@ -272,11 +281,16 @@ export default {
treeId: Number, treeId: Number,
eid: Number, eid: Number,
}, },
created() {},
mounted() { mounted() {
this.initFiled(); this.initFiled();
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
this.$refs.refmovieFile1.inputShow = false;
}, },
methods: { methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
initFiled() { initFiled() {
Api.listbyid({ Api.listbyid({
categoryId: this.treeId, categoryId: this.treeId,
...@@ -370,5 +384,8 @@ export default { ...@@ -370,5 +384,8 @@ export default {
height: 100%; height: 100%;
border-radius: 5px; border-radius: 5px;
} }
.img1 {
cursor: pointer;
}
} }
</style> </style>
\ No newline at end of file
...@@ -5,26 +5,48 @@ ...@@ -5,26 +5,48 @@
<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">
<Input v-if="li.dataType==0" v-model="entity[li.field]" :disabled="li.field=='code'"></Input> <Input
v-if="li.dataType == 0"
v-model="entity[li.field]"
:disabled="li.field == 'code'"
></Input>
<InputNumber <InputNumber
v-if="li.dataType==1||li.dataType==2" v-if="li.dataType == 1 || li.dataType == 2"
v-model="entity[li.field]" v-model="entity[li.field]"
class="w100" class="w100"
></InputNumber> ></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary> <Dictionary
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input> v-if="li.dataType == 3"
v-model="entity[li.field]"
:code="li.note"
></Dictionary>
<Input
v-if="li.dataType == 5"
type="textarea"
v-model="entity[li.filed]"
></Input>
<DatePicker <DatePicker
v-if="li.dataType==4" v-if="li.dataType == 4"
v-model="entity[li.field]" v-model="entity[li.field]"
type="date" type="date"
:placeholder="'选择'+li.title" :placeholder="'选择' + li.title"
></DatePicker> ></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile> <InputFile
v-if="li.dataType == 6"
v-model="entity[li.field]"
></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> --> <!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile> <InputFile
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input> v-if="li.dataType == 7"
v-model="entity[li.field]"
></InputFile>
<Input
v-if="li.dataType == 8"
type="textarea"
v-model="entity[li.field]"
></Input>
<state <state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)" v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName" :value="li.unitName"
code="material.main.unitName" code="material.main.unitName"
type="tag" type="tag"
...@@ -146,10 +168,10 @@ ...@@ -146,10 +168,10 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<RadioGroup v-model="entity.status"> <Dictionary
<Radio label="0">草稿</Radio> code="word.document.status"
<Radio label="1">送审</Radio> v-model="entity.status"
</RadioGroup> ></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<!-- <Col :span="24" style="text-align: right;"> <!-- <Col :span="24" style="text-align: right;">
...@@ -162,16 +184,26 @@ ...@@ -162,16 +184,26 @@
</Col> </Col>
<Col span="6"> <Col span="6">
<FormItem :label="l('img')" prop="img"> <FormItem :label="l('img')" prop="img">
<inputFile class="tphoto" ref="refmovieFile1" v-model="imgName" :parms="parmsName" /> <inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
/>
</FormItem> </FormItem>
<div class="img-touxiang"> <div class="img-touxiang">
<img :src="avatorPath" v-if="imgName" /> <img :src="avatorPath" v-if="imgName" @click="imgUrl" class="img1" />
<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>
<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>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
...@@ -206,8 +238,12 @@ export default { ...@@ -206,8 +238,12 @@ export default {
mounted() { mounted() {
this.initFiled(); this.initFiled();
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
this.$refs.refmovieFile1.inputShow = false;
}, },
methods: { methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
initFiled() { initFiled() {
// let conditions = [ // let conditions = [
// { // {
...@@ -321,5 +357,8 @@ export default { ...@@ -321,5 +357,8 @@ export default {
height: 100%; height: 100%;
border-radius: 5px; border-radius: 5px;
} }
.img1 {
cursor: pointer;
}
} }
</style> </style>
\ No newline at end of file
...@@ -58,9 +58,13 @@ ...@@ -58,9 +58,13 @@
/> />
</div> </div>
</Col> </Col>
<Col span="17" class="c"> <Col span="17">
<div class="c">
<div>版本:{{ row.version }}</div> <div>版本:{{ row.version }}</div>
<div>状态:{{ row.status == 0 ? "草稿" : "送审" }}</div> <div>
状态:
<state code="word.document.status" :value="row.status" />
</div>
<!-- <div> <!-- <div>
创建人: 创建人:
<User :value="row.creatorUserId" /> <User :value="row.creatorUserId" />
...@@ -68,13 +72,10 @@ ...@@ -68,13 +72,10 @@
<div class="shuo-ming"> <div class="shuo-ming">
<span>文档说明:</span> <span>文档说明:</span>
<Ellipsis <Ellipsis :text="row.description" :length="12" tooltip />
:text="row.description"
:length="12"
tooltip
class="tooltip-shuo"
/>
</div> </div>
</div>
<p class="a-icon"> <p class="a-icon">
<a @click="edit(row.id)"> <Icon type="md-create" />编辑 </a <a @click="edit(row.id)"> <Icon type="md-create" />编辑 </a
>&nbsp; >&nbsp;
...@@ -376,22 +377,18 @@ export default { ...@@ -376,22 +377,18 @@ export default {
width: 90px; width: 90px;
background: #eee; background: #eee;
height: 90px; height: 90px;
margin-right: 15px;
// overflow: hidden; // overflow: hidden;
img { img {
width: 90px; width: 90px;
height: 90px; height: 90px;
} }
} }
.c {
.c div { padding-left: 8px;
margin-left: 10px;
} }
.shuo-ming { .shuo-ming {
display: -webkit-inline-box; display: -webkit-inline-box;
.tooltip-shuo {
margin-left: -20px;
}
} }
.a-icon { .a-icon {
text-align: right; text-align: right;
......
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