confirm确认弹框禁止点击遮盖层关闭

dev_review
yujialong 9 months ago
parent f7a27f7e30
commit 539f1f95cc
  1. 1
      src/components/img-upload/Cropper.vue
  2. 4
      src/setting.js
  3. 9
      src/utils/api.js
  4. 88
      src/utils/editor.js
  5. 6
      src/views/course/AddCurriculum.vue
  6. 3
      src/views/course/contentSettings.vue
  7. 3
      src/views/customer/AddCustomer.vue
  8. 3
      src/views/information/addArticle/index.vue
  9. 447
      src/views/information/columnManage/index.vue
  10. 162
      src/views/information/contentManage/index.vue
  11. 144
      src/views/information/list/index.vue
  12. 9
      src/views/match/add/index.vue
  13. 2
      src/views/match/add/step1.vue
  14. 3
      src/views/match/manage/index.vue
  15. 447
      src/views/match/manage/matchProgress.vue
  16. 3
      src/views/match/manage/matchRank.vue
  17. 266
      src/views/match/manage/notice.vue
  18. 13
      src/views/parnerOperation/learnMg.vue
  19. 9
      src/views/parnerOperation/schemeSet.vue
  20. 2
      src/views/serve/Configure.vue
  21. 3
      src/views/serve/addModel.vue
  22. 3
      src/views/serve/projectAdd.vue
  23. 159
      src/views/setting/index.vue
  24. 3
      src/views/setting/info.vue
  25. 10
      src/views/shop/addProduct/index.vue
  26. 2
      src/views/system/index.vue
  27. 6
      src/views/system/manageLog.vue
  28. 6
      src/views/theoreticalCourse/add/index.vue
  29. 3
      src/views/theoreticalCourse/contentSettings/index.vue
  30. 879
      src/views/user/User.vue
  31. 3
      vue.config.js

