Commit ae718f44 by hank

修改交互

parent d77aac57
import request from '@/utils/request'
/**
* 获取预警发布列表
* @param {*} p
* @param {*} c
*/
export function getList(query = {}, p = 1, c = 200) {
return request({
url: '/event/get/list',
method: 'post',
data: {
beginTime: query.beginTime,
endTime: query.endTime,
type: query.type,
title: query.title
},
params: {
p, c
}
})
}
/**
*
* @param {*} eventId
* 获取预警发布详情
*/
export function getDetail(eventId) {
return request({
url: `/event/get/info/${eventId}`,
method: 'get'
})
}
/**
* 删除预警发布
* @param {*} eventId
*/
export function del(eventId) {
return request({
url: `/event/del/info/${eventId}`,
method: 'get'
})
}
/**
* 更新预警发布信息
* @param {*} data
*/
export function update(data = {}) {
console.log(data)
return request({
url: `/event/update/info`,
method: 'post',
data: data
})
}
export function add(data = {}) {
return request({
url: `/event/add/info`,
method: 'post',
data: data
})
}
import request from '@/utils/request'
/**
* 获取预警发布列表
* @param {*} p
* @param {*} cconstruction/add/info
新增预警中心建设接口
*/
export function getList(query = {}, p = 1, c = 200) {
return request({
url: '/construction/get/list',
method: 'post',
data: {
beginTime: query.beginTime,
endTime: query.endTime,
type: query.type,
title: query.title
},
params: {
p, c
}
})
}
/**
*
* @param {*} constructionId
* 获取预警发布详情
*/
export function getDetail(constructionId) {
return request({
url: `/construction/get/info/${constructionId}`,
method: 'get'
})
}
/**
* 删除预警发布
* @param {*} constructionId
*/
export function del(constructionId) {
return request({
url: `/construction/del/info/${constructionId}`,
method: 'get'
})
}
/**
* 更新预警发布信息
* @param {*} data
*/
export function update(data = {}) {
console.log(data)
return request({
url: `/construction/update/info`,
method: 'post',
data: data
})
}
export function add(data = {}) {
return request({
url: `/construction/add/info`,
method: 'post',
data: data
})
}
import request from '@/utils/request'
export function getCenterType(type) {
return request({
url: `/centre/get/info/${type}`,
method: 'get'
})
}
export function updateCenterType(data) {
return request({
url: `/centre/update/info`,
method: 'post',
data
})
}
......@@ -15,15 +15,29 @@ export function getValueList(p = 1, c = 20) {
}
})
}
export function getProvince() {
return request({
url: '/area/get/province',
method: 'get',
params: {
}
})
}
export function updateTitle(tiltle) {
return request({
url: '/system/get/variable/list',
url: '/index/update/title',
method: 'post',
data: {
tiltle
}
})
}
export function getTitle() {
return request({
url: '/index/get/title',
method: 'get'
})
}
export function uploadUrl() {
return process.env.VUE_APP_BASE_API + '/common/upload/resource'
}
import request from '@/utils/request'
/**
* 获取联系人列表
* @param {*} p
* @param {*} c
*/
export function getList(query = {}, p = 1, c = 200) {
return request({
url: '/liaison/get/list',
method: 'post',
data: {
beginTime: query.beginTime,
endTime: query.endTime,
code: query.code,
title: query.title
},
params: {
p, c
}
})
}
/**
*
* @param {*} liaisonId
* 获取联系人详情
*/
export function getDetail(liaisonId) {
return request({
url: `/liaison/get/info/${liaisonId}`,
method: 'get'
})
}
/**
* 删除联系人
* @param {*} liaisonId
*/
export function del(liaisonId) {
return request({
url: `/liaison/del/info/${liaisonId}`,
method: 'get'
})
}
/**
* 更新联系人信息
* @param {*} data
*/
export function update(data = {}) {
console.log(data)
return request({
url: `/liaison/update/info`,
method: 'post',
data: data
})
}
export function add(data = {}) {
return request({
url: `/liaison/add/info`,
method: 'post',
data: data
})
}
import request from '@/utils/request'
/**
* 获取预警发布列表
* @param {*} p
* @param {*} c
*/
export function getList(query = {}, p = 1, c = 200) {
return request({
url: '/benefit/get/list',
method: 'post',
data: {
beginTime: query.beginTime,
endTime: query.endTime,
type: query.type,
title: query.title
},
params: {
p, c
}
})
}
/**
*
* @param {*} benefitId
* 获取预警发布详情
*/
export function getDetail(benefitId) {
return request({
url: `/benefit/get/info/${benefitId}`,
method: 'get'
})
}
/**
* 删除预警发布
* @param {*} benefitId
*/
export function del(benefitId) {
return request({
url: `/benefit/del/info/${benefitId}`,
method: 'get'
})
}
/**
* 更新预警发布信息
* @param {*} data
*/
export function update(data = {}) {
console.log(data)
return request({
url: `/benefit/update/info`,
method: 'post',
data: data
})
}
export function add(data = {}) {
return request({
url: `/benefit/add/info`,
method: 'post',
data: data
})
}
import request from '@/utils/request'
/**
* 获取预警发布列表
* @param {*} p
* @param {*} c
*/
export function getList(query = {}, p = 1, c = 200) {
return request({
url: '/promotional/get/list',
method: 'post',
data: {
beginTime: query.beginTime,
endTime: query.endTime,
type: query.type,
title: query.title
},
params: {
p, c
}
})
}
/**
*
* @param {*} promotionalId
* 获取预警发布详情
*/
export function getDetail(promotionalId) {
return request({
url: `/promotional/get/info/${promotionalId}`,
method: 'get'
})
}
/**
* 删除预警发布
* @param {*} promotionalId
*/
export function del(promotionalId) {
return request({
url: `/promotional/del/info/${promotionalId}`,
method: 'get'
})
}
/**
* 更新预警发布信息
* @param {*} data
*/
export function update(data = {}) {
console.log(data)
return request({
url: `/promotional/update/info`,
method: 'post',
data: data
})
}
export function add(data = {}) {
return request({
url: `/promotional/add/info`,
method: 'post',
data: data
})
}
......@@ -66,6 +66,7 @@ export default {
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
}
}
......
......@@ -13,7 +13,7 @@ const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
// start progress bar
NProgress.start()
// return;
// set page title
document.title = getPageTitle(to.meta.title)
......
......@@ -8,7 +8,7 @@ import Layout from '@/layout'
/* Router Modules */
import tableRouter from './modules/table'
// import tableRouter from './modules/table'
// import DeviceRouter from './modules/device'
// import TempaltesRouter from './modules/templates'
// import CommonRouter from './modules/common'
......@@ -64,12 +64,14 @@ export const constantRoutes = [
{
path: '/',
component: Layout,
hidden: true,
redirect: '/profile/index',
children: [
{
path: 'dashboard',
component: () => import('@/views/dashboard/index'),
name: 'Dashboard',
hidden: true,
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
......@@ -111,23 +113,23 @@ export const constantRoutes = [
* the routes that need to be dynamically loaded based on user roles
*/
export const asyncRoutes = [
{
path: '/icon',
component: Layout,
children: [
{
path: 'index',
component: () => import('@/views/icons/index'),
name: 'Icons',
meta: { title: 'Icons', icon: 'icon', noCache: true }
}
]
},
// {
// path: '/icon',
// component: Layout,
// children: [
// {
// path: 'index',
// component: () => import('@/views/icons/index'),
// name: 'Icons',
// meta: { title: 'Icons', icon: 'icon', noCache: true }
// }
// ]
// },
/** when your routing map is too long, you can split it into small modules **/
// DeviceRouter,
// TempaltesRouter,
tableRouter,
// tableRouter,
// CommonRouter,
// {
// path: 'external-link',
......
......@@ -10,7 +10,7 @@ const contentsRouter = {
name: 'contents',
meta: {
title: '内容管理',
icon: 'table'
icon: 'education'
},
children: [
{
......
import { login, logout, getInfo } from '@/api/user'
import { login, getInfo } from '@/api/user'
import { getToken, setToken, removeToken } from '@/utils/auth'
import router, { resetRouter } from '@/router'
......@@ -74,15 +74,20 @@ const actions = {
// user logout
logout({ commit, state }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resetRouter()
resolve()
}).catch(error => {
reject(error)
})
// logout(state.token).then(() => {
// commit('SET_TOKEN', '')
// commit('SET_ROLES', [])
// removeToken()
// resetRouter()
// resolve()
// }).catch(error => {
// reject(error)
// })
})
},
......
......@@ -6,6 +6,7 @@
class="filter-item"
type="datetimerange"
:picker-options="pickerOptions"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
......
......@@ -6,6 +6,7 @@
class="filter-item"
type="datetimerange"
:picker-options="pickerOptions"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
......@@ -168,7 +169,7 @@
v-model="temp.content"
:autosize="{ minRows: 2, maxRows: 4}"
type="textarea"
placeholder="Please input"
placeholder="请输入"
/>
</el-form-item>
<el-form-item label="上传图片" prop="type">
......
......@@ -15,7 +15,6 @@
<el-select
v-model="temp.type"
placeholder="请选择"
clearable
class="filter-item"
style="width: 130px"
@change="selectChange"
......@@ -32,21 +31,23 @@
<el-input
v-model="temp.title"
:autosize="{ minRows: 2, maxRows: 4}"
type="password"
type="text"
placeholder="请输入"
/>
</el-form-item>
<el-form-item label="时间" prop="content">
<el-form-item label="时间" prop="updateTime" disabled>
<el-input
v-model="temp.content"
v-model="temp.updateTime"
disabled
:autosize="{ minRows: 2, maxRows: 4}"
type="datetime"
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="发布者" prop="content">
<el-form-item label="发布者" prop="userName" aria-disabled>
<el-input
v-model="temp.content"
v-model="temp.userName"
disabled
:autosize="{ minRows: 2, maxRows: 4}"
type="text"
placeholder="请输入"
......@@ -60,7 +61,7 @@
placeholder="请输入"
/>
</el-form-item>
<el-form-item label="邮编" prop="type">
<el-form-item label="上传内容" prop="type">
<el-upload
class="upload-demo"
drag
......@@ -79,7 +80,7 @@
<div slot="tip" class="el-upload__tip">只能上传图片</div>
</el-upload>
</el-form-item>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">提交</el-button>
<el-button type="primary" @click="updateData()">提交</el-button>
</el-form>
</div>
</template>
......@@ -89,10 +90,12 @@ import { uploadUrl } from '@/api/common'
import waves from '@/directive/waves' // waves directive
import { parseTime } from '@/utils'
import { getCenterType, updateCenterType } from '@/api/centre'
const calendarTypeOptions = [
{ id: 1, name: '气象中心' },
{ id: 2, name: '地域气象局' },
{ id: 3, name: '机构' }
{ id: '1', name: '主要职责' },
{ id: '2', name: '地位' },
{ id: '3', name: '成立时间' }
]
export default {
name: 'ComplexTable',
......@@ -112,13 +115,7 @@ export default {
calendarTypeOptions,
uploadUrl: uploadUrl(),
temp: {
id: undefined,
importance: 1,
remark: '',
timestamp: new Date(),
title: '',
type: '',
status: 'published'
type: '1'
},
rules: {
type: [
......@@ -134,14 +131,29 @@ export default {
],
title: [
{ required: true, message: 'title is required', trigger: 'blur' }
],
content: [
{ required: true, message: 'title is required', trigger: 'blur' }
],
url: [
{ required: true, message: 'title is required', trigger: 'blur' }
]
},
downloadLoading: false
}
},
created() {},
created() {
this.getList()
},
methods: {
getList() {},
getList() {
getCenterType(this.temp.type).then(res => {
console.log(res.data)
if (res.data) {
this.temp = res.data
}
})
},
selectChange() {
this.getList()
},
......@@ -160,7 +172,15 @@ export default {
this.$refs['dataForm'].validate(valid => {
if (valid) {
const tempData = Object.assign({}, this.temp)
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT
tempData.timestamp = +new Date(tempData.timestamp)
updateCenterType(this.temp).then(res => {
this.$notify({
title: 'Success',
message: '修改成功',
type: 'success',
duration: 2000
})
})
}
})
},
......
......@@ -6,6 +6,7 @@
class="filter-item"
type="datetimerange"
:picker-options="pickerOptions"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
......@@ -89,7 +90,7 @@
<template slot-scope="scope">
<span>{{ scope.row.type }}</span>
</template>
</el-table-column> -->
</el-table-column>-->
<el-table-column label="发布者" width="90px">
<template slot-scope="scope">
<span>{{ scope.row.userName }}</span>
......@@ -151,7 +152,7 @@
v-model="temp.content"
:autosize="{ minRows: 2, maxRows: 4}"
type="textarea"
placeholder="Please input"
placeholder="请输入"
/>
</el-form-item>
<el-form-item label="上传图片" prop="type">
......@@ -188,7 +189,25 @@ import { uploadUrl } from '@/api/common'
import waves from '@/directive/waves' // waves directive
import { parseTime } from '@/utils'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
// {
// '大事记': [
// { id: '1', name: '预警中心' },
// { id: '2', name: '预警发布系统' }]
// '预警发布系统':[
// { id: '1', name: '建设背景' },
// { id: '2', name: '发展历程' },
// { id: '3', name: '建设成效' }
// ],
// '中心介绍': [
// { id: '1', name: '气象中心' },
// { id: '2', name: '地域气象局' },
// { id: '3', name: '机构' }
// ],
// '信息服务应用效益': [
// { id: '1', name: '应用效益' },
// { id: '2', name: '服务宗旨' }
// ]
// }
const calendarTypeOptions = [
{ id: '1', name: '建设背景' },
{ id: '2', name: '发展历程' },
......@@ -429,13 +448,7 @@ export default {
const tempData = Object.assign({}, this.temp)
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
update(tempData).then(() => {
for (const v of this.list) {
if (v.id === this.temp.id) {
const index = this.list.indexOf(v)
this.list.splice(index, 1, this.temp)
break
}
}
this.getList()
this.dialogFormVisible = false
this.$notify({
title: 'Success',
......
......@@ -10,9 +10,9 @@
>
<el-form-item
label="系统标题"
prop="typeMenuOrder"
prop="title"
>
<el-input v-model="temp.typeMenuOrder" />
<el-input v-model="temp.title" />
</el-form-item>
</el-form>
<div
......@@ -21,7 +21,7 @@
>
<el-button
type="primary"
@click="dialogStatus==='create'?createData():updateData()"
@click="updateData()"
>
确认
</el-button>
......@@ -30,11 +30,11 @@
</template>
<script>
import { typeAdd } from '@/api/menu'
import { updateTitle, getTitle } from '@/api/common'
import waves from '@/directive/waves' // waves directive
export default {
name: 'ComplexTable',
name: 'Title',
components: { },
directives: { waves },
filters: {
......@@ -43,8 +43,7 @@ export default {
data() {
return {
temp: {
typeMenuOrde: 0,
typeMenuName: ''
title: '123123'
},
dialogFormVisible: false,
dialogStatus: '',
......@@ -70,7 +69,7 @@ export default {
trigger: 'change'
}
],
typeMenuOrder: [
title: [
{
required: true,
message: 'title is required',
......@@ -81,29 +80,30 @@ export default {
}
},
created() {
getTitle().then(res => {
this.temp = res.data
console.log(res.data)
})
},
methods: {
createData() {
this.$refs['dataForm'].validate(valid => {
if (valid) {
typeAdd(this.temp.typeMenuName, this.temp.typeMenuOrder).then(() => {
this.getList()
this.dialogFormVisible = false
this.$notify({
title: 'Success',
message: 'Created Successfully',
type: 'success',
duration: 2000
})
})
console.log(valid)
}
})
},
updateData() {
this.$refs['dataForm'].validate(valid => {
if (valid) {
const tempData = Object.assign({}, this.temp)
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
updateTitle(this.temp.title).then(res => {
this.$notify({
title: 'Success',
message: '修改成功',
type: 'success',
duration: 2000
})
})
}
})
}
......
......@@ -59,14 +59,14 @@
<span class="link-type" @click="handleUpdate(row)">{{ row.userName }}</span>
</template>
</el-table-column>
<el-table-column label="所属角色" width="110px" align="center">
<!-- <el-table-column label="所属角色" width="110px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="最后登录ip" width="120px">
<template slot-scope="scope">
<div>27.184.152.171 {{ scope.row.loginIp }}</div>
<div>{{ scope.row.loginIp }}</div>
</template>
</el-table-column>
<el-table-column label="最后登录时间" width="150px" align="center">
......@@ -126,7 +126,7 @@
v-model="temp.userEmail"
:autosize="{ minRows: 2, maxRows: 4}"
type="text"
placeholder="Please input"
placeholder="请输入"
/>
</el-form-item>
<el-form-item v-show="false" label="所属角色" prop="type">
......
......@@ -121,7 +121,7 @@
<el-rate v-model="temp.importance" :colors="['#99A9BF', '#F7BA2A', '#FF9900']" :max="3" style="margin-top:8px;" />
</el-form-item>
<el-form-item label="Remark">
<el-input v-model="temp.remark" :autosize="{ minRows: 2, maxRows: 4}" type="textarea" placeholder="Please input" />
<el-input v-model="temp.remark" :autosize="{ minRows: 2, maxRows: 4}" type="textarea" placeholder="请输入" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......
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