| | |
| | | </el-row> |
| | | |
| | | |
| | | <div class="infinite-list-wrapper" style="overflow:auto; height: 75vh; border-top: 1px solid #c3c5c7;"> |
| | | <div class="infinite-list-wrapper" style="overflow:auto; height: 70vh; border-top: 1px solid #c3c5c7;"> |
| | | |
| | | <div class="list" v-infinite-scroll="load" infinite-scroll-disabled="disabled"> |
| | | <div v-for="one in dataList" :key="one.id" class="list-item" @click="showItem(one)"> |
| | |
| | | </div> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button :v-if="selectOne.attachment == '' ? false: true" type="primary" @click="download">下 载</el-button> |
| | | <el-button v-if="selectOne.attachment && selectOne.attachment != ''" type="primary" @click="download">下 载</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="创建话题" :visible.sync="dialogFormVisible"> |
| | | <el-form :model="form"> |
| | | <el-form-item label="话题名称" :label-width="formLabelWidth"> |
| | | <el-input v-model="form.name" autocomplete="off"></el-input> |
| | | <el-input v-model="form.title" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="话题内容" :label-width="formLabelWidth"> |
| | | <el-input type="textarea" v-model="form.desp" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-upload |
| | | class="upload-demo" |
| | | :action="uploadUrl" |
| | | :on-preview="handlePreview" |
| | | :on-remove="handleRemove" |
| | | :before-remove="beforeRemove" |
| | | :data="form" |
| | | :limit="1" |
| | | :auto-upload='false' |
| | | :on-exceed="handleExceed" |
| | |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button> |
| | | <el-button type="primary" @click="createTopic">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | uploadUrl:"/api/api/file/topicUpload", |
| | | form:{}, |
| | | fileList: [], |
| | | dialogVisible: false, |
| | | dialogFormVisible: false, |
| | | fileList: [], |
| | | dialogVisible: false, |
| | | dialogFormVisible: false, |
| | | labelPosition: "right", |
| | | formInline:{}, |
| | | selectOne:{ |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | createTopic() { |
| | | var userId = localStorage.getItem('userId'); |
| | | if(!userId) { |
| | | this.$router.push('/login'); |
| | | } |
| | | this.from.userId = userId; |
| | | if(fileList.length == 0) { |
| | | //不带附件 |
| | | url = "/api/topic/add"; |
| | | this.$axios.get(url, { |
| | | params |
| | | }) |
| | | .then(data_ => { |
| | | console.log(data_); |
| | | this.tableData = data_.data.data.records; //给tableData赋值 |
| | | this.total = data_.data.data.total; |
| | | this.loading_table = false; |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | }else { |
| | | |
| | | } |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList); |
| | | }, |
| | |
| | | console.log(file); |
| | | }, |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
| | | this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
| | | }, |
| | | beforeRemove(file, fileList) { |
| | | return this.$confirm(`确定移除 ${ file.name }?`); |