TableComponent.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. <template>
  2. <div class="mymediaLibrary">
  3. <!-- 表头搜索 -->
  4. <el-form :inline="true" :model="searchForm">
  5. <el-form-item class="formitem">
  6. <el-input
  7. v-model="searchForm.name"
  8. @input="submitClick"
  9. @keydown.enter="submitClick"
  10. :placeholder="$t('mediaLibrary.addFilePlace')"
  11. size="default"
  12. :prefix-icon="Search"
  13. ></el-input>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-select
  17. style="width: 120px"
  18. v-model="searchForm.fileType"
  19. @change="submitClick"
  20. :placeholder="$t('mediaLibrary.fileType.0')"
  21. >
  22. <el-option
  23. v-for="(item, index) in [
  24. $t('mediaLibrary.fileType.0'),
  25. $t('mediaLibrary.fileType.1'),
  26. $t('mediaLibrary.fileType.2'),
  27. $t('mediaLibrary.fileType.3'),
  28. $t('mediaLibrary.fileType.4'),
  29. $t('mediaLibrary.fileType.5'),
  30. ]"
  31. :key="index"
  32. :label="item"
  33. :value="index"
  34. />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item style="margin-right: 0px">
  38. <el-select
  39. class="groupingSelcet"
  40. v-model="searchForm.dictId"
  41. style="width: 120px"
  42. @change="submitClick"
  43. :placeholder="$t('mediaLibrary.fileType.0')"
  44. >
  45. <el-option
  46. v-for="(item, index) in [...allList, ...dictIdList]"
  47. :key="index"
  48. :label="item.dictName"
  49. :value="item.id"
  50. />
  51. </el-select>
  52. <div class="grouping" @click="handleAddfz">
  53. <img :src="groupingSvg" alt="" />
  54. </div>
  55. </el-form-item>
  56. <el-form-item style="float: right; margin-right: 0">
  57. <el-button
  58. @click="windowOpen({ type: 'photography', library: true })"
  59. >{{ $t("mediaLibrary.photography") }}</el-button
  60. >
  61. <el-button
  62. v-if="modeling == 1"
  63. @click="windowOpen({ type: 'modeling', library: true })"
  64. >{{ $t("mediaLibrary.Modeling") }}</el-button
  65. >
  66. <!--v-if="photography == 1" <el-button type="primary" @click="handleAddfz">{{$t('mediaLibrary.grouping')}}</el-button> -->
  67. <el-button type="primary" @click="handleAdd">{{
  68. $t("mediaLibrary.upload")
  69. }}</el-button>
  70. </el-form-item>
  71. </el-form>
  72. <!-- 表格 -->
  73. <el-table
  74. tooltip-effect="dark"
  75. ref="tableRef"
  76. size="large"
  77. :data="tableData"
  78. style="width: 100%"
  79. :row-class-name="tableRowClassName"
  80. >
  81. <el-table-column
  82. prop="name"
  83. :label="$t('program.case.title')"
  84. min-width="300px"
  85. show-overflow-tooltip
  86. >
  87. <template #default="scope">
  88. <a
  89. style="color: var(--primaryColor); cursor: pointer"
  90. v-if="scope.row.fileUrl"
  91. target="_blank"
  92. :title="scope.row.name"
  93. @click="floadileUrl(scope.row)"
  94. >
  95. {{ scope.row.name }}</a
  96. >
  97. </template>
  98. </el-table-column>
  99. <el-table-column
  100. v-for="column in columns"
  101. :key="column.prop"
  102. :prop="column.prop"
  103. show-overflow-tooltip
  104. align="center"
  105. :min-width="column.width"
  106. :label="column.label"
  107. ></el-table-column>
  108. <el-table-column
  109. align="center"
  110. :label="$t('mediaLibrary.operate')"
  111. width="150"
  112. >
  113. <template #default="{ row }">
  114. <!-- <el-button type="primary" text style="color: var(--primaryColor)" size="small" @click="handleEdit(row)">
  115. 编辑
  116. </el-button> -->
  117. <span
  118. class="oper-span"
  119. style="color: var(--primaryColor)"
  120. @click="handleEdit(row)"
  121. >
  122. {{ $t("sys.edit") }}
  123. </span>
  124. <span
  125. class="oper-span"
  126. @click="del(row)"
  127. style="color: var(--primaryColor)"
  128. >
  129. {{ $t("sys.delete") }}
  130. </span>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <!-- 分页 -->
  135. <el-pagination
  136. class="mt-3"
  137. background
  138. @size-change="handleSizeChange"
  139. @current-change="handleCurrentChange"
  140. :current-page="currentPage"
  141. :page-sizes="[10, 20, 30]"
  142. :page-size="pageSize"
  143. style="justify-content: end"
  144. layout="prev, pager, next"
  145. :total="total"
  146. >
  147. </el-pagination>
  148. <!-- 弹窗 -->
  149. <el-dialog v-model="dialogData.show" :title="dialogData.title" width="400">
  150. <el-form label-position="top" :model="form" label-width="110">
  151. <el-form-item
  152. v-if="dialogData.title == $t('sys.upload')"
  153. :label="$t('mediaLibrary.file')"
  154. :label-width="formLabelWidth"
  155. >
  156. <!-- <el-input v-model="addForm.name" autocomplete="off" /> -->
  157. <el-upload
  158. class="upload-demo"
  159. style="width: 100%"
  160. ref="upload"
  161. :multiple="false"
  162. :limit="1"
  163. :before-upload="beforeUpload"
  164. :on-exceed="handleExceed"
  165. :file-list="fileList"
  166. :http-request="() => {}"
  167. :on-preview="previewFile"
  168. :accept="accept"
  169. :before-remove="removeFile"
  170. >
  171. <el-button type="primary">
  172. {{ $t("sys.upload") }}
  173. </el-button>
  174. </el-upload>
  175. </el-form-item>
  176. <el-form-item
  177. :label="
  178. dialogData.title == $t('sys.upload')
  179. ? $t('mediaLibrary.dictName')
  180. : $t('mediaLibrary.setGrouping')
  181. "
  182. :label-width="formLabelWidth"
  183. >
  184. <el-select
  185. style="width: 100%"
  186. v-model="addForm.dictId"
  187. :placeholder="$t('mediaLibrary.tips.dictId')"
  188. >
  189. <el-option
  190. v-for="(item, index) in dictIdList"
  191. :key="index"
  192. :label="item.dictName"
  193. :value="item.id"
  194. />
  195. </el-select>
  196. </el-form-item>
  197. <div v-if="dialogData.title == $t('sys.upload')">
  198. <div style="margin-bottom: 10px">
  199. {{ $t("mediaLibrary.tips.uplooadfiletype")
  200. }}{{ $t("mediaLibrary.tips.uplooadSize") }}
  201. </div>
  202. <!-- <span>注意:模型需使用zip包上传。包含贴图、模型、mtl文件,包内不得包含文件夹。</span> -->
  203. <div style="margin-bottom: 10px">
  204. <div>
  205. {{ $t("mediaLibrary.tips.objtips") }}
  206. </div>
  207. <img style="width: 150px" :src="obj" alt="" />
  208. </div>
  209. <div style="margin-bottom: 10px">
  210. <div>
  211. {{ $t("mediaLibrary.tips.osgbtips") }}
  212. </div>
  213. <img style="width: 150px" :src="osgb" alt="" />
  214. </div>
  215. </div>
  216. </el-form>
  217. <template #footer>
  218. <div class="dialog-footer">
  219. <el-button @click="dialogData.show = false">{{
  220. $t("sys.cancel")
  221. }}</el-button>
  222. <el-button type="primary" @click="handleuploadAdd">
  223. {{ $t("sys.enter") }}
  224. </el-button>
  225. </div>
  226. </template>
  227. </el-dialog>
  228. <!-- 修改分组 -->
  229. <el-dialog
  230. v-model="dialogData.fzshow"
  231. :title="$t('mediaLibrary.grouping')"
  232. width="400"
  233. >
  234. <el-form label-position="top" :model="form" label-width="50">
  235. <el-form-item
  236. :label="$t('mediaLibrary.addgrouping')"
  237. :label-width="formLabelWidth"
  238. >
  239. <el-input
  240. v-model="dialogData.fzName"
  241. maxlength="50"
  242. show-word-limit
  243. style="width: 278px"
  244. />
  245. <el-button
  246. style="margin-left: 20px; width: 60px"
  247. @click="handlefzAdd"
  248. >{{ $t("common.add") }}</el-button
  249. >
  250. </el-form-item>
  251. <div class="itemTitle">
  252. <p>{{ $t("mediaLibrary.groupingList") }}</p>
  253. <div class="itemTitleList">
  254. <div class="itemTitle-list" v-if="!dictIdList?.length">
  255. {{ $t("program.undata") }}
  256. </div>
  257. <div
  258. class="itemTitle-list"
  259. v-for="(item, index) in dictIdList"
  260. :key="index"
  261. >
  262. <span class="name">{{ item.dictName }}</span>
  263. <span class="del" @click="hanleFzDle(item)">{{
  264. $t("sys.delete")
  265. }}</span>
  266. </div>
  267. </div>
  268. </div>
  269. </el-form>
  270. <template #footer>
  271. <div class="dialog-footer">
  272. <el-button @click="dialogData.fzshow = false">{{
  273. $t("sys.cancel")
  274. }}</el-button>
  275. <el-button type="primary" @click="dialogData.fzshow = false">
  276. {{ $t("sys.enter") }}
  277. </el-button>
  278. </div>
  279. </template>
  280. </el-dialog>
  281. <!-- //查看资源下载 -->
  282. <el-dialog
  283. v-model="dialogDowm.show"
  284. :title="$t('sys.query')"
  285. :width="dialogDowm.type == 4 ? 800 : 600"
  286. @close="handleClose"
  287. >
  288. <div class="showContent">
  289. <img
  290. style="width: 100%; object-fit: cover"
  291. :src="dialogDowm.url"
  292. alt=""
  293. v-if="dialogDowm.type == 0"
  294. />
  295. <video
  296. ref="audio"
  297. controls
  298. style="width: 100%; max-height: 300px"
  299. :style="{ height: dialogDowm.type == 2 ? '50px' : 'auto' }"
  300. :src="dialogDowm.url"
  301. alt=""
  302. v-else-if="dialogDowm.type == 1 || dialogDowm.type == 2"
  303. />
  304. <iframe
  305. style="width: 100%; height: 400px"
  306. v-else
  307. :src="dialogDowm.url"
  308. frameborder="0"
  309. ></iframe>
  310. </div>
  311. <template #footer>
  312. <div class="dialog-footer">
  313. <el-button @click="dialogDowm.show = false">{{
  314. $t("sys.cancel")
  315. }}</el-button>
  316. <el-button
  317. v-if="dialogDowm.type == 0"
  318. type="primary"
  319. @click="hanleDown"
  320. >
  321. {{$t("sys.download")}}
  322. </el-button>
  323. </div>
  324. </template>
  325. </el-dialog>
  326. </div>
  327. </template>
  328. <script setup>
  329. import { Search } from "@element-plus/icons-vue";
  330. import { ref, watch, onMounted } from "vue";
  331. import {
  332. getByKeyList,
  333. getfzdel,
  334. getdictFiledel,
  335. getaddOrUpdate,
  336. setFileaddOrUpdate,
  337. uploadFile,
  338. getUrlSrc,
  339. } from "@/store/case";
  340. import dayjs from "dayjs";
  341. import obj from "@/assets/images/obj.jpg";
  342. import osgb from "@/assets/images/osgb.jpg";
  343. import { ElMessage, ElMessageBox, genFileId } from "element-plus";
  344. import { ui18n } from "@/i18n";
  345. import { windowOpen } from "@/util";
  346. import groupingSvg from "@/assets/images/grouping.svg";
  347. import { ElLoading } from "element-plus";
  348. // 定义 props
  349. const props = defineProps({
  350. columns: {
  351. type: Array,
  352. default: () => [],
  353. },
  354. searchColumns: {
  355. type: Array,
  356. default: () => [],
  357. },
  358. getData: {
  359. type: Function,
  360. required: true,
  361. },
  362. });
  363. // 定义响应式数据
  364. const searchForm = ref({
  365. name: "",
  366. fileType: 0,
  367. dictId: "0",
  368. });
  369. const addForm = ref({
  370. fileType: "",
  371. dictId: "",
  372. name: "",
  373. });
  374. const dialogDowm = ref({
  375. show: false,
  376. url: "",
  377. type: "",
  378. data: {},
  379. });
  380. const dialogData = ref({
  381. show: false,
  382. title: ui18n.t("sys.upload"),
  383. data: {},
  384. fzshow: false,
  385. fzName: "",
  386. fzList: [],
  387. });
  388. const upload = ref(null);
  389. const file = ref(null);
  390. const audio = ref(null);
  391. const loadingText = ref("0%");
  392. const accept = ".jpg,.png,.jpeg,.mp4,.wav,.mp3,.shp,.zip";
  393. const handleClose = () => {
  394. console.log("handleClose", audio.value);
  395. if (audio.value) {
  396. audio.value.pause();
  397. }
  398. };
  399. const hanleFzDle = (item) => {
  400. ElMessageBox.confirm(
  401. ui18n.t("mediaLibrary.tips.deltext"),
  402. ui18n.t("sys.dialogTitle"),
  403. {
  404. confirmButtonText: ui18n.t("sys.enter"),
  405. cancelButtonText: ui18n.t("sys.cancel"),
  406. }
  407. ).then(async () => {
  408. await getfzdel(item);
  409. dictIdList.value = dictIdList.value.filter((item1) => item1.id !== item.id);
  410. searchForm.value.dictId = "0";
  411. initData();
  412. ElMessage({
  413. type: "success",
  414. message: ui18n.t("mediaLibrary.tips.del"),
  415. });
  416. });
  417. console.log("upload", file);
  418. };
  419. const previewFile = (file) => {
  420. console.log("previewFile", file);
  421. };
  422. const handleEdit = (data) => {
  423. addForm.value.dictId = data.dictId;
  424. console.log("data", data, addForm.value);
  425. dialogData.value = {
  426. show: true,
  427. title: ui18n.t("mediaLibrary.setGrouping"),
  428. data,
  429. };
  430. };
  431. const removeFile = () => {
  432. return true;
  433. };
  434. const handleAdd = () => {
  435. fileList.value = [];
  436. addForm.value.dictId = "";
  437. dialogData.value.title = ui18n.t("sys.upload");
  438. setTimeout(() => {
  439. dialogData.value.show = true;
  440. }, 100);
  441. };
  442. const handlefzAdd = async () => {
  443. let params = {
  444. dictName: dialogData.value.fzName?.trim(),
  445. };
  446. if (!params.dictName) {
  447. return ElMessage.error(ui18n.t("mediaLibrary.tips.placeholderName"));
  448. }
  449. await getaddOrUpdate(params);
  450. ElMessage({
  451. type: "success",
  452. message: ui18n.t("mediaLibrary.tips.add"),
  453. });
  454. getFzlist();
  455. dialogData.value.fzName = "";
  456. };
  457. const handleAddfz = () => {
  458. dialogData.value.fzshow = true;
  459. };
  460. const handleuploadAdd = async () => {
  461. console.log("formData", dialogData.value.title);
  462. if (dialogData.value.title != ui18n.t("sys.upload")) {
  463. if (!addForm.value.dictId)
  464. return ElMessage.error(ui18n.t("mediaLibrary.tips.dictId"));
  465. await setFileaddOrUpdate({
  466. id: dialogData.value.data?.id,
  467. dictId: addForm.value.dictId,
  468. });
  469. initData();
  470. dialogData.value.show = false;
  471. dialogData.value.title = "";
  472. ElMessage({
  473. type: "success",
  474. message: ui18n.t("mediaLibrary.tips.operate"),
  475. });
  476. } else {
  477. const formData = new FormData();
  478. const file = fileList.value && fileList.value[0];
  479. if (!file) return ElMessage.error(ui18n.t("common.NoFilesSelected"));
  480. formData.append("file", file);
  481. formData.append("dictId", addForm.value.dictId);
  482. console.log(file, formData, "formData");
  483. const loading = ElLoading.service({
  484. lock: true,
  485. text: loadingText.value,
  486. background: "rgba(0, 0, 0, 0.7)",
  487. });
  488. uploadFile({ file, dictId: addForm.value.dictId }, (completeProgress) => {
  489. console.log("上传进度", completeProgress);
  490. // props.progress = completeProgress; //上传过程
  491. loadingText.value = completeProgress + "%";
  492. loading.setText(loadingText.value)
  493. }).then((res) => {
  494. loading.close();
  495. console.log("上传进度", res);
  496. if (res.data?.status == 1) {
  497. initData();
  498. dialogData.value.show = false;
  499. ElMessage({
  500. type: "success",
  501. message: ui18n.t("mediaLibrary.tips.uplooadSuccess"),
  502. });
  503. } else {
  504. ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadErr"));
  505. }
  506. });
  507. console.log(formData);
  508. }
  509. };
  510. // 定义方法
  511. const del = (row) => {
  512. console.log(file, "file");
  513. ElMessageBox.confirm(
  514. ui18n.t("mediaLibrary.tips.deltext"),
  515. ui18n.t("sys.dialogTitle"),
  516. {
  517. confirmButtonText: ui18n.t("sys.enter"),
  518. cancelButtonText: ui18n.t("sys.cancel"),
  519. }
  520. ).then(async () => {
  521. await getdictFiledel({ id: row.id });
  522. initData();
  523. ElMessage({
  524. type: "success",
  525. message: ui18n.t("mediaLibrary.tips.del"),
  526. });
  527. });
  528. };
  529. const allList = ref([
  530. { dictName: ui18n.t("mediaLibrary.fileType.0"), id: "0" },
  531. ]);
  532. const dictIdList = ref([]);
  533. const tableData = ref([]);
  534. const fileList = ref([]);
  535. const currentPage = ref(1);
  536. const pageSize = ref(10);
  537. const total = ref(0);
  538. onMounted(() => {
  539. // document.body.classList.toggle("dark-mode");
  540. });
  541. const getFzlist = () => {
  542. getByKeyList({}).then((res) => {
  543. console.log("getByKeyList", res);
  544. dictIdList.value = res;
  545. });
  546. };
  547. getFzlist();
  548. const submitClick = () => {
  549. console.log("submitClick", searchForm.value);
  550. currentPage.value = 1;
  551. initData();
  552. };
  553. const tableRowClassName = ({ row, rowIndex }) => {
  554. if (rowIndex === 1) {
  555. return "warning-row";
  556. } else if (rowIndex === 3) {
  557. return "success-row";
  558. }
  559. return "";
  560. };
  561. // 初始化数据
  562. const initData = async () => {
  563. const { list, totalCount } = await props.getData({
  564. ...searchForm.value,
  565. fileType:
  566. searchForm.value.fileType == 0 ? "" : searchForm.value.fileType - 1,
  567. dictId: searchForm.value.dictId == 0 ? "" : searchForm.value.dictId,
  568. pageNum: currentPage.value,
  569. pageSize: pageSize.value,
  570. });
  571. tableData.value = list.map((res) => {
  572. return {
  573. ...res,
  574. statusStr:
  575. res.status == -1
  576. ? ui18n.t("mediaLibrary.tips.uplooadErr")
  577. : res.status == 0
  578. ? ui18n.t("mediaLibrary.tips.uplooad")
  579. : ui18n.t("mediaLibrary.tips.uplooadSuccess"),
  580. createTime: dayjs(res.createTime).format("YYYY-MM-DD HH:mm:ss"),
  581. };
  582. });
  583. total.value = totalCount;
  584. };
  585. const floadileUrl = (record) => {
  586. dialogDowm.value.type = record.fileType;
  587. dialogDowm.value.data = record;
  588. if (record.fileType == 3) {
  589. // let url = `/code/index.html?title=${record.fileName}&type=${record.fileFormat}&fileUrl=${record.fileUrl}#/sign-model`;
  590. dialogDowm.value.url = getUrlSrc({ ...record, type: 101 });
  591. dialogDowm.value.show = true;
  592. // return windowOpen({url: dialogDowm.value.url, library: true});
  593. } else if (
  594. record.fileType == 2 ||
  595. record.fileType == 1 ||
  596. record.fileType == 0
  597. ) {
  598. dialogDowm.value.url = getUrlSrc({ type: 102 }) + "/" + record.fileUrl;
  599. dialogDowm.value.show = true;
  600. // return windowOpen({url: record.fileUrl, library: true});
  601. } else {
  602. hanleDown();
  603. }
  604. };
  605. const handleExceed = (files) => {
  606. const file = files[0];
  607. if (!beforeUpload(file)) {
  608. return false;
  609. }
  610. upload.value && upload.value.clearFiles();
  611. file.uid = genFileId();
  612. upload.value && upload.value.handleStart(file);
  613. };
  614. const beforeUpload = (file) => {
  615. console.log("beforeUpload", file);
  616. const filetype = file.name
  617. .substring(file.name.lastIndexOf(".") + 1)
  618. .toLowerCase();
  619. const isExcel = [
  620. "jpg",
  621. "jpg",
  622. "png",
  623. "jpeg",
  624. "mp4",
  625. "wav",
  626. "mp3",
  627. "shp",
  628. "zip",
  629. ].includes(filetype); // 调用上面代码
  630. if (!isExcel) {
  631. ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadfiletype"));
  632. fileList.value = [];
  633. return false;
  634. }
  635. const isLt10M = file.size / 1024 / 1024 < 2000;
  636. if (!isLt10M) {
  637. fileList.value = [];
  638. ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadSize"));
  639. return false;
  640. }
  641. fileList.value = [file];
  642. return true;
  643. };
  644. // 监听搜索表单变化
  645. watch(searchForm, () => {
  646. currentPage.value = 1;
  647. initData();
  648. });
  649. // 处理分页大小变化
  650. const handleSizeChange = (newSize) => {
  651. pageSize.value = newSize;
  652. initData();
  653. };
  654. // 处理当前页码变化
  655. const handleCurrentChange = (newPage) => {
  656. currentPage.value = newPage;
  657. initData();
  658. };
  659. // 下载资源
  660. const hanleDown = () => {
  661. const item = dialogDowm.value.data;
  662. const a = document.createElement("a");
  663. a.href = dialogDowm.value.url;
  664. a.download = `${item.name}.${item.fileFormat}`; // 下载后的文件名
  665. a.click();
  666. a.remove();
  667. };
  668. // 处理搜索按钮点击
  669. const handleSearch = () => {
  670. currentPage.value = 1;
  671. initData();
  672. };
  673. // 重置搜索表单
  674. const resetSearch = () => {
  675. Object.keys(searchForm.value).forEach((key) => {
  676. searchForm.value[key] = "";
  677. });
  678. currentPage.value = 1;
  679. initData();
  680. };
  681. // 初始化数据
  682. initData();
  683. </script>
  684. <style lang="scss">
  685. .upload-demo .el-upload-list__item.is-success:focus:not(:hover){
  686. display: none !important;
  687. }
  688. .mb-3 {
  689. margin-bottom: 1rem;
  690. }
  691. .mt-3 {
  692. margin-top: 1rem;
  693. }
  694. .mymediaLibrary {
  695. background-color: #292929;
  696. text-align: left;
  697. .grouping {
  698. padding: 7px 10px;
  699. background-color: var(--el-fill-color-blank);
  700. box-shadow: 0 0 0 1px var(--el-border-color);
  701. border-radius: 0 4px 4px 0;
  702. opacity: 0.7;
  703. cursor: pointer;
  704. &:hover {
  705. box-shadow: 0 0 0 1px #6c6e72;
  706. opacity: 1;
  707. }
  708. }
  709. .groupingSelcet {
  710. .el-select__wrapper {
  711. border-radius: 4px 0 0 4px;
  712. }
  713. }
  714. .el-form--inline .el-form-item {
  715. margin-right: 20px;
  716. }
  717. .itemTitle {
  718. width: 100%;
  719. margin: 0 0 10px 0;
  720. .itemTitleList {
  721. margin-top: 10px;
  722. background: rgba(255, 255, 255, 0.1);
  723. border-radius: 4px 4px 4px 4px;
  724. border: 1px solid rgba(255, 255, 255, 0.2);
  725. max-height: 240px;
  726. overflow-y: scroll;
  727. ::-webkit-scrollbar {
  728. display: none; /* Chrome Safari */
  729. }
  730. }
  731. .itemTitle-list {
  732. padding-left: 10px;
  733. line-height: 34px;
  734. display: flex;
  735. justify-content: space-between;
  736. position: relative;
  737. cursor: pointer;
  738. .name {
  739. width: 350px;
  740. overflow: hidden; //超出的文本隐藏
  741. text-overflow: ellipsis; //溢出用省略号显示
  742. white-space: nowrap; //溢出不换行
  743. }
  744. .del {
  745. color: #FA3D47;
  746. // width: 40px;
  747. cursor: pointer;
  748. }
  749. }
  750. }
  751. }
  752. .showContent {
  753. iframe {
  754. body:-webkit-full-page-media {
  755. background-color: none;
  756. }
  757. }
  758. }
  759. .el-pager li.is-active {
  760. border: 1px solid var(--el-color-primary);
  761. background-color: none;
  762. }
  763. </style>