Browse Source

完善项目

dev-lcr
lcr 2 months ago
parent
commit
4d92d79ce8
9 changed files with 329 additions and 104 deletions
  1. +1
    -0
      debug.log
  2. +9
    -0
      src/api/business/ctApply.js
  3. +22
    -0
      src/api/business/ctApplyPlan.js
  4. +9
    -0
      src/api/business/ctResourceLibrary.js
  5. +14
    -11
      src/views/business/ctApply/index.vue
  6. +232
    -15
      src/views/business/ctApplyPlan/index.vue
  7. +4
    -6
      src/views/business/ctResourceLibrary/index.vue
  8. +2
    -2
      src/views/login.vue
  9. +36
    -70
      src/views/system/user/index.vue

+ 1
- 0
debug.log View File

@@ -2,3 +2,4 @@
[0613/102540.147:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2)
[0618/152950.053:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2)
[0618/160106.928:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2)
[0626/154642.203:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2)

+ 9
- 0
src/api/business/ctApply.js View File

@@ -1,6 +1,15 @@
import request from '@/utils/request'


// 修改应用用时
export function updateRunDate(data) {
return request({
url: '/business/ctApply/updateRunDate',
method: 'post',
data:data
})
}

// 同步应用数据
export function syn() {
return request({


+ 22
- 0
src/api/business/ctApplyPlan.js View File

@@ -1,6 +1,28 @@
import request from '@/utils/request'




// 启用或禁用
export function stopOrStart(data) {
return request({
url: '/business/ctApplyPlan/stopOrStart',
method: 'post',
data: data
})
}


// 修改运行时间
export function updateRunTime(data) {
return request({
url: '/business/ctApplyPlan/updateRunTime',
method: 'post',
data: data
})
}


// 重新运行计划
export function appRetry(jobUuid) {
return request({


+ 9
- 0
src/api/business/ctResourceLibrary.js View File

@@ -1,5 +1,14 @@
import request from '@/utils/request'

// 提交参数修改
export function updateBatch(data) {
return request({
url: '/business/ctResourceLibrary/updateBatch',
method: 'post',
data: data
})
}

// 根据应用id查询所有参数
export function listByAppId(appId) {
return request({


+ 14
- 11
src/views/business/ctApply/index.vue View File

@@ -34,7 +34,7 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSyn"
v-hasPermi="['business:ctApply:syn']">同步应用数据</el-button>
<span style="color: red;"> 提示:搜索更新并非实时数据,同步为最新数据</span>
<span style="color: red;"> 提示:搜索更新并非实时数据,同步为最新数据</span>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -46,7 +46,7 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="应用名称" align="center" prop="appName" width="200" fixed="left" >
<el-table-column label="应用名称" align="center" prop="appName" width="200" fixed="left">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p> {{ scope.row.appName }}</p>
@@ -56,14 +56,14 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="所属部门" align="center" prop="deptName" width="100" >
<el-table-column label="所属部门" align="center" prop="deptName" width="100">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p v-if="scope.row.deptName == null">应用名称前缀:部门-XXX 分配部门</p>
<p v-if="scope.row.deptName != null"> {{ scope.row.deptName }}</p>
<div slot="reference" class="name-wrapper">
<el-tag size="medium" v-if="scope.row.deptName != null" >{{scope.row.deptName}}</el-tag>
<el-tag size="medium" v-if="scope.row.deptName == null" >未分配部门</el-tag>
<el-tag size="medium" v-if="scope.row.deptName != null">{{ scope.row.deptName }}</el-tag>
<el-tag size="medium" v-if="scope.row.deptName == null">未分配部门</el-tag>
</div>
</el-popover>
</template>
@@ -82,6 +82,7 @@
<!-- <el-table-column label="icon图下载地址" align="center" prop="icon" width="200" /> -->
<!-- <el-table-column label="参数" align="center" prop="param" width="150" /> -->
<el-table-column label="预计人工耗时(分钟)" align="center" prop="manualTime" width="150" />
<el-table-column label="共计节约时间" align="center" prop="timeSaving" width="150" />
<el-table-column label="应用类型名称" align="center" prop="appTypeName" width="100" />
<!-- <el-table-column label="应用类型枚举" align="center" prop="appType" width="100">
<template slot-scope="scope">
@@ -94,7 +95,7 @@
<!-- <el-table-column label="应用所有者账号" align="center" prop="ownerAccount" width="200" />
<el-table-column label="所有者id" align="center" prop="ownerId" width="300" />
<el-table-column label="appid" align="center" prop="appId" width="300" /> -->
<!-- <el-table-column label="部门id" align="center" prop="deptId" width="100" /> -->
<el-table-column label="创建者" align="center" fixed="right" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" fixed="right" prop="createTime" width="100">
@@ -111,8 +112,8 @@
<el-table-column label="备注" align="center" prop="remark" width="100" />
<el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.version != '未发版'" size="mini" type="text" icon="el-icon-edit" @click="showConfigTime(scope.row)"
v-hasPermi="['business:ctApply:configTime']">设置人工用时</el-button>
<el-button v-if="scope.row.version != '未发版'" size="mini" type="text" icon="el-icon-edit"
@click="showConfigTime(scope.row)" v-hasPermi="['business:ctApply:configTime']">设置人工用时</el-button>
</template>
</el-table-column>
</el-table>
@@ -191,7 +192,7 @@
</template>

<script>
import { listCtApply, getCtApply, delCtApply, addCtApply, updateCtApply, syn } from "@/api/business/ctApply";
import { listCtApply, getCtApply, delCtApply, addCtApply, updateCtApply, syn, updateRunDate } from "@/api/business/ctApply";

export default {
name: "CtApply",
@@ -242,8 +243,9 @@ export default {
methods: {
/** 设置时间 */
submitConfigTime() {
let data = { id: this.form.id, manualTime: this.form.manualTime }
updateCtApply(data).then(response => {
let data = { id: this.form.id, appId: this.form.appId, manualTime: this.form.manualTime }
console.log("data",data);
updateRunDate(data).then(response => {
this.$modal.msgSuccess("设置成功");
this.showConfigTimeVisible = false;
this.getList();
@@ -252,6 +254,7 @@ export default {
/** 打开设置时间 */
showConfigTime(row) {
this.form.id = row.id
this.form.appId = row.appId
this.showConfigTimeVisible = true;
},
/** 同步 */


+ 232
- 15
src/views/business/ctApplyPlan/index.vue View File

@@ -42,15 +42,27 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="计划名称" align="center" prop="planName" width="150" />
<el-table-column label="计划名称" align="center" prop="planName" width="200" >
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p>{{ scope.row.planName }}</p>
<div slot="reference" class="name-wrapper">
{{ scope.row.planName.length > 10 ? scope.row.planName.substring(0, 10) + "....." : scope.row.planName }}
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column label="应用名称" align="center" prop="appName" width="250" />
<el-table-column label="输出内容" align="center" prop="outParam" width="100">
<el-table-column label="输出内容" align="center" prop="outParam" width="150">
<template slot-scope="scope">
<el-tag v-if="scope.row.outParam != null && scope.row.outParam.includes('.xlsx')" style='cursor:pointer;'
@click="downloadUrl(scope.row.outParam)">点击下载</el-tag>
<span v-if="scope.row.outParam != null && !scope.row.outParam.includes('.xlsx')">{{ scope.row.outParam
}}</span>
<span v-if="scope.row.outParam == null"> 没有文件</span>
<el-tag v-if="scope.row.excType == '2'" :type="''" effect="dark" style='cursor:pointer;margin-left: 10px;' @click="showLog(scope.row.id)">
更多
</el-tag>
</template>
</el-table-column>
<el-table-column label="计划参数" align="center" prop="planParams" width="100">
@@ -69,11 +81,10 @@
<dict-tag :options="dict.type.plan_type" :value="scope.row.planType" />
</template>
</el-table-column>
<el-table-column label="机器人名称" align="center" prop="robotName" width="150" />
<el-table-column label="机器人名称" align="center" prop="robotName" width="200" />
<el-table-column label="应用类型名称" align="center" prop="appTypeName" width="100" />
<el-table-column label="appid" align="center" prop="appId" width="300" />
<el-table-column label="应用类型枚举" align="center" prop="appType" width="100" />

<el-table-column label="等待超时时间" align="center" prop="waitTimeout" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.wait_timeout" :value="scope.row.waitTimeout" />
@@ -86,7 +97,13 @@
</template>
</el-table-column>
<el-table-column label="执行时间" align="center" prop="excTime" width="160" />
<el-table-column label="执行表达式" align="center" prop="cronExpression" width="100" />
<el-table-column label="执行表达式" align="center" prop="cronExpression" width="150" />
<el-table-column label="启用状态" align="center" prop="enabled" width="100">
<template slot-scope="scope">
<span v-if="scope.row.enabled == '0'">启用</span>
<span v-if="scope.row.enabled == '1'">禁用</span>
</template>
</el-table-column>
<el-table-column label="任务执行状态" align="center" fixed="right" prop="taskStatus" width="100">
<template slot-scope="scope">
<el-popover v-if="scope.row.taskStatus == 'error'" trigger="hover" placement="top">
@@ -102,8 +119,8 @@
<el-table-column label="上次执行时间" align="center" prop="lastExecTime" width="200" />
<el-table-column label="下次执行时间" align="center" prop="nextExecTime" width="200" />
<el-table-column label="任务运行uuid" align="center" prop="taskUuid" width="300" />
<el-table-column label="开始时间" align="center" fixed="right" prop="startTime" width="200" />
<el-table-column label="结束时间" align="center" fixed="right" prop="endTime" width="200" />
<el-table-column label="开始时间" align="center" prop="startTime" width="200" />
<el-table-column label="结束时间" align="center" prop="endTime" width="200" />
<el-table-column label="人工耗时" align="center" prop="manualTime" width="100">
<template slot-scope="scope">
<span v-if="scope.row.manualTime != null">{{ scope.row.manualTime }} 分钟</span>
@@ -126,12 +143,21 @@
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center" prop="remark" /> -->
<el-table-column label="操作" align="center" width="250" fixed="right" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="350" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <router-link to="/rpa/ctResourceLibrary">
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create'" type="text" icon="el-icon-setting"
v-hasPermi="['business:ctApplyPlan:edit']">设置参数</el-button>
v-hasPermi="['business:ctApplyPlan:edit']">启用</el-button>
</router-link> -->
<el-button size="mini"
v-if="(scope.row.taskStatus == 'await_create' || scope.row.taskStatus == 'finish' || scope.row.taskStatus == 'stopped' || scope.row.taskStatus == 'error' || scope.row.taskStatus == 'skipped' || scope.row.taskStatus == 'cancel')
&& (scope.row.excType == '1' || scope.row.excType == '2')"
type="text" icon="el-icon-date" @click="updateParams(scope.row)"
v-hasPermi="['business:ctApplyPlan:updateRunTime']">修改文件</el-button>
<el-button size="mini"
v-if="((scope.row.excType == '1' && scope.row.taskStatus == 'await_create') || scope.row.excType == '2')"
type="text" icon="el-icon-date" @click="updateRunTime(scope.row)"
v-hasPermi="['business:ctApplyPlan:updateRunTime']">设置执行时间</el-button>
<el-button size="mini"
v-if="scope.row.taskStatus == 'stopped' || scope.row.taskStatus == 'error' || scope.row.taskStatus == 'cancel'"
type="text" icon="el-icon-refresh" @click="appRetry(scope.row)"
@@ -139,8 +165,12 @@
<el-button size="mini" v-if="scope.row.taskStatus == 'running' || scope.row.taskStatus == 'waiting'"
type="text" icon="el-icon-video-pause" @click="stopRun(scope.row)"
v-hasPermi="['business:ctApplyPlan:stopRun']">停止运行</el-button>
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create'" type="text" icon="el-icon-edit"
@click="handleUpdate(scope.row)" v-hasPermi="['business:ctApplyPlan:edit']">修改</el-button>
<el-button size="mini" v-if="scope.row.excType != 0 && scope.row.enabled == '1'" type="text"
icon="el-icon-video-play" @click="start(scope.row)"
v-hasPermi="['business:ctApplyPlan:start']">启用</el-button>
<el-button size="mini" v-if="scope.row.excType != 0 && scope.row.enabled == '0'" type="text"
icon="el-icon-video-pause" @click="stop(scope.row)"
v-hasPermi="['business:ctApplyPlan:stop']">禁用</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['business:ctApplyPlan:remove']">删除</el-button>
</template>
@@ -169,7 +199,6 @@
</el-form-item>
</el-col>
</el-row>

<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="如何执行" prop="excType">
@@ -215,7 +244,7 @@
<el-input-number v-model="scope.row.resourceValue" :precision="0"
v-if="scope.row.resourceType == 'int'" placeholder="请输入资源内容"></el-input-number>

<el-input-number v-model="form.resourceValue" :precision="2"
<el-input-number v-model="scope.row.resourceValue" :precision="2"
v-if="scope.row.resourceType == 'float'" placeholder="请输入资源内容"></el-input-number>

<el-switch v-model="scope.row.resourceValue" active-text="真" inactive-text="假" active-value="true"
@@ -235,6 +264,100 @@
</div>
</el-dialog>

<!-- 修改执行时间 -->
<el-dialog title="修改执行时间" :visible.sync="openUpdateRunTime" width="900px" append-to-body>
<el-form ref="form" :model="updateRunTimeForm" :rules="rules" label-width="120px">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="如何执行" prop="excType">
<el-select v-model="updateRunTimeForm.excType" placeholder="请选择执行方式" disabled>
<el-option v-for="dict in dict.type.exc_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item v-if="updateRunTimeForm.excType == 1" label="执行时间" prop="excTime">
<el-date-picker clearable v-model="updateRunTimeForm.excTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择执行时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="updateRunTimeForm.excType == 2" label="cron表达式" prop="cronExpression">
<el-input v-model="updateRunTimeForm.cronExpression" placeholder="请输入cron执行表达式"></el-input>
</el-form-item>
</el-col>
<el-col v-if="updateRunTimeForm.excType == 2" :span="4">
<a style="color: royalblue;" href="https://www.pppet.net/" target="_blank">表达式生成地址</a>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateRunTimeSubmit">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>

<!-- 修改文件 -->
<el-dialog title="修改文件" :visible.sync="openUpdateParams" width="900px" append-to-body>
<el-form ref="openUpdateParamsForm" :model="openUpdateParamsForm" :rules="rules" label-width="120px">
<!-- 参数列表 -->
<el-row :gutter="24" v-if="isParam">
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>执行应用需要填写以下内容</span>
</div>
<div class="text item">
<el-table :data="resourceLibrarieList" style="width: 100%">
<el-table-column prop="resource" label="文件描述" />
<el-table-column prop="resourceValue" label="文件内容">
<template slot-scope="scope">
<file-upload v-model="scope.row.resourceValue" v-if="scope.row.resourceType == 'file'" />

<el-input v-if="scope.row.resourceType == null || scope.row.resourceType == 'str'"
v-model="scope.row.resourceValue" type="text" placeholder="请输入资源内容" />

<el-input-number v-model="scope.row.resourceValue" :precision="0"
v-if="scope.row.resourceType == 'int'" placeholder="请输入资源内容"></el-input-number>

<el-input-number v-model="scope.row.resourceValue" :precision="2"
v-if="scope.row.resourceType == 'float'" placeholder="请输入资源内容"></el-input-number>

<el-switch v-model="scope.row.resourceValue" active-text="真" inactive-text="假" active-value="true"
v-if="scope.row.resourceType == 'bool'" inactive-value="false" />
</template>
</el-table-column>
</el-table>
</div>
</el-card>

</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateParamsSubmit">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>

<el-drawer title="历史执行记录" :visible.sync="drawer" :direction="'rtl'" :before-close="handleClose">
<el-table :data="logList" style="width: 100%" max-height="830">
<el-table-column align="center" prop="createTime" label="时间" />
<el-table-column align="center" prop="outParam" label="内容">
<template slot-scope="scope">
<el-tag v-if="scope.row.outParam != null && scope.row.outParam.includes('.xlsx')" style='cursor:pointer;'
@click="downloadUrl(scope.row.outParam)">点击下载</el-tag>
<span v-if="scope.row.outParam != null && !scope.row.outParam.includes('.xlsx')">{{ scope.row.outParam
}}</span>
<span v-if="scope.row.outParam == null"> 没有文件</span>
</template>
</el-table-column>
</el-table>
</el-drawer>


<el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
<crontab @hide="openCron = false" @fill="crontabFill" :expression="expression"></crontab>
</el-dialog>
@@ -242,8 +365,9 @@
</template>

<script>
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan, stopRun, appRetry } from "@/api/business/ctApplyPlan";
import { listByAppId } from "@/api/business/ctResourceLibrary";
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan, stopRun, appRetry, stopOrStart,updateRunTime } from "@/api/business/ctApplyPlan";
import { listCtApplyPlanLogAll } from "@/api/business/ctApplyPlanLog";
import { listByAppId, updateBatch } from "@/api/business/ctResourceLibrary";
import { listRebotAll } from "@/api/business/ctRebot";
import { listApplyAll } from "@/api/business/ctApply";
import Crontab from '@/components/Crontab'
@@ -255,6 +379,17 @@ export default {
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status', 'app_param_type'],
data() {
return {
drawer: false,
// 日志
logList: [],
// 修改参数对象
openUpdateParamsForm: {},
// 修改参数弹出
openUpdateParams: false,
// 修改执行时间对象
updateRunTimeForm: {},
// 修改执行时间弹出
openUpdateRunTime: false,
baseUrl: process.env.VUE_APP_BASE_API,
// 是否显示Cron表达式弹出层
openCron: false,
@@ -314,12 +449,89 @@ export default {
resourceLibrarieList: [],
// 应用是否需要参数
isParam: false,

};
},
created() {
this.getList();
},
methods: {
/** 显示执行日志 */
showLog(id) {
listCtApplyPlanLogAll({ planId: id }).then(res => {
this.logList = res.data;
this.drawer = true;
});
},
/** 提交参数修改 */
updateParamsSubmit() {
this.openUpdateParamsForm.list = this.resourceLibrarieList;
updateBatch(this.openUpdateParamsForm).then(res => {
this.$modal.msgSuccess("修改成功");
this.openUpdateParams = false;
});
},
updateParams(row) {
const id = row.id || this.ids
this.isParam = false;
getCtApplyPlan(id).then(response => {
this.openUpdateParamsForm = response.data;
this.openUpdateParams = true;
console.log("response.supportParam", response.data.supportParam);
if (response.data.supportParam == 1) {
this.isParam = true;
listByAppId(row.appId).then(res => {
console.log("res.data", res.data);
this.resourceLibrarieList = res.data;
});
}
this.title = "修改文件";
});
},
/**修改执行时间 */
updateRunTimeSubmit() {
if (this.updateRunTimeForm.excType == 1 && this.updateRunTimeForm.excTime == null) {
this.$modal.msgError("指定时间执行时间不能为空");
return;
}
if (this.updateRunTimeForm.excType == 2 && this.updateRunTimeForm.cronExpression == null) {
this.$modal.msgError("周期执行表达式不能为空");
return;
}

let data = { id: this.updateRunTimeForm.id }
if (this.updateRunTimeForm.excType == '1') {
data.excTime = this.updateRunTimeForm.excTime;
} else if (this.updateRunTimeForm.excType == '2') {
data.cronExpression = this.updateRunTimeForm.cronExpression;
}
console.log("data", data);
updateRunTime(data).then(res => {
this.$modal.msgSuccess("修改成功");
this.getList();
});
this.updateRunTimeForm = {};
this.openUpdateRunTime = false;
},
/**修改执行时间弹窗 */
updateRunTime(row) {
this.updateRunTimeForm = row;
this.openUpdateRunTime = true;
},
/** 启用 */
start(row) {
stopOrStart({ id: row.id, enabled: '0' }).then(res => {
this.$modal.msgSuccess("启用成功");
this.getList();
});
},
/** 禁用 */
stop(row) {
stopOrStart({ id: row.id, enabled: '1' }).then(res => {
this.$modal.msgSuccess("禁用成功");
this.getList();
});
},
/** 新增计划时选中app */
changeApp(newValue) {
this.isParam = false;
@@ -378,6 +590,8 @@ export default {
// 取消按钮
cancel() {
this.open = false;
this.openUpdateRunTime = false;
this.openUpdateParams = false;
this.reset();
},
// 表单重置
@@ -532,6 +746,9 @@ export default {
getFileName(fileName) {
// return fileName.substring(fileName.lastIndexOf("/") +1,fileName.lastIndexOf("."))
return fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length)
},
handleClose(done) {
done();
}
}
};

+ 4
- 6
src/views/business/ctResourceLibrary/index.vue View File

@@ -32,7 +32,7 @@
</el-row>

<el-table v-loading="loading" :data="ctResourceLibraryList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" fixed="left" /> -->
<el-table-column type="selection" width="55" align="center" fixed="left" />
<!-- <el-table-column label="序号" width="55" align="center" fixed="left">
<template slot-scope="scope">
{{ scope.$index + 1 }}
@@ -54,7 +54,7 @@
<dict-tag :options="dict.type.app_param_type" :value="scope.row.resourceType" />
</template>
</el-table-column>
<el-table-column label="资源描述" align="center" prop="resource" width="200">
<el-table-column label="资源描述" align="center" prop="resource">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p>{{ scope.row.resource }}</p>
@@ -64,8 +64,8 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="资源内容" align="center" prop="resourceValue" width="100">
<el-table-column label="资源键" align="center" prop="resourceName" width="100" />
<el-table-column label="资源内容" align="center" prop="resourceValue">
<template slot-scope="scope">
<el-tag
v-if="scope.row.resourceValue != null && (scope.row.resourceValue.includes('.xlsx') || scope.row.resourceValue.includes('.docx'))"
@@ -76,7 +76,6 @@
</template>
.xlsx
</el-table-column>
<el-table-column label="资源键" align="center" prop="resourceName" width="100" />
<!-- <el-table-column label="部门id" align="center" prop="deptId" width="100" /> -->
<!-- <el-table-column label="所属部门" align="center" prop="deptName" width="100" /> -->
<el-table-column label="创建者" align="center" fixed="right" prop="createBy" width="100" />
@@ -91,7 +90,6 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"


+ 2
- 2
src/views/login.vue View File

@@ -72,8 +72,8 @@ export default {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: ""


+ 36
- 70
src/views/system/user/index.vue View File

@@ -30,19 +30,19 @@
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName">
<el-form-item label="用户账号" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
placeholder="请输入用户账号"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-form-item label="用户名称" prop="nickName">
<el-input
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
v-model="queryParams.nickName"
placeholder="请输入用户名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
@@ -63,17 +63,6 @@
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -138,11 +127,9 @@

<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="用户名称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户账号" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope">
<el-switch
@@ -207,8 +194,8 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
<el-form-item v-if="form.userId == undefined" label="用户账号" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户账号" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -219,39 +206,40 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户名称" type="text" maxlength="20"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -266,34 +254,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
@@ -428,6 +388,12 @@ export default {
{ required: true, message: "用户名称不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
],
deptId: [
{ required: true, message: "用户部门不能为空", trigger: "blur" }
],
roleIds: [
{ required: true, message: "用户角色不能为空", trigger: "blur" }
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
],
@@ -461,9 +427,9 @@ export default {
created() {
this.getList();
this.getDeptTree();
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
});
// this.getConfigKey("sys.user.initPassword").then(response => {
// this.initPassword = response.msg;
// });
},
methods: {
/** 查询用户列表 */


Loading…
Cancel
Save