This commit is contained in:
clay
2022-09-06 22:28:24 +08:00
parent 25e94c1117
commit 9d78b43963
7 changed files with 71 additions and 34 deletions

View File

@@ -48,6 +48,7 @@ const routes = [
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base:"/web",
routes routes
}) })

View File

@@ -1,17 +1,20 @@
<template> <template>
<div class="file_list" style="background-color:#fff; margin-top: 3rem;"> <div class="file_list" style="background-color:#fff; margin-top: 3rem;">
<div class="query"> <div class="query">
<el-row> <el-row>
<el-col :xs="14" :sm="14" :md="14" :lg="20" :xl="20"> <el-col :xs="14" :sm="14" :md="14" :lg="20" :xl="20">
<!--<div style="width: 95%;">--> <!--<div style="width: 95%;">-->
<div> <div>
<!--<input class="query_input" v-model="query"/>--> <!--<input class="query_input" v-model="query"/>-->
<el-input class="query_input" v-model="query" size="small" :placeholder="$t('message.placeholder')"></el-input> <el-input class="query_input" v-model="query" size="small"
:placeholder="$t('message.placeholder')"></el-input>
</div> </div>
</el-col> </el-col>
<el-col :xs="10" :sm="10" :md="10" :lg="4" :xl="4" style="float: right"> <el-col :xs="10" :sm="10" :md="10" :lg="4" :xl="4" style="float: right">
<el-button class="query_button" type="primary" size="small" icon="el-icon-search" @click="handleCurrentChange(-1)"> <el-button class="query_button" type="primary" size="small" icon="el-icon-search"
{{ $t('message.search') }}</el-button> @click="handleCurrentChange(-1)">
{{ $t('message.search') }}
</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@@ -45,8 +48,9 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="value.pageNum" :current-page.sync="value.pageNum"
:page-size="4" :page-sizes="[10,20, 30, 50, 100]"
layout="prev, pager, next, jumper" :page-size="value.pageSize"
layout="prev, pager,next,sizes, jumper"
:total="value.total"> :total="value.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
@@ -65,6 +69,7 @@ export default {
default: { default: {
data: [{}], data: [{}],
pageNum: 1, pageNum: 1,
pageSize: 10,
}, },
}, },
}, },
@@ -78,10 +83,16 @@ export default {
methods: { methods: {
getDateTime(date) { getDateTime(date) {
let time = new Date(date); let time = new Date(date);
return time.getFullYear() + "-" + (time.getMonth()+1) + "-" + time.getDate(); return time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
}, },
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
if (val === -1) {
this.value.pageSize = 1
} else {
this.value.pageSize = val
}
this.getData()
}, },
downloadFile(file) { downloadFile(file) {
var filename = prompt(file.fileName); var filename = prompt(file.fileName);
@@ -91,16 +102,19 @@ export default {
a.click() a.click()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
if (val == -1) { if (val === -1) {
this.value.pageNum = 1 this.value.pageNum = 1
} else { } else {
this.value.pageNum = val this.value.pageNum = val
} }
this.getData()
},
getData() {
let data = { let data = {
title: this.query, title: this.query,
id: this.value.navId, id: this.value.navId,
pageNum: this.value.pageNum, pageNum: this.value.pageNum,
pageSize: 5 pageSize: this.value.pageSize,
} }
this.type = this.$route.query && this.$route.query.type this.type = this.$route.query && this.$route.query.type
if (this.type != null && this.type != 0) { if (this.type != null && this.type != 0) {

View File

@@ -59,8 +59,9 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="value.pageNum" :current-page.sync="value.pageNum"
:page-sizes="[5,10,20, 30, 50, 100]"
:page-size="4" :page-size="4"
layout="prev, pager, next, jumper" layout="prev, pager, next,sizes, jumper"
:total="value.total"> :total="value.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
@@ -78,8 +79,9 @@ export default {
value: { value: {
type: Object, type: Object,
default: { default: {
//生命周期初始化问题 data: [{}],
data: [] pageNum: 1,
pageSize: 5,
}, },
}, },
}, },
@@ -107,21 +109,30 @@ export default {
}, },
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
if (val === -1) {
this.value.pageSize = 1
} else {
this.value.pageSize = val
}
this.getData()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
if (val == -1) { if (val === -1) {
this.value.pageNum = 1 this.value.pageNum = 1
} else { } else {
this.value.pageNum = val this.value.pageNum = val
} }
this.getData()
},
getData(){
let data = { let data = {
title: this.query, title: this.query,
id: this.value.navId, id: this.value.navId,
pageNum: this.value.pageNum, pageNum: this.value.pageNum,
pageSize: 5 pageSize: this.value.pageSize
} }
this.type = this.$route.query && this.$route.query.type this.type = this.$route.query && this.$route.query.type
if (this.type != null && this.type != 0) { if (this.type != null && this.type !== 0) {
data.id = this.value.secondId data.id = this.value.secondId
} else { } else {
console.log(this.value); console.log(this.value);

View File

@@ -100,10 +100,10 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col> <el-col>
<Introduction :value="contextData" v-if="type == 1"/> <Introduction :value="contextData" v-if="type === 1"/>
<List :value="contextData" v-if="type == 2"/> <List :value="contextData" v-if="type === 2"/>
<FileList :value="contextData" v-if="type == 4"/> <FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type == 3"/> <DireData :value="contextData" v-if="type === 3"/>
<Details :value="detailsData" v-if="type == null"/> <Details :value="detailsData" v-if="type == null"/>
</el-col> </el-col>
</el-row> </el-row>
@@ -135,10 +135,10 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col> <el-col>
<Introduction :value="contextData" v-if="type == 1"/> <Introduction :value="contextData" v-if="type === 1"/>
<List :value="contextData" v-if="type == 2"/> <List :value="contextData" v-if="type === 2"/>
<FileList :value="contextData" v-if="type == 4"/> <FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type == 3"/> <DireData :value="contextData" v-if="type === 3"/>
<Details :value="detailsData" v-if="type == null"/> <Details :value="detailsData" v-if="type == null"/>
</el-col> </el-col>
</el-row> </el-row>
@@ -335,12 +335,15 @@ export default {
this.contextData = null this.contextData = null
this.bgImage = menu.link this.bgImage = menu.link
let data = null let data = null
if (this.type == 2 || this.type == 4) { if (this.type === 2 || this.type === 4) {
data = { data = {
id: menu.encodeId, id: menu.encodeId,
pageNum: 1, pageNum: 1,
pageSize: 5 pageSize: 5
} }
if (this.type === 4){
data.pageSize = 10
}
} else { } else {
data = { data = {
id: menu.encodeId, id: menu.encodeId,
@@ -349,7 +352,7 @@ export default {
getNode(data).then(res => { getNode(data).then(res => {
console.log(res, "res值") console.log(res, "res值")
console.log(this.type); console.log(this.type);
if (this.type == 2 || this.type == 4) { if (this.type === 2 || this.type === 4) {
this.contextData = { this.contextData = {
data: res.rows, data: res.rows,
total: res.total, total: res.total,

View File

@@ -32,10 +32,10 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col> <el-col>
<Introduction :value="contextData" v-if="type == 1"/> <Introduction :value="contextData" v-if="type === 1"/>
<List :value="contextData" v-if="type == 2"/> <List :value="contextData" v-if="type === 2"/>
<FileList :value="contextData" v-if="type == 4"/> <FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type == 3"/> <DireData :value="contextData" v-if="type === 3"/>
<Details :value="detailsData" v-if="type == null"/> <Details :value="detailsData" v-if="type == null"/>
</el-col> </el-col>
</el-row> </el-row>
@@ -166,19 +166,22 @@ export default {
this.contextData = null this.contextData = null
this.bgImage = menu.link this.bgImage = menu.link
let data = null let data = null
if (this.type == 2||this.type == 4) { if (this.type === 2||this.type === 4) {
data = { data = {
id: menu.encodeId, id: menu.encodeId,
pageNum: 1, pageNum: 1,
pageSize: 5 pageSize: 5
} }
if (this.type === 4){
data.pageSize=10
}
} else { } else {
data = { data = {
id: menu.encodeId, id: menu.encodeId,
} }
} }
getNode(data).then(res => { getNode(data).then(res => {
if (this.type == 2||this.type == 4) { if (this.type === 2||this.type === 4) {
this.contextData = { this.contextData = {
data: res.rows, data: res.rows,
total: res.total, total: res.total,

View File

@@ -3,7 +3,11 @@
<script> <script>
export default { export default {
created() { created() {
this.$router.push("/home?lang="+sessionStorage.getItem("lang")); let path = this.$route.path;
console.log(path)
if (!path.indexOf("attached")||path==="/"){
this.$router.push("/home?lang="+sessionStorage.getItem("lang"));
}
} }
} }
</script> </script>

View File

@@ -16,8 +16,9 @@ const port = process.env.port || process.env.npm_config_port || 80 // 端口
module.exports = { module.exports = {
// 部署生产环境和开发环境下的URL。 // 部署生产环境和开发环境下的URL。
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.hchyun.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.hchyun.com/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.hchyun.cn/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.hchyun.com/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/", // publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
publicPath: "/web",
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist // 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: 'dist', outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)