提交 88d06606 编写于 作者: 刘英杰's avatar 刘英杰

测试提交

上级 2f98a810
文件已添加
此差异已折叠。
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.2.0", "@babel/runtime": "^7.2.0",
"@vue-office/pdf": "^1.5.4",
"axios": "^0.18.0", "axios": "^0.18.0",
"better-scroll": "^1.12.1", "better-scroll": "^1.12.1",
"dayjs": "^1.8.9", "dayjs": "^1.8.9",
...@@ -30,7 +31,11 @@ ...@@ -30,7 +31,11 @@
"ua-parser-js": "^0.7.18", "ua-parser-js": "^0.7.18",
"view-design": "^4.6.0", "view-design": "^4.6.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-doc-preview": "^0.3.2",
"vue-i18n": "^7.8.1", "vue-i18n": "^7.8.1",
"vue-image-preview": "^0.0.8",
"vue-office": "^0.0.5",
"vue-pdf": "^4.3.0",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<title><%= VUE_APP_TITLE %></title> <title><%= VUE_APP_TITLE %></title>
</head> </head>
<body> <body>
<!--<script type="text/javascript" src="/a/manager/identify/identify.js"></script>--> <script type="text/javascript" src="/a/manager/identify/identify.js"></script>
<noscript> <noscript>
<strong> <strong>
请开启 JavaScript 功能来使用 <%= VUE_APP_TITLE %>。 请开启 JavaScript 功能来使用 <%= VUE_APP_TITLE %>。
......
此差异已折叠。
<template> <template>
<div class="i-frame"> <div class="i-frame">
<iframe v-if="ready" :src="src" frameborder="0" class="i-frame-iframe"></iframe> <iframe v-if="ready" :src="src" frameborder="0" class="i-frame-iframe"></iframe>
</div> </div>
</template> </template>
<script> <script>
const noMarginClassName = 'i-layout-content-main-no-margin'; // const noMarginClassName = 'i-layout-content-main-no-margin';
const noCopyrightClassName = 'i-copyright-hidden'; const noCopyrightClassName = 'i-copyright-hidden';
const contextFlexClassName = 'i-layout-content-flex'; // const contextFlexClassName = 'i-layout-content-flex';
const contextMainFlexClassName = 'i-layout-content-main-flex'; const contextMainFlexClassName = 'i-layout-content-main-flex';
export default { export default {
name: 'i-frame', name: 'i-frame',
props: { props: {
src: { src: {
type: String, type: String,
default: '' default: ''
}, },
// 是否保留默认左右边距(24px) // 是否保留默认左右边距(24px)
margin: { margin: {
type: Boolean, type: Boolean,
default: false default: false
}, },
// 是否显示底部版权 // 是否显示底部版权
copyright: { copyright: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data () { data() {
return { return {
ready: false, ready: false,
$content: null, $content: null,
$copyright: null, $copyright: null,
$layoutContent: null, $layoutContent: null,
$layoutContentMain: null $layoutContentMain: null,
} }
}, },
watch: { watch: {
margin: { margin: {
handler (val) { handler(val) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$content) { if (this.$content) {
if (!val) { if (!val) {
this.$content.classList.add(noMarginClassName); // this.$content.classList.add(noMarginClassName);
} else { } else {
this.$content.classList.remove(noMarginClassName); // this.$content.classList.remove(noMarginClassName);
}
}
});
},
immediate: true
} }
}, }
mounted () { });
this.$content = document.getElementsByClassName('i-layout-content-main')[0]; },
immediate: true
}
},
mounted() {
this.$content = document.getElementsByClassName('i-layout-content-main')[0];
this.$copyright = document.getElementsByClassName('i-copyright')[0]; this.$copyright = document.getElementsByClassName('i-copyright')[0];
if (this.$copyright && !this.copyright) this.$copyright.classList.add(noCopyrightClassName); if (this.$copyright && !this.copyright) this.$copyright.classList.add(noCopyrightClassName);
this.$layoutContent = document.getElementsByClassName('i-layout-content')[0]; this.$layoutContent = document.getElementsByClassName('i-layout-content')[0];
if (this.$layoutContent) this.$layoutContent.classList.add(contextFlexClassName); // if (this.$layoutContent) this.$layoutContent.classList.add(contextFlexClassName);
this.$layoutContentMain = document.getElementsByClassName('i-layout-content-main')[0]; this.$layoutContentMain = document.getElementsByClassName('i-layout-content-main')[0];
if (this.$layoutContentMain) this.$layoutContentMain.classList.add(contextMainFlexClassName); if (this.$layoutContentMain) this.$layoutContentMain.classList.add(contextMainFlexClassName);
this.$nextTick(() => { this.$nextTick(() => {
this.ready = true; this.ready = true;
}); });
}, },
beforeDestroy () { beforeDestroy() {
if (this.$content) this.$content.classList.remove(noMarginClassName); // if (this.$content) this.$content.classList.remove(noMarginClassName);
if (this.$copyright) this.$copyright.classList.remove(noCopyrightClassName); if (this.$copyright) this.$copyright.classList.remove(noCopyrightClassName);
if (this.$layoutContent) this.$layoutContent.classList.remove(contextFlexClassName); // if (this.$layoutContent) this.$layoutContent.classList.remove(contextFlexClassName);
if (this.$layoutContentMain) this.$layoutContentMain.classList.remove(contextMainFlexClassName); if (this.$layoutContentMain) this.$layoutContentMain.classList.remove(contextMainFlexClassName);
this.$content = null; this.$content = null;
this.$copyright = null; this.$copyright = null;
this.$layoutContent = null; this.$layoutContent = null;
this.$layoutContentMain = null; this.$layoutContentMain = null;
} }
} }
</script> </script>
<style lang="less"> <style lang="less" scoped>
.i-frame{ .i-frame {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
&-iframe{ &-iframe {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
} }
} }
</style> </style>
import {Modal,Message,Spin} from "view-design"; import {Modal, Message, Spin} from "view-design";
import Vue from "vue";
export function publicConfirm(publicFunction) { export function publicConfirm(publicFunction) {
// 公共弹窗删除 // 公共弹窗删除
Modal.confirm({ Modal.confirm({
title: '警告', title: '警告',
content: '<p>是否继续此操作?</p>', content: '<p>是否继续此操作?</p>',
cancelText: "取消", cancelText: "取消",
...@@ -15,7 +16,8 @@ export function publicConfirm(publicFunction) { ...@@ -15,7 +16,8 @@ export function publicConfirm(publicFunction) {
} }
}); });
} }
export function publicMessage(res) {
export function publicMessage(res) {
// 弹窗封装 // 弹窗封装
if (res.code !== 1) { if (res.code !== 1) {
Message['warning']({ Message['warning']({
...@@ -28,6 +30,50 @@ export function publicMessage(res) { ...@@ -28,6 +30,50 @@ export function publicMessage(res) {
background: true, background: true,
content: '操作成功' content: '操作成功'
}); });
}
}
export function storageAddEventListener(fun) {
// 监听storage事件,当主页面修改数据时,触发该事件
window.addEventListener('storage', (event) => {
if (event.key === 'updataEvent' && event.newValue === 'getDataEvent') {
//刷新主窗口
// 执行你的逻辑
// 重置存储的值,以便下次触发事件
localStorage.setItem('updataEvent', '');
fun()
}
});
}
export async function myEncapsulationFunction(fun) {
// Spin.show()
let res = await fun()
try {
switch (res.code) {
case 1 :
Message['success']({
background: true,
content: res.msg
});
break;
default :
Message['error']({
background: true,
content: res.msg_detail
});
}
console.log("try")
// Spin.hide()
return res
} catch (e) {
console.log("catch,", e)
Spin.hide()
Message['error']({
background: true,
content: res.msg_detail
});
} }
} }
...@@ -25,13 +25,13 @@ import iViewPro from '@/libs/iview-pro/iview-pro.min.js'; ...@@ -25,13 +25,13 @@ import iViewPro from '@/libs/iview-pro/iview-pro.min.js';
import router from './router'; import router from './router';
import menuHeader from '@/menu/header'; import menuHeader from '@/menu/header';
import menuSider from '@/menu/sider'; import menuSider from '@/menu/sider';
import { frameInRoutes } from '@/router/routes'; import {frameInRoutes} from '@/router/routes';
// 多语言 // 多语言
import i18n from '@/i18n'; import i18n from '@/i18n';
// 方法 // 方法
import { getHeaderName, getMenuSider, getSiderSubmenu } from '@/libs/system'; import {getHeaderName, getMenuSider, getSiderSubmenu} from '@/libs/system';
// 内置组件 // 内置组件
import iLink from '@/components/link'; import iLink from '@/components/link';
...@@ -42,8 +42,13 @@ import iFrame from '@/components/frame'; ...@@ -42,8 +42,13 @@ import iFrame from '@/components/frame';
import './styles/index.less'; import './styles/index.less';
import './libs/iview-pro/iview-pro.css'; import './libs/iview-pro/iview-pro.css';
if (window) window.$t = (key, value) => i18n.t(key, value); import VuePDF from 'vue-pdf';
import VueDocPreview from 'vue-doc-preview';
import VueImagePreview from 'vue-image-preview';
import pdf from 'vue-pdf'
if (window) window.$t = (key, value) => i18n.t(key, value);
Vue.prototype.protocolHost = 'https://asc.hnasct.cn'
Vue.use(plugins); Vue.use(plugins);
Vue.use(ViewUI, { Vue.use(ViewUI, {
...@@ -52,14 +57,16 @@ Vue.use(ViewUI, { ...@@ -52,14 +57,16 @@ Vue.use(ViewUI, {
Vue.use(iViewPro); Vue.use(iViewPro);
Vue.component('i-link', iLink); Vue.component('i-link', iLink);
Vue.component('i-frame', iFrame); Vue.component('i-frame', iFrame);
Vue.component('VueDocPreview', VueDocPreview)
Vue.component('vuePdf', VuePDF);
Vue.component('VueImagePreview', VueImagePreview);
new Vue({ new Vue({
mixins: [mixinApp], mixins: [mixinApp],
router, router,
store, store,
i18n, i18n,
render: h => h(App), render: h => h(App),
created () { created() {
// 处理路由 得到每一级的路由设置 // 处理路由 得到每一级的路由设置
this.$store.commit('admin/page/init', frameInRoutes); this.$store.commit('admin/page/init', frameInRoutes);
// 设置顶栏菜单 // 设置顶栏菜单
...@@ -71,7 +78,7 @@ new Vue({ ...@@ -71,7 +78,7 @@ new Vue({
}, },
watch: { watch: {
// 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要) // 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要)
'$route' (to, from) { '$route'(to, from) {
let path = to.matched[to.matched.length - 1].path; let path = to.matched[to.matched.length - 1].path;
if (!Setting.dynamicSiderMenu) { if (!Setting.dynamicSiderMenu) {
let headerName = getHeaderName(path, menuSider); let headerName = getHeaderName(path, menuSider);
......
...@@ -2,5 +2,5 @@ export default { ...@@ -2,5 +2,5 @@ export default {
path: '/Bursary', path: '/Bursary',
title: '补助金列表', title: '补助金列表',
header: 'home', header: 'home',
icon:'logo-usd' icon: 'logo-usd'
} }
export default {
path: '/competitionNotice',
title: '公告列表',
header: 'home',
icon: 'md-text'
}
export default {
path: '/competitionScore',
title: '竞赛成绩',
header: 'home',
icon: 'md-text'
}
const pre = '/flow'; const pre = '/flow';
export default { export default {
path: '/', path: '/1',
title: '流程集合', title: '流程集合',
header: 'home', header: 'home',
icon: 'md-clock', icon: 'md-clock',
......
...@@ -5,10 +5,24 @@ export default { ...@@ -5,10 +5,24 @@ export default {
header: 'home', header: 'home',
icon: 'md-flower', icon: 'md-flower',
children: [ children: [
{
path: `${pre}-flowDesign`,
title: '流程设计管理',
},
{
path: `${pre}-noticeManagement`,
title: '竞赛公告管理',
},
{ {
path: `${pre}-approvalUserGroupManagement`, path: `${pre}-approvalUserGroupManagement`,
title: '审批用户组管理', title: '审批用户组管理',
}, },
// {
// path: `${pre}-score`,
// title: '成绩录入',
// // header:'home',
// },
{ {
path: `${pre}-userManagement`, path: `${pre}-userManagement`,
title: '用户管理', title: '用户管理',
...@@ -18,6 +32,11 @@ export default { ...@@ -18,6 +32,11 @@ export default {
path: `${pre}-levelManagement`, path: `${pre}-levelManagement`,
title: '权限管理', title: '权限管理',
// header:'home', // header:'home',
},
{
path: `${pre}-log`,
title: '日志',
// header:'home',
} }
] ]
} }
...@@ -18,9 +18,12 @@ import Bursary from "@/menu/modules/Bursary"; ...@@ -18,9 +18,12 @@ import Bursary from "@/menu/modules/Bursary";
import Certificate from "@/menu/modules/Certificate"; import Certificate from "@/menu/modules/Certificate";
import CompetitionSign from "@/menu/modules/CompetitionSign"; import CompetitionSign from "@/menu/modules/CompetitionSign";
import flowassemble from "@/menu/modules/flowassemble"; import flowassemble from "@/menu/modules/flowassemble";
import competitionNotice from "@/menu/modules/competitionNotice";
import competitionScore from "@/menu/modules/competitionScore";
// 系统 // 系统
// import log from './modules/log'; // import log from './modules/log';
export default [ export default [
// dashboard, // dashboard,
// log, // log,
...@@ -46,7 +49,9 @@ export default [ ...@@ -46,7 +49,9 @@ export default [
CompetitionSign, CompetitionSign,
Bursary, Bursary,
Certificate, Certificate,
competitionNotice,
teamManagement, teamManagement,
competitionScore,
flowassemble, flowassemble,
systemConmfiguration, systemConmfiguration,
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<Table <Table
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:loading="loading"
> >
<template #race_level="{row}"> <template #race_level="{row}">
<!-- <Tag :color="['','success','primary'][row.way]">{{['国家级', '省一级', '省二级'][row.way] <!-- <Tag :color="['','success','primary'][row.way]">{{['国家级', '省一级', '省二级'][row.way]
...@@ -62,11 +63,18 @@ ...@@ -62,11 +63,18 @@
</template> </template>
<template v-slot:action="{row}"> <template v-slot:action="{row}">
<Button type="primary" size="small" @click="edit(row)">详细</Button> <a @click="importFile(row)">导出</a>
<!-- <Button v-if="false" type="info" @click="edit(row)">编辑</Button>--> <a @click="edit(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel"> <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button> <a style="margin-left: 15px;color: red">删除</a>
</Poptip> </Poptip>
<!-- <Button type="primary" size="small" @click="importFile(row)">导出</Button>-->
<!-- <Button type="primary" size="small" @click="edit(row)">详细</Button>-->
<!-- &lt;!&ndash; <Button v-if="false" type="info" @click="edit(row)">编辑</Button>&ndash;&gt;-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">-->
<!-- <Button type="error" size="small" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
</template> </template>
</Table> </Table>
<div style="height: 60px;display: flex;align-items: center;"> <div style="height: 60px;display: flex;align-items: center;">
...@@ -84,6 +92,23 @@ ...@@ -84,6 +92,23 @@
</Card> </Card>
<Modal
v-model="importModal"
title="文件导出"
>
<Spin fix v-if="importLoading"></Spin>
<div style=" display: flex;justify-content: space-around;">
<Button icon="md-log-in" @click="importButton(item[1])" v-for="(item,index) in fileObject" :key="index">
{{
item[2]
}}
</Button>
</div>
<template #footer>
<Button type="text" @click="importModal =false">关闭</Button>
<!-- <Button type="primary" @click="importOk">确定</Button>-->
</template>
</Modal>
<Drawer :width="800" title="详细" :closable="true" v-model="drawer"> <Drawer :width="800" title="详细" :closable="true" v-model="drawer">
<div class="tableList"> <div class="tableList">
<h1 style="display: flex;justify-content: center">补助金内容详细</h1> <h1 style="display: flex;justify-content: center">补助金内容详细</h1>
...@@ -100,14 +125,25 @@ ...@@ -100,14 +125,25 @@
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }} {{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td> </td>
<th v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colTitle">{{ <th v-if="item[0]!=='fileList'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2] item[2]
}} }}
</th> </th>
<td v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colContent">{{ <td v-if="item[0]!=='fileList'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1] item[1]
}} }}
</td> </td>
<th v-if="item[0]==='fileList'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='fileList'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr> </tr>
</table> </table>
...@@ -127,6 +163,8 @@ export default { ...@@ -127,6 +163,8 @@ export default {
data() { data() {
return { return {
importLoading: false,
importModal: false,
drawerKeyValueArray: [], drawerKeyValueArray: [],
drawer: false, drawer: false,
grid: { grid: {
...@@ -180,18 +218,25 @@ export default { ...@@ -180,18 +218,25 @@ export default {
minWidth: 150, minWidth: 150,
}, },
{ {
title: '竞赛文件名', title: '竞赛类别',
key: 'file_name', slot: 'race_level',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '补助金额',
key: 'money',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 200,
}, },
{ {
title: '竞赛类别', title: '审批状态',
slot: 'race_level', slot: 'approval_state',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 150, minWidth: 200,
}, },
{ {
title: '补助时间', title: '补助时间',
...@@ -201,12 +246,14 @@ export default { ...@@ -201,12 +246,14 @@ export default {
minWidth: 200, minWidth: 200,
}, },
{ {
title: '补助金额', title: '竞赛文件名',
key: 'money', key: 'file_name',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 200,
}, },
{ {
title: '计划集训时间', title: '计划集训时间',
key: 'plan_train_time', key: 'plan_train_time',
...@@ -230,14 +277,6 @@ export default { ...@@ -230,14 +277,6 @@ export default {
}, },
{
title: '审批状态',
slot: 'approval_state',
align: 'center',
show: true,
minWidth: 200,
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
...@@ -295,7 +334,8 @@ export default { ...@@ -295,7 +334,8 @@ export default {
page_size: 10, page_size: 10,
total: 0, total: 0,
}, },
pageKey: 1 pageKey: 1,
fileObject: {}
} }
}, },
// 查询条件初始化 // 查询条件初始化
...@@ -311,11 +351,18 @@ export default { ...@@ -311,11 +351,18 @@ export default {
this.getCompetitionSignList() this.getCompetitionSignList()
}, },
methods: { methods: {
importButton(row) {
window.open(row, '_blank')
},
importOk() {
},
async delCompetition(row) { async delCompetition(row) {
let data = { let data = {
id: row.bursaryid id: row.bursaryid
} }
const res = await api.BursaryDel(data) const res = await api.BursaryDel(data)
hook.publicMessage(res)
await this.getCompetitionSignList() await this.getCompetitionSignList()
}, },
...@@ -336,11 +383,10 @@ export default { ...@@ -336,11 +383,10 @@ export default {
this.pageKey++ this.pageKey++
this.init.page_index = 1 this.init.page_index = 1
const res = await this.getCompetitionSignList() const res = await this.getCompetitionSignList()
}, },
// 查询 // 查询
async getCompetitionSignList() { async getCompetitionSignList() {
this.$Spin.show() this.loading = true
let data = { let data = {
"name": this.search.wayCurrentValuethis, "name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue, "level": this.search.levelCurrentValue,
...@@ -352,17 +398,37 @@ export default { ...@@ -352,17 +398,37 @@ export default {
const res = await api.GetBursaryList(data) const res = await api.GetBursaryList(data)
this.tableData = res.response.data this.tableData = res.response.data
this.init.total = res.response.data_count this.init.total = res.response.data_count
hook.publicMessage(res) this.loading = false
}, },
// 新增 // 新增
add() { add() {
this.$refs.addEdit.add() this.$refs.addEdit.add()
}, },
async importFile(row) {
this.importModal = true
this.importLoading = true
const res = await api.BursaryExport({id: row.bursaryid})
try {
delete res.response.response.file_name
let data = Object.entries(res.response.response)
let name = ['PDF导出', 'Word导出']
data.map((cur, index) => {
cur.push(name[index])
})
this.fileObject = data
this.importLoading = false
} catch (e) {
this.importLoading = false
}
},
// 修改 // 修改
edit(row) { async edit(row) {
let res = await api.GetBursaryInfo({id: row.bursaryid})
console.log("🚀🚀🚀,", res)
this.drawer = true this.drawer = true
let array = _.cloneDeep(row) let array = _.cloneDeep(row)
delete array.bursaryid delete array.bursaryid
delete array.grant_file delete array.grant_file
...@@ -370,7 +436,8 @@ export default { ...@@ -370,7 +436,8 @@ export default {
delete array.createtime delete array.createtime
delete array._rowKey delete array._rowKey
delete array._index delete array._index
delete array.approval_remark
array.fileList = res.response.fileList
this.drawerKeyValueArray = Object.entries(array) this.drawerKeyValueArray = Object.entries(array)
this.drawerKeyValueArray.map((cur, index) => { this.drawerKeyValueArray.map((cur, index) => {
let data = [ let data = [
...@@ -380,8 +447,6 @@ export default { ...@@ -380,8 +447,6 @@ export default {
'学号/工号', '学号/工号',
'身份证', '身份证',
'专业/班级', '专业/班级',
'竞赛名称', '竞赛名称',
'竞赛文件名', '竞赛文件名',
'竞赛类别', '竞赛类别',
...@@ -391,7 +456,8 @@ export default { ...@@ -391,7 +456,8 @@ export default {
'实际集训起止时间', '实际集训起止时间',
'参赛具体情况', '参赛具体情况',
'审批状态', '审批状态',
'审批意见' // '审批意见'
'附件',
]; ];
cur.push(data[index]) cur.push(data[index])
}) })
......
此差异已折叠。
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<Table <Table
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:loading="loading"
> >
<template #race_level="{row}"> <template #race_level="{row}">
...@@ -69,10 +70,17 @@ ...@@ -69,10 +70,17 @@
</template> </template>
<template v-slot:action="{row}"> <template v-slot:action="{row}">
<Button type="primary" size="small" @click="edit(row)">详细</Button> <a @click="importFile(row)">导出</a>
<a @click="edit(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel"> <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button> <a style="margin-left: 15px;color: red">删除</a>
</Poptip> </Poptip>
<!-- <Button type="primary" size="small" @click="importFile(row)">导出</Button>-->
<!-- <Button type="primary" size="small" @click="edit(row)">详细</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">-->
<!-- <Button type="error" size="small" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
</template> </template>
</Table> </Table>
<div style="height: 60px;display: flex;align-items: center;"> <div style="height: 60px;display: flex;align-items: center;">
...@@ -96,35 +104,70 @@ ...@@ -96,35 +104,70 @@
<table border="1" class="container"> <table border="1" class="container">
<tr class="row" v-for="(item,index) in drawerKeyValueArray" :key="index"> <tr class="row" v-for="(item,index) in drawerKeyValueArray" :key="index">
<th v-if="item[0]==='level'" class="colTitle">{{ item[2] }}</th> <th v-if="item[0]==='level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='level'" class="colContent">{{ ['国家级', '省一级', '省二级'][item[1]] }}</td> <td v-if="item[0]==='level'" class="colContent">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</td>
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th> <th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td> <td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td>
<th v-if="item[0]==='race_level'" class="colTitle">{{ item[2] }}</th> <th v-if="item[0]==='race_level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='race_level'" class="colContent">{{ ['国家级', '省一级', '省二级'][item[1]] }}</td> <td v-if="item[0]==='race_level'" class="colContent">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th> <th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent"> <td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }} {{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td> </td>
<th v-if="item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
<th v-if="item[0]!=='projectInfo'&&item[0]!=='trainPlanInfo' &&item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{ class="colTitle">{{
item[2] item[2]
}} }}
</th> </th>
<td v-if="item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'" <td v-if="item[0]!=='projectInfo'&&item[0]!=='trainPlanInfo'&&item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{ class="colContent">{{
item[1] item[1]
}} }}
</td> </td>
<th v-if="item[0]==='trainPlanInfo'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='trainPlanInfo'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
<th v-if="item[0]==='projectInfo'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='projectInfo'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr> </tr>
</table> </table>
</div> </div>
</Drawer> </Drawer>
<Modal
v-model="importModal"
title="文件导出"
>
<Spin fix v-if="importLoading"></Spin>
<div style=" display: flex;justify-content: space-around;">
<Button icon="md-log-in" @click="importButton(item[1])" v-for="(item,index) in fileObject" :key="index">
{{
item[2]
}}
</Button>
</div>
<template #footer>
<Button type="text" @click="importModal =false">关闭</Button>
<!-- <Button type="primary" @click="importOk">确定</Button>-->
</template>
</Modal>
</div> </div>
</template> </template>
...@@ -326,7 +369,11 @@ export default { ...@@ -326,7 +369,11 @@ export default {
page_size: 10, page_size: 10,
total: 0, total: 0,
}, },
pageKey: 1 pageKey: 1,
importLoading: false,
importModal: false,
fileObject: [],
} }
}, },
// 查询条件初始化 // 查询条件初始化
...@@ -342,11 +389,36 @@ export default { ...@@ -342,11 +389,36 @@ export default {
this.getCompetitionSignList() this.getCompetitionSignList()
}, },
methods: { methods: {
importButton(row) {
window.open(row, '_blank')
},
async importFile(row) {
console.log("🚀🚀🚀,", row)
this.importModal = true
this.importLoading = true
const res = await api.SignExport({id: row.competitionsignid})
try {
delete res.response.response.file_name
let data = Object.entries(res.response.response)
let name = ['PDF导出', 'Word导出']
data.map((cur, index) => {
cur.push(name[index])
})
this.fileObject = data
this.importLoading = false
} catch (e) {
this.importLoading = false
}
},
async delCompetition(row) { async delCompetition(row) {
let data = { let data = {
id: row.competitionsignid id: row.competitionsignid
} }
const res = await api.SignDel(data) const res = await api.SignDel(data)
hook.publicMessage(res)
await this.getCompetitionSignList() await this.getCompetitionSignList()
}, },
...@@ -367,11 +439,10 @@ export default { ...@@ -367,11 +439,10 @@ export default {
this.pageKey++ this.pageKey++
this.init.page_index = 1 this.init.page_index = 1
const res = await this.getCompetitionSignList() const res = await this.getCompetitionSignList()
}, },
// 查询 // 查询
async getCompetitionSignList() { async getCompetitionSignList() {
this.$Spin.show() this.loading = true
let data = { let data = {
"name": this.search.wayCurrentValuethis, "name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue, "level": this.search.levelCurrentValue,
...@@ -383,7 +454,7 @@ export default { ...@@ -383,7 +454,7 @@ export default {
const res = await api.GetSignList(data) const res = await api.GetSignList(data)
this.tableData = res.response.data this.tableData = res.response.data
this.init.total = res.response.data_count this.init.total = res.response.data_count
hook.publicMessage(res) this.loading = false
}, },
// 新增 // 新增
...@@ -391,9 +462,9 @@ export default { ...@@ -391,9 +462,9 @@ export default {
this.$refs.addEdit.add() this.$refs.addEdit.add()
}, },
// 修改 // 修改
edit(row) { async edit(row) {
let res = await api.GetSignInfo({id: row.competitionsignid})
this.drawer = true this.drawer = true
let array = _.cloneDeep(row) let array = _.cloneDeep(row)
delete array.competitionsignid delete array.competitionsignid
delete array.competitionreportid delete array.competitionreportid
...@@ -404,6 +475,9 @@ export default { ...@@ -404,6 +475,9 @@ export default {
delete array._rowKey delete array._rowKey
delete array._index delete array._index
delete array.sign_up delete array.sign_up
delete array.approval_remark
array.trainPlanInfo = res.response.trainPlanInfo
array.projectInfo = res.response.projectInfo
this.drawerKeyValueArray = Object.entries(array) this.drawerKeyValueArray = Object.entries(array)
this.drawerKeyValueArray.map((cur, index) => { this.drawerKeyValueArray.map((cur, index) => {
let data = [ let data = [
...@@ -423,12 +497,14 @@ export default { ...@@ -423,12 +497,14 @@ export default {
'培训结束时间', '培训结束时间',
'竞赛的其他要求', '竞赛的其他要求',
'审批状态', '审批状态',
'审批意见' // '审批意见'
'培训计划附件',
'竞赛方案附件',
]; ];
cur.push(data[index]) cur.push(data[index])
}) })
console.log("🚀🚀🚀,", this.drawerKeyValueArray) console.log("🚀🚀🚀,", this.drawerKeyValueArray)
}, },
// 删除 // 删除
del(row) { del(row) {
...@@ -465,7 +541,6 @@ export default { ...@@ -465,7 +541,6 @@ export default {
text-align: center; text-align: center;
width: 200px; width: 200px;
height: 50px; height: 50px;
} }
.colContent { .colContent {
...@@ -473,6 +548,10 @@ export default { ...@@ -473,6 +548,10 @@ export default {
height: 50px; height: 50px;
text-align: center; text-align: center;
} }
.aText:hover {
transform: scale(1.2);
}
} }
} }
......
<template>
<div class="container">
<div class="header">
<h1 style="display: flex;justify-content: center"> 竞赛公告详细</h1>
<div style="margin-left:20px;display: flex;align-items: center">
<Notification
:count="data.length"
@on-load-more="handleLoadMore"
@on-clear="handleClear"
:scroll-to-load="true"
:show-clear="false"
:clear-close="true"
:locale="loading"
>
<NotificationTab
title="需阅读用户列表"
name="message"
>
<template #clear>
关闭
</template>
<NotificationItem
v-for="(item, index) in data.publicList"
:key="index"
:title="item.public_name"
:content="['未读','已读'][item.is_read]"
:read="item.is_read"
:tag="item.public_type === 'Team' ? '团队': item.public_type === 'UserInfo' ? '个人' :'公告用户组'"
/>
</NotificationTab>
</Notification>
(阅读列表)
</div>
</div>
<div class="content">
<Card style="width: 50%;margin-top: 20px;border-radius: 20px;box-sizing: border-box">
<div class="tableList">
<table border="1" class="container1">
<tr v-for="(item,index) in data.keyValueArray" :key="index">
<th v-if="item[0]==='is_top'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='is_top'" class="colContent">{{ ['否', '是'][item[1]] }}</td>
<th v-if="item[0]==='is_public'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='is_public'" class="colContent">{{ ['否', '是'][item[1]] }}</td>
<th v-if="item[0]==='content'" class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]==='content'" class="colContent">
<spin style="max-height: 500px;overflow-y: auto" v-html="item[1]"></spin>
</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='content'&&item[0]!=='race_level'&& item[0]!=='is_top'&& item[0]!=='is_public' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='content'&&item[0]!=='race_level'&& item[0]!=='is_top'&& item[0]!=='is_public' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
</tr>
<tr>
<th>附件:</th>
<td class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in data.fileList"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
</div>
</Card>
</div>
</div>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import * as api from "@api/requestUtils";
import * as hook from "@/hook";
export default {
//import引入的组件需要注入到对象中才能使用",
components: {},
data() {
//这里存放数据",
return {
init: {
noticeid: '',
is_readTrue: 0,
is_readFalse: 0,
},
data: {
Object: {}
}
};
},
//监听属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {},
//方法集合",
methods: {
handleLoadMore() {
},
handleClear(e) {
console.log("🚀🚀🚀,", e)
},
async getNoticeInfo() {
this.$Spin.show()
const downSpin = (res) => {
if (res.code !== 1) {
this.$Spin.hide();
this.$Message.error('无数据')
}
}
this.init.noticeid = this.$route.query.id
const res4 = await api.GetNoticeInfo({id: this.$route.query.id})
this.data = res4.response
this.data.length = res4.response.publicList.length
downSpin(res4)
this.data.Object = res4.response
delete res4.response.noticeInfo.noticeid
delete res4.response.noticeInfo.typeid
delete res4.response.noticeInfo.createtime
delete res4.response.noticeInfo.competitionreportid
this.data.keyValueArray = Object.entries(res4.response.noticeInfo)
this.data.keyValueArray.map((cur, index) => {
let array4 = [
// 'bursaryid',
'公告标题',
'公告类型',
'发布时间',
'发布用户',
'是否置顶',
'是否发布',
'审批状态',
'修改人',
'修改时间',
'公告内容',
]
cur.push(array4[index])
})
hook.publicMessage(res4)
}
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
beforeCreate() {
},
//生命周期 - 创建完成(可以访问当前this实例)",数据模型已加载,方法已加载,html模板已加载,html模板未渲染
created() {
},
//生命周期 - 挂载之前",html模板未渲染
beforeMount() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",html模板已渲染
mounted() {
this.getNoticeInfo()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
beforeUpdate() {
},
//生命周期 - 更新之后",数据模型已更新,html模板已更新
updated() {
},
//生命周期 - 销毁之前",
beforeDestroy() {
},
destroyed() {
},
//生命周期 - 销毁完成",
//如果页面有keep-alive缓存功能,这个函数会触发",
activated() {
},
}
</script>
<style scoped>
.container {
width: 100vw;
height: 100vh;
}
.header {
width: 100%;
height: 8%;
background-color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
}
.content {
width: 100%;
height: 92%;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
justify-content: center;
.tableList {
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
.container1 {
border-collapse: collapse;
box-sizing: border-box;
width: 100%;
.row {
width: 100%;
height: 100%;
}
.colTitle {
text-align: center;
width: 30%;
height: 50px;
}
.colContent {
width: 70%;
height: 50px;
text-align: center;
}
}
}
}
</style>
<template>
<div class="container">
<Card style="width: 50%">
<template #title><h2 style="text-align: center">
竞赛公告编辑</h2></template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<Row>
<Col :span="12">
<FormItem label="公告标题" prop="title">
<Input v-model="formValidate.title" placeholder="请输入公告标题"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="公告类型" prop="typeid">
<Select v-model="formValidate.typeid"
placeholder="请选择公告类型">
<Option v-for="(item,index) in noticeSelect" :key="index"
:value="item.id">
{{ item.name }}
</Option>
</Select>
</FormItem>
</Col>
</Row>
<!-- <Row>-->
<!-- <Col :span="12">-->
<!-- <FormItem label="公告是否置顶" prop="is_top">-->
<!-- <Select v-model="formValidate.is_top"-->
<!-- placeholder="请选择是否置顶">-->
<!-- <Option v-for="(item,index) in noticeIsTop" :key="index"-->
<!-- :value="item.value">-->
<!-- {{ item.name }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- </Col>-->
<!-- </Row>-->
<richText :value="formValidate.content" :minHeight="500" @setRichTextValue="getRichTextValue"></richText>
<!-- <FormItem>-->
<Upload
:multiple="true"
:before-upload="beforeUpload"
:on-error="onError"
:on-success="onsuccess"
:on-format-error="onFormatError"
:show-upload-list="true"
type="drag"
action=""
>
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>附件上传</p>-->
<div style="padding: 20px 0;width: 100%;">
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
<p>附件上传</p>
</div>
</Upload>
<div class="filelist" v-for="(item,index) in files_list" :key="index">
{{ item.file_name }}
<Icon v-if="item.file_name" class="fileddelete" @click="fileDelete(item)" type="ios-trash"/>
</div>
<!-- </FormItem>-->
<FormItem>
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">保存
</Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>-->
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</Card>
</div>
<!-- <Grid center square :border="false" style="height: 100%">-->
<!-- <GridItem >1</GridItem>-->
<!-- <GridItem>2</GridItem>-->
<!-- <GridItem>3</GridItem>-->
<!-- </Grid>-->
</template>
<script>
import * as hook from '../../../hook'
import * as api from '../../../api/requestUtils'
import _ from "lodash";
import richText from '../../../components/quill/index.vue'
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用",
components: {richText},
data() {
//这里存放数据",
return {
noticeIsTop: [
{value: 0, name: '否'},
{value: 1, name: '是'}
],
noticeSelect: [],
teamSelect: [],
competitionNameArray: [],
approval_stateArray: [
{value: 0, label: '未审批'},
{value: 1, label: '审批中'},
{value: 2, label: '审批通过'},
{value: 3, label: '审批不通过'},
],
levelArray: [
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
],
wayArray: [
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
competitionnameValue: '',
formValidate: {
"noticeid": "",
"title": "",
"typeid": "",
content: '',
},
module: '',
"files_list": [],
ruleValidate: {
title: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
typeid: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
is_top: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
"competitionname": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
"sponsor": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
race_level: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
team_id: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
certificate_name: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
certificate_description: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
}
}
},
//监听属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {
'formValidate.content'(newValue, oldValue) {
console.log("🚀🚀newValue🚀,", newValue)
}
},
//方法集合",
methods: {
getRichTextValue(e) {
this.formValidate.content = e
},
fileDelete(e) {
this.files_list.map((cur, index) => {
if (cur.id === e.id) {
this.files_list.splice(index, 1)
}
})
},
onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList)
},
onsuccess(response, file, fileList) {
console.log("🚀🚀🚀,onsuccess", response, file, fileList)
},
onFormatError(response, file, fileList) {
this.$Message.info('文件类型错误!')
},
async beforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload(this.module, formData);
this.files_list.push(res.response)
hook.publicMessage(res)
return false
},
handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => {
if (cur) {
await hook.myEncapsulationFunction(async () => {
this.formValidate.files_list = this.files_list
let data = _.cloneDeep(this.formValidate)
const res = await api.NoticeSave(data)
setTimeout(() => {
localStorage.setItem('updataEvent', 'getDataEvent');
window.close()
}, 1500)
return res
})
}
})
},
handleReset() {
this.formValidate = {}
},
async getCompetiotionName() {
const res = await api.GetReportSelect()
this.competitionNameArray = res.response
const date = await api.TeamSelect()
this.teamSelect = date.response
const noticeSelect = await api.NoticeTypeSelect()
this.noticeSelect = noticeSelect.response
},
async GetNoticeInfo() {
this.$Spin.show()
const res = await api.GetNoticeInfo({id: this.formValidate.noticeid})
try {
this.formValidate = res.response.noticeInfo
this.files_list = res.response.fileList
this.$Spin.hide()
} catch (e) {
this.$Spin.hide()
}
}
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
beforeCreate() {
},
//生命周期 - 创建完成(可以访问当前this实例)",数据模型已加载,方法已加载,html模板已加载,html模板未渲染
created() {
},
//生命周期 - 挂载之前",html模板未渲染
beforeMount() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",html模板已渲染
mounted() {
this.getCompetiotionName()
this.formValidate.noticeid = this.$route.query.id;
this.module = this.$route.query.remark;
console.log("🚀🚀🚀,", this.module)
this.GetNoticeInfo()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
beforeUpdate() {
},
//生命周期 - 更新之后",数据模型已更新,html模板已更新
updated() {
},
//生命周期 - 销毁之前",
beforeDestroy() {
},
destroyed() {
},
//生命周期 - 销毁完成",
//如果页面有keep-alive缓存功能,这个函数会触发",
activated() {
},
}
</script>
<style>
.filelist {
}
.filelist:hover {
color: #1e93ff;
background-color: #f7f7f7;
}
.fileddelete {
}
.fileddelete:hover {
color: red;
transform: scale(1.5);
}
</style>
<style>
.container {
width: 100%;
min-height: 887px;
height: auto;
display: flex;
align-content: center;
justify-content: center;
flex-wrap: wrap;
}
</style>
<template>
<div>
<Card ref="card">
<template #title>
<div style="height: 30px;display: flex;align-items: center">
<h3>竞赛成绩</h3>
</div>
</template>
<!-- <Button type="primary" class="ivu-ml-8" @click="add">-->
<!-- <Icon type="md-add"/>-->
<!-- 新增-->
<!-- </Button>-->
<template #extra>
参与方式:
<Select v-model="init.reportid" style="width: 10vw;">
<Option v-for="(item,index) in personageCompetitionSelect" :value="item.id" :key="index"> {{ item.name }}
</Option>
</Select>
<Button class="ivu-ml-8" @click="resetSearchSelect">
重置
</Button>
</template>
<Table
:columns="columns"
:data="tableData"
class="ivu-mt"
:loading="loading"
:size="tableSize"
>
<template #way="{row}">
<tag :color="['success','primary'][row.way]"> {{ ['团队', '个人'][row.way] }}</tag>
</template>
<template v-slot:is_win="{row}">
<tag :color="['primary','success'][row.is_win]"> {{ ['否', '是'][row.is_win] }}</tag>
<!-- <Switch v-if="!!tableData.length " size="large" v-model="row.is_win" :true-value="1" :false-value="0"-->
<!-- @on-change="switchChange(row)">-->
<!-- <span type="md-checkmark" slot="open">是</span>-->
<!-- <span type="md-close" slot="close">否</span>-->
<!-- </Switch>-->
</template>
<template slot-scope="{ row }" slot="action">
<a @click="importScore(row)">录入成绩</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="importScore(row)" @on-cancel="cancel">
<a style="margin-left: 15px;color: red">删除成绩</a>
</Poptip>
<!-- <Button type="info" @click="importScore(row)">录入成绩</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除成绩</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
<Page
:total="init.total"
:current.sync="init.page_index"
show-total
show-sizer
:page-size="init.page_size"
@on-change="handleChangePage"
@on-page-size-change="handleChangepage_size"
/>
</div>
</Card>
<Modal
v-model="scoreModal"
title="编辑"
>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="竞赛成绩" prop="score">
<InputNumber style="width: 100%" :min="0" :max="100" v-model="formValidate.score"
placeholder="请输入竞赛成绩"></InputNumber>
</FormItem>
<FormItem label="是否获奖" prop="is_win">
<Select style="width: 100%" v-model="formValidate.is_win"
placeholder="请输入竞赛成绩">
<Option :value="i.value" v-for="(i,ind) in is_winArray" :key="ind">{{ i.name }}</Option>
</Select>
</FormItem>
<FormItem label="奖项名称" prop="prizes1">
<Input :disabled="prizesDis" style="width: 100%" v-model="formValidate.prizes"
placeholder="请输入奖项名称"></Input>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="scoreModal =false">取消</Button>
<Button type="primary" @click="scoreOk">确定</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from "@api/requestUtils";
import {myEncapsulationFunction} from "@/hook";
export default {
name: 'list',
data() {
return {
prizesDis: false,
personageCompetitionSelect: [],
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '赛事名称',
key: 'competitionname',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '报名者',
key: 'sign_name',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '竞赛形式(团/个人)',
slot: 'way',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '成绩',
key: 'score',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '是否获奖',
slot: 'is_win',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '奖项',
key: 'prizes',
align: 'center',
show: true,
minWidth: 120,
},
// {
// title: '创建时间',
// key: 'createtime',
// align: 'center',
// show: true,
// minWidth: 120,
// },
// {
// title: '创建人',
// key: 'createby',
// align: 'center',
// show: true,
// minWidth: 150,
// },
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 120,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '操作',
align: 'center',
minWidth: 180,
fixed: 'right',
show: true,
slot: 'action'
}
],
loading: false,
tableData: [],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
init: {
select: '',
page_index: 1,
page_size: 10,
total: 0,
reportid: '',
score: 0,
},
is_winArray: [
{name: '否', value: 0},
{name: '是', value: 1},
],
scoreModal: false,
ruleValidate: {
score: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'blur'},
],
prizes: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'},
],
is_win: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'},
],
},
formValidate: {
score: 0,
id: '',
prizes: '',
is_win: '',
}
}
},
watch: {
'init.reportid'(newValue, oldValue) {
this.init.reportid = newValue
newValue ? this.getData() : ''
},
'formValidate.is_win'(newValue, oldValue) {
Boolean(newValue) ? this.prizesDis = false : this.prizesDis = true
}
},
// 查询条件初始化
created() {
},
mounted() {
// this.getData()
this.GetScoreBySignSelect()
},
methods: {
scoreOk() {
this.$refs['formValidate'].validate((val) => {
if (val) {
myEncapsulationFunction(async () => {
let data = this.formValidate
const res = await api.ScoreSave(data)
await this.getData()
this.scoreModal = false
return res
})
}
})
},
// switchChange(row) {
// myEncapsulationFunction(async () => {
// let data = {
// id: row.scoreid,
// is_win: !Boolean(row.is_win) ? 0 : 1
// }
// const res = await api.WinSave(data)
// await this.getData()
// return res
// })
// console.log("🚀🚀row🚀,", row)
// },
resetSearchSelect() {
this.init.reportid = ''
},
async GetScoreBySignSelect() {
const res = await api.GetScoreBySignSelect()
this.personageCompetitionSelect = res.response
},
// 查询
async getData() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
reportid: this.init.reportid,
}
const res = await api.GetScoreList(data)
try {
this.init.total = res.response.data_count
this.tableData = res.response.data
this.loading = false
} catch (e) {
this.loading = false
}
},
// 新增
add() {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
this.$refs.addEdit.edit(row)
},
importScore(row) {
this.scoreModal = true
this.formValidate = {}
this.formValidate.id = row.scoreid
},
// 删除
del(row) {
myEncapsulationFunction(async () => {
const res = await api.ScoreDel({id: row.scoreid})
this.getData()
return res
})
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.getData()
},
// 切换每页条数
handleChangepage_size(size) {
this.current = 1;
this.init.page_size = size
this.getData()
},
}
}
</script>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<Table <Table
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:loading="loading"
> >
<template #todo="{row}"> <template #todo="{row}">
<span v-for="(item,index) in row.todo" :key="index">{{ <span v-for="(item,index) in row.todo" :key="index">{{
...@@ -32,7 +33,9 @@ ...@@ -32,7 +33,9 @@
</Tag> </Tag>
</template> </template>
<template slot-scope="{ row }" slot="action"> <template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="approvalLisFun(row)">审批</Button>
<a @click="approvalLisFun(row)">审批</a>
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">--> <!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除</Button>--> <!-- <Button type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>--> <!-- </Poptip>-->
...@@ -138,27 +141,6 @@ export default { ...@@ -138,27 +141,6 @@ export default {
show: true, show: true,
minWidth: 120, minWidth: 120,
}, },
{
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 150,
},
{ {
title: '当前节点名称', title: '当前节点名称',
key: 'current_node_name', key: 'current_node_name',
...@@ -173,7 +155,6 @@ export default { ...@@ -173,7 +155,6 @@ export default {
show: true, show: true,
minWidth: 200, minWidth: 200,
}, },
{ {
title: '参与人', title: '参与人',
slot: 'partcipant', slot: 'partcipant',
...@@ -182,26 +163,49 @@ export default { ...@@ -182,26 +163,49 @@ export default {
minWidth: 200, minWidth: 200,
}, },
{ {
title: '修改人', title: '发起人',
key: 'modifyby', key: 'starter',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 150,
}, },
{ {
title: '修改时间', title: '发起人姓名',
key: 'modifytime', key: 'starter_name',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 120,
}, },
{ {
title: '关联模块', title: '发起时间',
key: 'form_name', key: 'start_time',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 150,
}, },
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '关联模块',
// key: 'form_name',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
...@@ -237,17 +241,33 @@ export default { ...@@ -237,17 +241,33 @@ export default {
pageKey: 1 pageKey: 1
} }
}, },
watch: {},
// 查询条件初始化 // 查询条件初始化
created() { created() {
}, },
mounted() { mounted() {
this.GetFlowTaskList() this.GetFlowTaskList()
hook.storageAddEventListener(async () => {
await this.GetFlowTaskList()
})
// // 监听storage事件,当主页面修改数据时,触发该事件
// window.addEventListener('storage', (event) => {
// if (event.key === 'updataEvent' && event.newValue === 'getDataEvent') {
// //刷新主窗口
// // 执行你的逻辑
// // 重置存储的值,以便下次触发事件
// localStorage.setItem('updataEvent', '');
// this.GetFlowTaskList()
// }
// });
}, },
methods: { methods: {
// 查询 // 查询
async GetFlowTaskList() { async GetFlowTaskList() {
this.$Spin.show() this.loading = true
let data = { let data = {
page_index: this.init.page_index, page_index: this.init.page_index,
page_size: this.init.page_size page_size: this.init.page_size
...@@ -255,7 +275,7 @@ export default { ...@@ -255,7 +275,7 @@ export default {
const res = await api.GetFlowTaskList(data) const res = await api.GetFlowTaskList(data)
this.init.total = res.response.data_count this.init.total = res.response.data_count
this.tableData = res.response.data this.tableData = res.response.data
hook.publicMessage(res) this.loading = false
}, },
// 新增 // 新增
add() { add() {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<Table <Table
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:loading="loading"
> >
<template #todo="{row}"> <template #todo="{row}">
<span v-for="(item,index) in row.todo" :key="index">{{ <span v-for="(item,index) in row.todo" :key="index">{{
...@@ -32,7 +33,8 @@ ...@@ -32,7 +33,8 @@
</Tag> </Tag>
</template> </template>
<template slot-scope="{ row }" slot="action"> <template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="approvalLisFun(row)">详细</Button>
<a @click="approvalLisFun(row)">详细</a>
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">--> <!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除</Button>--> <!-- <Button type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>--> <!-- </Poptip>-->
...@@ -203,27 +205,6 @@ export default { ...@@ -203,27 +205,6 @@ export default {
show: true, show: true,
minWidth: 120, minWidth: 120,
}, },
{
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 150,
},
{ {
title: '当前节点名称', title: '当前节点名称',
key: 'current_node_name', key: 'current_node_name',
...@@ -238,7 +219,6 @@ export default { ...@@ -238,7 +219,6 @@ export default {
show: true, show: true,
minWidth: 200, minWidth: 200,
}, },
{ {
title: '参与人', title: '参与人',
slot: 'partcipant', slot: 'partcipant',
...@@ -247,26 +227,49 @@ export default { ...@@ -247,26 +227,49 @@ export default {
minWidth: 200, minWidth: 200,
}, },
{ {
title: '修改人', title: '发起人',
key: 'modifyby', key: 'starter',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 150,
}, },
{ {
title: '修改时间', title: '发起人姓名',
key: 'modifytime', key: 'starter_name',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 120,
}, },
{ {
title: '关联模块', title: '发起时间',
key: 'form_name', key: 'start_time',
align: 'center', align: 'center',
show: true, show: true,
minWidth: 200, minWidth: 150,
}, },
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '关联模块',
// key: 'form_name',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
...@@ -312,7 +315,7 @@ export default { ...@@ -312,7 +315,7 @@ export default {
methods: { methods: {
// 查询 // 查询
async GetFlowTaskList() { async GetFlowTaskList() {
this.$Spin.show() this.loading = true
let data = { let data = {
page_index: this.init.page_index, page_index: this.init.page_index,
page_size: this.init.page_size page_size: this.init.page_size
...@@ -321,7 +324,7 @@ export default { ...@@ -321,7 +324,7 @@ export default {
const res = await api.GetAlreadyFlowTaskList(data) const res = await api.GetAlreadyFlowTaskList(data)
this.init.total = res.response.data_count this.init.total = res.response.data_count
this.tableData = res.response.data this.tableData = res.response.data
hook.publicMessage(res) this.loading = false
}, },
// 新增 // 新增
add() { add() {
......
<template> <template>
<div> <div>
<Card ref="card"> <Card ref="card">
<template #title> <template #title>
...@@ -7,10 +8,13 @@ ...@@ -7,10 +8,13 @@
<h3>流程列表</h3> <h3>流程列表</h3>
</div> </div>
</template> </template>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap"> <div style="display: flex;justify-content: flex-start;flex-wrap: wrap">
<Card @click.native="flowAssembleFun(item)" <Card @click.native="flowAssembleFun(item)"
style="width: 150px;min-height: 150px;margin: 10px 5px;" style="width: 150px;min-height: 150px;margin: 10px 5px;"
v-for="(item,index) in init.data" :key="index"> v-for="(item,index) in init.data" :key="index">
<div style="display: flex;align-items: center;flex-wrap: wrap;justify-content: center"> <div style="display: flex;align-items: center;flex-wrap: wrap;justify-content: center">
<Icon :type="item.icon" size="100"/> <Icon :type="item.icon" size="100"/>
<span> <span>
...@@ -188,6 +192,7 @@ export default { ...@@ -188,6 +192,7 @@ export default {
query: { query: {
id: e.flowid, id: e.flowid,
remark: e.remark, remark: e.remark,
entrance: 'flow',
} }
}) })
window.open(href.href, '_blank') window.open(href.href, '_blank')
...@@ -200,13 +205,13 @@ export default { ...@@ -200,13 +205,13 @@ export default {
page_size: this.init.page_size page_size: this.init.page_size
} }
let res = await api.GetFlowDesignList(data) let res = await api.GetFlowDesignList(data)
let iconArray = ['ios-ribbon', 'md-trophy', 'md-list-box', 'logo-usd'] let iconArray = ['ios-ribbon', 'md-trophy', 'md-list-box', 'logo-usd', 'md-chatboxes']
res.response.data.map((currentValue, index) => { res.response.data.map((currentValue, index) => {
currentValue.icon = iconArray[index] currentValue.icon = iconArray[index]
}) })
this.init.data = res.response.data this.init.data = res.response.data
this.init.total = res.response.data_count this.init.total = res.response.data_count
hook.publicMessage(res) this.$Spin.hide()
}, },
// 新增 // 新增
add() { add() {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<Option v-for="(item,index) in levelArray" :key="index" :value="item.value">{{ item.label }}</Option> <Option v-for="(item,index) in levelArray" :key="index" :value="item.value">{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="补助时间" prop="grant_time"> <FormItem label="补助时间" prop="grant_time" :key="timeKey">
<DatePicker type="date" v-model="formValidate.grant_time" @on-change="bursaryTime" <DatePicker type="date" v-model="formValidate.grant_time" @on-change="bursaryTime"
placeholder="请选择补助时间" style="width: 100%"/> placeholder="请选择补助时间" style="width: 100%"/>
</FormItem> </FormItem>
...@@ -44,17 +44,17 @@ ...@@ -44,17 +44,17 @@
<InputNumber style="width: 100%" v-model="formValidate.money" <InputNumber style="width: 100%" v-model="formValidate.money"
placeholder="请输入补助金额"></InputNumber> placeholder="请输入补助金额"></InputNumber>
</FormItem> </FormItem>
<FormItem label="计划集训时间" prop="plan_train_time"> <FormItem label="计划集训时间" prop="plan_train_time" :key="timeKey">
<DatePicker type="date" v-model="formValidate.plan_train_time" @on-change="intensiveTrainingTime" <DatePicker type="date" v-model="formValidate.plan_train_time" @on-change="intensiveTrainingTime"
placeholder="请选择计划集训时间" style="width: 100%"/> placeholder="请选择计划集训时间" style="width: 100%"/>
</FormItem> </FormItem>
<FormItem label="实际集训起止时间" prop="train_time"> <FormItem label="实际集训起止时间" prop="train_time" :key="timeKey">
<DatePicker type="date" v-model="formValidate.train_time" @on-change="actualTrainingStartAndEndTime" <DatePicker type="date" v-model="formValidate.train_time" @on-change="actualTrainingStartAndEndTime"
placeholder="请选择实际集训起止时间" style="width: 100%"/> placeholder="请选择实际集训起止时间" style="width: 100%"/>
</FormItem> </FormItem>
<FormItem label="参赛具体情况" prop="competition_info"> <FormItem label="参赛具体情况" prop="competition_info">
<Input v-model="formValidate.competition_info" type="textarea" :autosize="{minRows: 2,maxRows: 5}" <Input v-model="formValidate.competition_info" type="textarea" :autosize="{minRows: 7,maxRows: 10}"
placeholder="请输入参赛具体情况"></Input> placeholder="请输入参赛具体情况"></Input>
</FormItem> </FormItem>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
:on-error="onError" :on-error="onError"
:on-success="onsuccess" :on-success="onsuccess"
:on-format-error="onFormatError" :on-format-error="onFormatError"
:key="fileKey"
:show-upload-list="true" :show-upload-list="true"
type="drag" type="drag"
action="" action=""
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<Button type="primary" style="margin-right: 10px" <Button type="primary" style="margin-right: 10px"
@click="handleSubmit">提交流程 @click="handleSubmit">提交流程
</Button> </Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>--> <Button type="primary" @click="save">保存</Button>
<Button @click="handleReset" style="margin-left: 8px">重置</Button> <Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -162,6 +162,12 @@ export default { ...@@ -162,6 +162,12 @@ export default {
{value: 0, label: '团队'}, {value: 0, label: '团队'},
{value: 1, label: '个人'}, {value: 1, label: '个人'},
], ],
changecommitid: '',
flowid: '',
module_id: '',
module: '',
fileKey: 1,
timeKey: 1,
competitionnameValue: '', competitionnameValue: '',
formValidate: { formValidate: {
"flowid": "", "flowid": "",
...@@ -239,6 +245,54 @@ export default { ...@@ -239,6 +245,54 @@ export default {
}, },
//方法集合", //方法集合",
methods: { methods: {
save() {
const fun = async (changecommitid) => {
let formValidate = _.cloneDeep(this.formValidate)
let files_list = formValidate.files_list
delete formValidate.files_list
let data = {
"changecommitid": changecommitid,
"flowid": this.flowid,
"module_id": this.module_id,
"module": this.module,
"bursary": formValidate,
'files_list': files_list,
}
await hook.myEncapsulationFunction(async () => {
return await api.FlowChangeCommit(data)
})
}
switch (this.changecommitid) {
case undefined :
fun(this.changecommitid)
break;
default:
fun(this.changecommitid)
break;
}
},
async FlowInit() {
const res = await api.FlowInit({flowid: this.flowid})
switch (res.response.changecommitid) {
case null:
break;
default :
res.response.bursary.rece_level = Number(res.response.bursary.rece_level)
res.response.bursary.level = Number(res.response.bursary.level)
res.response.bursary.money = Number(res.response.bursary.money)
this.formValidate = res.response.bursary
this.formValidate.files_list = res.response.files_list
//------------------------------
this.changecommitid = res.response.changecommitid
this.flowid = res.response.flowid
this.module_id = res.response.module_id
this.module = res.response.module
this.competitionSelectName(res.response.bursary.competitionname)
this.timeKey++
break;
}
},
intensiveTrainingTime(e) { intensiveTrainingTime(e) {
//计划集训时间 //计划集训时间
this.formValidate.plan_train_time = dayjs(e).format('YYYY-MM-DD') this.formValidate.plan_train_time = dayjs(e).format('YYYY-MM-DD')
...@@ -257,6 +311,7 @@ export default { ...@@ -257,6 +311,7 @@ export default {
this.formValidate.files_list.splice(index, 1) this.formValidate.files_list.splice(index, 1)
} }
}) })
this.fileKey++
}, },
onError(response, file, fileList) { onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList) console.log("🚀🚀🚀,onError", response, file, fileList)
...@@ -275,17 +330,21 @@ export default { ...@@ -275,17 +330,21 @@ export default {
const res = await api.fileUpload(this.formValidate.files_list.module, formData); const res = await api.fileUpload(this.formValidate.files_list.module, formData);
this.formValidate.files_list.push(res.response) this.formValidate.files_list.push(res.response)
hook.publicMessage(res) hook.publicMessage(res)
this.fileKey++
return false return false
}, },
handleSubmit() { handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => { this.$refs['formValidate'].validate(async (cur) => {
if (cur) { if (cur) {
this.$Spin.show() this.$Spin.show()
this.formValidate.competitionname = this.competitionnameValue this.formValidate.competitionname = this.competitionnameValue
let data = _.cloneDeep(this.formValidate) let data = _.cloneDeep(this.formValidate)
data.flowid = this.flowid
const res = await api.FlowBursarySubmit(data) const res = await api.FlowBursarySubmit(data)
hook.publicMessage(res) hook.publicMessage(res)
setTimeout(() => {
window.open("about:blank", "_top").close()
}, 1500)
} }
}) })
}, },
...@@ -330,6 +389,9 @@ export default { ...@@ -330,6 +389,9 @@ export default {
this.getCompetiotionName() this.getCompetiotionName()
this.formValidate.flowid = this.$route.query.id; this.formValidate.flowid = this.$route.query.id;
this.formValidate.files_list.module = this.$route.query.remark; this.formValidate.files_list.module = this.$route.query.remark;
this.flowid = this.$route.query.id;
this.module = this.$route.query.remark;
this.FlowInit()
}, },
//生命周期 - 更新之前",数据模型已更新,html模板未更新 //生命周期 - 更新之前",数据模型已更新,html模板未更新
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -46,7 +46,7 @@ function errorLog(err) { ...@@ -46,7 +46,7 @@ function errorLog(err) {
// 创建一个 axios 实例 // 创建一个 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
timeout: 10000 // 请求超时时间 timeout: 60000 // 请求超时时间
}); });
let flag = 1 let flag = 1
const refreshToken = async () => { const refreshToken = async () => {
......
...@@ -26,33 +26,28 @@ const router = new VueRouter({ ...@@ -26,33 +26,28 @@ const router = new VueRouter({
*/ */
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
console.log(to, '111to')
console.log(from, 'fr111om')
console.log(next, 'nex11t')
if (Setting.showProgressBar) iView.LoadingBar.start(); if (Setting.showProgressBar) iView.LoadingBar.start();
// 判断是否需要登录才可以进入 // 判断是否需要登录才可以进入
if (to.matched.some(_ => _.meta.auth)) { if (to.matched.some(_ => _.meta.auth)) {
// 这里依据 token 判断是否登录,可视情况修改 // 这里依据 token 判断是否登录,可视情况修改
const token = util.cookies.get('token'); const token = util.cookies.get('token');
if (token && token !== 'undefined') { if (token && token !== 'undefined') {
console.log("🚀🚀1111🚀,")
next(); next();
} else { } else {
console.log("🚀🚀2---------2222🚀,") console.log("🚀🚀2---------2222🚀,")
let token = '' let token = ''
if (Cookies.get('token')) { if (Cookies.get('token') && Cookies.get('token') !== 'undefined' || Cookies.get('token') && Cookies.get('token') !== 'null') {
token = Cookies.get('token') token = Cookies.get('token')
console.log("🚀🚀Cookies🚀,", token) console.log("🚀🚀Cookies🚀,", token)
} else { } else {
token = localStorage.getItem('token') token = localStorage.getItem('token')
Cookies.set('token', token) // Cookies.set('token', token)
console.log("🚀🚀localStorage🚀,", token) console.log("🚀🚀localStorage🚀,", token)
} }
await store.dispatch('admin/account/ascLogin', { await store.dispatch('admin/account/ascLogin', {
"token": token "token": token
}, {root: true}); }, {root: true});
console.log("🚀🚀🚀我验证完成了,", token)
console.log("🚀🚀22222🚀,")
next(); next();
// 没有登录的时候跳转到登录界面 // 没有登录的时候跳转到登录界面
...@@ -66,7 +61,6 @@ router.beforeEach(async (to, from, next) => { ...@@ -66,7 +61,6 @@ router.beforeEach(async (to, from, next) => {
} }
} else { } else {
// 不需要身份校验 直接通过 // 不需要身份校验 直接通过
console.log("🚀🚀333333🚀,")
next(); next();
} }
}); });
......
import BasicLayout from '@/layouts/basic-layout';
const meta = {
auth: true
};
export default {
path: '/',
name: '',
meta,
component: BasicLayout,
children: [
{
path: `competitionNotice`,
name: `competitionNotice`,
meta: {
...meta,
title: '竞赛公告列表',
closable: false
},
component: () => import('@/pages/CompetititonNotice/index')
}
]
};
import BasicLayout from '@/layouts/basic-layout';
const meta = {
auth: true
};
export default {
path: '/',
name: '',
meta,
component: BasicLayout,
directive: {
name: 'competitionScore'
},
children: [
{
path: `competitionScore`,
name: `competitionScore`,
meta: {
...meta,
title: '竞赛成绩列表',
closable: false
},
component: () => import('@/pages/competitionScore/index')
}
]
};
此差异已折叠。
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或