wordList.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <div class="pb_content g_body">
  3. <div class="topBg">
  4. <div class="wordIcon">
  5. <div class="docImg">
  6. <img src="../../assets/icon/secondToolList/doc.png" alt="" />
  7. </div>
  8. <div>协同文档</div>
  9. </div>
  10. <div class="searchRoom">
  11. <div class="firstTop">
  12. <input
  13. type="text"
  14. placeholder="输入房间名称/号码...."
  15. v-model="roomS"
  16. />
  17. <div @click="getFileList">确定</div>
  18. </div>
  19. <div class="lastTop">
  20. <div class="notice">
  21. <img src="../../assets/icon/word/notice.png" alt="" />
  22. </div>
  23. <div>若找不到房间,输入房间号或名称进行搜索哦!</div>
  24. </div>
  25. </div>
  26. <div class="addOrCreateRoom">
  27. <div @click="dialogVisible = true">加入房间</div>
  28. <div v-if="tType == '1'" @click="jumpWord">创建房间</div>
  29. </div>
  30. </div>
  31. <div class="roomBox">
  32. <div class="roomDiv" v-for="(f, fIndex) in fileList" :key="fIndex">
  33. <div class="roomNumer">{{ f.num }}</div>
  34. <div class="roomImg">
  35. <img src="../../assets/icon/word/roomImg.png" alt="" />
  36. </div>
  37. <div class="roomName">
  38. <div>{{ f.name ? f.name : "暂无房间名称" }}</div>
  39. <div>{{ f.time }}</div>
  40. </div>
  41. <div class="enterRoom" @click="enterRoom(f.num)">进入房间</div>
  42. </div>
  43. <div v-if="fileList.length == 0" class="noRoom">
  44. <img src="../../assets/icon/word/noRoom.png" alt="" />
  45. </div>
  46. </div>
  47. <el-dialog
  48. title="加入房间"
  49. class="addOrCreateRoom"
  50. :visible.sync="dialogVisible"
  51. :append-to-body="true"
  52. width="500px"
  53. :before-close="handleClose"
  54. >
  55. <div slot="title" class="header-title">
  56. <div class="title_add_student">加入房间</div>
  57. </div>
  58. <div class="addRoom_box">
  59. <div class="inputBox">
  60. <el-input
  61. v-model="goNum"
  62. placeholder="请输入要加入的房间号"
  63. ></el-input>
  64. <div class="room_b">
  65. 备注:输入房间号点击加入房间或点击创建房间直接创建房间
  66. </div>
  67. <div class="room_btn">
  68. <el-button class="roomBtn" type="primary" @click="enterRoom(f.num)"
  69. >加入房间</el-button
  70. >
  71. <!-- <el-button class="roomBtn" type="primary" @click="goRoom(goNum)"
  72. >加入房间</el-button
  73. >
  74. <el-button class="roomBtn" type="primary" @click="checkNum"
  75. >创建房间</el-button
  76. > -->
  77. </div>
  78. </div>
  79. </div>
  80. </el-dialog>
  81. </div>
  82. </template>
  83. <script>
  84. import Clipboard from "clipboard";
  85. import draggable from "vuedraggable";
  86. export default {
  87. components: {
  88. //调用组件
  89. draggable,
  90. },
  91. data() {
  92. return {
  93. dialogVisible: false,
  94. goNum: "",
  95. fileList: [],
  96. userid: this.$route.query.userid,
  97. oid: this.$route.query.oid,
  98. cid: this.$route.query.cid,
  99. tType: this.$route.query.tType,
  100. copyText: "",
  101. roomS: "",
  102. };
  103. },
  104. methods: {
  105. goTo(path) {
  106. this.$router.push(path);
  107. },
  108. copy() {
  109. this.copyText =
  110. this.$refs.inviteT.innerHTML +
  111. "\n" +
  112. this.$refs.invite1.innerHTML +
  113. "\n" +
  114. this.$refs.invite2.innerHTML +
  115. "\n" +
  116. this.$refs.invite3.innerText +
  117. "\n" +
  118. this.$refs.invite4.innerHTML;
  119. var clipboard = new Clipboard(".tag-read");
  120. clipboard.on("success", (e) => {
  121. this.$message.success("复制成功");
  122. console.log("复制成功");
  123. clipboard.destroy(); // 释放内存
  124. });
  125. clipboard.on("error", (e) => {
  126. console.log("不支持复制,该浏览器不支持自动复制");
  127. clipboard.destroy(); // 释放内存
  128. });
  129. },
  130. handleClose(done) {
  131. done();
  132. },
  133. getFileList() {
  134. let params = {
  135. uid: this.userid,
  136. oid: this.oid,
  137. cid: this.cid,
  138. cu: "",
  139. cn: this.roomS,
  140. };
  141. this.ajax
  142. .get(this.$store.state.api + "selectFileList", params)
  143. .then((res) => {
  144. this.fileList = res.data[0];
  145. })
  146. .catch((err) => {
  147. console.error(err);
  148. });
  149. },
  150. jumpWord() {
  151. window.parent.postMessage({ num: "0" }, "*");
  152. },
  153. enterRoom(num) {
  154. window.parent.postMessage({ num: num }, "*");
  155. },
  156. },
  157. created() {
  158. this.getFileList();
  159. },
  160. };
  161. </script>
  162. <style scoped>
  163. .g_body {
  164. width: 100%;
  165. height: 100%;
  166. margin: 0 !important;
  167. background: #e6eaf0;
  168. }
  169. .topBg {
  170. background: url("../../assets/icon/word/topBg.png");
  171. width: 100%;
  172. object-fit: cover;
  173. height: 220px;
  174. display: flex;
  175. flex-direction: row;
  176. flex-wrap: nowrap;
  177. align-items: center;
  178. justify-content: space-between;
  179. background-size: 100% 100%;
  180. }
  181. .wordIcon {
  182. display: flex;
  183. flex-direction: row;
  184. flex-wrap: nowrap;
  185. align-items: center;
  186. margin: 0 0 100px 45px;
  187. }
  188. .docImg {
  189. width: 40px;
  190. height: 40px;
  191. }
  192. .docImg > img,
  193. .notice > img,
  194. .roomImg > img,
  195. .noRoom > img {
  196. width: 100%;
  197. height: 100%;
  198. }
  199. .notice {
  200. width: 20px;
  201. height: 20px;
  202. }
  203. .wordIcon > div:nth-child(2) {
  204. font-size: 20px;
  205. color: #fff;
  206. margin-left: 10px;
  207. }
  208. .addOrCreateRoom {
  209. margin: 0 45px 100px 0;
  210. display: flex;
  211. flex-direction: row;
  212. flex-wrap: nowrap;
  213. align-items: center;
  214. }
  215. .addOrCreateRoom > div {
  216. width: 90px;
  217. background: #199cfe;
  218. height: 30px;
  219. color: #fff;
  220. border-radius: 5px;
  221. text-align: center;
  222. line-height: 30px;
  223. font-size: 12px;
  224. cursor: pointer;
  225. }
  226. .addOrCreateRoom > div:nth-child(2) {
  227. margin-left: 20px;
  228. }
  229. .searchRoom {
  230. margin-top: 100px;
  231. }
  232. .firstTop {
  233. display: flex;
  234. flex-direction: row;
  235. flex-wrap: nowrap;
  236. align-items: center;
  237. }
  238. .firstTop > input {
  239. width: 350px;
  240. height: 40px;
  241. outline: none;
  242. border: none;
  243. border-radius: 5px;
  244. text-indent: 10px;
  245. }
  246. .firstTop > div {
  247. width: 65px;
  248. background: #5e5e5e;
  249. color: #fff;
  250. height: 40px;
  251. text-align: center;
  252. line-height: 40px;
  253. border-radius: 5px;
  254. margin-left: 15px;
  255. cursor: pointer;
  256. }
  257. .lastTop {
  258. display: flex;
  259. flex-direction: row;
  260. flex-wrap: nowrap;
  261. align-items: center;
  262. margin-top: 10px;
  263. color: #fff;
  264. }
  265. .roomBox {
  266. width: 98%;
  267. margin: 20px 0 0 20px;
  268. display: flex;
  269. flex-direction: row;
  270. flex-wrap: wrap;
  271. justify-content: flex-start;
  272. align-items: center;
  273. }
  274. .roomDiv {
  275. border-radius: 5px;
  276. background: #fff;
  277. width: 250px;
  278. position: relative;
  279. height: 260px;
  280. margin: 0 30px 30px 0;
  281. }
  282. .roomNumer {
  283. position: absolute;
  284. right: 8px;
  285. color: #bababa;
  286. top: 2px;
  287. }
  288. .roomImg {
  289. width: 100px;
  290. margin: 0 auto;
  291. padding: 10px 0;
  292. }
  293. .roomName {
  294. display: flex;
  295. flex-direction: column;
  296. flex-wrap: nowrap;
  297. align-items: center;
  298. margin-bottom: 15px;
  299. }
  300. .roomName > div:nth-child(1) {
  301. font-size: 15px;
  302. }
  303. .roomName > div:nth-child(2) {
  304. color: #d1d1d1;
  305. padding-top: 5px;
  306. }
  307. .enterRoom {
  308. background: #3e86ff;
  309. width: 90%;
  310. text-align: center;
  311. margin: 0 auto;
  312. height: 30px;
  313. line-height: 30px;
  314. color: #fff;
  315. border-radius: 3px;
  316. cursor: pointer;
  317. }
  318. body::-webkit-scrollbar {
  319. /*滚动条整体样式*/
  320. width: 6px;
  321. /*高宽分别对应横竖滚动条的尺寸*/
  322. height: 6px;
  323. }
  324. .addOrCreateRoom >>> .el-dialog {
  325. height: 200px;
  326. }
  327. .addOrCreateRoom >>> .el-dialog__header {
  328. background: #32455b;
  329. color: #fff;
  330. height: 40px;
  331. line-height: 40px;
  332. padding: 0 0 0 20px;
  333. }
  334. .addOrCreateRoom >>> .el-dialog__headerbtn {
  335. top: 13px !important;
  336. }
  337. .addOrCreateRoom >>> .el-dialog__body {
  338. background: #f3f3f3;
  339. height: 100%;
  340. }
  341. .addRoom_box {
  342. background: #fff;
  343. width: 100%;
  344. height: 100%;
  345. position: relative;
  346. }
  347. .inputBox {
  348. padding: 30px 0 0 20px;
  349. }
  350. .inputBox >>> .el-input {
  351. width: 95% !important;
  352. }
  353. .room_b {
  354. margin: 10px 0;
  355. }
  356. .room_btn {
  357. position: absolute;
  358. bottom: 35px;
  359. left: 25%;
  360. }
  361. .noRoom {
  362. margin: 10% auto 0;
  363. }
  364. </style>