Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
school-paper-admin-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
school-paper
school-paper-admin-front
Commits
7fd8f3a1
Commit
7fd8f3a1
authored
Jul 24, 2023
by
H.wb.wang.peixun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
837b90ca
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
328 additions
and
79 deletions
+328
-79
src/components/DragUpload/index.vue
+213
-0
src/main.js
+3
-0
src/views/school-paper/dict/index.vue
+23
-19
src/views/school-paper/profile/index.vue
+18
-21
src/views/school-paper/testPaperRecord/index.vue
+69
-37
vue.config.js
+2
-2
No files found.
src/components/DragUpload/index.vue
0 → 100644
View file @
7fd8f3a1
<
template
>
<div
class=
"upload-file"
>
<el-upload
class=
"upload-demo"
drag
:action=
"uploadFileUrl"
:before-upload=
"handleBeforeUpload"
:file-list=
"fileList"
:limit=
"limit"
:on-error=
"handleUploadError"
:on-exceed=
"handleExceed"
:on-success=
"handleUploadSuccess"
:show-file-list=
"false"
:headers=
"headers"
ref=
"fileUpload"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<!--
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
-->
</el-upload>
<!-- 文件列表 -->
<transition-group
class=
"upload-file-list el-upload-list el-upload-list--text"
name=
"el-fade-in-linear"
tag=
"ul"
>
<li
:key=
"file.url"
class=
"el-upload-list__item ele-upload-list__item-content"
v-for=
"(file, index) in fileList"
>
<el-link
:href=
"`$
{file.url}`" :underline="false" target="_blank">
<span
class=
"el-icon-document"
>
{{
getFileName
(
file
.
name
)
}}
</span>
</el-link>
<div
class=
"ele-upload-list__item-content-action"
>
<el-link
:underline=
"false"
@
click=
"handleDelete(index)"
type=
"danger"
>
删除
</el-link>
</div>
</li>
</transition-group>
</div>
</
template
>
<
script
>
import
{
getToken
}
from
"@/utils/auth"
;
import
{
listByIds
,
delOss
}
from
"@/api/system/oss"
;
export
default
{
name
:
"FileUpload"
,
props
:
{
// 值
value
:
[
String
,
Object
,
Array
],
// 数量限制
limit
:
{
type
:
Number
,
default
:
5
,
},
// 大小限制(MB)
fileSize
:
{
type
:
Number
,
default
:
5
,
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType
:
{
type
:
Array
,
default
:
()
=>
[
"doc"
,
"xls"
,
"ppt"
,
"txt"
,
"pdf"
,
"xlsx"
],
},
// 是否显示提示
isShowTip
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
return
{
number
:
0
,
uploadList
:
[],
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
,
uploadFileUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"/system/oss/upload"
,
// 上传文件服务器地址
headers
:
{
Authorization
:
"Bearer "
+
getToken
(),
},
fileList
:
[],
};
},
watch
:
{
value
:
{
async
handler
(
val
)
{
if
(
val
)
{
let
temp
=
1
;
// 首先将值转为数组
let
list
;
if
(
Array
.
isArray
(
val
))
{
list
=
val
;
}
else
{
await
listByIds
(
val
).
then
(
res
=>
{
list
=
res
.
data
.
map
(
oss
=>
{
oss
=
{
name
:
oss
.
originalName
,
url
:
oss
.
url
,
ossId
:
oss
.
ossId
};
return
oss
;
});
})
}
// 然后将数组转为对象数组
this
.
fileList
=
list
.
map
(
item
=>
{
item
=
{
name
:
item
.
name
,
url
:
item
.
url
,
ossId
:
item
.
ossId
};
item
.
uid
=
item
.
uid
||
new
Date
().
getTime
()
+
temp
++
;
return
item
;
});
}
else
{
this
.
fileList
=
[];
return
[];
}
},
deep
:
true
,
immediate
:
true
}
},
computed
:
{
// 是否显示提示
showTip
()
{
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
},
},
methods
:
{
// 上传前校检格式和大小
handleBeforeUpload
(
file
)
{
// 校检文件类型
if
(
this
.
fileType
)
{
const
fileName
=
file
.
name
.
split
(
'.'
);
const
fileExt
=
fileName
[
fileName
.
length
-
1
];
const
isTypeOk
=
this
.
fileType
.
indexOf
(
fileExt
)
>=
0
;
if
(
!
isTypeOk
)
{
this
.
$modal
.
msgError
(
`文件格式不正确, 请上传
${
this
.
fileType
.
join
(
"/"
)}
格式文件!`
);
return
false
;
}
}
// 校检文件大小
if
(
this
.
fileSize
)
{
const
isLt
=
file
.
size
/
1024
/
1024
<
this
.
fileSize
;
if
(
!
isLt
)
{
this
.
$modal
.
msgError
(
`上传文件大小不能超过
${
this
.
fileSize
}
MB!`
);
return
false
;
}
}
this
.
$modal
.
loading
(
"正在上传文件,请稍候..."
);
this
.
number
++
;
return
true
;
},
// 文件个数超出
handleExceed
()
{
this
.
$modal
.
msgError
(
`上传文件数量不能超过
${
this
.
limit
}
个!`
);
},
// 上传失败
handleUploadError
(
err
)
{
this
.
$modal
.
msgError
(
"上传文件失败,请重试"
);
this
.
$modal
.
closeLoading
();
},
// 上传成功回调
handleUploadSuccess
(
res
,
file
)
{
if
(
res
.
code
===
200
)
{
this
.
uploadList
.
push
({
name
:
res
.
data
.
fileName
,
url
:
res
.
data
.
url
,
ossId
:
res
.
data
.
ossId
});
this
.
uploadedSuccessfully
();
}
else
{
this
.
number
--
;
this
.
$modal
.
closeLoading
();
this
.
$modal
.
msgError
(
res
.
msg
);
this
.
$refs
.
fileUpload
.
handleRemove
(
file
);
this
.
uploadedSuccessfully
();
}
},
// 删除文件
handleDelete
(
index
)
{
let
ossId
=
this
.
fileList
[
index
].
ossId
;
delOss
(
ossId
);
this
.
fileList
.
splice
(
index
,
1
);
this
.
$emit
(
"input"
,
this
.
listToString
(
this
.
fileList
));
},
// 上传结束处理
uploadedSuccessfully
()
{
if
(
this
.
number
>
0
&&
this
.
uploadList
.
length
===
this
.
number
)
{
this
.
fileList
=
this
.
fileList
.
concat
(
this
.
uploadList
);
this
.
uploadList
=
[];
this
.
number
=
0
;
this
.
$emit
(
"input"
,
this
.
listToString
(
this
.
fileList
));
this
.
$modal
.
closeLoading
();
}
},
// 获取文件名称
getFileName
(
name
)
{
// 如果是url那么取最后的名字 如果不是直接返回
if
(
name
.
lastIndexOf
(
"/"
)
>
-
1
)
{
return
name
.
slice
(
name
.
lastIndexOf
(
"/"
)
+
1
);
}
else
{
return
name
;
}
},
// 对象转成指定字符串分隔
listToString
(
list
,
separator
)
{
let
strs
=
""
;
separator
=
separator
||
","
;
for
(
let
i
in
list
)
{
strs
+=
list
[
i
].
ossId
+
separator
;
}
return
strs
!=
""
?
strs
.
substr
(
0
,
strs
.
length
-
1
)
:
""
;
},
},
};
</
script
>
<
style
scoped
lang=
"scss"
>
.upload-file-uploader
{
margin-bottom
:
5px
;
}
.upload-file-list
.el-upload-list__item
{
border
:
1px
solid
#e4e7ed
;
line-height
:
2
;
margin-bottom
:
10px
;
position
:
relative
;
}
.upload-file-list
.ele-upload-list__item-content
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
color
:
inherit
;
}
//
.ele-upload-list__item-content-action
.el-link
{
//
margin-right
:
10px
;
//
}
</
style
>
src/main.js
View file @
7fd8f3a1
...
@@ -27,6 +27,8 @@ import RightToolbar from "@/components/RightToolbar"
...
@@ -27,6 +27,8 @@ import RightToolbar from "@/components/RightToolbar"
import
Editor
from
"@/components/Editor"
import
Editor
from
"@/components/Editor"
// 文件上传组件
// 文件上传组件
import
FileUpload
from
"@/components/FileUpload"
import
FileUpload
from
"@/components/FileUpload"
// 文件拖拽上传组件
import
DragUpload
from
"@/components/DragUpload"
// 图片上传组件
// 图片上传组件
import
ImageUpload
from
"@/components/ImageUpload"
import
ImageUpload
from
"@/components/ImageUpload"
// 图片预览组件
// 图片预览组件
...
@@ -56,6 +58,7 @@ Vue.component('Pagination', Pagination)
...
@@ -56,6 +58,7 @@ Vue.component('Pagination', Pagination)
Vue
.
component
(
'RightToolbar'
,
RightToolbar
)
Vue
.
component
(
'RightToolbar'
,
RightToolbar
)
Vue
.
component
(
'Editor'
,
Editor
)
Vue
.
component
(
'Editor'
,
Editor
)
Vue
.
component
(
'FileUpload'
,
FileUpload
)
Vue
.
component
(
'FileUpload'
,
FileUpload
)
Vue
.
component
(
'DragUpload'
,
DragUpload
)
Vue
.
component
(
'ImageUpload'
,
ImageUpload
)
Vue
.
component
(
'ImageUpload'
,
ImageUpload
)
Vue
.
component
(
'ImagePreview'
,
ImagePreview
)
Vue
.
component
(
'ImagePreview'
,
ImagePreview
)
...
...
src/views/school-paper/dict/index.vue
View file @
7fd8f3a1
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<
!--
<
el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"父级id"
prop=
"parentId"
>
<el-form-item
label=
"父级id"
prop=
"parentId"
>
<el-input
<el-input
v-model=
"queryParams.parentId"
v-model=
"queryParams.parentId"
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
-->
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
...
@@ -32,9 +32,9 @@
...
@@ -32,9 +32,9 @@
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPermi=
"['school-paper:dict:add']"
v-hasPermi=
"['school-paper:dict:add']"
>
新增
</el-button>
>
新增
类别
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<
!--
<
el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"success"
type=
"success"
plain
plain
...
@@ -65,18 +65,18 @@
...
@@ -65,18 +65,18 @@
@
click=
"handleExport"
@
click=
"handleExport"
v-hasPermi=
"['school-paper:dict:export']"
v-hasPermi=
"['school-paper:dict:export']"
>
导出
</el-button>
>
导出
</el-button>
</el-col>
</el-col>
-->
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
</el-row>
<el-table
v-loading=
"loading"
:data=
"dictList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"dictList"
@
selection-change=
"handleSelectionChange"
>
<
el-table-column
type=
"selection"
width=
"55"
align=
"center"
/
>
<
!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
--
>
<el-table-column
label=
"
主键id"
align=
"center"
prop=
"id"
v-if=
"true"
/>
<el-table-column
label=
"
类别名称"
prop=
"name"
/>
<el-table-column
label=
"父级id"
align=
"center"
prop=
"parentId"
/>
<
!--
<
el-table-column
label=
"父级id"
align=
"center"
prop=
"parentId"
/>
<el-table-column
label=
"类型:1 类别,2 阶段,3 班级"
align=
"center"
prop=
"type"
/>
<el-table-column
label=
"类型:1 类别,2 阶段,3 班级"
align=
"center"
prop=
"type"
/>
<el-table-column
label=
"名称"
align=
"center"
prop=
"typeValue"
/>
<el-table-column
label=
"名称"
align=
"center"
prop=
"typeValue"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"状态:0正常,1删除"
align=
"center"
prop=
"typeStatus"
/>
<el-table-column
label=
"状态:0正常,1删除"
align=
"center"
prop=
"typeStatus"
/>
-->
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
<el-button
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
icon=
"el-icon-edit"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['school-paper:dict:edit']"
v-hasPermi=
"['school-paper:dict:edit']"
>
修改
</el-button>
>
编辑
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
<!-- 添加或修改字典对话框 -->
<!-- 添加或修改字典对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<
!-- <
el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父级id" prop="parentId">
<el-form-item label="父级id" prop="parentId">
<el-input v-model="form.parentId" placeholder="请输入父级id" />
<el-input v-model="form.parentId" placeholder="请输入父级id" />
</el-form-item>
</el-form-item>
...
@@ -117,17 +117,19 @@
...
@@ -117,17 +117,19 @@
<el-form-item label="备注" prop="remark">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form-item>
</el-form>
</el-form> -->
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-input
v-model=
"form.remark"
placeholder=
"请输入类别名称"
/>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center;"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<
el-button
@
click=
"cancel"
>
取 消
</el-button
>
<
!-- <el-button @click="cancel">取 消</el-button> --
>
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
listDict
,
getDict
,
delDict
,
addDict
,
updateDict
}
from
"@/api/school-paper/dict"
;
//
import { listDict, getDict, delDict, addDict, updateDict } from "@/api/school-paper/dict";
export
default
{
export
default
{
name
:
"Dict"
,
name
:
"Dict"
,
...
@@ -136,7 +138,7 @@ export default {
...
@@ -136,7 +138,7 @@ export default {
// 按钮loading
// 按钮loading
buttonLoading
:
false
,
buttonLoading
:
false
,
// 遮罩层
// 遮罩层
loading
:
tru
e
,
loading
:
fals
e
,
// 选中数组
// 选中数组
ids
:
[],
ids
:
[],
// 非单个禁用
// 非单个禁用
...
@@ -148,7 +150,9 @@ export default {
...
@@ -148,7 +150,9 @@ export default {
// 总条数
// 总条数
total
:
0
,
total
:
0
,
// 字典表格数据
// 字典表格数据
dictList
:
[],
dictList
:
[{
name
:
'1'
}],
// 弹出层标题
// 弹出层标题
title
:
""
,
title
:
""
,
// 是否显示弹出层
// 是否显示弹出层
...
@@ -188,7 +192,7 @@ export default {
...
@@ -188,7 +192,7 @@ export default {
};
};
},
},
created
()
{
created
()
{
this
.
getList
();
//
this.getList();
},
},
methods
:
{
methods
:
{
/** 查询字典列表 */
/** 查询字典列表 */
...
@@ -241,7 +245,7 @@ export default {
...
@@ -241,7 +245,7 @@ export default {
handleAdd
()
{
handleAdd
()
{
this
.
reset
();
this
.
reset
();
this
.
open
=
true
;
this
.
open
=
true
;
this
.
title
=
"
添加字典
"
;
this
.
title
=
"
请输入类别名称
"
;
},
},
/** 修改按钮操作 */
/** 修改按钮操作 */
handleUpdate
(
row
)
{
handleUpdate
(
row
)
{
...
...
src/views/school-paper/profile/index.vue
View file @
7fd8f3a1
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"资料
名称
"
prop=
"profileName"
>
<el-form-item
label=
"资料
管理
"
prop=
"profileName"
>
<el-input
<el-input
v-model=
"queryParams.profileName"
v-model=
"queryParams.profileName"
placeholder=
"请输入资料名称"
placeholder=
"请输入资料名称
搜索
"
clearable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"资料地址"
prop=
"profileUrl"
>
<
!--
<
el-form-item
label=
"资料地址"
prop=
"profileUrl"
>
<el-input
<el-input
v-model=
"queryParams.profileUrl"
v-model=
"queryParams.profileUrl"
placeholder=
"请输入资料地址"
placeholder=
"请输入资料地址"
clearable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
-->
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
...
@@ -32,9 +32,9 @@
...
@@ -32,9 +32,9 @@
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPermi=
"['school-paper:profile:add']"
v-hasPermi=
"['school-paper:profile:add']"
>
新增
</el-button>
>
上传
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<
!--
<
el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"success"
type=
"success"
plain
plain
...
@@ -65,17 +65,17 @@
...
@@ -65,17 +65,17 @@
@
click=
"handleExport"
@
click=
"handleExport"
v-hasPermi=
"['school-paper:profile:export']"
v-hasPermi=
"['school-paper:profile:export']"
>
导出
</el-button>
>
导出
</el-button>
</el-col>
</el-col>
-->
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
</el-row>
<el-table
v-loading=
"loading"
:data=
"profileList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"profileList"
@
selection-change=
"handleSelectionChange"
>
<
el-table-column
type=
"selection"
width=
"55"
align=
"center"
/
>
<
!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
--
>
<
el-table-column
label=
"主键id"
align=
"center"
prop=
"id"
v-if=
"true"
/
>
<
!--
<el-table-column
label=
"主键id"
align=
"center"
prop=
"id"
v-if=
"true"
/>
--
>
<el-table-column
label=
"资料名称"
align=
"center"
prop=
"profileName"
/>
<el-table-column
label=
"资料名称"
prop=
"profileName"
/>
<el-table-column
label=
"
资料地址"
align=
"center"
prop=
"profileUrl"
/>
<el-table-column
label=
"
上传者"
prop=
"profileUrl"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<
!--
<
el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"状态:0正常,1删除"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"状态:0正常,1删除"
align=
"center"
prop=
"status"
/>
-->
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
<el-button
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
icon=
"el-icon-edit"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['school-paper:profile:edit']"
v-hasPermi=
"['school-paper:profile:edit']"
>
修改
</el-button>
>
下载
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
...
@@ -110,16 +110,13 @@
...
@@ -110,16 +110,13 @@
<el-form-item
label=
"资料名称"
prop=
"profileName"
>
<el-form-item
label=
"资料名称"
prop=
"profileName"
>
<el-input
v-model=
"form.profileName"
placeholder=
"请输入资料名称"
/>
<el-input
v-model=
"form.profileName"
placeholder=
"请输入资料名称"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"资料地址"
prop=
"profileUrl"
>
<el-form-item
label=
"上传文件"
prop=
"profileUrl"
>
<el-input
v-model=
"form.profileUrl"
placeholder=
"请输入资料地址"
/>
<DragUpload
v-model=
"form.file"
/>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
placeholder=
"请输入备注"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center;"
>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
上 传
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
...
...
src/views/school-paper/testPaperRecord/index.vue
View file @
7fd8f3a1
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"
用户id
"
prop=
"userId"
>
<el-form-item
label=
"
审批阅卷
"
prop=
"userId"
>
<el-input
<el-input
v-model=
"queryParams.userId"
v-model=
"queryParams.userId"
placeholder=
"请输入
用户id
"
placeholder=
"请输入
试卷名称搜索
"
clearable
clearable
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"试卷id"
prop=
"testPaperId"
>
<el-form-item
label=
"阶段"
prop=
"testPaperId"
>
<el-input
<el-select
v-model=
"value"
placeholder=
"请选择阶段"
>
v-model=
"queryParams.testPaperId"
<el-option
placeholder=
"请输入试卷id"
v-for=
"item in options"
clearable
:key=
"item.value"
@
keyup
.
enter
.
native=
"handleQuery"
:label=
"item.label"
/>
:value=
"item.value"
>
</el-form-item>
</el-option>
<el-form-item
label=
"总得分"
prop=
"totalPoints"
>
</el-select>
<el-input
v-model=
"queryParams.totalPoints"
placeholder=
"请输入总得分"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
...
@@ -31,7 +25,7 @@
...
@@ -31,7 +25,7 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<
!--
<
el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"primary"
type=
"primary"
...
@@ -75,32 +69,41 @@
...
@@ -75,32 +69,41 @@
>
导出
</el-button>
>
导出
</el-button>
</el-col>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
</el-row>
-->
<el-table
v-loading=
"loading"
:data=
"testPaperRecordList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-
if=
"typePaper == 1"
v-
loading=
"loading"
:data=
"testPaperRecordList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<
!--
<
el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"主键id"
align=
"center"
prop=
"id"
v-if=
"true"
/>
<el-table-column
label=
"主键id"
align=
"center"
prop=
"id"
v-if=
"true"
/>
-->
<el-table-column
label=
"
用户id
"
align=
"center"
prop=
"userId"
/>
<el-table-column
label=
"
试卷名称
"
align=
"center"
prop=
"userId"
/>
<el-table-column
label=
"
试卷id
"
align=
"center"
prop=
"testPaperId"
/>
<el-table-column
label=
"
满分
"
align=
"center"
prop=
"testPaperId"
/>
<el-table-column
label=
"
状态:0 批卷中,1 批卷完成
"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"
阶段
"
align=
"center"
prop=
"status"
/>
<el-table-column
label=
"总得分"
align=
"center"
prop=
"totalPoints"
/>
<
!--
<
el-table-column
label=
"总得分"
align=
"center"
prop=
"totalPoints"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
-->
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
<el-button
type=
"primary"
size=
"medium"
@
click=
"examination(1)"
>
批卷
</el-button>
size=
"mini"
type=
"text"
<!--
<el-button
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['school-paper:testPaperRecord:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['school-paper:testPaperRecord:remove']"
v-hasPermi=
"['school-paper:testPaperRecord:remove']"
>
删除
</el-button>
>
删除
</el-button>
-->
</
template
>
</el-table-column>
</el-table>
<el-table
v-if=
"typePaper == 2"
v-loading=
"loading"
:data=
"testPaperRecordList"
@
selection-change=
"handleSelectionChange"
>
<!-- <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" v-if="true"/> -->
<el-table-column
label=
"同学名称"
align=
"center"
prop=
"userId"
/>
<el-table-column
label=
"班级"
align=
"center"
prop=
"testPaperId"
/>
<el-table-column
label=
"得分"
align=
"center"
prop=
"status"
/>
<!-- <el-table-column label="总得分" align="center" prop="totalPoints" />
<el-table-column label="备注" align="center" prop="remark" /> -->
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"medium"
@
click=
"examination(2)"
>
批卷
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -117,7 +120,8 @@
...
@@ -117,7 +120,8 @@
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"用户id"
prop=
"userId"
>
<el-form-item
label=
"用户id"
prop=
"userId"
>
<el-input
v-model=
"form.userId"
placeholder=
"请输入用户id"
/>
<editor
v-model=
"form.optionContent"
:min-height=
"192"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"试卷id"
prop=
"testPaperId"
>
<el-form-item
label=
"试卷id"
prop=
"testPaperId"
>
<el-input
v-model=
"form.testPaperId"
placeholder=
"请输入试卷id"
/>
<el-input
v-model=
"form.testPaperId"
placeholder=
"请输入试卷id"
/>
...
@@ -144,6 +148,24 @@ export default {
...
@@ -144,6 +148,24 @@ export default {
name
:
"TestPaperRecord"
,
name
:
"TestPaperRecord"
,
data
()
{
data
()
{
return
{
return
{
value
:
''
,
typePaper
:
1
,
options
:
[{
value
:
'选项1'
,
label
:
'黄金糕'
},
{
value
:
'选项2'
,
label
:
'双皮奶'
},
{
value
:
'选项3'
,
label
:
'蚵仔煎'
},
{
value
:
'选项4'
,
label
:
'龙须面'
},
{
value
:
'选项5'
,
label
:
'北京烤鸭'
}],
// 按钮loading
// 按钮loading
buttonLoading
:
false
,
buttonLoading
:
false
,
// 遮罩层
// 遮罩层
...
@@ -202,6 +224,16 @@ export default {
...
@@ -202,6 +224,16 @@ export default {
this
.
getList
();
this
.
getList
();
},
},
methods
:
{
methods
:
{
// 批卷
examination
(
val
){
if
(
val
==
1
){
this
.
typePaper
=
2
}
else
if
(
val
==
2
){
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加答题记录"
;
}
},
/** 查询答题记录列表 */
/** 查询答题记录列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
...
vue.config.js
View file @
7fd8f3a1
...
@@ -35,8 +35,8 @@ module.exports = {
...
@@ -35,8 +35,8 @@ module.exports = {
proxy
:
{
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
[
process
.
env
.
VUE_APP_BASE_API
]:
{
/* target: `https://farming.nyinhong.com/api`,*/
target
:
`https://farming.nyinhong.com/api`
,
target
:
`http://127.0.0.1:8111`
,
//
target: `http://127.0.0.1:8111`,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment