添加天气配置
This commit is contained in:
parent
66d1ef3f45
commit
0e80445d8b
@ -18,7 +18,7 @@ var COMPANY = ""; //通用
|
|||||||
// COMPANY = 'jlw'//金林湾
|
// COMPANY = 'jlw'//金林湾
|
||||||
// COMPANY = 'shzj' //上海张江
|
// COMPANY = 'shzj' //上海张江
|
||||||
// COMPANY = 'shjg'//上海优益(上海建工)
|
// COMPANY = 'shjg'//上海优益(上海建工)
|
||||||
COMPANY = "agjt"; //鞍钢集团
|
// COMPANY = "agjt"; //鞍钢集团
|
||||||
// COMPANY = 'zkax' //中科安信
|
// COMPANY = 'zkax' //中科安信
|
||||||
// COMPANY = 'hfqc' //乌丹站舍(合肥启程)
|
// COMPANY = 'hfqc' //乌丹站舍(合肥启程)
|
||||||
// COMPANY = 'mulei' //木垒
|
// COMPANY = 'mulei' //木垒
|
||||||
|
|||||||
9
src/assets/js/api/weather.js
Normal file
9
src/assets/js/api/weather.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* api接口统一管理
|
||||||
|
*/
|
||||||
|
import { post, get } from '../http'
|
||||||
|
export const getWeatherPage = data => post('xmgl/weather/page', data) //查询列表数据
|
||||||
|
export const weatherAdd = data => post('xmgl/weather/add', data) //新增
|
||||||
|
export const weatherEdit = data => post('xmgl/weather/edit', data) //编辑
|
||||||
|
export const weatherDelete = data => post('xmgl/weather/delete', data) //删除
|
||||||
|
export const weatherImportExcel = data => post('xmgl/weather/importExcel', data)
|
||||||
@ -638,7 +638,7 @@ export default {
|
|||||||
this.jumpToken = localStorage.getItem("jumpToken");
|
this.jumpToken = localStorage.getItem("jumpToken");
|
||||||
let userId = this.$store.state.userInfo.userId;
|
let userId = this.$store.state.userInfo.userId;
|
||||||
window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + this.$store.state.projectSn, "_self");
|
window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + this.$store.state.projectSn, "_self");
|
||||||
// window.open('http://192.168.34.138:8081/#/large?token=' + this.jumpToken + '&sn=' + this.$store.state.projectSn, "_self")//这里是后台跳到大屏的操作,携带token过去
|
// window.open('http://192.168.34.216:8081/#/large?userId=' + userId + '&sn=' + this.$store.state.projectSn, "_self")//这里是后台跳到大屏的操作,携带token过去
|
||||||
}
|
}
|
||||||
// if (this.newBigScreen != null) {
|
// if (this.newBigScreen != null) {
|
||||||
// console.log("当前跳转链接",this.newBigScreen)
|
// console.log("当前跳转链接",this.newBigScreen)
|
||||||
|
|||||||
@ -295,6 +295,13 @@ const routes2 = [{
|
|||||||
component: () =>
|
component: () =>
|
||||||
import ("@/views/projectFront/projectSummary/manageTeam.vue"),
|
import ("@/views/projectFront/projectSummary/manageTeam.vue"),
|
||||||
},
|
},
|
||||||
|
//天气管理
|
||||||
|
{
|
||||||
|
path: "/project/summary/weatherManagement",
|
||||||
|
name: "天气管理",
|
||||||
|
component: () =>
|
||||||
|
import ("@/views/projectFront/projectSummary/weatherManagement.vue"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/project/summary/cooperationUnit",
|
path: "/project/summary/cooperationUnit",
|
||||||
name: "项目概况_合作单位",
|
name: "项目概况_合作单位",
|
||||||
|
|||||||
266
src/views/projectFront/projectSummary/weatherManagement.vue
Normal file
266
src/views/projectFront/projectSummary/weatherManagement.vue
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
<template>
|
||||||
|
<div class="fullHeight">
|
||||||
|
<div class="searchBox whiteBlock">
|
||||||
|
<el-button type="warning" size="medium" plain @click="refresh">{{ $t('message.deviceManage.refresh') }}</el-button>
|
||||||
|
<el-button type="primary" size="medium" @click="add">{{ $t('message.deviceManage.add') }}</el-button>
|
||||||
|
<!-- <el-upload
|
||||||
|
style="margin: 0px 15px; display: inline"
|
||||||
|
class="upload-demo expintBtn"
|
||||||
|
name="mppFile"
|
||||||
|
:on-success="handleImportSuccess"
|
||||||
|
:file-list="fileList"
|
||||||
|
:action="$http.defaults.baseURL + 'xmgl/weather/importExcel'"
|
||||||
|
:data="{ projectSn: $store.state.projectSn }"
|
||||||
|
:show-file-list="false"
|
||||||
|
:headers="headers"
|
||||||
|
>
|
||||||
|
<el-button size="medium" type="primary">导入</el-button>
|
||||||
|
</el-upload> -->
|
||||||
|
</div>
|
||||||
|
<div class="table_wrap whiteBlock">
|
||||||
|
<el-table class="tables" :data="dataList" height="800">
|
||||||
|
<el-table-column prop="city" align="center" label="城市名称"></el-table-column>
|
||||||
|
<el-table-column prop="date" label="预报日期" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="temDay" label="白天温度(高温)" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="temNight" label="白天温度(低温)" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="wea" label="天气情况" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="win" label="风向" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="winSpeed" label="风力等级" align="center"></el-table-column>
|
||||||
|
<el-table-column :label="$t('message.deviceManage.operation')" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="tableBtns">
|
||||||
|
<div
|
||||||
|
v-permission="{ key: 'gltd_edit', menuPath: '/project/summary/manageTeam' }"
|
||||||
|
@click="edit(scope.row)"
|
||||||
|
class="operationText"
|
||||||
|
>
|
||||||
|
<img src="@/assets/images/icon-edit.png" width="15px" height="15px" />
|
||||||
|
<span>{{ $t('message.deviceManage.edit') }}</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-permission="{ key: 'gltd_delete', menuPath: '/project/summary/manageTeam' }"
|
||||||
|
@click="deleteDev(scope.row)"
|
||||||
|
class="operationText"
|
||||||
|
>
|
||||||
|
<img src="@/assets/images/icon-delete.png" width="15px" height="15px" />
|
||||||
|
<span>{{ $t('message.deviceManage.delete') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<el-dialog
|
||||||
|
:modal-append-to-body="false"
|
||||||
|
@close="close"
|
||||||
|
:title="Popup.type === 'add' ? '新增天气' : '编辑天气'"
|
||||||
|
:visible.sync="Popup.show"
|
||||||
|
width="667px"
|
||||||
|
>
|
||||||
|
<div class="dialog_content">
|
||||||
|
<el-form
|
||||||
|
v-if="Popup.type === 'add' || Popup.type === 'edit'"
|
||||||
|
size="medium"
|
||||||
|
ref="addEditForm"
|
||||||
|
:model="addEditForm"
|
||||||
|
:rules="addEditRules"
|
||||||
|
label-width="140px"
|
||||||
|
class="dialogFormBox"
|
||||||
|
>
|
||||||
|
<el-form-item label="城市名称" prop="city">
|
||||||
|
<el-input v-model="addEditForm.city" :placeholder="$t('message.deviceManage.placeholder')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预报日期" prop="date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="addEditForm.date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="date"
|
||||||
|
:placeholder="$t('message.projectInfo.chooseDate')"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白天温度(高温)" prop="temDay">
|
||||||
|
<el-input v-model="addEditForm.temDay" :placeholder="$t('message.deviceManage.placeholder')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="白天温度(低温)" prop="date">
|
||||||
|
<el-input v-model="addEditForm.temNight" :placeholder="$t('message.deviceManage.placeholder')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="天气情况" prop="wea">
|
||||||
|
<el-input v-model="addEditForm.wea" :placeholder="$t('message.deviceManage.placeholder')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="天气图标" prop="weaImg">
|
||||||
|
<el-select v-model="addEditForm.weaImg" placeholder="请选择">
|
||||||
|
<el-option v-for="item in iconOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="风向" prop="win">
|
||||||
|
<el-input v-model="addEditForm.win" :placeholder="$t('message.deviceManage.placeholder')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="风力等级" prop="winSpeed">
|
||||||
|
<el-input v-model="addEditForm.winSpeed" type="number" :placeholder="$t('message.deviceManage.placeholder')"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button class="cancleBtn" @click="Popup.show = false" icon="el-icon-circle-close" size="medium"
|
||||||
|
>{{ $t('message.deviceManage.cancel') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-circle-check" @click="submit" size="medium"
|
||||||
|
>{{ $t('message.deviceManage.save') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getWeatherPage, weatherAdd, weatherEdit, weatherDelete } from '@/assets/js/api/weather'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mounted() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
headers() {
|
||||||
|
return { Authorization: this.$store.state.userInfo.token }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
multiple: true
|
||||||
|
},
|
||||||
|
fileList: [], //上传文件
|
||||||
|
// xue、lei、shachen、wu、bingbao、yun、yu、yin、qing
|
||||||
|
iconOptions: [
|
||||||
|
{ label: '晴', value: 'qing' },
|
||||||
|
{ label: '阴', value: 'yin' },
|
||||||
|
{ label: '雨', value: 'yu' },
|
||||||
|
{ label: '雪', value: 'xue' },
|
||||||
|
{ label: '雷', value: 'lei' },
|
||||||
|
{ label: '沙尘', value: 'shachen' },
|
||||||
|
{ label: '雾', value: 'wu' },
|
||||||
|
{ label: '冰雹', value: 'bingbao' },
|
||||||
|
{ label: '云', value: 'yun' }
|
||||||
|
],
|
||||||
|
addEditRules: {
|
||||||
|
city: [{ required: true, message: '请输入城市名称', trigger: 'blur' }],
|
||||||
|
date: [{ required: true, message: '请选择预报日期', trigger: 'change' }],
|
||||||
|
temDay: [{ required: true, message: '请输入白天温度', trigger: 'blur' }],
|
||||||
|
temNight: [{ required: true, message: '请输入白天温度', trigger: 'blur' }],
|
||||||
|
wea: [{ required: true, message: '请输入天气情况', trigger: 'blur' }],
|
||||||
|
weaImg: [{ required: true, message: '请选择天气图标', trigger: 'change' }],
|
||||||
|
win: [{ required: true, message: '请输入风向', trigger: 'blur' }],
|
||||||
|
winSpeed: [{ required: true, message: '请输入风力等级', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
addEditForm: {},
|
||||||
|
dataList: [],
|
||||||
|
Popup: {
|
||||||
|
type: 'add',
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handle(type, show) {
|
||||||
|
//打开弹窗前的统一处理
|
||||||
|
this.Popup = {
|
||||||
|
type: type,
|
||||||
|
show: show
|
||||||
|
}
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.handle('add', true)
|
||||||
|
},
|
||||||
|
edit(obj) {
|
||||||
|
this.addEditForm = JSON.parse(JSON.stringify(obj))
|
||||||
|
// this.$forceUpdate();
|
||||||
|
console.log('#编辑', obj)
|
||||||
|
this.handle('edit', true)
|
||||||
|
},
|
||||||
|
deleteDev(obj) {
|
||||||
|
console.log('删除', obj)
|
||||||
|
this.$confirm(this.$t('message.projectInfo.confirmTipText') + '?', this.$t('message.projectInfo.tip'), {
|
||||||
|
confirmButtonText: /* '确定', */ this.$t('message.energyManage.material.confirm'),
|
||||||
|
cancelButtonText: /* '取消', */ this.$t('message.energyManage.material.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
weatherDelete({ id: obj.id }).then(result => {
|
||||||
|
if (result.success) {
|
||||||
|
this.$message.success(result.message)
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
let params = JSON.parse(JSON.stringify(this.addEditForm))
|
||||||
|
params.projectSn = this.$store.state.projectSn
|
||||||
|
this.$refs.addEditForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
const api = this.Popup.type === 'add' ? weatherAdd : weatherEdit
|
||||||
|
api(params).then(result => {
|
||||||
|
if (result.success) {
|
||||||
|
this.$message.success(result.message)
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.Popup.show = false
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 导入成功
|
||||||
|
handleImportSuccess(res) {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
console.log('导入', res)
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
getWeatherPage({
|
||||||
|
projectSn: this.$store.state.projectSn
|
||||||
|
}).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
console.log('records', res.result.records)
|
||||||
|
this.dataList = res.result.records
|
||||||
|
console.log('run', this.dataList)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.addEditForm = {}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addEditForm.clearValidate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.tables {
|
||||||
|
img {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableBtns {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.yj-dialogFormBox {
|
||||||
|
width: 462px;
|
||||||
|
}
|
||||||
|
::v-deep .el-input__inner {
|
||||||
|
line-height: 1px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user