Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zys-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
zys-ui
Commits
995c38bd
提交
995c38bd
authored
10月 07, 2023
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
第三方资源增加年份搜索
上级
1d660b24
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
125 行增加
和
110 行删除
+125
-110
file.js
src/libs/qiwen/globalFunction/file.js
+0
-62
index.vue
src/views/resource/components/searchBar/index.vue
+41
-8
index.vue
src/views/resource/components/table/index.vue
+22
-8
index.vue
src/views/resource/external/index.vue
+7
-3
index.vue
src/views/resource/internal/index.vue
+42
-6
index.vue
src/views/resource/sharedCommunity/index.vue
+13
-23
没有找到文件。
src/libs/qiwen/globalFunction/file.js
浏览文件 @
995c38bd
import
Vue
from
'vue'
import
router
from
'@/router/index'
import
qwConfig
from
'@/utils/qwConfig'
import
{
Message
}
from
'element-ui'
import
{
fileImgMap
,
...
...
@@ -86,67 +85,6 @@ const fileFunction = {
}
&shareBatchNum=
${
row
.
shareBatchNum
==
null
?
''
:
row
.
shareBatchNum
}
&extractionCode=
${
row
.
extractionCode
==
null
?
''
:
row
.
extractionCode
}
`
},
/**
* 获取 Onlyoffice 文件创建路径
* @param {object} row
* @returns {string} office 文件创建路径
*/
createFileOnlineByOffice
(
data
)
{
let
fileUrl
=
`
${
location
.
protocol
}
//
${
location
.
host
}${
process
.
env
.
VUE_APP_BASE_API
}
`
const
{
href
}
=
router
.
resolve
({
name
:
'Onlyoffice'
,
query
:
{
fileUrl
:
fileUrl
,
fileName
:
data
.
fileName
,
filePath
:
data
.
filePath
,
extendName
:
data
.
extendName
,
ot
:
'add'
}
})
window
.
open
(
href
,
'_blank'
)
},
/**
* 获取 Onlyoffice 文件在线预览路径
* @param {object} row
* @returns {string} office 文件在线预览路径
*/
getFileOnlineViewPathByOffice
(
row
)
{
let
userFileId
=
row
.
userFileId
const
{
href
}
=
router
.
resolve
({
name
:
'Onlyoffice'
,
query
:
{
userFileId
:
userFileId
,
ot
:
'detail'
}
})
window
.
open
(
href
,
'_blank'
)
},
/**
* 获取 Onlyoffice 文件在线编辑路径
* @param {object} row
* @returns {string} office 文件在线编辑路径
*/
getFileOnlineEditPathByOffice
(
row
)
{
let
userFileId
=
row
.
userFileId
const
{
href
}
=
router
.
resolve
({
name
:
'Onlyoffice'
,
query
:
{
userFileId
:
userFileId
,
ot
:
'edit'
}
})
window
.
open
(
href
,
'_blank'
)
},
/**
* 获取分享链接
* @param {string} shareBatchNum
* @returns {string} 完整的分享链接
*/
getShareLink
(
shareBatchNum
)
{
return
`
${
location
.
protocol
}
//
${
location
.
host
}
/share/
${
shareBatchNum
}
`
},
/**
* 复制分享链接
* @param {string} shareBatchNum
...
...
src/views/resource/components/searchBar/index.vue
浏览文件 @
995c38bd
...
...
@@ -21,31 +21,60 @@
>
搜索
</el-button>
</div>
<div
class=
"years"
>
年份:
<el-radio-group
v-model=
"currentYear"
>
<el-radio
v-for=
"(item, index) in years"
:key=
"index"
:label=
"item"
></el-radio>
</el-radio-group>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
hasType
:
{
type
:
Boolean
,
default
:
true
,
},
},
data
()
{
return
{
leftTabActiveName
:
"按类别"
,
tabs
:
[
"报纸"
,
"论文"
,
"会议"
,
"期刊"
],
years
:
[
"全部"
,
"2020"
,
"2019"
,
"2018"
,
"2017"
,
"2016"
,
"2015"
,
"2014"
,
"2013"
,
"2012"
,
],
activeTab
:
"报纸"
,
keyword
:
""
,
currentYear
:
"全部"
,
};
},
watch
:
{
currentYear
(
value
)
{
this
.
$emit
(
"search"
);
},
},
methods
:
{
handleClickTab
(
item
)
{
this
.
activeTab
=
item
;
this
.
handleSearch
();
},
handleSearch
()
{
const
{
keyword
}
=
this
;
const
params
=
{
keyword
,
// pageNo: 1,
// pageCount: 10,
};
this
.
$emit
(
"search"
,
params
);
this
.
$emit
(
"search"
);
},
},
};
...
...
@@ -56,7 +85,6 @@ export default {
background-color
:
#fff
;
padding
:
20px
;
border-radius
:
8px
;
.tab
{
display
:
flex
;
margin-bottom
:
20px
;
...
...
@@ -102,5 +130,10 @@ export default {
}
}
}
.years
{
display
:
flex
;
align-items
:
center
;
padding
:
20px
10px
10px
;
}
}
</
style
>
src/views/resource/components/table/index.vue
浏览文件 @
995c38bd
...
...
@@ -17,10 +17,6 @@
@
click
.
native=
"handleMultiDownload"
>
批量下载
</el-button
>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</div>
<el-table
v-loading=
"loading"
...
...
@@ -54,6 +50,12 @@
show-overflow-tooltip
>
</el-table-column>
<el-table-column
show-overflow-tooltip
label=
"年份"
prop=
"year"
align=
"center"
/>
<el-table-column
show-overflow-tooltip
label=
"机构"
...
...
@@ -95,8 +97,8 @@
target=
"_blank"
type=
"primary"
icon=
"el-icon-download"
:href=
"
$file.
getDownloadFilePath(scope.row)"
:download=
"
scope.row.fileName + '.' + scope.row.extendName
"
:href=
"getDownloadFilePath(scope.row)"
:download=
"
getDownloadFileName(scope.row)
"
>
下载
</el-link>
...
...
@@ -187,6 +189,18 @@ export default {
this
.
$file
.
handleFileNameClickNew
(
file
);
},
// 获取下载地址
getDownloadFilePath
(
file
)
{
return
file
.
weburl
;
},
// 获取下载文件名
getDownloadFileName
(
file
)
{
const
{
name
,
weburl
}
=
file
;
const
suffix
=
weburl
.
split
(
"."
)[
1
];
return
name
+
"."
+
suffix
;
},
// 点击收藏
async
handleCollect
(
file
)
{
let
request
;
...
...
@@ -209,8 +223,8 @@ export default {
extendName
,
filePath
:
"/我的收藏"
,
userId
:
this
.
$store
.
getters
.
userInfo
.
userId
,
//以下字段必填但可为空
deleteFlag
:
null
,
//以下字段
timeStampName
:
null
,
storageType
:
null
,
pointCount
:
null
,
...
...
@@ -243,7 +257,7 @@ export default {
align-items
:
center
;
}
.table
{
margin
:
40px
0
20px
;
margin
:
0
0
20px
;
padding
:
20px
;
background-color
:
#fff
;
border-radius
:
4px
;
...
...
src/views/resource/external/index.vue
浏览文件 @
995c38bd
...
...
@@ -33,17 +33,20 @@ export default {
methods
:
{
async
loadData
()
{
this
.
loading
=
true
;
const
{
activeTab
,
keyword
}
=
this
.
$refs
.
SearchBar
;
const
{
activeTab
,
keyword
,
currentYear
}
=
this
.
$refs
.
SearchBar
;
const
{
pageNo
,
pageCount
}
=
this
.
$refs
.
Table
.
queryParams
;
const
params
=
{
keyword
,
pageNo
,
pageCount
,
year
:
currentYear
,
};
if
(
keyword
)
{
params
.
pageNo
=
1
;
}
console
.
log
(
params
);
if
(
params
.
year
==
"全部"
)
{
params
.
year
=
""
;
}
let
request
;
switch
(
activeTab
)
{
case
"报纸"
:
...
...
@@ -71,6 +74,7 @@ export default {
<
style
lang=
"scss"
scoped
>
.container
{
background-color
:
#f7f8fa
;
padding
:
20px
40px
;
padding
:
20px
;
box-shadow
:
rgba
(
99
,
99
,
99
,
0
.2
)
0px
2px
8px
0px
;
}
</
style
>
src/views/resource/internal/index.vue
浏览文件 @
995c38bd
<
template
>
<div
class=
"app-container container"
>
<SearchBar
@
search=
"handleRearch"
/>
<Table
/>
<div
class=
"search-input"
>
<el-input
placeholder=
"输入关键词搜索,马上在线阅读"
v-model=
"keyword"
clearable
@
keyup
.
native
.
enter=
"handleSearch"
></el-input>
<el-button
icon=
"el-icon-search"
type=
"primary"
@
click=
"handleSearch"
>
搜索
</el-button>
</div>
<Table
:list=
"list"
@
getList=
"loadData"
v-loading=
"loading"
/>
</div>
</
template
>
<
script
>
import
SearchBar
from
"../components/searchBar/index.vue"
;
import
Table
from
"../components/table/index.vue"
;
export
default
{
components
:
{
SearchBar
,
Table
,
},
data
()
{
return
{
keyword
:
""
,
list
:
{
records
:
[],
totalElements
:
0
,
pageCount
:
10
,
pageNo
:
1
,
},
loading
:
false
,
};
},
methods
:
{
handle
R
earch
(
keyword
)
{
console
.
log
(
"search"
,
keyword
);
handle
S
earch
(
keyword
)
{
console
.
log
(
"search"
,
keyword
);
},
loadData
()
{},
},
};
</
script
>
...
...
@@ -24,4 +45,19 @@ export default {
background-color
:
#f7f8fa
;
padding
:
20px
40px
;
}
.search-input
{
display
:
flex
;
background-color
:
#fff
;
padding
:
20px
;
border-radius
:
8px
;
.el-button
{
margin-left
:
20px
;
}
::v-deep
.el-input
{
input
{
background-color
:
#f7f8fa
;
border
:
none
;
}
}
}
</
style
>
src/views/resource/sharedCommunity/index.vue
浏览文件 @
995c38bd
...
...
@@ -248,7 +248,7 @@ export default {
this
.
$refs
[
"batchDownloadRef"
].
click
();
},
// 收藏
async
handleCollect
(
row
)
{
handleCollect
(
row
)
{
console
.
log
(
"点击收藏"
,
row
);
this
.
loading
=
true
;
const
{
extendName
,
fileName
}
=
row
;
...
...
@@ -265,29 +265,19 @@ export default {
extendName
,
filePath
,
fileName
,
// isTemplat
e,
// templateId: templateId[0] ||
"",
isTemplate
:
fals
e
,
templateId
:
""
,
};
let
res
=
await
newfile
(
params
);
this
.
loading
=
false
;
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"收藏成功!"
);
}
// newfile(params)
// .then((res) => {
// this.sureBtnLoading = false;
// if (res.code == 200) {
// this.$message.success("文件创建成功");
// this.$refs[formName].resetFields();
// this.visible = false;
// this.callback("confirm");
// } else {
// this.$message.warning(res.message);
// }
// })
// .catch(() => {
// this.sureBtnLoading = false;
// });
newfile
(
params
)
.
then
((
res
)
=>
{
this
.
loading
=
false
;
if
(
res
.
code
==
200
)
{
this
.
$message
.
success
(
"收藏成功!"
);
}
})
.
catch
(()
=>
{
this
.
loading
=
false
;
});
},
},
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论