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
bd22908c
Commit
bd22908c
authored
Jul 28, 2023
by
H.wb.wang.peixun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口对接
parent
41e7a6e5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
144 additions
and
94 deletions
+144
-94
.env.production
+1
-1
src/api/school-paper/profile.js
+2
-2
src/components/DragUpload/index.vue
+81
-47
src/components/Editor/index.vue
+3
-3
src/views/school-paper/errorList/index.vue
+27
-32
src/views/school-paper/profile/index.vue
+19
-8
src/views/school-paper/questionBank/index.vue
+1
-1
src/views/school-paper/testPaper/components/treeselect.vue
+10
-0
No files found.
.env.production
View file @
bd22908c
...
...
@@ -14,4 +14,4 @@ VUE_APP_MONITRO_ADMIN = '/admin/login'
VUE_APP_XXL_JOB_ADMIN = '/xxl-job-admin'
# 若依管理系统/生产环境
VUE_APP_BASE_API = '/api'
VUE_APP_BASE_API = '/api
/
'
src/api/school-paper/profile.js
View file @
bd22908c
...
...
@@ -36,9 +36,9 @@ export function updateProfile(data) {
}
// 删除资料
export
function
delProfile
(
id
)
{
export
function
delProfile
(
id
s
)
{
return
request
({
url
:
'/school-paper/profile/'
+
id
,
url
:
'/school-paper/profile/'
+
id
s
,
method
:
'delete'
})
}
src/components/DragUpload/index.vue
View file @
bd22908c
...
...
@@ -57,45 +57,13 @@ export default {
number
:
0
,
uploadList
:
[],
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
,
uploadFileUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"
/system/oss/upload
"
,
// 上传文件服务器地址
uploadFileUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"
school-paper/banner/uploadFile
"
,
// 上传文件服务器地址
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
()
{
...
...
@@ -103,22 +71,88 @@ export default {
},
},
methods
:
{
// 文件上传中处理
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
// 上传前校检格式和大小
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
;
},
// 文件上传成功处理
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"
+
response
.
msg
+
"</div>"
,
"导入结果"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getList
();
// 文件个数超出
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
.
originalFilename
,
url
:
res
.
data
.
url
});
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
)
{
console
.
log
(
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
)
:
""
;
},
// 提交上传文件
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
}
},
};
</
script
>
...
...
src/components/Editor/index.vue
View file @
bd22908c
...
...
@@ -103,14 +103,14 @@ export default {
watch
:
{
value
:
{
handler
(
val
)
{
console
.
log
(
val
,
'val-------------'
)
//
console.log(val, 'val-------------')
if
(
val
!==
this
.
currentValue
)
{
this
.
currentValue
=
val
===
null
?
""
:
val
;
console
.
log
(
this
.
currentValue
,
'val-------------11111111'
)
//
console.log(this.currentValue, 'val-------------11111111')
if
(
this
.
Quill
)
{
this
.
Quill
.
pasteHTML
(
this
.
currentValue
);
console
.
log
(
this
.
Quill
,
'val-------------2222222222222'
)
//
console.log(this.Quill, 'val-------------2222222222222')
}
}
...
...
src/views/school-paper/errorList/index.vue
View file @
bd22908c
...
...
@@ -2,13 +2,12 @@
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"题库类别"
prop=
"categoryId"
>
<el-select
clearable
v-model=
"queryParams.categoryId"
placeholder=
"请选择题库类别"
@
change=
"handleQuery"
>
<el-select
clearable
v-model=
"queryParams.categoryId"
placeholder=
"请选择题库类别"
>
<el-option
v-for=
"item in category"
:key=
"item.id"
:label=
"item.typeValue"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"习题种类:"
prop=
"species"
>
<!-- 1填空,2选择,3解答 -->
<!--
<el-form-item
label=
"习题种类:"
prop=
"species"
>
<el-select
clearable
v-model=
"queryParams.species"
placeholder=
"请选择习题种类"
@
change=
"handleQuery"
>
<el-option
v-for=
"item in [
{ label: '全部', value: '' },
...
...
@@ -18,9 +17,9 @@
]" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form-item>
-->
<el-form-item
label=
"类型"
prop=
"type"
>
<el-select
clearable
v-model=
"queryParams.type"
placeholder=
"请选择类型"
@
change=
"handleQuery"
>
<el-select
clearable
v-model=
"queryParams.type"
placeholder=
"请选择类型"
>
<el-option
v-for=
"item in [
{ label: '全部', value: '' },
{ label: '典例精讲', value: '1' },
...
...
@@ -30,7 +29,7 @@
</el-form-item>
<el-form-item
label=
"强度分类:"
prop=
"intensity"
>
<!-- 1基础,2中等,3提高 -->
<el-select
clearable
v-model=
"queryParams.intensity"
placeholder=
"请选择强度"
@
change=
"handleQuery"
>
<el-select
clearable
v-model=
"queryParams.intensity"
placeholder=
"请选择强度"
>
<el-option
v-for=
"item in [
{ label: '全部', value: '' },
{ label: '基础', value: '1' },
...
...
@@ -217,47 +216,51 @@
<el-row
:gutter=
"24"
>
<el-col
:span=
"6"
>
<el-form-item
label=
"题库类别"
prop=
"categoryId"
>
<el-select
clearable
v-model=
"form.categoryId"
placeholder=
"请选择题库类别"
>
<
!--
<
el-select
clearable
v-model=
"form.categoryId"
placeholder=
"请选择题库类别"
>
<el-option
v-for=
"item in category"
:key=
"item.id"
:label=
"item.typeValue"
:value=
"item.id"
>
</el-option>
</el-select>
</el-select>
-->
<el-input
v-model=
"form.typeName"
placeholder=
"请输入内容"
disabled
></el-input>
</el-form-item>
<el-form-item
label=
"年级阶段"
prop=
"phaseId"
>
<el-select
clearable
v-model=
"form.phaseId"
placeholder=
"请选择阶段"
@
change=
"handleQuery"
>
<el-input
v-model=
"form.phaseName"
placeholder=
"请输入内容"
disabled
></el-input>
<!--
<el-select
clearable
v-model=
"form.phaseId"
placeholder=
"请选择阶段"
@
change=
"handleQuery"
>
<el-option
v-for=
"item in [
{ label: '高一', value: '1' },
{ label: '高二', value: '2' },
{ label: '高三', value: '3' },
]" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-select>
-->
</el-form-item>
<el-form-item
label=
"强度分类:"
prop=
"intensity"
>
<!-- 1基础,2中等,3提高 -->
<el-select
clearable
v-model=
"form.intensity"
placeholder=
"请选择强度"
>
<el-input
v-model=
"form.intensity"
placeholder=
"请输入内容"
disabled
></el-input>
<!--
<el-select
clearable
v-model=
"form.intensity"
placeholder=
"请选择强度"
>
<el-option
v-for=
"item in [
{ label: '基础', value: '1' },
{ label: '中等', value: '2' },
{ label: '提高', value: '3' },
]" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-select>
-->
</el-form-item>
<el-form-item
label=
"习题种类:"
prop=
"species"
>
<!-- 1填空,2选择,3解答 -->
<el-select
clearable
v-model=
"form.species"
placeholder=
"请选择习题种类"
@
change=
"changeSpecies"
>
<el-input
v-model=
"form.species"
placeholder=
"请输入内容"
disabled
></el-input>
<!--
<el-select
clearable
v-model=
"form.species"
placeholder=
"请选择习题种类"
@
change=
"changeSpecies"
>
<el-option
v-for=
"item in [
{ label: '填空', value: '1' },
{ label: '选择', value: '2' },
{ label: '解答', value: '3' },
]" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-select>
-->
</el-form-item>
</el-col>
<el-col
:span=
"18"
>
<el-form-item
label=
"题目"
prop=
"topic"
>
<editor
v-model=
"form.topic"
:min-height=
"192"
:iconType=
"['image']"
/>
<editor
v-model=
"form.topic"
:min-height=
"192"
:iconType=
"['image']"
:readOnly=
"true"
/>
</el-form-item>
<template
v-if=
"[1, '1', 3, '3'].includes(form.species)"
>
<el-form-item
label=
"答案"
prop=
"answer"
>
...
...
@@ -277,22 +280,22 @@
index
|
filterType
(
form
.
options
)
}}
</span><i
v-if=
"index + 1 === form.options.length"
class=
"el-icon-circle-plus-outline app-container-form-check-item-add"
@
click=
"clickCheckItemAdd(index)"
></i>
></i>
<i
class=
"el-icon-remove-outline app-container-form-check-item-del"
v-else
@
click=
"clickCheckItemDel(index)"
></i>
<editor
v-model=
"item.html"
:min-height=
"192"
:iconType=
"['image']"
/>
></i>
<editor
v-model=
"item.html"
:min-height=
"192"
:iconType=
"['image']"
:readOnly=
"true"
/>
</div>
</div>
</el-form-item>
<el-form-item
label=
"标准答案"
prop=
"rightAnswers"
v-if=
"form.options && form.options.length"
>
<el-radio-group
v-model=
"form.rightAnswers"
>
<el-radio
:label=
"index"
v-for=
"(item, index) in form.options"
:key=
"index"
>
{{
index
|
<el-radio
disabled
:label=
"index"
v-for=
"(item, index) in form.options"
:key=
"index"
>
{{
index
|
filterType
(
form
.
options
)
}}
</el-radio>
</el-radio-group>
</el-form-item>
</
template
>
<el-form-item
label=
"典例精讲"
prop=
"explain"
>
<el-switch
@
change=
"changeExplain"
v-model=
"form.explain"
active-color=
"#409eff"
>
<el-switch
@
change=
"changeExplain"
v-model=
"form.explain"
active-color=
"#409eff"
disabled
>
</el-switch>
</el-form-item>
<
template
v-if=
"form.explain"
>
...
...
@@ -309,9 +312,9 @@
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item> -->
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<
el-button
:loading=
"buttonLoading"
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<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>
</div>
</el-dialog>
</template>
...
...
@@ -358,16 +361,8 @@ export default {
pageNum
:
1
,
pageSize
:
10
,
categoryId
:
undefined
,
species
:
undefined
,
phaseId
:
undefined
,
type
:
undefined
,
intensity
:
undefined
,
topic
:
undefined
,
rightAnswers
:
undefined
,
rightAnswersPic
:
undefined
,
resolveCourse
:
undefined
,
resolveVideo
:
undefined
,
status
:
undefined
,
},
// 表单参数
form
:
{},
...
...
@@ -657,7 +652,7 @@ export default {
this
.
loading
=
false
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改
题库主"
;
this
.
title
=
"
查看
题库主"
;
});
},
getWangEditorText
(
str
)
{
...
...
src/views/school-paper/profile/index.vue
View file @
bd22908c
...
...
@@ -99,15 +99,16 @@
<el-form-item
label=
"资料名称"
prop=
"profileName"
>
<el-input
v-model=
"form.profileName"
placeholder=
"请输入资料名称"
/>
</el-form-item>
<
el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<
!-- <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-preview="handlePreview" :on-remove="clickRemove"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xls、xlsx格式文件。</span>
</div>
</el-upload>
</el-upload> -->
<dragUpload
:limit=
"1"
ref=
"refDragUpload"
></dragUpload>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center;"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
...
...
@@ -191,7 +192,8 @@ export default {
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
$refs
[
'refDragUpload'
].
handleDelete
(
0
)
this
.
upload
.
open
=
false
;
this
.
reset
();
},
// 表单重置
...
...
@@ -226,11 +228,18 @@ export default {
},
/** 下载操作 */
handleUpdate
(
row
)
{
this
.
download
(
'system/user/importTemplateNew'
,
{
},
`user_template_
${
new
Date
().
getTime
()}
.xlsx`
)
console
.
log
(
row
,
'[[[[[[[[[]]]]]]]]]'
)
window
.
location
.
href
=
row
.
profileUrl
// this.download('system/user/importTemplateNew', {
// }, `user_template_${new Date().getTime()}.xlsx`)
},
/** 提交按钮 */
submitForm
()
{
if
(
this
.
$refs
[
'refDragUpload'
].
fileList
&&
this
.
$refs
[
'refDragUpload'
].
fileList
.
length
)
{
this
.
$set
(
this
.
form
,
'profileUrl'
,
this
.
$refs
[
'refDragUpload'
].
fileList
[
0
].
url
)
}
else
{
this
.
$message
.
error
(
'请上传资料'
);
}
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
buttonLoading
=
true
;
...
...
@@ -244,8 +253,9 @@ export default {
});
}
else
{
addProfile
(
this
.
form
).
then
(
response
=>
{
this
.
$refs
[
'refDragUpload'
].
handleDelete
(
0
)
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
upload
.
open
=
false
;
this
.
getList
();
}).
finally
(()
=>
{
this
.
buttonLoading
=
false
;
...
...
@@ -281,6 +291,7 @@ export default {
},
// 文件上传成功处理
handleFileSuccess
(
response
,
file
,
fileList
)
{
console
.
log
(
response
,
'111111111'
)
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
...
...
src/views/school-paper/questionBank/index.vue
View file @
bd22908c
...
...
@@ -706,7 +706,7 @@ export default {
this
.
form
=
response
.
data
;
this
.
open
=
true
;
// 判断是否是填空题
if
(
self
.
form
.
species
==
1
)
{
if
(
self
.
form
.
species
==
1
||
self
.
form
.
species
==
3
)
{
self
.
form
.
answer
=
self
.
form
.
rightAnswers
if
(
self
.
form
.
rightAnswersPic
)
{
let
arr
=
self
.
form
.
rightAnswersPic
.
split
(
','
),
...
...
src/views/school-paper/testPaper/components/treeselect.vue
View file @
bd22908c
...
...
@@ -58,8 +58,18 @@ export default {
// 选中触发(清除值的时候不会触发)
treeSelectChange
(
raw
,
instanceId
)
{
console
.
log
(
raw
,
'当前的对象'
)
let
self
=
this
setTimeout
(()
=>
{
// 如果用到this.value 需要setTimeout延迟一下拿到最新的值
console
.
log
(
this
.
value
,
'this.value -- select'
)
if
(
!
this
.
multiple
)
{
if
(
raw
.
children
==
undefined
)
{
}
else
{
if
(
self
.
value
==
raw
.
id
)
{
self
.
value
=
null
}
}
}
})
},
// 移除选项时触发 当设置multiple为true时生效 raw为当前移除的对象
...
...
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