Commit dba9c0b1 by changjin

修改bug

parents f7f43e97 1c562811
......@@ -30,7 +30,14 @@
</template>
</el-table-column>
</el-table>
<pagination v-if="showpage" @pageSize="currentSize" @pageNum="currentPage" :totalNum="totalNum"></pagination>
<div class="block text-right mt10" v-if="showpage">
<el-pagination
@size-change="currentSize"
@current-change="currentPage"
layout="total, prev, pager, next, jumper"
:total="totalNum">
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="adddialogVisible" width="40%">
......@@ -84,7 +91,7 @@
<span style="margin: 0 5px;">--</span>
<el-date-picker v-model="editForm.endTime" type="date" :picker-options="EndOptions" placeholder="结束时间" style="width: 190px;" > </el-date-picker>
</el-form-item>
<el-form-item label="上传封面" required >
<el-form-item label="上传海报" required >
<div style="display: flex;flex-direction: column;">
<el-upload
class="avatar-uploader"
......@@ -110,9 +117,9 @@
</div>
</template>
<script>
import pagination from '../../BasePagination.vue';
// import pagination from '../../BasePagination.vue';
export default {
components: { pagination },
// components: { pagination },
data: () => ({
loading: false,
showpage: true,
......@@ -249,30 +256,15 @@ export default {
addsubmit() {
var that = this
if(that.addForm.title == ''){
that.$message({
message: '活动标题不为空',
type: 'warning'
});
that.showAlert('请输入活动标题~')
}else if(that.addForm.content == ''){
that.$message({
message: '活动内容不为空',
type: 'warning'
});
that.showAlert('请输入活动内容~')
}else if(that.addForm.startTime == ''){
that.$message({
message: '请选择活动开始时间',
type: 'warning'
});
that.showAlert('请选择活动开始时间~')
}else if(that.addForm.endTime == ''){
that.$message({
message: '请选择活动内容结束时间',
type: 'warning'
});
that.showAlert('请选择活动结束时间~')
}else if(that.addForm.imgUrl == ''){
that.$message({
message: '活动内容配图',
type: 'warning'
});
that.showAlert('请上传海报~')
}else{
that.$axios.post('/activity/addActivity', that.addForm).then((res) => {
if (res.data.code === '0') {
......@@ -292,30 +284,15 @@ export default {
editsubmit(data){
var that = this
if(that.editForm.title == ''){
that.$message({
message: '活动标题不为空',
type: 'warning'
});
that.showAlert('请输入活动标题~')
}else if(that.editForm.content == ''){
that.$message({
message: '活动内容不为空',
type: 'warning'
});
that.showAlert('请输入活动内容~')
}else if(that.editForm.startTime == ''){
that.$message({
message: '请选择活动开始时间',
type: 'warning'
});
that.showAlert('请选择活动开始时间~')
}else if(that.editForm.endTime == ''){
that.$message({
message: '请选择活动内容结束时间',
type: 'warning'
});
that.showAlert('请选择活动结束时间~')
}else if(that.editForm.imgUrl == ''){
that.$message({
message: '活动内容配图',
type: 'warning'
});
that.showAlert('请上传海报~')
}else{
var parem = Object.assign(that.editForm,{startTime:new Date(that.editForm.startTime),endTime:new Date(that.editForm.endTime),})
that.$axios.post('/activity/editActivityById', parem).then((res) => {
......@@ -395,6 +372,11 @@ export default {
this.page = val;
this.getList();
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
})
}
}
};
</script>
......
......@@ -30,7 +30,14 @@
</template>
</el-table-column>
</el-table>
<pagination v-if="showpage" @pageSize="currentSize" @pageNum="currentPage" :totalNum="totalNum"></pagination>
<div class="block text-right mt10" v-if="showpage">
<el-pagination
@size-change="currentSize"
@current-change="currentPage"
layout="total, prev, pager, next, jumper"
:total="totalNum">
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="adddialogVisible" width="40%">
......@@ -45,11 +52,13 @@
<el-form-item label="上传视频" required style="margin-bottom: 12px !important;">
<div style="display: flex;flex-direction: column;">
<el-upload
v-loading="loading"
class="avatar-uploader"
action="http://39.97.169.207:9200/baseInfo/uploadPhoto"
:show-file-list="false"
:headers="headers"
:on-success="handlevideoSuccess"
:on-progress="upLoadImg"
v-if="videoShow"
>
<video v-if="addForm.videoUrl" :src="addForm.videoUrl" controls='controls' :autoplay="autoplay" class="avatar"/>
......@@ -94,11 +103,13 @@
<el-form-item label="上传视频" required style="margin-bottom: 12px !important;">
<div style="display: flex;flex-direction: column;">
<el-upload
v-loading="loading"
class="avatar-uploader"
action="http://39.97.169.207:9200/baseInfo/uploadPhoto"
:show-file-list="false"
:headers="headers"
:on-success="handlevideoedit"
:on-progress="upLoadImg"
v-if="videoShow"
>
<video v-if="editForm.videoUrl" :src="editForm.videoUrl" controls='controls' :autoplay="autoplay" class="avatar"/>
......@@ -133,9 +144,9 @@
</div>
</template>
<script>
import pagination from '../../BasePagination.vue';
// import pagination from '../../BasePagination.vue';
export default {
components: { pagination },
// components: { pagination },
data: () => ({
loading: false,
showpage: true,
......@@ -212,8 +223,12 @@ export default {
this.imgShow = true
})
},
upLoadImg(){
this.loading = true
},
handlevideoSuccess(res, file) {
this.addForm.videoUrl = res.data;
this.loading = false
this.videoShow = false
this.$nextTick(() => {
this.videoShow = true
......@@ -221,6 +236,7 @@ export default {
},
handlevideoedit(res, file) {
this.editForm.videoUrl = res.data;
this.loading = false
this.videoShow = false
this.$nextTick(() => {
this.videoShow = true
......@@ -274,25 +290,13 @@ export default {
addsubmit() {
var that = this
if(that.addForm.title == ''){
that.$message({
message: '请输入广告标题',
type: 'warning'
});
that.showAlert('请输入广告标题~')
}else if(that.addForm.content == ''){
that.$message({
message: '请输入广告内容',
type: 'warning'
});
that.showAlert('请输入广告内容~')
}else if(that.addForm.videoUrl == ''){
that.$message({
message: '请输入上传视频',
type: 'warning'
});
that.showAlert('请上传视频~')
}else if(that.addForm.imgUrl == ''){
that.$message({
message: '请输入上传图片',
type: 'warning'
});
that.showAlert('请上传图片~')
}else{
that.$axios.post('/advertisement/addAdvertisement', that.addForm).then((res) => {
that.adddialogVisible = false;
......@@ -311,25 +315,13 @@ export default {
editsubmit() {
var that = this
if(that.editForm.title == ''){
that.$message({
message: '请输入广告标题',
type: 'warning'
});
that.showAlert('请输入广告标题~')
}else if(that.editForm.content == ''){
that.$message({
message: '请输入广告内容',
type: 'warning'
});
that.showAlert('请输入广告内容~')
}else if(that.editForm.videoUrl == ''){
that.$message({
message: '请输入上传视频',
type: 'warning'
});
that.showAlert('请上传视频~')
}else if(that.editForm.imgUrl == ''){
that.$message({
message: '请输入上传图片',
type: 'warning'
});
that.showAlert('请上传图片~')
}else{
that.$axios.post('/advertisement/editAdvertisementById', that.editForm).then((res) => {
that.editdialogVisible = false;
......@@ -407,9 +399,19 @@ export default {
this.page = val;
this.getList();
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
})
}
}
};
</script>
<style>
.el-loading-spinner{
width: 35% !important;
}
</style>
<style scoped lang="less">
.tableCont {
height: calc(100vh - 20px);
......
......@@ -297,23 +297,14 @@ export default {
IntelData1:[],
IntelData2:[],
IntelData3:{},
IntelData4:{},
IntelData4:{
name:'',
mobile:'',
ascription:'',
imgUrl:'',
},
SmartData:[],
num: 1,
Data1:[{
name: '监控设备',
},{
name: '应急按钮',
},{
name: '周界键盘',
}],
Data2:[{
name: '周界警报',
},{
name: '高空抛物',
},{
name: '安全预警',
}],
headers:{
token:window.sessionStorage.getItem('token'),
projectId:window.sessionStorage.getItem('projectId')
......@@ -398,20 +389,45 @@ export default {
var that = this
// 状态
that.$axios.post('/intelligentSecurity/findEquipmentType').then((res) => {
var data = res.data.data
if(data){
that.IntelData1 = res.data.data;
}else{
}
});
// 预警
that.$axios.post('/intelligentSecurity/findEquipmentWarning').then((res) => {
var data = res.data.data
if(data){
that.IntelData2 = res.data.data;
}else{
}
});
// 巡更
that.$axios.post('/keepWatch/findTodayWatch').then((res) => {
var val = res.data.data
that.IntelData3 = val;
if(val){
that.IntelData3 = res.data.data;
}else{
}
});
// 社区警官
that.$axios.post('/PoliceDetails/findPolice').then((res) => {
var data = res.data.data
if(data){
that.IntelData4 = res.data.data;
}else{
that.IntelData4 = {
name:'',
mobile:'',
ascription:'',
imgUrl:'',
}
}
});
},
// 设备
......@@ -621,7 +637,11 @@ export default {
margin: 0 15px;
}
.left {
display: flex;
display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* 老版本语法: Firefox (buggy) */
display: -ms-flexbox; /* 混合版本语法: IE 10 */
display: -webkit-flex; /* 新版本语法: Chrome 21+ */
display: flex; /* 新版本语法: Opera 12.1, Firefox 22+ */
flex-direction: column;
align-items: center;
justify-content: center;
......@@ -771,7 +791,7 @@ export default {
}
.boxDiv3 {
width: 23%;
// height: 150px;
height: 248px;
overflow: hidden;
background: #ffffff;
border: 1px solid #ffffff;
......
......@@ -25,7 +25,14 @@
</template>
</el-table-column>
</el-table>
<pagination v-if="showpage" @pageSize="currentSize" @pageNum="currentPage" :totalNum="totalNum"></pagination>
<div class="block text-right mt10" v-if="showpage">
<el-pagination
@size-change="currentSize"
@current-change="currentPage"
layout="total, prev, pager, next, jumper"
:total="totalNum">
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="adddialogVisible" width="40%">
......@@ -95,9 +102,9 @@
</div>
</template>
<script>
import pagination from '../../BasePagination.vue';
// import pagination from '../../BasePagination.vue';
export default {
components: { pagination },
// components: { pagination },
data: () => ({
loading: false,
showpage: true,
......@@ -213,20 +220,11 @@ export default {
addsubmit() {
var that = this
if(that.addForm.title == ''){
that.$message({
message: '请输入绿植名称',
type: 'warning'
});
that.showAlert('请输入绿植名称~')
}else if(that.addForm.content == ''){
that.$message({
message: '请输入绿植介绍',
type: 'warning'
});
that.showAlert('请输入绿植介绍~')
}else if(that.addForm.imgUrl == ''){
that.$message({
message: '请上传绿植图片',
type: 'warning'
});
that.showAlert('请上传绿植图片~')
}else{
that.$axios.post('/greenPlants/addGreen', that.addForm).then((res) => {
that.adddialogVisible = false;
......@@ -246,20 +244,11 @@ export default {
editsubmit() {
var that = this
if(that.editForm.title == ''){
that.$message({
message: '请输入绿植名称',
type: 'warning'
});
that.showAlert('请输入绿植名称~')
}else if(that.editForm.content == ''){
that.$message({
message: '请输入绿植介绍',
type: 'warning'
});
that.showAlert('请输入绿植介绍~')
}else if(that.editForm.imgUrl == ''){
that.$message({
message: '请上传绿植图片',
type: 'warning'
});
that.showAlert('请上传绿植图片~')
}else{
that.$axios.post('/greenPlants/editGreenById', that.editForm).then((res) => {
that.editdialogVisible = false;
......@@ -340,6 +329,11 @@ export default {
this.page = val;
this.getList();
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
})
}
}
};
</script>
......
......@@ -35,7 +35,14 @@
</template>
</el-table-column>
</el-table>
<pagination v-if="showpage" @pageSize="currentSize" @pageNum="currentPage" :totalNum="totalNum"></pagination>
<div class="block text-right mt10" v-if="showpage">
<el-pagination
@size-change="currentSize"
@current-change="currentPage"
layout="total, prev, pager, next, jumper"
:total="totalNum">
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="adddialogVisible" width="40%">
......@@ -65,9 +72,9 @@
</div>
</template>
<script>
import pagination from '../../BasePagination.vue';
// import pagination from '../../BasePagination.vue';
export default {
components: { pagination },
// components: { pagination },
data: () => ({
loading: false,
showpage: true,
......@@ -167,16 +174,9 @@ export default {
var that = this;
console.log(that.addForm.content)
if (that.addForm.title == '') {
console.log('1111111111')
that.$message({
message: '公告标题不为空',
type: 'warning'
});
that.showAlert('请输入公告标题~')
} else if (that.addForm.content == '') {
that.$message({
message: '公告内容不为空',
type: 'warning'
});
that.showAlert('请输入公告内容~')
} else {
that.$axios.post('/notice/addNotice', that.addForm).then(res => {
that.adddialogVisible = false;
......@@ -196,15 +196,9 @@ export default {
editsubmit() {
var that = this;
if (that.editForm.title == '') {
that.$message({
message: '公告标题不为空',
type: 'warning'
});
that.showAlert('请输入公告标题~')
} else if (that.editForm.content == '') {
that.$message({
message: '公告内容不为空',
type: 'warning'
});
that.showAlert('请输入公告内容~')
} else {
that.$axios.post('/notice/editNoticeById', that.editForm).then(res => {
that.editdialogVisible = false;
......@@ -280,6 +274,11 @@ export default {
currentPage(val) {
this.page = val;
this.getList();
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
})
}
}
};
......
......@@ -30,7 +30,14 @@
</template>
</el-table-column>
</el-table>
<pagination v-if="showpage" @pageSize="currentSize" @pageNum="currentPage" :totalNum="totalNum"></pagination>
<div class="block text-right mt10" v-if="showpage">
<el-pagination
@size-change="currentSize"
@current-change="currentPage"
layout="total, prev, pager, next, jumper"
:total="totalNum">
</el-pagination>
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="adddialogVisible" width="40%">
......@@ -100,9 +107,9 @@
</div>
</template>
<script>
import pagination from '../../BasePagination.vue';
// import pagination from '../../BasePagination.vue';
export default {
components: { pagination },
// components: { pagination },
data: () => ({
loading: false,
showpage: true,
......@@ -218,20 +225,11 @@ export default {
addsubmit() {
var that = this
if(that.addForm.title == ''){
that.$message({
message: '请输入商铺名称',
type: 'warning'
});
that.showAlert('请输入商铺名称~')
}else if(that.addForm.content == ''){
that.$message({
message: '请输入商铺内容',
type: 'warning'
});
that.showAlert('请输入商铺内容~')
}else if(that.addForm.imgUrl == ''){
that.$message({
message: '请上传周围商铺图片',
type: 'warning'
});
that.showAlert('请上传图片~')
}else{
that.$axios.post('/foodMenu/addFoodMenu', that.addForm).then((res) => {
that.adddialogVisible = false;
......@@ -250,20 +248,11 @@ export default {
editsubmit() {
var that = this
if(that.editForm.title == ''){
that.$message({
message: '请输入商铺名称',
type: 'warning'
});
that.showAlert('请输入商铺名称~')
}else if(that.editForm.content == ''){
that.$message({
message: '请输入商铺内容',
type: 'warning'
});
that.showAlert('请输入商铺内容~')
}else if(that.editForm.imgUrl == ''){
that.$message({
message: '请上传图片',
type: 'warning'
});
that.showAlert('请上传图片~')
}else{
that.$axios.post('/foodMenu/editFoodMenuById', that.editForm).then((res) => {
that.editdialogVisible = false;
......@@ -341,6 +330,11 @@ export default {
this.page = val;
this.getList();
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
})
}
}
};
</script>
......
......@@ -9,7 +9,7 @@
</el-button>
<el-button class="addBtn" @click="upload(1)" v-if="isDownloadBtn"><span>导入模板下载</span></el-button>
<el-button class="addBtn" v-if="isImportBtn">
<el-upload ref="upload" action="string" :before-upload="onBeforeUploadImage" :http-request="UploadImage" :show-file-list="false" style="width: 80px;">
<el-upload ref="upload" action="string" :before-upload="onBeforeUploadImage" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel " :http-request="UploadImage" :show-file-list="false" style="width: 80px;">
<span>数据导入</span>
</el-upload>
</el-button>
......@@ -172,27 +172,14 @@ export default {
},
upload(data) {
if (data === 1) {
this.$axios({
method: 'post',
url: '/carParking/templateExport',
responseType:'blob',
headers: {
'Content-Type': 'application/x-www-form-urlencoded', //设置请求头请求格式为JSON
token: window.sessionStorage.getItem('token'),
projectId: window.sessionStorage.getItem('projectId')
}
}).then(res => {
let blob = new Blob([res], {type: "application/vnd.ms-excel"}); // res就是接口返回的文件流了
let objectUrl = URL.createObjectURL(blob);
window.location.href = objectUrl;
});
window.open(this.fileUrl + 'static/xls/出售车位模板.xls')
} else if (data === 3) {
this.$axios({
method: 'post',
url: '/carParking/carExport',
responseType:'blob',
data:{},
headers: {
'Content-Type': 'application/x-www-form-urlencoded', //设置请求头请求格式为JSON
'Content-Type': 'application/json;charset=UTF-8', //设置请求头请求格式为JSON
token: window.sessionStorage.getItem('token'),
projectId: window.sessionStorage.getItem('projectId')
}
......@@ -216,12 +203,20 @@ export default {
url: '/carParking/carImport',
data:formData,
headers: {
'Content-Type': 'multipart/form-data', //设置请求头请求格式为JSON
'Content-Type': 'application/json;charset=UTF-8', //设置请求头请求格式为JSON
token: window.sessionStorage.getItem('token'),
projectId: window.sessionStorage.getItem('projectId')
}
}).then(res => {
if (res.data.code === '0') {
this.$message({
message: '导入成功',
type: 'success'
});
this.getList();
} else {
this.$message.error('车位出售删除');
}
});
},
// 出售
......@@ -248,20 +243,11 @@ export default {
addsubmit() {
var that = this;
if (that.addForm.floor == '') {
that.$message({
message: '请输入所在楼层',
type: 'warning'
});
that.showAlert('请输入所在楼层~')
} else if (that.addForm.region == '') {
that.$message({
message: '请输入区域',
type: 'warning'
});
that.showAlert('请输入区域~')
} else if (that.addForm.carNumber == '') {
that.$message({
message: '请输入车位编号',
type: 'warning'
});
that.showAlert('请输入车位编号~')
} else {
that.$axios.post('/carParking/addCarParking', that.addForm).then(res => {
that.adddialogVisible = false;
......@@ -280,20 +266,11 @@ export default {
editsubmit() {
var that = this;
if (that.editForm.floor == '') {
that.$message({
message: '请输入所在楼层',
type: 'warning'
});
that.showAlert('请输入所在楼层~')
} else if (that.editForm.region == '') {
that.$message({
message: '请输入区域',
type: 'warning'
});
that.showAlert('请输入区域~')
} else if (that.editForm.carNumber == '') {
that.$message({
message: '请输入车位编号',
type: 'warning'
});
that.showAlert('请输入车位编号~')
} else {
that.$axios.post('/carParking/editCarParkingById', that.editForm).then(res => {
that.editdialogVisible = false;
......@@ -338,6 +315,11 @@ export default {
currentPage(val) {
this.page = val;
this.getList();
},
showAlert: function (cont) {
this.$alert(cont, '温馨提示', {
confirmButtonText: '确定'
})
}
}
};
......
......@@ -12,13 +12,14 @@ import 'element-ui/lib/theme-chalk/index.css';
import store from './vuex/store.js'
require('../static/css/index.css')
Vue.use(uploader)
Vue.prototype.fileUrl = 'http://39.97.169.207/'
Vue.prototype.fileUrl = 'http://39.97.169.207/' //测试
// Vue.prototype.baseURL = 'http://172.16.2.69:8088/'
Vue.prototype.baseURL = 'http://39.97.169.207:9200/' // 测试
// Vue.prototype.baseURL = 'https://witcase.chinajinmao.cn' // 正式
axios.defaults.fileURL = Vue.prototype.fileURL
axios.defaults.baseURL = Vue.prototype.baseURL
axios.defaults.fileUrl = Vue.prototype.fileUrl
axios.defaults.withCredentials = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment