| | |
| | | <template> |
| | | <div> |
| | | <el-row > |
| | | <el-col :span="18"> |
| | | <el-form label-width="80px" :inline="true" :label-position="labelPosition" :model="formInline" class="form-inline"> |
| | | <el-form-item label="标题"> |
| | | <el-input v-model="formInline.title" placeholder="标题"></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="描述"> |
| | | <el-input v-model="formInline.desp" placeholder="描述"></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item > |
| | | <el-button type="primary" @click="query_">查询</el-button> |
| | | <el-button type="info" @click="empty_">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <el-col :span="4" > |
| | | <el-button type="primary" @click="createNew">创建</el-button> |
| | | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <div class="infinite-list-wrapper" style="overflow:auto"> |
| | | <ul class="list" v-infinite-scroll="load" infinite-scroll-disabled="disabled"> |
| | | <li v-for="item in dataList" :key = "item.id" class="list-item"> |
| | | <div ref="list_div" class="infinite-list-wrapper" style="overflow:auto; border-top: 1px solid #c3c5c7;"> |
| | | <div v-if="isRefresh" class="list" v-infinite-scroll="load" infinite-scroll-disabled="disabled"> |
| | | <div v-for="one in dataList" :key="one.id" class="list-item"> |
| | | <el-row> |
| | | <el-col :span="8"><div class="grid-content">{{item.title}}</div></el-col> |
| | | <el-col :span="4" :><div class="grid-content">{{item.time}}</div></el-col> |
| | | <el-col :span="18"><div class="grid-content z_grid-content1 grid-content_text" @click="showItem(one)">{{one.title}}</div></el-col> |
| | | <el-col :span="3"><div class="grid-content z_grid-content1 grid-content_exam" @click="showLinkItem(one)">{{formatter(one)}}</div></el-col> |
| | | <el-col :span="3"><div class="grid-content z_grid-content1 grid-content_time">{{one.time}}</div></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"><div class="grid-content">{{item.desp}}</div></el-col> |
| | | |
| | | <el-row style="padding-left: 16px;"> |
| | | <el-col :span="20"><div class="grid-content z_grid-content2">{{one.desp}}</div></el-col> |
| | | </el-row> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <p v-if="loading">加载中...</p> |
| | | <p v-if="noMore">没有更多了</p> |
| | | </div> |
| | | <el-dialog |
| | | v-if="dialogVisible" |
| | | title="详情" |
| | | :visible.sync="dialogVisible" |
| | | width="40%" |
| | | height="40%" |
| | | custom-class="handleClose"> |
| | | <span>{{selectOne.title}}</span> |
| | | <el-divider></el-divider> |
| | | <div style="content"> |
| | | <span>{{selectOne.desp}}</span> |
| | | </div> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="canEdit" type="primary" @click="edit">修改</el-button> |
| | | <el-button v-if="!selectOne.examine" type="primary" @click="addProject">生成项目</el-button> |
| | | <el-button v-if="selectOne.attachment && selectOne.attachment != ''" type="primary" @click="download(selectOne)">下 载</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="创建话题" :visible.sync="dialogFormVisible" @close="closeCreate" > |
| | | <el-form :model="form"> |
| | | <el-form-item label="话题名称" :label-width="formLabelWidth"> |
| | | <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-form-item> |
| | | <el-upload |
| | | class="upload-demo" |
| | | :action="uploadUrl" |
| | | :on-preview="handlePreview" |
| | | :data="form" |
| | | :limit="3" |
| | | :auto-upload='false' |
| | | ref="upload" |
| | | :on-change="onChange" |
| | | :on-exceed="handleExceed" |
| | | :on-success="uploadSuccess" |
| | | > |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | <div slot="tip" class="el-upload__tip">不超过50M</div> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="createTopic">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <div style="width: 0px; height: 0px;"> |
| | | <iframe ref="frame_export" style="width: 0px; height: 0px; border: 0px;"></iframe> |
| | | </div> |
| | | <el-dialog v-if="dialog_1" @close="Cancel" width="70%" top="50px" :visible.sync="dialog_1" append-to-body> |
| | | <newProject @closeNewProject="closeNewProject" v-bind:rowData="rowData" ref="newProject_"></newProject> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-if="dialog_2" @close="Cancel1" width="70%" top="50px" :visible.sync="dialog_2" append-to-body> |
| | | <newProject ref="newProject1_"></newProject> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-if="dialogProdetail" width="70%" top="50px" :visible.sync="dialogProdetail" append-to-body> |
| | | <prodetail v-bind:rowData="rowData" ref="newProject2_"></prodetail> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import squareList from "./squareList.vue"; |
| | | |
| | | import newProject from '../components/popup/newProject.vue' |
| | | import prodetail from '../components/popup/prodetail.vue' |
| | | export default { |
| | | components: { |
| | | newProject, |
| | | prodetail |
| | | }, |
| | | data() { |
| | | return { |
| | | isRefresh: true, |
| | | rowData: {}, |
| | | dialog_1: false, |
| | | dialog_2: false, |
| | | uploadUrl:"/api/api/file/topicUpload", |
| | | form:{}, |
| | | pageno:1, |
| | | total:0, |
| | | maxPage:0, |
| | | fileList: [], |
| | | dialogVisible: false, |
| | | dialogProdetail: false, |
| | | dialogFormVisible: false, |
| | | labelPosition: "right", |
| | | formInline:{}, |
| | | selectOne:{ |
| | | title:"biaoti", |
| | | desp:"miaoshu", |
| | | attachment:"222" |
| | | }, |
| | | formLabelWidth:"100px", |
| | | dataList: [ |
| | | {id:1,title:"11",desp:"111",time:"11-11"}, |
| | | {id:1,title:"11",desp:"111",time:"11-11"}, |
| | | {id:1,title:"11",desp:"111",time:"11-11"}, |
| | | {id:1,title:"11",desp:"111",time:"11-11"}, |
| | | {id:1,title:"11",desp:"111",time:"11-11"}, |
| | | ], |
| | | loading: false |
| | | // {id:1,attachment:"222",title:"标题", desp:"描述时发生纠纷司符合双方酒叟发动机时代峰峻配电间 刀片机水电费搜豆腐皮搜的看法我都叫打破是觉得批发商附加费第三季度破发接收到发地方就搜到到四点分发偶读囧", time:"12分钟前"}, |
| | | // {id:1,attachment:"222",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | // {id:1,attachment:"",title:"11", desp:"111", time:"11111"}, |
| | | ], |
| | | loading: false, |
| | | |
| | | } |
| | | }, |
| | | computed: { |
| | | |
| | | noMore() { |
| | | return this.count >= 20 |
| | | return this.maxPage == this.pageno |
| | | }, |
| | | disabled() { |
| | | return this.loading || this.noMore |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getData(); |
| | | let clientHeight = document.documentElement.clientHeight; |
| | | let tableHeight_ = clientHeight - 60 - 45 - 62; |
| | | this.$refs.list_div.style['height'] = tableHeight_ + "px"; |
| | | }, |
| | | methods: { |
| | | Cancel() { |
| | | this.$refs.newProject_.Cancel(); |
| | | this.dialogFormVisible = false; |
| | | }, |
| | | Cancel1() { |
| | | |
| | | }, |
| | | addProject() { |
| | | this.rowData = { |
| | | parentid: this.selectOne.id, |
| | | desp: this.selectOne.desp, |
| | | name: this.selectOne.title, |
| | | //objective:this.selected.reseachType, |
| | | //items:[this.$moment(this.selected.startTime).format('YYYY-MM-DD'),this.$moment(this.selected.endTime).format('YYYY-MM-DD')] |
| | | } |
| | | |
| | | this.dialog_1 = true; |
| | | this.dialogVisible = false; |
| | | }, |
| | | closeNewProject() { |
| | | this.dialog_1 = false; |
| | | this.getData(); |
| | | }, |
| | | download(val) { |
| | | if(val) { |
| | | this.$refs.frame_export.src = "/api/api/file/download/" + val.id; |
| | | }else { |
| | | this.$message({message:'获取地址失败', type: 'warning'}); |
| | | } |
| | | |
| | | }, |
| | | uploadSuccess() { |
| | | this.dialogFormVisible = false; |
| | | }, |
| | | onChange(file, fileList) { |
| | | this.fileList = []; |
| | | this.fileList = fileList; |
| | | }, |
| | | canExam() { |
| | | return true; |
| | | }, |
| | | |
| | | createTopic() { |
| | | let me = this; |
| | | var userId = localStorage.getItem('userId'); |
| | | if(!userId) { |
| | | this.$router.push('/login'); |
| | | } |
| | | this.form.userId = userId; |
| | | let params = this.form; |
| | | |
| | | if(this.fileList.length == 0) { |
| | | //不带附件 |
| | | let url = "/api/topic/add"; |
| | | this.$axios.get(url, { |
| | | params |
| | | }) |
| | | .then(data_ => { |
| | | if(data_.data.success) { |
| | | this.$message('创建成功'); |
| | | me.dialogFormVisible = false; |
| | | }else { |
| | | this.$message({message:'话题创建失败', type: 'warning'}); |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }else { |
| | | this.$refs.upload.submit(); |
| | | } |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | }, |
| | | handlePreview(file) { |
| | | }, |
| | | handleExceed(files, fileList) { |
| | | this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
| | | }, |
| | | beforeRemove(file, fileList) { |
| | | return this.$confirm(`确定移除 ${ file.name }?`); |
| | | }, |
| | | load() { |
| | | // this.loading = true |
| | | // setTimeout(() => { |
| | | // this.count += 2 |
| | | // this.loading = false |
| | | // }, 2000) |
| | | } |
| | | let me = this; |
| | | if(me.pageno < me.maxPage) { |
| | | me.pageno++; |
| | | } |
| | | this.query_(); |
| | | }, |
| | | showItem(one) { |
| | | this.dialogVisible = true; |
| | | this.selectOne = one; |
| | | }, |
| | | showLinkItem(one) { |
| | | this.rowData = { |
| | | id: one.linkId, |
| | | } |
| | | this.dialogProdetail = true; |
| | | }, |
| | | createNew() { |
| | | this.form = {}; |
| | | this.dialogFormVisible = true; |
| | | }, |
| | | formatter(one){ |
| | | if(one.examine && one.linkId){ |
| | | return "已关联项目"; |
| | | } |
| | | }, |
| | | empty_() { |
| | | this.formInline = {}; |
| | | this.query_(); |
| | | }, |
| | | query_() { |
| | | this.getData(this.formInline, true); |
| | | }, |
| | | canEdit() { |
| | | return this.selectOne.userId == this.userId; |
| | | }, |
| | | edit(){ |
| | | this.form = { |
| | | title: this.selectOne.title, |
| | | desp: this.selectOne.desp, |
| | | id: this.selectOne.id |
| | | }; |
| | | this.dialogFormVisible = true; |
| | | this.dialogVisible = false; |
| | | }, |
| | | closeCreate() { |
| | | this.dialogFormVisible = false; |
| | | this.getData(); |
| | | }, |
| | | |
| | | setRefresh() { |
| | | this.isRefresh = false; |
| | | this.isRefresh = true; |
| | | }, |
| | | getData(query,empty) { |
| | | this.setRefresh(); |
| | | // this.dataList = []; |
| | | let me = this; |
| | | this.loading = true |
| | | this.loading_table = true; |
| | | let pageno = this.pagenum; |
| | | let url = "/api/topic/page/" + this.pageno; |
| | | let params = {}; |
| | | if(query && query != {}){ |
| | | params.title = query.title; |
| | | params.desp = query.desp; |
| | | } |
| | | this.$axios.get(url, { |
| | | params |
| | | }) |
| | | .then(data_ => { |
| | | if(data_.data.success) { |
| | | me.dataList.push.apply(me.dataList, data_.data.data.records) |
| | | me.total = data_.data.data.total; |
| | | me.pageno = data_.data.data.pageno; |
| | | me.maxPage = data_.data.data.maxPage; |
| | | } |
| | | me.loading = false |
| | | }).catch(error => { |
| | | me.loading = false |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .grid-content{ |
| | | text-align: left; |
| | | padding: 5px; |
| | | } |
| | | |
| | | .grid-content_text { |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | | font-style: italic; |
| | | color: #000; |
| | | } |
| | | .grid-content_text:hover { |
| | | color: #409EFF; |
| | | cursor:pointer; |
| | | } |
| | | .grid-content_time { |
| | | font-weight: bold; |
| | | color: #909399; |
| | | } |
| | | .grid-content_exam { |
| | | color: #00aaff; |
| | | font-size: 14px; |
| | | } |
| | | .grid-content_exam:hover { |
| | | font-weight: bold; |
| | | cursor:pointer; |
| | | } |
| | | |
| | | .z_grid-content1{ |
| | | display:table-cell; |
| | | vertical-align:bottom; |
| | | height: 30px; |
| | | } |
| | | .z_grid-content2{ |
| | | color: #83878a; |
| | | font-size: 14px; |
| | | padding: 0px; |
| | | min-height: 24px; |
| | | height: 24px; |
| | | line-height: 24px; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | .content{ |
| | | |
| | | } |
| | | |
| | | .form-inline { |
| | | text-align: left; |
| | | } |
| | | |
| | | .list { |
| | | |
| | | } |
| | | .list-item { |
| | | margin-top: 0px; |
| | | padding-bottom: 5px; |
| | | border-bottom: 1px solid #c3c5c7; |
| | | } |
| | | |
| | | .handleClose { |
| | | margin: 10px; |
| | | text-align: left; |
| | | margin-left: 30%; |
| | | } |
| | | .handleClose .el-dialog__body { |
| | | padding: 10px 20px; |
| | | } |
| | | .handleClose .el-divider--horizontal{ |
| | | margin: 5px; |
| | | } |
| | | </style> |