@ -148,6 +148,7 @@ export default {
if (type === 'blob') {
this.$refs.cropper.getCropBlob(data => {
compress(data, 1).then(res => {
debugger
that.$emit('upload', res)
})
})

@ -6,7 +6,7 @@ const isDev = process.env.NODE_ENV === 'development' // 开发环境
const isPro = url.includes('huorantech.cn') //正式服
let jumpPath = `${location.origin}/judgmentPoint`
let sandPath = `${location.origin}/sandbox` // 沙盘地址
let sandPath = `https://izhixinyun.com/sandbox` // 沙盘地址
let host = `${location.origin}/`
if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
@ -16,7 +16,7 @@ if (isDev) {
host = 'http://192.168.31.217:9000/'// 榕
// host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
jumpPath = 'https://judgment.huorantech.cn/'
}

@ -1,7 +1,6 @@
import Setting from "@/setting";
const host = Setting.apiBaseURL
const uploadURL = Setting.uploadURL
const { uploadURL, jumpPath, apiBaseURL: host } = Setting
export default {
@ -16,7 +15,7 @@ export default {
// 阿里云文件/视频管理
getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证
staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板
staffTemplate: `https://occupationlab.com/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板
checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`, // 新增学生前:校验手机号或者邮箱
checkWorkNumOrAccount: `occupationlab/occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号
@ -94,8 +93,8 @@ export default {
editProjectDraft: `occupationlab/occupationlab/projectManage/editProjectDraft`, // 修改项目管理
copyProjectManage: `occupationlab/occupationlab/projectManage/copyProjectManage`, // 复制项目管理
// 判分点
getBcJudgmentPoint: `judgment/judgment/bcJudgmentPoint/getBcJudgmentPoint`, // 获取编程类判分点列表(分页)
getLcJudgmentPoint: `judgment/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页)
getBcJudgmentPoint: `${jumpPath}judgment/judgment/bcJudgmentPoint/getBcJudgmentPoint`, // 获取编程类判分点列表(分页)
getLcJudgmentPoint: `${jumpPath}judgment/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页)
addProjectJudgment: `occupationlab/occupationlab/projectJudgment/addProjectJudgment`, // 添加项目管理、判分点中间表
updateProjectJudgment: `occupationlab/occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `occupationlab/occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除

@ -199,93 +199,7 @@ export default {
{ title: 'Some class', value: 'class-name' }
],
//为内容模板插件提供预置模板
templates: [
{ title: '中文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap">
<div class="block">
<div class="fl">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div class="texts">
<p>S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机
</p>
</div>
</div>
<div class="block">
<div class="fr">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div>
<p>集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地</p>
<p>S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度</p>
</div>
</div>
</div>
`
},
{ title: '英文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap">
<div class="block en-block">
<div class="fr">
<img class="pic" src="images/default.png"/>
<p class="img-des">Picture description</p>
</div>
<div>
<p>One of the major barriers to treating pain effectively is rooted in providers fear of killing their patients. This includes caregivers who may be family or friends. In a 2014 study I led of nonprofessional hospice caregivers, we found that the majority of pain medication errors caregivers made involved administering less than the prescribed dose, which makes it difficult for patients to achieve optimal pain relief.</p>
<p>Meanwhile, more than 11 million Americans  often family members or friends provide unpaid care for people with Alzheimer's or other dementias, according to calculations by the Alzheimers Association. In 2021, caregivers for people with Alzheimers or other dementias provided an estimated 16 billion hours of unpaid care valued at nearly $272 billion.My father took her to the emergency room. A doctor found a severe knee infection and took her into surgery. She was hospitalized for two weeks, followed by two months of rehabilitation at a skilled nursing facility.</p>
<p>If you heated the salt on your kitchen table up to 801 C (1,474 F), it would melt, and youd have molten salt. However, for making and storing energy, not just any salt will do. Scientists are exploring different combinations of salts to get the exact properties needed to cool and fuel a nuclear power reactor efficiently for decades. These properties include lower melting temperatures, the right consistency, and the ability to absorb high amounts of heat, among others.</p>
<div class="quote">We used experimental results to validate our simulation. At the same time, the simulation results provided us more details about which salts to study further. They work with each other. Jicheng Guo, chemical engineer at Argonne National Laboratory</div>
<p>Which molten salt blueprints will deliver the desired traits for a nuclear reactor? The potential variations are nearly endless. The study set out to determine whether computer simulations driven by machine learning could guide and refine real-world experiments at the Advanced Photon Source (APS), a DOE Office of Science user facility at Argonne. The results were recently published in the journal Physical Review B.</p>
<p>We used experimental results from the APS to validate our simulation. At the same time, the simulation results provided us more details about which salts to study further. They work with each other, said Jicheng Guo, a chemical engineer at Argonne and the papers lead author. This allows us to study multiple compositions at the same time.</p>
</div>
</div>
</div>
`
},
{ title: '新闻模板', description: '', content: `
<div class="tiny-wrap">
<div class="block" style="margin-bottom: 70px;">
<div class="fr">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div>
<p style="text-indent: 2em">S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度</p>
<div class="quote">
Here is a long quotation here is a long quotation here is a long quotation
here is a long quotation here is a long quotation here is a long quotation
here is a long quotation here is a long quotation here is a long quotation.
</div>
</div>
</div>
<div class="block">
<div class="img-wrap">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div class="texts">
<h6 class="tiny-title">小标题</h6>
<p style="text-indent: 2em">S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键
</p>
</div>
</div>
</div>
`
},
{ title: '图片描述', description: '', content: `
<div class="tiny-wrap">
<div class="block">
<div class="img-wrap">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
</div>
</div>
`
}
],
templates: [],
// content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js",
// extended_valid_elements:'script[src]',
//

@ -1042,7 +1042,8 @@ export default {
!fromBack ? this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
type: "success",
confirmButtonText: "马上设置",
cancelButtonText: "稍后操作"
cancelButtonText: "稍后操作",
closeOnClickModal: false
}).then(() => {
this.$router.push(`/contentSettings?cid=${res.cid}`);
}).catch(() => {
@ -1064,7 +1065,8 @@ export default {
//
if ((id && updateTime > 2) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.saveAdd(1)
}).catch(() => {

@ -462,7 +462,8 @@ export default {
//
if (this.moved) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.saveSort()
this.moved = false

@ -1331,7 +1331,8 @@ export default {
//
if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.saveAdd(i)
}).catch(() => {

@ -204,7 +204,8 @@ export default {
},
goback () {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
type: "warning",
closeOnClickModal: false
})
.then(() => {
this.back();

@ -1,220 +1,257 @@
<template>
<div>
<div class="page">
<div class="btn-wrap">
<template v-if="sorting">
<el-button class="action-btn" type="primary" round @click="cancelSort">取消</el-button>
<el-button class="action-btn" type="primary" round @click="sortSubmit">保存</el-button>
</template>
<template v-if="!sorting">
<el-button v-auth="'栏目管理:更改排序'" class="action-btn" type="primary" round @click="openSort">更改排序
</el-button>
<el-button v-auth="'栏目管理:添加栏目'" class="action-btn" type="primary" round @click="handleColumn(false, 0, 0)">添加栏目
</el-button>
</template>
<div>
<div class="page">
<div class="btn-wrap">
<template v-if="sorting">
<el-button class="action-btn"
type="primary"
round
@click="cancelSort">取消</el-button>
<el-button class="action-btn"
type="primary"
round
@click="sortSubmit">保存</el-button>
</template>
<template v-if="!sorting">
<el-button v-auth="'栏目管理:更改排序'"
class="action-btn"
type="primary"
round
@click="openSort">更改排序
</el-button>
<el-button v-auth="'栏目管理:添加栏目'"
class="action-btn"
type="primary"
round
@click="handleColumn(false, 0, 0)">添加栏目
</el-button>
</template>
</div>
<div class="page-content"
style="padding-top: 24px; margin-top: 24px">
<div class="el-table">
<div class="list">
<div class="thead">
<span>栏目名称</span>
<span><em :class="{hide: sorting}"
style="font-style: normal">操作</em></span>
</div>
<div class="page-content" style="padding-top: 24px; margin-top: 24px">
<div class="el-table">
<div class="list">
<div class="thead">
<span>栏目名称</span>
<span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span>
</div>
</div>
<el-tree :data="list" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span>
<span class="action" v-show="!sorting">
<el-button v-auth="'栏目管理:编辑'" type="text" @click.stop="handleColumn(data)">编辑</el-button>
<el-divider v-auth="'栏目管理:编辑'" direction="vertical"></el-divider>
<template v-if="node.level < 4">
<el-button v-auth="'栏目管理:新增'" type="text" @click.stop="handleColumn(data, data.id, data.level + 1)">新增</el-button>
<el-divider v-auth="'栏目管理:新增'" direction="vertical"></el-divider>
</template>
<el-button v-auth="'栏目管理:删除'" type="text" @click.stop="delData(data)">删除</el-button>
</span>
</span>
</el-tree>
</div>
</div>
</div>
<el-dialog :title="!curRow.id ? '添加栏目' : '编辑栏目'" :visible.sync="columnVisible" width="400px"
:close-on-click-modal="false" @close="closeColumn">
<el-form>
<el-form-item>
<el-input placeholder="栏目名称" v-model="curRow.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="columnVisible = false"> </el-button>
<el-button type="primary" @click="columnSubmit"> </el-button>
</div>
<el-tree :data="list"
node-key="id"
default-expand-all
:draggable="sorting"
:allow-drop="allowDrop">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span>
<span class="action"
v-show="!sorting">
<el-button v-auth="'栏目管理:编辑'"
type="text"
@click.stop="handleColumn(data)">编辑</el-button>
<el-divider v-auth="'栏目管理:编辑'"
direction="vertical"></el-divider>
<template v-if="node.level < 4">
<el-button v-auth="'栏目管理:新增'"
type="text"
@click.stop="handleColumn(data, data.id, data.level + 1)">新增</el-button>
<el-divider v-auth="'栏目管理:新增'"
direction="vertical"></el-divider>
</template>
<el-button v-auth="'栏目管理:删除'"
type="text"
@click.stop="delData(data)">删除</el-button>
</span>
</span>
</el-dialog>
</el-tree>
</div>
</div>
</div>
<el-dialog :title="!curRow.id ? '添加栏目' : '编辑栏目'"
:visible.sync="columnVisible"
width="400px"
:close-on-click-modal="false"
@close="closeColumn">
<el-form>
<el-form-item>
<el-input placeholder="栏目名称"
v-model="curRow.name"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button @click="columnVisible = false"> </el-button>
<el-button type="primary"
@click="columnSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from '@/setting'
export default {
name: "columnManage",
data() {
return {
activeName: "first",
tabs: {
first: "栏目管理"
},
name: this.$store.state.name,
originList: [],
list: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
total: 0,
columnVisible: false,
curRow: {},
sortObj: null,
sorting: false,
parentId: '',
isAddType: false,
defaultProps: {
label: "name"
},
level: 0
};
name: "columnManage",
data () {
return {
activeName: "first",
tabs: {
first: "栏目管理"
},
name: this.$store.state.name,
originList: [],
list: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
total: 0,
columnVisible: false,
curRow: {},
sortObj: null,
sorting: false,
parentId: '',
isAddType: false,
defaultProps: {
label: "name"
},
level: 0
};
},
mounted () {
this.getData();
},
beforeRouteLeave (to, from, next) {
if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) {
this.$confirm("确定返回?排序尚未保存。", "提示", {
type: "warning",
closeOnClickModal: false
})
.then(() => {
next();
})
.catch(() => {
});
} else {
next();
}
},
methods: {
getData () {
this.$get(this.api.queryAllColumns, {
school: 0
}).then(({ columnTree }) => {
this.list = columnTree
this.originList = JSON.parse(JSON.stringify(this.list));
this.total = columnTree.length
}).catch(res => {
});
},
mounted() {
this.getData();
delData (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
beforeRouteLeave(to, from, next) {
if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) {
this.$confirm("确定返回?排序尚未保存。", "提示", {
type: "warning"
})
.then(() => {
next();
})
.catch(() => {
});
} else {
next();
handleColumn (row, parentId, level) {
this.columnVisible = true
if (row) {
this.curRow = JSON.parse(JSON.stringify(row))
}
if (typeof parentId === 'number') {
this.curRow = {
parentId,
level,
name: '',
platformId: Setting.platformId
}
}
},
methods: {
getData() {
this.$get(this.api.queryAllColumns, {
school: 0
}).then(({ columnTree }) => {
this.list = columnTree
this.originList = JSON.parse(JSON.stringify(this.list));
this.total = columnTree.length
}).catch(res => {
});
},
delData(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
handleColumn(row, parentId, level) {
this.columnVisible = true
if (row) {
this.curRow = JSON.parse(JSON.stringify(row))
}
if (typeof parentId === 'number') {
this.curRow = {
parentId,
level,
name: '',
platformId: Setting.platformId
}
}
},
// list
handleList(data, parent = {}) {
data.map((n, i) => {
n.parentId = parent.id || 0
n.level = this.level
n.sort = i
if (n.children.length) {
this.level++
this.handleList(n.children, n)
} else {
this.level = 0
}
})
},
sortSubmit() {
this.level = 0
let list = JSON.parse(JSON.stringify(this.list))
this.handleList(list)
this.$post(this.api.columnReorder, {
columnTree: list
}).then(res => {
util.successMsg("保存成功");
this.sorting = false;
this.getData();
}).catch(res => {
});
},
columnSubmit() {
const row = this.curRow
if (!row.name) return util.warningMsg("请填写栏目名称");
if (this.curRow.id) {
this.$put(this.api.editColumn, row).then(res => {
util.successMsg("修改成功");
this.columnVisible = false;
this.getData();
}).catch(res => {
});
} else {
this.$post(this.api.addColumn, row).then(res => {
util.successMsg("添加成功");
this.columnVisible = false;
this.getData();
}).catch(res => {
});
}
},
cancelSort() {
this.sorting = false;
this.list = JSON.parse(JSON.stringify(this.originList));
this.sortObj.destroy();
},
openSort() {
this.sorting = true;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
closeColumn() {
this.curRow = {}
},
allowDrop(draggingNode, dropNode, type) {
console.log("🚀 ~ file: index.vue ~ line 207 ~ allowDrop ~ draggingNode, dropNode, type", draggingNode, dropNode.level, type)
if (dropNode.level == 4 && draggingNode.childNodes.length == 0) {
return type !== "inner";
} else if ((draggingNode.childNodes.length > 0 && dropNode.level == 4) || (draggingNode.childNodes.length > 0 && type == "inner")) {
return false;
} else {
return true;
}
// list
handleList (data, parent = {}) {
data.map((n, i) => {
n.parentId = parent.id || 0
n.level = this.level
n.sort = i
if (n.children.length) {
this.level++
this.handleList(n.children, n)
} else {
this.level = 0
}
})
},
sortSubmit () {
this.level = 0
let list = JSON.parse(JSON.stringify(this.list))
this.handleList(list)
this.$post(this.api.columnReorder, {
columnTree: list
}).then(res => {
util.successMsg("保存成功");
this.sorting = false;
this.getData();
}).catch(res => {
});
},
columnSubmit () {
const row = this.curRow
if (!row.name) return util.warningMsg("请填写栏目名称");
if (this.curRow.id) {
this.$put(this.api.editColumn, row).then(res => {
util.successMsg("修改成功");
this.columnVisible = false;
this.getData();
}).catch(res => {
});
} else {
this.$post(this.api.addColumn, row).then(res => {
util.successMsg("添加成功");
this.columnVisible = false;
this.getData();
}).catch(res => {
});
}
},
cancelSort () {
this.sorting = false;
this.list = JSON.parse(JSON.stringify(this.originList));
this.sortObj.destroy();
},
openSort () {
this.sorting = true;
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
handleCurrentChange (val) {
this.pageNo = val;
this.getData();
},
closeColumn () {
this.curRow = {}
},
allowDrop (draggingNode, dropNode, type) {
console.log("🚀 ~ file: index.vue ~ line 207 ~ allowDrop ~ draggingNode, dropNode, type", draggingNode, dropNode.level, type)
if (dropNode.level == 4 && draggingNode.childNodes.length == 0) {
return type !== "inner";
} else if ((draggingNode.childNodes.length > 0 && dropNode.level == 4) || (draggingNode.childNodes.length > 0 && type == "inner")) {
return false;
} else {
return true;
}
}
}
};
</script>
@ -242,7 +279,7 @@ export default {
&:first-child {
padding-left: 23.5vw;
@media(max-width: 1270px) {
@media (max-width: 1270px) {
padding-left: 25.5%;
}
}
@ -257,14 +294,14 @@ export default {
/deep/ .el-tree {
.el-tree-node__expand-icon {
margin-left: 22.5vw;
@media(max-width: 1270px) {
@media (max-width: 1270px) {
margin-left: 23.5%;
}
}
.el-tree-node__content {
padding: 5px;
border-bottom: 0.0625rem solid #EBEEF5;
border-bottom: 0.0625rem solid #ebeef5;
}
}
@ -283,7 +320,7 @@ export default {
.action {
width: 8.5vw;
text-align: left;
@media(max-width: 1270px) {
@media (max-width: 1270px) {
width: 16%;
}
}

@ -2,10 +2,19 @@
<!-- 内容管理 -->
<div class="flex">
<div class="menu-con">
<el-tree ref="column" :data="menuList" :props="{ label: 'name' }" highlight-current :expand-on-click-node="false" default-expand-all node-key="id" @node-click="handleSelect"></el-tree>
<el-tree ref="column"
:data="menuList"
:props="{ label: 'name' }"
highlight-current
:expand-on-click-node="false"
default-expand-all
node-key="id"
@node-click="handleSelect"></el-tree>
</div>
<div class="right">
<ContentList ref="content" v-show="menuList.length" :columnId="columnId" />
<ContentList ref="content"
v-show="menuList.length"
:columnId="columnId" />
</div>
</div>
</template>
@ -15,92 +24,93 @@ import menuTree from '@/components/menuTree'
import ContentList from "./contentList";
import Setting from '@/setting'
export default {
name: "contentManage",
components: {
menuTree,
ContentList
},
data() {
return {
menuList: [],
activeName: this.$store.state.columnId,
columnId: "",
ids: [],
curId: ''
};
},
mounted() {
this.getMenuData();
},
methods: {
getMenuData() {
this.$get(this.api.queryAllColumns, {
school: 0
}).then(res => {
this.menuList = res.columnTree
const storeId = this.$store.state.columnId
if (this.menuList.length) {
this.getId(this.menuList)
this.columnId = this.menuList[0].id
if (!storeId) {
this.$store.commit('setColumnId', this.columnId)
} else {
this.columnId = storeId
}
}
this.$nextTick(() => {
this.$refs.column.setCurrentKey(this.columnId)
})
}).catch(err => {
});
},
// id便
getId(data) {
data.map(e => {
this.ids.push(e.id)
e.children.length && this.getId(e.children)
})
},
setColumnId(id) {
this.columnId = id
this.$store.commit('setColumnId', id)
},
handleSelect(key) {
const { content } = this.$refs
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
this.setColumnId(key.id)
}).catch(() => {
this.setColumnId(key.id)
})
name: "contentManage",
components: {
menuTree,
ContentList
},
data () {
return {
menuList: [],
activeName: this.$store.state.columnId,
columnId: "",
ids: [],
curId: ''
};
},
mounted () {
this.getMenuData();
},
methods: {
getMenuData () {
this.$get(this.api.queryAllColumns, {
school: 0
}).then(res => {
this.menuList = res.columnTree
const storeId = this.$store.state.columnId
if (this.menuList.length) {
this.getId(this.menuList)
this.columnId = this.menuList[0].id
if (!storeId) {
this.$store.commit('setColumnId', this.columnId)
} else {
this.setColumnId(key.id)
this.columnId = storeId
}
}
this.$nextTick(() => {
this.$refs.column.setCurrentKey(this.columnId)
})
}).catch(err => {
});
},
// id便
getId (data) {
data.map(e => {
this.ids.push(e.id)
e.children.length && this.getId(e.children)
})
},
setColumnId (id) {
this.columnId = id
this.$store.commit('setColumnId', id)
},
handleSelect (key) {
const { content } = this.$refs
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning',
closeOnClickModal: false
}).then(() => {
content.sortSubmit()
this.setColumnId(key.id)
}).catch(() => {
this.setColumnId(key.id)
})
} else {
this.setColumnId(key.id)
}
}
}
};
</script>
<style lang="scss" scoped>
.menu-con {
width: 210px;
height: calc(100vh - 250px);
border-right: solid 1px #e6e6e6;
background-color: #F2F6FC;
/deep/.el-tree-node__content {
height: 50px;
}
width: 210px;
height: calc(100vh - 250px);
border-right: solid 1px #e6e6e6;
background-color: #f2f6fc;
/deep/.el-tree-node__content {
height: 50px;
}
}
.right {
flex: 1;
flex: 1;
}
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
color: #fff;
background-color: #9278ff;
color: #fff;
background-color: #9278ff;
}
</style>

@ -1,90 +1,98 @@
<template>
<!-- 资讯管理 -->
<div class="page">
<ul class="column-tab">
<li :class="{active: tabsName == 1}" @click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li>
<li :class="{active: tabsName == 2}" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
</ul>
<columnManage class="flex-1" ref="content1" v-if="tabsName == 1" />
<ContentManage class="flex-1" ref="content2" v-if="tabsName == 2" />
</div>
<!-- 资讯管理 -->
<div class="page">
<ul class="column-tab">
<li :class="{active: tabsName == 1}"
@click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li>
<li :class="{active: tabsName == 2}"
@click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
</ul>
<columnManage class="flex-1"
ref="content1"
v-if="tabsName == 1" />
<ContentManage class="flex-1"
ref="content2"
v-if="tabsName == 2" />
</div>
</template>
<script>
import ColumnManage from "../columnManage";
import ContentManage from "../contentManage";
export default {
components: {
ColumnManage,
ContentManage
components: {
ColumnManage,
ContentManage
},
data () {
return {
tabsName: this.$store.state.tabId
};
},
//
beforeRouteLeave (to, from, next) {
this.routeLeave(next, true)
},
methods: {
switchTab (id) {
this.tabsName = id
this.$store.commit('setInfoTab', id)
this.$store.commit('setColumnId', '')
},
data() {
return {
tabsName: this.$store.state.tabId
};
//
routeLeave (fn, param) {
const tab = this.tabsName
let content = this.$refs['content' + tab]
if (tab == 2) content = content.$refs.content
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
type: 'warning',
closeOnClickModal: false
}).then(() => {
content.sortSubmit()
fn(param)
}).catch(() => {
fn(param)
})
} else {
fn(param)
}
},
//
beforeRouteLeave(to, from, next) {
this.routeLeave(next, true)
},
methods: {
switchTab(id) {
this.tabsName = id
this.$store.commit('setInfoTab', id)
this.$store.commit('setColumnId', '')
},
//
routeLeave(fn, param) {
const tab = this.tabsName
let content = this.$refs['content' + tab]
if (tab == 2) content = content.$refs.content
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
fn(param)
}).catch(() => {
fn(param)
})
} else {
fn(param)
}
},
// tab
handleClick(id) {
this.routeLeave(this.switchTab, id)
}
},
mounted() {
// tab
handleClick (id) {
this.routeLeave(this.switchTab, id)
}
},
mounted () {
}
};
</script>
<style lang="scss" scoped>
.flex-1 {
flex: 1;
flex: 1;
}
.page {
display: flex;
display: flex;
}
.column-tab {
width: 120px;
border-right: solid 1px #e6e6e6;
li {
display: flex;
align-items: center;
height: 60px;
cursor: pointer;
i {
margin-right: 5px;
}
&:hover, &.active {
color: #9278FF;
width: 120px;
border-right: solid 1px #e6e6e6;
li {
display: flex;
align-items: center;
height: 60px;
cursor: pointer;
i {
margin-right: 5px;
}
&:hover,
&.active {
color: #9278ff;
}
}
}
}
</style>

@ -165,7 +165,8 @@ export default {
const { updateTime } = this.$refs['step' + this.step]
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.save(0, 1)
}).catch(() => {
@ -208,7 +209,8 @@ export default {
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.save(0, 3)
}).catch(() => {
@ -226,7 +228,8 @@ export default {
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.save(0)
}).catch(() => {

@ -679,7 +679,7 @@ export default {
this.$parent.showLoad()
delete form.publishStatus
if (status === 1) form.publishStatus = 1
form.ztOpen = status ? 0 : 1 //
form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) //
form.releaseType = releaseType
form.id = this.$route.query.id
if (form.id) {

@ -91,7 +91,8 @@ export default {
const step = detail.$refs['step' + detail.step]
if (detail.step < 4 && step && step.updateTime) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
detail.save(1, 1)
this.backOrTab(i)

@ -1,223 +1,260 @@
<template>
<!-- 竞赛进展 -->
<div class="page-content" style="padding: 24px">
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="标题">
<template slot-scope="scope">
<el-input placeholder="请输入标题" :disabled="!scope.row.operate" v-model="scope.row.title"></el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="详情描述">
<template slot-scope="scope">
<el-input placeholder="请输入详情描述" :disabled="!scope.row.operate" type="textarea" v-model="scope.row.description"></el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="状态" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.status" :disabled="!scope.row.operate" clearable placeholder="请选择状态">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-if="!scope.row.operate" type="text" @click="operateIt(scope.row)" v-auth="'/match:管理:竞赛进展:编辑'">编辑</el-button>
<el-button v-else type="text" @click="saveData(scope.row)">保存</el-button>
<el-button type="text" @click="handleDelete(scope.row, scope.$index)" v-auth="'/match:管理:竞赛进展:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="plus" @click="addData" v-auth="'/match:管理:竞赛进展:新增'">
<i class="el-icon-circle-plus-outline"></i>
</div>
<!-- 竞赛进展 -->
<div class="page-content"
style="padding: 24px">
<el-table ref="table"
:data="listData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name"
label="标题">
<template slot-scope="scope">
<el-input placeholder="请输入标题"
:disabled="!scope.row.operate"
v-model="scope.row.title"></el-input>
</template>
</el-table-column>
<el-table-column prop="name"
label="详情描述">
<template slot-scope="scope">
<el-input placeholder="请输入详情描述"
:disabled="!scope.row.operate"
type="textarea"
v-model="scope.row.description"></el-input>
</template>
</el-table-column>
<el-table-column prop="name"
label="状态"
width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.status"
:disabled="!scope.row.operate"
clearable
placeholder="请选择状态">
<el-option v-for="(item,index) in statusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="170">
<template slot-scope="scope">
<el-button v-if="!scope.row.operate"
type="text"
@click="operateIt(scope.row)"
v-auth="'/match:管理:竞赛进展:编辑'">编辑</el-button>
<el-button v-else
type="text"
@click="saveData(scope.row)">保存</el-button>
<el-button type="text"
@click="handleDelete(scope.row, scope.$index)"
v-auth="'/match:管理:竞赛进展:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="plus"
@click="addData"
v-auth="'/match:管理:竞赛进展:新增'">
<i class="el-icon-circle-plus-outline"></i>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
export default {
name: "matchProgress",
data() {
return {
save: false,
id: this.$route.query.id,
statusList: [
{
value: 0,
name: "未完成"
},
{
value: 1,
name: "进行中"
},
{
value: 2,
name: "已完成"
}
],
listData: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0,
touchTime:0,
timeOut: {}
};
},
mounted() {
this.getData();
},
methods: {
operateIt(row) {
row.operate = true
},
getData() {
this.$get(this.api.getCompetitionProgress, {
competitionId: this.id
}).then(res => {
this.listData = res.competitionProgressList;
for(let index=0; index<this.listData.length; index++) {
//
this.$set(this.listData, index, { operate: false, ...this.listData[index]})
}
}).catch(res => {
});
},
saveData(row) {
//
let data = row;
if (data.title.length) {
if (row.id) {
this.$put(this.api.editCompetitionProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("修改成功");
this.getData();
}).catch(res => {
});
} else {
this.$post(this.api.addCompetitionProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("创建成功");
this.getData();
}).catch(res => {
});
}
} else {
util.warningMsg("请填写标题");
}
name: "matchProgress",
data () {
return {
save: false,
id: this.$route.query.id,
statusList: [
{
value: 0,
name: "未完成"
},
handleSelectionChange(val) {
this.multipleSelection = val;
{
value: 1,
name: "进行中"
},
onSearch() {
this.pageNo = 1;
{
value: 2,
name: "已完成"
}
],
listData: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0,
touchTime: 0,
timeOut: {}
};
},
mounted () {
this.getData();
},
methods: {
operateIt (row) {
row.operate = true
},
getData () {
this.$get(this.api.getCompetitionProgress, {
competitionId: this.id
}).then(res => {
this.listData = res.competitionProgressList;
for (let index = 0; index < this.listData.length; index++) {
//
this.$set(this.listData, index, { operate: false, ...this.listData[index] })
}
}).catch(res => {
});
},
saveData (row) {
//
let data = row;
if (data.title.length) {
if (row.id) {
this.$put(this.api.editCompetitionProgress, data).then(res => {
this.touchTime = this.touchTime - 1
util.successMsg("修改成功");
this.getData();
},
handleCurrentChange(val) {
this.pageNo = val;
}).catch(res => {
});
} else {
this.$post(this.api.addCompetitionProgress, data).then(res => {
this.touchTime = this.touchTime - 1
util.successMsg("创建成功");
this.getData();
},
handleDelete(row, index) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
}).then(() => {
if(row.id === "") {
this.listData.splice(index, 1)
util.successMsg("删除成功");
}else {
this.touchTime = this.touchTime+1
this.$del(`${this.api.deleteCompetitionProgress}?competitionProgressId=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}
}).catch(() => {
});
},
addData() {
// this.$store.commit("match/setWait", 1);
this.touchTime = this.touchTime+1
if (this.listData.length) {
if (this.listData[this.listData.length - 1].id) {
this.listData.push({
competitionId: this.id,
id: "",
title: "",
description: "",
status: 0,
operate: true
});
this.operateIt(this.listData[this.listData.length - 1])
} else {
util.warningMsg("请先保存新数据");
}
} else {
this.listData.push({
competitionId: this.id,
id: "",
title: "",
description: "",
status: 1, // status1
operate: true
});
}
},
waitSave() {
if(this.hasEdit) {
this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let num = 0;
for(var i=0;i<this.listData.length;i++){
let data = this.listData[i];
if (data.title) {
if (this.listData[i].id) {
this.$put(this.api.editContestProgress, data).then(res => {
}).catch(res => {
});
}else{
num = num+1
}
}else{
num = num+1
}
}
if (num >0){
this.$message({
type: 'error',
message: '保存失败,有未填项目'
});
}else{
this.$message({
type: 'success',
message: '保存成功!'
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
});
});
}
}).catch(res => {
});
}
} else {
util.warningMsg("请填写标题");
}
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
onSearch () {
this.pageNo = 1;
this.getData();
},
handleCurrentChange (val) {
this.pageNo = val;
this.getData();
},
handleDelete (row, index) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
}).then(() => {
if (row.id === "") {
this.listData.splice(index, 1)
util.successMsg("删除成功");
} else {
this.touchTime = this.touchTime + 1
this.$del(`${this.api.deleteCompetitionProgress}?competitionProgressId=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}
}).catch(() => {
});
},
computed: {
hasEdit() {
return this.listData.some(item => item.operate)
addData () {
// this.$store.commit("match/setWait", 1);
this.touchTime = this.touchTime + 1
if (this.listData.length) {
if (this.listData[this.listData.length - 1].id) {
this.listData.push({
competitionId: this.id,
id: "",
title: "",
description: "",
status: 0,
operate: true
});
this.operateIt(this.listData[this.listData.length - 1])
} else {
util.warningMsg("请先保存新数据");
}
} else {
this.listData.push({
competitionId: this.id,
id: "",
title: "",
description: "",
status: 1, // status1
operate: true
});
}
},
waitSave () {
if (this.hasEdit) {
this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
let num = 0;
for (var i = 0; i < this.listData.length; i++) {
let data = this.listData[i];
if (data.title) {
if (this.listData[i].id) {
this.$put(this.api.editContestProgress, data).then(res => {
}).catch(res => {
});
} else {
num = num + 1
}
} else {
num = num + 1
}
}
if (num > 0) {
this.$message({
type: 'error',
message: '保存失败,有未填项目'
});
} else {
this.$message({
type: 'success',
message: '保存成功!'
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
});
});
}
}
},
computed: {
hasEdit () {
return this.listData.some(item => item.operate)
}
}
};
</script>

@ -605,7 +605,8 @@ export default {
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
whetherToPublish ?
this.$confirm('排名已经发布,是否直接覆盖?', '提示', {
type: 'success'
type: 'success',
closeOnClickModal: false
}).then(() => {
this.publishSubmit()
}).catch(() => { }) :

@ -1,48 +1,74 @@
<template>
<!-- 报名人员 -->
<div class="page-content" style="padding: 24px">
<div class="tool" style="justify-content: flex-end">
<el-button type="primary" round @click="add" v-auth="'/match:管理:公告通知:新增'">新增</el-button>
</div>
<!-- 报名人员 -->
<div class="page-content"
style="padding: 24px">
<div class="tool"
style="justify-content: flex-end">
<el-button type="primary"
round
@click="add"
v-auth="'/match:管理:公告通知:新增'">新增</el-button>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="announcementTitle" label="标题名称">
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
</el-table-column>
<el-table-column prop="updateTime" label="发布时间">
</el-table-column>
<el-table-column prop="phone" label="状态">
<template slot-scope="scope">
{{ scope.row.status ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth="'/match:管理:公告通知:编辑'">编辑</el-button>
<el-button type="text" @click="del(scope.row)" v-auth="'/match:管理:公告通知:删除'">删除</el-button>
<el-switch
v-auth="'/match:管理:公告通知:启用'"
v-model="scope.row.isOpen"
:active-text="scope.row.isOpen ? '关' : '开'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
<el-table ref="table"
:data="listData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="announcementTitle"
label="标题名称">
</el-table-column>
<el-table-column prop="createTime"
label="创建时间">
</el-table-column>
<el-table-column prop="updateTime"
label="发布时间">
</el-table-column>
<el-table-column prop="phone"
label="状态">
<template slot-scope="scope">
{{ scope.row.status ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="250">
<template slot-scope="scope">
<el-button type="text"
@click="edit(scope.row)"
v-auth="'/match:管理:公告通知:编辑'">编辑</el-button>
<el-button type="text"
@click="del(scope.row)"
v-auth="'/match:管理:公告通知:删除'">删除</el-button>
<el-switch v-auth="'/match:管理:公告通知:启用'"
v-model="scope.row.isOpen"
:active-text="scope.row.isOpen ? '关' : '开'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="totals"
@current-change="handleCurrentChange"
:current-page="pageNo">
</el-pagination>
</div>
</div>
</template>
<script>
@ -50,91 +76,91 @@ import util from "@/libs/util";
import Setting from "@/setting";
export default {
name: "matchSignup",
data() {
return {
token: util.local.get(Setting.tokenKey),
id: this.$route.query.id,
keyword: "",
listData: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0
};
name: "matchSignup",
data () {
return {
token: util.local.get(Setting.tokenKey),
id: this.$route.query.id,
keyword: "",
listData: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
},
mounted () {
this.getData()
},
methods: {
getData () {
this.$post(`${this.api.queryAnnouncementByCompetitionId}?pageNum=${this.pageNo}&pageSize=${this.pageSize}&competitionId=${this.id}`).then(({ data }) => {
this.listData = data.records
this.totals = data.total
this.$refs.table.clearSelection()
}).catch(res => { })
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
handleSelectionChange (val) {
this.multipleSelection = val;
},
mounted() {
this.getData()
handleCurrentChange (val) {
this.pageNo = val;
this.getData();
},
methods: {
getData() {
this.$post(`${this.api.queryAnnouncementByCompetitionId}?pageNum=${this.pageNo}&pageSize=${this.pageSize}&competitionId=${this.id}`).then(({ data }) => {
this.listData = data.records
this.totals = data.total
this.$refs.table.clearSelection()
}).catch(res => {})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
del (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.deleteAnnouncement}?id=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
},
del(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.deleteAnnouncement}?id=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
},
switchOff(val, row, index) {
if (val) {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {}).catch(err => {})
} else if (!row.status) {
this.$confirm('是否发布该公告?', '提示', {
type: 'success'
}).then(() => {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {
this.$post(this.api.amendmentAnnouncement, {
id: row.id,
status: 1
}).then(res => {
this.getData()
}).catch(err => {})
}).catch(err => {})
}).catch(() => {
row.isOpen = 1
})
} else {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {}).catch(err => {})
}
},
add() {
this.$router.push(`/noticeDetail?competitionId=${this.id}`)
},
edit(row) {
this.$router.push(`/noticeDetail?id=${row.id}&competitionId=${this.id}`)
}
}).catch(res => {
});
})
.catch(() => {
});
},
switchOff (val, row, index) {
if (val) {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => { }).catch(err => { })
} else if (!row.status) {
this.$confirm('是否发布该公告?', '提示', {
type: 'success',
closeOnClickModal: false
}).then(() => {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {
this.$post(this.api.amendmentAnnouncement, {
id: row.id,
status: 1
}).then(res => {
this.getData()
}).catch(err => { })
}).catch(err => { })
}).catch(() => {
row.isOpen = 1
})
} else {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => { }).catch(err => { })
}
},
add () {
this.$router.push(`/noticeDetail?competitionId=${this.id}`)
},
edit (row) {
this.$router.push(`/noticeDetail?id=${row.id}&competitionId=${this.id}`)
}
}
};
</script>
<style scoped>
</style>

@ -376,11 +376,11 @@ export default {
//
if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.submit(this.form.isRelease, next)
}).catch(() => {
console.log(55)
next()
})
} else {
@ -473,7 +473,8 @@ export default {
const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
list.map(e => {
e.edit && e.classificationName && this.submitClass(e, 0)
@ -548,7 +549,8 @@ export default {
const list = this.labels
if (list.find(e => e.edit && e.labelName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
list.map(e => {
e.edit && e.labelName && this.submitLabel(e, 0)
@ -664,7 +666,8 @@ export default {
//
if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.submit(this.form.isRelease)
}).catch(() => {

@ -355,7 +355,8 @@ export default {
//
if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.submit(this.form.isRelease, next)
}).catch(() => {
@ -450,7 +451,8 @@ export default {
const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
list.map(e => {
e.edit && e.classificationName && this.submitClass(e, 0)
@ -578,7 +580,8 @@ export default {
//
if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.submit(this.form.isRelease)
}).catch(() => {

@ -99,7 +99,7 @@
<template slot-scope="scope">
<el-button type="text"
@click="toBackstage(scope.row)"
v-if="scope.row.systemId !== '11'"
v-if="scope.row.systemId !== '11' && scope.row.systemId !== '12'"
v-auth="'/configure:系统后台进入'">进入</el-button>
</template>
</el-table-column>

@ -194,7 +194,8 @@ export default {
//
if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.submit(this.postStatus ? 1 : 0, 1)
this.backPage()

@ -870,7 +870,8 @@ export default {
//
if (this.updateTime) {
this.$confirm('编辑的内容未保存,是否保存?', "提示", {
type: "warning"
type: "warning",
closeOnClickModal: false
}).then(() => {
this.handleSubmit(this.projectManage.state)
}).catch(() => {

@ -1,121 +1,132 @@
<template>
<div class="wrap">
<div class="left">
<div class="inner">
<div class="text-center">
<img :src="$store.state.avatar" class="avatar" />
<el-upload :headers="{token}" :action="this.api.updateUserAvatars" name="file" :limit="10" :show-file-list="false" :on-success="changeAvatar">
<el-button type="text" size="small">点击更换头像</el-button>
</el-upload>
</div>
<ul class="menu">
<li v-for="item in typeList" :key="item.index" :class="{active: item.index == active}">
{{ item.title }}
</li>
</ul>
</div>
</div>
<div class="right">
<info ref="info" @updateStatus="updateStatus"></info>
<div class="wrap">
<div class="left">
<div class="inner">
<div class="text-center">
<img :src="$store.state.avatar"
class="avatar" />
<el-upload :headers="{token}"
:action="this.api.updateUserAvatars"
name="file"
:limit="10"
:show-file-list="false"
:on-success="changeAvatar">
<el-button type="text"
size="small">点击更换头像</el-button>
</el-upload>
</div>
<ul class="menu">
<li v-for="item in typeList"
:key="item.index"
:class="{active: item.index == active}">
{{ item.title }}
</li>
</ul>
</div>
</div>
<div class="right">
<info ref="info"
@updateStatus="updateStatus"></info>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import { mapState,mapMutations } from 'vuex'
import { mapState, mapMutations } from 'vuex'
import info from './info'
import util from '@/libs/util'
export default {
data() {
return {
token: sessionStorage.getItem('token'),
typeList: [
{
index: '1',
title: '用户信息'
}
],
active: '1',
edited: false
};
},
components: { info },
computed: {
...mapState('user', [
'avatar'
]),
},
// ,
beforeRouteLeave(to, from, next) {
if(this.edited){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.$refs.info.save()
next(false)
}).catch(() => {
next(false)
})
}else{
next()
data () {
return {
token: sessionStorage.getItem('token'),
typeList: [
{
index: '1',
title: '用户信息'
}
],
active: '1',
edited: false
};
},
components: { info },
computed: {
...mapState('user', [
'avatar'
]),
},
// ,
beforeRouteLeave (to, from, next) {
if (this.edited) {
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.$refs.info.save()
next(false)
}).catch(() => {
next(false)
})
} else {
next()
}
},
mounted () {
},
methods: {
changeAvatar (res) {
this.$store.commit('userAvatar', {
avatar: res.message
})
},
mounted() {
},
methods: {
changeAvatar(res) {
this.$store.commit('userAvatar', {
avatar: res.message
})
},
updateStatus(status){
this.edited = status
}
updateStatus (status) {
this.edited = status
}
}
};
</script>
<style lang="scss" scoped>
.wrap{
.wrap {
display: flex;
width: 1280px;
margin: 0 auto;
background-color: #f3f6fa;
.text-center {
text-align: center;
text-align: center;
}
.left{
.left {
margin-right: 12px;
background-color: #fff;
box-shadow: 2px 0px 6px 0px #EEEEEE;
.inner{
box-shadow: 2px 0px 6px 0px #eeeeee;
.inner {
width: 170px;
padding: 20px 0;
}
.avatar{
.avatar {
width: 80px;
height: 80px;
border-radius: 50%;
}
.menu{
.menu {
margin-top: 32px;
li{
li {
padding: 0 20px;
color: #303133;
font-size: 14px;
line-height: 38px;
cursor: pointer;
&.active{
&.active {
color: #fff;
background-color: #9278ff;
}
}
}
}
.right{
.right {
flex: 1;
}
}

@ -545,7 +545,8 @@ export default {
//
unbind() {
this.$confirm('确定要解绑该手机号吗?', '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.$get(this.api.unbindMobilePhone).then(res => {
this.$message.success('解绑成功')

@ -890,7 +890,8 @@ export default {
//
if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.submit(this.form.state, next)
}).catch(() => {
@ -1188,7 +1189,8 @@ export default {
const list = this.labels
if (list.find(e => e.edit && e.tagsName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
list.map(e => {
e.edit && e.tagsName && this.submitLabel(e, 0)
@ -1287,7 +1289,8 @@ export default {
const list = this.classifications
if (list.find(e => e.edit && e.typeName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
list.map(e => {
e.edit && e.typeName && this.submitClass(e, 0)
@ -1584,6 +1587,7 @@ export default {
type: 'warning',
confirmButtonText: '是',
cancelButtonText: '否',
closeOnClickModal: false
}).then(() => {
this.submit(this.form.mall.state)
}).catch(() => {

@ -16,7 +16,7 @@
<div v-if="active == 'task'">
<p class="tips">账号admin;密码huoran@2023</p>
<iframe class="frame"
:src="isPro ? 'https://huorantech.cn/xxl-job-admin/' : 'http://121.37.12.51:8001/xxl-job-admin/'"
:src="isPro ? 'https://xxl.huorantech.cn/xxl-job-admin/' : 'http://121.37.12.51:8001/xxl-job-admin/'"
frameborder="0"></iframe>
</div>
<taskLog v-if="active == 'taskLog'"></taskLog>

@ -152,7 +152,8 @@ export default {
add () {
if (this.listData.find(e => e.draft)) {
this.$confirm("当前有未发布的版本,是否要新增版本?", "提示", {
type: "warning"
type: "warning",
closeOnClickModal: false
}).then(() => {
this.$router.push(`/addLog?platformId=${this.platformId}`)
}).catch(() => { })
@ -201,7 +202,8 @@ export default {
const logId = row.logId
if (row.draft && !val) {
this.$confirm('是否要发布该日志?', '提示', {
type: 'success'
type: 'success',
closeOnClickModal: false
}).then(() => {
this.changeStatus(logId, val, 0)
}).catch(() => {

@ -511,7 +511,8 @@ export default {
this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
type: "success",
confirmButtonText: "马上设置",
cancelButtonText: "稍后操作"
cancelButtonText: "稍后操作",
closeOnClickModal: false
}).then(() => {
this.$router.replace(`/setTheoreticalCourse?id=${courseId}`);
}).catch(() => {
@ -534,7 +535,8 @@ export default {
//
if ((id && updateTime > 2) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.save()
}).catch(() => {

@ -441,7 +441,8 @@ export default {
//
if (this.moved) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.saveSort()
this.moved = false

@ -1,429 +1,510 @@
<template>
<div class="wrap">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div style="overflow: auto;">
<el-form label-width="80px">
<el-row>
<el-col :span="5">
<!--
<div class="wrap">
<el-card shadow="hover"
class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div style="overflow: auto;">
<el-form label-width="80px">
<el-row>
<el-col :span="5">
<!--
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
-->
<el-form-item label="省份">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市"
:disabled="form.provinces ? false : true" @clear="clearcity()" @change="initData">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="来源">
<el-select v-model="form.platformId" clearable placeholder="请选择来源" @change="initData">
<el-option
v-for="item in platformList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="学校">
<el-select v-model="form.schoolId" clearable filterable placeholder="请选择学校" @change="initData">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="5">
<el-form-item label="省份">
<el-select v-model="form.provinces"
clearable
placeholder="请选择省份"
@change="getCity"
@clear="clearprovince()">
<el-option v-for="(item,index) in provinceList"
:key="index"
:label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="城市">
<el-select v-model="form.city"
clearable
placeholder="请选择城市"
:disabled="form.provinces ? false : true"
@clear="clearcity()"
@change="initData">
<el-option v-for="(item,index) in cityList"
:key="index"
:label="item.cityName"
:value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="来源">
<el-select v-model="form.platformId"
clearable
placeholder="请选择来源"
@change="initData">
<el-option v-for="item in platformList"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="学校">
<el-select v-model="form.schoolId"
clearable
filterable
placeholder="请选择学校"
@change="initData">
<el-option v-for="(item,index) in schoolList"
:key="index"
:label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="5">
<el-form-item label="角色">
<el-select v-model="form.accountRole" clearable placeholder="请选择角色" @change="initData">
<el-option v-for="(item,index) in accountRoleList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col> -->
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="创建时间" class="userRadio">
<el-radio-group v-model="form.month">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="自定义">
<el-date-picker
v-model="form.date"
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="支持手机号,姓名" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="创建时间"
class="userRadio">
<el-radio-group v-model="form.month">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="自定义">
<el-date-picker v-model="form.date"
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="支持手机号,姓名"
prefix-icon="el-icon-search"
v-model="form.keyword"
clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</el-card>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>用户列表</span>
</div>
<div>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" v-loading="loading" row-key="userId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"></el-table-column>
<el-table-column prop="platformName" label="来源" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" width="150" align="center"></el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column>
<el-table-column prop="lastLoginTime" label="最近登录时间" align="center"></el-table-column>
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button>
<el-button v-if="scope.row.userId!==1" type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-switch v-if="scope.row.userId!==1" v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'" @change="switchOff($event,scope.row,scope.$index)" v-auth="'/user:启用'"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</el-card>
</div>
<el-card shadow="hover"
class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>用户列表</span>
</div>
<div>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="userData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
v-loading="loading"
row-key="userId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="userName"
label="姓名"
align="center"></el-table-column>
<el-table-column prop="phone"
label="手机号"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学校"
align="center"></el-table-column>
<el-table-column prop="platformName"
label="来源"
align="center"></el-table-column>
<el-table-column prop="createTime"
label="创建时间"
width="150"
align="center"></el-table-column>
<el-table-column prop="logInNumber"
label="登录次数"
align="center"></el-table-column>
<el-table-column prop="lastLoginTime"
label="最近登录时间"
align="center"></el-table-column>
<el-table-column label="操作"
width="300"
align="center">
<template slot-scope="scope">
<el-button type="text"
@click="toDetail(scope.row, 1)"
v-auth>查看</el-button>
<el-button v-if="scope.row.userId!==1"
type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
<el-button type="text"
@click="resetPassword(scope.row)"
v-auth>重置密码</el-button>
<el-switch v-if="scope.row.userId!==1"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'/user:启用'"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="totals">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import Setting from '@/setting'
export default {
name: 'user',
data() {
return {
platformId: Setting.platformId,
searchTimer: null,
form: {
name: '',
countries: '中国',
provinces: '',
city: '',
platformId: '',
schoolId: '',
accountRole: '',
keyword: '',
date:'',
startTime: '',
endTime: '',
month: ''
},
accountRoleList: [{
name: '超级管理员',
value: 1
},
{
name: '管理员',
value: 13
},
{
name: '教师',
value: 14
},
{
name: '学生',
value: 4
}],
countryList: [{
name:'中国'
}],
provinceList: this.$store.state.provinceList,
cityList: [],
schoolList: [],
userData:[],
dateList: [{
id: '',
name: '不限'
},
{
id: 3,
name: '3个月内'
},
{
id: 6,
name: '6个月内'
},
{
id: 9,
name: '9个月内'
},
{
id: 12,
name: '1年内'
}],
platformList: [
{
value: '',
label: '不限'
},
{
value: 1,
label: '职站'
},
{
value: 2,
label: '数据前瞻'
},
],
page: +this.$route.query.page || 1,
pageSize: 10,
totals: 0,
multipleSelection: [],
loading: false
};
},
watch: {
'form.keyword': function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
name: 'user',
data () {
return {
platformId: Setting.platformId,
searchTimer: null,
form: {
name: '',
countries: '中国',
provinces: '',
city: '',
platformId: '',
schoolId: '',
accountRole: '',
keyword: '',
date: '',
startTime: '',
endTime: '',
month: ''
},
accountRoleList: [{
name: '超级管理员',
value: 1
},
{
name: '管理员',
value: 13
},
{
name: '教师',
value: 14
},
{
name: '学生',
value: 4
}],
countryList: [{
name: '中国'
}],
provinceList: this.$store.state.provinceList,
cityList: [],
schoolList: [],
userData: [],
dateList: [{
id: '',
name: '不限'
},
{
id: 3,
name: '3个月内'
},
{
id: 6,
name: '6个月内'
},
{
id: 9,
name: '9个月内'
},
{
id: 12,
name: '1年内'
}],
platformList: [
{
value: '',
label: '不限'
},
'form.month': function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.form.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.form.date = []
}
{
value: 1,
label: '职站'
},
'form.date': function(val){
if(val && val.length){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{
this.form.startTime = ''
this.form.endTime = ''
}
this.initData()
}
{
value: 2,
label: '数据前瞻'
},
],
page: +this.$route.query.page || 1,
pageSize: 10,
totals: 0,
multipleSelection: [],
loading: false
};
},
watch: {
'form.keyword': function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
},
mounted() {
this.getData()
this.getSchoolData();
'form.month': function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000
this.form.date = [this.formatDate('yyyy-MM-dd', new Date(new Date().getTime() - unit * 30 * val)), this.formatDate('yyyy-MM-dd', new Date(new Date().getTime() + unit))]
} else {
this.form.date = []
}
},
methods: {
getData() {
let data = {
countries: this.form.countries,
provinceId: this.form.provinces,
cityId: this.form.city,
platformId: this.form.platformId,
schoolId: this.form.schoolId,
month: this.form.month,
creationTime: this.form.startTime,
endTime: this.form.endTime,
roleId: this.form.accountRole,
searchContent: this.form.keyword,
pageNum: this.page,
pageSize: this.pageSize
}
this.loading = true
this.$post(this.api.queryUserInfoList, data).then(({ page, total }) => {
const promises = []
page.map(e => {
promises.push(new Promise((resolve, reject) => {
//
this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => {
const platList = result.bindingPlatformAndUserList
// 1->0->
e.isEnable = platList.find(e => e.isEnable) ? 1 : 0
e.userIds = platList.map(e => e.userId) // userId
resolve()
}).catch((res) => {
reject()
})
}))
})
Promise.all(promises).then(_ => {
this.userData = page
this.totals = total
this.loading = false
})
}).catch(res => {
this.loading = false
})
},
initData(){
this.page = 1
this.getData()
},
//
clearprovince(){
this.form.city = '',
this.form.schoolId = ''
},
//
getCity(){
this.clearprovince()
this.getCityData()
this.page = 1
this.getData()
},
getCityData(){
let data = {
provinceId: this.form.provinces
}
this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.list
}).catch(res => {})
},
//
clearcity(){
this.form.schoolId = ''
},
// /
getSchool(){
this.clearcity()
this.getSchoolData()
this.page = 1
this.getData()
},
getSchoolData(){
let data = {
provinceId: "",
cityId: ""
}
this.$get(this.api.querySchoolData,data).then(res => {
this.schoolList = res.list
}).catch(res => {})
},
currentChange(val) {
this.page = val
this.$router.push(`user?page=${val}`)
this.getData()
},
toDetail(row, detail){
this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`)
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, row.userIds).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
resetPassword(row){
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', {
}).then(() => {
this.$get(this.api.resetPwd,{
newPwd: Setting.initialPassword,
userId: row.userId,
}).then(res => {
if(res.message == 'success'){
this.$message.success('重置成功')
}else{
this.$message.error('重置失败')
}
}).catch(res => {})
}).catch(() => {})
},
//
switchUser(val,row) {
this.$get(this.api.updateAccountAllEnable, {
id: row.userId,
isEnable: val,
phone: row.phone
}).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功')
}).catch(res => {})
},
//
switchOff(val,row) {
//
if (val) {
//
this.$post(`${this.api.oneClickEnableVerification}?accountId=${row.accountId}`).then(({ result }) => {
this.switchUser(val, row)
'form.date': function (val) {
if (val && val.length) {
this.form.startTime = val[0]
this.form.endTime = val[1]
} else {
this.form.startTime = ''
this.form.endTime = ''
}
this.initData()
}
},
mounted () {
this.getData()
this.getSchoolData();
},
methods: {
getData () {
let data = {
countries: this.form.countries,
provinceId: this.form.provinces,
cityId: this.form.city,
platformId: this.form.platformId,
schoolId: this.form.schoolId,
month: this.form.month,
creationTime: this.form.startTime,
endTime: this.form.endTime,
roleId: this.form.accountRole,
searchContent: this.form.keyword,
pageNum: this.page,
pageSize: this.pageSize
}
this.loading = true
this.$post(this.api.queryUserInfoList, data).then(({ page, total }) => {
const promises = []
page.map(e => {
promises.push(new Promise((resolve, reject) => {
//
this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => {
const platList = result.bindingPlatformAndUserList
// 1->0->
e.isEnable = platList.find(e => e.isEnable) ? 1 : 0
e.userIds = platList.map(e => e.userId) // userId
resolve()
}).catch((res) => {
//
this.$confirm(res.message, '提示', {
type: 'info'
}).then(() => {
this.switchUser(val, row)
}).catch(() => {
//
row.isEnable = 0
})
reject()
})
}))
})
Promise.all(promises).then(_ => {
this.userData = page
this.totals = total
this.loading = false
})
}).catch(res => {
this.loading = false
})
},
initData () {
this.page = 1
this.getData()
},
//
clearprovince () {
this.form.city = '',
this.form.schoolId = ''
},
//
getCity () {
this.clearprovince()
this.getCityData()
this.page = 1
this.getData()
},
getCityData () {
let data = {
provinceId: this.form.provinces
}
this.$get(this.api.queryCity, data).then(res => {
this.cityList = res.list
}).catch(res => { })
},
//
clearcity () {
this.form.schoolId = ''
},
// /
getSchool () {
this.clearcity()
this.getSchoolData()
this.page = 1
this.getData()
},
getSchoolData () {
let data = {
provinceId: "",
cityId: ""
}
this.$get(this.api.querySchoolData, data).then(res => {
this.schoolList = res.list
}).catch(res => { })
},
currentChange (val) {
this.page = val
this.$router.push(`user?page=${val}`)
this.getData()
},
toDetail (row, detail) {
this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`)
},
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, row.userIds).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
resetPassword (row) {
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', {
}).then(() => {
this.$get(this.api.resetPwd, {
newPwd: Setting.initialPassword,
userId: row.userId,
}).then(res => {
if (res.message == 'success') {
this.$message.success('重置成功')
} else {
this.switchUser(val, row)
this.$message.error('重置失败')
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length){
let delList = this.multipleSelection.map(e => e.userId);
this.$confirm('确定要删除选中用户吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts,delList).then(res => {
if(delList.length == this.userData.length){
if(this.page > 1){
this.page = this.page-1
}
}
this.$message.success('删除成功')
this.$refs.table.clearSelection()
this.getData()
}).catch(res => {
})
}).catch(() => {})
}else{
this.$message.error('请先选择客户 !')
}).catch(res => { })
}).catch(() => { })
},
//
switchUser (val, row) {
this.$get(this.api.updateAccountAllEnable, {
id: row.userId,
isEnable: val,
phone: row.phone
}).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功')
}).catch(res => { })
},
//
switchOff (val, row) {
//
if (val) {
//
this.$post(`${this.api.oneClickEnableVerification}?accountId=${row.accountId}`).then(({ result }) => {
this.switchUser(val, row)
}).catch((res) => {
//
this.$confirm(res.message, '提示', {
type: 'info',
closeOnClickModal: false
}).then(() => {
this.switchUser(val, row)
}).catch(() => {
//
row.isEnable = 0
})
})
} else {
this.switchUser(val, row)
}
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
delAllSelection () {
if (this.multipleSelection.length) {
let delList = this.multipleSelection.map(e => e.userId);
this.$confirm('确定要删除选中用户吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, delList).then(res => {
if (delList.length == this.userData.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
},
}
this.$message.success('删除成功')
this.$refs.table.clearSelection()
this.getData()
}).catch(res => {
})
}).catch(() => { })
} else {
this.$message.error('请先选择客户 !')
}
},
}
};
</script>
@ -434,7 +515,7 @@ export default {
.card {
min-height: calc(100vh - 380px);
}
.el-form-item{
.el-form-item {
margin-bottom: 0;
/deep/.el-radio {
width: 87px;
@ -443,7 +524,7 @@ export default {
padding-left: 0;
}
}
.el-radio.is-bordered+.el-radio.is-bordered{
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
}

@ -22,5 +22,6 @@ module.exports = {
// '@': resolve('src'),
// }
// }
}
},
productionSourceMap: false,
};
Loading…
Cancel
Save