|
@@ -0,0 +1,402 @@
|
|
|
|
|
+<style lang="scss">
|
|
|
|
|
+.preview {
|
|
|
|
|
+ .el-form-item {
|
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
|
+ }
|
|
|
|
|
+ label,
|
|
|
|
|
+ p {
|
|
|
|
|
+ line-height: 25px !important;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.el-cascader {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+a {
|
|
|
|
|
+ text-decoration: none;
|
|
|
|
|
+ color: #409eff;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+// 右边
|
|
|
|
|
+.item-main {
|
|
|
|
|
+ // margin:34px;
|
|
|
|
|
+ // height:600px;
|
|
|
|
|
+ // background: #FFFFFF;
|
|
|
|
|
+ border: 1px solid #dddddd;
|
|
|
|
|
+ box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.13);
|
|
|
|
|
+ border-radius: 20px;
|
|
|
|
|
+ .el-form.over_y {
|
|
|
|
|
+ max-height: calc(100vh - 340px);
|
|
|
|
|
+ }
|
|
|
|
|
+ /deep/.el-form-item__label {
|
|
|
|
|
+ float: none;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// label样式
|
|
|
|
|
+.edit_label {
|
|
|
|
|
+ /deep/.el-input__inner {
|
|
|
|
|
+ background: #f5faff;
|
|
|
|
|
+ border: 0px;
|
|
|
|
|
+ padding: 0px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+/deep/.opicon {
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ padding: 5px;
|
|
|
|
|
+ color: #3895fe;
|
|
|
|
|
+}
|
|
|
|
|
+.tpl_title {
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ margin: 20px 0;
|
|
|
|
|
+}
|
|
|
|
|
+.tpl_form {
|
|
|
|
|
+ margin: 20px;
|
|
|
|
|
+ border: 1px solid #ccc;
|
|
|
|
|
+ border-radius: 20px;
|
|
|
|
|
+ /deep/.el-form-item {
|
|
|
|
|
+ background: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ /deep/.el-form-item__content {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.survey_logo {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ top: 15px;
|
|
|
|
|
+ left: 20px;
|
|
|
|
|
+}
|
|
|
|
|
+.result_dialog .el-dialog{
|
|
|
|
|
+ width: 40%;
|
|
|
|
|
+ margin-top:20vh!important;
|
|
|
|
|
+}
|
|
|
|
|
+.result-item{
|
|
|
|
|
+ height: 35px;
|
|
|
|
|
+ .label{
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|
|
|
|
|
+<template>
|
|
|
|
|
+ <section>
|
|
|
|
|
+ <p><span>信息管理></span>问卷统计</p>
|
|
|
|
|
+ <div class="content">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <p>第1题<span>姓名</span><span>[填空题]</span></p>
|
|
|
|
|
+ <div>张三、李四、王五</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <p>第2题<span>你喜欢的期刊是?</span><span>[多选题]</span></p>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="14">
|
|
|
|
|
+ <el-table>
|
|
|
|
|
+ <el-table-column prop="realname" label="选项1"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="realname" label="次数"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="realname" label="比例"> </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="10">
|
|
|
|
|
+ 一个柱状图、一个饼图
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </section>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import Page from "../../components/Page";
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ Page,
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ // checked: [],
|
|
|
|
|
+ cur_message_id:null,
|
|
|
|
|
+ cur_post_type:null,
|
|
|
|
|
+ postResult:{},
|
|
|
|
|
+ analyseDataList:[],
|
|
|
|
|
+ title: "",
|
|
|
|
|
+ widgetList: [],
|
|
|
|
|
+ form: { name: "", page: 1, page_size: 20 },
|
|
|
|
|
+ form1: {},
|
|
|
|
|
+ form2: {
|
|
|
|
|
+ },
|
|
|
|
|
+ total: 1,
|
|
|
|
|
+ list: [{ name: "2333" }],
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ input: "",
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
|
+ dialogVisible1: false,
|
|
|
|
|
+ dialogVisible2: false,
|
|
|
|
|
+ dialogVisible3:false,
|
|
|
|
|
+ dialogTitle: "",
|
|
|
|
|
+ dialogTitle2:"",
|
|
|
|
|
+ dialogTitle3:"",
|
|
|
|
|
+ defaultProps: {},
|
|
|
|
|
+ data: [],
|
|
|
|
|
+ templateList: [],
|
|
|
|
|
+ userList: [],
|
|
|
|
|
+ checkList: [],
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ name: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
|
|
|
|
+ },
|
|
|
|
|
+ props: { multiple: true },
|
|
|
|
|
+ options: [
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 1,
|
|
|
|
|
+ label: "东南",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 2,
|
|
|
|
|
+ label: "上海",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ { value: 3, label: "普陀" },
|
|
|
|
|
+ { value: 4, label: "黄埔" },
|
|
|
|
|
+ { value: 5, label: "徐汇" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 7,
|
|
|
|
|
+ label: "江苏",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ { value: 8, label: "南京" },
|
|
|
|
|
+ { value: 9, label: "苏州" },
|
|
|
|
|
+ { value: 10, label: "无锡" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 12,
|
|
|
|
|
+ label: "浙江",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ { value: 13, label: "杭州" },
|
|
|
|
|
+ { value: 14, label: "宁波" },
|
|
|
|
|
+ { value: 15, label: "嘉兴" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 17,
|
|
|
|
|
+ label: "西北",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 18,
|
|
|
|
|
+ label: "陕西",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ { value: 19, label: "西安" },
|
|
|
|
|
+ { value: 20, label: "延安" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 21,
|
|
|
|
|
+ label: "新疆维吾尔族自治区",
|
|
|
|
|
+ children: [
|
|
|
|
|
+ { value: 22, label: "乌鲁木齐" },
|
|
|
|
|
+ { value: 23, label: "克拉玛依" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed() {},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ downloadExcel(){
|
|
|
|
|
+ this.$api.downloadSurveyResult({message_id:this.cur_message_id,type:this.cur_post_type}).then((res)=>{
|
|
|
|
|
+ var elink = document.createElement('a');
|
|
|
|
|
+ let blob=new Blob([res.data], {type: 'application/vnd.ms-excel,charset=UTF-8'});
|
|
|
|
|
+ let objUrl=URL.createObjectURL(blob);
|
|
|
|
|
+ let file_name=decodeURIComponent(res.headers['content-disposition'].split('=')[1]);
|
|
|
|
|
+ console.log(file_name)
|
|
|
|
|
+ elink.download = file_name;
|
|
|
|
|
+ elink.style.display = 'none';
|
|
|
|
|
+ elink.href = objUrl;
|
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
|
+ elink.click();
|
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
|
+ this.download_loading = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ showPostResult(row){
|
|
|
|
|
+ this.postResult = row.post_result
|
|
|
|
|
+ this.dialogTitle3 = "填报结果"
|
|
|
|
|
+ this.dialogVisible3 = true
|
|
|
|
|
+ },
|
|
|
|
|
+ analyseData(type,message_id) {
|
|
|
|
|
+ this.dialogTitle2 = "统计结果"
|
|
|
|
|
+ this.dialogVisible2 = true;
|
|
|
|
|
+ this.$api.getMessageSurveyAnalyse({type:type,message_id:message_id}).then((res)=>{
|
|
|
|
|
+ this.analyseDataList = res.data.data.list
|
|
|
|
|
+ this.cur_message_id = message_id
|
|
|
|
|
+ this.cur_post_type = type
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSuccess(res, file) {
|
|
|
|
|
+ this.form2[res.data.type] = res.data.url;
|
|
|
|
|
+ },
|
|
|
|
|
+ change(i, label) {
|
|
|
|
|
+ this.form2[label] = i;
|
|
|
|
|
+ },
|
|
|
|
|
+ changeMul(i, label) {
|
|
|
|
|
+ this.form2[label] = i;
|
|
|
|
|
+ },
|
|
|
|
|
+ showSurvey(row) {
|
|
|
|
|
+ let _this = this;
|
|
|
|
|
+ this.title = row.name;
|
|
|
|
|
+ this.message_id = row.id;
|
|
|
|
|
+ this.$api.getMessageInfo({ id: row.id }).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.widgetList = res.data.data.widget;
|
|
|
|
|
+ this.widgetList.forEach((i) => {
|
|
|
|
|
+ if (i.type == "checkbox") {
|
|
|
|
|
+ // _this.form2[i.label] = [] ;
|
|
|
|
|
+ _this.$set(_this.form2,i.label,[])
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(this.form2)
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ this.dialogVisible1 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ upload(type) {
|
|
|
|
|
+ var file = document.getElementById(type).files;
|
|
|
|
|
+ var data = new FormData();
|
|
|
|
|
+ data.append("file", file[0]);
|
|
|
|
|
+ this.$api.uploadFile(data).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.$set(this.form1, type, res.data.data.url);
|
|
|
|
|
+ this.$set(this.form1, "filename", res.data.data.name);
|
|
|
|
|
+ this.$message({ message: "上传成功!", type: "success" });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleChange(value) {
|
|
|
|
|
+ console.log(value);
|
|
|
|
|
+ },
|
|
|
|
|
+ search() {
|
|
|
|
|
+ let parm = this.form;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+ openDiag() {
|
|
|
|
|
+ this.form1 = {};
|
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
|
+ this.dialogTitle = "发送消息";
|
|
|
|
|
+ },
|
|
|
|
|
+ gopage(size) {
|
|
|
|
|
+ if (size) {
|
|
|
|
|
+ this.form.page_size = size;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.page = this.$refs.pageButton.page;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+ getData() {
|
|
|
|
|
+ var parm = this.form;
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.$api.getAllTemplateList().then((res) => {
|
|
|
|
|
+ this.templateList = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$api.getAllSysUserList().then((res) => {
|
|
|
|
|
+ this.userList = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$api.getMessageList(parm).then((res) => {
|
|
|
|
|
+ this.list = res.data.data.list;
|
|
|
|
|
+ this.total = res.data.data.total;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$api.getMessageReceiverList().then((res) => {
|
|
|
|
|
+ this.options = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ del(id) {
|
|
|
|
|
+ this.$confirm("确定删除吗", "提示", {
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.$api.delMessageInfo({ id: id }).then((res) => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "删除成功",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ edit(row) {
|
|
|
|
|
+ this.form1 = row;
|
|
|
|
|
+ let receiver_ids = this.form1.receiver_id;
|
|
|
|
|
+ console.log(receiver_ids, 33333333333333);
|
|
|
|
|
+ if (typeof receiver_ids == "string") {
|
|
|
|
|
+ receiver_ids = JSON.parse(receiver_ids);
|
|
|
|
|
+ }
|
|
|
|
|
+ // receiver_ids.forEach((element,index) => {
|
|
|
|
|
+ // receiver_ids[index] = parseInt(element)
|
|
|
|
|
+ // });
|
|
|
|
|
+ this.form1.receiver_id = receiver_ids;
|
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ saveResult() {
|
|
|
|
|
+ let result = JSON.stringify(this.form2);
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .saveSurveyResult({
|
|
|
|
|
+ message_id: this.message_id,
|
|
|
|
|
+ result: result,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: "保存成功!",
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error("保存失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ this.dialogVisible1 = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ save() {
|
|
|
|
|
+ this.$refs["form1"].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ let parm = this.form1;
|
|
|
|
|
+ let id = this.form1.id;
|
|
|
|
|
+ parm.receiver_id = JSON.stringify(parm.receiver_id);
|
|
|
|
|
+ if (id) {
|
|
|
|
|
+ this.$api.editMessage(parm).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: "保存成功!",
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error("保存失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$api.addMessage(parm).then((res) => {
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: "保存成功!",
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error("保存失败!");
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|