firm.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <!-- 创业公司登记 -->
  3. <div class="firm" v-loading="loading">
  4. <!-- <div class="pAHeader"> -->
  5. <!-- <div class="pAHeader1">创业公司登记</div> -->
  6. <!-- </div> -->
  7. <div class="pAHeader">
  8. <div class="pAHeader1">创业公司登记</div>
  9. </div>
  10. <hr />
  11. <div class="twoSelectInp">
  12. <div class="selectTwo">
  13. <div class="selectsBlock">
  14. <el-input
  15. v-model="input"
  16. style="width: 200px"
  17. @change="getData"
  18. placeholder="请输入"
  19. ></el-input>
  20. <el-button type="primary" class="btn2" @click="getData"
  21. >查询</el-button
  22. >
  23. </div>
  24. </div>
  25. <div class="upFile">
  26. <el-progress
  27. v-if="progress.show"
  28. style="width: 300px; margin-top: 10px"
  29. :percentage="progress.value"
  30. :format="ProgressFormat"
  31. ></el-progress>
  32. <beUpload
  33. @getFile="getFile"
  34. v-show="!progress.show"
  35. :navName="'上传文件'"
  36. :accept="accept"
  37. :progress="progress"
  38. ></beUpload>
  39. </div>
  40. </div>
  41. <div class="projectBlock">
  42. <el-table
  43. :data="tableData"
  44. tooltip-effect="dark"
  45. stripe
  46. class="fontSize"
  47. :header-cell-style="{ background: '#f2f2f2', color: '#000' }"
  48. >
  49. <el-table-column
  50. prop="startFile.fileName"
  51. label="文件名称"
  52. align="center"
  53. min-width="25%"
  54. >
  55. </el-table-column>
  56. <el-table-column
  57. prop="create_at"
  58. label="上传时间"
  59. align="center"
  60. min-width="25%"
  61. >
  62. </el-table-column>
  63. <el-table-column
  64. prop="startFile.size"
  65. label="文件大小"
  66. align="center"
  67. min-width="20%"
  68. >
  69. </el-table-column>
  70. <el-table-column
  71. prop="operation"
  72. label="操作"
  73. align="center"
  74. width="200"
  75. >
  76. <template #default="scope">
  77. <div class="operations">
  78. <el-button
  79. type="primary"
  80. class="bt1"
  81. size="mini"
  82. @click="checkFileType(scope.row.startFile.url)"
  83. >查看信息</el-button
  84. >
  85. <el-button
  86. type="primary"
  87. class="bt1"
  88. size="mini"
  89. @click="del(scope.row.startupId)"
  90. style="width: 85px"
  91. >删除</el-button
  92. >
  93. </div>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </div>
  98. <!-- 分页 -->
  99. <el-pagination
  100. background
  101. @current-change="changePage"
  102. layout="prev, pager, next"
  103. :page-size="Page.lim"
  104. :total="Page.total"
  105. class="paginations"
  106. >
  107. </el-pagination>
  108. <!-- 删除通知开始 -->
  109. <el-dialog
  110. title="删除文件"
  111. :visible.sync="dialogVisible1"
  112. width="600px"
  113. class="addDialog"
  114. >
  115. <span class="deleteContent">确定删除文件?</span>
  116. <span slot="footer" class="dialog-footer">
  117. <el-button type="primary" @click="commitDel" class="AllDialogBtn"
  118. >确认删除</el-button
  119. >
  120. <el-button @click="dialogVisible1 = false" class="AllDialogBtn"
  121. >取消</el-button
  122. >
  123. </span>
  124. </el-dialog>
  125. <!-- 删除通知结束-->
  126. <!-- 展示文档开始 -->
  127. <el-dialog
  128. title="展示文件"
  129. :visible.sync="showFile"
  130. top="50px"
  131. width="70vw"
  132. :fullscreen="fullShow"
  133. class="addDialog showDialog"
  134. >
  135. <template slot="title">
  136. <div class="DialogBox">
  137. <div class="DialogTitle">展示文件</div>
  138. <span
  139. v-if="Wordss['name'] != '视频'"
  140. class="changeFull el-icon-zoom-in"
  141. @click="fullShow = !fullShow"
  142. ></span>
  143. </div>
  144. </template>
  145. <!-- <el-button type="primary" style="margin-bottom: 20px;" @click="fullShow=!fullShow">全屏查看</el-button> -->
  146. <div class="showFileArea">
  147. <video-player
  148. class="video-player vjs-custom-skin"
  149. :playsinline="true"
  150. :options="videoDetail"
  151. @play="onPlayerPlay($event)"
  152. style="width: 100%; height: 100%"
  153. v-if="Wordss['name'] == '视频'"
  154. ></video-player>
  155. <vword
  156. style="width: 100%; height: 100%; overflow: auto"
  157. class="fullStyle"
  158. v-if="
  159. Wordss['type'] != 'pdf' &&
  160. Wordss['name'] != '图片' &&
  161. Wordss['name'] != '视频'
  162. "
  163. :pdfUrl="
  164. 'https://view.officeapps.live.com/op/view.aspx?src=' + showFileUrl
  165. "
  166. ></vword>
  167. <vpdf
  168. style="width: 100%; height: 100%; overflow: auto"
  169. class="fullStyle"
  170. :pdfUrl="showFileUrl"
  171. v-if="Wordss['type'] == 'pdf'"
  172. ></vpdf>
  173. <img
  174. :src="showFileUrl"
  175. alt="图片哦"
  176. v-if="Wordss['name'] == '图片'"
  177. style="width: auto; height: auto; max-width: 100%; max-height: 100%"
  178. />
  179. </div>
  180. </el-dialog>
  181. <!-- 展示文档结束 -->
  182. </div>
  183. </template>
  184. <script>
  185. import beUpload from "@/components/tool/beUpload.vue";
  186. import vpdf from "@/components/vpdf.vue";
  187. import vword from "@/components/vword.vue";
  188. import full from "core-js/full";
  189. // import { Header } from 'element-ui';
  190. export default {
  191. components: { beUpload, vpdf, vword },
  192. data() {
  193. return {
  194. fullShow: false,
  195. accept: "*",
  196. // showFileType: 0,
  197. dialogVisible1: false,
  198. loading: false,
  199. delId: "",
  200. input: "",
  201. tableData: [],
  202. Page: {
  203. nowPage: 1,
  204. total: 0,
  205. lim: 8,
  206. },
  207. progress: {
  208. value: 50,
  209. show: false,
  210. },
  211. // ProjectEndLookFile:{url:"",type:""},
  212. showFile: false,
  213. showFileUrl: "",
  214. Wordss: { type: "", name: "" },
  215. canonical: {
  216. Image:
  217. /^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,
  218. File: /^https?:\/\/(.+\/)+.+(\.(docx|xlsx|ppt|pdf))$/i,
  219. video:
  220. /^https?:\/\/(.+\/)+.+(\.(avi|wmv|mpg|mpeg|mov|rm|ram|mp4|swf|flv))$/i,
  221. },
  222. videoDetail: {},
  223. playerOptions: {
  224. playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
  225. autoplay: false, //如果true,浏览器准备好时开始回放。
  226. muted: false, // 默认情况下将会消除任何音频。
  227. loop: false, // 导致视频一结束就重新开始。
  228. preload: "auto", // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
  229. language: "zh-CN",
  230. aspectRatio: "16:9", // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
  231. fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
  232. sources: [
  233. {
  234. type: "video/mp4", //这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目 || "video/ogg"|| "video/webm"
  235. src: "", //url地址require("../../assets/media/aaa.mp4")
  236. },
  237. ],
  238. // poster: require("../../assets/tu31.png"), //你的封面地址
  239. // poster: dataRes.imgUrl, //你的封面地址
  240. notSupportedMessage: "此视频暂无法播放,请稍后再试", //允许覆盖Video.js无法播放媒体源时显示的默认信息。
  241. controlBar: {
  242. timeDivider: true, //当前时间和持续时间的分隔符
  243. durationDisplay: true, //显示持续时间
  244. remainingTimeDisplay: false, //是否显示剩余时间功能
  245. fullscreenToggle: true, //全屏按钮
  246. },
  247. },
  248. playerO: {},
  249. };
  250. },
  251. methods: {
  252. //展示文件
  253. checkFileType(url) {
  254. console.log(url);
  255. this.showFileUrl = url;
  256. this.showFile = true;
  257. if (typeof url == "undefined") return { type: "", name: "" };
  258. let urlSplit = url.split(".");
  259. const type = urlSplit[urlSplit.length - 1];
  260. if (this.canonical.Image.test(url)) {
  261. this.Wordss = { type: type, name: "图片" };
  262. return console.log(this.Wordss);
  263. }
  264. if (this.canonical.File.test(url)) {
  265. this.Wordss = { type: type, name: "文档" };
  266. return console.log(this.Wordss);
  267. }
  268. if (this.canonical.video.test(url)) {
  269. this.Wordss = { type: type, name: "视频" };
  270. this.videoDetail = {};
  271. this.playerOptions.sources[0].src = url;
  272. this.videoDetail = this.playerOptions;
  273. return console.log(this.Wordss);
  274. } else return (this.Wordss = { type: type, name: type });
  275. },
  276. switchVideo(media) {
  277. this.playerO = {};
  278. this.playerOptions.poster = "";
  279. this.playerOptions.sources[0].src = media;
  280. this.playerO = this.playerOptions;
  281. },
  282. onPlayerPlay() {},
  283. del(Id) {
  284. this.delId = Id;
  285. this.dialogVisible1 = true;
  286. },
  287. commitDel() {
  288. this.ajax
  289. .post(this.$store.state.api + "/UpdateFirmFileState", {
  290. uid: this.$store.state.userInfo.userid,
  291. sid: this.delId,
  292. st: 1,
  293. })
  294. .then((res) => {
  295. if (res.data == 1) {
  296. this.$message.success("删除成功");
  297. } else {
  298. this.$message.error("删除失败");
  299. }
  300. this.getData();
  301. this.dialogVisible1 = false;
  302. this.delId = "";
  303. })
  304. .catch((err) => {
  305. console.log(err);
  306. });
  307. },
  308. changePage(newPage) {
  309. this.Page.nowPage = newPage;
  310. this.getData();
  311. },
  312. getFile(val) {
  313. console.log(val);
  314. this.ajax
  315. .post(this.$store.state.api + "/UploadFirmFile", {
  316. uid: this.$store.state.userInfo.userid,
  317. file: JSON.stringify(val),
  318. })
  319. .then((res) => {
  320. if (res.data == 1) {
  321. this.$message.success("上传成功");
  322. } else {
  323. this.$message.error("上传失败");
  324. }
  325. this.getData();
  326. });
  327. },
  328. getData() {
  329. this.loading = true;
  330. this.tableData = [];
  331. this.ajax
  332. .get(this.$store.state.api + "/GetFirmFile", {
  333. uid: this.$store.state.userInfo.userid,
  334. tit: this.input,
  335. page: this.Page.nowPage,
  336. lim: this.Page.lim,
  337. })
  338. .then((res) => {
  339. res.data[0].forEach((item) => {
  340. item["startFile"] = JSON.parse(item["startFile"]);
  341. this.tableData.push(item);
  342. });
  343. this.Page.total = res.data[1][0]["total"];
  344. this.progress.show = false;
  345. this.loading = false;
  346. })
  347. .catch((err) => {
  348. console.log(err);
  349. });
  350. },
  351. ProgressFormat(value) {
  352. return value == 100 ? "100%" : `${value}%`;
  353. },
  354. },
  355. watch: {
  356. input: {
  357. handler() {
  358. immediate: true;
  359. deep: true;
  360. this.getData();
  361. },
  362. },
  363. },
  364. mounted() {
  365. this.getData();
  366. },
  367. };
  368. </script>
  369. <style lang="less">
  370. .firm {
  371. width: 100%;
  372. height: 100%;
  373. position: relative;
  374. .addDialog {
  375. .el-dialog {
  376. border-radius: 5px;
  377. overflow: hidden;
  378. }
  379. .el-dialog__body {
  380. text-align: center;
  381. }
  382. .deleteContent {
  383. width: 100%;
  384. margin: 30px 0;
  385. font-size: 22px;
  386. color: #000;
  387. }
  388. .addDialogLogo {
  389. width: 60px;
  390. height: 30px;
  391. display: flex;
  392. justify-content: center;
  393. border-radius: 5px;
  394. line-height: 30px;
  395. background: #f2f2f2;
  396. position: absolute;
  397. left: 20px;
  398. top: 15px;
  399. }
  400. .el-dialog__header {
  401. display: flex;
  402. justify-content: center;
  403. background: #32455b;
  404. }
  405. .el-dialog__title {
  406. color: #fff;
  407. display: flex;
  408. justify-content: center;
  409. font-size: 18px;
  410. position: relative;
  411. top: -2px;
  412. }
  413. .addDialogMid {
  414. box-sizing: border-box;
  415. padding: 0 60px 0 10px;
  416. .addDialogTit {
  417. display: flex;
  418. span {
  419. width: 80px;
  420. font-size: 16px;
  421. line-height: 40px;
  422. text-align: left;
  423. }
  424. }
  425. .addDialogTit1 {
  426. display: flex;
  427. justify-content: space-between;
  428. margin-bottom: 15px;
  429. }
  430. .addDialogTit2 {
  431. margin-top: 10px;
  432. font-size: 16px;
  433. color: #000;
  434. text-indent: 2em;
  435. }
  436. .addDialogCon {
  437. margin-top: 20px;
  438. }
  439. }
  440. .dialog-footer {
  441. display: flex;
  442. justify-content: center;
  443. box-sizing: border-box;
  444. // .btn5 {
  445. // font-size: 16px;
  446. // }
  447. }
  448. }
  449. .btn {
  450. //上传文件
  451. width: 100px;
  452. height: 35px;
  453. font-size: 16px;
  454. background: #477edd;
  455. }
  456. }
  457. .upFile {
  458. height: 40px !important;
  459. width: auto;
  460. }
  461. /deep/ .video-player > .video-js {
  462. height: 100%;
  463. }
  464. // #footerPage {
  465. // width: 100%;
  466. // position: absolute;
  467. // bottom: 0;
  468. // display: flex;
  469. // justify-content: flex-end;
  470. // }
  471. </style>