112 changed files with 5294 additions and 286 deletions
@ -1,53 +1,55 @@ |
|||||
{ |
{ |
||||
"name": "gin-vue-admin", |
"name": "gin-vue-admin", |
||||
"version": "2.3.5", |
"version": "2.3.5", |
||||
"private": true, |
"private": true, |
||||
"scripts": { |
"scripts": { |
||||
"serve": "vite --host --mode development", |
"serve": "vite --host --mode development", |
||||
"build": "vite build --mode production", |
"build": "vite build --mode production", |
||||
"preview": "vite preview" |
"preview": "vite preview" |
||||
}, |
}, |
||||
"dependencies": { |
"dependencies": { |
||||
"@babel/polyfill": "^7.12.1", |
"@babel/polyfill": "^7.12.1", |
||||
"@element-plus/icons": "0.0.11", |
"@element-plus/icons": "0.0.11", |
||||
"axios": "^0.19.2", |
"axios": "^0.19.2", |
||||
"core-js": "^3.6.5", |
"core-js": "^3.6.5", |
||||
"echarts": "4.9.0", |
"echarts": "^5.2.2", |
||||
"element-plus": "^1.1.0-beta.24", |
"element-plus": "^1.1.0-beta.24", |
||||
"highlight.js": "^10.6.0", |
"highlight.js": "^10.6.0", |
||||
"marked": "^2.0.0", |
"marked": "^2.0.0", |
||||
"mitt": "^3.0.0", |
"mitt": "^3.0.0", |
||||
"path": "^0.12.7", |
"path": "^0.12.7", |
||||
"qs": "^6.8.0", |
"qs": "^6.8.0", |
||||
"quill": "^1.3.7", |
"quill": "^1.3.7", |
||||
"screenfull": "^5.0.2", |
"screenfull": "^5.0.2", |
||||
"script-ext-html-webpack-plugin": "^2.1.4", |
"script-ext-html-webpack-plugin": "^2.1.4", |
||||
"spark-md5": "^3.0.1", |
"spark-md5": "^3.0.1", |
||||
"vue": "^3.2.0", |
"vue": "^3.2.0", |
||||
"vue-particle-line": "^0.1.4", |
"vue-baidu-map": "^0.21.22", |
||||
"vue-router": "^4.0.0-0", |
"vue-particle-line": "^0.1.4", |
||||
"vuex": "^4.0.0-0", |
"vue-router": "^4.0.0-0", |
||||
"vuex-persist": "^2.1.0" |
"vuex": "^4.0.0-0", |
||||
}, |
"vuex-persist": "^2.1.0", |
||||
"devDependencies": { |
"wangeditor": "^4.7.9" |
||||
"@vitejs/plugin-legacy": "^1.4.4", |
}, |
||||
"@vitejs/plugin-vue": "latest", |
"devDependencies": { |
||||
"@vue/cli-plugin-babel": "~4.5.0", |
"@vitejs/plugin-legacy": "^1.4.4", |
||||
"@vue/cli-plugin-eslint": "~4.5.0", |
"@vitejs/plugin-vue": "latest", |
||||
"@vue/cli-plugin-router": "~4.5.0", |
"@vue/cli-plugin-babel": "~4.5.0", |
||||
"@vue/cli-plugin-vuex": "~4.5.0", |
"@vue/cli-plugin-eslint": "~4.5.0", |
||||
"@vue/cli-service": "~4.5.0", |
"@vue/cli-plugin-router": "~4.5.0", |
||||
"@vue/compiler-sfc": "^3.1.5", |
"@vue/cli-plugin-vuex": "~4.5.0", |
||||
"babel-eslint": "^10.1.0", |
"@vue/cli-service": "~4.5.0", |
||||
"babel-plugin-import": "^1.13.3", |
"@vue/compiler-sfc": "^3.1.5", |
||||
"babel-polyfill": "^6.26.0", |
"babel-eslint": "^10.1.0", |
||||
"dotenv": "^10.0.0", |
"babel-plugin-import": "^1.13.3", |
||||
"es6-promise": "^4.2.8", |
"babel-polyfill": "^6.26.0", |
||||
"eslint": "^6.7.2", |
"dotenv": "^10.0.0", |
||||
"eslint-plugin-vue": "^7.0.0", |
"es6-promise": "^4.2.8", |
||||
"sass": "^1.26.5", |
"eslint": "^6.7.2", |
||||
"sass-loader": "^8.0.2", |
"eslint-plugin-vue": "^7.0.0", |
||||
"vite": "2", |
"sass": "^1.26.5", |
||||
"vite-plugin-importer": "^0.2.5" |
"sass-loader": "^8.0.2", |
||||
} |
"vite": "2", |
||||
|
"vite-plugin-importer": "^0.2.5" |
||||
|
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,118 @@ |
|||||
|
// 集团api
|
||||
|
import service from '@/utils/request' |
||||
|
|
||||
|
// @Tags api
|
||||
|
// @Summary 获取集团详情 不分页
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const getgroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getgroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 获取子公司详情
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.CreateApiParams true "创建api"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/createApi [post]
|
||||
|
export const getsubsidiaryinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getsubsidiaryinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags menu
|
||||
|
// @Summary 添加集团信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.GetById true "添加集团信息"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /menu/getApiById [post]
|
||||
|
export const addgroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/addgroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 获取工段详情
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.CreateApiParams true "获取工段详情"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
|
// @Router /api/updateApi [post]
|
||||
|
export const getgrouppositioninfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/getgrouppositioninfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 修改集团信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body api.CreateApiParams true "修改集团信息"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
|
// @Router /group/eitegroupinfo [post]
|
||||
|
export const eitegroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/eitegroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 删除集团框架相应信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/delgroupinfo [post]
|
||||
|
export const delgroupinfo = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/delgroupinfo', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// @Tags Api
|
||||
|
// @Summary 获取集团架构
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body dbModel.Api true "获取集团架构"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /group/grouplist [get]
|
||||
|
export const grouplist = (data) => { |
||||
|
return service({ |
||||
|
url: '/group/grouplist', |
||||
|
method: 'get', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,156 @@ |
|||||
|
// 健康上报api
|
||||
|
import service from '@/utils/request' |
||||
|
|
||||
|
// @Tags api
|
||||
|
// @Summary 获取题目详情 不分页
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const getPostHealthlist = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/posthealthlist', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 获取企业当前正在运行的上报任务ID列表 不分页
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const getRunHealthList = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/runhealthlist', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 获取上报统计
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const getseportstatistics = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/getseportstatistics', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 获取通知人列表
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const noticeuserlist = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/noticeuserlist', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 根据ID查询报警人
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const looknoticeusercont = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/looknoticeusercont', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 添加被通知人信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const addnoticeuser = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/addnoticeuser', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 修改被通知人信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const eitenoticeuser = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/eitenoticeuser', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// @Tags api
|
||||
|
// @Summary 删除被通知人信息
|
||||
|
// @Security ApiKeyAuth
|
||||
|
// @accept application/json
|
||||
|
// @Produce application/json
|
||||
|
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
|
||||
|
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
|
// @Router /api/getApiList [post]
|
||||
|
// {
|
||||
|
// page int
|
||||
|
// pageSize int
|
||||
|
// }
|
||||
|
export const delnoticeuser = (data) => { |
||||
|
return service({ |
||||
|
url: '/wechathealth/delnoticeuser', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,143 @@ |
|||||
|
<template lang="html"> |
||||
|
<div class="editor"> |
||||
|
<div ref="toolbar" class="toolbar"> |
||||
|
</div> |
||||
|
<div ref="editor" class="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import E from 'wangeditor' |
||||
|
export default { |
||||
|
name: 'editoritem', |
||||
|
data() { |
||||
|
return { |
||||
|
// uploadPath, |
||||
|
editor: null, |
||||
|
info_: null |
||||
|
} |
||||
|
}, |
||||
|
model: { |
||||
|
prop: 'value', |
||||
|
event: 'change' |
||||
|
}, |
||||
|
props: { |
||||
|
value: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
isClear: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
isClear(val) { |
||||
|
// 触发清除文本域内容 |
||||
|
if (val) { |
||||
|
this.editor.txt.clear() |
||||
|
this.info_ = null |
||||
|
} |
||||
|
}, |
||||
|
value: function(value) { |
||||
|
if (value !== this.editor.txt.html()) { |
||||
|
this.editor.txt.html(this.value) |
||||
|
} |
||||
|
} |
||||
|
//value为编辑框输入的内容,这里我监听了一下值,当父组件调用得时候,如果给value赋值了,子组件将会显示父组件赋给的值 |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.seteditor() |
||||
|
this.editor.txt.html(this.value) |
||||
|
}, |
||||
|
methods: { |
||||
|
seteditor() { |
||||
|
// http://192.168.2.125:8080/admin/storage/create |
||||
|
this.editor = new E(this.$refs.toolbar, this.$refs.editor) |
||||
|
this.editor.customConfig.uploadImgShowBase64 = false // base 64 存储图片 |
||||
|
this.editor.customConfig.uploadImgServer = 'http://otp.cdinfotech.top/file/upload_images'// 配置服务器端地址 |
||||
|
this.editor.customConfig.uploadImgHeaders = { }// 自定义 header |
||||
|
this.editor.customConfig.uploadFileName = 'file' // 后端接受上传文件的参数名 |
||||
|
this.editor.customConfig.uploadImgMaxSize = 2 * 1024 * 1024 // 将图片大小限制为 2M |
||||
|
this.editor.customConfig.uploadImgMaxLength = 6 // 限制一次最多上传 3 张图片 |
||||
|
this.editor.customConfig.uploadImgTimeout = 3 * 60 * 1000 // 设置超时时间 |
||||
|
|
||||
|
// 配置菜单 |
||||
|
this.editor.customConfig.menus = [ |
||||
|
'head', // 标题 |
||||
|
'bold', // 粗体 |
||||
|
'fontSize', // 字号 |
||||
|
'fontName', // 字体 |
||||
|
'italic', // 斜体 |
||||
|
'underline', // 下划线 |
||||
|
'strikeThrough', // 删除线 |
||||
|
'foreColor', // 文字颜色 |
||||
|
'backColor', // 背景颜色 |
||||
|
'link', // 插入链接 |
||||
|
'list', // 列表 |
||||
|
'justify', // 对齐方式 |
||||
|
'quote', // 引用 |
||||
|
'emoticon', // 表情 |
||||
|
'image', // 插入图片 |
||||
|
'table', // 表格 |
||||
|
'video', // 插入视频 |
||||
|
'code', // 插入代码 |
||||
|
'undo', // 撤销 |
||||
|
'redo', // 重复 |
||||
|
'fullscreen' // 全屏 |
||||
|
] |
||||
|
|
||||
|
this.editor.customConfig.uploadImgHooks = { |
||||
|
fail: (xhr, editor, result) => { |
||||
|
// 插入图片失败回调 |
||||
|
}, |
||||
|
success: (xhr, editor, result) => { |
||||
|
// 图片上传成功回调 |
||||
|
}, |
||||
|
timeout: (xhr, editor) => { |
||||
|
// 网络超时的回调 |
||||
|
}, |
||||
|
error: (xhr, editor) => { |
||||
|
// 图片上传错误的回调 |
||||
|
}, |
||||
|
customInsert: (insertImg, result, editor) => { |
||||
|
// 插入图片的回调函数 |
||||
|
// 图片上传成功,插入图片的回调 |
||||
|
//result为上传图片成功的时候返回的数据,这里我打印了一下发现后台返回的是data:[{url:"路径的形式"},...] |
||||
|
// console.log(result.data[0].url) |
||||
|
//insertImg()为插入图片的函数 |
||||
|
//循环插入图片 |
||||
|
// for (let i = 0; i < 1; i++) { |
||||
|
// console.log(result) |
||||
|
let url = "http://otp.cdinfotech.top"+result.url |
||||
|
insertImg(url) |
||||
|
// } |
||||
|
} |
||||
|
} |
||||
|
this.editor.customConfig.onchange = (html) => { |
||||
|
this.info_ = html // 绑定当前逐渐地值 |
||||
|
this.$emit('change', this.info_) // 将内容同步到父组件中 |
||||
|
} |
||||
|
// 创建富文本编辑器 |
||||
|
this.editor.create() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="css"> |
||||
|
.editor { |
||||
|
width: 100%; |
||||
|
margin: 0 auto; |
||||
|
position: relative; |
||||
|
z-index: 0; |
||||
|
} |
||||
|
.toolbar { |
||||
|
border: 1px solid #ccc; |
||||
|
} |
||||
|
.text { |
||||
|
border: 1px solid #ccc; |
||||
|
min-height: 500px; |
||||
|
} |
||||
|
</style> |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,27 @@ |
|||||
|
(function (root, factory) { |
||||
|
if (typeof define === 'function' && define.amd) { |
||||
|
// AMD. Register as an anonymous module.
|
||||
|
define(['exports', 'echarts'], factory); |
||||
|
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { |
||||
|
// CommonJS
|
||||
|
factory(exports, require('echarts')); |
||||
|
} else { |
||||
|
// Browser globals
|
||||
|
factory({}, root.echarts); |
||||
|
} |
||||
|
}(this, function (exports, echarts) { |
||||
|
var log = function (msg) { |
||||
|
if (typeof console !== 'undefined') { |
||||
|
console && console.error && console.error(msg); |
||||
|
} |
||||
|
} |
||||
|
if (!echarts) { |
||||
|
log('ECharts is not Loaded'); |
||||
|
return; |
||||
|
} |
||||
|
if (!echarts.registerMap) { |
||||
|
log('ECharts Map is not loaded') |
||||
|
return; |
||||
|
} |
||||
|
echarts.registerMap('澳门', {"type":"FeatureCollection","features":[{"id":"820001","type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[["@@LADC^umZ@DONWE@DALBBF@H@DFBBTC"],["@@P@LC@AGM@OECMBABBTCD@DDH"]],"encodeOffsets":[[[116285,22746]],[[116303,22746]]]},"properties":{"cp":[113.552965,22.207882],"name":"花地玛堂区","childNum":2}},{"id":"820002","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@MK@CA@AAGDEB@NVFJG"],"encodeOffsets":[[116281,22734]]},"properties":{"cp":[113.549052,22.199175],"name":"花王堂区","childNum":1}},{"id":"820003","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@EGOB@DNLHE@C"],"encodeOffsets":[[116285,22729]]},"properties":{"cp":[113.550252,22.193791],"name":"望德堂区","childNum":1}},{"id":"820004","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@YMVAN@BFCBBDAFHDBBFDHIJJEFDPCHHlYJQ"],"encodeOffsets":[[116313,22707]]},"properties":{"cp":[113.55374,22.188119],"name":"大堂区","childNum":1}},{"id":"820005","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@JICGAECACGEBAAEDBFNXB@"],"encodeOffsets":[[116266,22728]]},"properties":{"cp":[113.54167,22.187778],"name":"风顺堂区","childNum":1}},{"id":"820006","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@INEL"],"encodeOffsets":[[116265,22694]]},"properties":{"cp":[113.558783,22.154124],"name":"嘉模堂区","childNum":1}},{"id":"820007","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBC@@FB@BDDDA\\M"],"encodeOffsets":[[116316,22676]]},"properties":{"cp":[113.56925,22.136546],"name":"路凼填海区","childNum":1}},{"id":"820008","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNPZK"],"encodeOffsets":[[116329,22670]]},"properties":{"cp":[113.559954,22.124049],"name":"圣方济各堂区","childNum":1}}],"UTF8Encoding":true}); |
||||
|
})); |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
{"type":"FeatureCollection","features":[{"id":"820001","type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[["@@LADC^umZ@DONWE@DALBBF@H@DFBBTC"],["@@P@LC@AGM@OECMBABBTCD@DDH"]],"encodeOffsets":[[[116285,22746]],[[116303,22746]]]},"properties":{"cp":[113.552965,22.207882],"name":"花地玛堂区","childNum":2}},{"id":"820002","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@MK@CA@AAGDEB@NVFJG"],"encodeOffsets":[[116281,22734]]},"properties":{"cp":[113.549052,22.199175],"name":"花王堂区","childNum":1}},{"id":"820003","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@EGOB@DNLHE@C"],"encodeOffsets":[[116285,22729]]},"properties":{"cp":[113.550252,22.193791],"name":"望德堂区","childNum":1}},{"id":"820004","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@YMVAN@BFCBBDAFHDBBFDHIJJEFDPCHHlYJQ"],"encodeOffsets":[[116313,22707]]},"properties":{"cp":[113.55374,22.188119],"name":"大堂区","childNum":1}},{"id":"820005","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@JICGAECACGEBAAEDBFNXB@"],"encodeOffsets":[[116266,22728]]},"properties":{"cp":[113.54167,22.187778],"name":"风顺堂区","childNum":1}},{"id":"820006","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@INEL"],"encodeOffsets":[[116265,22694]]},"properties":{"cp":[113.558783,22.154124],"name":"嘉模堂区","childNum":1}},{"id":"820007","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBC@@FB@BDDDA\\M"],"encodeOffsets":[[116316,22676]]},"properties":{"cp":[113.56925,22.136546],"name":"路凼填海区","childNum":1}},{"id":"820008","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNPZK"],"encodeOffsets":[[116329,22670]]},"properties":{"cp":[113.559954,22.124049],"name":"圣方济各堂区","childNum":1}}],"UTF8Encoding":true} |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,371 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!-- 数据提报表设置 --> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="名称"> |
||||
|
<el-input v-model="searchInfo.path" placeholder="请输入报表名称" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog('addApi')">新增</el-button> |
||||
|
<!-- <el-button size="mini" type="primary" icon="el-icon-upload" @click="openDialog('addApi')">导入员工数据</el-button> --> |
||||
|
<el-popover v-model:visible="deleteVisible" placement="top" width="160"> |
||||
|
<p>确定要删除吗?</p> |
||||
|
<div style="text-align: right; margin-top: 8px;"> |
||||
|
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button> |
||||
|
<el-button size="mini" type="primary" @click="onDelete">确定</el-button> |
||||
|
</div> |
||||
|
<template #reference> |
||||
|
<el-button icon="el-icon-delete" size="mini" :disabled="!apis.length" style="margin-left: 10px;">删除</el-button> |
||||
|
</template> |
||||
|
</el-popover> |
||||
|
</div> |
||||
|
<el-table :data="tableData" @sort-change="sortChange" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="55"/> |
||||
|
<el-table-column align="left" label="数据提报表名称" prop="ID"/> |
||||
|
<el-table-column align="left" label="发布时间" prop="path"/> |
||||
|
<el-table-column align="left" label="评分分配" prop="apiGroup"/> |
||||
|
<el-table-column align="left" label="发布人" prop="description"/> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
|
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="editApi(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteApi(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
:current-page="page" |
||||
|
:page-size="pageSize" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@current-change="handleCurrentChange" |
||||
|
@size-change="handleSizeChange" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="dialogTitle" width="40%"> |
||||
|
<el-form ref="apiForm" :model="form" :rules="rules" label-width="100px"> |
||||
|
<el-form-item label="数据提报表名称" prop="num"> |
||||
|
<el-input v-model="form.num" autocomplete="off"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item |
||||
|
v-for="(domain, index) in form.domains" |
||||
|
:label="'评分标准' + (index+1)" |
||||
|
:key="domain.key" |
||||
|
:prop="'domains.' + index + '.value'" |
||||
|
:rules="{ |
||||
|
required: true, message: '评分标准不能为空', trigger: 'blur' |
||||
|
}" |
||||
|
> |
||||
|
<el-input v-model="domain.value"></el-input><el-button @click.prevent="removeDomain(domain)">删除</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button @click="addDomain">新增评分标准</el-button> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="阅读量" prop="num"> |
||||
|
<div>{{form.domains}}</div> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
import { |
||||
|
getApiById, |
||||
|
getApiList, |
||||
|
createApi, |
||||
|
updateApi, |
||||
|
deleteApi, |
||||
|
deleteApisByIds |
||||
|
} from '@/api/api' |
||||
|
import infoList from '@/mixins/infoList' |
||||
|
// import EditorBar from '../../components/wangEnduit/index.vue' |
||||
|
import { toSQLLine } from '@/utils/stringFun' |
||||
|
import warningBar from '@/components/warningBar/warningBar.vue' |
||||
|
|
||||
|
const methodOptions = [ |
||||
|
{ |
||||
|
value: 'POST', |
||||
|
label: '创建', |
||||
|
type: 'success' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'GET', |
||||
|
label: '查看', |
||||
|
type: '' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'PUT', |
||||
|
label: '更新', |
||||
|
type: 'warning' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'DELETE', |
||||
|
label: '删除', |
||||
|
type: 'danger' |
||||
|
} |
||||
|
] |
||||
|
|
||||
|
export default { |
||||
|
name: 'Api', |
||||
|
components: { |
||||
|
// warningBar,EditorBar |
||||
|
warningBar |
||||
|
}, |
||||
|
mixins: [infoList], |
||||
|
data() { |
||||
|
return { |
||||
|
deleteVisible: false, |
||||
|
// listApi: getApiList, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增新闻', |
||||
|
apis: [], |
||||
|
form: { |
||||
|
domains: [{ |
||||
|
value: '' |
||||
|
}], |
||||
|
wxId:'', |
||||
|
jdId:'', |
||||
|
num:'', |
||||
|
name:'', |
||||
|
type:'', |
||||
|
birthDate:'', |
||||
|
onboardingDate:'', |
||||
|
password:'', |
||||
|
passwordTwo:'', |
||||
|
department:'', |
||||
|
post: '', |
||||
|
gender: '', |
||||
|
age: '', |
||||
|
certificate: '', |
||||
|
certificateNum: '', |
||||
|
phone: '', |
||||
|
state: '', |
||||
|
}, |
||||
|
methodOptions: methodOptions, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
path: [{ required: true, message: '请输入api路径', trigger: 'blur' }], |
||||
|
apiGroup: [ |
||||
|
{ required: true, message: '请输入组名称', trigger: 'blur' } |
||||
|
], |
||||
|
description: [ |
||||
|
{ required: true, message: '请输入api介绍', trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除控件 |
||||
|
removeDomain(item) { |
||||
|
var index = this.form.domains.indexOf(item) |
||||
|
if (index !== -1) { |
||||
|
this.form.domains.splice(index, 1) |
||||
|
} |
||||
|
}, |
||||
|
// 新增控件 |
||||
|
addDomain() { |
||||
|
this.form.domains.push({ |
||||
|
value: '', |
||||
|
key: Date.now() |
||||
|
}); |
||||
|
}, |
||||
|
methodFiletr(value) { |
||||
|
const target = methodOptions.filter(item => item.value === value)[0] |
||||
|
return target && `${target.label}` |
||||
|
}, |
||||
|
tagTypeFiletr(value) { |
||||
|
const target = methodOptions.filter(item => item.value === value)[0] |
||||
|
return target && `${target.type}` |
||||
|
}, |
||||
|
// 选中api |
||||
|
handleSelectionChange(val) { |
||||
|
this.apis = val |
||||
|
}, |
||||
|
async onDelete() { |
||||
|
const ids = this.apis.forEach(item => item.ID) |
||||
|
const res = await deleteApisByIds({ ids }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: res.msg |
||||
|
}) |
||||
|
if (this.tableData.length === ids.length && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.deleteVisible = false |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}, |
||||
|
// 排序 |
||||
|
sortChange({ prop, order }) { |
||||
|
if (prop) { |
||||
|
this.searchInfo.orderKey = toSQLLine(prop) |
||||
|
this.searchInfo.desc = order === 'descending' |
||||
|
} |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 搜索时调用 |
||||
|
// 条件搜索前端看此方法 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
initForm() { |
||||
|
this.$refs.apiForm.resetFields() |
||||
|
this.form = { |
||||
|
domains: [{ |
||||
|
value: '' |
||||
|
}], |
||||
|
path: '', |
||||
|
apiGroup: '', |
||||
|
method: '', |
||||
|
description: '' |
||||
|
} |
||||
|
}, |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
|
||||
|
}, |
||||
|
openDialog(type) { |
||||
|
switch (type) { |
||||
|
case 'addApi': |
||||
|
this.dialogTitle = '新增数据提报表' |
||||
|
break |
||||
|
case 'edit': |
||||
|
this.dialogTitle = '编辑新增数据提报表' |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
this.type = type |
||||
|
this.dialogFormVisible = true |
||||
|
}, |
||||
|
async editApi(row) { |
||||
|
const res = await getApiById({ id: row.ID }) |
||||
|
this.form = res.data.api |
||||
|
this.openDialog('edit') |
||||
|
}, |
||||
|
async deleteApi(row) { |
||||
|
this.$confirm('此操作将永久删除所有角色下该api, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const res = await deleteApi(row) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
if (this.tableData.length === 1 && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
async enterDialog() { |
||||
|
this.$refs.apiForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
switch (this.type) { |
||||
|
case 'addApi': |
||||
|
{ |
||||
|
const res = await createApi(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getTableData() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
|
||||
|
break |
||||
|
case 'edit': |
||||
|
{ |
||||
|
const res = await updateApi(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getTableData() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
break |
||||
|
default: |
||||
|
// eslint-disable-next-line no-lone-blocks |
||||
|
{ |
||||
|
this.$message({ |
||||
|
type: 'error', |
||||
|
message: '未知操作', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.el-input { |
||||
|
width: 220px; |
||||
|
} |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<router-view v-slot="{ Component }"> |
||||
|
<transition mode="out-in" name="el-fade-in-linear"> |
||||
|
<keep-alive :include="$store.getters['router/keepAliveRouters']"> |
||||
|
<component :is="Component" /> |
||||
|
</keep-alive> |
||||
|
</transition> |
||||
|
</router-view> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'dataReport' |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,331 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!-- 岗位管理 --> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="岗位名称"> |
||||
|
<el-input v-model="searchInfo.name" placeholder="请输入岗位名称" /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog('addApi')">新增</el-button> |
||||
|
<el-popover v-model:visible="deleteVisible" placement="top" width="160"> |
||||
|
<p>确定要删除吗?</p> |
||||
|
<div style="text-align: right; margin-top: 8px;"> |
||||
|
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button> |
||||
|
<el-button size="mini" type="primary" @click="onDelete">确定</el-button> |
||||
|
</div> |
||||
|
<template #reference> |
||||
|
<el-button icon="el-icon-delete" size="mini" :disabled="!apis.length" style="margin-left: 10px;">删除</el-button> |
||||
|
</template> |
||||
|
</el-popover> |
||||
|
</div> |
||||
|
<el-table :data="tableData" @sort-change="sortChange" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column |
||||
|
type="selection" |
||||
|
width="55" |
||||
|
/> |
||||
|
<el-table-column align="left" label="岗位名称" min-width="150" prop="name"/> |
||||
|
<el-table-column align="left" label="岗位权重" min-width="150" prop="weights"/> |
||||
|
<el-table-column align="left" label="岗位状态" min-width="150" prop="state"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row"></el-switch> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="editApi(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteApi(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
:current-page="page" |
||||
|
:page-size="pageSize" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@current-change="handleCurrentChange" |
||||
|
@size-change="handleSizeChange" |
||||
|
/> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="dialogTitle" width=20%> |
||||
|
|
||||
|
<el-form ref="apiForm" :model="form" :rules="rules" label-width="80px"> |
||||
|
<el-form-item label="岗位名称" prop="path"> |
||||
|
<el-input v-model="form.path" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位权重" prop="method"> |
||||
|
<el-input v-model="form.path" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="岗位状态" prop="apiGroup"> |
||||
|
<el-switch v-model="form.delivery"></el-switch> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
import { |
||||
|
getApiById, |
||||
|
getApiList, |
||||
|
createApi, |
||||
|
updateApi, |
||||
|
deleteApi, |
||||
|
deleteApisByIds |
||||
|
} from '@/api/api' |
||||
|
import infoList from '@/mixins/infoList' |
||||
|
import { toSQLLine } from '@/utils/stringFun' |
||||
|
import warningBar from '@/components/warningBar/warningBar.vue' |
||||
|
const methodOptions = [ |
||||
|
{ |
||||
|
value: 'POST', |
||||
|
label: '创建', |
||||
|
type: 'success' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'GET', |
||||
|
label: '查看', |
||||
|
type: '' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'PUT', |
||||
|
label: '更新', |
||||
|
type: 'warning' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'DELETE', |
||||
|
label: '删除', |
||||
|
type: 'danger' |
||||
|
} |
||||
|
] |
||||
|
|
||||
|
export default { |
||||
|
name: 'Api', |
||||
|
components: { |
||||
|
warningBar |
||||
|
}, |
||||
|
mixins: [infoList], |
||||
|
data() { |
||||
|
return { |
||||
|
deleteVisible: false, |
||||
|
// listApi: getApiList, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增', |
||||
|
apis: [], |
||||
|
form: { |
||||
|
path: '', |
||||
|
apiGroup: '', |
||||
|
method: '', |
||||
|
description: '' |
||||
|
}, |
||||
|
methodOptions: methodOptions, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
path: [{ required: true, message: '请输入api路径', trigger: 'blur' }], |
||||
|
apiGroup: [ |
||||
|
{ required: true, message: '请输入组名称', trigger: 'blur' } |
||||
|
], |
||||
|
method: [ |
||||
|
{ required: true, message: '请选择请求方式', trigger: 'blur' } |
||||
|
], |
||||
|
description: [ |
||||
|
{ required: true, message: '请输入api介绍', trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
methods: { |
||||
|
methodFiletr(value) { |
||||
|
const target = methodOptions.filter(item => item.value === value)[0] |
||||
|
return target && `${target.label}` |
||||
|
}, |
||||
|
tagTypeFiletr(value) { |
||||
|
const target = methodOptions.filter(item => item.value === value)[0] |
||||
|
return target && `${target.type}` |
||||
|
}, |
||||
|
// 选中api |
||||
|
handleSelectionChange(val) { |
||||
|
this.apis = val |
||||
|
}, |
||||
|
async onDelete() { |
||||
|
const ids = this.apis.forEach(item => item.ID) |
||||
|
const res = await deleteApisByIds({ ids }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: res.msg |
||||
|
}) |
||||
|
if (this.tableData.length === ids.length && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.deleteVisible = false |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}, |
||||
|
// 排序 |
||||
|
sortChange({ prop, order }) { |
||||
|
if (prop) { |
||||
|
this.searchInfo.orderKey = toSQLLine(prop) |
||||
|
this.searchInfo.desc = order === 'descending' |
||||
|
} |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索前端看此方法 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
initForm() { |
||||
|
this.$refs.apiForm.resetFields() |
||||
|
this.form = { |
||||
|
path: '', |
||||
|
apiGroup: '', |
||||
|
method: '', |
||||
|
description: '' |
||||
|
} |
||||
|
}, |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
|
||||
|
openDialog(type) { |
||||
|
switch (type) { |
||||
|
case 'addApi': |
||||
|
this.dialogTitle = '新增岗位信息' |
||||
|
break |
||||
|
case 'edit': |
||||
|
this.dialogTitle = '编辑岗位信息' |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
this.type = type |
||||
|
this.dialogFormVisible = true |
||||
|
}, |
||||
|
async editApi(row) { |
||||
|
const res = await getApiById({ id: row.ID }) |
||||
|
this.form = res.data.api |
||||
|
this.openDialog('edit') |
||||
|
}, |
||||
|
async deleteApi(row) { |
||||
|
this.$confirm('此操作将永久删除所有角色下该api, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const res = await deleteApi(row) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
if (this.tableData.length === 1 && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
async enterDialog() { |
||||
|
this.$refs.apiForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
switch (this.type) { |
||||
|
case 'addApi': |
||||
|
{ |
||||
|
const res = await createApi(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getTableData() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
|
||||
|
break |
||||
|
case 'edit': |
||||
|
{ |
||||
|
const res = await updateApi(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getTableData() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
break |
||||
|
default: |
||||
|
// eslint-disable-next-line no-lone-blocks |
||||
|
{ |
||||
|
this.$message({ |
||||
|
type: 'error', |
||||
|
message: '未知操作', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,506 @@ |
|||||
|
<template> |
||||
|
<!-- 员工管理 --> |
||||
|
<div> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="工段"> |
||||
|
<el-select v-model="searchInfo.workSection" clearable placeholder="请选择"> |
||||
|
<el-option value="1" label="a工段">a工段</el-option> |
||||
|
<el-option value="2" label="b工段">b工段</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="职务"> |
||||
|
<el-select v-model="searchInfo.method" clearable placeholder="职务"> |
||||
|
<el-option value="1" label="a职务">a职务</el-option> |
||||
|
<el-option value="2" label="b职务">b职务</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="员工姓名"> |
||||
|
<el-input v-model="searchInfo.path" placeholder="请输入员工姓名" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
<el-date-picker |
||||
|
v-model="value2" |
||||
|
align="right" |
||||
|
type="date" |
||||
|
placeholder="选择日期" |
||||
|
:picker-options="pickerOptions"> |
||||
|
</el-date-picker> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog('addApi')">新增</el-button> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-upload" @click="openDialog('addApi')">导入员工数据</el-button> |
||||
|
<el-popover v-model:visible="deleteVisible" placement="top" width="160"> |
||||
|
<p>确定要删除吗?</p> |
||||
|
<div style="text-align: right; margin-top: 8px;"> |
||||
|
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button> |
||||
|
<el-button size="mini" type="primary" @click="onDelete">确定</el-button> |
||||
|
</div> |
||||
|
<template #reference> |
||||
|
<el-button icon="el-icon-delete" size="mini" :disabled="!apis.length" style="margin-left: 10px;">删除</el-button> |
||||
|
</template> |
||||
|
</el-popover> |
||||
|
</div> |
||||
|
<el-table :data="tableData" @sort-change="sortChange" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column |
||||
|
type="selection" |
||||
|
width="55" |
||||
|
/> |
||||
|
<el-table-column align="left" label="编号" prop="ID"/> |
||||
|
<el-table-column align="left" label="姓名" prop="path"/> |
||||
|
<el-table-column align="left" label="归属" prop="apiGroup"/> |
||||
|
<el-table-column align="left" label="职务" prop="description"/> |
||||
|
<el-table-column align="left" label="班组" prop="method"/> |
||||
|
<el-table-column align="left" label="员工类别" prop="method"/> |
||||
|
<el-table-column align="left" label="雇佣状态" prop="method"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="状态" prop="method"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" label="企业微信ID" prop="method"/> |
||||
|
<el-table-column align="left" label="金蝶ID" prop="method"/> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="editApi(scope.row)" |
||||
|
>编辑</el-button> |
||||
|
<el-button |
||||
|
icon="el-icon-delete" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="deleteApi(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
:current-page="page" |
||||
|
:page-size="pageSize" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@current-change="handleCurrentChange" |
||||
|
@size-change="handleSizeChange" |
||||
|
/> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="dialogTitle" width="40%"> |
||||
|
<el-form ref="apiForm" :model="form" :rules="rules" label-width="85px"> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="职工编号" prop="num"> |
||||
|
<el-input style="width: 162px;" v-model="form.num" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="职工姓名" prop="name"> |
||||
|
<el-input style="width: 162px;" v-model="form.name" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="员工类别" prop="type"> |
||||
|
<el-select v-model="form.type" clearable placeholder="请选择员工类别"> |
||||
|
<el-option value="1" label="正式工">正式工</el-option> |
||||
|
<el-option value="2" label="合同工">合同工</el-option> |
||||
|
<el-option value="3" label="实习生">实习生</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="出生日期" prop="birthDate"> |
||||
|
<el-date-picker |
||||
|
v-model="form.birthDate" |
||||
|
align="right" |
||||
|
type="date" |
||||
|
format="YYYY/MM/DD" |
||||
|
value-format="x" |
||||
|
placeholder="选择出生日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="入职日期" prop="onboardingDate"> |
||||
|
<el-date-picker |
||||
|
v-model="form.onboardingDate" |
||||
|
type="date" |
||||
|
placeholder="选择入职日期" |
||||
|
format="YYYY/MM/DD" |
||||
|
value-format="x"> |
||||
|
</el-date-picker> |
||||
|
<!-- <el-date-picker v-model="form.onboardingDate" type="date" placeholder="选择入职日期"></el-date-picker> --> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="登录密码" prop="password"> |
||||
|
<el-input placeholder="请输入密码" v-model="form.password1" show-password></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="确认密码" prop="passwordTwo"> |
||||
|
<el-input placeholder="请输入密码" v-model="form.passwordTwo" show-password></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="所属部门" prop="department"> |
||||
|
<el-cascader |
||||
|
:options="options" |
||||
|
:props="{ checkStrictly: true }" |
||||
|
clearable></el-cascader> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="岗位" prop="past"> |
||||
|
<el-select v-model="form.past" clearable placeholder="岗位"> |
||||
|
<el-option value="1" label="a岗位">a岗位</el-option> |
||||
|
<el-option value="2" label="b岗位">b岗位</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="性别" prop="gender"> |
||||
|
<el-select v-model="form.gender" clearable placeholder="性别"> |
||||
|
<el-option value="1" label="a岗位">男 </el-option> |
||||
|
<el-option value="2" label="b岗位">女</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="年龄" prop="age"> |
||||
|
<el-input v-model="form.age" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="证件类型" prop="certificate"> |
||||
|
<el-select v-model="form.certificate" clearable placeholder="证件类型"> |
||||
|
<el-option value="1" label="身份证">身份证</el-option> |
||||
|
<el-option value="2" label="驾驶证">驾驶证</el-option> |
||||
|
<el-option value="3" label="军人证">军人证</el-option> |
||||
|
<el-option value="4" label="护照">居住证</el-option> |
||||
|
<el-option value="5" label="居住证">护照</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="证件号" prop="certificateNum"> |
||||
|
<el-input v-model="form.certificateNum" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="联系方式" prop="phone"> |
||||
|
<el-input v-model="form.phone" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
|
||||
|
<el-form-item label="雇佣状态" prop="state"> |
||||
|
<!-- <el-select v-model="from.state" clearable placeholder="雇佣状态"> |
||||
|
<el-option value="1" label="在职">在职</el-option> |
||||
|
<el-option value="2" label="离职">离职</el-option> |
||||
|
</el-select> --> |
||||
|
<el-select v-model="form.state" clearable placeholder="请选择雇佣状态"> |
||||
|
<el-option value="1" label="在职">在职</el-option> |
||||
|
<el-option value="2" label="离职">离职</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="企业微信ID" prop="phone"> |
||||
|
<el-input v-model="form.wxId" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
|
||||
|
<el-form-item label="金蝶ID" prop="state"> |
||||
|
<el-input v-model="form.jdId" autocomplete="off" /> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
import { |
||||
|
getApiById, |
||||
|
getApiList, |
||||
|
createApi, |
||||
|
updateApi, |
||||
|
deleteApi, |
||||
|
deleteApisByIds |
||||
|
} from '@/api/api' |
||||
|
import infoList from '@/mixins/infoList' |
||||
|
import { toSQLLine } from '@/utils/stringFun' |
||||
|
import warningBar from '@/components/warningBar/warningBar.vue' |
||||
|
const methodOptions = [ |
||||
|
{ |
||||
|
value: 'POST', |
||||
|
label: '创建', |
||||
|
type: 'success' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'GET', |
||||
|
label: '查看', |
||||
|
type: '' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'PUT', |
||||
|
label: '更新', |
||||
|
type: 'warning' |
||||
|
}, |
||||
|
{ |
||||
|
value: 'DELETE', |
||||
|
label: '删除', |
||||
|
type: 'danger' |
||||
|
} |
||||
|
] |
||||
|
|
||||
|
export default { |
||||
|
name: 'staff', |
||||
|
components: { |
||||
|
warningBar |
||||
|
}, |
||||
|
mixins: [infoList], |
||||
|
data() { |
||||
|
return { |
||||
|
deleteVisible: false, |
||||
|
// listApi: getApiList, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增', |
||||
|
apis: [], |
||||
|
form: { |
||||
|
wxId:'', |
||||
|
jdId:'', |
||||
|
num:'', |
||||
|
name:'', |
||||
|
type:'', |
||||
|
birthDate:'', |
||||
|
onboardingDate:'', |
||||
|
password:'', |
||||
|
passwordTwo:'', |
||||
|
department:'', |
||||
|
post: '', |
||||
|
gender: '', |
||||
|
age: '', |
||||
|
certificate: '', |
||||
|
certificateNum: '', |
||||
|
phone: '', |
||||
|
state: '', |
||||
|
}, |
||||
|
methodOptions: methodOptions, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
path: [{ required: true, message: '请输入api路径', trigger: 'blur' }], |
||||
|
apiGroup: [ |
||||
|
{ required: true, message: '请输入组名称', trigger: 'blur' } |
||||
|
], |
||||
|
description: [ |
||||
|
{ required: true, message: '请输入api介绍', trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
methods: { |
||||
|
methodFiletr(value) { |
||||
|
const target = methodOptions.filter(item => item.value === value)[0] |
||||
|
return target && `${target.label}` |
||||
|
}, |
||||
|
tagTypeFiletr(value) { |
||||
|
const target = methodOptions.filter(item => item.value === value)[0] |
||||
|
return target && `${target.type}` |
||||
|
}, |
||||
|
// 选中api |
||||
|
handleSelectionChange(val) { |
||||
|
this.apis = val |
||||
|
}, |
||||
|
async onDelete() { |
||||
|
const ids = this.apis.forEach(item => item.ID) |
||||
|
const res = await deleteApisByIds({ ids }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: res.msg |
||||
|
}) |
||||
|
if (this.tableData.length === ids.length && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.deleteVisible = false |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}, |
||||
|
// 排序 |
||||
|
sortChange({ prop, order }) { |
||||
|
if (prop) { |
||||
|
this.searchInfo.orderKey = toSQLLine(prop) |
||||
|
this.searchInfo.desc = order === 'descending' |
||||
|
} |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索前端看此方法 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
initForm() { |
||||
|
this.$refs.apiForm.resetFields() |
||||
|
this.form = { |
||||
|
path: '', |
||||
|
apiGroup: '', |
||||
|
method: '', |
||||
|
description: '' |
||||
|
} |
||||
|
}, |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
openDialog(type) { |
||||
|
switch (type) { |
||||
|
case 'addApi': |
||||
|
this.dialogTitle = '新增员工信息' |
||||
|
break |
||||
|
case 'edit': |
||||
|
this.dialogTitle = '编辑员工信息' |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
this.type = type |
||||
|
this.dialogFormVisible = true |
||||
|
}, |
||||
|
async editApi(row) { |
||||
|
const res = await getApiById({ id: row.ID }) |
||||
|
this.form = res.data.api |
||||
|
this.openDialog('edit') |
||||
|
}, |
||||
|
async deleteApi(row) { |
||||
|
this.$confirm('此操作将永久删除所有角色下该api, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const res = await deleteApi(row) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
if (this.tableData.length === 1 && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
async enterDialog() { |
||||
|
this.$refs.apiForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
switch (this.type) { |
||||
|
case 'addApi': |
||||
|
{ |
||||
|
const res = await createApi(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getTableData() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
|
||||
|
break |
||||
|
case 'edit': |
||||
|
{ |
||||
|
const res = await updateApi(this.form) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '编辑成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getTableData() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
break |
||||
|
default: |
||||
|
// eslint-disable-next-line no-lone-blocks |
||||
|
{ |
||||
|
this.$message({ |
||||
|
type: 'error', |
||||
|
message: '未知操作', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.el-input { |
||||
|
width: 220px; |
||||
|
} |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<router-view v-slot="{ Component }"> |
||||
|
<transition mode="out-in" name="el-fade-in-linear"> |
||||
|
<keep-alive :include="$store.getters['router/keepAliveRouters']"> |
||||
|
<component :is="Component" /> |
||||
|
</keep-alive> |
||||
|
</transition> |
||||
|
</router-view> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'healthy' |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,183 @@ |
|||||
|
<template> |
||||
|
<div class="echarts"> |
||||
|
<div id="main" style="width:100%; height:500px"></div> |
||||
|
<div :style="{height:'400px',width:'100%'}" ref="myEchart"></div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import "../map/shandong.js"; |
||||
|
import obj from "../map/shandong.json"; |
||||
|
import echarts from "echarts"; |
||||
|
// import '../../node_modules/echarts/map/js/world.js' |
||||
|
import '../../../utils/map/js/china' // 引入中国地图数据 |
||||
|
export default { |
||||
|
name: "echarts", |
||||
|
props: ["userJson"], |
||||
|
data() { |
||||
|
return { |
||||
|
listArr: [], //城市json |
||||
|
max: "", //最大value值 |
||||
|
min: "" ,// 最小value值 |
||||
|
chart: null |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getData(); |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.DrawMap(); |
||||
|
this.chinaConfigure(); |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
if (!this.chart) { |
||||
|
return; |
||||
|
} |
||||
|
this.chart.dispose(); |
||||
|
this.chart = null; |
||||
|
}, |
||||
|
methods: { |
||||
|
chinaConfigure() { |
||||
|
console.log(this.userJson) |
||||
|
let myChart = echarts.init(this.$refs.myEchart); //这里是为了获得容器所在位置 |
||||
|
window.onresize = myChart.resize; |
||||
|
myChart.setOption({ // 进行相关配置 |
||||
|
backgroundColor: "#02AFDB", |
||||
|
tooltip: {}, // 鼠标移到图里面的浮动提示框 |
||||
|
dataRange: { |
||||
|
show: false, |
||||
|
min: 0, |
||||
|
max: 1000, |
||||
|
text: ['High', 'Low'], |
||||
|
realtime: true, |
||||
|
calculable: true, |
||||
|
color: ['orangered', 'yellow', 'lightskyblue'] |
||||
|
}, |
||||
|
geo: { // 这个是重点配置区 |
||||
|
map: 'china', // 表示中国地图 |
||||
|
roam: true, |
||||
|
label: { |
||||
|
normal: { |
||||
|
show: true, // 是否显示对应地名 |
||||
|
textStyle: { |
||||
|
color: 'rgba(0,0,0,0.4)' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
borderColor: 'rgba(0, 0, 0, 0.2)' |
||||
|
}, |
||||
|
emphasis: { |
||||
|
areaColor: null, |
||||
|
shadowOffsetX: 0, |
||||
|
shadowOffsetY: 0, |
||||
|
shadowBlur: 20, |
||||
|
borderWidth: 0, |
||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
series: [{ |
||||
|
type: 'scatter', |
||||
|
coordinateSystem: 'geo' // 对应上方配置 |
||||
|
}, |
||||
|
{ |
||||
|
name: '启动次数', // 浮动框的标题 |
||||
|
type: 'map', |
||||
|
geoIndex: 0, |
||||
|
data: [{ |
||||
|
"name": "北京", |
||||
|
"value": 599 |
||||
|
}, { |
||||
|
"name": "上海", |
||||
|
"value": 142 |
||||
|
}, { |
||||
|
"name": "黑龙江", |
||||
|
"value": 44 |
||||
|
}, { |
||||
|
"name": "深圳", |
||||
|
"value": 92 |
||||
|
}, { |
||||
|
"name": "湖北", |
||||
|
"value": 810 |
||||
|
}, { |
||||
|
"name": "四川", |
||||
|
"value": 453 |
||||
|
}] |
||||
|
} |
||||
|
] |
||||
|
}) |
||||
|
}, |
||||
|
getData() { |
||||
|
// 获取城市名称数据 |
||||
|
console.log("取到的山东省的json数据", obj); |
||||
|
if (obj) { |
||||
|
let arr = obj.features; |
||||
|
// 循环取出 城市名称和value值 |
||||
|
for (var j = 0; j < arr.length; j++) { |
||||
|
this.max = arr[0].id; |
||||
|
this.min = arr[0].id; |
||||
|
if (arr[j].id > this.max) { |
||||
|
this.max = arr[j].id; |
||||
|
} |
||||
|
if (arr[j].id < this.min) { |
||||
|
this.min = arr[j].id; |
||||
|
} |
||||
|
this.listArr.push({ |
||||
|
name: arr[j].properties.name, |
||||
|
value: arr[j].id |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
DrawMap() { |
||||
|
let _this = this; |
||||
|
let myChart8 = this.$echarts.init(document.getElementById("main")); |
||||
|
console.log( |
||||
|
"最大value值", |
||||
|
this.max, |
||||
|
"\n", |
||||
|
"最小value值", |
||||
|
this.min, |
||||
|
"\n", |
||||
|
"城市数据", |
||||
|
this.listArr |
||||
|
); |
||||
|
myChart8.setOption({ |
||||
|
visualMap: { |
||||
|
min: _this.min, |
||||
|
max: _this.max, |
||||
|
show: false, |
||||
|
inRange: { |
||||
|
// color: ["lightskyblue", "yellow", "orangered"] |
||||
|
color: ["white"] |
||||
|
} |
||||
|
}, |
||||
|
series: [ |
||||
|
{ |
||||
|
type: "map", |
||||
|
map: "山东", |
||||
|
itemStyle: { |
||||
|
normal: { label: { show: true } }, |
||||
|
emphasis: { label: { show: true } }, |
||||
|
emphasis: { |
||||
|
areaColor: "#67C23A" //鼠标进入时的颜色 |
||||
|
} |
||||
|
}, |
||||
|
data: _this.listArr |
||||
|
} |
||||
|
] |
||||
|
}); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
.o-echarts { |
||||
|
min-width: 30px; |
||||
|
min-height: 30px; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
</style> |
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,235 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog('add')">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column label="姓名" prop="user_name" /> |
||||
|
<el-table-column label="微信UID" prop="user_wechat" /> |
||||
|
<el-table-column label="状态" prop="state"> |
||||
|
<template #default="scope"> |
||||
|
<div> |
||||
|
<el-switch :active-value="1" :inactive-value="2" v-model="scope.row.state" disabled /> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button icon="el-icon-edit" size="small" type="text" @click="editOperate(scope.row)">修改</el-button> |
||||
|
<el-button icon="el-icon-delete" size="small" type="text" @click="deleteOperate(scope.row)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- 新增弹窗 --> |
||||
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="dialogTitle" width="20%"> |
||||
|
<el-form ref="addForm" :model="addform" :rules="rules" label-width="80px"> |
||||
|
<el-form-item label="姓名" prop="user_name"> |
||||
|
<el-input v-model="addform.user_name" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="微信UID" prop="user_wechat"> |
||||
|
<el-input v-model="addform.user_wechat" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="add">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 修改弹窗 --> |
||||
|
<el-dialog v-model="editDialogFormVisible" :before-close="closeEditDialog" title="修改通知人" width="20%"> |
||||
|
<el-form ref="editForm" :model="editForm" :rules="editRules" label-width="80px"> |
||||
|
<el-form-item label="姓名" prop="user_name"> |
||||
|
<el-input v-model="editForm.user_name" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="微信UID" prop="user_wechat"> |
||||
|
<el-input v-model="editForm.user_wechat" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeEditDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="edit">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
import { |
||||
|
noticeuserlist, |
||||
|
looknoticeusercont, |
||||
|
delnoticeuser, |
||||
|
eitenoticeuser, |
||||
|
addnoticeuser |
||||
|
} from '@/api/healthy' |
||||
|
|
||||
|
export default { |
||||
|
name: 'Notify', |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
tableData:'', |
||||
|
editDialogFormVisible:false, |
||||
|
deleteVisible: false, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增通知人', |
||||
|
apis: [], |
||||
|
addform: { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
}, |
||||
|
editForm: { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
}, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
user_name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
|
user_wechat: [{ required: true, message: '请输入微信UID', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules: { |
||||
|
user_name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
|
user_wechat: [{ required: true, message: '请输入微信UID', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getNoticeuserList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const res = await delnoticeuser({ id: row.id }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getNoticeuserList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 修改操作 |
||||
|
edit(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitenoticeuser(this.editForm) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getNoticeuserList() |
||||
|
this.closeEditDialog() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增操作 |
||||
|
add(){ |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await addnoticeuser(this.addform) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getNoticeuserList() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增/编辑 |
||||
|
openDialog(type) { |
||||
|
switch (type) { |
||||
|
case 'add': |
||||
|
this.dialogTitle = '新增通知人' |
||||
|
break |
||||
|
case 'edit': |
||||
|
this.dialogTitle = '编辑通知人' |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
this.type = type |
||||
|
this.dialogFormVisible = true |
||||
|
}, |
||||
|
|
||||
|
// 获取通知人列表 |
||||
|
async getNoticeuserList(){ |
||||
|
const res=await noticeuserlist() |
||||
|
if(res.code==0){ |
||||
|
this.tableData=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 点击修改事件 |
||||
|
async editOperate(row) { |
||||
|
const res = await looknoticeusercont({ id: row.id }) |
||||
|
this.editForm = res.data |
||||
|
this.editDialogFormVisible=true |
||||
|
}, |
||||
|
|
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
|
||||
|
// 新增form清空 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.addform = { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
} |
||||
|
}, |
||||
|
// 修改form清空 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editForm = { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
} |
||||
|
}, |
||||
|
// 关闭添加弹框事件 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 关闭修改弹框事件 |
||||
|
closeEditDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,217 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<div class="gva-search-box"> |
||||
|
<el-form ref="searchForm" :inline="true" :model="searchInfo"> |
||||
|
<el-form-item label="姓名"> |
||||
|
<el-input clearable v-model="searchInfo.name" placeholder="请输入姓名" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否异常"> |
||||
|
<el-select clearable v-model="searchInfo.istrue" placeholder="请选择"> |
||||
|
<el-option label="正常" :value=1></el-option> |
||||
|
<el-option label="异常" :value=2></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="归属公司"> |
||||
|
<el-select v-model="searchInfo.groupId" clearable placeholder="请选择所属公司"> |
||||
|
<el-option |
||||
|
v-for="item in groupList" |
||||
|
:key="item.id" |
||||
|
:label="item.name" |
||||
|
:value="item.id" |
||||
|
> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
|
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="选择日期"> |
||||
|
<el-date-picker |
||||
|
v-model="searchInfo.time" |
||||
|
type="date" |
||||
|
placeholder="请选择上传日期" |
||||
|
format="YYYY/MM/DD" |
||||
|
value-format="YYYY-MM-DD" |
||||
|
> |
||||
|
</el-date-picker> |
||||
|
<!-- <el-date-picker |
||||
|
v-model="searchInfo.time" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> --> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
||||
|
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div class="gva-table-box"> |
||||
|
|
||||
|
<el-table :data="tableData" @sort-change="sortChange" @selection-change="handleSelectionChange"> |
||||
|
|
||||
|
<el-table-column label="姓名" prop="name" /> |
||||
|
<el-table-column label="所在公司" prop="ID"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.group}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="所在部门" prop="ID"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.department}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="工号" prop="jobnumber" /> |
||||
|
<!-- <el-table-column label="是否上传行程码" prop="ID" /> --> |
||||
|
<el-table-column label="是否异常" prop="isabnormal"> |
||||
|
<template #default="scope"> |
||||
|
<div> |
||||
|
<el-tag v-if="scope.row.isabnormal==1">正常</el-tag> |
||||
|
<el-tag v-else-if="scope.row.isabnormal==2" type="danger">异常</el-tag> |
||||
|
<el-tag v-else type="info">未知</el-tag> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="异常详情" prop="abnormalcont" /> |
||||
|
<el-table-column label="上传日期" prop="date" /> |
||||
|
</el-table> |
||||
|
<div class="gva-pagination"> |
||||
|
<el-pagination |
||||
|
:current-page="page" |
||||
|
:page-size="pageSize" |
||||
|
:page-sizes="[10, 30, 50, 100]" |
||||
|
:total="total" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@current-change="handleCurrentChange" |
||||
|
@size-change="handleSizeChange" |
||||
|
> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
import { |
||||
|
getseportstatistics, |
||||
|
|
||||
|
} from '@/api/healthy' |
||||
|
import { |
||||
|
grouplist, |
||||
|
} from '@/api/group' |
||||
|
import infoList from '@/mixins/infoList' |
||||
|
|
||||
|
export default { |
||||
|
name: 'Api', |
||||
|
|
||||
|
mixins: [infoList], |
||||
|
data() { |
||||
|
return { |
||||
|
groupList:"", |
||||
|
deleteVisible: false, |
||||
|
listApi: getseportstatistics, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增Api', |
||||
|
apis: [], |
||||
|
form: { |
||||
|
path: '', |
||||
|
apiGroup: '', |
||||
|
method: '', |
||||
|
description: '' |
||||
|
}, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
path: [{ required: true, message: '请输入api路径', trigger: 'blur' }], |
||||
|
apiGroup: [ |
||||
|
{ required: true, message: '请输入组名称', trigger: 'blur' } |
||||
|
], |
||||
|
method: [ |
||||
|
{ required: true, message: '请选择请求方式', trigger: 'blur' } |
||||
|
], |
||||
|
description: [ |
||||
|
{ required: true, message: '请输入api介绍', trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getTableData() |
||||
|
this.getGroupList() |
||||
|
// this.getseportstatisticsList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取公司架构 |
||||
|
async getGroupList(){ |
||||
|
const res=await grouplist() |
||||
|
if(res.code==0){ |
||||
|
this.groupList=res.data.list |
||||
|
} |
||||
|
}, |
||||
|
// getseportstatisticsList(){ |
||||
|
// const res = await getseportstatistics() |
||||
|
// if (res.code==0) { |
||||
|
// } else { |
||||
|
|
||||
|
// } |
||||
|
// }, |
||||
|
// 选中api |
||||
|
handleSelectionChange(val) { |
||||
|
this.apis = val |
||||
|
}, |
||||
|
async onDelete() { |
||||
|
const ids = this.apis.forEach(item => item.ID) |
||||
|
const res = await deleteApisByIds({ ids }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: res.msg |
||||
|
}) |
||||
|
if (this.tableData.length === ids.length && this.page > 1) { |
||||
|
this.page-- |
||||
|
} |
||||
|
this.deleteVisible = false |
||||
|
this.getTableData() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
// 条件搜索前端看此方法 |
||||
|
onSubmit() { |
||||
|
this.page = 1 |
||||
|
this.pageSize = 10 |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
initForm() { |
||||
|
this.$refs.apiForm.resetFields() |
||||
|
this.form = { |
||||
|
path: '', |
||||
|
apiGroup: '', |
||||
|
method: '', |
||||
|
description: '' |
||||
|
} |
||||
|
}, |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,156 @@ |
|||||
|
<template> |
||||
|
<!-- 健康报警设置 --> |
||||
|
<div class="upload"> |
||||
|
<div class="gva-table-box"> |
||||
|
<el-table :data="topicList"> |
||||
|
<el-table-column label="题目ID" prop="question_id" width='100' align="center"/> |
||||
|
<el-table-column label="题目" prop="title" width='600' align="center"/> |
||||
|
<el-table-column label="选项" prop="option_list"> |
||||
|
<template #default="scope"> |
||||
|
<el-tag v-for="(val,key) in scope.row.option_list"> |
||||
|
{{val.option_text}} |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="报警值" prop="ID" /> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button |
||||
|
icon="el-icon-edit" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
@click="edit(scope.row)" |
||||
|
>设置报警值</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<el-dialog width="20%" v-model="dialogFormVisible" :before-close="closeDialog" :title="dialogTitle"> |
||||
|
<el-form ref="apiForm" :model="form" :rules="rules" label-width="100px"> |
||||
|
<el-form-item label="报警值" prop="path"> |
||||
|
<el-radio v-for="(val,key) in valList" v-model="radio" :label="val.option_id">{{val.option_text}}</el-radio> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
const path = import.meta.env.VITE_BASE_API |
||||
|
import { mapGetters } from 'vuex' |
||||
|
// import infoList from '@/mixins/infoList' |
||||
|
import { exportExcel, loadExcelData, downloadTemplate } from '@/api/excel' |
||||
|
import { getPostHealthlist,getRunHealthList } from '@/api/healthy' |
||||
|
export default { |
||||
|
name: 'Excel', |
||||
|
// mixins: [infoList], |
||||
|
data() { |
||||
|
return { |
||||
|
radio:'', |
||||
|
valList:[], |
||||
|
dialogFormVisible:false, |
||||
|
topicList:'', |
||||
|
searchInfo:{ |
||||
|
date:'', |
||||
|
jobid:'', |
||||
|
}, |
||||
|
yearMD:'', |
||||
|
// listApi: getPostHealthlist, |
||||
|
path: path, |
||||
|
runHealthListFrom:{ |
||||
|
page:0, |
||||
|
pagesize:100 |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
...mapGetters('user', ['userInfo', 'token']) |
||||
|
}, |
||||
|
created() { |
||||
|
this.getRunHealthList() |
||||
|
|
||||
|
// this.getTableData() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 关闭弹窗事件 |
||||
|
closeDialog() { |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 点击设置报警值事件 |
||||
|
edit(e){ |
||||
|
this.valList=e.option_list; |
||||
|
this.dialogFormVisible=true; |
||||
|
}, |
||||
|
// 获取jobid |
||||
|
async getRunHealthList(){ |
||||
|
const res = await getRunHealthList( this.runHealthListFrom ) |
||||
|
this.searchInfo.jobid=res.data[0]; |
||||
|
this.addData() |
||||
|
this.getList() |
||||
|
}, |
||||
|
// 获取题目列表 |
||||
|
async getList(){ |
||||
|
const res = await getPostHealthlist(this.searchInfo) |
||||
|
this.topicList=res.data.question_templates |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
// 把jobid放入查询条件 |
||||
|
async addData(){ |
||||
|
// 获取当前日期 |
||||
|
let year = new Date().getFullYear();//年 |
||||
|
let month = new Date().getMonth() +1;//注意!月份是从0月开始获取的,所以要+1; |
||||
|
let day = new Date().getDate();//日 |
||||
|
let hour = new Date().getHours();//时 |
||||
|
let minute = new Date().getMinutes();//分 |
||||
|
let second = new Date().getSeconds();//秒 |
||||
|
//拼接日期 YYYY-MM-DD HH:mm:ss |
||||
|
this.yearMD = |
||||
|
year + |
||||
|
'-' + |
||||
|
(month >=10 ? month:'0'+ month) + |
||||
|
'-' + |
||||
|
(day >=10 ? day:'0' + day); |
||||
|
this.Hms = |
||||
|
(hour >= 10 ? hour:'0' + hour) |
||||
|
+ ':' + |
||||
|
(minute >=10 ? minute:'0' + minute) |
||||
|
+ ':' + |
||||
|
(second >=10 ? second:'0' + second); |
||||
|
|
||||
|
this.searchInfo.date=this.yearMD; |
||||
|
}, |
||||
|
handleExcelExport(fileName) { |
||||
|
if (!fileName || typeof fileName !== 'string') { |
||||
|
fileName = 'ExcelExport.xlsx' |
||||
|
} |
||||
|
exportExcel(this.tableData, fileName) |
||||
|
}, |
||||
|
loadExcel() { |
||||
|
this.listApi = loadExcelData |
||||
|
this.getTableData() |
||||
|
}, |
||||
|
downloadExcelTemplate() { |
||||
|
downloadTemplate('ExcelTemplate.xlsx') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.btn-list{ |
||||
|
display: flex; |
||||
|
margin-bottom: 12px; |
||||
|
justify-content: flex-end; |
||||
|
|
||||
|
} |
||||
|
.excel-btn+.excel-btn{ |
||||
|
margin-left: 10px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,236 @@ |
|||||
|
<template> |
||||
|
<!-- 知识库 --> |
||||
|
<div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog('add')">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column label="栏目名称" prop="user_name" /> |
||||
|
<el-table-column label="排序" prop="user_wechat" /> |
||||
|
<el-table-column label="状态" prop="state"> |
||||
|
<template #default="scope"> |
||||
|
<div> |
||||
|
<el-switch :active-value="1" :inactive-value="2" v-model="scope.row.state" disabled /> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button icon="el-icon-edit" size="small" type="text" @click="editOperate(scope.row)">修改</el-button> |
||||
|
<el-button icon="el-icon-delete" size="small" type="text" @click="deleteOperate(scope.row)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- 新增弹窗 --> |
||||
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="新增顶级栏目" width="20%"> |
||||
|
<el-form ref="addForm" :model="addform" :rules="rules" label-width="80px"> |
||||
|
<el-form-item label="栏目名称" prop="user_name"> |
||||
|
<el-input v-model="addform.user_name" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="序号" prop="user_wechat"> |
||||
|
<el-input v-model="addform.user_wechat" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="add">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 修改弹窗 --> |
||||
|
<el-dialog v-model="editDialogFormVisible" :before-close="closeEditDialog" title="修改顶级栏目" width="20%"> |
||||
|
<el-form ref="editForm" :model="editForm" :rules="editRules" label-width="80px"> |
||||
|
<el-form-item label="栏目名称" prop="user_name"> |
||||
|
<el-input v-model="editForm.user_name" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="序号" prop="user_wechat"> |
||||
|
<el-input v-model="editForm.user_wechat" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeEditDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="edit">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
import { |
||||
|
noticeuserlist, |
||||
|
looknoticeusercont, |
||||
|
delnoticeuser, |
||||
|
eitenoticeuser, |
||||
|
addnoticeuser |
||||
|
} from '@/api/healthy' |
||||
|
|
||||
|
export default { |
||||
|
name: 'Classrooom', |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
tableData:'', |
||||
|
editDialogFormVisible:false, |
||||
|
deleteVisible: false, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增通知人', |
||||
|
apis: [], |
||||
|
addform: { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
}, |
||||
|
editForm: { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
}, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
user_name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
|
user_wechat: [{ required: true, message: '请输入微信UID', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules: { |
||||
|
user_name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
|
user_wechat: [{ required: true, message: '请输入微信UID', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getNoticeuserList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const res = await delnoticeuser({ id: row.id }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getNoticeuserList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 修改操作 |
||||
|
edit(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitenoticeuser(this.editForm) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getNoticeuserList() |
||||
|
this.closeEditDialog() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增操作 |
||||
|
add(){ |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await addnoticeuser(this.addform) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getNoticeuserList() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增/编辑 |
||||
|
openDialog(type) { |
||||
|
switch (type) { |
||||
|
case 'add': |
||||
|
this.dialogTitle = '新增通知人' |
||||
|
break |
||||
|
case 'edit': |
||||
|
this.dialogTitle = '编辑通知人' |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
this.type = type |
||||
|
this.dialogFormVisible = true |
||||
|
}, |
||||
|
|
||||
|
// 获取通知人列表 |
||||
|
async getNoticeuserList(){ |
||||
|
const res=await noticeuserlist() |
||||
|
if(res.code==0){ |
||||
|
this.tableData=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 点击修改事件 |
||||
|
async editOperate(row) { |
||||
|
const res = await looknoticeusercont({ id: row.id }) |
||||
|
this.editForm = res.data |
||||
|
this.editDialogFormVisible=true |
||||
|
}, |
||||
|
|
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
|
||||
|
// 新增form清空 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.addform = { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
} |
||||
|
}, |
||||
|
// 修改form清空 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editForm = { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
} |
||||
|
}, |
||||
|
// 关闭添加弹框事件 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 关闭修改弹框事件 |
||||
|
closeEditDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,298 @@ |
|||||
|
<template> |
||||
|
<!-- 恒信动态 --> |
||||
|
<div> |
||||
|
<div class="gva-table-box"> |
||||
|
<div class="gva-btn-list"> |
||||
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog('add')">新增</el-button> |
||||
|
</div> |
||||
|
<el-table :data="tableData"> |
||||
|
<el-table-column label="栏目名称" prop="columnr_name" /> |
||||
|
<el-table-column label="排序" prop="sort" /> |
||||
|
<el-table-column label="状态" prop="state" center> |
||||
|
<template #default="scope"> |
||||
|
<div> |
||||
|
<el-switch style="display: block" v-model="scope.row.state" active-color="#13ce66" inactive-color="#ff4949" active-text="启用" inactive-text="禁用"></el-switch> |
||||
|
<!-- <el-switch :active-value="1" :inactive-value="2" v-model="scope.row.state" disabled /> --> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column align="left" fixed="right" label="操作" width="200"> |
||||
|
<template #default="scope"> |
||||
|
<el-button icon="el-icon-edit" size="small" type="text" @click="editOperate(scope.row)">修改</el-button> |
||||
|
<el-button icon="el-icon-delete" size="small" type="text" @click="deleteOperate(scope.row)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- 新增弹窗 --> |
||||
|
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="新增顶级栏目" width="20%"> |
||||
|
<el-form ref="addForm" :model="addform" :rules="rules" label-width="80px"> |
||||
|
<el-form-item label="栏目名称" prop="user_name"> |
||||
|
<el-input v-model="addform.user_name" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="序号" prop="user_wechat"> |
||||
|
<el-input v-model="addform.user_wechat" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="add">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
<!-- 修改弹窗 --> |
||||
|
<el-dialog v-model="editDialogFormVisible" :before-close="closeEditDialog" title="修改顶级栏目" width="20%"> |
||||
|
<el-form ref="editForm" :model="editForm" :rules="editRules" label-width="80px"> |
||||
|
<el-form-item label="栏目名称" prop="user_name"> |
||||
|
<el-input v-model="editForm.user_name" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="序号" prop="user_wechat"> |
||||
|
<el-input v-model="editForm.user_wechat" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div class="dialog-footer"> |
||||
|
<el-button size="small" @click="closeEditDialog">取 消</el-button> |
||||
|
<el-button size="small" type="primary" @click="edit">确 定</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索 |
||||
|
|
||||
|
// import { |
||||
|
// noticeuserlist, |
||||
|
// looknoticeusercont, |
||||
|
// delnoticeuser, |
||||
|
// eitenoticeuser, |
||||
|
// addnoticeuser |
||||
|
// } from '@/api/healthy' |
||||
|
|
||||
|
export default { |
||||
|
name: 'Notify', |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
tableData:[ |
||||
|
{ |
||||
|
// 栏目id |
||||
|
id:1, |
||||
|
// 栏目名称 |
||||
|
columnr_name:'精益6S管理', |
||||
|
// 排序 |
||||
|
sort:'1', |
||||
|
// 状态 |
||||
|
state:false |
||||
|
}, |
||||
|
{ |
||||
|
// 栏目id |
||||
|
id:2, |
||||
|
// 栏目名称 |
||||
|
columnr_name:'疫情防控', |
||||
|
// 排序 |
||||
|
sort:'2', |
||||
|
// 状态 |
||||
|
state:true |
||||
|
}, |
||||
|
{ |
||||
|
// 栏目id |
||||
|
id:3, |
||||
|
// 栏目名称 |
||||
|
columnr_name:'新闻动态', |
||||
|
// 排序 |
||||
|
sort:'3', |
||||
|
// 状态 |
||||
|
state:true |
||||
|
}, |
||||
|
{ |
||||
|
// 栏目id |
||||
|
id:4, |
||||
|
// 栏目名称 |
||||
|
columnr_name:'检查通报', |
||||
|
// 排序 |
||||
|
sort:'4', |
||||
|
// 状态 |
||||
|
state:true |
||||
|
}, |
||||
|
{ |
||||
|
// 栏目id |
||||
|
id:5, |
||||
|
// 栏目名称 |
||||
|
columnr_name:'通知公告', |
||||
|
// 排序 |
||||
|
sort:'5', |
||||
|
// 状态 |
||||
|
state:true |
||||
|
}, |
||||
|
{ |
||||
|
// 栏目id |
||||
|
id:6, |
||||
|
// 栏目名称 |
||||
|
columnr_name:'会议纪要', |
||||
|
// 排序 |
||||
|
sort:'6', |
||||
|
// 状态 |
||||
|
state:false |
||||
|
}, |
||||
|
], |
||||
|
editDialogFormVisible:false, |
||||
|
deleteVisible: false, |
||||
|
dialogFormVisible: false, |
||||
|
dialogTitle: '新增通知人', |
||||
|
apis: [], |
||||
|
addform: { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
}, |
||||
|
editForm: { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
}, |
||||
|
type: '', |
||||
|
rules: { |
||||
|
user_name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
|
user_wechat: [{ required: true, message: '请输入微信UID', trigger: 'blur' }], |
||||
|
}, |
||||
|
editRules: { |
||||
|
user_name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
|
user_wechat: [{ required: true, message: '请输入微信UID', trigger: 'blur' }], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getNoticeuserList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 删除操作 |
||||
|
async deleteOperate(row) { |
||||
|
this.$confirm('此操作将永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(async() => { |
||||
|
const res = await delnoticeuser({ id: row.id }) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
|
||||
|
this.getNoticeuserList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 修改操作 |
||||
|
edit(){ |
||||
|
this.$refs.editForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await eitenoticeuser(this.editForm) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getNoticeuserList() |
||||
|
this.closeEditDialog() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增操作 |
||||
|
add(){ |
||||
|
this.$refs.addForm.validate(async valid => { |
||||
|
if (valid) { |
||||
|
const res = await addnoticeuser(this.addform) |
||||
|
if (res.code === 0) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '添加成功', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} |
||||
|
this.getNoticeuserList() |
||||
|
this.closeDialog() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 新增/编辑 |
||||
|
openDialog(type) { |
||||
|
switch (type) { |
||||
|
case 'add': |
||||
|
this.dialogTitle = '新增通知人' |
||||
|
break |
||||
|
case 'edit': |
||||
|
this.dialogTitle = '编辑通知人' |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
this.type = type |
||||
|
this.dialogFormVisible = true |
||||
|
}, |
||||
|
|
||||
|
// 获取通知人列表 |
||||
|
async getNoticeuserList(){ |
||||
|
const res=await noticeuserlist() |
||||
|
if(res.code==0){ |
||||
|
this.tableData=res.data |
||||
|
} |
||||
|
}, |
||||
|
// 点击修改事件 |
||||
|
async editOperate(row) { |
||||
|
const res = await looknoticeusercont({ id: row.id }) |
||||
|
this.editForm = res.data |
||||
|
this.editDialogFormVisible=true |
||||
|
}, |
||||
|
|
||||
|
onReset() { |
||||
|
this.searchInfo = {} |
||||
|
}, |
||||
|
|
||||
|
// 新增form清空 |
||||
|
initForm() { |
||||
|
this.$refs.addForm.resetFields() |
||||
|
this.addform = { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
} |
||||
|
}, |
||||
|
// 修改form清空 |
||||
|
editInitForm() { |
||||
|
this.$refs.editForm.resetFields() |
||||
|
this.editForm = { |
||||
|
user_name:'', |
||||
|
user_wechat:'' |
||||
|
} |
||||
|
}, |
||||
|
// 关闭添加弹框事件 |
||||
|
closeDialog() { |
||||
|
this.initForm() |
||||
|
this.dialogFormVisible = false |
||||
|
}, |
||||
|
// 关闭修改弹框事件 |
||||
|
closeEditDialog() { |
||||
|
this.editInitForm() |
||||
|
this.editDialogFormVisible = false |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.button-box { |
||||
|
padding: 10px 20px; |
||||
|
.el-button { |
||||
|
float: right; |
||||
|
} |
||||
|
} |
||||
|
.warning { |
||||
|
color: #dc143c; |
||||
|
} |
||||
|
</style> |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue