@@ -60,7 +60,7 @@ export default { | |||
// 文件类型, 例如['png', 'jpg', 'jpeg'] | |||
fileType: { | |||
type: Array, | |||
default: () => ["doc", "xls", "ppt", "txt", "pdf"], | |||
default: () => ["doc", "xls", "xlsx", "ppt", "txt", "pdf"], | |||
}, | |||
// 是否显示提示 | |||
isShowTip: { | |||
@@ -35,33 +35,38 @@ | |||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSyn" | |||
v-hasPermi="['business:ctApply:add']">同步应用数据</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |||
v-hasPermi="['business:ctApply:export']">导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="ctApplyList" @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 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="应用名称" align="center" prop="appName" width="300" /> | |||
<el-table-column label="应用类型名称" align="center" prop="appTypeName" width="100" /> | |||
<el-table-column label="应用类型枚举" align="center" prop="appType" width="100"> | |||
<el-table-column label="应用名称" align="center" prop="appName" width="200" fixed="left" > | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.app_type" :value="scope.row.appType" /> | |||
<el-popover trigger="hover" placement="top"> | |||
<p> {{ scope.row.appName }}</p> | |||
<div slot="reference" class="name-wrapper"> | |||
<el-tag size="medium">{{scope.row.appName}}</el-tag> | |||
</div> | |||
</el-popover> | |||
</template> | |||
</el-table-column> | |||
<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> | |||
</div> | |||
</el-popover> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="应用创建时间" align="center" prop="appCreateTime" width="100" /> | |||
<el-table-column label="应用修改时间" align="center" prop="appUpdateTime" width="100" /> | |||
<el-table-column label="应用所有者名称" align="center" prop="ownerName" width="120" /> | |||
<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="版本" align="center" prop="version" width="100" /> | |||
<el-table-column label="是否支持应用参数" align="center" prop="supportParam" width="200"> | |||
<template slot-scope="scope"> | |||
@@ -74,10 +79,22 @@ | |||
</template> | |||
</el-table-column> | |||
<!-- <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="param" width="150" /> --> | |||
<el-table-column label="预计人工耗时(分钟)" align="center" prop="manualTime" width="150" /> | |||
<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" prop="appTypeName" width="100" /> | |||
<!-- <el-table-column label="应用类型枚举" align="center" prop="appType" width="100"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.app_type" :value="scope.row.appType" /> | |||
</template> | |||
</el-table-column> --> | |||
<el-table-column label="应用创建时间" align="center" prop="appCreateTime" width="100" /> | |||
<el-table-column label="应用修改时间" align="center" prop="appUpdateTime" width="100" /> | |||
<el-table-column label="应用所有者名称" align="center" prop="ownerName" width="120" /> | |||
<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"> | |||
<template slot-scope="scope"> | |||
@@ -93,22 +110,8 @@ | |||
<el-table-column label="备注" align="center" prop="remark" /> | |||
<el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width"> | |||
<template slot-scope="scope"> | |||
<el-button size="mini" type="text" icon="el-icon-edit" @click="showConfigTime(scope.row)" | |||
v-hasPermi="['business:ctApply:edit']">设置时间</el-button> | |||
<!-- <el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-edit" | |||
@click="handleUpdate(scope.row)" | |||
v-hasPermi="['business:ctApply:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:ctApply:remove']" | |||
>删除</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> | |||
@@ -4,12 +4,16 @@ | |||
<el-form-item label="计划名称" prop="planName"> | |||
<el-input v-model="queryParams.planName" placeholder="请输入计划名称" clearable @keyup.enter.native="handleQuery" /> | |||
</el-form-item> | |||
<el-form-item label="机器人名称" prop="robotName"> | |||
<el-input v-model="queryParams.robotName" placeholder="请输入计划执行的机器人名称" clearable | |||
@keyup.enter.native="handleQuery" /> | |||
</el-form-item> | |||
<el-form-item label="应用名称" prop="appName"> | |||
<el-input v-model="queryParams.appName" placeholder="请输入应用名称" clearable @keyup.enter.native="handleQuery" /> | |||
<el-form-item label="应用名称" prop="appId"> | |||
<el-select v-model="form.appId" filterable placeholder="请选择应用"> | |||
<el-option v-for="apply in applyList" :key="apply.appId" :label="apply.appName" | |||
@keyup.enter.native="handleQuery" :value="apply.appId"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="执行类型" prop="excType"> | |||
<el-select v-model="queryParams.excType" placeholder="请选择执行类型" clearable> | |||
@@ -27,18 +31,6 @@ | |||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |||
v-hasPermi="['business:ctApplyPlan:add']">新增</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" | |||
v-hasPermi="['business:ctApplyPlan:edit']">修改</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" | |||
v-hasPermi="['business:ctApplyPlan:remove']">删除</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |||
v-hasPermi="['business:ctApplyPlan:export']">导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
@@ -52,6 +44,14 @@ | |||
</el-table-column> | |||
<el-table-column label="计划名称" align="center" prop="planName" width="150" /> | |||
<el-table-column label="应用名称" align="center" prop="appName" width="250" /> | |||
<el-table-column label="输出内容" align="center" prop="outParam" width="100"> | |||
<template slot-scope="scope"> | |||
<el-tag v-if="scope.row.outParam != null && scope.row.outParam.includes('.xlsx')" | |||
@click="downloadUrl(scope.row.outParam)">下载</el-tag> | |||
<span v-if="scope.row.outParam != null && !scope.row.outParam.includes('.xlsx')">{{ scope.row.outParam | |||
}}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="调度方式" align="center" prop="planType" width="100"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.plan_type" :value="scope.row.planType" /> | |||
@@ -71,6 +71,7 @@ | |||
</el-popover> | |||
</template> | |||
</el-table-column> | |||
<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" /> | |||
@@ -116,11 +117,12 @@ | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="备注" align="center" prop="remark" /> | |||
<el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width"> | |||
<el-table-column label="操作" align="center" width="250" fixed="right" class-name="small-padding fixed-width"> | |||
<template slot-scope="scope"> | |||
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create' && scope.row.supportParam != 0" | |||
type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |||
v-hasPermi="['business:ctApplyPlan:edit']">设置参数</el-button> | |||
<router-link to="/rpa/ctResourceLibrary"> | |||
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create'" type="text" icon="el-icon-edit" | |||
v-hasPermi="['business:ctApplyPlan:edit']">设置参数</el-button> | |||
</router-link> | |||
<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" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |||
@@ -134,7 +136,7 @@ | |||
<!-- 添加或修改应用执行计划管理对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<el-form-item label="计划名称" prop="planName"> | |||
@@ -153,7 +155,7 @@ | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<el-form-item label="应用名称" prop="appName"> | |||
<el-form-item label="应用名称" prop="appId"> | |||
<el-select v-model="form.appId" multiple filterable collapse-tags style="margin-left: 20px;" | |||
placeholder="请选择机器人"> | |||
<el-option v-for="apply in applyList" :key="apply.appId" :label="apply.appName" :value="apply.appId"> | |||
@@ -171,7 +173,6 @@ | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<el-form-item label="优先级" prop="priority"> | |||
@@ -209,21 +210,6 @@ | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="20"> | |||
<el-form-item label="计划参数" prop="planParams"> | |||
<el-input v-model="form.planParams" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="4"> | |||
<el-row :gutter="24"> | |||
<el-col style="margin-bottom: 10px;" :span="24"><el-button type="primary" size="mini" | |||
@click="showAddParam">添加参数</el-button></el-col> | |||
<el-col :span="24"><el-button type="primary" size="mini" @click="clearAddParam">清空参数</el-button></el-col> | |||
</el-row> | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="24"> | |||
<el-form-item label="备注" prop="remark"> | |||
@@ -239,60 +225,7 @@ | |||
</el-dialog> | |||
<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> | |||
<!-- 添加参数 --> | |||
<el-dialog title="添加参数" :visible.sync="addParamVisible" width="1000px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |||
<el-row :gutter="24"> | |||
<el-col :span="8"> | |||
<el-form-item label="参数类型" prop="type"> | |||
<el-select v-model="param.type" placeholder="请选择参数类型"> | |||
<el-option v-for="dict in dict.type.app_param_type" :key="dict.value" :label="dict.label" | |||
:value="dict.value"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="8"> | |||
<el-form-item label="参数键" prop="name"> | |||
<el-input v-model="param.name" type="text" placeholder="请输入内容" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="param.type == null || param.type == 'str'" :span="8"> | |||
<el-form-item label="参数值" prop="value"> | |||
<el-input v-model="param.value" type="text" placeholder="请输入参数值" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="param.type == 'int'" :span="8"> | |||
<el-form-item label="参数值" prop="value"> | |||
<el-input-number v-model="param.value" :precision="0" placeholder="请输入参数值"></el-input-number> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="param.type == 'float'" :span="8"> | |||
<el-form-item label="参数值" prop="value"> | |||
<el-input-number v-model="param.value" :precision="2" placeholder="请输入参数值"></el-input-number> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="param.type == 'bool'" :span="8"> | |||
<el-form-item label="参数值" prop="value"> | |||
<el-switch v-model="param.value" active-text="真" inactive-text="假" active-value="true" | |||
inactive-value="false" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="param.type == 'file'" :span="8"> | |||
<el-form-item label="参数值" prop="value"> | |||
<file-upload v-model="param.value" /> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="addParam">确 定</el-button> | |||
<el-button @click="addParamVisible = false">取 消</el-button> | |||
</div> | |||
<crontab @hide="openCron = false" @fill="crontabFill" :expression="expression"></crontab> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
@@ -314,8 +247,6 @@ export default { | |||
openCron: false, | |||
// 传入的表达式 | |||
expression: "", | |||
// 添加参数 | |||
addParamVisible: false, | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
@@ -354,6 +285,24 @@ export default { | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
planName: [ | |||
{ required: true, message: "计划名称不能为空", trigger: "blur" } | |||
], | |||
planType: [ | |||
{ required: true, message: "执行类型不能为空", trigger: "change" } | |||
], | |||
appId: [ | |||
{ required: true, message: "请选择一个应用", trigger: "change" } | |||
], | |||
waitTimeout: [ | |||
{ required: true, message: "等待超时时间不能为空", trigger: "blur" } | |||
], | |||
priority: [ | |||
{ required: true, message: "优先级不能为空", trigger: "blur" } | |||
], | |||
excType: [ | |||
{ required: true, message: "执行类型不能为空", trigger: "change" } | |||
], | |||
}, | |||
// 机器人列表 | |||
rebotList: [], | |||
@@ -369,23 +318,6 @@ export default { | |||
this.getList(); | |||
}, | |||
methods: { | |||
// 添加参数 | |||
addParam() { | |||
this.params.push(this.param); | |||
this.form.planParams = JSON.stringify(this.params); | |||
this.addParamVisible = false; | |||
}, | |||
// 清空参数 | |||
clearAddParam() { | |||
this.form.planParams = '' | |||
this.params = []; | |||
this.param = {}; | |||
}, | |||
// 打开添加参数 | |||
showAddParam() { | |||
this.addParamVisible = true; | |||
this.param = {}; | |||
}, | |||
/** 查询应用执行计划管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
@@ -19,31 +19,27 @@ | |||
<el-row :gutter="10" class="mb8"> | |||
<el-col :span="1.5"> | |||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSyn" | |||
v-hasPermi="['business:ctRebot:add']">同步机器人信息</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |||
v-hasPermi="['business:ctRebot:export']">导出</el-button> | |||
v-hasPermi="['business:ctRebot:syn']">同步机器人信息</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="ctRebotList" @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 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="机器人名称" align="center" prop="robotClientName" width="200"/> | |||
<el-table-column label="机器人Uuid信息" align="center" prop="robotClientUuid" width="300"/> | |||
<!-- <el-table-column label="机器人Uuid信息" align="center" prop="robotClientUuid" width="300"/> --> | |||
<el-table-column label="运行状态" align="center" prop="status" width="100"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.rebot_status" :value="scope.row.status"/> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="描述" align="center" prop="description" width="100"/> | |||
<el-table-column label="客户端系统账号" align="center" prop="windowsAccount" width="150"/> | |||
<!-- <el-table-column label="描述" align="center" prop="description" width="100"/> | |||
<el-table-column label="客户端系统账号" align="center" prop="windowsAccount" width="150"/> --> | |||
<el-table-column label="客户端ip" align="center" prop="clientIp" width="150"/> | |||
<!-- <el-table-column label="部门id" align="center" prop="deptId" width="100"/> --> | |||
<el-table-column label="创建者" align="center" fixed="right" prop="createBy" width="100"/> | |||
@@ -1,55 +1,14 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> | |||
<el-form-item label="资源描述" prop="resource"> | |||
<el-input | |||
v-model="queryParams.resource" | |||
placeholder="请输入资源描述" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="资源内容" prop="resourceValue"> | |||
<el-input | |||
v-model="queryParams.resourceValue" | |||
placeholder="请输入资源内容" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="资源类型" prop="resourceType"> | |||
<el-select v-model="queryParams.resourceType" placeholder="请选择资源类型" clearable> | |||
<el-option | |||
v-for="dict in dict.type.app_param_type" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
/> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="资源键" prop="resourceName"> | |||
<el-input | |||
v-model="queryParams.resourceName" | |||
placeholder="请输入资源键" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="所属应用名称" prop="appName"> | |||
<el-input | |||
v-model="queryParams.appName" | |||
placeholder="请输入所属应用名称" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
<el-select v-model="form.appId" filterable placeholder="请选择应用"> | |||
<el-option v-for="apply in applyList" :key="apply.appId" :label="apply.appName" | |||
@keyup.enter.native="handleQuery" :value="apply.appId"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="部门id" prop="deptId"> | |||
<el-input | |||
v-model="queryParams.deptId" | |||
placeholder="请输入部门id" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
<el-form-item label="资源描述" prop="resource"> | |||
<el-input v-model="queryParams.resource" placeholder="请输入资源描述" clearable @keyup.enter.native="handleQuery" /> | |||
</el-form-item> | |||
<el-form-item> | |||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | |||
@@ -59,139 +18,135 @@ | |||
<el-row :gutter="10" class="mb8"> | |||
<el-col :span="1.5"> | |||
<el-button | |||
type="primary" | |||
plain | |||
icon="el-icon-plus" | |||
size="mini" | |||
@click="handleAdd" | |||
v-hasPermi="['business:ctResourceLibrary:add']" | |||
>新增</el-button> | |||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |||
v-hasPermi="['business:ctResourceLibrary:add']">新增</el-button> | |||
</el-col> | |||
<!-- <el-col :span="1.5"> | |||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" | |||
v-hasPermi="['business:ctResourceLibrary:edit']">修改</el-button> | |||
</el-col> --> | |||
<el-col :span="1.5"> | |||
<el-button | |||
type="success" | |||
plain | |||
icon="el-icon-edit" | |||
size="mini" | |||
:disabled="single" | |||
@click="handleUpdate" | |||
v-hasPermi="['business:ctResourceLibrary:edit']" | |||
>修改</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button | |||
type="danger" | |||
plain | |||
icon="el-icon-delete" | |||
size="mini" | |||
:disabled="multiple" | |||
@click="handleDelete" | |||
v-hasPermi="['business:ctResourceLibrary:remove']" | |||
>删除</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button | |||
type="warning" | |||
plain | |||
icon="el-icon-download" | |||
size="mini" | |||
@click="handleExport" | |||
v-hasPermi="['business:ctResourceLibrary:export']" | |||
>导出</el-button> | |||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" | |||
v-hasPermi="['business:ctResourceLibrary:remove']">删除</el-button> | |||
</el-col> | |||
<!-- <el-col :span="1.5"> | |||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |||
v-hasPermi="['business:ctResourceLibrary:export']">导出</el-button> | |||
</el-col> --> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</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 label="序号" width="55" align="center" fixed="left" > | |||
<el-table-column label="序号" width="55" align="center" fixed="left"> | |||
<template slot-scope="scope"> | |||
{{ scope.$index + 1 }} | |||
{{ scope.$index + 1 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="资源描述" align="center" prop="resource" width="100"/> | |||
<el-table-column label="资源内容" align="center" prop="resourceValue" width="100"/> | |||
<el-table-column label="资源描述" align="center" prop="resource" width="100" /> | |||
<el-table-column label="资源内容" align="center" prop="resourceValue" width="100"> | |||
<template slot-scope="scope"> | |||
<el-tag v-if="scope.row.resourceValue.includes('.xlsx')" | |||
@click="downloadUrl(scope.row.resourceValue)">下载</el-tag> | |||
<span v-if="!scope.row.resourceValue.includes('.xlsx')">{{ scope.row.resourceValue }}</span> | |||
</template> | |||
.xlsx | |||
</el-table-column> | |||
<el-table-column label="资源类型" align="center" prop="resourceType" width="100"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.app_param_type" :value="scope.row.resourceType"/> | |||
<dict-tag :options="dict.type.app_param_type" :value="scope.row.resourceType" /> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="资源键" align="center" prop="resourceName" width="100"/> | |||
<el-table-column label="所属应用名称" align="center" prop="appName" width="100"/> | |||
<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" prop="resourceName" width="100" /> | |||
<el-table-column label="所属应用名称" align="center" prop="appName" 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" /> | |||
<el-table-column label="创建时间" align="center" fixed="right" prop="createTime" width="100"> | |||
<template slot-scope="scope"> | |||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="更新者" align="center" fixed="right" prop="updateBy" width="100"/> | |||
<el-table-column label="更新者" align="center" fixed="right" prop="updateBy" width="100" /> | |||
<el-table-column label="更新时间" align="center" fixed="right" prop="updateTime" width="100"> | |||
<template slot-scope="scope"> | |||
<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" 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)" | |||
v-hasPermi="['business:ctResourceLibrary:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:ctResourceLibrary:remove']" | |||
>删除</el-button> | |||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |||
v-hasPermi="['business:ctResourceLibrary:edit']">修改</el-button> | |||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |||
v-hasPermi="['business:ctResourceLibrary:remove']">删除</el-button> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<pagination | |||
v-show="total>0" | |||
:total="total" | |||
:page.sync="queryParams.pageNum" | |||
:limit.sync="queryParams.pageSize" | |||
@pagination="getList" | |||
/> | |||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" | |||
@pagination="getList" /> | |||
<!-- 添加或修改资源库管理对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |||
<el-form-item label="资源描述" prop="resource"> | |||
<el-input v-model="form.resource" placeholder="请输入资源描述" /> | |||
</el-form-item> | |||
<el-form-item label="资源内容" prop="resourceValue"> | |||
<el-input v-model="form.resourceValue" placeholder="请输入资源内容" /> | |||
</el-form-item> | |||
<el-form-item label="资源类型" prop="resourceType"> | |||
<el-select v-model="form.resourceType" placeholder="请选择资源类型"> | |||
<el-option | |||
v-for="dict in dict.type.app_param_type" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="资源键" prop="resourceName"> | |||
<el-input v-model="form.resourceName" placeholder="请输入资源键" /> | |||
</el-form-item> | |||
<el-form-item label="所属应用名称" prop="appName"> | |||
<el-input v-model="form.appName" placeholder="请输入所属应用名称" /> | |||
</el-form-item> | |||
<el-form-item label="部门id" prop="deptId"> | |||
<el-input v-model="form.deptId" placeholder="请输入部门id" /> | |||
</el-form-item> | |||
<el-form-item label="备注" prop="remark"> | |||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
<el-row :gutter="24"> | |||
<el-col :span="8"> | |||
<el-form-item label="资源类型" prop="resourceType" v-hasPermi="['business:ctResourceLibrary:updateType']"> | |||
<el-select v-model="form.resourceType" placeholder="请选择资源类型"> | |||
<el-option v-for="dict in dict.type.app_param_type" :key="dict.value" :label="dict.label" | |||
:value="dict.value"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="8"> | |||
<el-form-item label="资源键" prop="resourceName" v-hasPermi="['business:ctResourceLibrary:updateKey']"> | |||
<el-input v-model="form.resourceName" placeholder="请输入资源键" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="8"> | |||
<el-form-item label="所属应用" prop="appId" v-hasPermi="['business:ctResourceLibrary:updateApp']"> | |||
<el-select v-model="form.appId" filterable placeholder="请选择应用"> | |||
<el-option v-for="apply in applyList" :key="apply.appId" :label="apply.appName" | |||
:value="apply.appId"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<el-form-item label="资源描述" prop="resource""> | |||
<el-input v-model="form.resource" placeholder="请输入资源描述" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="form.resourceType == null || form.resourceType == 'str'" :span="12"> | |||
<el-form-item label="资源内容" prop="value"> | |||
<el-input v-model="form.resourceValue" type="text" placeholder="请输入资源内容" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="form.resourceType == 'int'" :span="12"> | |||
<el-form-item label="资源内容" prop="value"> | |||
<el-input-number v-model="form.resourceValue" :precision="0" placeholder="请输入资源内容"></el-input-number> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="form.resourceType == 'float'" :span="12"> | |||
<el-form-item label="资源内容" prop="value"> | |||
<el-input-number v-model="form.resourceValue" :precision="2" placeholder="请输入资源内容"></el-input-number> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="form.resourceType == 'bool'" :span="12"> | |||
<el-form-item label="资源内容" prop="value"> | |||
<el-switch v-model="form.resourceValue" active-text="真" inactive-text="假" active-value="true" | |||
inactive-value="false" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col v-if="form.resourceType == 'file'" :span="12"> | |||
<el-form-item label="资源内容" prop="value"> | |||
<file-upload v-model="form.resourceValue" /> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
@@ -203,6 +158,7 @@ | |||
<script> | |||
import { listCtResourceLibrary, getCtResourceLibrary, delCtResourceLibrary, addCtResourceLibrary, updateCtResourceLibrary } from "@/api/business/ctResourceLibrary"; | |||
import { listApplyAll } from "@/api/business/ctApply"; | |||
export default { | |||
name: "CtResourceLibrary", | |||
@@ -218,7 +174,7 @@ export default { | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: false, | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 资源库管理表格数据 | |||
@@ -242,13 +198,37 @@ export default { | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
} | |||
resource: [ | |||
{ required: true, message: "资源描述不能为空", trigger: "blur" } | |||
], | |||
resourceValue: [ | |||
{ required: true, message: "资源内容不能为空", trigger: "blur" } | |||
], | |||
resourceType: [ | |||
{ required: true, message: "资源类型不能为空", trigger: "change" } | |||
], | |||
resourceName: [ | |||
{ required: true, message: "资源键不能为空", trigger: "blur" } | |||
], | |||
appId: [ | |||
{ required: true, message: "所属应用id不能为空", trigger: "change" } | |||
], | |||
}, | |||
// 所有应用列表 | |||
applyList: [], | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
this.listApplyAll(); | |||
}, | |||
methods: { | |||
/**获取所有应用 */ | |||
listApplyAll() { | |||
listApplyAll({}).then(res => { | |||
this.applyList = res.data; | |||
}); | |||
}, | |||
/** 查询资源库管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
@@ -295,12 +275,13 @@ export default { | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length!==1 | |||
this.single = selection.length !== 1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.listApplyAll(); | |||
this.open = true; | |||
this.title = "添加资源库管理"; | |||
}, | |||
@@ -312,6 +293,7 @@ export default { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改资源库管理"; | |||
this.listApplyAll(); | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
@@ -337,18 +319,27 @@ export default { | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除资源库管理编号为"' + ids + '"的数据项?').then(function() { | |||
this.$modal.confirm('是否确认删除资源库管理编号为"' + ids + '"的数据项?').then(function () { | |||
return delCtResourceLibrary(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}).catch(() => { }); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/ctResourceLibrary/export', { | |||
...this.queryParams | |||
}, `ctResourceLibrary_${new Date().getTime()}.xlsx`) | |||
}, | |||
/**下载文件 */ | |||
downloadUrl(url) { | |||
let link = document.createElement("a"); | |||
link.style.display = "none"; | |||
link.href = url; | |||
link.setAttribute("download", name); | |||
document.body.appendChild(link); | |||
link.click(); | |||
} | |||
} | |||
}; | |||
@@ -56,7 +56,7 @@ | |||
:default-expand-all="isExpandAll" | |||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" | |||
> | |||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column> | |||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="250"></el-table-column> | |||
<el-table-column prop="icon" label="图标" align="center" width="100"> | |||
<template slot-scope="scope"> | |||
<svg-icon :icon-class="scope.row.icon" /> | |||