Skip to content

Commit

Permalink
🐛优化调整了一些东西
Browse files Browse the repository at this point in the history
  • Loading branch information
hellohao committed Jun 21, 2023
1 parent 2682e8b commit a59f577
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 121 deletions.
78 changes: 52 additions & 26 deletions src/assets/js/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,22 @@ export default {
type: 'picture',
bucketname: null,
bucketlist: [],
selectUserType: 'me',
searchtype: '1',//查询的文本类型
searchtext: null,//查询的文本
searchname: null,//图像名称
searchbucket: '',
searchStartDate: null,
searchStopDate: null,
searchData: {
selectUserType: 'me',
order: 'desc',
searchname: null,//图像名称
searchbucket: '',
searchtext: null,//查询的文本
searchtype: '1',//查询的文本类型
searchStartDate: null,
searchStopDate: null,
violation: false,
},
submitData: [],
toolBottom: 10,
nextButloading: false,
btntext: '加载更多',
treePopup: false,
violation: false,
moveImgLoading: false,
noImgMsg: false,//没有图像的时候提示
//画廊
Expand Down Expand Up @@ -109,25 +112,29 @@ export default {
lookImg(img) {
this.$refs[`myImages_${img.id}`][0].click()
},
selectPhoto() {
selectPhoto(t) {
// this.$Spin.show();
this.nextButloading = true;
var paramJson = {};
paramJson.pageNum = this.pageNum;
paramJson.pageSize = this.pageSize;
paramJson.selectUserType = this.selectUserType;
paramJson.searchname = this.searchname;
if (this.selectUserType == 'me') {
paramJson.selectUserType = this.searchData.selectUserType;
paramJson.searchname = this.searchData.searchname;
if (this.searchData.selectUserType == 'me') {
paramJson.selecttype = null;
paramJson.username = null;
} else {
paramJson.selecttype = this.searchtype;
paramJson.username = this.searchtext;
paramJson.selecttype = this.searchData.searchtype;
paramJson.username = this.searchData.searchtext;
}
paramJson.source = this.searchData.searchbucket;
paramJson.starttime = this.searchData.searchStartDate == '' ? null : this.searchData.searchStartDate;
paramJson.stoptime = this.searchData.searchStopDate == '' ? null : this.searchData.searchStopDate;
paramJson.violation = this.searchData.violation;
paramJson.order = this.searchData.order;
if (t == 'search') {
this.closeDrawer();
}
paramJson.source = this.searchbucket;
paramJson.starttime = this.searchStartDate == '' ? null : this.searchStartDate;
paramJson.stoptime = this.searchStopDate == '' ? null : this.searchStopDate;
paramJson.violation = this.violation;
this.treePopup = false;
request(
"/admin/selectPhoto",
Expand Down Expand Up @@ -251,11 +258,11 @@ export default {
},
startDateChange(e) {
console.log(e)
this.searchStartDate = e;
this.searchData.searchStartDate = e;
},
stopDateChange(e) {
console.log(e)
this.searchStopDate = e;
this.searchData.searchStopDate = e;
},
compareDate(checkStartDate, checkEndDate) {
var arys1 = new Array();
Expand All @@ -278,7 +285,7 @@ export default {
this.imglist = [];
this.clearSelectData();
this.pageNum = 1;
this.selectPhoto();
this.selectPhoto('search');
},
imgInfo(e) {
this.isimginfo = true;
Expand Down Expand Up @@ -340,9 +347,10 @@ export default {
paramJson).then(res => {
if (res.status != 200) {
this.$Message.error("请求时出现错误");
} else {
this.TimeingDelImg();
}
// else {
// this.TimeingDelImg();
// }
}).catch(err => {
console.log(err);
this.$Message.error('服务器请求错误');
Expand All @@ -363,6 +371,7 @@ export default {
that.delOver = false;
var paramJson = {}
paramJson.uuid = 'DEL-' + that.pageUUID;
console.log('定时器')
var interval = setInterval(function () {
let res = that.GetDelprogress(paramJson);
res.then(function (data) {
Expand All @@ -379,9 +388,9 @@ export default {
}
if (that.delOver) {
clearInterval(interval);
debugger;
that.isDelfun = false;
that.$Message.success("删除完成");
that.clearSelectData();
if (data.errorlist != null) {
if (data.errorlist > 0) {
that.isDelImgModal = true;
Expand All @@ -396,7 +405,7 @@ export default {
});

temp = true;
}, 800);
}, 600);
},
getBucketName(id) {
this.bucketname = "";
Expand Down Expand Up @@ -615,7 +624,24 @@ export default {
menuImgInfo() {
this.imgInfo(this.rightClickData)
},

hideDrawer() {
this.treePopup = false;
this.closeDrawer();
},
closeDrawer() {
console.log('清空')
this.searchData = {
selectUserType: 'me',
order: 'desc',
searchname: null,//图像名称
searchbucket: '',
searchtext: null,//查询的文本
searchtype: '1',//查询的文本类型
searchStartDate: null,
searchStopDate: null,
violation: false,
}
},

},
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="layout-nav" v-show="true">
<Menu mode="horizontal" theme="light" active-name="1">
<MenuItem name="men01">
<img @click="goHome" :src="$store.state.metaInfo.logo==null?hellohaologo:$store.state.metaInfo.logo"
<img @click="goHome" :src="$store.state.metaInfo.logo=='hellohao'?hellohaologo:$store.state.metaInfo.logo"
style="width: 135px;vertical-align: middle;"/>
</MenuItem>
<!-- <MenuItem @click.native="goHome">-->
Expand Down
43 changes: 27 additions & 16 deletions src/views/admin/photo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,42 @@
<Icon type="ios-alert-outline" size="16"/>&nbsp;&nbsp;
</v-contextmenu-item>
</v-contextmenu>
<Drawer title="图像类别" :closable="false" v-model="treePopup" :width="screenWidth<=368?screenWidth:368">
<Drawer title="图像筛选" :closable="false" v-model="treePopup" @on-close="closeDrawer"
:width="screenWidth<=368?screenWidth:368">
<Form @submit.native.prevent style="margin-top: 30px;">
<Divider plain>图像分类</Divider>
<FormItem>
<RadioGroup v-model="selectUserType" type="button" style="width: 100%">
<FormItem style="width: 100%;text-align: center;">
<RadioGroup v-model="searchData.selectUserType" type="button" style="width: 100%">
<Radio label="me">我的图像</Radio>
<Radio label="all">用户图像</Radio>
</RadioGroup>
</FormItem>
<FormItem>
<Select v-model="searchData.order" style="width:100%" placeholder="筛选排序方式">
<Option value="desc" key="desc">时间倒序</Option>
<Option value="asc" key="asc">时间顺序</Option>
<Option value="sizeDesc" key="sizeDesc">大小倒序</Option>
<Option value="sizeAsc" key="sizeAsc">大小顺序</Option>
</Select>
</FormItem>
<Divider plain>名称搜索</Divider>
<FormItem>
<Input style="width: 100%" size="default" v-model="searchname" placeholder="图像名称/url名称(可模糊搜索)">
<Input style="width: 100%" size="default" v-model="searchData.searchname"
placeholder="图像名称/地址后缀(可模糊搜索)">
</Input>
</FormItem>
<Divider plain>高级选项(选填)</Divider>
<FormItem v-if="$store.state.RoleLevel=='admin'">
<Select style="width: 100%;" v-model="searchbucket" filterable clearable placeholder="存储源(默认全部)">
<Select style="width: 100%;" v-model="searchData.searchbucket" filterable clearable
placeholder="存储源(默认全部)">
<Option v-for="item in bucketlist" :value="item.id" :key="item.id">
{{ item.keyname }}
</Option>
</Select>
</FormItem>
<FormItem v-if="$store.state.RoleLevel=='admin' && selectUserType=='all'">
<Input style="width: 100%" size="default" v-model="searchtext" placeholder="填写用户名">
<Select v-model="searchtype" slot="prepend" style="width: 80px">
<FormItem v-if="$store.state.RoleLevel=='admin' && searchData.selectUserType=='all'">
<Input style="width: 100%" size="default" v-model="searchData.searchtext" placeholder="填写用户名">
<Select v-model="searchData.searchtype" slot="prepend" style="width: 80px">
<Option value="1">包含</Option>
<Option value="0">排除</Option>
</Select>
Expand All @@ -61,16 +72,16 @@
<DatePicker style="width: 100%;" @on-change="stopDateChange" format="yyyy-MM-dd HH:mm:ss" type="datetime"
split-panels placeholder="结束日期段(默认当前日期)"></DatePicker>
</FormItem>

<FormItem>
<CheckboxGroup>
<Checkbox label="违规图片" v-model="violation" border></Checkbox>
<Checkbox label="违规图片" v-model="searchData.violation" border></Checkbox>
</CheckboxGroup>
</FormItem>

</Form>
<div style="width: 100%; height: 55px; position: fixed; bottom: 0; left: 0;text-align: right; padding: 10px;">
<div style="width: 75px; display: inline-block;">
<Button shape="circle" @click="treePopup = false">取消</Button>
<Button shape="circle" @click="hideDrawer">取消</Button>
</div>
<div style="width: 75px; display: inline-block;">
<Button type="primary" shape="circle" @click="tosearch">检索</Button>
Expand Down Expand Up @@ -131,9 +142,9 @@
<div class="" id="box" ref="dom">
<ul id="sortAble">
<li v-for="(item,index) in imglist" :ref="`imgLi_${item.id}`" :key="index" v-contextmenu:contextmenu>
<div>
<div :style="{width: imgWidth+'px', height:imgWidth+'px'}">
<span class="formatTag">{{ item.imgname.substr(item.imgname.lastIndexOf("\.") + 1) }}</span>
<img :style="{width: imgWidth+'px', }" :id="'myimg_'+index" :alt="item.imgurl"
<img :style="{width: imgWidth+'px', }" :id="'myimg_'+index"
:v-lazy="item.imgurl"
:src="item.imgurl"
:key="item.imgurl"
Expand Down Expand Up @@ -250,7 +261,7 @@
<Input v-model="albumData.password" style="width: auto;width: 100px;"/>
<Button style="position: absolute;right: 30px;" size="small" type="primary" shape="circle" class="cobyOrderSn"
data-clipboard-action="copy"
:data-clipboard-text="'画廊链接:'+albumData.url+'提取码:'+albumData.password+' 复制这段内容后用浏览器打开,即可查看画廊哦'"
:data-clipboard-text="'画廊链接: '+albumData.url+' 提取码:'+albumData.password+' 复制这段内容后用浏览器打开,即可查看画廊哦'"
@click.native="copy">复 制
</Button>
</FormItem>
Expand Down Expand Up @@ -440,8 +451,8 @@ circle {
}
.myselect {
width: 20px;
height: 20px;
width: 1.8em;
height: 1.8em;
box-shadow: 0 1px 6px rgba(58, 58, 58, .2);
border-radius: 4px;
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
style="max-width: 500px;"/>
</FormItem>
<FormItem label="站点LOGO" :label-width="90">
<Input v-model="config.logo" maxlength="500" placeholder="请输入LOGO链接"/>
<Input v-model="config.logo" maxlength="500" placeholder="请输入LOGO链接(输入‘hellohao’使用默认)"/>
</FormItem>
<FormItem label="favicon图标" :label-width="90">
<Input v-model="config.webfavicons" maxlength="500" placeholder="请输入站点favicon图标URL地址"/>
Expand Down
Loading

0 comments on commit a59f577

Please sign in to comment.