提交 bb863701 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 9971d3d9
......@@ -87,6 +87,12 @@ export default {
created() {
if (this.$route.query.id) {
this.getRegisterDetail()
} else {
const stepStorage = JSON.parse(window.localStorage.getItem('stepData'))
if (stepStorage) {
this.basicForm = stepStorage.basaForm
this.stepPageInfo = stepStorage.stepForm
}
}
},
methods: {
......@@ -102,6 +108,7 @@ export default {
return item
})
createRegister(params).then(res => {
window.localStorage.removeItem('stepData')
this.$message({
message: '创建成功',
type: 'success'
......@@ -232,9 +239,8 @@ export default {
},
// 暂存配置
hanleLocalStorage() {
console.log('111')
window.localStorage.setItem('stepPageInfo', JSON.stringify(this.stepPageInfo))
console.log(window.localStorage.getItem('stepPageInfo'))
const params = { basaForm: this.basicForm, stepForm: this.stepPageInfo }
window.localStorage.setItem('stepData', JSON.stringify(params))
this.$message.success('暂存数据成功')
// console.log(JSON.parse(window.localStorage.getItem('stepPageInfo'))
}
......
......@@ -9,7 +9,7 @@
<template v-slot:table-x="{ row }">
<el-button type="text" v-if="!row.isEdit" @click="handleUpdate(row)">编辑</el-button>
<el-button type="text" v-if="!row.isEdit" @click="deleteRegister(row)">删除</el-button>
<el-button type="text" @click="onRemove(row)">复制活动链接</el-button>
<el-button type="text" @click="copyUrl(row)">复制活动链接</el-button>
</template>
</app-list>
</app-card>
......@@ -114,6 +114,29 @@ export default {
})
deleteRegister({ id: row.id }).then(this.$refs.list.refetch(true))
})
},
copyUrl(row) {
this.copyToClipboard(`https://register-show-h5.ezijing.com/SignMainPage?id=${row.id}`)
},
copyToClipboard(str) {
const el = document.createElement('textarea')
el.value = str
el.setAttribute('readonly', '')
el.style.position = 'absolute'
el.style.left = '-9999px'
document.body.appendChild(el)
const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false
el.select()
document.execCommand('copy')
document.body.removeChild(el)
if (selected) {
document.getSelection().removeAllRanges()
document.getSelection().addRange(selected)
}
this.$message({
message: '已复制',
type: 'success'
})
}
}
}
......
......@@ -10,7 +10,7 @@
:key="cIndex"
v-for="(opt, cIndex) in item.optionList"
v-model="form[item.key]"
:label="opt.id + ':'"
:label="opt.id"
>{{ opt.option }}</el-radio
>
</el-form-item>
......@@ -43,7 +43,7 @@ export default {
required: true,
key: 'name',
value: '',
enable_edit: false
enable_edit: true
},
{
type: 'input',
......@@ -59,7 +59,7 @@ export default {
name: '性别',
key: 'gender',
required: true,
value: '',
value: '0',
optionList: [
{ id: '0', option: '未知' },
{ id: '1', option: '男' },
......@@ -283,6 +283,7 @@ export default {
}
})
this.dataList = formData
console.log(this.form, 'form')
console.log(this.dataList, 'fordata')
},
onSubmit() {
......
......@@ -34,7 +34,7 @@
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
<div style="text-align: center">
<a :href="file" download="试题模板.xlsx" style="color: #c01c40"> <i class="el-icon-download"></i>试题模板.xlsx</a>
<a :href="file" download="人员模板.xlsx" style="color: #c01c40"> <i class="el-icon-download"></i>人员模板.xlsx</a>
<!-- <a href="https://webapp-pub.oss-cn-beijing.aliyuncs.com/qbs/question.xlsx" :download="试题模版"></a> -->
</div>
<div style="text-align: center; margin-top: 15px">
......@@ -108,10 +108,20 @@ export default {
this.$refs.upload.submit()
},
cancel() {
this.$router.push({
name: 'teacher'
})
this.$emit('cancel')
// this.$router.push({
// name: 'teacher'
// })
}
}
}
</script>
<style lang="scss" scoped>
.file-import {
::v-deep{
.el-upload-dragger {
width: 260px !important;
}
}
}
</style>
<template>
<div class="create-box">
<div class="title">新建报名</div>
<div class="create-top">
<div class="sub-title">基本设置</div>
<set-basic class="set-basic"></set-basic>
</div>
<div class="create-bottom">
<div class="sub-title">展示设置</div>
<div class="create-bottom_mian">
<el-tabs @tab-click="handleClick" v-model="activeName">
<el-tab-pane
:name="`${index}`"
:label="`第${index + 1}步`"
v-for="(item, index) in stepPageInfo"
:key="index"
>
<display-page ref="display" v-if="item.type == '1'" :key="index"></display-page>
<form-page ref="display" v-if="item.type == '2'" :key="index"></form-page>
</el-tab-pane>
</el-tabs>
</div>
<div class="create-bottom_btn">
<el-button type="primary" style="margin-right: 80px" @click="hanleLocalStorage">暂存配置</el-button>
<el-button type="primary" @click="handleAddPageClick">添加步骤</el-button>
<el-button @click="handleRemovePageClick">删除步骤</el-button>
</div>
</div>
<!-- 添加页面弹窗 -->
<el-dialog title="添加步骤" :visible.sync="dialogAddPageVisible" width="25%" center>
<div class="add-page_select">
<div class="label">步骤类型:</div>
<el-select v-model="dialogAddPageValue" placeholder="请选择">
<el-option v-for="item in dialogAddPageOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogAddPageVisible = false">取 消</el-button>
<el-button type="primary" @click="handleDialogAddPageClick">确 定</el-button>
</div>
</el-dialog>
<el-button type="primary" @click="handleAddPageClick" style="display: block; margin: 30px auto">生成报名</el-button>
</div>
</template>
<script>
import SetBasic from '../components/SetBasic.vue'
import FormPage from '../components/FormType.vue'
import DisplayPage from '../components/DisplayType.vue'
export default {
components: { SetBasic, FormPage, DisplayPage },
data() {
return {
// 添加步骤弹窗
dialogAddPageVisible: false,
dialogAddPageValue: '1',
dialogAddPageOptions: [
{ value: '1', label: '展示类型' },
{ value: '2', label: '表单类型' }
],
// 步骤页面
activeName: '0',
stepPageInfo: [
{
type: '1',
index: 0
}
]
}
},
methods: {
handleClick(tab, event) {
// console.log(tab, event)
},
handleAddPageClick() {
this.isDisplayPageForm()
},
// 添加页面 && 跳转到添加的页面
handleDialogAddPageClick() {
this.stepPageInfo.push({ type: this.dialogAddPageValue, index: this.stepPageInfo.length })
this.dialogAddPageVisible = false
this.activeName = (this.stepPageInfo.length - 1).toString()
},
// 点击添加步骤按钮判断
isDisplayPageForm() {
const isFormValue = this.$refs.display.findIndex(item => (item.submitForm ? !item.submitForm() : false))
if (isFormValue === -1) {
this.dialogAddPageVisible = true
} else {
this.activeName = isFormValue.toString()
}
},
// 删除页面
handleRemovePageClick() {
if (this.stepPageInfo.length > 1) {
this.stepPageInfo = this.stepPageInfo.filter((item, index) => index !== parseInt(this.activeName))
this.activeName = (this.activeName === '0' ? '0' : this.activeName - 1).toString()
}
},
// 暂存配置
hanleLocalStorage() {
console.log('111')
window.localStorage.setItem('stepPageInfo', JSON.stringify(this.stepPageInfo))
console.log(window.localStorage.getItem('stepPageInfo'))
this.$message.success('暂存数据成功')
// console.log(JSON.parse(window.localStorage.getItem('stepPageInfo'))
}
}
}
</script>
<style lang="scss" scoped>
.create-box {
padding: 20px;
.title {
font-size: 18px;
line-height: 100%;
color: #333333;
margin-bottom: 20px;
}
.create-top {
background: #fff;
padding: 30px 30px 15px;
.set-basic {
margin-top: 20px;
}
}
.sub-title {
line-height: 100%;
font-size: 16px;
font-weight: bold;
color: #333333;
border-left: 3px solid rgba(184, 1, 64, 1);
padding-left: 7px;
}
.create-bottom {
background: #fff;
padding: 30px 30px 15px;
margin-top: 20px;
.create-bottom_mian {
margin-top: 30px;
}
}
.add-page_select {
display: flex;
align-items: center;
justify-content: center;
.label {
margin-right: 5px;
}
}
}
.create-bottom_btn {
margin-top: 15px;
}
</style>
......@@ -88,7 +88,7 @@
</el-pagination>
</div>
</div>
<import-people width="30%" :visible.sync="importDialogVisible"></import-people>
<import-people @cancel="importDialogVisible = false" width="400px" :visible.sync="importDialogVisible"></import-people>
<set-tabel-heade
@closeSetHeader="columnsOptionsVisible = false"
@handleConfirm="handleConfirm"
......
......@@ -49,7 +49,7 @@ httpRequest.interceptors.response.use(
function (response) {
const { data } = response
// 正常返回
if (data.code === 0) {
if (data.code === 0 || !Object.keys(data).includes('code')) {
return data
}
// 未登录
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论