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

文档管理上传优化

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