myResources.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <template>
  2. <a-card>
  3. <!-- 标签页 -->
  4. <a-tabs v-model:activeKey="formState.verifyStatus" @change="tabChange">
  5. <a-tab-pane key="0" tab="未发布" v-if="!pageType"></a-tab-pane>
  6. <a-tab-pane key="1" tab="待审核"></a-tab-pane>
  7. <a-tab-pane key="2" tab="已发布" v-if="!pageType"></a-tab-pane>
  8. <!-- <a-tab-pane key="3" tab="已审核" v-if="pageType == 'economize'"></a-tab-pane> -->
  9. <a-tab-pane key="4" tab="回收站"></a-tab-pane>
  10. </a-tabs>
  11. <!-- 搜索和操作区域 -->
  12. <a-row :gutter="16" style="margin-bottom: 16px">
  13. <a-col :span="18">
  14. <a-input v-model:value="formState.fileName" placeholder="请输入资源名称" style="width: 200px" />
  15. <a-cascader
  16. style="width: 200px; margin-left: 8px"
  17. v-model:value="formState.majorIdName"
  18. :options="collegeMajorOptions"
  19. :fieldNames="{ label: 'name', value: 'parentId', children: 'children' }"
  20. placeholder="请选择院系"
  21. changeOnSelect
  22. @change="changeCollegeMajor"
  23. />
  24. <a-select
  25. v-model:value="formState.resourceTypeName"
  26. style="width: 200px; margin-left: 8px"
  27. :options="courseTypeOptions"
  28. placeholder="请选择资源类型"
  29. />
  30. <a-select v-model:value="formState.suffix" placeholder="请选择资源格式" style="width: 200px; margin-left: 8px">
  31. <a-select-option value="mp4">mp4</a-select-option>
  32. <a-select-option value="ppt">ppt</a-select-option>
  33. <a-select-option value="word">word</a-select-option>
  34. <a-select-option value="pdf">pdf</a-select-option>
  35. </a-select>
  36. <!-- <a-select
  37. v-model:value="formState.suffix"
  38. style="width: 200px; margin-left: 8px"
  39. :options="suffixTypeOptions"
  40. placeholder="请选择课件格式"
  41. /> -->
  42. <a-button type="primary" style="margin-left: 8px" @click="handleSearch">查询</a-button>
  43. <a-button style="margin-left: 8px" @click="handleReset">重置</a-button>
  44. </a-col>
  45. <a-col :span="6" style="text-align: right">
  46. <a-button
  47. type="primary"
  48. style="margin-right: 8px"
  49. v-if="formState.verifyStatus === '0'"
  50. @click="batchPublish"
  51. :disabled="selectedRowKeys.length === 0"
  52. >
  53. + 批量发布
  54. </a-button>
  55. <a-button type="primary" @click="showUploadModal">+ 上传资源</a-button>
  56. </a-col>
  57. </a-row>
  58. <!-- 表格 -->
  59. <a-table
  60. :columns="currentColumns"
  61. :data-source="dataSource"
  62. :pagination="false"
  63. :loading="loading"
  64. bordered
  65. :row-key="(record) => record.id"
  66. :row-selection="rowSelection"
  67. >
  68. <template #bodyCell="{ column, text, record }">
  69. <template
  70. v-if="
  71. ['fileName', 'collegeIdName', 'majorIdName', 'resourceTypeName', 'suffix', 'uploadTime'].includes(
  72. column.dataIndex
  73. )
  74. "
  75. >
  76. <div class="multiLine-ellipsis" :title="text">{{ text || '-' }}</div>
  77. </template>
  78. <!-- 状态列 -->
  79. <template v-if="column.key === 'verifyStatus'">
  80. <span v-if="record.verifyStatus === '0'">
  81. <a-badge status="processing" text="处理中" />
  82. </span>
  83. <span v-else-if="record.verifyStatus === 'uploaded'">
  84. <a-badge status="success" text="已上传" />
  85. </span>
  86. <span v-else-if="record.verifyStatus === '1'">
  87. <a-badge status="default" text="待审核" />
  88. </span>
  89. <span v-else-if="record.verifyStatus === '2'">
  90. <a-badge status="success" text="已发布" />
  91. </span>
  92. <span v-else-if="record.verifyStatus === '4'">
  93. <a-badge status="error" text="已删除" />
  94. </span>
  95. </template>
  96. <template v-if="column.dataIndex === 'fileUrl'">
  97. <!-- 动态图标 + 格式提示 -->
  98. <a-tooltip :title="`${record.suffix || '未知'}`">
  99. <component
  100. :is="fileTypeIcons[record.suffix?.toLowerCase()] || fileTypeIcons['*']"
  101. :style="{ fontSize: '24px', color: getIconColor(record.suffix) }"
  102. />
  103. </a-tooltip>
  104. </template>
  105. <!-- 操作列 -->
  106. <template v-else-if="column.key === 'action'">
  107. <div class="editable-cell">
  108. <a v-if="formState.verifyStatus === '0' && !pageType" @click="handlePublish(record)">发布</a>
  109. <a v-if="formState.verifyStatus === '1' && pageType == 'economize'" @click="handleAudit(record)">审核</a>
  110. <a v-if="formState.verifyStatus === '2' && pageType == 'economize'" @click="handlePermission(record)"
  111. >权限</a
  112. >
  113. <a v-if="formState.verifyStatus === '4'" @click="handleRestore(record)">恢复</a>
  114. <a-divider type="vertical" />
  115. <a-dropdown>
  116. <a class="ant-dropdown-link">
  117. 更多
  118. <DownOutlined />
  119. </a>
  120. <template #overlay>
  121. <a-menu>
  122. <a-menu-item>
  123. <a href="javascript:;" @click="handleView(record)">播放</a>
  124. </a-menu-item>
  125. <a-menu-item>
  126. <!-- <a href="javascript:;" @click="handleDownload(record)">下载</a> -->
  127. <a
  128. target="_blank"
  129. style="display: block; color: inherit"
  130. :href="$file.getDownloadFilePath3(record)"
  131. :download="record.fileName"
  132. >
  133. 下载
  134. </a>
  135. </a-menu-item>
  136. <a-menu-item v-if="formState.verifyStatus === '2'">
  137. <a href="javascript:;" @click="edit(record)">编辑</a>
  138. </a-menu-item>
  139. <a-menu-item>
  140. <a-popconfirm title="确认删除吗?" @confirm="resourcesDelete(record, 1)">
  141. <a href="javascript:;">删除</a>
  142. </a-popconfirm>
  143. </a-menu-item>
  144. </a-menu>
  145. </template>
  146. </a-dropdown>
  147. </div>
  148. </template>
  149. </template>
  150. </a-table>
  151. <div class="dis-flex-sb margin-top">
  152. <div>
  153. <a-button @click="selectAll">选择全部</a-button>
  154. <a-button @click="invertSelection" style="margin-left: 8px">反选选择</a-button>
  155. </div>
  156. <div>
  157. <CustomPagination
  158. :total="pagination.total"
  159. :current="pagination.pageNum"
  160. :pageSize="pagination.pageSize"
  161. :showQuickJumper="true"
  162. :showSizeChanger="true"
  163. :showTotal="(total) => `共 ${total} 条数据`"
  164. @change="handlePageChange"
  165. @showSizeChange="handlePageSizeChange"
  166. />
  167. </div>
  168. </div>
  169. <!-- 权限树模态框 -->
  170. <permissionTree v-if="permissionTreeVisible" @close="permissionTreeVisible = false"></permissionTree>
  171. <!-- 审核播放模态框 -->
  172. <auditModal
  173. v-if="auditModalVisible"
  174. :recordData="publishedData"
  175. :isAudit="auditState"
  176. @confirm="auditConfirm"
  177. @close="auditModalVisible = false"
  178. ></auditModal>
  179. <!-- 资源上传模态框 -->
  180. <resourceUpload
  181. v-if="uploadModalVisible"
  182. :isState="isState"
  183. :resourcesId="editResourcesId"
  184. @close="uploadModalVisible = false"
  185. @getList="getList"
  186. ></resourceUpload>
  187. <!-- 发布模态框 -->
  188. <releaseModal v-if="releaseVisible" @close="releaseVisible = false" @confirm="releaseConfirm"></releaseModal>
  189. </a-card>
  190. </template>
  191. <script setup>
  192. import { ref, onMounted } from 'vue'
  193. import { DownOutlined } from '@ant-design/icons-vue'
  194. import releaseModal from './releaseModal.vue'
  195. import resourceUpload from './resourceUpload.vue'
  196. import resourceAuditApi from '@/api/resourceAudit.js'
  197. import permissionTree from './permissionTree.vue'
  198. import auditModal from './auditModal.vue'
  199. import CustomPagination from '@/components/customPagination.vue'
  200. import tool from '@/utils/tool'
  201. import {
  202. FileOutlined,
  203. FileImageOutlined,
  204. FilePdfOutlined,
  205. FileWordOutlined,
  206. FileExcelOutlined,
  207. FilePptOutlined,
  208. FileTextOutlined,
  209. FileZipOutlined,
  210. PlaySquareOutlined
  211. } from '@ant-design/icons-vue'
  212. // eslint-disable-next-line vue/no-setup-props-destructure
  213. const { pageType } = defineProps({
  214. pageType: {
  215. type: String,
  216. default: () => {}
  217. }
  218. })
  219. const fileTypeIcons = {
  220. // 图片类
  221. jpg: 'FileImageOutlined',
  222. jpeg: 'FileImageOutlined',
  223. png: 'FileImageOutlined',
  224. gif: 'FileImageOutlined',
  225. // 文档类
  226. pdf: 'FilePdfOutlined',
  227. ppt: 'FilePptOutlined',
  228. pptx: 'FilePptOutlined',
  229. doc: 'FileWordOutlined',
  230. docx: 'FileWordOutlined',
  231. xls: 'FileExcelOutlined',
  232. xlsx: 'FileExcelOutlined',
  233. txt: 'FileTextOutlined',
  234. // 视频类
  235. mp4: 'PlaySquareOutlined',
  236. mov: 'PlaySquareOutlined',
  237. // 压缩包
  238. zip: 'FileZipOutlined',
  239. rar: 'FileZipOutlined',
  240. // 默认图标
  241. '*': 'FileOutlined'
  242. }
  243. // 数据源
  244. const dataSource = ref([])
  245. //发布按钮状态
  246. const releaseVisible = ref(false)
  247. const permissionTreeVisible = ref(false) //权限树
  248. const auditModalVisible = ref(false) //播放审核
  249. const isPublishBulk = ref(false) //是否批量发布
  250. const loading = ref(false) // 列表loading
  251. const isState = ref(0) //是否是编辑 0:新增 1:编辑
  252. const editResourcesId = ref(null) //资源id
  253. // 搜索值
  254. const searchValue = ref('')
  255. //课程类型
  256. const courseTypeOptions = tool.dictList('COURSE_TYPE')
  257. const suffixTypeOptions = ref([])
  258. const pagination = reactive({
  259. pageSize: 10,
  260. pageNum: 1,
  261. total: 0
  262. })
  263. const formState = reactive({
  264. fileName: null,
  265. verifyStatus: '0',
  266. resourcesId: null,
  267. majorIdName: null,
  268. resourceTypeName: null,
  269. suffix: null
  270. })
  271. // 添加选择状态
  272. const selectedRowKeys = ref([])
  273. const selectedRows = ref([])
  274. const publishedData = ref([]) //当前点击数据
  275. // 行选择配置
  276. const rowSelection = computed(() => {
  277. return {
  278. selectedRowKeys: selectedRowKeys.value,
  279. onChange: (keys, rows) => {
  280. selectedRowKeys.value = keys
  281. selectedRows.value = rows
  282. },
  283. onSelectAll: (selected, selectedRows, changeRows) => {
  284. if (selected) {
  285. // 全选当前页
  286. selectedRowKeys.value = dataSource.value.map((item) => item.id)
  287. selectedRows.value = dataSource.value
  288. } else {
  289. // 取消全选
  290. selectedRowKeys.value = []
  291. selectedRows.value = []
  292. }
  293. },
  294. onSelectInvert: () => {
  295. // 反选当前页
  296. const allKeys = dataSource.value.map((item) => item.id)
  297. const newSelectedKeys = allKeys.filter((key) => !selectedRowKeys.value.includes(key))
  298. selectedRowKeys.value = newSelectedKeys
  299. selectedRows.value = dataSource.value.filter((item) => newSelectedKeys.includes(item.id))
  300. }
  301. }
  302. })
  303. // 列定义
  304. const columnsUnpublished = [
  305. {
  306. title: '编号',
  307. align: 'center',
  308. dataIndex: 'fileId',
  309. key: 'fileId'
  310. },
  311. {
  312. title: '资源名称',
  313. align: 'center',
  314. dataIndex: 'fileName',
  315. key: 'fileName'
  316. },
  317. {
  318. title: '课件格式',
  319. align: 'center',
  320. dataIndex: 'suffix',
  321. key: 'suffix'
  322. },
  323. {
  324. title: '上传时间',
  325. dataIndex: 'uploadTime',
  326. align: 'center',
  327. key: 'uploadTime'
  328. },
  329. {
  330. title: '状态',
  331. align: 'center',
  332. key: 'verifyStatus'
  333. },
  334. {
  335. title: '资源缩略图',
  336. align: 'center',
  337. dataIndex: 'fileUrl',
  338. key: 'fileUrl'
  339. },
  340. {
  341. title: '操作',
  342. align: 'center',
  343. key: 'action'
  344. }
  345. ]
  346. const columnsPending = [
  347. {
  348. title: '编号',
  349. dataIndex: 'id',
  350. align: 'center',
  351. key: 'id'
  352. },
  353. {
  354. title: '资源名称',
  355. align: 'center',
  356. dataIndex: 'fileName',
  357. key: 'fileName'
  358. },
  359. {
  360. title: '所属院系',
  361. align: 'center',
  362. dataIndex: 'collegeAllIdName',
  363. key: 'collegeAllIdName'
  364. },
  365. // {
  366. // title: '所属课程',
  367. // align: 'center',
  368. // dataIndex: 'collegeIdName',
  369. // key: 'collegeIdName'
  370. // },
  371. // {
  372. // title: '所属专业',
  373. // align: 'center',
  374. // dataIndex: 'majorIdName',
  375. // key: 'majorIdName'
  376. // },
  377. {
  378. title: '资源类型',
  379. align: 'center',
  380. dataIndex: 'resourceTypeName',
  381. key: 'resourceTypeName'
  382. },
  383. {
  384. title: '资源格式',
  385. align: 'center',
  386. dataIndex: 'suffix',
  387. key: 'suffix'
  388. },
  389. {
  390. title: '上传时间',
  391. align: 'center',
  392. dataIndex: 'uploadTime',
  393. key: 'uploadTime'
  394. },
  395. {
  396. title: '状态',
  397. align: 'center',
  398. key: 'verifyStatus'
  399. },
  400. {
  401. title: '资源缩略图',
  402. align: 'center',
  403. dataIndex: 'fileUrl',
  404. key: 'fileUrl'
  405. },
  406. {
  407. title: '操作',
  408. align: 'center',
  409. key: 'action'
  410. }
  411. ]
  412. const columnsPublished = [...columnsPending]
  413. const columnsRecycle = [...columnsPending]
  414. const collegeMajorOptions = ref([])
  415. const currentColumns = computed(() => {
  416. switch (formState.verifyStatus) {
  417. case '0':
  418. return columnsUnpublished
  419. case '1':
  420. return columnsPending
  421. case '2':
  422. return columnsPublished
  423. case '3':
  424. return columnsPublished
  425. case '4':
  426. return columnsRecycle
  427. default:
  428. return []
  429. }
  430. })
  431. const getIconColor = (suffix) => {
  432. const type = suffix?.toLowerCase()
  433. if (['jpg', 'jpeg', 'png', 'gif'].includes(type)) return '#ff4d4f' // 图片红色
  434. if (['pdf'].includes(type)) return '#f5222d' // PDF红色
  435. if (['ppt', 'pptx'].includes(type)) return '#fa8c16' // PPT橙色
  436. if (['doc', 'docx'].includes(type)) return '#1890ff' // Word蓝色
  437. if (['xls', 'xlsx'].includes(type)) return '#52c41a' // Excel绿色
  438. return '#666' // 默认灰色
  439. }
  440. const getListData = () => {
  441. loading.value = true
  442. let params = {
  443. current: pagination.pageNum,
  444. size: pagination.pageSize,
  445. verifyStatus: formState.verifyStatus,
  446. fileName: formState.fileName,
  447. majorIdName: formState.majorIdName?.join(','),
  448. resourceTypeName: formState.resourceTypeName,
  449. suffix: formState.suffix
  450. }
  451. resourceAuditApi
  452. .page(params)
  453. .then((res) => {
  454. console.log(res, '资源审核列表')
  455. dataSource.value = res.data.records
  456. pagination.total = res.data.total
  457. loading.value = false
  458. })
  459. .catch((err) => {
  460. console.log(err)
  461. dataSource.value = []
  462. pagination.total = 0
  463. loading.value = false
  464. })
  465. }
  466. const getList = () => {
  467. getListData()
  468. uploadModalVisible.value = false
  469. }
  470. //院系组织查询
  471. const getOrgTreeSelector = () => {
  472. resourceAuditApi
  473. .orgTreeSelector()
  474. .then((res) => {
  475. console.log(res.data, '获取组织树选择器')
  476. collegeMajorOptions.value = res.data
  477. })
  478. .catch((err) => {
  479. console.log(err)
  480. })
  481. }
  482. // 方法
  483. const handleSearch = () => {
  484. console.log('Search:', searchValue.value)
  485. getListData()
  486. }
  487. const handleReset = () => {
  488. searchValue.value = null
  489. formState.majorIdName = null
  490. formState.fileName = null
  491. formState.resourceTypeName = null
  492. formState.suffix = null
  493. getListData()
  494. }
  495. const tabChange = () => {
  496. dataSource.value = []
  497. getListData()
  498. }
  499. //发布
  500. const handlePublish = (record) => {
  501. publishedData.value = record
  502. releaseVisible.value = true
  503. isPublishBulk.value = false
  504. }
  505. // 批量发布方法
  506. const batchPublish = () => {
  507. if (selectedRows.value.length === 0) {
  508. message.warning('请至少选择一条记录')
  509. return
  510. }
  511. isState.value = 0
  512. isPublishBulk.value = true
  513. releaseVisible.value = true
  514. }
  515. // 全选当前页数据
  516. const selectAll = () => {
  517. selectedRowKeys.value = dataSource.value.map((item) => item.id)
  518. selectedRows.value = dataSource.value
  519. }
  520. // 反选当前页数据
  521. const invertSelection = () => {
  522. const allKeys = dataSource.value.map((item) => item.id)
  523. const newSelectedKeys = allKeys.filter((key) => !selectedRowKeys.value.includes(key))
  524. selectedRowKeys.value = newSelectedKeys
  525. selectedRows.value = dataSource.value.filter((item) => newSelectedKeys.includes(item.id))
  526. }
  527. //发布确定
  528. const releaseConfirm = (obj) => {
  529. console.log(obj, selectedRows.value, '传回来的数据')
  530. releaseVisible.value = false
  531. if (isPublishBulk.value) {
  532. // const batchParams = selectedRows.value.map((item) => ({
  533. // id: item.id,
  534. // coverImage: item.coverImage,
  535. // resourceDesc: item.resourceDesc,
  536. // verifyStatus: 1
  537. // }))
  538. const params = {
  539. ids: selectedRows.value.map((item) => item.id).join(','),
  540. coverImage: obj.coverImageId,
  541. resourceDesc: obj.resourceDesc,
  542. verifyStatus: 1
  543. }
  544. console.log(params, '批量发布参数')
  545. // handleRelease(params)
  546. } else {
  547. const params = {
  548. ids: publishedData.value.id,
  549. coverImage: obj.coverImageId,
  550. resourceDesc: obj.resourceDesc,
  551. verifyStatus: 1
  552. }
  553. console.log(params, '发布参数')
  554. handleRelease(params)
  555. }
  556. }
  557. // updateStatus接口调用
  558. const handleRelease = (Params) => {
  559. resourceAuditApi
  560. .updateStatus(Params)
  561. .then((res) => {
  562. getListData()
  563. selectedRowKeys.value = []
  564. })
  565. .catch((err) => {
  566. console.error(err)
  567. })
  568. }
  569. const auditState = ref(null)
  570. const handleAudit = (record) => {
  571. console.log('Audit:', record)
  572. publishedData.value = record
  573. auditState.value = true
  574. auditModalVisible.value = true
  575. }
  576. const handleView = (record) => {
  577. publishedData.value = record
  578. auditState.value = false
  579. auditModalVisible.value = true
  580. }
  581. const handleDownload = (record) => {
  582. resourceAuditApi
  583. .downloadfile({
  584. userFileId: record.fileId,
  585. shareBatchNum: record.shareBatchNum == null ? '' : record.shareBatchNum,
  586. extractionCode: record.extractionCode == null ? '' : record.extractionCode,
  587. admin: true
  588. })
  589. .then((res) => {
  590. console.log('下载成功:', res)
  591. // 创建Blob对象
  592. const url = window.URL.createObjectURL(new Blob([res]))
  593. const link = document.createElement('a')
  594. link.href = url
  595. link.download = record.fileName || `file_${record.id}.${record.suffix}`
  596. document.body.appendChild(link)
  597. link.click()
  598. window.URL.revokeObjectURL(url)
  599. document.body.removeChild(link)
  600. })
  601. .catch((err) => {
  602. console.error(err)
  603. })
  604. }
  605. const handlePermission = (record) => {
  606. console.log('Permission:', record)
  607. permissionTreeVisible.value = true
  608. }
  609. const auditConfirm = (obj) => {
  610. console.log('auditConfirm:', obj)
  611. const params = {
  612. ids: obj.id,
  613. verifyStatus: obj.auditResult
  614. }
  615. resourceAuditApi
  616. .updateStatus(params)
  617. .then((res) => {
  618. if (res.code == 200) {
  619. auditModalVisible.value = false
  620. }
  621. getListData()
  622. })
  623. .catch((err) => {
  624. console.error(err)
  625. })
  626. }
  627. const handleDelete = (record) => {
  628. console.log('Delete:', record)
  629. }
  630. const handleRestore = (record) => {
  631. const params = {
  632. ids: record.id,
  633. verifyStatus: 0
  634. }
  635. resourceAuditApi
  636. .updateStatus(params)
  637. .then((res) => {
  638. getListData()
  639. })
  640. .catch((err) => {
  641. console.error(err)
  642. })
  643. }
  644. //资源编辑
  645. const edit = (record) => {
  646. console.log('Restore:', record)
  647. uploadModalVisible.value = true
  648. isState.value = 1
  649. editResourcesId.value = record.id
  650. }
  651. //资源删除
  652. const resourcesDelete = (record) => {
  653. const params = {
  654. ids: record.id,
  655. verifyStatus: 4
  656. }
  657. if (formState.verifyStatus == 4) {
  658. resourceAuditApi
  659. .deletefile(params)
  660. .then((res) => {
  661. getListData()
  662. })
  663. .catch((err) => {
  664. console.error(err)
  665. })
  666. } else {
  667. resourceAuditApi
  668. .updateStatus(params)
  669. .then((res) => {
  670. getListData()
  671. })
  672. .catch((err) => {
  673. console.error(err)
  674. })
  675. }
  676. }
  677. // 上传资源模态框
  678. const uploadModalVisible = ref(false)
  679. // 显示上传模态框
  680. const showUploadModal = () => {
  681. isState.value = 0
  682. uploadModalVisible.value = true
  683. }
  684. // 翻页
  685. const handlePageChange = (page) => {
  686. pagination.pageNum = page
  687. getListData()
  688. }
  689. // 每页条数
  690. const handlePageSizeChange = (pageNum, size) => {
  691. pagination.pageNum = 1
  692. pagination.pageSize = size
  693. getListData()
  694. }
  695. onMounted(() => {
  696. if (pageType == 'economize') {
  697. formState.verifyStatus = '1'
  698. }
  699. getOrgTreeSelector()
  700. getListData()
  701. })
  702. </script>
  703. <style scoped>
  704. .editable-cell {
  705. position: relative;
  706. }
  707. .ant-dropdown-link {
  708. margin-left: 8px;
  709. }
  710. .upload-area {
  711. border: 2px dashed #3ca9f5;
  712. padding: 40px;
  713. text-align: center;
  714. }
  715. .upload-area p {
  716. margin: 10px 0;
  717. }
  718. .file-item {
  719. display: flex;
  720. align-items: center;
  721. margin: 10px 0;
  722. }
  723. .file-item .ant-progress {
  724. flex: 1;
  725. margin: 0 10px;
  726. }
  727. </style>