|
@@ -18,6 +18,7 @@
|
|
|
<el-row>
|
|
|
<el-col
|
|
|
v-for="(item, index) in ruleList"
|
|
|
+ :key="index"
|
|
|
:span="item.span ? item.span : 24"
|
|
|
><el-form-item :label="item.label" :prop="item.prop">
|
|
|
<el-select
|
|
@@ -28,7 +29,7 @@
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="items in options1"
|
|
|
- :key="item.value"
|
|
|
+ :key="items.value"
|
|
|
:label="items.text"
|
|
|
:value="items.value"
|
|
|
>
|
|
@@ -42,7 +43,7 @@
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="items in options2"
|
|
|
- :key="item.value"
|
|
|
+ :key="items.value"
|
|
|
:label="items.text"
|
|
|
:value="items.value"
|
|
|
>
|
|
@@ -52,9 +53,12 @@
|
|
|
v-model="ruleForm[item.prop]"
|
|
|
v-else-if="item.scope === 'options'"
|
|
|
>
|
|
|
- <el-radio v-for="items in item.options" :label="items.value">{{
|
|
|
- items.label
|
|
|
- }}</el-radio>
|
|
|
+ <el-radio
|
|
|
+ v-for="(items, indexs) in item.options"
|
|
|
+ :key="indexs"
|
|
|
+ :label="items.value"
|
|
|
+ >{{ items.label }}</el-radio
|
|
|
+ >
|
|
|
</el-radio-group>
|
|
|
|
|
|
<el-date-picker
|
|
@@ -73,19 +77,25 @@
|
|
|
clearable
|
|
|
v-model.trim="ruleForm[item.prop]"
|
|
|
></el-input-number>
|
|
|
- <div v-else-if="item.scope === 'file'" style="display: flex">
|
|
|
+ <div
|
|
|
+ v-else-if="item.scope === 'file'"
|
|
|
+ style="display: flex; flex-wrap: wrap"
|
|
|
+ >
|
|
|
<a
|
|
|
v-if="ruleForm[item.prop]"
|
|
|
:href="$methods.splitImgHost(ruleForm.FilePath)"
|
|
|
target="_blank"
|
|
|
class="file_style"
|
|
|
- >点击查看文件</a
|
|
|
+ >已上传(点击可查看下载)</a
|
|
|
>
|
|
|
<label for="uploads" style="vertical-align: text-bottom"
|
|
|
><span class="btn">{{
|
|
|
ruleForm[item.prop] ? "更换文件" : "上传文件"
|
|
|
}}</span></label
|
|
|
>
|
|
|
+ <span style="color: red"
|
|
|
+ >(支持所有办公文件格式,多个文件请使用压缩包格式上传)</span
|
|
|
+ >
|
|
|
<input
|
|
|
type="file"
|
|
|
id="uploads"
|
|
@@ -325,21 +335,21 @@ export default {
|
|
|
if (file === undefined) {
|
|
|
return;
|
|
|
}
|
|
|
- if (file.size > 10 * 1024 * 1024) {
|
|
|
- self.$message.error("文件不得大于10MB");
|
|
|
- return;
|
|
|
- }
|
|
|
- var type = e.target.value.toLowerCase().split(".").splice(-1);
|
|
|
- if (
|
|
|
- type[0] != "jpg" &&
|
|
|
- type[0] != "pdf" &&
|
|
|
- type[0] != "png" &&
|
|
|
- type[0] != "jpeg"
|
|
|
- ) {
|
|
|
- self.$message.error("上传格式需为:.jpg/.png/.jpeg/.pdf");
|
|
|
- e.target.value = "";
|
|
|
+ if (file.size > 50 * 1024 * 1024) {
|
|
|
+ self.$message.error("文件不得大于50MB");
|
|
|
return;
|
|
|
}
|
|
|
+ // var type = e.target.value.toLowerCase().split(".").splice(-1);
|
|
|
+ // if (
|
|
|
+ // type[0] != "jpg" &&
|
|
|
+ // type[0] != "pdf" &&
|
|
|
+ // type[0] != "png" &&
|
|
|
+ // type[0] != "jpeg"
|
|
|
+ // ) {
|
|
|
+ // self.$message.error("上传格式需为:.jpg/.png/.jpeg/.pdf");
|
|
|
+ // e.target.value = "";
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
let formDatas = new FormData();
|
|
|
formDatas.append("file", file);
|
|
|
this.$api
|
|
@@ -400,6 +410,6 @@ export default {
|
|
|
}
|
|
|
.btn {
|
|
|
cursor: pointer;
|
|
|
- color:red;
|
|
|
+ color: rgb(0, 102, 255);
|
|
|
}
|
|
|
</style>
|