@@ -1,5 +1,5 @@ | |||
# 页面标题 | |||
VUE_APP_TITLE = 后台管理系统 | |||
VUE_APP_TITLE = 影刀后台管理系统 | |||
# 开发环境配置 | |||
ENV = 'development' | |||
@@ -0,0 +1 @@ | |||
node_modules |
@@ -0,0 +1,2 @@ | |||
[0613/100035.500:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2) | |||
[0613/102540.147:ERROR:registration_protocol_win.cc(108)] CreateFile: 系统找不到指定的文件。 (0x2) |
@@ -0,0 +1,55 @@ | |||
import request from '@/utils/request' | |||
// 同步应用数据 | |||
export function syn() { | |||
return request({ | |||
url: '/business/ctApply/syn', | |||
method: 'post', | |||
data:{} | |||
}) | |||
} | |||
// 查询应用信息管理列表 | |||
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,53 @@ | |||
import request from '@/utils/request' | |||
// 同步机器人数据 | |||
export function syn() { | |||
return request({ | |||
url: '/business/ctRebot/syn', | |||
method: 'post', | |||
data:{} | |||
}) | |||
} | |||
// 查询机器人管理列表 | |||
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' | |||
}) | |||
} |
@@ -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' | |||
}) | |||
} |
@@ -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,368 @@ | |||
<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> | |||
<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:add']">同步应用数据</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |||
v-hasPermi="['business:ctApply:export']">导出</el-button> | |||
</el-col> | |||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||
</el-row> | |||
<el-table v-loading="loading" :data="ctApplyList" @selection-change="handleSelectionChange"> | |||
<el-table-column type="selection" width="55" align="center" fixed="left" /> | |||
<el-table-column 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="ownerName" width="120" /> | |||
<el-table-column label="应用所有者账号" align="center" prop="ownerAccount" width="200" /> | |||
<el-table-column label="所有者id" align="center" prop="ownerId" width="300" /> | |||
<el-table-column label="appid" align="center" prop="appId" width="300" /> | |||
<el-table-column label="应用名称" align="center" prop="appName" width="200" /> | |||
<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="version" width="100" /> | |||
<el-table-column label="是否支持应用参数" align="center" prop="supportParam" width="200"> | |||
<template slot-scope="scope"> | |||
<span v-if="scope.row.supportParam == 0"> | |||
否 | |||
</span> | |||
<span v-if="scope.row.supportParam == 1"> | |||
是 | |||
</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="icon图下载地址" align="center" prop="icon" width="200" /> | |||
<el-table-column label="预计人工耗时(分钟)" align="center" prop="manualTime" 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="showConfigTime(scope.row)" | |||
v-hasPermi="['business:ctApply:edit']">设置时间</el-button> | |||
<!-- <el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-edit" | |||
@click="handleUpdate(scope.row)" | |||
v-hasPermi="['business:ctApply:edit']" | |||
>修改</el-button> | |||
<el-button | |||
size="mini" | |||
type="text" | |||
icon="el-icon-delete" | |||
@click="handleDelete(scope.row)" | |||
v-hasPermi="['business:ctApply:remove']" | |||
>删除</el-button> --> | |||
</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="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="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="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,261 @@ | |||
<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:add']">同步机器人信息</el-button> | |||
</el-col> | |||
<el-col :span="1.5"> | |||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" | |||
v-hasPermi="['business:ctRebot:export']">导出</el-button> | |||
</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="150"/> | |||
<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> |
@@ -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> |
@@ -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 // 端口 | |||