Commit 33eafaaf authored by 王启林's avatar 王启林

parent 8e749a65
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
......@@ -11,7 +11,7 @@
</el-form-item>
<el-form-item label="问卷说明:" label-width="125px">
<el-input type="textarea" placeholder="请输入问卷说明(不超过1000个汉字)" maxlength="1000"
v-model="titleForm.remake"></el-input>
v-model="titleForm.remark"></el-input>
</el-form-item>
<div style="text-align: center;">
<el-button size="small" @click="$router.back()">取消</el-button>
......@@ -58,7 +58,8 @@
<el-form-item label="问卷封面:" label-width="125px">
<div style="display: flex;align-items: center;">
<img style="width:80px; height: 50px; margin-right: 10px;cursor: pointer;"
v-for="i in issueForm.cover" :src="i" alt="">
v-for="(i, j) in issueForm.cover" :key="j" :src="i" alt=""
:class="selImg == j ? 'selImg' : ''" @click="selImg = j">
</div>
<!-- <el-input v-model="issueForm.cover" autocomplete="off"></el-input> -->
</el-form-item>
......@@ -68,7 +69,8 @@
</el-date-picker>
</el-form-item>
<el-form-item label="邀请人员:" label-width="125px">
<el-button type="success" size="small">选择人员</el-button>
<el-button size="small" type="success" @click="treeDialog = 1">选择人员</el-button>
</el-form-item>
<div style="text-align: center;">
<el-button size="small" @click="issueDialog = false">取消</el-button>
......@@ -76,6 +78,28 @@
</div>
</el-form>
</el-dialog>
<el-dialog title="人员选择" :visible.sync="treeDialog">
<div class="treeDialog">
<el-tree class="treeCss" :data="treeData" node-key="id" :props="defaultProps"
@node-click="handleNodeClick"></el-tree>
<div class="treeCss" style="margin-left: 10px;">
<div style="margin-top: 3px;">
{{ cityOptions.length > 0 ? '请选择人员' : '请选择部门' }}
</div>
<!-- <el-checkbox v-show="cityOptions.length > 0" :indeterminate="isIndeterminate"
v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox> -->
<el-checkbox-group v-model="checkedCities">
<el-checkbox v-for="i in cityOptions" :label="i.staffId" :key="i">{{ i.staffName
}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
<div style="text-align: center;margin-top: 10px;">
<el-button size="small" @click="checkedCities = []">重置</el-button>
<el-button size="small" type="primary" @click="subUser">确定</el-button>
</div>
</el-dialog>
</el-tab-pane>
</el-tabs>
</div>
......@@ -114,11 +138,11 @@ export default {
data() {
return {
step: 1,
tabs: '1',
titleForm: {
title: '',
remark: ''
},
titleRules: {
title: [
......@@ -129,11 +153,13 @@ export default {
Frule: [],
Fopthion: '',
issueDialog: false,
selImg: 0,
issueForm: {
id: '',
title: '',
cover: [
'http://sy.scsmile.cn/YX-JXgl/v1.0/HT/images/%E6%96%B0%E5%A2%9E%E5%8F%8D%E9%A6%88_%E7%AC%AC3%E6%AD%A5_/u26101.svg',
'http://sy.scsmile.cn/YX-JXgl/v1.0/HT/images/%E6%96%B0%E5%A2%9E%E5%8F%8D%E9%A6%88_%E7%AC%AC3%E6%AD%A5_/u26102.svg',
],
},
......@@ -141,19 +167,51 @@ export default {
time: [
{ required: true, message: '请输入选择反馈期限', trigger: 'blur' },
]
}
},
treeData: [],
defaultProps: {
label: 'label',
children: 'children'
},
treeDialog: 0,
checkAll: false,
cityOptions: [],
checkedCities: [],
isIndeterminate: true
}
},
mounted() {
this.formConfiguration()
this.getDeptData()
},
methods: {
handleCheckAllChange(val) {
console.log(val)
this.checkedCities = val ? this.cityOptions : [];
this.isIndeterminate = false;
},
subUser() {
console.log(this.checkedCities)
},
handleNodeClick(data) {
if (data.personList) {
this.cityOptions = data.personList
// console.log(this.cityOptions)
}
},
//获取部门数据
getDeptData() {
this.$post('/staff/list', { page: 1, size: -1 }).then(res => {
let arr = res.dict.deptPerson[0].children
this.treeData = arr
})
},
//创建问卷
createForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.step = 0;
this.formConfiguration()
}
});
},
......@@ -161,13 +219,13 @@ export default {
issueBtn() {
this.Frule = formCreate.parseJson(this.getFormJson())
this.Fopthion = formCreate.parseJson(this.getFormOption())
console.log(this.Frule)
// console.log(this.Frule)
//判断是否配置了表单
if (this.Frule.length > 0) {
if (this.Frule.length > 1) {
this.issueDialog = true
} else {
this.$message({
message: '请配置表单后发布',
message: '请配置问卷内容后发布',
type: 'warning'
});
}
......@@ -185,13 +243,13 @@ export default {
getFormJson() {
//FcDesigner 生成的`JSON`
const FcDesignerRule = this.$refs.designer.getRule();
console.log(FcDesignerRule)
// console.log(FcDesignerRule)
return JSON.stringify(FcDesignerRule)
},
getFormOption() {
//FcDesigner 生成的`options`
const FcDesignerOptions = this.$refs.designer.getOption();
console.log(FcDesignerOptions)
// console.log(FcDesignerOptions)
return JSON.stringify(FcDesignerOptions)
},
issueFormBtn(formName) {
......@@ -199,17 +257,20 @@ export default {
if (valid) {
console.log(this.issueForm)
this.Frule.forEach(i => {
i.remake = i.field
i.remark = i.field
i.questionType = formType(i.type)
i.require = formatNum(i.$required)
i.content = i.info
i.content = i.info || ''
if (formType(i.type) == 1 || formType(i.type) == 2) {
i.options.forEach(j => {
j.content = j.value
j.remark = j.label
})
}
if (formType(i.type) == 1 || formType(i.type) == 2) {
i.feedbackOptionList = i.options
}
})
let sub = {
id: '',
......@@ -270,23 +331,58 @@ export default {
this.$refs.designer.removeMenuItem("fc-editor")
this.$refs.designer.removeMenuItem("el-button")
this.$refs.designer.removeMenuItem("el-divider")
//配置组件生成规则---直接配置显示在页面上
// const rule = [{
// "type": "span",
// "title": "请输入问卷名称",
// "native": false,
// "children": [],
// "_fc_drag_tag": "span",
// "hidden": false,
// "display": true
// }]
// this.$refs.designer.setRule(rule)
// 配置组件生成规则---直接配置显示在页面上
const rule = [{
"type": "span",
"title": this.titleForm.title,
"native": false,
"children": [this.titleForm.remark],
"_fc_drag_tag": "span",
"hidden": false,
"display": true
}]
this.$refs.designer.setRule(rule)
}
}
}
</script>
<style lang="less" scoped>
.treeDialog {
// border: 1px solid;
display: flex;
align-items: center;
justify-content: space-between;
.treeCss {
width: 50%;
height: 500px;
overflow: auto;
}
/* 侧边滚动条 */
.treeCss::-webkit-scrollbar {
width: 3px;
}
/* 滚动条上的滚动滑块 */
.treeCss::-webkit-scrollbar-thumb {
background: #CCCCCC;
border-radius: 4px;
}
/* 滚动条轨道 */
.treeCss::-webkit-scrollbar-track {
background: #EEEEEE;
border-radius: 4px;
}
}
.selImg {
border: 2px solid #1a7af8;
}
/deep/.el-textarea__inner {
height: 300px;
}
......
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
<LayoutTable :data="tableData" noDel :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
......@@ -50,6 +48,8 @@ export default {
},
/** 重写查看方法 */
toView(row) {
console.log(row)
localStorage.setItem('checkFeedbackId',row.id)
// this.$refs.drawerform.view(row);
this.$router.push('/feedback/questionnaire/list')
},
......
......@@ -6,9 +6,9 @@
<el-tab-pane label="问卷情况" name="1">
<div class="top" style="margin: 10px 0;">
<div style="width: 80%;">
<div class="title">问卷名称</div>
<div class="title">{{ this.feedbackData.title }}</div>
<div class="tips">
问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述
{{ this.feedbackData.remark }}
</div>
</div>
<el-button type="success" @click="drawer = true">预览</el-button>
......@@ -123,6 +123,7 @@ export default {
Frule: '',
Fopthion: '',
drawerAnswer: false,
feedbackData: {},
tableData: [{
date: '2016-05-02',
name: '王小虎',
......@@ -182,97 +183,99 @@ export default {
}
},
mounted() {
this.Frule = [
{
"type": "span",
"title": "问卷名称",
"native": false,
"children": [
"这是一段文字"
],
"_fc_drag_tag": "span",
"hidden": false,
"display": true
},
{
"type": "input",
"field": "Fupb1nuyh5txf1",
"title": "输入框",
"info": "",
"$required": false,
"_fc_drag_tag": "input",
"hidden": false,
"display": true
},
{
"type": "inputNumber",
"field": "Flo91nuyh5vjag",
"title": "计数器",
"info": "",
"$required": false,
"_fc_drag_tag": "inputNumber",
"hidden": false,
"display": true
},
{
"type": "radio",
"field": "Fz3d1nuyh5xpor",
"title": "单选框",
"info": "",
"effect": {
"fetch": ""
},
"$required": false,
"options": [
{
"value": "1",
"label": "选项1"
},
{
"value": "2",
"label": "选项2"
}
],
"_fc_drag_tag": "radio",
"hidden": false,
"display": true
},
{
"type": "checkbox",
"field": "Fwzb1nuyh61906",
"title": "多选框",
"info": "",
"effect": {
"fetch": ""
},
"$required": false,
"options": [
{
"value": "1",
"label": "选项1"
},
{
"value": "2",
"label": "选项2"
}
],
"_fc_drag_tag": "checkbox",
"hidden": false,
"display": true
}
]
this.Fopthion = {
"form": {
"labelPosition": "top",
"size": "mini",
"labelWidth": "20%",
"hideRequiredAsterisk": false,
"showMessage": true,
"inlineMessage": false
},
"submitBtn": true,
"resetBtn": false
}
let id = localStorage.getItem('checkFeedbackId')
this.getInfo(id)
// this.Frule = [
// {
// "type": "span",
// "title": "问卷名称",
// "native": false,
// "children": [
// "这是一段文字"
// ],
// "_fc_drag_tag": "span",
// "hidden": false,
// "display": true
// },
// {
// "type": "input",
// "field": "Fupb1nuyh5txf1",
// "title": "输入框",
// "info": "",
// "$required": false,
// "_fc_drag_tag": "input",
// "hidden": false,
// "display": true
// },
// {
// "type": "inputNumber",
// "field": "Flo91nuyh5vjag",
// "title": "计数器",
// "info": "",
// "$required": false,
// "_fc_drag_tag": "inputNumber",
// "hidden": false,
// "display": true
// },
// {
// "type": "radio",
// "field": "Fz3d1nuyh5xpor",
// "title": "单选框",
// "info": "",
// "effect": {
// "fetch": ""
// },
// "$required": false,
// "options": [
// {
// "value": "1",
// "label": "选项1"
// },
// {
// "value": "2",
// "label": "选项2"
// }
// ],
// "_fc_drag_tag": "radio",
// "hidden": false,
// "display": true
// },
// {
// "type": "checkbox",
// "field": "Fwzb1nuyh61906",
// "title": "多选框",
// "info": "",
// "effect": {
// "fetch": ""
// },
// "$required": false,
// "options": [
// {
// "value": "1",
// "label": "选项1"
// },
// {
// "value": "2",
// "label": "选项2"
// }
// ],
// "_fc_drag_tag": "checkbox",
// "hidden": false,
// "display": true
// }
// ]
// this.Fopthion = {
// "form": {
// "labelPosition": "top",
// "size": "mini",
// "labelWidth": "20%",
// "hideRequiredAsterisk": false,
// "showMessage": true,
// "inlineMessage": false
// },
// "submitBtn": true,
// "resetBtn": false
// }
},
methods: {
......@@ -281,6 +284,14 @@ export default {
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
getInfo(id) {
this.$get('/feedback/info', { id }).then(res => {
this.feedbackData = res.data
console.log(this.feedbackData)
this.Frule = formCreate.parseJson(this.feedbackData.formContent)
this.Fopthion = formCreate.parseJson(this.feedbackData.ruleContent)
})
}
}
}
......@@ -323,6 +334,7 @@ export default {
}
.tips {
font-size: 14px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment