diff --git a/src/renderer/src/views/prepare/container/file-list-item.vue b/src/renderer/src/views/prepare/container/file-list-item.vue index 51a98f2..849d7f0 100644 --- a/src/renderer/src/views/prepare/container/file-list-item.vue +++ b/src/renderer/src/views/prepare/container/file-list-item.vue @@ -6,36 +6,53 @@
- {{ item.fileShowName }} +
+
+ {{ item.fileShowName }} +
+ + + + + {{ item.async === true ? '已同步' : '' }} + {{ !item.async ? '待同步' : '' }} + {{ item.async === 'on' ? '同步中' : '' }} +
-
{{ formatFileSize(item.fileSize) }}
+
{{ formatFileSize(item.fileSize) }}
-
{{ toTimeText(item.uploadTime, true) }}
+
+ {{ toTimeText(item.uploadTime, true) }} +
- - +
+ +
    -
  • +
  • - +
    -
    {{ item.fileShowName }}
    +
    +
    +
    + {{ item.fileShowName }} +
    +
    {{ item.fileFlag }} {{ getFileSuffix(item.fileShowName) }} @@ -18,10 +36,16 @@
    - + - 备课 + 备课
-
- +
-
@@ -69,17 +102,17 @@ import useUserStore from '@/store/modules/user' import useResoureStore from '../store' const { ipcRenderer } = window.electron || {} -const userstore = useUserStore() +const userstore = useUserStore() const sourceStore = useResoureStore() const userInfo = userstore.user // 分页change -const handleSizeChange = (limit) => { +const handleSizeChange = (limit) => { sourceStore.query.pageSize = limit sourceStore.handleQuery() } -const handleCurrentChange = (page) => { +const handleCurrentChange = (page) => { sourceStore.query.pageNum = page sourceStore.handleQuery() } @@ -108,7 +141,7 @@ const editRow = (item) => { } }) }) - .catch(() => { }) + .catch(() => {}) } // 删除 const delRow = (item) => { @@ -128,7 +161,7 @@ const addLesson = ({ id }) => { let data = { id, fileRoot: '备课', - ...(toRaw(sourceStore.nodeData)), + ...toRaw(sourceStore.nodeData) } // 过滤空值 for (let key in data) { @@ -136,19 +169,18 @@ const addLesson = ({ id }) => { delete data[key] } } - + try { sourceStore.loading = true addFileToPrepare(data).then(() => { ElMessage.success('操作成功') }) - } - finally { + } finally { sourceStore.loading = false } } -// -const handleRow = () =>{ +// +const handleRow = () => { ElMessage.warning('请先加入备课,在备课里面进行预览!') } @@ -181,6 +213,10 @@ const handleRow = () =>{ } .resource-list { + flex: 1; + display: flex; + flex-direction: column; + overflow: auto; .list-item { flex: 1; padding: 10px 20px; @@ -189,10 +225,13 @@ const handleRow = () =>{ justify-content: space-between; align-items: center; cursor: pointer; - + &:hover { + background-color: rgba(144, 147, 153, 0.2); + cursor: pointer; + } .item-left { align-items: center; - + flex: 1; .icon { font-size: 50px; } @@ -200,12 +239,14 @@ const handleRow = () =>{ .item-left-content { margin-left: 10px; flex-direction: column; + flex: 1; + text-align: left; } .name { font-size: 14px; color: #3b3b3b; - margin-bottom: 10px + margin-bottom: 10px; } .line { @@ -226,7 +267,6 @@ const handleRow = () =>{ color: #909399; font-size: 13px; } - } &:last-child { @@ -258,15 +298,13 @@ const handleRow = () =>{ margin-right: 3px; font-weight: bold; } - } - } .pagination-box { - margin-top: 20px; display: flex; justify-content: center; + height: 65px; } } - \ No newline at end of file + diff --git a/src/renderer/src/views/resource/index.vue b/src/renderer/src/views/resource/index.vue index d4565dd..4f66881 100644 --- a/src/renderer/src/views/resource/index.vue +++ b/src/renderer/src/views/resource/index.vue @@ -1,21 +1,28 @@ @@ -40,7 +47,7 @@ onMounted(async () => { // const res = await ipcMsgSend('tool-sphere:create', params) // console.log('消息返回:', res) }) -const testClick = async() => { +const testClick = async () => { const win = await createWindow('tool-sphere', { url: '/tool/sphere' }) console.log('消息返回:', win) } @@ -48,12 +55,11 @@ const testClick = async() => { const getData = (data) => { const { textBook, node } = data let textbookId = textBook.curBookId - let levelSecondId = node.id + let levelSecondId = node.id let levelFirstId - if(node.parentNode){ - levelFirstId = node.parentNode.id - } - else{ + if (node.parentNode) { + levelFirstId = node.parentNode.id + } else { levelFirstId = node.id levelSecondId = '' } @@ -63,7 +69,7 @@ const getData = (data) => { sourceStore.nodeData = { textbookId, levelFirstId, - levelSecondId, + levelSecondId } sourceStore.handleQuery() } @@ -73,7 +79,7 @@ const submitFile = (data) => { let fileList = toRaw(data) const { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot } = sourceStore.query // 给每个文件添加属性 - fileList.forEach(item => { + fileList.forEach((item) => { let fileData = { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot } fileData.fileShowName = item.fileData.fileShowName fileData.fileFlag = item.fileData.fileFlag @@ -83,17 +89,15 @@ const submitFile = (data) => { uploaderState().pushFile(fileList) } - const fileCallBack = (res) => { if (res.code == 200) { sourceStore.handleQuery() } } -onMounted(()=>{ +onMounted(() => { sourceStore.getCreate() }) -