390b3816 by xiaomiao

--no commit message

1 parent 49ec079a
......@@ -20,6 +20,7 @@
"nprogress": "0.2.0",
"vue": "2.6.10",
"vue-awesome": "^4.5.0",
"vue-json-editor": "^1.4.3",
"vue-router": "3.0.2",
"vuex": "3.1.0",
"xe-utils": "^3.5.7"
......
<template>
<el-dialog
:title="title"
:visible.sync="visible"
:width="width"
:append-to-body="appendToBody"
:modal="modal"
:close-on-click-modal="false"
:fullscreen="fullscreen"
:destroy-on-close="destroyOnClose"
:modal-append-to-body="modalAppendToBody"
:class="customClass"
@close="close"
class="dialog"
>
<slot name="content" />
<span slot="footer" class="dialog-footer">
<slot name="footer" />
</span>
</el-dialog>
</template>
<script>
export default {
name: '',
props: {
show: {
type: Boolean,
default: false
},
customClass: {
type: String,
default: ''
},
title: {
type: String,
default: '新增'
},
appendToBody: {
// Dialog 自身是否插入至 body 元素上。嵌套的 Dialog 必须指定该属性并赋值为 true
type: Boolean,
default: true
},
modalAppendToBody: {
// 遮罩层是否插入至 body 元素上,若为 false,则遮罩层会插入至 Dialog 的父元素上
type: Boolean,
default: true
},
modal: {
// 是否需要遮罩层
type: Boolean,
default: true
},
fullscreen: {
// 是否全屏
type: Boolean,
default: false
},
destroyOnClose: {
// 关闭时销毁 Dialog 中的元素
type: Boolean,
default: false
},
width: {
type: String,
default: '30%'
}
},
data() {
return {}
},
computed: {
visible: {
get() {
return this.show
},
set(val) {
this.$emit('update:show', val) // visible 改变的时候通知父组件
}
}
},
methods: {
close() {
this.$emit('close')
}
}
}
</script>
<style lang="scss" scoped>
.dialog {
/deep/.el-dialog{
overflow: hidden;
background: url("~@/image/dialogBg.png") no-repeat !important;
background-size: 100% 100% !important;
}
.el-dialog__header {
padding: 0;
height: 56px;
line-height: 56px;
border-bottom: none;
.el-dialog__title {
font-weight: 400;
}
.el-dialog__title:before {
display: inline-block;
content: '';
width: 4px;
height: 16px;
background: #3aa3f8;
margin-left: 12px;
margin-right: 8px;
position: relative;
top: 2px;
}
.el-dialog__headerbtn {
position: absolute;
// top: 2%;
right: 12px;
}
}
.el-dialog__body {
margin: 0px 12px;
padding: 48px 24px;
background: #fff;
border: 1px solid #dfe7f3;
.el-button {
padding: 8px 16px;
border: none;
}
.el-form {
.el-checkbox {
line-height: 32px;
height: 32px;
}
.form-item-mb0 {
margin-bottom: 0 !important;
}
.el-form-item {
margin-bottom: 24px;
.el-form-item__label {
height: 32px;
line-height: 32px;
vertical-align: middle;
}
.el-form-item__content {
// height: 32px;
line-height: 32px;
// date 组件有图标
.has-icon.el-date-editor {
.el-input__inner {
padding-left: 32px;
}
}
.el-input__inner {
padding: 0 8px;
height: 32px;
line-height: 32px;
text-align: left;
}
.el-textarea__inner {
padding: 8px 8px;
}
.el-input .el-input__icon {
font-size: 14px;
color: #747e8c;
}
}
}
}
.el-select,
.el-cascader,
.el-date-editor {
width: 100%;
line-height: 32px;
}
}
.el-dialog__footer {
padding: 0 12px;
height: 56px;
line-height: 56px;
border: none;
.el-button {
padding: 8px 16px;
border: none;
}
.el-button + .el-button {
margin-left: 12px;
}
}
}
</style>
<template>
<div class="icon-List">
<el-dialog
:visible.sync="visible"
:append-to-body="true"
:show-close="isClose"
>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="内置图标" name="first">
<ul v-if="iconList" class="clearfix">
<li
v-for="(item, index) in iconList"
:key="index"
@click="changeData(item)"
>
<i :class="item" />
</li>
</ul>
</el-tab-pane>
<el-tab-pane label="自定义图标" name="second">
<el-upload
class="avatar-uploader"
action="https://jsonplaceholder.typicode.com/posts/"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon">
<p>点击上传</p>
</i>
</el-upload>
<div>
<el-input v-model="iconName" class="icon-name" placeholder="请输入图标代码"></el-input>
</div>
<el-button class="confirm" type="primary" @click="changeIconName">确定</el-button>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
<script>
import icoNameList from '@/utils/elementUI'
export default {
name: 'IconList',
components: {},
props: {},
data() {
return {
visible: false,
isClose: false,
iconList: [],
activeName: 'first',
iconName: '',
imageUrl: ''
}
},
computed: {},
watch: {},
created() {},
mounted() {
this.iconList = icoNameList
},
methods: {
show(show) {
this.visible = show
},
handleClick(tab, event) {
console.log(tab, event)
},
changeData(iconName) {
this.visible = false
// 传递图标名称给父级
this.$emit('iconName', iconName)
},
changeIconName() {
this.visible = false
// 传递图标名称给父级
this.$emit('iconName', this.iconName)
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog {
box-shadow: 0px 4px 10px 0px #666666;
border-radius: 4px;
width: 573px;
height: 300px;
position: relative;
top: 4vh;
left: 0vw;
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding: 10px;
}
.el-tabs {
.el-tabs__content {
height: 200px;
overflow-y: scroll;
ul {
li {
float: left;
padding: 1%;
margin: 2px;
border: 1px solid #e8eaec;
cursor: pointer;
width: 30px;
height: 30px;
}
}
.avatar-uploader-icon {
font-size: 12px;
color: #8c939d;
text-align: center;
width: 62px;
height: 62px;
background: #f6f7f9;
border-radius: 4px;
border: 1px solid #e5e5e5;
padding-top: 32%;
}
}
}
.confirm {
float: right;
margin-top: 30px;
}
.icon-name {
width: 70%;
margin-top: 10px;
}
}
</style>
<template>
<div>
<i class="icon-tubiao-242 iconfont" :title="title" @click="openDialog" />
<el-dialog
:key="key"
:title="title"
:inner-dialog="true"
:visible.sync="dialogVisible"
width="600px"
:close-on-click-modal="false"
append-to-body
@cancel="cancel"
>
<vue-json-editor
id="minejson"
v-model="resultInfo"
:mode="'code'"
lang="zh"
@json-change="onJsonChange"
@json-save="onJsonSave"
@has-error="onError"
/>
<el-tooltip
content="全屏缩放"
effect="dark"
placement="bottom"
fullscreen
class="fullScreen"
>
<i class="el-icon-full-screen" @click="enLarge" />
</el-tooltip>
<template slot="footer">
<div class="dialog-footer flex flex-pack-center">
<el-button
type="primary"
class="confirmBtn"
@click="onJsonSave"
>保存</el-button>
<el-button
type="primary"
class="cancelBtn"
@click="cancel"
>关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
import vueJsonEditor from 'vue-json-editor'
export default {
components: {
vueJsonEditor
},
props: {
title: {
type: String,
default: '配置参数'
},
resultInfos: {
type: String,
default: ''
}
},
data() {
return {
activeNames: [],
resultInfo: {},
tmpResultInfo: {},
dialogVisible: false,
hasJsonFlag: true,
key: 0,
isEnlarge: false
}
},
watch: {
resultInfos: {
handler: function(val) {
++this.key
this.resultInfo =
this.resultInfos === '' ? {} : JSON.parse(this.resultInfos)
this.tmpResultInfo = this.resultInfo
},
deep: true,
immediate: true
}
},
mounted() {
this.resultInfo =
this.resultInfos === '' ? {} : JSON.parse(this.resultInfos)
},
methods: {
onJsonChange(value) {
// 只有在格式正确的时候进入此事件
this.hasJsonFlag = true
},
onJsonSave() {
const value = this.resultInfo
console.log(this.resultInfo, 'resultInfo')
if (this.hasJsonFlag === false) {
this.$message.error({ message: 'json格式验证失败', showClose: true })
// alert("json验证失败")
return false
} else {
this.dialogVisible = false
this.$emit('getJsonString', JSON.stringify(value))
return true
}
},
onError(value) {
this.hasJsonFlag = false
},
openDialog() {
this.dialogVisible = true
},
cancel() {
console.log(this.tmpResultInfo, 'tmpResultInfo')
this.resultInfo = this.tmpResultInfo
this.dialogVisible = false
},
// 放大
enLarge() {
const fullarea = document.getElementById('minejson')
if (fullarea.requestFullscreen) {
fullarea.requestFullscreen()
} else if (fullarea.webkitRequestFullScreen) {
fullarea.webkitRequestFullScreen() // webkit内核(chrome、safari、Opera等)
} else if (fullarea.mozRequestFullScreen) {
fullarea.mozRequestFullScreen() // moz内核(firefox)
} else if (fullarea.msRequestFullscreen) {
fullarea.msRequestFullscreen() // IE11、edge
}
this.isEnlarge = true
}
}
}
</script>
<style scoped lang="scss">
/* jsoneditor右上角默认有一个链接,加css去掉了 */
.iconfont {
cursor: pointer;
position: relative;
top: 1px;
color: #349af3;
}
::v-deep .jsoneditor-vue {
height: 100%;
}
.fullScreen {
position: absolute;
right: 5%;
top: 22%;
cursor: pointer;
color: #fff;
}
::v-deep .jsoneditor-modes {
display: none !important;
}
.jsoneditor-poweredBy {
display: none !important;
}
.jsoneditor-menu {
background-color: #9c9e9f !important;
border-bottom: 1px solid #9c9e9f !important;
}
.jsoneditor {
border: 1px solid #9c9e9f !important;
}
.el-collapse {
border: 0;
}
.el-collapse-item__header {
height: 44px;
}
</style>
......@@ -104,13 +104,6 @@
<Xyjg :form-data = 'dataReport'></Xyjg>
</div>
<JsonEditor :resultInfo="resultInfo" v-if="titleName == 'xml'" />
<!-- <div slot="footer" class="dialog_footer" ref="dialogFooter">
<div class="dialog_button">
<el-button type="primary" plain @click="submitForm" v-if="!Edit" :loading="saveloding">确定
</el-button>
<el-button @click="closeDialog()">关闭</el-button>
</div>
</div> -->
</el-dialog>
</template>
......
......@@ -16,23 +16,7 @@ export default {
data () {
return {
cdata: {
seriesData: [
{ value: 10, name: "土地所有权" },
{ value: 5, name: "建设用地、宅基地使用权" },
{ value: 15, name: "房地产权(项目内多幢房屋)" },
{ value: 25, name: "产地产权(独幢、层、套、间、房屋)" },
{ value: 20, name: "建筑物区分所有权业主共有部分" },
{ value: 35, name: "海域(含无居民海岛)使用权" },
{ value: 10, name: "构(建)筑物所有权" },
{ value: 5, name: "农用地使用权(非林地)" },
{ value: 15, name: "林权" },
{ value: 25, name: "注销登记" },
{ value: 20, name: "异议登记" },
{ value: 35, name: "预告登记" },
{ value: 20, name: "查封登记" },
{ value: 35, name: "抵押权登记" },
{ value: 20, name: "地役权登记" },
],
seriesData: [],
},
};
},
......@@ -41,22 +25,30 @@ export default {
},
mounted () {
this.getdjywltotal();
},
methods: {
getdjywltotal () {
return new Promise(async (resolve) => {
async getdjywltotal () {
try {
let p = {
DJLX: "A21",
QLLX: "A8",
XZQDM: "A20",
DJLX: "",
QLLX: "",
XZQDM: "",
};
let res = await work.getdjywltotal(p);
console.log("res",res);
res.result.filter((item) => {
return (
this.cdata.seriesData.push({ "name": item.AREACODE, "value": item.ywtotal })
)
});
console.log("this.cdata.seriesData",this.cdata.seriesData);
} catch (error) {
this.$refs.msg.messageShow();
}
});
},
},
};
......
......@@ -28,8 +28,8 @@ export default {
res.filter((item) => {
return (
this.cdata.category.push(item.areaName),
this.cdata.lineData.push(item.successCount),
this.cdata.barData.push(item.failureCount)
this.cdata.barData.push(item.successCount),
this.cdata.lineData.push(item.failureCount)
);
});
} catch (error) {
......
......@@ -17,9 +17,6 @@ export default {
components: {
Chart,
},
created () {
},
mounted () {
this.getDjlxtotal();
},
......@@ -28,9 +25,9 @@ export default {
return new Promise(async (resolve) => {
try {
let p = {
DJLX: "A21",
QLLX: "A8",
XZQDM: "A20",
DJLX: "",
QLLX: "",
XZQDM: "",
};
let res = await work.getDjlxtotal(p);
res.result.filter((item) => {
......
const icoNameList = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round']
.map(s => 'el-icon-' + s)
export default icoNameList
......@@ -5,3 +5,26 @@
export function isExternal (path) {
return /^(https?:|mailto:|tel:)/.test(path)
}
// ex: {validator:validateCode,trigger:'blur'}
// 验证code
export const validateCode = (rule, value, callback) => {
const reg = /^[A-Z]{1}[A-Za-z0-9]*$/
!reg.test(value) ? callback('字母开头、数字和字母组成') : callback()
}
// 验证 网址
export const validateUrl = (rule, value, callback) => {
const reg = /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/
!reg.test(value) ? callback('URL格式不正确') : callback()
}
// 验证 电话
export const validatePhone = (rule, value, callback) => {
const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
const rel = /^[0]\d{2,3}-[1-9]\d{7}$/
if (!value) {
callback()
} else {
!(phoneReg.test(value) || rel.test(value))
? callback(new Error('请输入正确的联系电话'))
: callback()
}
}
......
......@@ -18,7 +18,7 @@
</p>
<p>
<span>成功率</span>
<span class="cg">99%</span>
<span class="cg">{{qxcgl}}</span>
</p>
</div>
</div>
......@@ -41,7 +41,7 @@
</p>
<p>
<span>成功率</span>
<span class="cg">99%</span>
<span class="cg">{{stcgl}}</span>
</p>
</div>
</div>
......@@ -60,12 +60,14 @@ export default {
data () {
return {
// 日均接入量
qxerrer: 0,
qxsuccess: 0,
sterrer: 0,
stsuccess: 0,
qxjrl: 50300,
stjrl: 50300,
qxerrer: "",
qxsuccess: "",
sterrer: "",
stsuccess: "",
qxjrl: "",
stjrl: "",
qxcgl:"",
stcgl:""
};
},
mounted () {
......@@ -79,12 +81,6 @@ export default {
stjrlList: function () {
return this.stjrl.toString().split("");
},
sbqkgsList: function () {
const numbers = this.sbqkgs.toString().split("").reverse();
const segs = [];
while (numbers.length) segs.push(numbers.splice(0, 3).join(""));
return segs.join(",").split("").reverse().join("");
},
},
methods: {
getsthjqxjrtotal () {
......@@ -96,6 +92,18 @@ export default {
XZQDM: "A20",
};
let res = await work.getsthjqxjrtotal(p);
this.stjrl=Number(res.result.sum)
this.qxjrl=Number(res.result.sum)
this.qxerrer=Number(res.result.qxjrerrer)
this.sterrer=Number(res.result.sthjerrer)
if(res.result.sum=="0"){
this.qxcgl="100%"
this.stcgl="100%"
}else{
this.qxcgl=Number(res.result.qxjrsuccess)/this.qxjrl*100+"%"
this.stcgl=Number(res.result.sthjsuccess)/Number(res.result.sum)*100+"%"
}
} catch (error) {
this.$refs.msg.messageShow();
}
......
......@@ -6,37 +6,22 @@ class data extends filter {
columns () {
return [
{
prop: "job_name",
label: "任务名称",
width: 130
},
{
prop: "description",
label: "任务描述",
prop: "name",
label: "菜单名称",
width: 300
},
{
prop: "cron_expression",
label: "cron表达式"
prop: "code",
label: "菜单代码"
},
{
prop: "bean_class",
prop: "uri",
width: 260,
label: "任务类"
label: "链接路径"
},
{
prop: "job_group",
label: "任务分组"
},
{
label: "状态",
render: (h, scope) => {
return (
<div>
{ this.stateStatus(scope.row.job_status) }
</div>
)
},
prop: "icon",
label: "图标"
}
]
}
......
<template>
<div>
<Dialog
:title="title"
:show.sync="visible"
:width="'767px'"
@close="close()"
>
<template slot="content">
<el-form ref="form" :model="form" :rules="rules">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="菜单名称:" prop="name" label-width="124px">
<el-input v-model="form.name" placeholder="请输入菜单名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="图标:" label-width="54px">
<el-input
v-model="form.icon"
placeholder="请选择图标"
:prefix-icon="form.icon"
clearable
@focus="getIconList"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="上级菜单:" label-width="124px">
<el-cascader
:key="menuKey"
v-model="form.parentId"
:options="parentMenuList"
:props="setProps"
placeholder="请选择上级菜单"
clearable
@change="handleChange"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="代码:" prop="code" label-width="54px">
<el-input
v-model="codeComputed"
placeholder="请输入菜单代码"
:disabled="type === 1"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="链接路径:" label-width="124px">
<el-input v-model="form.uri" placeholder="请输入链接路径" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="浏览器跳转模式:" label-width="124px">
<el-select
v-model="form.jumpMode"
placeholder="请选择浏览器跳转模式"
>
<el-option
v-for="item in jumpModeList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item
label="配置参数:"
label-width="124px"
class="form-item-mb0"
>
<!-- 配置参数 -->
<JsonEditor
:result-infos="form.metadata"
@getJsonString="getJsonString"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<template slot="footer">
<el-button class="cancel-button" @click="close()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
</template>
</Dialog>
<!-- 图标列表 -->
<IconList ref="iconList" @iconName="getIconName" />
</div>
</template>
<script>
import Dialog from "@/components/Dialog/";
// import JsonEditor from '@components/JsonEditors'
import JsonEditor from '../../../components/JsonEditors'
// import IconList from '@components/IconList'
import IconList from '../../../components/IconList'
import { validateCode } from '../../../utils/validate';
export default {
name: "EditDialog",
components: {
Dialog,
JsonEditor,
IconList,
},
data() {
return {
form: {
icon: "",
code: "",
},
rules: {
name: [{ required: true, message: "请输入菜单名称", trigger: "blur" }],
code: [
{ required: true, message: "必填", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
title: "",
type: "",
visible: false,
parentMenuList: [],
menuKey: 0,
jumpModeList: [
{ name: "在当前页面显示", value: 1 },
{ name: "跳转到新页面", value: 2 },
],
setProps: {
value: "id",
label: "name",
children: "children",
expandTrigger: "hover",
checkStrictly: true, // 可取消关联,选择任意一级选项
emitPath: false,
},
// dataUrl: api.menus,
};
},
computed: {
codeComputed: {
get: function() {
return this.form.code
},
set: function(val) {
this.form.code = val.toUpperCase()
}
}
},
created() {},
mounted() {},
methods: {
getParentMenuList() {
// getParentMenuListAction(id).then((res) => {
// if (res.status === 1) {
// const list = this.$dealArrChildren(res.content)
// if (id) {
// this.parentMenuList = this.$dealArrDisabled(
// this.$deepCopy(list),
// id
// )
// this.menuKey++
// } else {
// this.parentMenuList = list
// }
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
},
getIconList() {
this.$refs.iconList.show(true);
},
// 选择图标
getIconName(data) {
this.form.icon = data;
},
getJsonString(data) {
this.form.metadata = data;
},
add() {
// console.log(this.productId)
// if (!this.productId) {
// this.$message.info({
// message: '请先选择子系统才能添加菜单,如果没有,请先添加子系统!',
// showClose: true
// })
// return
// }
// this.getParentMenuList(this.productId)
this.visible = true;
// this.type = 0
// this.form.jumpMode = 1
},
edit(record) {
// this.type = 1
// // 若有id为编辑
// if (record.id) {
// this.$nextTick(() => {
// this.form = Object.assign({}, record)
// this.getParentMenuList(this.productId)
// })
// }
this.visible = true;
},
addChild(record) {
// this.getParentMenuList(this.productId)
this.visible = true;
// this.type = 2
// this.form.jumpMode = 1
// this.form.parentId = record.id
},
handleChange(value) {
// this.form.parentId = value
},
submitForm(submitType) {
// this.$refs.form.validate((valid) => {
// if (valid) {
// let method = "";
// let url = "";
// const formData = this.form;
// formData.productId = this.productId;
// if (!formData.id) {
// method = "post";
// url = this.dataUrl;
// } else {
// method = "put";
// url = `${this.dataUrl}/${formData.id}`;
// }
// httpAction(url, formData, method)
// .then((res) => {
// if (res.status === 1) {
// this.$message.success({
// message: res.message,
// showClose: true,
// });
// // this.$emit("ok");
// // this.type 0新增 1编辑 2添加子
// if (this.type === 0) {
// if (submitType === 1) {
// this.close();
// } else {
// this.resetForm();
// }
// } else if (this.type === 1) {
// this.close();
// } else if (this.type === 2) {
// if (submitType === 1) {
// this.close();
// } else {
// this.resetForm();
// this.form.parentId = formData.parentId;
// }
// }
// this.$emit("ok");
// } else {
// this.$message.error({ message: res.message, showClose: true });
// }
// })
// .catch((err) => {
// console.log(err);
// });
// }
// });
},
resetForm() {
this.$refs.form.resetFields();
this.form = {
icon: "",
code: "",
};
},
close() {
this.resetForm();
this.visible = false;
},
},
};
</script>
<style scoped lang="scss">
.el-form {
.el-input {
.el-input__icon {
font-size: 14px;
// color: #3AA3F8 !important;
}
}
}
</style>
<template>
<div class="timedTask from-clues">
<div class="from-clues-header">
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="搜索标题">
<el-input v-model="form.job_name" placeholder="请输入标题"></el-input>
</el-form-item>
</el-col>
<el-col :span="18" class="btnColRight">
<btn nativeType="cx" @click="handleSubmit">搜索</btn>
<btn nativeType="sb" @click="handleAdd">新增</btn>
<el-form ref="ruleForm" :model="form" label-width="100px">
<el-row class="mb-5">
<el-col :span="2" class="btnColRight">
<btn nativeType="cx" @click="handleAdd()">新增菜单</btn>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
<lb-table
:column="tableData.columns"
:data="tabledata11"
row-key="id"
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
</lb-table>
<add-task ref="task" :taskData="taskData" />
<message-tips ref="msg" :message="message" />
</div>
<edit-dialog ref="dialogForm" />
</div>
</template>
<script>
// 定时任务
import data from "./data"
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import addTask from '../components/addTask.vue'
import data from "./data";
import EditDialog from "./edit-dialog.vue";
export default {
name: "menus",
mixins: [tableMixin],
components: {
addTask
EditDialog,
},
data () {
data() {
return {
tabledata11: [
{
id: "c6221838-187b-4a7a-b173-b0543022f560",
createdAt: "2021-08-26T07:00:07.101+0000",
updatedAt: "2021-08-26T07:00:07.101+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 135,
name: "概览",
code: "GL",
description: null,
uri: null,
parentId: null,
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: [
{
id: "abf28772-a719-44bd-b461-f63ab9e0a53d",
createdAt: "2022-03-04T08:08:25.703+0000",
updatedAt: "2022-03-04T09:21:19.578+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 197,
name: "资源概览",
code: "ZYGL2",
description: null,
uri: "/admin/#/resource-overview",
parentId: "c6221838-187b-4a7a-b173-b0543022f560",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata:
'{"icon":"resource-overview","iconActive":"resource-overview-active"}',
children: null,
},
{
id: "06a0807e-11f5-4046-b245-3bb7b835b1c5",
createdAt: "2022-03-04T08:09:18.106+0000",
updatedAt: "2022-03-04T09:21:24.292+0000",
createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 196,
name: "访问概览",
code: "FWGL",
description: null,
uri: "/admin/#/access-overview",
parentId: "c6221838-187b-4a7a-b173-b0543022f560",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata:
'{"icon":"access-overview","iconActive":"access-overview-active"}',
children: null,
},
],
},
{
id: "f94c92cb-a032-4b89-8722-79dbcc331894",
createdAt: null,
updatedAt: null,
createdBy: null,
updatedBy: null,
sort: 59,
name: "资源管理",
code: "ZYGL",
description: null,
uri: null,
parentId: null,
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: [
{
id: "065fe2d7-d59a-442c-92d0-c91aa19d7fae",
createdAt: null,
updatedAt: "2021-11-11T09:40:08.951+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 35,
name: "目录管理",
code: "MLGL",
description: null,
uri: "/admin/#/catalog-manage",
parentId: "f94c92cb-a032-4b89-8722-79dbcc331894",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata:
'{"icon":"tubiao_huaban","iconActive":"tubiao_huaban-active"}',
children: [
{
id: "0b5952bc-dc7f-4d4e-8fcc-af9d33908c2a",
createdAt: null,
updatedAt: "2022-03-04T01:46:25.515+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 137,
name: "服务目录",
code: "FWML",
description: null,
uri: "/admin/#/catalog-manage/catalog-service",
parentId: "065fe2d7-d59a-442c-92d0-c91aa19d7fae",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: null,
},
{
id: "2377caf7-22e5-4261-b88a-0fbbbace1452",
createdAt: null,
updatedAt: "2022-03-04T01:47:00.774+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: -3,
name: "应用目录",
code: "YYML",
description: null,
uri: "/admin/#/catalog-manage/catalog-application",
parentId: "065fe2d7-d59a-442c-92d0-c91aa19d7fae",
state: null,
style: null,
icon: "",
jumpMode: 1,
productId: "d798323e-8834-4417-bbb8-837b8d13e7d5",
resourceCategoryId: "d798323e-8834-4417-bbb8-837b8d585656",
metadata: null,
children: null,
},
],
},
],
},
],
taskData: null,
form: {
job_name: '',
currentPage: 1
job_name: "",
currentPage: 1,
},
title: "",
queryParam: {},
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
tableData: [],
sexList: [],
typeOptions: [
{
value: "0",
label: "姓名",
},
{
value: "1",
label: "工号",
},
{
value: "2",
label: "部门",
},
{
value: "3",
label: "机构",
},
],
selectionList: [],
tableData: {
columns: [{
label: '序号',
type: 'index',
width: '50',
index: this.indexMethod,
}].concat(data.columns()).concat([
columns: [].concat(data.columns()).concat([
{
label: "排序",
width: 380,
render: (h, scope) => {
return <div></div>;
},
},
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button type="text" size="mini" style="color: #67C23A"
v-show={scope.row.job_status !== '1' && scope.row.job_status !== '2'}
icon="el-icon-magic-stick"
onClick={() => { this.handleRecovery(scope.row) }}>激活
</el-button>
<el-button type="text" size="mini"
style="color: #67C23A;margin-left:0"
icon="el-icon-refresh-right"
v-show={scope.row.job_status === '2'}
onClick={() => { this.handleActivation(scope.row) }}>恢复
</el-button>
<el-button type="text" size="mini"
v-show={scope.row.job_status !== '1'}
icon="el-icon-stopwatch"
onClick={() => { this.handletest(scope.row) }}>手动测试
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
<el-button type="text" size="mini"
v-show={scope.row.job_status === '1'}
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
onClick={() => { this.handleSuspend(scope.row) }}>暂停
</el-button>
<el-button type="text" size="mini"
icon="el-icon-edit"
v-show={scope.row.job_status === '2' || scope.row.job_status === '-1' || scope.row.job_status === '0'}
onClick={() => { this.handleEdit(scope.row) }}>编辑
onClick={() => {
this.authorizationQuery(scope.row);
}}
>
授权
</el-button>
<el-button type="text" size="mini"
icon="el-icon-delete" style="color:#F56C6C"
v-show={scope.row.job_status !== '1'}
onClick={() => { this.handleDel(scope.row) }}>删除
<el-button
type="text"
size="mini"
icon="el-icon-delete"
style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
},
]),
data: []
data: [],
},
pageData: {
total: 0,
total: 5,
pageSize: 15,
current: 1,
},
}
};
},
methods: {
handleAdd () {
this.taskData = null
this.$refs.task.isShow()
// 新增菜单
handleAdd() {
this.taskData = null;
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
async featchData () {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await sjsbTask.getTaskListByName(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
current,
total
}
} catch (error) {
this.message = error
this.$refs.msg.messageShow()
}
},
// 暂停
handleSuspend (row) {
this.$confirm('此操将进行暂停操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.pauseJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
// 修改
handleEdit(record) {
localStorage.setItem("record", JSON.stringify(record));
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 激活
handleRecovery (row) {
this.$confirm('此操将进行激活操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.activateJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
// 授权
authorizationQuery(record) {
this.$refs.authorizationList.open(record, 'menu')
this.$refs.authorizationList.emptyJudge = true
},
// 恢复
handleActivation (row) {
this.$confirm('此操将进行恢复操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
// 删除
handleDelete(row, id) {
this.$confirm("此操将进行删除操作, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
sjsbTask.resumeJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
// sjsbTask.sjsbTaskRemove(row.id)
// .then((res) => {
// if ((res.code = 200)) {
// this.$message({
// type: 'success',
// message: res.message,
// })
// this.featchData()
// }
// })
// .catch((error) => {
// this.$alert(error, '提示', {
// confirmButtonText: '确定',
// type: 'error'
// })
// })
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
},
// 手动测试
handletest (row) {
this.$confirm('此操将进行手动测试, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.sjsbTaskRun(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$alert(res.message, '提示', {
confirmButtonText: '确定',
type: 'success'
type: "info",
message: "已取消",
});
});
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
},
handleEdit (row) {
this.taskData = row
this.$refs.task.isShow()
},
handleDel (row) {
this.$confirm('此操将进行删除操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.sjsbTaskRemove(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
}
}
}
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
......
......@@ -7,36 +7,17 @@ class data extends filter {
return [
{
prop: "job_name",
label: "任务名称",
width: 130
label: "角色名称",
width: 330
},
{
prop: "description",
label: "任务描述",
width: 300
label: "类别",
width: 400
},
{
prop: "cron_expression",
label: "cron表达式"
},
{
prop: "bean_class",
width: 260,
label: "任务类"
},
{
prop: "job_group",
label: "任务分组"
},
{
label: "状态",
render: (h, scope) => {
return (
<div>
{ this.stateStatus(scope.row.job_status) }
</div>
)
},
label: "备注"
}
]
}
......
<!-- 新增 & 修改角色 -->
<template>
<Dialog
:title="dialogTitle"
:show.sync="showAddEditDialog"
:width="'767px'"
@close="handleCloseDialog()"
>
<template slot="content">
<el-form ref="form" :model="dialogForm" :rules="rules" label-width="82px">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="角色名称:" prop="roleName">
<el-input
v-model="dialogForm.roleName"
clearable
placeholder="请输入角色名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="角色类型:" prop="roleType">
<!-- <el-select v-model="dialogForm.roleType.value" placeholder="请输入角色类型">
<el-option
v-for="item in roleTypeOptions"
:key="item.value"
:label="item.name"
:value="item.value">
</el-option>
</el-select> -->
<el-input
v-model="dialogForm.roleType"
clearable
placeholder="请输入角色类型"
/>
</el-form-item>
</el-col>
</el-row>
<br>
<el-row>
<el-col :span="24">
<el-form-item label="备注:" class="form-item-mb0">
<el-input
v-model="dialogForm.roleTextArea"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<template slot="footer">
<el-button
class="cancel-button"
@click="handleCloseDialog"
>取消</el-button>
<el-button
type="primary"
@click="handleSaveRole()"
>保存</el-button>
</template>
</Dialog>
</template>
<script>
import Dialog from "@/components/Dialog/";
export default {
components: {
Dialog
},
data() {
return {
dialogTitle: '',
showAddEditDialog: false,
menuType: '',
roleId: '',
sort: 0,
dialogForm: {
roleName: '',
roleType: '',
roleTextArea: ''
},
rules: {
roleName: [
{ required: true, message: '请输入角色名称', trigger: 'blur' }
],
roleType: [
{ required: true, message: '请输入角色类型', trigger: 'blur' }
]
},
roleTypeOptions: [
{ name: '定制', value: '定制' },
{ name: '其他', value: '其他' }
]
}
},
methods: {
// 保存新增或关闭事件
handleSaveRole(val) {
this.$refs.form.validate((valid) => {
if (valid) {
try {
const params = {
category: this.menuType,
description: this.dialogForm.roleTextArea,
name: this.dialogForm.roleName,
sort: this.sort,
type: this.dialogForm.roleType
}
if (this.roleId) {
// params.id = this.roleId
// httpAction(`${api.roles}/${params.id}`, params, 'post').then(
// (res) => {
// if (res.status === 1) {
// this.$message.success({
// message: '修改成功',
// showClose: true
// })
// this.dialogForm = {
// roleName: '',
// roleType: ''
// }
// this.showAddEditDialog = val
// this.$emit('ok', this.menuType)
// } else {
// this.$message.error({
// message: res.message,
// showClose: true
// })
// }
// }
// )
} else {
// httpAction(api.roles, params, 'post').then((res) => {
// if (res.status === 1) {
// this.$message.success({
// message: '新增成功',
// showClose: true
// })
// this.dialogForm = {
// roleName: '',
// roleType: ''
// }
// this.showAddEditDialog = val
// this.$emit('ok', this.menuType)
// } else {
// this.$message.error({
// message: res.message,
// showClose: true
// })
// }
// })
}
} catch (e) {
console.error(e)
}
}
})
},
// 取消事件
handleCloseDialog() {
this.dialogForm = {
roleName: '',
roleType: ''
}
this.showAddEditDialog = false
}
}
}
</script>
<style scoped lang="scss"></style>
<template>
<div class="timedTask from-clues">
<div class="from-clues-header">
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="搜索标题">
<el-input v-model="form.job_name" placeholder="请输入标题"></el-input>
</el-form-item>
</el-col>
<el-col :span="18" class="btnColRight">
<btn nativeType="cx" @click="handleSubmit">搜索</btn>
<btn nativeType="sb" @click="handleAdd">新增</btn>
<el-form ref="ruleForm" :model="form" label-width="100px">
<el-row class="mb-5">
<el-col :span="2" class="btnColRight">
<btn nativeType="cx" @click="handleAdd">增加角色</btn>
</el-col>
</el-row>
</el-form>
</div>
......@@ -20,22 +15,24 @@
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
<add-task ref="task" :taskData="taskData" />
<message-tips ref="msg" :message="message" />
</div>
<EditDialog ref="dialogForm" />
<Roleslistdiglog ref="rolesForm" />
</div>
</template>
<script>
// 定时任务
import data from "./data"
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import addTask from '../components/addTask.vue'
import EditDialog from "./edit-dialog.vue";
import Roleslistdiglog from "./roleslistdiglog.vue";
export default {
name: "roles",
name: "menus",
mixins: [tableMixin],
components: {
addTask
EditDialog,Roleslistdiglog
},
data () {
return {
......@@ -44,6 +41,35 @@ export default {
job_name: '',
currentPage: 1
},
title: '',
queryParam: {},
selectType: '0',
queryName: '',
organizationId: '', // 组织机构ID
departmentId: '', // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
tableData: [],
sexList: [],
typeOptions: [
{
value: '0',
label: '姓名'
},
{
value: '1',
label: '工号'
},
{
value: '2',
label: '部门'
},
{
value: '3',
label: '机构'
}
],
selectionList: [],
tableData: {
columns: [{
......@@ -51,44 +77,23 @@ export default {
type: 'index',
width: '50',
index: this.indexMethod,
}].concat(data.columns()).concat([
{
}].concat(data.columns()).concat([ {
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button type="text" size="mini" style="color: #67C23A"
v-show={scope.row.job_status !== '1' && scope.row.job_status !== '2'}
icon="el-icon-magic-stick"
onClick={() => { this.handleRecovery(scope.row) }}>激活
</el-button>
<el-button type="text" size="mini"
style="color: #67C23A;margin-left:0"
icon="el-icon-refresh-right"
v-show={scope.row.job_status === '2'}
onClick={() => { this.handleActivation(scope.row) }}>恢复
</el-button>
<el-button type="text" size="mini"
v-show={scope.row.job_status !== '1'}
icon="el-icon-stopwatch"
onClick={() => { this.handletest(scope.row) }}>手动测试
</el-button>
<el-button type="text" size="mini"
v-show={scope.row.job_status === '1'}
icon="el-icon-video-pause"
onClick={() => { this.handleSuspend(scope.row) }}>暂停
onClick={() => { this.personnel(scope.row) }}>人员
</el-button>
<el-button type="text" size="mini"
icon="el-icon-edit"
v-show={scope.row.job_status === '2' || scope.row.job_status === '-1' || scope.row.job_status === '0'}
onClick={() => { this.handleEdit(scope.row) }}>编辑
onClick={() => { this.handleEdit(scope.row) }}>修改
</el-button>
<el-button type="text" size="mini"
icon="el-icon-delete" style="color:#F56C6C"
v-show={scope.row.job_status !== '1'}
onClick={() => { this.handleDel(scope.row) }}>删除
</el-button>
</div>
......@@ -99,164 +104,53 @@ export default {
data: []
},
pageData: {
total: 0,
total: 5,
pageSize: 15,
current: 1,
},
}
},
methods: {
handleAdd () {
this.taskData = null
this.$refs.task.isShow()
// 新增角色
handleAdd() {
// this.$refs.addEditDialog.menuType = this.menuType
// this.$refs.addEditDialog.roleId = value.id
// this.roleSort = value.sort ? value.sort : 0
// if (value.id) {
// this.$refs.addEditDialog.dialogForm.roleName = value.name
// this.$refs.addEditDialog.dialogForm.roleType = value.type
// this.$refs.addEditDialog.dialogForm.roleTextArea = value.description
// }
this.$refs.dialogForm.showAddEditDialog = true
// this.$refs.addEditDialog.dialogTitle = value.id ? '修改' : '新增'
},
async featchData () {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await sjsbTask.getTaskListByName(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
current,
total
}
} catch (error) {
this.message = error
this.$refs.msg.messageShow()
}
// 修改角色
handleEdit(row) {
// this.$refs.addEditDialog.menuType = this.menuType
// this.$refs.addEditDialog.roleId = row.id
// this.roleSort = row.sort ? row.sort : 0
// if (row.id) {
// this.$refs.addEditDialog.dialogForm.roleName = row.name
// this.$refs.addEditDialog.dialogForm.roleType = row.type
// this.$refs.addEditDialog.dialogForm.roleTextArea = row.description
// }
this.$refs.dialogForm.showAddEditDialog = true
// this.$refs.addEditDialog.dialogTitle = row.id ? '修改' : '新增'
},
// 暂停
handleSuspend (row) {
this.$confirm('此操将进行暂停操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.pauseJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
},
// 激活
handleRecovery (row) {
this.$confirm('此操将进行激活操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.activateJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
},
// 恢复
handleActivation (row) {
this.$confirm('此操将进行恢复操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.resumeJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
type: 'success',
message: res.message,
})
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
featchData () {
this.tableData.data = [
{
job_name: "人事部材料管理员",
description: "材料管理员",
cron_expression: "管理内部材料",
},
// 手动测试
handletest (row) {
this.$confirm('此操将进行手动测试, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
sjsbTask.sjsbTaskRun(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$alert(res.message, '提示', {
confirmButtonText: '确定',
type: 'success'
});
this.featchData()
}
})
.catch((error) => {
this.$alert(error, '提示', {
confirmButtonText: '确定',
type: 'error'
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
})
})
]
},
handleEdit (row) {
this.taskData = row
this.$refs.task.isShow()
personnel(){
this.$refs.rolesForm.adds();
// this.$refs.rolesForm.title = "人员配置";
},
handleDel (row) {
this.$confirm('此操将进行删除操作, 是否继续?', '提示', {
......
<template>
<Dialog :title="title" :show.sync="visible" :width="'715px'" @close="close()">
<template slot="content">
<vxe-table
show-overflow
:data="memberList"
border
class="header-bg-type1"
auto-resize
:checkbox-config="{ highlight: true, range: true }"
highlight-hover-row
max-height="500px"
:empty-render="{ name: 'NotData' }"
>
<template #empty>
<table-empty />
</template>
<vxe-table-column
type="checkbox"
width="60"
align="left"
fixed="left"
/>
<vxe-table-column
field="code"
title="工号"
fixed="left"
min-width="100"
show-header-overflow="tooltip"
show-overflow="tooltip"
align="left"
/>
<vxe-table-column
title="姓名"
fixed="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
>
<template slot-scope="scope">
<svg-icon
:icon-class="
scope.row.sex === '0'
? 'male'
: scope.row.sex === '1'
? 'female'
: 'secrecy'
"
/>
{{ scope.row.name }}
</template>
</vxe-table-column>
<vxe-table-column
field="loginName"
title="用户名"
fixed="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
/>
<vxe-table-column
field="departmentName"
title="部门"
show-header-overflow="tooltip"
show-overflow="tooltip"
/>
</vxe-table>
</template>
<template slot="footer">
<el-button type="primary" class="save" @click="submitForm(1)"
>保存</el-button
>
<el-button class="cancel-button" @click="close()">取消</el-button>
</template>
</Dialog>
</template>
<script>
import Dialog from "@/components/Dialog/";
export default {
name: "",
components: { Dialog },
props: {},
data() {
return {
form: {
sex: "0",
},
memberList: [
{
id: "3127e455-43ba-45ff-9326-0e02ef89485e",
createdAt: null,
updatedAt: "2022-08-04T03:38:27.626+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 1,
name: "超级管理员",
loginName: "admin",
password: "05eb15777e8fd1d61c840472e7267f61d432f63340d86b59",
passwordSalt: "5178114777136485",
email: null,
lastLoginTime: null,
mobilePhone: "18291003568",
status: "ACTIVE",
passwordChangeTime: "2021-12-10T08:01:01.569+0000",
idCard: "612725202111021521",
departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b",
organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa",
sex: "0",
isDuty: true,
code: "123324",
jobLevel: null,
telephone: "028-87720898",
address: "办公地点修改测试",
isLocked: false,
departmentName: "研发部",
_X_ROW_KEY: "row_276",
},
],
title: "",
type: "",
visible: false,
showLoginName: false,
options: [],
setProps: {
value: "id",
label: "name",
children: "children",
expandTrigger: "hover",
checkStrictly: true, // 可取消关联,选择任意一级选项
emitPath: false,
},
sexList: [],
levelList: [],
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
};
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
adds() {
this.visible = true;
},
edit(record) {
this.visible = true;
},
handleChange(value) {
this.form.departmentId = value;
},
close() {
// this.resetForm()
this.visible = false;
},
},
};
</script>
<style scoped lang="scss">
.el-form {
.el-form-item__content {
.el-radio {
margin-right: 6px;
}
}
.el-checkbox {
line-height: 40px;
}
.col-pd0 {
padding: 0 !important;
}
}
</style>
......@@ -21,7 +21,6 @@
:data="tableData.data">
</lb-table>
<add-task ref="task" :taskData="taskData" />
<message-tips ref="msg" :message="message" />
</div>
</div>
</template>
......@@ -123,7 +122,6 @@ export default {
}
} catch (error) {
this.message = error
this.$refs.msg.messageShow()
}
},
// 暂停
......
......@@ -6,37 +6,35 @@ class data extends filter {
columns () {
return [
{
prop: "job_name",
label: "任务名称",
prop: "code",
label: "工号",
width: 130
},
{
prop: "description",
label: "任务描述",
prop: "name",
label: "姓名",
width: 300
},
{
prop: "cron_expression",
label: "cron表达式"
prop: "loginName",
label: "用户名"
},
{
prop: "bean_class",
prop: "isDuty",
width: 260,
label: "任务类"
label: "负责人"
},
{
prop: "job_group",
label: "任务分组"
prop: "departmentName",
label: "所属部门"
},
{
label: "状态",
render: (h, scope) => {
return (
<div>
{ this.stateStatus(scope.row.job_status) }
</div>
)
prop: "job_group",
label: "职位"
},
{
prop: "telephone",
label: "电话"
}
]
}
......
<template>
<Dialog :title="title" :show.sync="visible" :width="'715px'" @close="close()">
<template slot="content">
<el-form ref="form" :model="form" :rules="rules">
<el-row :gutter="24">
<el-col :span="11">
<el-form-item label="姓名:" prop="name" label-width="100px">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-col :span="18" class="col-pd0">
<el-form-item label="性别:" label-width="72px">
<el-radio
v-for="(item, index) in sexList"
:key="index"
v-model="form.sex"
:label="item.value"
>{{ item.name }}</el-radio
>
</el-form-item>
</el-col>
<el-col :span="6">
<el-checkbox v-model="form.isDuty">负责人</el-checkbox>
</el-col>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="11">
<el-form-item label="工号:" prop="code" label-width="100px">
<el-input v-model="form.code" placeholder="请输入工号" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="用户名:" prop="loginName" label-width="72px">
<el-input
v-model="form.loginName"
:disabled="showLoginName"
placeholder="请输入用户名"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="11">
<el-form-item label="身份证号码:" label-width="100px">
<el-input v-model="form.idCard" placeholder="请输入身份证号码" />
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item
label="手机号码:"
prop="mobilePhone"
label-width="72px"
>
<el-input
v-model="form.mobilePhone"
placeholder="请输入手机号码"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="11">
<el-form-item label="最高职务级别:" label-width="100px">
<el-select
v-model="form.jobLevel"
placeholder="请选择最高职务级别"
>
<el-option
v-for="item in levelList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="办公电话:" prop="telephone" label-width="72px">
<el-input v-model="form.telephone" placeholder="请输入办公电话" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item
label="办公地点:"
label-width="100px"
class="form-item-mb0"
>
<el-input v-model="form.address" placeholder="请输入办公地点" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<template slot="footer">
<el-button type="primary" class="save" @click="submitForm(1)">保存</el-button>
<el-button class="cancel-button" @click="close()">取消</el-button>
</template>
</Dialog>
</template>
<script>
import Dialog from "@/components/Dialog/";
export default {
name: "",
components: { Dialog },
props: {},
data() {
return {
form: {
sex: "0",
},
rules: {
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
code: [{ required: true, message: "请输入工号", trigger: "blur" }],
mobilePhone: [{ validator: "sddd", trigger: "blur" }],
loginName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
},
title: "",
visible: false,
showLoginName: false,
sexList: [{lable:"0",value:"0",name:"男"},{lable:"1",value:"1",name:"女"}],
levelList: [{lable:"0",value:"0",name:"干事"},{lable:"1",value:"1",name:"经理"}],
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
};
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
// initDictConfig() {
// getDictItems('XB').then((res) => {
// if (res.status === 1) {
// this.sexList = res.content
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
// getDictItems('ZWJB').then((res) => {
// if (res.status === 1) {
// this.levelList = res.content
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
// },
add() {
this.visible = true;
// this.type = 0
this.showLoginName = false
},
edit(record) {
// this.initDictConfig()
this.showLoginName = true
// 若有id为编辑
if (record) {
this.$nextTick(() => {
this.form = Object.assign({}, record)
})
}
this.visible = true
},
handleChange(value) {
this.form.departmentId = value;
},
submitForm(submitType) {
this.$refs.form.validate((valid) => {
if (valid) {
let method = ''
let url = ''
const formData = this.form
if (!formData.id) {
method = 'post'
url = this.dataUrl
} else {
method = 'put'
url = `${this.dataUrl}/${formData.id}`
}
httpAction(url, formData, method).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
// this.type 0新增 1编辑
if (this.type === 0) {
// submitType 1需要关闭页面 0保存&新增暂不关闭页面
if (submitType === 1) {
this.close()
} else {
this.resetForm()
}
} else if (this.type === 1) {
this.close()
}
this.$emit('ok')
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
} else {
console.log('提交错误!!!')
return false
}
})
},
resetForm() {
this.form = {
sex: '0'
}
this.$refs.form.resetFields()
},
close() {
// this.resetForm()
this.visible = false;
},
},
};
</script>
<style scoped lang="scss">
.el-form {
.el-form-item__content {
.el-radio {
margin-right: 6px;
}
}
.el-checkbox {
line-height: 40px;
}
.col-pd0 {
padding: 0 !important;
}
}
</style>
......@@ -3,450 +3,229 @@
<div class="from-clues-header">
<el-form ref="ruleForm" :model="form" label-width="100px">
<el-row class="mb-5">
<el-col :span="3">
<el-select v-model="selectType" placeholder="请选择" class="select">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
<el-col :span="3">
<el-input
v-model="queryName"
class="selectName"
clearable
placeholder="请输入"
>
<el-button
slot="append"
icon="el-icon-search"
@click="searchQuery()"
/>
</el-input>
</el-col>
<!-- 按钮操作 -->
<el-col :span="6" class="btnColRight">
<el-col :span="2" class="btnColRight">
<el-form-item>
<btn nativeType="cz" @click="handleAdd" >添加人员</btn>
<btn nativeType="cx" @click="resetPassword(selectionRows)">重置密码</btn>
<btn nativeType="sb" @click="resetSearch()">重置</btn>
<btn nativeType="cx" @click="handleAdd">添加人员</btn>
<!-- <btn nativeType="cx" @click="resetPassword(selectionRows)"
>重置密码</btn
>
<btn nativeType="cx" @click="resetSearch()">重置</btn> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<vxe-table
ref="xTree"
v-loading="loading"
class="header-bg-type1"
:data="tableData"
show-overflow
border
:checkbox-config="{ highlight: true }"
:empty-render="{ name: 'NotData' }"
highlight-hover-row
max-height="90%"
@checkbox-all="selectAllEvent"
@checkbox-change="selectChangeEvent"
>
<template #empty>
<table-empty />
</template>
<vxe-table-column
type="checkbox"
width="36"
align="center"
fixed="left"
/>
<vxe-table-column
field="code"
title="工号"
width="80"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
fixed="left"
/>
<vxe-table-column
title="姓名"
width="140"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
fixed="left"
>
<template slot-scope="scope">
<svg-icon
:icon-class="
scope.row.sex === '0'
? 'male'
: scope.row.sex === '1'
? 'female'
: 'secrecy'
"
/>
{{ scope.row.name }}
</template>
</vxe-table-column>
<vxe-table-column
field="loginName"
title="用户名"
width="110"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
fixed="left"
/>
<vxe-table-column
title="负责人"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
<lb-table
:page-size="pageData.size"
:current-page.sync="pageData.current"
:total="pageData.total"
@size-change="handleSizeChange"
@p-current-change="handleCurrentChange"
:column="tableData.columns"
:data="tableData.data"
>
<template slot-scope="scope">
<i v-if="scope.row.isDuty" class="el-icon-check" />
</template>
</vxe-table-column>
<vxe-table-column
field="departmentName"
title="所属部门"
align="left"
width="140"
min-width="140"
show-header-overflow="tooltip"
show-overflow="tooltip"
/>
<vxe-table-column
field="jobLevel"
:formatter="formatterjobLevel"
title="职位"
align="left"
width="140"
min-width="140"
show-header-overflow="tooltip"
show-overflow="tooltip"
/>
<vxe-table-column
field="mobilePhone"
title="电话"
width="140"
show-header-overflow="tooltip"
show-overflow="tooltip"
align="left"
/>
<vxe-table-column title="状态" width="50">
<template scope="scope">
<el-switch
v-model="scope.row.switch"
class="switch"
active-color="#32BAD4"
inactive-color="#B1B9C5"
active-text="启"
inactive-text="禁"
@change="changeStatus(scope.row)"
/>
</template>
</vxe-table-column>
<vxe-table-column
title="排序"
width="148"
min-width="148"
align="left"
fixed="right"
>
<template #header>
<p class="ml8">排序</p>
</template>
<template slot-scope="scope">
<sort-table
:scope-data="scope"
:sort-url="tableUrl"
@sortOk="getTableList"
/>
</template>
</vxe-table-column>
<vxe-table-column
title="操作"
width="148"
min-width="148"
align="left"
fixed="right"
>
<template #header>
<p class="ml8">操作</p>
</template>
<template slot-scope="scope">
<el-button type="text" size="small">
<el-tooltip
class="item"
effect="dark"
content="解锁"
placement="top"
>
<i
class="icon-platform-unlock iconfont"
@click="updateLock(scope.row.id, scope.row.name)"
/>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="重置"
placement="top"
>
<i
class="icon-platform-reset iconfont"
@click="resetPassword(scope.row.id)"
/>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<i
class="icon-platform-edit iconfont"
@click="handleEdit(scope.row)"
/>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="删除"
placement="top"
>
<i
class="icon-platform-delete iconfont"
@click="handleDelete(scope.row.id, scope.row.name)"
/>
</el-tooltip>
</el-button>
</template>
</vxe-table-column>
</vxe-table>
</lb-table>
</div>
<edit-dialog ref="dialogForm" />
</div>
</template>
<script>
// 定时任务
import data from "./data";
import sjsbTask from "@/api/sjsbTask.js";
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
export default {
name: "users",
components: {},
name: "menus",
mixins: [tableMixin],
components: {
EditDialog,
},
data() {
return {
title: '',
taskData: null,
form: {
job_name: "",
currentPage: 1,
},
queryParam: {},
selectType: '0',
queryName: '',
organizationId: '', // 组织机构ID
departmentId: '', // 部门ID
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
tableData: [],
sexList: [],
typeOptions: [
{
value: '0',
label: '姓名'
value: "0",
label: "姓名",
},
{
value: '1',
label: '工号'
value: "1",
label: "工号",
},
{
value: '2',
label: '部门'
value: "2",
label: "部门",
},
{
value: '3',
label: '机构'
}
value: "3",
label: "机构",
},
],
// tableUrl: api.users, // 接口地址,
pageData: {
total: 0,
pageSize: 15,
current: 1,
},
};
selectionList: [],
tableData: {
columns: [
{
label: "序号",
type: "index",
width: "50",
index: this.indexMethod,
},
created() {
// 获取区域和组织机构id
eventBus.$on('getSelectedId', (res) => {
if (!res.organizationId) {
this.tableData = []
this.organizationId = ''
this.departmentId = ''
} else {
this.organizationId = res.organizationId
this.departmentId = res.departmentId
this.getTableList()
this.getDepartData()
}
this.initDictConfig()
})
]
.concat(data.columns())
.concat([
{
label: "排序",
width: 380,
render: (h, scope) => {
return <div></div>;
},
updated() {
this.tableData.forEach((element) => {
element.switch = element.status === 'ACTIVE'
})
},
methods: {
initDictConfig() {
getDictItems('XB').then((res) => {
if (res.status === 1) {
this.sexList = res.content
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
getDictItems('ZWJB').then((res) => {
if (res.status === 1) {
this.levelList = res.content
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
getDepartData() {
getDeptsByIdAction(this.organizationId).then((res) => {
if (res.status === 1) {
this.departmentList = res.content
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.updateLock(scope.row, scope.row.name);
}}
>
解锁
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
onClick={() => {
this.resetPassword(scope.row.id);
}}
>
重置
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
getTableList() {
this.loading = true
this.queryParam = {
organizationId: this.organizationId,
departmentId: this.departmentId
}
getUserList(this.queryParam).then((res) => {
if (res.status === 1) {
this.loading = false
this.tableData = res.content
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
// 查询
searchQuery() {
switch (this.selectType) {
case '0':
this.queryParam.type = 'NAME'
break
case '1':
this.queryParam.type = 'CODE'
break
case '2':
this.queryParam.type = 'DEPARTMENT'
break
case '3':
this.queryParam.type = 'ORGANIZATION'
break
default:
break
}
this.queryParam.typeValue = this.queryName
getUserList(this.queryParam).then((res) => {
if (res.status === 1) {
this.tableData = res.content
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
]),
data: [],
},
// 重置搜索
resetSearch() {
this.selectType = '0'
this.queryName = ''
this.queryParam = {
organizationId: this.organizationId,
departmentId: this.departmentId
}
this.getTableList()
pageData: {
total: 5,
pageSize: 15,
current: 1,
},
// 性别
formatterSex({ cellValue }) {
if (this.sexList.length !== 0) {
if (cellValue !== null) {
const sex = this.sexList.find((item) => item.value === cellValue).name
return sex
} else {
return cellValue
}
}
};
},
// 职务级别
formatterjobLevel({ cellValue }) {
if (this.levelList.length !== 0) {
if (cellValue) {
const jobLevel = this.levelList.find(
(item) => item.value === cellValue
).name
return jobLevel
} else {
return cellValue
}
}
methods: {
handleAdd() {
this.taskData = null;
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
// 删除
handleDelete(id, content) {
this.$confirm(deleteDomStr(content), '执行确认', {
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteAction(`${api.users}/${id}`).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
} else {
this.$message.error({ message: res.message, showClose: true })
}
this.getTableList()
})
})
.catch(() => {})
featchData() {
this.tableData.data = [
{
id: "6a269fa4-49ee-40ed-be72-302ebdf7b9d6",
name: "组件开发模板测试用户",
sort: 67,
loginName: "wgs-template-test",
email: null,
lastLoginTime: null,
mobilePhone: null,
isLocked: false,
status: "ACTIVE",
passwordChangeTime: "2022-06-29T01:59:18.123+0000",
idCard: null,
departmentId: "dcce05ff-7747-4c19-b31f-c018ec8d8f0c",
departmentName: "科室一",
organizationId: "e9e830f0-38f4-4fb2-90ad-496c4e1314aa",
sex: "0",
isDuty: null,
code: "adfasfd",
jobLevel: null,
telephone: null,
address: null,
_X_ROW_KEY: "row_42",
switch: true,
},
// 修改状态
changeStatus(row) {
this.$confirm('确定要修改状态吗?', '提示', {
customClass: 'customer-update',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const status = row.status === 'ACTIVE' ? 'INACTIVE' : 'ACTIVE'
const id = row.id
updateStatus(id, status).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableList()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch((err) => {
console.log({ err })
})
{
id: "acebbaf3-81d0-4b0f-a426-feafa7ea1bed",
name: "饿肚肚",
sort: 36,
loginName: "吃饭",
email: null,
lastLoginTime: null,
mobilePhone: null,
isLocked: false,
status: "ACTIVE",
passwordChangeTime: "2021-08-24T02:04:39.132+0000",
idCard: "43423441242134 ",
departmentId: "dcce05ff-7747-4c19-b31f-c018ec8d8f0c",
departmentName: "科室一",
organizationId: "e9e830f0-38f4-4fb2-90ad-496c4e1314aa",
sex: null,
isDuty: null,
code: "2323",
jobLevel: null,
telephone: null,
address: null,
_X_ROW_KEY: "row_43",
switch: true,
}
];
},
// 重置搜索
// resetSearch() {
// this.selectType = "0";
// this.queryName = "";
// this.queryParam = {
// organizationId: this.organizationId,
// departmentId: this.departmentId
// }
// },
// 更新用户解锁状态
updateLock(id, name) {
this.$confirm(
......@@ -456,44 +235,44 @@ export default {
<span >无法恢复</span>
</p>
</div>`,
'执行确认',
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
updateLock(id).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableList()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
// updateLock(id).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// this.getTableList()
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
})
.catch(() => {})
.catch(() => {});
},
// 重置用户密码
resetPassword(data) {
const ids = []
const ids = [];
if (data instanceof Array) {
data.forEach((item) => {
ids.push(item.id)
})
ids.push(item.id);
});
} else {
ids.push(data)
ids.push(data);
}
console.log(ids, 'ids')
console.log(ids, "ids");
if (ids.length === 0) {
this.$message({
message: '请选择需要重置密码的用户!',
showClose: true
})
return
message: "请选择需要重置密码的用户!",
showClose: true,
});
return;
}
this.$confirm(
`<div class="customer-message-wrapper">
......@@ -502,85 +281,55 @@ export default {
<span >无法恢复</span>
</p>
</div>`,
'执行确认',
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
resetPassword(ids).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableList()
} else {
this.$message.error({ message: res.message, showClose: true })
}
// resetPassword(ids).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// this.getTableList()
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
})
.catch(() => {});
},
// 修改人员信息
handleEdit(row) {
this.$refs.dialogForm.edit(row);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete(id, content) {
this.$confirm("此操将进行删除操作, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.catch(() => {})
.then(() => {
// deleteAction(`${api.users}/${id}`).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// this.getTableList()
// })
})
.catch(() => {});
},
// 新增回显
reloadTableData() {
this.getTableList()
},
showimport() {
this.$refs.leadingIn.import(this.tableUrl, '人员')
}
}
}
};
</script>
<style scoped lang="less">
.content {
.top-wrapper {
.el-button + .el-button {
margin-left: 16px;
}
.top-wrapper-search {
display: inline-block;
margin-left: 16px;
::v-deep .el-input,
::v-deep .el-input__inner {
height: 32px;
}
.select {
width: 120px;
vertical-align: middle;
}
.selectName {
width: 178px;
margin: 0 16px;
vertical-align: middle;
::v-deep .el-input-group__append {
background: #e0eeff;
color: #3aa3f8 !important;
padding-right: 12px;
border-radius: 0;
.el-button {
padding: 8px 8px;
}
}
}
}
}
.vxe-table {
::v-deep .vxe-body--row {
.vxe-body--column:nth-child(3) {
text-align: left;
}
.svg-icon {
width: 1.5em;
height: 1.5em;
vertical-align: middle;
margin-left: 5px;
}
}
}
}
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
</style>
......