多媒体信息发布平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

713 lines
25 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="app-container theme_main">
  3. <!-- 右上角btn -->
  4. <div class="home_publish_btn">
  5. <el-button round class="el_button_green" @click="addEditClassify(0)">新增</el-button>
  6. <el-button round type="primary" @click="addEditClassify(1)">编辑</el-button>
  7. <el-button round class="el_button_red" @click="uploadTheme()">上传</el-button>
  8. </div>
  9. <div style="position:relative">
  10. <!-- 主题库list -->
  11. <ThemeGalleryList
  12. ref="ThemeGalleryList"
  13. :is-multi-selected="isMultiSelected"
  14. :mulit-text="mulitText"
  15. :show-item-info="showItemInfo"
  16. :tab-item="tabItem"
  17. :is-my-album="isMyAlbum"
  18. @pf="parent"
  19. @changedMultiSelected="changedMultiSelected"
  20. />
  21. <MyAlbum v-show="isMyAlbum" ref="MyAlbum" :is-multi-selected="isMultiSelected" />
  22. <div class="material_btn">
  23. <el-button round type="primary" @click="uploadHistoryVisible=true">上传历史</el-button>
  24. <el-button round @click="multiSelectBtn">{{ mulitText }}</el-button>
  25. </div>
  26. </div>
  27. <!-- 平台技术人员-新增/编辑分类 -->
  28. <div class="upload_layer">
  29. <el-dialog append-to-body :show-close="false" :visible.sync="addDialogVisible" :close-on-click-modal="false" :title="layerTitle" width="620px">
  30. <el-form ref="classifyForm" inline :model="classifyForm" size="small" label-width="80px">
  31. <el-form-item
  32. v-if="isAddEdit==0"
  33. label="类别名称"
  34. prop="class_name"
  35. :rules="[
  36. { required: true, message: '请输入类别名称', trigger: 'blur' }
  37. ]"
  38. >
  39. <el-input v-model="classifyForm.class_name" style="width: 360px;" />
  40. </el-form-item>
  41. <el-form-item
  42. v-else
  43. label="类别名称"
  44. prop="class_name"
  45. :rules="[
  46. { required: true, message: '请选择类别名称', trigger: 'change' }
  47. ]"
  48. >
  49. <el-select v-model="classifyForm.class_name" placeholder="请选择" value-key="class_name" style="width: 360px;" @change="selectName">
  50. <el-option v-for="item in tabItem" :key="item.id" :label="item.class_name" :value="item" />
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item
  54. label="所属机构"
  55. prop="searchClassify"
  56. >
  57. <el-select v-model="searchClassify" multiple placeholder="请选择" style="width: 360px;" @change="changeSelect">
  58. <el-option
  59. v-for="item in organOptions"
  60. :key="item.value"
  61. :label="item.label"
  62. :value="item.id"
  63. />
  64. </el-select>
  65. </el-form-item>
  66. </el-form>
  67. <div slot="footer" class="dialog-footer">
  68. <el-button type="primary" round @click="submitForm('classifyForm')"> </el-button>
  69. <el-button round @click="resetForm('classifyForm')"> </el-button>
  70. </div>
  71. </el-dialog>
  72. </div>
  73. <!-- 平台技术人员-上传 -->
  74. <el-dialog append-to-body :show-close="false" :visible.sync="uploadDialogVisible" :close-on-click-modal="false" :title="uploadTitle" class="upload_layer">
  75. <el-form ref="uploadForm" :model="uploadForm" size="small" label-width="80px">
  76. <el-form-item label="类别名称" prop="selectClassifyList">
  77. <el-checkbox-group v-model="selectClassifyList">
  78. <el-checkbox v-for="item in tabItem" :key="item.id" :label="item.id" :value="item.id">{{ item.class_name }}</el-checkbox>
  79. </el-checkbox-group>
  80. </el-form-item>
  81. <el-form-item label="设备方向" prop="device_direction">
  82. <el-radio-group v-model="uploadForm.device_direction">
  83. <el-radio :label="1" value="1">横屏</el-radio>
  84. <el-radio :label="2" value="2">竖屏</el-radio>
  85. </el-radio-group>
  86. </el-form-item>
  87. <el-form-item v-if="isUploadThemeType == 1" prop="material_name" label="文件名称">
  88. <el-input v-model="uploadForm.material_name" style="width:336px" />
  89. </el-form-item>
  90. <el-form-item class="upload_source" label="上传内容" prop="deposit_url">
  91. <div v-if="formatType != -1" class="source_cont">
  92. <img v-if="formatType==0" :src="uploadForm.deposit_url" alt="" width="150" />
  93. <video v-if="formatType==1" :src="uploadForm.deposit_url" controls width="200"></video>
  94. <audio v-if="formatType==2" :src="uploadForm.deposit_url" controls></audio>
  95. <!-- <p>文件名{{ fileNames }}</p> -->
  96. </div>
  97. <Upload ref="uploadMaterial" :is-theme="isTheme" @saveMaterial="saveMaterial" />
  98. </el-form-item>
  99. <el-form-item v-if="formatType != 0" label="添加封面" prop="img_path">
  100. <UploadCover ref="childUpload" />
  101. </el-form-item>
  102. </el-form>
  103. <div slot="footer" class="dialog-footer">
  104. <el-button type="primary" round @click="uploadSubmit()"> </el-button>
  105. <el-button round @click="resetForm('uploadForm')"> </el-button>
  106. </div>
  107. </el-dialog>
  108. <!-- 上传历史layer -->
  109. <div class="upload_layer">
  110. <el-dialog title="上传历史" :close-on-click-modal="false" :visible.sync="uploadHistoryVisible" width="1100px">
  111. <!-- 上传历史 - 搜索 -->
  112. <el-form ref="form" :model="queryForm" label-width="80px" class="query_history">
  113. <el-form-item label="文件名称">
  114. <el-input v-model="queryForm.name" style="width:200px" @keyup.enter.native="getThemeHistoryList(pager = 1)" @blur="getThemeHistoryList(pager = 1)" />
  115. </el-form-item>
  116. <el-form-item label="时间">
  117. <el-date-picker v-model="queryForm.date" type="daterange" value-format="yyyy-MM-dd" range-separator="" start-placeholder="开始日期" end-placeholder="结束日期" @change="getThemeHistoryList(pager = 1)" @blur="getThemeHistoryList(pager = 1)" />
  118. </el-form-item>
  119. </el-form>
  120. <!-- 上传历史 - table-list -->
  121. <el-table :data="uploadHistoryListData" :header-cell-style="{ color: '#333' }">
  122. <el-table-column align="center" prop="material_name" label="文件名称" />
  123. <el-table-column align="center" prop="cover" label="发布内容">
  124. <template slot-scope="scope">
  125. <div v-if="scope.row.img_path">
  126. <img width="48px" height="64px" size="medium" :src="scope.row.img_path" />
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="center" prop="classes" label="类别名称" width="180">
  131. <template slot-scope="scope">
  132. <div class="tag_list">
  133. <el-tag v-for="tag in scope.row.classes.split(',')" :key="tag" type="primary">{{ tag }}</el-tag>
  134. </div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="center" prop="device_direction" label="设备方向">
  138. <template slot-scope="scope">
  139. {{ scope.row.device_direction==2 ? "竖屏" : "横屏" }}
  140. </template>
  141. </el-table-column>
  142. <!-- <el-table-column align="center" prop="agency" label="所属机构" /> -->
  143. <el-table-column align="center" prop="create_time" label="上传时间" width="150">
  144. <template slot-scope="{row}">
  145. <div>{{ row.create_time | parseTime }}</div>
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="center" prop="create_by" label="发布人" />
  149. <el-table-column align="center" prop="handle" label="操作">
  150. <template slot-scope="scope">
  151. <el-button type="primary" round class="edit_btn" @click="editUploadTheme(scope.row)">编辑</el-button>
  152. <el-button type="primary" round :class="['start_btn', { stop_btn: scope.row.is_state == 1 }]" @click="isStopHandle(scope.row)">{{ scope.row.is_state == 1 ? "停用" : "恢复" }}</el-button>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <!-- 分页器 -->
  157. <el-pagination style="margin-top: 20px;" background :current-page="page" :total="total" :page-size="size" :pager-count="5" :page-sizes="[3, 5, 10]" layout="prev, pager, next, jumper,->,sizes,total" @current-change="getThemeHistoryList" @size-change="handleSizeChange" />
  158. </el-dialog>
  159. </div>
  160. </div>
  161. </template>
  162. <script>
  163. import { FetchAddOrEdit, FetchThemeHistoryList, FetchUpdateThemeState, FetchFindThemeClassDetails } from '@/api/theme/theme.js'
  164. import { saveMaterial } from '@/api/material/material'
  165. import ThemeGalleryList from '../components/ThemeGalleryList'
  166. import MyAlbum from '../components/MyAlbum'
  167. import Upload from '../components/upload'
  168. import UploadCover from '../components/upload_cover'
  169. import { parseTime } from '@/utils/index.js'
  170. export default {
  171. name: 'ThemeGallery',
  172. components: { ThemeGalleryList, MyAlbum, UploadCover, Upload },
  173. filters: {
  174. parseTime(time, cFormat) {
  175. return parseTime(time, cFormat)
  176. }
  177. },
  178. data() {
  179. return {
  180. isMyAlbum: false,
  181. isTheme: true,
  182. orga_id: '133221333123111', // 机构ID
  183. addDialogVisible: false, // 新增编辑-分类弹框
  184. layerTitle: '新增',
  185. isAddEdit: 0, // 判断分类菜单是新增还是编辑
  186. classifyForm: { // 主题库分类菜单form
  187. class_name: '',
  188. is_all: false,
  189. id: '',
  190. orga_ids: []
  191. },
  192. tabItem: [], // 分类菜单data
  193. isAllSelect: [],
  194. searchClassify: [], // 机构选择多选操作
  195. oldSearchClassify: [],
  196. organOptions: [ // 机构list-data
  197. {
  198. label: '全部',
  199. value: 'ALL_SELECT',
  200. id: 'ALL_SELECT'
  201. },
  202. {
  203. label: '武汉图书馆',
  204. value: '01',
  205. id: '133221333123111'
  206. }
  207. ],
  208. mulitText: '多选', // 主题库list - 多选操作
  209. isMultiSelected: false,
  210. showItemInfo: true, // 判断是否显示画册
  211. uploadDialogVisible: false, // 上传主题内容 - 弹框
  212. uploadHistoryVisible: false, // 上传主题历史 - 弹框
  213. uploadTitle: '上传', // 上传-弹框内
  214. isUploadThemeType: 0, // 判断上传-新增还是编辑
  215. uploadForm: { // 上传素材
  216. class_ids: [
  217. // 素材类id集合
  218. ],
  219. deposit_url: null, // 素材存放路径
  220. device_direction: null, // 横竖屏 1.横屏 2.竖屏,
  221. duration: null, // 时长s
  222. material_id: null,
  223. folder_id: null, // 文件夹id
  224. img_path: null, // 封面图片id
  225. material_name: null, // 素材名称
  226. material_type: null, // 素材类别
  227. file_size: null, // 文件大小
  228. orga_id: null, // 机构id
  229. store_type: null // 库类型 1.素材库 2.主题库
  230. },
  231. fileNames: '',
  232. formatType: -1,
  233. materialImgPath: null,
  234. materialDuration: null,
  235. selectClassifyList: [],
  236. queryForm: { // 历史list - 搜索
  237. name: '',
  238. date: []
  239. },
  240. uploadHistoryListData: [], // 上传历史list
  241. isEditTheme: false,
  242. page: 1,
  243. size: 10,
  244. total: 0,
  245. selectContVisible: true
  246. }
  247. },
  248. watch: {
  249. },
  250. mounted() {
  251. // 上传历史list
  252. this.getThemeHistoryList()
  253. },
  254. methods: {
  255. parent() {
  256. this.isMyAlbum = this.$refs.ThemeGalleryList.themeItemActive == 2
  257. console.log(this.$refs.ThemeGalleryList.themeItemActive)
  258. this.$refs.MyAlbum.selectInFolderid = []
  259. this.$refs.MyAlbum.getMyAlbum()
  260. },
  261. // 机构选择 全选 / 多选
  262. changeSelect(val) {
  263. const allValues = []
  264. // 保留所有值
  265. for (const item of this.organOptions) {
  266. allValues.push(item.id)
  267. }
  268. // 用来储存上一次的值,可以进行对比
  269. const oldVal = this.oldSearchClassify.length === 1 ? this.oldSearchClassify[0] : []
  270. // 若是全部选择
  271. if (val.includes('ALL_SELECT')) this.searchClassify = allValues
  272. // 取消全部选中 上次有 当前没有 表示取消全选
  273. if (oldVal.includes('ALL_SELECT') && !val.includes('ALL_SELECT')) this.searchClassify = []
  274. // 点击非全部选中 需要排除全部选中 以及 当前点击的选项
  275. // 新老数据都有全部选中
  276. if (oldVal.includes('ALL_SELECT') && val.includes('ALL_SELECT')) {
  277. const index = val.indexOf('ALL_SELECT')
  278. val.splice(index, 1) // 排除全选选项
  279. this.searchClassify = val
  280. }
  281. // 全选未选 但是其他选项全部选上 则全选选上 上次和当前 都没有全选
  282. if (!oldVal.includes('ALL_SELECT') && !val.includes('ALL_SELECT')) {
  283. if (val.length === allValues.length - 1) this.searchClassify = ['ALL_SELECT'].concat(val)
  284. }
  285. // 储存当前最后的结果 作为下次的老数据
  286. this.oldSearchClassify[0] = this.searchClassify
  287. },
  288. // 编辑分类 - 类型名称选择
  289. selectName(vId) {
  290. this.classifyForm.id = vId.id
  291. this.classifyForm.class_name = vId.class_name
  292. },
  293. // 主题库分类菜单 - 新增 / 编辑
  294. addEditClassify(index) {
  295. this.addDialogVisible = true
  296. if (index == 1) {
  297. this.layerTitle = '编辑'
  298. this.isAddEdit = 1
  299. this.tabItem = this.$refs.ThemeGalleryList.tabItem
  300. this.activeIndex = this.$refs.ThemeGalleryList.activeIndex
  301. this.classifyForm.class_name = this.tabItem[this.activeIndex].class_name
  302. this.classifyForm.id = this.tabItem[this.activeIndex].id
  303. // 利用这个,来判断是否机构全选
  304. this.isAllSelect = []
  305. for (const item of this.organOptions) {
  306. this.isAllSelect.push(item.id)
  307. }
  308. const params = {
  309. theme_class_id: this.classifyForm.id
  310. }
  311. FetchFindThemeClassDetails(params).then(res => {
  312. if (res.code == 200) {
  313. if (res.data.is_all) {
  314. this.searchClassify = this.isAllSelect
  315. } else {
  316. this.searchClassify.push(res.data.orgs)
  317. }
  318. }
  319. })
  320. } else {
  321. this.layerTitle = '新增'
  322. this.isAddEdit = 0
  323. this.classifyForm.id = null
  324. this.classifyForm.class_name = ''
  325. }
  326. },
  327. // 新增/编辑 - 分类菜单 - 提交
  328. submitForm(formName) {
  329. this.classifyForm.is_all = !!this.searchClassify.includes('ALL_SELECT')
  330. this.classifyForm.orga_ids = this.searchClassify.includes('ALL_SELECT') ? [] : this.searchClassify
  331. this.$refs[formName].validate((valid) => {
  332. if (valid) {
  333. if (this.searchClassify.length == 0) {
  334. this.$message.error('请选择所属机构!')
  335. return false
  336. }
  337. FetchAddOrEdit(this.classifyForm).then(res => {
  338. if (res.code == 200) {
  339. this.$message({
  340. type: 'success',
  341. message: this.classifyForm.id ? '编辑成功' : '新增成功'
  342. })
  343. this.addDialogVisible = false
  344. this.searchClassify = []
  345. this.$refs.ThemeGalleryList.getThemeClassList()
  346. }
  347. })
  348. } else {
  349. console.log('error submit!!')
  350. return false
  351. }
  352. })
  353. },
  354. // 表单 - 关闭btn
  355. resetForm(formName) {
  356. this.addDialogVisible = false
  357. this.uploadDialogVisible = false
  358. this.searchClassify = []
  359. // 上传表单重置
  360. this.selectClassifyList = []
  361. this.uploadForm.device_direction = 0
  362. this.uploadForm.deposit_url = null
  363. this.formatType = -1
  364. this.uploadForm.material_type = null
  365. this.uploadForm.img_path = null
  366. this.materialImgPath = null
  367. this.$nextTick(() => {
  368. if (this.$refs.uploadMaterial) {
  369. this.$refs.uploadMaterial.filePercent = 0
  370. }
  371. if (this.$refs.childUpload) {
  372. this.$refs.childUpload.imageUrl = null
  373. }
  374. })
  375. this.$refs[formName].resetFields()
  376. },
  377. // list - 多选btn
  378. multiSelectBtn() {
  379. this.isMultiSelected = !this.isMultiSelected
  380. if (this.isMultiSelected) {
  381. this.mulitText = '取消'
  382. } else {
  383. this.mulitText = '多选'
  384. }
  385. },
  386. // 新增 - 上传
  387. uploadTheme() {
  388. this.isEditTheme = false
  389. this.$nextTick(() => {
  390. this.tabItem = this.$refs.ThemeGalleryList.tabItem
  391. })
  392. this.uploadDialogVisible = true
  393. this.isUploadThemeType = 0
  394. this.uploadTitle = '新增'
  395. this.uploadForm.device_direction = 0
  396. },
  397. // 编辑 - 上传
  398. editUploadTheme(row) {
  399. this.isEditTheme = true
  400. this.uploadDialogVisible = true
  401. this.isUploadThemeType = 1
  402. this.uploadTitle = '编辑'
  403. this.$nextTick(() => {
  404. this.tabItem = this.$refs.ThemeGalleryList.tabItem
  405. const classifyListName = row.classes.split(',')
  406. if (classifyListName) {
  407. this.selectClassifyList = []
  408. this.tabItem.filter(item => {
  409. if (classifyListName.indexOf(item.class_name) != -1) {
  410. this.selectClassifyList.push(item.id)
  411. }
  412. })
  413. }
  414. })
  415. this.uploadForm.device_direction = row.device_direction
  416. this.uploadForm.material_name = row.material_name
  417. this.fileNames = row.material_name
  418. this.uploadForm.deposit_url = row.deposit_url
  419. this.formatType = row.material_type
  420. if (this.formatType != 0) {
  421. this.$nextTick(() => {
  422. if (this.$refs.childUpload) {
  423. this.$refs.childUpload.imageUrl = row.img_path
  424. }
  425. })
  426. } else {
  427. this.uploadForm.img_path = row.deposit_url
  428. }
  429. this.uploadForm.material_type = this.formatType
  430. this.uploadForm.duration = row.duration
  431. this.uploadForm.file_size = row.file_size
  432. this.uploadForm.material_id = row.material_id
  433. },
  434. // 素材上传完之后 - 获取相关info
  435. saveMaterial() {
  436. const formatType = this.$refs.uploadMaterial.formatType
  437. const uploadFileUrl = this.$refs.uploadMaterial.uploadFileUrl
  438. // 视频和音频的时长
  439. const duration = this.$refs.uploadMaterial.duration
  440. switch (formatType) {
  441. case 'image':
  442. this.formatType = 0
  443. this.materialImgPath = uploadFileUrl
  444. this.materialDuration = 0
  445. break
  446. case 'video':
  447. this.formatType = 1
  448. this.materialDuration = duration
  449. this.materialImgPath = null
  450. break
  451. case 'audio':
  452. this.formatType = 2
  453. this.materialDuration = duration
  454. this.materialImgPath = null
  455. break
  456. }
  457. this.uploadForm.deposit_url = uploadFileUrl
  458. this.fileNames = this.$refs.uploadMaterial.fileNames
  459. this.uploadForm.material_name = this.$refs.uploadMaterial.fileNames
  460. this.uploadForm.material_type = this.formatType
  461. this.uploadForm.file_size = this.$refs.uploadMaterial.fileSize
  462. this.uploadForm.img_path = this.materialImgPath
  463. this.uploadForm.duration = this.materialDuration
  464. },
  465. // 上传 - 提交btn
  466. uploadSubmit(formName) {
  467. if (this.isEditTheme) {
  468. this.$nextTick(() => {
  469. if (this.$refs.childUpload) {
  470. this.uploadForm.img_path = this.$refs.childUpload.imageUrl
  471. }
  472. })
  473. }
  474. this.uploadForm.class_ids = this.selectClassifyList
  475. if (this.uploadForm.class_ids.length == 0) {
  476. this.$message.error('请选择类别名称')
  477. return
  478. } else if (!this.uploadForm.device_direction) {
  479. this.$message.error('请选择设备方向')
  480. return
  481. } else if (!this.uploadForm.deposit_url) {
  482. this.$message.error('请上传资源内容')
  483. return
  484. } else if (!this.uploadForm.material_name) {
  485. this.$message.error('请输入文件名称')
  486. return
  487. }
  488. // this.uploadForm.orga_id = this.orga_id
  489. this.uploadForm.store_type = 2
  490. setTimeout(() => {
  491. saveMaterial(this.uploadForm).then(res => {
  492. if (res.code === 200) {
  493. this.$message({
  494. message: '上传素材成功',
  495. type: 'success'
  496. })
  497. this.uploadDialogVisible = false
  498. this.getThemeHistoryList()
  499. this.$refs.ThemeGalleryList.getThemeGallery()
  500. // 上传表单重置
  501. this.selectClassifyList = []
  502. this.uploadForm.device_direction = 0
  503. this.uploadForm.deposit_url = null
  504. this.formatType = -1
  505. this.uploadForm.material_type = null
  506. this.uploadForm.img_path = null
  507. this.materialImgPath = null
  508. this.$nextTick(() => {
  509. if (this.$refs.uploadMaterial) {
  510. this.$refs.uploadMaterial.filePercent = 0
  511. }
  512. if (this.$refs.childUpload) {
  513. this.$refs.childUpload.imageUrl = null
  514. }
  515. })
  516. this.$refs.uploadForm.resetFields()
  517. } else {
  518. this.$message.error(res.msg)
  519. }
  520. })
  521. }, 200)
  522. },
  523. // 上传历史list - 主题库
  524. getThemeHistoryList(pager = 1) {
  525. this.page = pager
  526. let start_time = ''
  527. let end_time = ''
  528. if (this.queryForm.date) {
  529. start_time = this.queryForm.date[0]
  530. end_time = this.queryForm.date[1]
  531. } else {
  532. start_time = end_time = null
  533. }
  534. const params = {
  535. theme_name: this.queryForm.name,
  536. theme_class: null,
  537. device_direction: null,
  538. orga_id: null,
  539. start_time: start_time,
  540. end_time: end_time,
  541. folder_id: null,
  542. page: this.page,
  543. size: this.size
  544. }
  545. FetchThemeHistoryList(params).then(res => {
  546. if (res.code === 200) {
  547. this.uploadHistoryListData = res.data.content
  548. this.total = res.data.totalElements
  549. } else {
  550. this.$message.error(res.msg)
  551. }
  552. })
  553. },
  554. // 每条显示数据改变时的事件
  555. handleSizeChange(size) {
  556. // 整理参数
  557. this.size = size
  558. this.getThemeHistoryList()
  559. },
  560. // 上传历史-停用/恢复
  561. isStopHandle(row) {
  562. row.is_state = row.is_state == 1 ? 2 : 1
  563. const params = {
  564. id: row.material_id,
  565. state: row.is_state
  566. }
  567. FetchUpdateThemeState(params).then(res => {
  568. if (res.code == 200) {
  569. this.$message.success(res.msg)
  570. this.getThemeHistoryList()
  571. } else {
  572. this.$message.error(res.msg)
  573. }
  574. })
  575. },
  576. // 有选择中的文件夹时,同时存在素材多选操作时,素材多选操作取消
  577. changedMultiSelected() {
  578. if (this.isMultiSelected) {
  579. this.isMultiSelected = false
  580. this.mulitText = '多选'
  581. }
  582. }
  583. }
  584. }
  585. </script>
  586. <style lang="scss" scoped>
  587. .theme_main {
  588. position: relative;
  589. padding: 0;
  590. background: none;
  591. ::v-deep .el-tabs {
  592. height: 55px;
  593. padding: 0 24px;
  594. margin-bottom: 24px;
  595. line-height: 55px;
  596. background: #fff;
  597. }
  598. ::v-deep .el-tabs__nav-wrap::after {
  599. display: none;
  600. }
  601. ::v-deep .el-tabs__active-bar {
  602. display: none;
  603. }
  604. ::v-deep .theme_item_tab {
  605. margin-bottom: 0;
  606. .el-tabs__header {
  607. margin-bottom: 0;
  608. border-bottom: 1px solid #eee;
  609. }
  610. }
  611. ::v-deep .theme_img {
  612. align-content: flex-start;
  613. height: calc(100vh - 246px);
  614. padding: 18px 24px 0 24px;
  615. overflow-y: auto;
  616. background: #fff;
  617. }
  618. .material_btn {
  619. top: 93px;
  620. }
  621. }
  622. .upload_layer {
  623. .query_history {
  624. display: flex;
  625. margin-top: -16px;
  626. }
  627. ::v-deep .el-dialog__body {
  628. .el-form-item__label {
  629. height: 30px;
  630. line-height: 30px;
  631. }
  632. .el-input__inner {
  633. height: 30px;
  634. line-height: 30px;
  635. }
  636. .el-range-separator {
  637. line-height: 26px;
  638. }
  639. .el-checkbox__label {
  640. line-height: 30px;
  641. }
  642. }
  643. }
  644. .upload_source {
  645. ::v-deep .el-form-item__content{
  646. display: flex;
  647. }
  648. .source_cont{
  649. margin-right: 20px;
  650. p{
  651. font-size: 12px;
  652. padding: 0 10px;
  653. line-height: 32px;
  654. }
  655. }
  656. video{
  657. display: block;
  658. }
  659. audio{
  660. display: block;
  661. }
  662. img{
  663. display: block;
  664. }
  665. }
  666. ::v-deep .components_upload{
  667. display: flex;
  668. flex-direction: column;
  669. justify-content: center;
  670. align-content: center;
  671. text-align: center;
  672. width: 128px;
  673. height: 120px;
  674. font-size: 14px;
  675. border: 1px dashed #dcdde3;
  676. background: #f2f7ff;
  677. border-radius: 6px;
  678. .cont_upload_btn{
  679. display: block;
  680. width: 100px;
  681. height: 34px;
  682. font-size: 14px;
  683. left: 50%;
  684. top: 14px;
  685. margin-left: -50px;
  686. }
  687. #upFile{
  688. margin: 0 auto;
  689. }
  690. .start_upload{
  691. display: block;
  692. width: 100px;
  693. height: 34px;
  694. color: #fff;
  695. text-align: center;
  696. border: none;
  697. background: linear-gradient(to right, #fc8c6f, #fa544e);
  698. border-radius: 34px;
  699. margin: 10px auto;
  700. }
  701. }
  702. .tag_list{
  703. ::v-deep .el-tag{
  704. margin: 0 5px 5px 0;
  705. }
  706. }
  707. </style>