@@ -1,10 +1,10 @@ | |||
# 页面标题 | |||
VUE_APP_TITLE = 后台管理系统 | |||
VUE_APP_TITLE = 影刀后台管理系统 | |||
# 开发环境配置 | |||
ENV = 'development' | |||
# 后台管理系统/开发环境 | |||
# 影刀后台管理系统/开发环境 | |||
VUE_APP_BASE_API = '/dev-api' | |||
# 路由懒加载 | |||
@@ -1,8 +1,8 @@ | |||
# 页面标题 | |||
VUE_APP_TITLE = 后台管理系统 | |||
VUE_APP_TITLE = 影刀后台管理系统 | |||
# 生产环境配置 | |||
ENV = 'production' | |||
# 后台管理系统/生产环境 | |||
# 影刀后台管理系统/生产环境 | |||
VUE_APP_BASE_API = '/prod-api' |
@@ -1,10 +1,10 @@ | |||
# 页面标题 | |||
VUE_APP_TITLE = 后台管理系统 | |||
VUE_APP_TITLE = 影刀后台管理系统 | |||
NODE_ENV = production | |||
# 测试环境配置 | |||
ENV = 'staging' | |||
# 后台管理系统/测试环境 | |||
# 影刀后台管理系统/测试环境 | |||
VUE_APP_BASE_API = '/stage-api' |
@@ -0,0 +1 @@ | |||
node_modules |
@@ -0,0 +1,4 @@ | |||
[0613/100035.500:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2) | |||
[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) |
@@ -1,7 +1,7 @@ | |||
{ | |||
"name": "ruoyi", | |||
"version": "3.8.5", | |||
"description": "后台管理系统", | |||
"description": "影刀后台管理系统", | |||
"author": "若依", | |||
"license": "MIT", | |||
"scripts": { | |||
@@ -0,0 +1,64 @@ | |||
import request from '@/utils/request' | |||
// 同步应用数据 | |||
export function syn() { | |||
return request({ | |||
url: '/business/ctApply/syn', | |||
method: 'post', | |||
data:{} | |||
}) | |||
} | |||
// 查询所有应用列表 | |||
export function listApplyAll(query) { | |||
return request({ | |||
url: '/business/ctApply/listAll', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询应用信息管理列表 | |||
export function listCtApply(query) { | |||
return request({ | |||
url: '/business/ctApply/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询应用信息管理详细 | |||
export function getCtApply(id) { | |||
return request({ | |||
url: '/business/ctApply/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增应用信息管理 | |||
export function addCtApply(data) { | |||
return request({ | |||
url: '/business/ctApply', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改应用信息管理 | |||
export function updateCtApply(data) { | |||
return request({ | |||
url: '/business/ctApply', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除应用信息管理 | |||
export function delCtApply(id) { | |||
return request({ | |||
url: '/business/ctApply/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -0,0 +1,63 @@ | |||
import request from '@/utils/request' | |||
// 重新运行计划 | |||
export function appRetry(jobUuid) { | |||
return request({ | |||
url: '/business/ctApplyPlan/appRetry', | |||
method: 'post', | |||
data: {jobUuid} | |||
}) | |||
} | |||
// 停止运行计划 | |||
export function stopRun(jobUuid) { | |||
return request({ | |||
url: '/business/ctApplyPlan/stopRun', | |||
method: 'post', | |||
data: {jobUuid} | |||
}) | |||
} | |||
// 查询应用执行计划管理列表 | |||
export function listCtApplyPlan(query) { | |||
return request({ | |||
url: '/business/ctApplyPlan/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询应用执行计划管理详细 | |||
export function getCtApplyPlan(id) { | |||
return request({ | |||
url: '/business/ctApplyPlan/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增应用执行计划管理 | |||
export function addCtApplyPlan(data) { | |||
return request({ | |||
url: '/business/ctApplyPlan', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改应用执行计划管理 | |||
export function updateCtApplyPlan(data) { | |||
return request({ | |||
url: '/business/ctApplyPlan', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除应用执行计划管理 | |||
export function delCtApplyPlan(id) { | |||
return request({ | |||
url: '/business/ctApplyPlan/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -0,0 +1,63 @@ | |||
import request from '@/utils/request' | |||
// 同步机器人数据 | |||
export function syn() { | |||
return request({ | |||
url: '/business/ctRebot/syn', | |||
method: 'post', | |||
data:{} | |||
}) | |||
} | |||
// 查询所有可用机器人 | |||
export function listRebotAll(query) { | |||
return request({ | |||
url: '/business/ctRebot/listAll', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询机器人管理列表 | |||
export function listCtRebot(query) { | |||
return request({ | |||
url: '/business/ctRebot/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询机器人管理详细 | |||
export function getCtRebot(id) { | |||
return request({ | |||
url: '/business/ctRebot/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增机器人管理 | |||
export function addCtRebot(data) { | |||
return request({ | |||
url: '/business/ctRebot', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改机器人管理 | |||
export function updateCtRebot(data) { | |||
return request({ | |||
url: '/business/ctRebot', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除机器人管理 | |||
export function delCtRebot(id) { | |||
return request({ | |||
url: '/business/ctRebot/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -0,0 +1,44 @@ | |||
import request from '@/utils/request' | |||
// 查询资源库管理列表 | |||
export function listCtResourceLibrary(query) { | |||
return request({ | |||
url: '/business/ctResourceLibrary/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询资源库管理详细 | |||
export function getCtResourceLibrary(id) { | |||
return request({ | |||
url: '/business/ctResourceLibrary/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增资源库管理 | |||
export function addCtResourceLibrary(data) { | |||
return request({ | |||
url: '/business/ctResourceLibrary', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改资源库管理 | |||
export function updateCtResourceLibrary(data) { | |||
return request({ | |||
url: '/business/ctResourceLibrary', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除资源库管理 | |||
export function delCtResourceLibrary(id) { | |||
return request({ | |||
url: '/business/ctResourceLibrary/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -1,53 +0,0 @@ | |||
import request from '@/utils/request' | |||
// 查询模版属性列表 | |||
export function listBySurveyId(surveyId) { | |||
return request({ | |||
url: '/business/survey/listBySurveyId?surveyId=' + surveyId, | |||
method: 'get', | |||
}) | |||
} | |||
// 查询调查问卷管理列表 | |||
export function listSurvey(query) { | |||
return request({ | |||
url: '/business/survey/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询调查问卷管理详细 | |||
export function getSurvey(id) { | |||
return request({ | |||
url: '/business/survey/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增调查问卷管理 | |||
export function addSurvey(data) { | |||
return request({ | |||
url: '/business/survey', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改调查问卷管理 | |||
export function updateSurvey(data) { | |||
return request({ | |||
url: '/business/survey', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除调查问卷管理 | |||
export function delSurvey(id) { | |||
return request({ | |||
url: '/business/survey/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -1,54 +0,0 @@ | |||
import request from '@/utils/request' | |||
// 查询模版管理列表 | |||
export function listTemplate(query) { | |||
return request({ | |||
url: '/business/template/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询模版管理列表 | |||
export function listAll(query) { | |||
return request({ | |||
url: '/business/template/listAll', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询模版管理详细 | |||
export function getTemplate(id) { | |||
return request({ | |||
url: '/business/template/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增模版管理 | |||
export function addTemplate(data) { | |||
return request({ | |||
url: '/business/template', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改模版管理 | |||
export function updateTemplate(data) { | |||
return request({ | |||
url: '/business/template', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除模版管理 | |||
export function delTemplate(id) { | |||
return request({ | |||
url: '/business/template/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -1,45 +0,0 @@ | |||
import request from '@/utils/request' | |||
// 查询模版管理列表 | |||
export function listTemplateProp(query) { | |||
return request({ | |||
url: '/business/templateProp/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询模版属性详细 | |||
export function getTemplateProp(id) { | |||
return request({ | |||
url: '/business/templateProp/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增模版属性 | |||
export function addTemplateProp(data) { | |||
return request({ | |||
url: '/business/templateProp', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改模版属性 | |||
export function updateTemplateProp(data) { | |||
return request({ | |||
url: '/business/templateProp', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除模版属性 | |||
export function delTemplateProp(id) { | |||
return request({ | |||
url: '/business/templateProp/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -1,61 +0,0 @@ | |||
import request from '@/utils/request' | |||
// 统计数据 | |||
export function countGroup(surveyId) { | |||
return request({ | |||
url: '/business/templatePropValue/countGroup?surveyId=' + surveyId, | |||
method: 'get', | |||
}) | |||
} | |||
// 查询模版属性值列表 | |||
export function listTemplatePropValue(query) { | |||
return request({ | |||
url: '/business/templatePropValue/list', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 查询模版属性值详细 | |||
export function getTemplatePropValue(id) { | |||
return request({ | |||
url: '/business/templatePropValue/' + id, | |||
method: 'get' | |||
}) | |||
} | |||
// 新增模版属性值 | |||
export function addTemplatePropValue(data) { | |||
return request({ | |||
url: '/business/templatePropValue', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 新增模版属性值 | |||
export function addList(data) { | |||
return request({ | |||
url: '/business/templatePropValue/addList', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 修改模版属性值 | |||
export function updateTemplatePropValue(data) { | |||
return request({ | |||
url: '/business/templatePropValue', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
// 删除模版属性值 | |||
export function delTemplatePropValue(id) { | |||
return request({ | |||
url: '/business/templatePropValue/' + id, | |||
method: 'delete' | |||
}) | |||
} |
@@ -60,7 +60,7 @@ export default { | |||
// 文件类型, 例如['png', 'jpg', 'jpeg'] | |||
fileType: { | |||
type: Array, | |||
default: () => ["doc", "xls", "ppt", "txt", "pdf"], | |||
default: () => ["doc", "docx","xls", "xlsx"], | |||
}, | |||
// 是否显示提示 | |||
isShowTip: { | |||
@@ -35,7 +35,7 @@ export default { | |||
}, | |||
data() { | |||
return { | |||
title: '后台管理系统', | |||
title: '影刀后台管理系统', | |||
logo: logoImg | |||
} | |||
} | |||
@@ -1,175 +0,0 @@ | |||
<template> | |||
<div class="app-container home"> | |||
<el-card class="box-card"> | |||
<div slot="header" class="clearfix"> | |||
<span>{{ title }}数据统计</span> | |||
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button> --> | |||
</div> | |||
<el-row :gutter="20"> | |||
<el-col :span="8" v-for="row in rows" :key="row"> | |||
<div :id="row" style="width: 500px;height: 500px;"></div> | |||
</el-col> | |||
<!-- <el-col :span="8"> | |||
<div id="orderSources" style="width: 500px;height: 500px;"></div> | |||
</el-col> | |||
<el-col :span="8"> | |||
<div id="car" style="width: 500px;height: 500px;"></div> | |||
</el-col> --> | |||
</el-row> | |||
<div class="text item"> | |||
<!-- <v-chart v-if="isShow" :options="option" theme="th" /> --> | |||
</div> | |||
</el-card> | |||
</div> | |||
</template> | |||
<script> | |||
import { countGroup } from "@/api/business/templatePropValue"; | |||
import * as echarts from 'echarts'; | |||
export default { | |||
name: "Index", | |||
data() { | |||
return { | |||
surveyId: null, | |||
title: null, | |||
rows:[] | |||
}; | |||
}, | |||
beforeCreate(){ | |||
console.log( this.$route.query.id); | |||
countGroup(this.$route.query.id).then(response => { | |||
this.rows = []; | |||
for (let key in response.data) { | |||
this.rows.push(key); | |||
} | |||
}); | |||
}, | |||
created() { | |||
this.surveyId = this.$route.query.id | |||
this.title = this.$route.query.title | |||
setTimeout(() => { | |||
this.ininChat(this.$route.query.id); | |||
}, 500); // 5000毫秒后执行 | |||
}, | |||
methods: { | |||
goTarget(href) { | |||
window.open(href, "_blank"); | |||
}, | |||
ininChat(surveyId) { | |||
countGroup(surveyId).then(response => { | |||
console.log("response", response); | |||
this.rows = []; | |||
for (let key in response.data) { | |||
this.rows.push(key); | |||
} | |||
console.log(this.rows); | |||
for (let key in response.data) { | |||
console.log(key); | |||
var option = { | |||
title: { | |||
text: key, | |||
left: 'center', | |||
top: 'center' | |||
}, | |||
series: [ | |||
{ | |||
type: 'pie', | |||
data: response.data[key], | |||
// {"name":"待处理","value":99},{"name":"已送达","value":1} | |||
radius: ['40%', '70%'] | |||
} | |||
] | |||
}; | |||
// 绘制图表 | |||
var dom = document.getElementById(key); | |||
console.log("dom",dom); | |||
if(dom == null){ | |||
this.$modal.msgError("未获取到dom"); | |||
}else{ | |||
this.orderRound = echarts.init(dom); | |||
this.orderRound.setOption(option); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
</script> | |||
<style scoped lang="scss"> | |||
.home { | |||
blockquote { | |||
padding: 10px 20px; | |||
margin: 0 0 20px; | |||
font-size: 17.5px; | |||
border-left: 5px solid #eee; | |||
} | |||
hr { | |||
margin-top: 20px; | |||
margin-bottom: 20px; | |||
border: 0; | |||
border-top: 1px solid #eee; | |||
} | |||
.col-item { | |||
margin-bottom: 20px; | |||
} | |||
ul { | |||
padding: 0; | |||
margin: 0; | |||
} | |||
font-family: "open sans", | |||
"Helvetica Neue", | |||
Helvetica, | |||
Arial, | |||
sans-serif; | |||
font-size: 13px; | |||
color: #676a6c; | |||
overflow-x: hidden; | |||
ul { | |||
list-style-type: none; | |||
} | |||
h4 { | |||
margin-top: 0px; | |||
} | |||
h2 { | |||
margin-top: 10px; | |||
font-size: 26px; | |||
font-weight: 100; | |||
} | |||
p { | |||
margin-top: 10px; | |||
b { | |||
font-weight: 700; | |||
} | |||
} | |||
.update-log { | |||
ol { | |||
display: block; | |||
list-style-type: decimal; | |||
margin-block-start: 1em; | |||
margin-block-end: 1em; | |||
margin-inline-start: 0; | |||
margin-inline-end: 0; | |||
padding-inline-start: 40px; | |||
} | |||
} | |||
} | |||
</style> |
@@ -0,0 +1,378 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px"> | |||
<el-form-item label="应用所有者名称" prop="ownerName"> | |||
<el-input v-model="queryParams.ownerName" placeholder="请输入应用所有者名称" clearable | |||
@keyup.enter.native="handleQuery" /> | |||
</el-form-item> | |||
<el-form-item label="应用所有者账号" prop="ownerAccount"> | |||
<el-input v-model="queryParams.ownerAccount" 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> | |||
<el-form-item label="应用类型名称" prop="appTypeName"> | |||
<el-input v-model="queryParams.appTypeName" placeholder="请输入应用类型名称" clearable | |||
@keyup.enter.native="handleQuery" /> | |||
</el-form-item> | |||
<el-form-item label="应用类型枚举" prop="appType"> | |||
<el-select v-model="queryParams.appType" placeholder="请选择应用类型枚举" clearable> | |||
<el-option v-for="dict in dict.type.app_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="部门名称" prop="deptName"> | |||
<el-input v-model="queryParams.deptName" 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> | |||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |||
</el-form-item> | |||
</el-form> | |||
<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:ctApply:syn']">同步应用数据</el-button> | |||
<span style="color: red;"> 提示:搜索更新并非实时数据,同步为最新数据</span> | |||
</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 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="200" fixed="left" > | |||
<template slot-scope="scope"> | |||
<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="version" width="100" /> | |||
<el-table-column label="是否支持应用参数" align="center" prop="supportParam" width="200"> | |||
<template slot-scope="scope"> | |||
<span v-if="scope.row.supportParam"> | |||
是 | |||
</span> | |||
<span v-if="scope.row.supportParam == 0"> | |||
否 | |||
</span> | |||
</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="manualTime" 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"> | |||
<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"> | |||
<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="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" 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> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<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="120px"> | |||
<el-form-item label="应用名称" prop="appName"> | |||
<el-input v-model="form.appName" placeholder="请输入应用名称" /> | |||
</el-form-item> | |||
<el-form-item label="应用类型名称" prop="appTypeName"> | |||
<el-input v-model="form.appTypeName" placeholder="请输入应用类型名称" /> | |||
</el-form-item> | |||
<el-form-item label="应用类型枚举" prop="appType"> | |||
<el-select v-model="form.appType" placeholder="请选择应用类型枚举"> | |||
<el-option v-for="dict in dict.type.app_type" :key="dict.value" :label="dict.label" | |||
:value="dict.value"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="应用创建时间" prop="appCreateTime"> | |||
<el-date-picker clearable v-model="form.appCreateTime" type="date" value-format="yyyy-MM-dd" | |||
placeholder="请选择应用创建时间"> | |||
</el-date-picker> | |||
</el-form-item> | |||
<el-form-item label="应用修改时间" prop="appUpdateTime"> | |||
<el-date-picker clearable v-model="form.appUpdateTime" type="date" value-format="yyyy-MM-dd" | |||
placeholder="请选择应用修改时间"> | |||
</el-date-picker> | |||
</el-form-item> | |||
<el-form-item label="应用所有者名称" prop="ownerName"> | |||
<el-input v-model="form.ownerName" placeholder="请输入应用所有者名称" /> | |||
</el-form-item> | |||
<el-form-item label="应用所有者账号" prop="ownerAccount"> | |||
<el-input v-model="form.ownerAccount" placeholder="请输入应用所有者账号" /> | |||
</el-form-item> | |||
<el-form-item label="所有者id" prop="ownerId"> | |||
<el-input v-model="form.ownerId" placeholder="请输入所有者id" /> | |||
</el-form-item> | |||
<el-form-item label="appid" prop="appId"> | |||
<el-input v-model="form.appId" placeholder="请输入appid" /> | |||
</el-form-item> | |||
<el-form-item label="版本,值内容:未发版、版本" prop="version"> | |||
<el-input v-model="form.version" placeholder="请输入版本,值内容:未发版、版本" /> | |||
</el-form-item> | |||
<el-form-item label="icon图下载地址" prop="icon"> | |||
<el-input v-model="form.icon" placeholder="请输入icon图下载地址" /> | |||
</el-form-item> | |||
<el-form-item label="预计人工耗时" prop="manualTime"> | |||
<el-input v-model="form.manualTime" placeholder="请输入预计人工耗时" /> | |||
</el-form-item> | |||
<el-form-item label="备注" prop="remark"> | |||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
<!-- 设置时间 --> | |||
<el-dialog title="配置预计人工用时" :visible.sync="showConfigTimeVisible" width="500px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> | |||
<el-form-item label="预计人工用时" prop="manualTime"> | |||
<el-input-number v-model="form.manualTime" @change="handleChange" label="请输入预计人工用时"></el-input-number>分钟 | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitConfigTime">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listCtApply, getCtApply, delCtApply, addCtApply, updateCtApply, syn } from "@/api/business/ctApply"; | |||
export default { | |||
name: "CtApply", | |||
dicts: ['app_type'], | |||
data() { | |||
return { | |||
// 显示配置时间 | |||
showConfigTimeVisible: false, | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 应用信息管理表格数据 | |||
ctApplyList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
ownerName: null, | |||
ownerAccount: null, | |||
appName: null, | |||
appTypeName: null, | |||
appType: null, | |||
supportParam: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
} | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 设置时间 */ | |||
submitConfigTime() { | |||
let data = { id: this.form.id, manualTime: this.form.manualTime } | |||
updateCtApply(data).then(response => { | |||
this.$modal.msgSuccess("设置成功"); | |||
this.showConfigTimeVisible = false; | |||
this.getList(); | |||
}); | |||
}, | |||
/** 打开设置时间 */ | |||
showConfigTime(row) { | |||
this.form.id = row.id | |||
this.showConfigTimeVisible = true; | |||
}, | |||
/** 同步 */ | |||
handleSyn() { | |||
syn().then(res => { | |||
this.getList() | |||
this.$modal.msgSuccess("操作成功"); | |||
}); | |||
}, | |||
/** 查询应用信息管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
listCtApply(this.queryParams).then(response => { | |||
this.ctApplyList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.showConfigTimeVisible = false; | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
ownerName: null, | |||
ownerAccount: null, | |||
ownerId: null, | |||
appId: null, | |||
appName: null, | |||
appTypeName: null, | |||
appType: null, | |||
appCreateTime: null, | |||
appUpdateTime: null, | |||
version: null, | |||
supportParam: null, | |||
icon: null, | |||
manualTime: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
remark: null, | |||
deleted: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length !== 1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加应用信息管理"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getCtApply(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改应用信息管理"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateCtApply(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addCtApply(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除应用信息管理编号为"' + ids + '"的数据项?').then(function () { | |||
return delCtApply(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => { }); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/ctApply/export', { | |||
...this.queryParams | |||
}, `ctApply_${new Date().getTime()}.xlsx`) | |||
}, | |||
handleChange(value) { | |||
console.log(value); | |||
} | |||
} | |||
}; | |||
</script> |
@@ -0,0 +1,519 @@ | |||
<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="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="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> | |||
<el-option v-for="dict in dict.type.exc_type" :key="dict.value" :label="dict.label" :value="dict.value" /> | |||
</el-select> | |||
</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> | |||
</el-form-item> | |||
</el-form> | |||
<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:ctApplyPlan:add']">新增</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="ctApplyPlanList" @selection-change="handleSelectionChange"> | |||
<!-- :summary-method="getSummaries" show-summary --> | |||
<!-- <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="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" /> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="机器人名称" align="center" prop="robotName" width="150" /> | |||
<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="planParams" width="100"> | |||
<template slot-scope="scope"> | |||
<el-popover trigger="hover" placement="top"> | |||
<p> {{ scope.row.planParams }}</p> | |||
<div slot="reference" class="name-wrapper"> | |||
<el-tag size="medium">显示参数</el-tag> | |||
</div> | |||
</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" /> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="优先级" align="center" prop="priority" width="100" /> | |||
<el-table-column label="执行类型" align="center" prop="excType" width="200"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.exc_type" :value="scope.row.excType" /> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="执行时间" align="center" prop="excTime" width="100" /> | |||
<el-table-column label="执行表达式" align="center" prop="cronExpression" width="100" /> | |||
<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"> | |||
<span>{{ scope.row.remark }}</span> | |||
<div slot="reference" class="name-wrapper"> | |||
<dict-tag :options="dict.type.plan_run_status" :value="scope.row.taskStatus" /> | |||
</div> | |||
</el-popover> | |||
<dict-tag v-if="scope.row.taskStatus != 'error'" :options="dict.type.plan_run_status" :value="scope.row.taskStatus" /> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="上次执行时间" align="center" prop="lastExecTime" width="170" /> | |||
<el-table-column label="下次执行时间" align="center" prop="nextExecTime" width="170" /> | |||
<el-table-column label="任务运行uuid" align="center" prop="taskUuid" width="300" /> | |||
<el-table-column label="开始时间" align="center" fixed="right" prop="startTime" width="100" /> | |||
<el-table-column label="结束时间" align="center" fixed="right" prop="endTime" width="100" /> | |||
<el-table-column label="人工耗时" align="center" fixed="right" prop="manualTime" width="100"> | |||
<template slot-scope="scope"> | |||
<span v-if="scope.row.manualTime != null">{{ scope.row.manualTime }} 分钟</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="实际耗时" align="center" fixed="right" prop="planTime" width="100"> | |||
<template slot-scope="scope"> | |||
<span v-if="scope.row.planTime != null">{{ scope.row.planTime }} 分钟</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="节约时间" align="center" fixed="right" prop="timeSaving" width="100"> | |||
<template slot-scope="scope"> | |||
<span v-if="scope.row.timeSaving != null">{{ scope.row.timeSaving }} 分钟</span> | |||
</template> | |||
</el-table-column> | |||
<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" prop="remark" /> --> | |||
<el-table-column label="操作" align="center" width="250" 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> | |||
</router-link> | |||
<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)" v-hasPermi="['business:ctApplyPlan:appRetry']">重新运行</el-button> | |||
<el-button size="mini" v-if="scope.row.taskStatus == 'running'" 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" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |||
v-hasPermi="['business:ctApplyPlan: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" /> | |||
<!-- 添加或修改应用执行计划管理对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> | |||
<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"> | |||
<el-input v-model="form.planName" placeholder="请输入计划名称" /> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="12"> | |||
<el-form-item label="调度方式" prop="planType"> | |||
<el-select v-model="form.planType" placeholder="请选择调度方式"> | |||
<el-option v-for="dict in dict.type.plan_type" :key="dict.value" :label="dict.label" | |||
:disabled="dict.value == 0" :value="dict.value"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<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"> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="12"> | |||
<el-form-item label="等待超时时间" prop="waitTimeout"> | |||
<el-select v-model="form.waitTimeout" placeholder="请选择等待超时时间"> | |||
<el-option v-for="dict in dict.type.wait_timeout" :key="dict.value" :label="dict.label" | |||
:value="dict.value"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<el-form-item label="优先级" prop="priority"> | |||
<el-input-number v-model="form.priority" label="请输入预计人工用时"></el-input-number> | |||
</el-form-item> | |||
</el-col> | |||
<el-col :span="12"> | |||
<el-form-item label="执行类型" prop="excType"> | |||
<el-select v-model="form.excType" placeholder="请选择执行类型"> | |||
<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-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="12"> | |||
<el-form-item v-if="form.excType == 1" label="执行时间" prop="excTime"> | |||
<el-date-picker clearable v-model="form.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="form.excType == 2" label="cron表达式" prop="cronExpression"> | |||
<el-input v-model="form.cronExpression" placeholder="请输入cron执行表达式"> | |||
<template slot="append"> | |||
<el-button type="primary" @click="handleShowCron"> | |||
生成表达式 | |||
<i class="el-icon-time el-icon--right"></i> | |||
</el-button> | |||
</template> | |||
</el-input> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
<el-row :gutter="24"> | |||
<el-col :span="24"> | |||
<el-form-item label="备注" prop="remark"> | |||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
</el-col> | |||
</el-row> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</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> | |||
</div> | |||
</template> | |||
<script> | |||
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan,stopRun,appRetry } from "@/api/business/ctApplyPlan"; | |||
import { listRebotAll } from "@/api/business/ctRebot"; | |||
import { listApplyAll } from "@/api/business/ctApply"; | |||
import Crontab from '@/components/Crontab' | |||
export default { | |||
components: { Crontab }, | |||
name: "CtApplyPlan", | |||
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status', 'app_param_type'], | |||
data() { | |||
return { | |||
baseUrl: process.env.VUE_APP_BASE_API, | |||
// 是否显示Cron表达式弹出层 | |||
openCron: false, | |||
// 传入的表达式 | |||
expression: "", | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 应用执行计划管理表格数据 | |||
ctApplyPlanList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
planName: null, | |||
planType: null, | |||
robotName: null, | |||
appTypeName: null, | |||
appName: null, | |||
appId: null, | |||
appType: null, | |||
manualTime: null, | |||
planParams: null, | |||
waitTimeout: null, | |||
priority: null, | |||
}, | |||
// 表单参数 | |||
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: [], | |||
// 应用列表 | |||
applyList: [], | |||
// 参数集 | |||
params: [], | |||
// 单个参数对象 | |||
param: {}, | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 停止运行 */ | |||
stopRun(row) { | |||
stopRun(row.taskUuid).then(res => { | |||
this.$modal.msgSuccess("操作成功"); | |||
this.getList(); | |||
}); | |||
}, | |||
/** 重新运行 */ | |||
appRetry(row) { | |||
appRetry(row.taskUuid).then(res => { | |||
this.$modal.msgSuccess("操作成功"); | |||
this.getList(); | |||
}); | |||
}, | |||
/** 查询应用执行计划管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
listCtApplyPlan(this.queryParams).then(response => { | |||
this.ctApplyPlanList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
/** 查询所有应用 */ | |||
listAll() { | |||
this.listRebotAll(); | |||
this.listApplyAll(); | |||
}, | |||
/** 查询所有可用机器人 */ | |||
listRebotAll() { | |||
listRebotAll({}).then(res => { | |||
this.rebotList = res.data; | |||
}); | |||
}, | |||
/** 查询应用 */ | |||
listApplyAll() { | |||
listApplyAll({}).then(res => { | |||
this.applyList = res.data; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
planName: null, | |||
planType: null, | |||
robotName: null, | |||
appTypeName: null, | |||
appName: null, | |||
appId: null, | |||
appType: null, | |||
manualTime: null, | |||
planParams: null, | |||
waitTimeout: null, | |||
priority: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
remark: null, | |||
deleted: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length !== 1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.listAll(); | |||
this.open = true; | |||
this.title = "添加应用执行计划"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
this.listAll(); | |||
const id = row.id || this.ids | |||
getCtApplyPlan(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改应用执行计划"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateCtApplyPlan(this.form).then(response => { | |||
this.$modal.msgSuccess("修改计划成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addCtApplyPlan(this.form).then(response => { | |||
this.$modal.msgSuccess("创建计划成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除应用执行计划管理编号为"' + ids + '"的数据项?').then(function () { | |||
return delCtApplyPlan(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => { }); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/ctApplyPlan/export', { | |||
...this.queryParams | |||
}, `ctApplyPlan_${new Date().getTime()}.xlsx`) | |||
}, | |||
getSummaries(param) { | |||
const { columns, data } = param; | |||
const sums = []; | |||
columns.forEach((column, index) => { | |||
if (index === 0) { | |||
sums[index] = '总计时间'; | |||
return; | |||
} | |||
const values = data.map(item => Number(item[column.property])); | |||
if (!values.every(value => isNaN(value))) { | |||
sums[index] = values.reduce((prev, curr) => { | |||
const value = Number(curr); | |||
if (!isNaN(value)) { | |||
return prev + curr; | |||
} else { | |||
return prev; | |||
} | |||
}, 0); | |||
console.log("column",column); | |||
sums[index] += ' 分钟'; | |||
} else { | |||
sums[index] = ''; | |||
} | |||
}); | |||
return sums; | |||
}, | |||
/** cron表达式按钮操作 */ | |||
handleShowCron() { | |||
this.expression = this.form.cronExpression; | |||
this.openCron = true; | |||
}, | |||
/** 确定后回传值 */ | |||
crontabFill(value) { | |||
this.form.cronExpression = value; | |||
}, | |||
/**下载文件 */ | |||
downloadUrl(url) { | |||
let link = document.createElement("a"); | |||
link.style.display = "none"; | |||
link.href = this.baseUrl + url; | |||
link.setAttribute("download", name); | |||
document.body.appendChild(link); | |||
link.click(); | |||
} | |||
} | |||
}; | |||
</script> |
@@ -0,0 +1,258 @@ | |||
<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="accountName"> | |||
<el-input v-model="queryParams.accountName" placeholder="请输入机器人账号" clearable | |||
@keyup.enter.native="handleQuery" /> | |||
</el-form-item> | |||
<el-form-item label="运行状态" prop="status"> | |||
<el-select v-model="queryParams.status" placeholder="请选择运行状态" clearable> | |||
<el-option v-for="dict in dict.type.rebot_status" :key="dict.value" :label="dict.label" :value="dict.value" /> | |||
</el-select> | |||
</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> | |||
</el-form-item> | |||
</el-form> | |||
<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:syn']">同步机器人信息</el-button> | |||
<span style="color: red;"> 提示:搜索更新并非实时数据,同步为最新数据</span> | |||
</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 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="运行状态" 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="客户端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"/> | |||
<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="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" 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="handleSyn(scope.row)" | |||
v-hasPermi="['business:ctRebot:edit']">同步</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" /> | |||
<!-- 添加或修改机器人管理对话框 --> | |||
<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="accountName"> | |||
<el-input v-model="form.accountName" placeholder="请输入机器人账号" /> | |||
</el-form-item> | |||
<el-form-item label="机器人Uuid信息" prop="robotClientUuid"> | |||
<el-input v-model="form.robotClientUuid" placeholder="请输入机器人Uuid信息" /> | |||
</el-form-item> | |||
<el-form-item label="运行状态" prop="status"> | |||
<el-select v-model="form.status" placeholder="请选择运行状态"> | |||
<el-option v-for="dict in dict.type.rebot_status" :key="dict.value" :label="dict.label" | |||
:value="dict.value"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="描述" prop="description"> | |||
<el-input v-model="form.description" placeholder="请输入描述" /> | |||
</el-form-item> | |||
<el-form-item label="客户端ip" prop="clientIp"> | |||
<el-input v-model="form.clientIp" placeholder="请输入客户端ip" /> | |||
</el-form-item> | |||
<el-form-item label="备注" prop="remark"> | |||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listCtRebot, getCtRebot, delCtRebot, addCtRebot, updateCtRebot, syn } from "@/api/business/ctRebot"; | |||
export default { | |||
name: "CtRebot", | |||
dicts: ['rebot_status'], | |||
data() { | |||
return { | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 机器人管理表格数据 | |||
ctRebotList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
accountName: null, | |||
status: null, | |||
description: null, | |||
clientIp: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
} | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 同步 */ | |||
handleSyn() { | |||
syn().then(res => { | |||
this.getList() | |||
this.$modal.msgSuccess("操作成功"); | |||
}); | |||
}, | |||
/** 查询机器人管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
listCtRebot(this.queryParams).then(response => { | |||
this.ctRebotList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
accountName: null, | |||
robotClientUuid: null, | |||
status: null, | |||
description: null, | |||
clientIp: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
remark: null, | |||
deleted: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length !== 1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加机器人管理"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getCtRebot(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改机器人管理"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateCtRebot(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addCtRebot(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除机器人管理编号为"' + ids + '"的数据项?').then(function () { | |||
return delCtRebot(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => { }); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/ctRebot/export', { | |||
...this.queryParams | |||
}, `ctRebot_${new Date().getTime()}.xlsx`) | |||
} | |||
} | |||
}; | |||
</script> |
@@ -0,0 +1,340 @@ | |||
<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="appName"> | |||
<el-select v-model="queryParams.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="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> | |||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |||
</el-form-item> | |||
</el-form> | |||
<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> | |||
<span style="color: red;"> 提示:该参数跟随计划,修改内容不会影响已经创建的计划</span> | |||
</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> | |||
<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"> | |||
<template slot-scope="scope"> | |||
{{ scope.$index + 1 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="所属应用名称" align="center" prop="appName" width="150" /> | |||
<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" /> | |||
</template> | |||
</el-table-column> | |||
<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="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" /> | |||
<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="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" 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> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<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-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> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listCtResourceLibrary, getCtResourceLibrary, delCtResourceLibrary, addCtResourceLibrary, updateCtResourceLibrary } from "@/api/business/ctResourceLibrary"; | |||
import { listApplyAll } from "@/api/business/ctApply"; | |||
export default { | |||
name: "CtResourceLibrary", | |||
dicts: ['app_param_type'], | |||
data() { | |||
return { | |||
baseUrl: process.env.VUE_APP_BASE_API, | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 资源库管理表格数据 | |||
ctResourceLibraryList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
resource: null, | |||
resourceValue: null, | |||
resourceType: null, | |||
resourceName: null, | |||
appName: null, | |||
deptId: null, | |||
}, | |||
// 表单参数 | |||
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; | |||
listCtResourceLibrary(this.queryParams).then(response => { | |||
this.ctResourceLibraryList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
resource: null, | |||
resourceValue: null, | |||
resourceType: null, | |||
resourceName: null, | |||
appName: null, | |||
deptId: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
remark: null, | |||
deleted: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length !== 1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.listApplyAll(); | |||
this.open = true; | |||
this.title = "添加资源库管理"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getCtResourceLibrary(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改资源库管理"; | |||
this.listApplyAll(); | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateCtResourceLibrary(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addCtResourceLibrary(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除资源库管理编号为"' + ids + '"的数据项?').then(function () { | |||
return delCtResourceLibrary(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).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 = this.baseUrl + url; | |||
link.setAttribute("download", name); | |||
document.body.appendChild(link); | |||
link.click(); | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,347 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |||
<el-form-item label="问卷名称" prop="title"> | |||
<el-input | |||
v-model="queryParams.title" | |||
placeholder="请输入问卷名称" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="是否开放" prop="open"> | |||
<el-select v-model="queryParams.open" placeholder="请选择是否开放" clearable> | |||
<el-option | |||
v-for="dict in dict.type.open" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
/> | |||
</el-select> | |||
</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> | |||
</el-form-item> | |||
</el-form> | |||
<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:survey: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:survey: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:survey: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:survey:export']" | |||
>导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="surveyList" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" /> | |||
<el-table-column label="序列" align="center"> | |||
<template slot-scope="scope"> | |||
{{ scope.$index + 1 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="问卷名称" align="center" prop="title" /> | |||
<el-table-column label="问卷描述" align="center" prop="context" /> | |||
<el-table-column label="模板" align="center" prop="tempName" /> | |||
<el-table-column label="是否开放" align="center" prop="open"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.open" :value="scope.row.open"/> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |||
<template slot-scope="scope"> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-edit" | |||
@click="navigateToCount(scope.row.id,scope.row.title)" | |||
v-hasPermi="['business:template:edit']" | |||
>查看统计</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-edit" | |||
@click="navigateToDetails(scope.row.id,scope.row.title)" | |||
v-hasPermi="['business:template:edit']" | |||
>开始填写</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-edit" | |||
@click="handleUpdate(scope.row)" | |||
v-hasPermi="['business:survey:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:survey: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" | |||
/> | |||
<!-- 添加或修改调查问卷管理对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |||
<el-form-item label="问卷名称" prop="title"> | |||
<el-input v-model="form.title" placeholder="请输入问卷名称" /> | |||
</el-form-item> | |||
<el-form-item label="问卷描述" prop="context"> | |||
<el-input v-model="form.context" placeholder="请输入问卷描述" /> | |||
</el-form-item> | |||
<el-form-item label="是否开放" prop="open"> | |||
<el-select v-model="form.open" placeholder="请选择是否开放"> | |||
<el-option | |||
v-for="dict in dict.type.open" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="模板" prop="tempId"> | |||
<el-select v-model="form.tempId" placeholder="请选择模板"> | |||
<el-option | |||
v-for="temp in templateList" | |||
:key="temp.id" | |||
:label="temp.title" | |||
:value="temp.id" | |||
></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listSurvey, getSurvey, delSurvey, addSurvey, updateSurvey } from "@/api/business/survey"; | |||
import { listTemplate} from "@/api/business/template"; | |||
export default { | |||
name: "Survey", | |||
dicts: ['open'], | |||
data() { | |||
return { | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 调查问卷管理表格数据 | |||
surveyList: [], | |||
// 模版管理表格数据 | |||
templateList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
title: null, | |||
context: null, | |||
tempId: null, | |||
open: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
} | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
this.getTempList(); | |||
}, | |||
methods: { | |||
/** | |||
* 查看统计 | |||
*/ | |||
navigateToCount(id,title) { | |||
console.log("id",id); | |||
this.$router.push({ path: '/questionnaire/countGroup?id=' + id + '&title=' + title }); | |||
}, | |||
/** | |||
* 编辑答卷 | |||
*/ | |||
navigateToDetails(id,title) { | |||
console.log("id",id); | |||
this.$router.push({ path: '/questionnaire/surveySubmit?id=' + id + '&title=' + title }); | |||
}, | |||
/** 查询模版管理列表 */ | |||
getTempList() { | |||
this.loading = true; | |||
this.queryParams.open = '1' | |||
listTemplate(this.queryParams).then(response => { | |||
this.templateList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
/** 查询调查问卷管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
listSurvey(this.queryParams).then(response => { | |||
this.surveyList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
title: null, | |||
context: null, | |||
tempId: null, | |||
open: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
deleted: null, | |||
remark: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length!==1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加调查问卷管理"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getSurvey(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改调查问卷管理"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateSurvey(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addSurvey(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除调查问卷管理编号为"' + ids + '"的数据项?').then(function() { | |||
return delSurvey(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/survey/export', { | |||
...this.queryParams | |||
}, `survey_${new Date().getTime()}.xlsx`) | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,166 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-card class="box-card"> | |||
<div class="text item"> | |||
<H1 style="margin-left: 45%; width: 50%;display: flex; align-items: center;">{{title}}问卷调查</H1> | |||
<el-main style="margin-left:25%;margin-right: 25%; width: 50%;"> | |||
<el-form ref="form" v-for="data in rows" :key="data.id" :model="form" :rules="rules" label-width="80px"> | |||
<!-- 单选 --> | |||
<el-form-item v-if="data.compType == '0'" :label="data.title" :prop="data.fieldName"> | |||
<el-radio-group v-model="form[data.id]" size="medium"> | |||
<el-radio v-for="(item, index) in data.optionalValues" :key="item.key" :label="item.key">{{ item.value | |||
}}</el-radio> | |||
</el-radio-group> | |||
</el-form-item> | |||
<!-- 多选 --> | |||
<el-form-item v-if="data.compType == '1'" :label="data.title" :prop="data.fieldName"> | |||
<el-checkbox-group v-model="form[data.id]" size="medium"> | |||
<el-checkbox v-for="(item, index) in data.optionalValues" :key="item.key" :label="item.key">{{ item.value | |||
}}</el-checkbox> | |||
</el-checkbox-group> | |||
</el-form-item> | |||
<!-- 单行 --> | |||
<el-form-item v-if="data.compType == '2'" :label="data.title" :prop="data.fieldName"> | |||
<el-input v-model="form[data.id]" :placeholder="data.placPrompt" clearable :style="{ width: '100%' }"> | |||
</el-input> | |||
</el-form-item> | |||
<!-- 多行 --> | |||
<el-form-item v-if="data.compType == '3'" :label="data.title" :prop="data.fieldName"> | |||
<el-input v-model="form[data.id]" type="textarea" :placeholder="data.placPrompt" | |||
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input> | |||
</el-form-item> | |||
<!-- 密码 --> | |||
<el-form-item v-if="data.compType == '4'" :label="data.title" :prop="data.fieldName"> | |||
<el-input v-model="form[data.id]" :placeholder="data.placPrompt" clearable show-password | |||
:style="{ width: '100%' }"></el-input> | |||
</el-form-item> | |||
<!-- 计数器 --> | |||
<el-form-item v-if="data.compType == '5'" :label="data.title" :prop="data.fieldName"> | |||
<el-input-number v-model="form[data.id]" :placeholder="data.placPrompt"></el-input-number> | |||
</el-form-item> | |||
<!-- 下拉 --> | |||
<el-form-item v-if="data.compType == '6'" :label="data.title" :prop="data.fieldName"> | |||
<el-select v-model="form[data.id]" :placeholder="data.placPrompt" clearable :style="{ width: '100%' }"> | |||
<el-option v-for="(item, index) in data.optionalValues" :key="item.key" :label="item.value" | |||
:value="item.key"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<!-- 开关 --> | |||
<el-form-item v-if="data.compType == '7'" :label="data.title" :prop="data.fieldName" required> | |||
<el-switch v-model="form[data.id]"></el-switch> | |||
</el-form-item> | |||
<!-- 时间选择 --> | |||
<el-form-item v-if="data.compType == '8'" :label="data.title" :prop="data.fieldName"> | |||
<el-time-picker v-model="form[data.id]" format="HH:mm:ss" value-format="HH:mm:ss" | |||
:picker-options='{ "selectableRange": "00:00:00-23:59:59" }' :style="{ width: '100%' }" | |||
:placeholder="data.placPrompt" clearable></el-time-picker> | |||
</el-form-item> | |||
<!-- 时间范围 --> | |||
<el-form-item v-if="data.compType == '9'" :label="data.title" :prop="data.fieldName"> | |||
<el-time-picker v-model="form[data.id]" is-range format="HH:mm:ss" value-format="HH:mm:ss" | |||
:style="{ width: '100%' }" start-placeholder="开始时间" end-placeholder="结束时间" range-separator="至" | |||
clearable></el-time-picker> | |||
</el-form-item> | |||
</el-form> | |||
</el-main> | |||
<div style="margin-left: 45%; width: 50%;display: flex; align-items: center;" slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">提交</el-button> | |||
</div> | |||
</div> | |||
</el-card> | |||
</div> | |||
</template> | |||
<script> | |||
import {listBySurveyId } from "@/api/business/survey"; | |||
import { addList, } from "@/api/business/templatePropValue"; | |||
export default { | |||
name: "Template", | |||
dicts: ['open'], | |||
data() { | |||
return { | |||
rows: null, | |||
check: [], | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
}, | |||
queryParams: {}, | |||
surveyId: null, | |||
title: null, | |||
}; | |||
}, | |||
created() { | |||
console.log("query", this.$route.query.id); | |||
this.surveyId = this.$route.query.id | |||
this.title = this.$route.query.title | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 查询模版管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
console.log("surveyId", this.surveyId); | |||
listBySurveyId(this.surveyId).then(response => { | |||
console.log("response", response); | |||
this.rows = response.data; | |||
console.log("response.form", response.form); | |||
this.form = response.form; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
title: null, | |||
context: null, | |||
open: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
deleted: null, | |||
remark: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
console.log("this.form", this.form); | |||
this.form.surveyId = this.surveyId; | |||
addList(this.form).then(response => { | |||
this.$modal.msgSuccess("提交成功"); | |||
this.$router.push({ path: '/questionnaire/survey' }); | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除模版管理编号为"' + ids + '"的数据项?').then(function () { | |||
return delTemplate(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => { }); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/template/export', { | |||
...this.queryParams | |||
}, `template_${new Date().getTime()}.xlsx`) | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,298 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |||
<el-form-item label="标题" prop="title"> | |||
<el-input | |||
v-model="queryParams.title" | |||
placeholder="请输入标题" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="内容" prop="context"> | |||
<el-input | |||
v-model="queryParams.context" | |||
placeholder="请输入内容" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="是否开放" prop="open"> | |||
<el-select v-model="queryParams.open" placeholder="请选择是否开放" clearable> | |||
<el-option | |||
v-for="dict in dict.type.open" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
/> | |||
</el-select> | |||
</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> | |||
</el-form-item> | |||
</el-form> | |||
<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:template: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:template: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:template: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:template:export']" | |||
>导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="templateList" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" /> | |||
<el-table-column label="序列" align="center"> | |||
<template slot-scope="scope"> | |||
{{ scope.$index + 1 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="标题" align="center" prop="title" /> | |||
<el-table-column label="内容" align="center" prop="context" /> | |||
<el-table-column label="是否开放" align="center" prop="open"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.open" :value="scope.row.open"/> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="操作" align="center" 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:template:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:template: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" | |||
/> | |||
<!-- 添加或修改模版管理对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |||
<el-form-item label="标题" prop="title"> | |||
<el-input v-model="form.title" placeholder="请输入标题" /> | |||
</el-form-item> | |||
<el-form-item label="内容" prop="context"> | |||
<el-input v-model="form.context" placeholder="请输入内容" /> | |||
</el-form-item> | |||
<el-form-item label="是否开放" prop="open"> | |||
<el-select v-model="form.open" placeholder="请选择是否开放"> | |||
<el-option | |||
v-for="dict in dict.type.open" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate } from "@/api/business/template"; | |||
export default { | |||
name: "Template", | |||
dicts: ['open'], | |||
data() { | |||
return { | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 模版管理表格数据 | |||
templateList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
title: null, | |||
context: null, | |||
open: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
} | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 查询模版管理列表 */ | |||
getList() { | |||
this.loading = true; | |||
this.queryParams.createBy = "123" | |||
listTemplate(this.queryParams).then(response => { | |||
this.templateList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
title: null, | |||
context: null, | |||
open: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
deleted: null, | |||
remark: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length!==1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加模版管理"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getTemplate(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改模版管理"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateTemplate(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addTemplate(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除模版管理编号为"' + ids + '"的数据项?').then(function() { | |||
return delTemplate(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/template/export', { | |||
...this.queryParams | |||
}, `template_${new Date().getTime()}.xlsx`) | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,363 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |||
<el-form-item label="组件类型" prop="compType"> | |||
<el-select v-model="queryParams.compType" placeholder="请选择组件类型" clearable> | |||
<el-option | |||
v-for="dict in dict.type.comp_type" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
/> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="字段名" prop="fieldName"> | |||
<el-input | |||
v-model="queryParams.fieldName" | |||
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> | |||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |||
</el-form-item> | |||
</el-form> | |||
<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:templateProp: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:templateProp: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:templateProp: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:templateProp:export']" | |||
>导出</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
新增到模版 | |||
<el-select v-model="queryParams.tempId" @change="seach" placeholder="请选择模版" :clearable="true"> | |||
<el-option | |||
v-for="temp in tempList" | |||
:key="temp.id" | |||
:label="temp.title" | |||
:value="temp.id" | |||
></el-option> | |||
</el-select> | |||
中 | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="templatePropList" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" /> | |||
<el-table-column label="序列" align="center"> | |||
<template slot-scope="scope"> | |||
{{ scope.$index + 1 }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="标题" align="center" prop="title" /> | |||
<el-table-column label="组件类型" align="center" prop="compType"> | |||
<template slot-scope="scope"> | |||
<dict-tag :options="dict.type.comp_type" :value="scope.row.compType"/> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="字段名" align="center" prop="fieldName" /> | |||
<el-table-column label="占位提示" align="center" prop="placPrompt" /> | |||
<el-table-column label="默认值" align="center" prop="defaultValue" /> | |||
<el-table-column label="可选值" align="center" prop="optionalValue" /> | |||
<el-table-column label="顺序" align="center" prop="sort" /> | |||
<!-- <el-table-column label="是否开放" align="center" prop="open" /> --> | |||
<!-- <el-table-column label="模版id" align="center" prop="tempId" /> --> | |||
<el-table-column label="操作" align="center" 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:templateProp:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:templateProp: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" | |||
/> | |||
<!-- 添加或修改模版属性对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |||
<el-form-item label="标题" prop="title"> | |||
<el-input v-model="form.title" placeholder="请输入标题" /> | |||
</el-form-item> | |||
<el-form-item label="组件类型" prop="compType"> | |||
<el-select v-model="form.compType" placeholder="请选择组件类型"> | |||
<el-option | |||
v-for="dict in dict.type.comp_type" | |||
:key="dict.value" | |||
:label="dict.label" | |||
:value="dict.value" | |||
></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="字段名" prop="fieldName"> | |||
<el-input v-model="form.fieldName" placeholder="请输入字段名" /> | |||
</el-form-item> | |||
<el-form-item label="占位提示" prop="placPrompt"> | |||
<el-input v-model="form.placPrompt" placeholder="请输入占位提示" /> | |||
</el-form-item> | |||
<el-form-item label="默认值" prop="defaultValue"> | |||
<el-input v-model="form.defaultValue" type="textarea" placeholder="请输入内容" /> | |||
</el-form-item> | |||
<el-form-item label="可选值" prop="optionalValue"> | |||
<el-input v-model="form.optionalValue" placeholder="请输入可选值" /> | |||
</el-form-item> | |||
<el-form-item label="顺序" prop="sort"> | |||
<el-input v-model="form.sort" placeholder="请输入顺序" /> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listTemplateProp, getTemplateProp, delTemplateProp, addTemplateProp, updateTemplateProp } from "@/api/business/templateProp"; | |||
import { listAll } from "@/api/business/template"; | |||
export default { | |||
name: "TemplateProp", | |||
dicts: ['comp_type'], | |||
data() { | |||
return { | |||
tempId:null, | |||
tempList:[], | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 模版属性表格数据 | |||
templatePropList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
title: null, | |||
compType: null, | |||
fieldName: null, | |||
placPrompt: null, | |||
defaultValue: null, | |||
optionalValue: null, | |||
open: null, | |||
tempId: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
title: [ | |||
{ required: true, message: "标题不能为空", trigger: "blur" } | |||
], | |||
compType: [ | |||
{ required: true, message: "组件类型不能为空", trigger: "change" } | |||
], | |||
fieldName: [ | |||
{ required: true, message: "字段名不能为空", trigger: "blur" } | |||
], | |||
} | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
this.getTempList(); | |||
}, | |||
methods: { | |||
seach(){ | |||
this.getList(); | |||
}, | |||
/** 查询模版属性列表 */ | |||
getList() { | |||
this.loading = true; | |||
if(this.queryParams.tempId == null){ | |||
this.queryParams.id = -1 | |||
}else{ | |||
this.queryParams.id = null | |||
} | |||
listTemplateProp(this.queryParams).then(response => { | |||
this.templatePropList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
/** 查询模版属性列表 */ | |||
getTempList() { | |||
this.loading = true; | |||
let data = {}; | |||
listAll(data).then(response => { | |||
this.tempList = response.data; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
title: null, | |||
compType: null, | |||
fieldName: null, | |||
placPrompt: null, | |||
defaultValue: null, | |||
optionalValue: null, | |||
open: null, | |||
tempId: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
deleted: null, | |||
remark: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length!==1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
if(this.queryParams.tempId == null){ | |||
this.$modal.msgError("请先在右边选择模版"); | |||
return; | |||
} | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加模版属性"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getTemplateProp(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改模版属性"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
this.form.tempId = this.queryParams.tempId; | |||
if (this.form.id != null) { | |||
updateTemplateProp(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addTemplateProp(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除模版属性编号为"' + ids + '"的数据项?').then(function() { | |||
return delTemplateProp(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/templateProp/export', { | |||
...this.queryParams | |||
}, `templateProp_${new Date().getTime()}.xlsx`) | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,307 +0,0 @@ | |||
<template> | |||
<div class="app-container"> | |||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |||
<el-form-item label="字段id" prop="propId"> | |||
<el-input | |||
v-model="queryParams.propId" | |||
placeholder="请输入字段id" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="字段名称" prop="propName"> | |||
<el-input | |||
v-model="queryParams.propName" | |||
placeholder="请输入字段名称" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="值键" prop="valueKey"> | |||
<el-input | |||
v-model="queryParams.valueKey" | |||
placeholder="请输入值键" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="值描述" prop="valueText"> | |||
<el-input | |||
v-model="queryParams.valueText" | |||
placeholder="请输入值描述" | |||
clearable | |||
@keyup.enter.native="handleQuery" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="模版id" prop="tempId"> | |||
<el-input | |||
v-model="queryParams.tempId" | |||
placeholder="请输入模版id" | |||
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> | |||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |||
</el-form-item> | |||
</el-form> | |||
<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:templatePropValue: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:templatePropValue: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:templatePropValue: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:templatePropValue:export']" | |||
>导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="templatePropValueList" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" /> | |||
<el-table-column label="主键" align="center" prop="id" /> | |||
<el-table-column label="字段id" align="center" prop="propId" /> | |||
<el-table-column label="字段名称" align="center" prop="propName" /> | |||
<el-table-column label="值键" align="center" prop="valueKey" /> | |||
<el-table-column label="值描述" align="center" prop="valueText" /> | |||
<el-table-column label="模版id" align="center" prop="tempId" /> | |||
<el-table-column label="操作" align="center" 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:templatePropValue:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:templatePropValue: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" | |||
/> | |||
<!-- 添加或修改模版属性值对话框 --> | |||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | |||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |||
<el-form-item label="字段id" prop="propId"> | |||
<el-input v-model="form.propId" placeholder="请输入字段id" /> | |||
</el-form-item> | |||
<el-form-item label="字段名称" prop="propName"> | |||
<el-input v-model="form.propName" placeholder="请输入字段名称" /> | |||
</el-form-item> | |||
<el-form-item label="值键" prop="valueKey"> | |||
<el-input v-model="form.valueKey" placeholder="请输入值键" /> | |||
</el-form-item> | |||
<el-form-item label="值描述" prop="valueText"> | |||
<el-input v-model="form.valueText" placeholder="请输入值描述" /> | |||
</el-form-item> | |||
<el-form-item label="模版id" prop="tempId"> | |||
<el-input v-model="form.tempId" placeholder="请输入模版id" /> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button type="primary" @click="submitForm">确 定</el-button> | |||
<el-button @click="cancel">取 消</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
<script> | |||
import { listTemplatePropValue, getTemplatePropValue, delTemplatePropValue, addTemplatePropValue, updateTemplatePropValue } from "@/api/business/templatePropValue"; | |||
export default { | |||
name: "TemplatePropValue", | |||
data() { | |||
return { | |||
// 遮罩层 | |||
loading: true, | |||
// 选中数组 | |||
ids: [], | |||
// 非单个禁用 | |||
single: true, | |||
// 非多个禁用 | |||
multiple: true, | |||
// 显示搜索条件 | |||
showSearch: true, | |||
// 总条数 | |||
total: 0, | |||
// 模版属性值表格数据 | |||
templatePropValueList: [], | |||
// 弹出层标题 | |||
title: "", | |||
// 是否显示弹出层 | |||
open: false, | |||
// 查询参数 | |||
queryParams: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
propId: null, | |||
propName: null, | |||
valueKey: null, | |||
valueText: null, | |||
tempId: null, | |||
}, | |||
// 表单参数 | |||
form: {}, | |||
// 表单校验 | |||
rules: { | |||
} | |||
}; | |||
}, | |||
created() { | |||
this.getList(); | |||
}, | |||
methods: { | |||
/** 查询模版属性值列表 */ | |||
getList() { | |||
this.loading = true; | |||
listTemplatePropValue(this.queryParams).then(response => { | |||
this.templatePropValueList = response.rows; | |||
this.total = response.total; | |||
this.loading = false; | |||
}); | |||
}, | |||
// 取消按钮 | |||
cancel() { | |||
this.open = false; | |||
this.reset(); | |||
}, | |||
// 表单重置 | |||
reset() { | |||
this.form = { | |||
id: null, | |||
propId: null, | |||
propName: null, | |||
valueKey: null, | |||
valueText: null, | |||
tempId: null, | |||
createBy: null, | |||
createTime: null, | |||
updateBy: null, | |||
updateTime: null, | |||
deleted: null, | |||
remark: null | |||
}; | |||
this.resetForm("form"); | |||
}, | |||
/** 搜索按钮操作 */ | |||
handleQuery() { | |||
this.queryParams.pageNum = 1; | |||
this.getList(); | |||
}, | |||
/** 重置按钮操作 */ | |||
resetQuery() { | |||
this.resetForm("queryForm"); | |||
this.handleQuery(); | |||
}, | |||
// 多选框选中数据 | |||
handleSelectionChange(selection) { | |||
this.ids = selection.map(item => item.id) | |||
this.single = selection.length!==1 | |||
this.multiple = !selection.length | |||
}, | |||
/** 新增按钮操作 */ | |||
handleAdd() { | |||
this.reset(); | |||
this.open = true; | |||
this.title = "添加模版属性值"; | |||
}, | |||
/** 修改按钮操作 */ | |||
handleUpdate(row) { | |||
this.reset(); | |||
const id = row.id || this.ids | |||
getTemplatePropValue(id).then(response => { | |||
this.form = response.data; | |||
this.open = true; | |||
this.title = "修改模版属性值"; | |||
}); | |||
}, | |||
/** 提交按钮 */ | |||
submitForm() { | |||
this.$refs["form"].validate(valid => { | |||
if (valid) { | |||
if (this.form.id != null) { | |||
updateTemplatePropValue(this.form).then(response => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} else { | |||
addTemplatePropValue(this.form).then(response => { | |||
this.$modal.msgSuccess("新增成功"); | |||
this.open = false; | |||
this.getList(); | |||
}); | |||
} | |||
} | |||
}); | |||
}, | |||
/** 删除按钮操作 */ | |||
handleDelete(row) { | |||
const ids = row.id || this.ids; | |||
this.$modal.confirm('是否确认删除模版属性值编号为"' + ids + '"的数据项?').then(function() { | |||
return delTemplatePropValue(ids); | |||
}).then(() => { | |||
this.getList(); | |||
this.$modal.msgSuccess("删除成功"); | |||
}).catch(() => {}); | |||
}, | |||
/** 导出按钮操作 */ | |||
handleExport() { | |||
this.download('business/templatePropValue/export', { | |||
...this.queryParams | |||
}, `templatePropValue_${new Date().getTime()}.xlsx`) | |||
} | |||
} | |||
}; | |||
</script> |
@@ -1,7 +1,7 @@ | |||
<template> | |||
<div class="login"> | |||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> | |||
<h3 class="title">后台管理系统</h3> | |||
<h3 class="title">影刀后台管理系统</h3> | |||
<el-form-item prop="username"> | |||
<el-input | |||
v-model="loginForm.username" | |||
@@ -1,7 +1,7 @@ | |||
<template> | |||
<div class="register"> | |||
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form"> | |||
<h3 class="title">后台管理系统</h3> | |||
<h3 class="title">影刀后台管理系统</h3> | |||
<el-form-item prop="username"> | |||
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号"> | |||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> | |||
@@ -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" /> | |||
@@ -108,8 +108,6 @@ import logo from '@/assets/logo/logo.png' | |||
import CodeTypeDialog from './CodeTypeDialog' | |||
import DraggableItem from './DraggableItem' | |||
import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate } from "@/api/business/template"; | |||
let oldActiveId | |||
let tempActiveData | |||
@@ -7,7 +7,7 @@ function resolve(dir) { | |||
const CompressionPlugin = require('compression-webpack-plugin') | |||
const name = process.env.VUE_APP_TITLE || '后台管理系统' // 网页标题 | |||
const name = process.env.VUE_APP_TITLE || '影刀后台管理系统' // 网页标题 | |||
const port = process.env.port || process.env.npm_config_port || 80 // 端口 | |||