修改约谈流程的文件上传方式

duhanyu
吕天方 2 years ago
parent 41bedcf040
commit 79a9620b98

@ -5,7 +5,7 @@ VUE_APP_TITLE = 数据中台系统
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:9035'
VUE_APP_BASE_API = 'http://39.101.188.84:9035'
# VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api'
# 路由懒加载

@ -1,11 +1,11 @@
<template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/tcZz/networkSecurity/DataSourceTj">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<router-link v-else key="expand" class="sidebar-logo-link" to="/tcZz/networkSecurity/DataSourceTj">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link>

@ -230,7 +230,7 @@
/>
<!-- 添加或修改工作动态对话框 -->
<el-dialog :visible.sync="open" width="600px" append-to-body custom-class="dialog-box">
<el-dialog :visible.sync="open" width="700px" append-to-body custom-class="dialog-box">
<div slot="title" class="dialog-title">{{ title }}</div>
<el-form ref="form" :model="form" :rules="rules" label-width="auto" class="dialog-from">
<el-form-item label="区域" prop="areaId">
@ -711,9 +711,16 @@
.el-form {
.file-item {
display:flex;
.el-form-item {
flex: 1;
}
.el-button {
height: 35px;
}
.el-input {
// width: 200px
width: 100%;
}
}
}
}

@ -95,10 +95,13 @@
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="文件">
<el-button @click="addDomain" type="primary">添加文件</el-button>
<el-form-item label="上传文件">
<!-- <el-button @click="addDomain" type="primary">添加文件</el-button> -->
<!-- <el-form-item label="文件路径(完整路径)"> -->
<fileUpload v-model="fileNameS" :limit="1"/>
<!-- </el-form-item> -->
</el-form-item>
<div v-for="(domain, index) in form.domains" :key="index" class="file-item">
<!-- <div v-for="(domain, index) in form.domains" :key="index" class="file-item">
<el-form-item
label="文件名称"
:prop="'domains.' + index + '.fileName'"
@ -118,7 +121,7 @@
<el-input v-model="domain.fileUrl" placeholder="请输入文件路径"></el-input>
</el-form-item>
<el-button @click.prevent="removeDomain(domain)" type="danger" size="mini">删除</el-button>
</div>
</div> -->
<el-form-item label="备注" prop="remark">
<!-- <el-input v-model="form.remark" placeholder="请输入备注" /> -->
<el-input v-model="form.remark" resize="none" :rows="5" type="textarea" placeholder="请输入备注" />
@ -217,12 +220,12 @@
},
//
form: {
domains: [
{
fileName: "",
fileUrl: "",
}
],
// domains: [
// {
// fileName: "",
// fileUrl: "",
// }
// ],
},
//
rules: {
@ -231,6 +234,7 @@
],
},
fileList:[],
fileNameS:[],
};
},
created() {
@ -283,12 +287,12 @@
remark: null,
domains: [
{
fileName: "",
fileUrl: "",
}
],
// domains: [
// {
// fileName: "",
// fileUrl: "",
// }
// ],
};
this.resetForm("form");
@ -324,79 +328,53 @@
/** 新增按钮操作 */
handleAdd() {
this.reset();
// this.fileNameS = [];
this.fileNameS = [];
this.open = true;
this.title = "添加约谈流程";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// this.fileNameS = []
this.fileNameS = []
const id = row.id || this.ids
getYtlc(id).then(response => {
// console.log(response.data,'response.data')
this.form.name = response.data.name;
this.form.createTime = response.data.createTime;
this.form.remark = response.data.remark;
this.form.id = response.data.id;
console.log(response.data,'response.data')
this.form = response.data;
// this.form.name = response.data.name;
// this.form.createTime = response.data.createTime;
// this.form.remark = response.data.remark;
// this.form.id = response.data.id;
// console.log(this.form,'this.form')
if (response.data.fileName && response.data.fileUrl) {
let arr1 = response.data.fileName.split(",");
let arr2 = response.data.fileUrl.split(",");
if(arr1.length > 1) {
// console.log(arr1,'arr1')
this.form.domains = [];
arr1.forEach((value, index) => {
this.form.domains.push({
fileName: value,
fileUrl: arr2[index],
this.fileNameS.push({
name: value,
url: arr2[index],
});
});
} else {
// this.form.domains = [];
// let obj = {}
// obj.fileName = arr1[0]
// obj.fileUrl = arr2[0]
// this.form.domains.push(obj)
this.form.domains = [
{
fileName: arr1[0],
fileUrl: arr2[0],
}
];
}
} else {
this.form.domains = [
{
fileName: '',
fileUrl: '',
}
];
}
this.open = true;
this.title = "修改约谈流程";
console.log(this.form,'this.form')
});
},
/** 提交按钮 */
submitForm() {
let arr1 = [];
let arr2 = [];
this.form.domains.forEach((value) => {
arr1.push(value.fileName);
arr2.push(value.fileUrl);
console.log(this.fileNameS)
if (this.fileNameS.length > 0) {
this.fileNameS.forEach((value) => {
arr1.push(value.name);
arr2.push(value.url);
});
this.form.fileName = arr1.join(",");
this.form.fileUrl = arr2.join(",");
// if (this.fileNameS.length > 0) {
// this.form.fileName = arr1.join(",");
// this.form.fileUrl = arr2.join(",");
// } else {
// this.form.fileName = "";
// this.form.fileUrl = "";
// }
// console.log(this.form,'this.form')
} else {
this.form.fileName = "";
this.form.fileUrl = "";
}
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
@ -463,22 +441,22 @@
</script>
<style lang="scss" scoped>
::v-deep .el-dialog {
.el-dialog__body {
.el-form {
.file-item {
display:flex;
// .el-form-item__content {
// display:flex;
// // .my-input {
// // margin: 0 10px;
// // }
// }
.el-button {
height: 35px;
}
}
}
}
}
// ::v-deep .el-dialog {
// .el-dialog__body {
// .el-form {
// .file-item {
// display:flex;
// // .el-form-item__content {
// // display:flex;
// // // .my-input {
// // // margin: 0 10px;
// // // }
// // }
// .el-button {
// height: 35px;
// }
// }
// }
// }
// }
</style>
Loading…
Cancel
Save