Compare commits

...

3 Commits

  1. 213
      vue/afvue/src/assets/sfilecompare.css
  2. 76
      vue/afvue/src/components/NProgress/nprogress.less
  3. 0
      vue/afvue/src/components/index.less
  4. 145
      vue/afvue/src/views/Login.vue
  5. 274
      vue/afvue/src/views/Sfilecompare.vue

213
vue/afvue/src/assets/sfilecompare.css

@ -0,0 +1,213 @@
.sfcbox {
float: left;
width: 100%;
/* overflow-y: auto; */
margin: 20px auto;
margin-top: 12px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 12px 12px 0 0;
position: relative;
}
.sfcon {
padding: 20px;
float: left;
width: 100%;
min-height: 560px;
margin-bottom: 40px;
}
.sfcon:first-child {
margin-bottom: 22px;
box-shadow: 1px 7px 10px 3px rgba(0, 0, 0, 0.1);
}
.sfcon:nth-child(2) {
margin-top: 22px;
}
.sfcon:nth-child(2) .sflist {
background-color: #dddcdc5e;
}
.sfbcon .sflist{
position: relative;
}
/* 操作按钮 */
/* .sfcon .sflist .fbdiv{
position: absolute;
bottom: 0;
left: 0;
height: 46px;
background-color: #00bd7e;
width: 100%;
} */
/* .sfcon .sflist .fbdiv .fbtn{
margin: 12px;
} */
.sfind {
width: 100%;
/* height: 40px; */
line-height: 40px;
padding: 12px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.sfind .selbox {
height: 40px;
border-top: none;
border-left: none;
border-right: none;
outline: none;
padding: 0 12px;
}
.sfind .inputbox {
height: 40px;
line-height: 40px;
padding: 12px;
border-top: none;
border-left: none;
border-right: none;
margin-left: 12px;
outline: none;
width: 460px;
}
.sfind button {
width: 70px;
height: 40px;
margin-left: 12px;
background-color: #f5f5f5;
border: none;
}
.sfcon .sflist {
min-height: 460px;
overflow-y: auto;
background-color: #f5f5f5;
}
.sfcon .sflist ul {
margin-top: 20px;
display: block;
width: 100%;
min-height: 500px;
}
.sfcon .sflist ul li {
list-style: none;
width: 100%;
float: left;
height: 40px;
line-height: 40px;
border-bottom: 1px dashed #ccc;
}
.sfcon .sflist ul li:hover {
background-color: #dad8d8;
}
.sfcon .sflist ul li .sflfunc {
/* display: none; */
float: right;
width: 360px;
margin-right: 20px;
}
.sfcon .sflist ul li .sfchkbox {
margin-right: 12px;
width: 18px;
height: 18px;
}
.sfcon .sflist ul li span{
line-height: 30px;
}
.sfcon .sflist .haschild {
cursor: pointer;
}
.sfcon .sflist .haschild i{
display: inline-block;
width: 25px;
height: 25px;
background-image: url("@/assets/css_sprites.png");
background-repeat: no-repeat;
background-size: 25px;
background-position: 0px -400px;
vertical-align: middle;
}
.sfcon .sflist .tips {
width: 100%;
float: left;
margin-top: 12px;
}
/* 传输功能区 */
.sftrans {
position: fixed;
width: 200px;
height: 120px;
z-index: 99;
background-color: #f5f5f5;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.sftrans .sfbcon {
color: #333;
margin-left: auto;
margin-right: auto;
background-color: #fff;
padding: 10px;
}
.sftrans .sfbcon li {
list-style: none;
height: 30px;
line-height: 30px;
}
.sftrans .sfbcon li:hover {
background-color: #00bd7e;
color: #fff;
cursor: default;
}
.sftrans .sfbcon li span {
padding-left: 12px;
}
.sftrans .sfbcon li.divider{
height: 1px;
background-color: #00bd7e;
margin: 10px 0;
}
/** 发送文件 */
.fsend{
float: left;
height: 60px;
background-color: #f3efef;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-top: 20px;
width: 100%;
position:fixed;
bottom: 0;
left: 0;
}
.fsend .fsendcon{
margin-left: auto;
padding: 12px;
background-color: #fff;
min-height: 60px;
width: 1200px;
margin-left: auto;
margin-right: auto;
}
.diff{
background-color: #fcc;
}

76
vue/afvue/src/components/NProgress/nprogress.less

@ -0,0 +1,76 @@
@import url('../index.less');
/* Make clicks pass-through */
#nprogress {
pointer-events: none;
}
#nprogress .bar {
background: @primary-color;
position: fixed;
z-index: 1031;
top: 0;
left: 0;
width: 100%;
height: 2px;
}
/* Fancy blur effect */
#nprogress .peg {
display: block;
position: absolute;
right: 0px;
width: 100px;
height: 100%;
box-shadow: 0 0 10px @primary-color, 0 0 5px @primary-color;
opacity: 1.0;
-webkit-transform: rotate(3deg) translate(0px, -4px);
-ms-transform: rotate(3deg) translate(0px, -4px);
transform: rotate(3deg) translate(0px, -4px);
}
/* Remove these to get rid of the spinner */
#nprogress .spinner {
display: block;
position: fixed;
z-index: 1031;
top: 15px;
right: 15px;
}
#nprogress .spinner-icon {
width: 18px;
height: 18px;
box-sizing: border-box;
border: solid 2px transparent;
border-top-color: @primary-color;
border-left-color: @primary-color;
border-radius: 50%;
-webkit-animation: nprogress-spinner 400ms linear infinite;
animation: nprogress-spinner 400ms linear infinite;
}
.nprogress-custom-parent {
overflow: hidden;
position: relative;
}
.nprogress-custom-parent #nprogress .spinner,
.nprogress-custom-parent #nprogress .bar {
position: absolute;
}
@-webkit-keyframes nprogress-spinner {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes nprogress-spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

0
vue/afvue/src/components/index.less

145
vue/afvue/src/views/Login.vue

@ -0,0 +1,145 @@
<template>
<div class="login-container">
<div class="login-form">
<h2>系统登录</h2>
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" v-model="username" placeholder="请输入用户名" />
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" v-model="password" placeholder="请输入密码" />
</div>
<button class="login-button" @click="handleLogin" :disabled="loading">
{{ loading ? '登录中...' : '登录' }}
</button>
<div v-if="error" class="error-message">{{ error }}</div>
</div>
</div>
</template>
<script>
import { login } from '@/api/scinfo'
import storage from 'store'
import router from '@/router'
export default {
name: 'Login',
data() {
return {
username: '',
password: '',
loading: false,
error: ''
}
},
methods: {
async handleLogin() {
if (!this.username || !this.password) {
this.error = '请输入用户名和密码'
return
}
this.loading = true
this.error = ''
try {
// API
const res = await login({
username: this.username,
password: this.password
})
if (res && res.data && res.data.token) {
// tokenlocalStorage
storage.set('token', res.data.token)
//
router.push('/')
} else {
this.error = '登录失败,请检查用户名和密码'
}
} catch (err) {
console.error('Login error:', err)
this.error = '登录失败,请稍后重试'
} finally {
this.loading = false
}
}
}
}
</script>
<style scoped>
.login-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f5f5f5;
}
.login-form {
background: white;
padding: 40px;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
width: 350px;
}
.login-form h2 {
text-align: center;
margin-bottom: 30px;
color: #333;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 8px;
color: #666;
font-size: 14px;
}
.form-group input {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.form-group input:focus {
outline: none;
border-color: #42b983;
}
.login-button {
width: 100%;
padding: 12px;
background-color: #42b983;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
margin-bottom: 15px;
}
.login-button:hover:not(:disabled) {
background-color: #359c6d;
}
.login-button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.error-message {
color: #ff4d4f;
font-size: 14px;
text-align: center;
}
</style>

274
vue/afvue/src/views/Sfilecompare.vue

@ -19,7 +19,7 @@
<div class="sflist">
<form method="post" ref="fsform">
<ul>
<li v-for="(item, index) in fsclist" :key="item" :data-index="index">
<li v-for="(item, index) in fsclist" :key="item" :data-index="index" :id="'fs_'+rc32(item.path)" :class="{'diff': item.path in diffFiles}">
<input type="checkbox" :value="item.path" class="sfchkbox" :name="'fsbox' + index" :ref="'fsbox' + index"/>
<a class="haschild" @click="goIntoDir(item.path, 1)" v-if="item.isdir"><i></i>{{ item.path }}</a>
<span v-else><i :class="'tb tb-'+item.suffix"></i>{{ item.path }}</span>
@ -83,7 +83,7 @@
</div>
<!-- 待发送文件 -->
<div class="fsend">
<div class="fsend" v-if="hasTwolist">
<div class="fsendcon">
<!-- 暂未想好放啥 -->
<button class="fbtn" @click="submitForm">同步选中的文件</button>
@ -126,6 +126,9 @@ export default {
menuLeft: 0, //
dialogShow: false, //
isShowDir: false, //
hasTwolist: false, //
diffFiles: [], //
}
},
mounted() {
@ -170,6 +173,63 @@ export default {
GetFileList({ srcip: scip, path: this.sspath, sport: sport }).then(res => {
this.ssclist = res.data.list
})
// 3s
setTimeout(() => {
this.diffFlist()
}, 3000)
//
if (this.fsclist.length > 0 && this.ssclist.length > 0) {
this.hasTwolist=true
}
},
// web
diffFlist(){
let alist = this.fsclist;
let blist = this.ssclist;
// alist blist
let diff = [...alist].filter(item =>
!blist.some(i =>
// i.hash == item.hash
i.path == item.path
)
)
// diff
// diff = diff.flatMap(item => item.hash)
diff = diff.map(item => item.path)
//
this.diffFiles = diff
},
// rc32,
rc32(str) {
// utf-8
str = encodeURIComponent(str)
let rc = 0xffff
for (let i = 0; i < str.length; i++) {
rc = (rc << 5) + rc + str.charCodeAt(i)
// 使
rc = rc & 0x7FFFFFFF
}
return rc
},
// list
compareList(){
let alist = this.fsclist;
let blist = this.ssclist;
// alist blist
let diff = [...alist].filter(item =>
!blist.some(i =>
// i.hash == item.hash
i.path == item.path
)
)
// diff
// diff = diff.flatMap(item => item.hash)
diff = diff.map(item => item.path)
//
this.diffFiles = diff
},
//
goIntoDir(path, nflag) {
@ -383,213 +443,5 @@ export default {
</script>
<style scoped>
.sfcbox {
float: left;
width: 100%;
/* overflow-y: auto; */
margin: 20px auto;
margin-top: 12px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 12px 12px 0 0;
position: relative;
}
.sfcon {
padding: 20px;
float: left;
width: 100%;
min-height: 560px;
margin-bottom: 40px;
}
.sfcon:first-child {
margin-bottom: 22px;
box-shadow: 1px 7px 10px 3px rgba(0, 0, 0, 0.1);
}
.sfcon:nth-child(2) {
margin-top: 22px;
}
.sfcon:nth-child(2) .sflist {
background-color: #dddcdc5e;
}
.sfbcon .sflist{
position: relative;
}
/* 操作按钮 */
/* .sfcon .sflist .fbdiv{
position: absolute;
bottom: 0;
left: 0;
height: 46px;
background-color: #00bd7e;
width: 100%;
} */
/* .sfcon .sflist .fbdiv .fbtn{
margin: 12px;
} */
.sfind {
width: 100%;
/* height: 40px; */
line-height: 40px;
padding: 12px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.sfind .selbox {
height: 40px;
border-top: none;
border-left: none;
border-right: none;
outline: none;
padding: 0 12px;
}
.sfind .inputbox {
height: 40px;
line-height: 40px;
padding: 12px;
border-top: none;
border-left: none;
border-right: none;
margin-left: 12px;
outline: none;
width: 460px;
}
.sfind button {
width: 70px;
height: 40px;
margin-left: 12px;
background-color: #f5f5f5;
border: none;
}
.sfcon .sflist {
min-height: 460px;
overflow-y: auto;
background-color: #f5f5f5;
}
.sfcon .sflist ul {
margin-top: 20px;
display: block;
width: 100%;
min-height: 500px;
}
.sfcon .sflist ul li {
list-style: none;
width: 100%;
float: left;
height: 40px;
line-height: 40px;
border-bottom: 1px dashed #ccc;
}
.sfcon .sflist ul li:hover {
background-color: #dad8d8;
}
.sfcon .sflist ul li .sflfunc {
/* display: none; */
float: right;
width: 360px;
margin-right: 20px;
}
.sfcon .sflist ul li .sfchkbox {
margin-right: 12px;
width: 18px;
height: 18px;
}
.sfcon .sflist ul li span{
line-height: 30px;
}
.sfcon .sflist .haschild {
cursor: pointer;
}
.sfcon .sflist .haschild i{
display: inline-block;
width: 25px;
height: 25px;
background-image: url("@/assets/css_sprites.png");
background-repeat: no-repeat;
background-size: 25px;
background-position: 0px -400px;
vertical-align: middle;
}
.sfcon .sflist .tips {
width: 100%;
float: left;
margin-top: 12px;
}
/* 传输功能区 */
.sftrans {
position: fixed;
width: 200px;
height: 120px;
z-index: 99;
background-color: #f5f5f5;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.sftrans .sfbcon {
color: #333;
margin-left: auto;
margin-right: auto;
background-color: #fff;
padding: 10px;
}
.sftrans .sfbcon li {
list-style: none;
height: 30px;
line-height: 30px;
}
.sftrans .sfbcon li:hover {
background-color: #00bd7e;
color: #fff;
cursor: default;
}
.sftrans .sfbcon li span {
padding-left: 12px;
}
.sftrans .sfbcon li.divider{
height: 1px;
background-color: #00bd7e;
margin: 10px 0;
}
/** 发送文件 */
.fsend{
float: left;
height: 60px;
background-color: #f3efef;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-top: 20px;
width: 100%;
position:fixed;
bottom: 0;
left: 0;
}
.fsend .fsendcon{
margin-left: auto;
padding: 12px;
background-color: #fff;
min-height: 60px;
width: 1200px;
margin-left: auto;
margin-right: auto;
}
@import url('@/assets/sfilecompare.css');
</style>
Loading…
Cancel
Save