课程分类标签页面
parent
e9e9a3dfa2
commit
38ad4f9c1e
Binary file not shown.
Binary file not shown.
@ -0,0 +1,31 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
let baseUrl = '/pc/course/cat/'
|
||||||
|
export function getList() {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+'list',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function add(cat) {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+"add",
|
||||||
|
method: 'post',
|
||||||
|
data: cat
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(cat) {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+"update",
|
||||||
|
method: 'post',
|
||||||
|
data: cat
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(cat) {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+"delete",
|
||||||
|
method: 'post',
|
||||||
|
data: cat
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
let baseUrl = '/pc/course/tag/'
|
||||||
|
export function getList() {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+'list',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function add(cat) {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+"add",
|
||||||
|
method: 'post',
|
||||||
|
data: cat
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(cat) {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+"update",
|
||||||
|
method: 'post',
|
||||||
|
data: cat
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(cat) {
|
||||||
|
return request({
|
||||||
|
url: baseUrl+"delete",
|
||||||
|
method: 'post',
|
||||||
|
data: cat
|
||||||
|
})
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645185634820" class="icon" viewBox="0 0 1298 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2108" xmlns:xlink="http://www.w3.org/1999/xlink" width="253.515625" height="200"><defs><style type="text/css"></style></defs><path d="M675.057703 207.819807l220.065483-0.95112-10.581215 736.167189c5.706722 42.800418-52.430512 73.236271-89.405317 73.236271H142.90584c-36.974806 0-31.505863-34.240334-31.505863-73.236271l-6.895623-850.063857c0-38.995936 1.426681-72.04737 38.401486-72.04737H670.539882l4.517821 186.895158z" fill="#BF8E58" p-id="2109"></path><path d="M654.251945 410.646232H276.657146c-24.61024 0-44.702659-20.092418-44.702659-44.702658s20.092418-44.702659 44.702659-44.702659h377.594799c24.61024 0 44.702659 20.092418 44.702659 44.702659s-20.092418 44.702659-44.702659 44.702658z m-377.594799-71.215139c-14.623476 0-26.393591 11.889005-26.393591 26.393591 0 14.623476 11.889005 26.512481 26.393591 26.512481h377.594799c14.623476 0 26.393591-11.889005 26.393591-26.512481s-11.889005-26.393591-26.393591-26.393591H276.657146zM654.251945 605.982584H276.657146c-24.61024 0-44.702659-20.092418-44.702659-44.702658 0-24.61024 20.092418-44.702659 44.702659-44.702659h377.594799c24.61024 0 44.702659 20.092418 44.702659 44.702659 0 24.61024-20.092418 44.702659-44.702659 44.702658z m-377.594799-71.215139c-14.623476 0-26.393591 11.889005-26.393591 26.393591 0 14.623476 11.889005 26.512481 26.393591 26.512481h377.594799c14.623476 0 26.393591-11.889005 26.393591-26.512481s-11.889005-26.393591-26.393591-26.393591H276.657146zM654.251945 801.318936H276.657146c-24.61024 0-44.702659-20.092418-44.702659-44.702658 0-24.61024 20.092418-44.702659 44.702659-44.702659h377.594799c24.61024 0 44.702659 20.092418 44.702659 44.702659 0 24.61024-20.092418 44.702659-44.702659 44.702658z m-377.594799-71.096249c-14.623476 0-26.393591 11.889005-26.393591 26.393591 0 14.623476 11.889005 26.393591 26.393591 26.393591h377.594799c14.623476 0 26.393591-11.889005 26.393591-26.393591 0-14.623476-11.889005-26.393591-26.393591-26.393591H276.657146z" fill="#070606" p-id="2110"></path><path d="M679.337745 0H127.450134c-44.345989 0-80.488564 36.142575-80.488564 80.488564v863.022872c0 44.345989 36.142575 80.488564 80.488564 80.488564h696.339022c44.464879 0 80.607454-36.142575 80.607454-80.488564v-740.685011L679.337745 0z m4.874492 28.890282L872.415186 198.665273H684.212237v-169.774991z m139.458029 976.91954H127.450134c-34.359224 0-62.298386-27.939162-62.298387-62.298386V80.607454c0-34.359224 27.939162-62.298386 62.298387-62.298386h538.571926V216.974341h220.065482V943.630326c-0.11889 34.240334-28.058052 62.179496-62.417276 62.179496z" fill="#070606" p-id="2111"></path><path d="M683.855567 362.257982c0 17.714617-15.574597 31.981423-34.834784 31.981424H278.797167c-19.260188 0-34.834785-14.266806-34.834785-31.981424 0-17.714617 15.574597-31.981423 34.834785-31.981423h370.104725c19.260188 0 34.953675 14.385696 34.953675 31.981423zM685.401138 561.279926c0 17.714617-15.574597 31.981423-34.834785 31.981423H280.342738c-19.260188 0-34.834785-14.266806-34.834785-31.981423 0-17.714617 15.574597-31.981423 34.834785-31.981424h370.104725c19.260188 0 34.953675 14.266806 34.953675 31.981424zM685.401138 756.616278c0 17.595727-15.574597 31.981423-34.834785 31.981423H280.342738c-19.260188 0-34.834785-14.266806-34.834785-31.981423 0-17.714617 15.574597-31.981423 34.834785-31.981424h370.104725c19.260188 0 34.953675 14.385696 34.953675 31.981424z" fill="#EEBF2F" p-id="2112"></path><path d="M885.493092 569.126669c0 241.941252-205.204226 438.823174-449.404389 436.683153h357.50238c42.800418 3.804482 92.734239-1.1889 92.734239-68.242888" fill="#B1702D" p-id="2113"></path></svg>
|
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645186610067" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7140" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M875.6 724c0 128.5-162.8 160-363.6 160s-363.6-31.5-363.6-160S311.2 418.6 512 418.6 875.6 595.5 875.6 724z" fill="#C7F1FF" p-id="7141"></path><path d="M613 760.5H255.3c-20.8 0-37.6-16.9-37.6-37.6v-466c0-20.8 16.9-37.6 37.6-37.6H613c20.8 0 37.6 16.9 37.6 37.6v466c0.1 20.8-16.8 37.6-37.6 37.6z" fill="#FFD500" p-id="7142"></path><path d="M549.1 360.9H313.9c-11.8 0-21.4-9.6-21.4-21.4s9.6-21.4 21.4-21.4h235.2c11.8 0 21.4 9.6 21.4 21.4s-9.6 21.4-21.4 21.4zM495.6 467.8H313.9c-11.8 0-21.4-9.6-21.4-21.4s9.6-21.4 21.4-21.4h181.8c11.8 0 21.4 9.6 21.4 21.4s-9.7 21.4-21.5 21.4zM495.6 564.1H313.9c-11.8 0-21.4-9.6-21.4-21.4s9.6-21.4 21.4-21.4h181.8c11.8 0 21.4 9.6 21.4 21.4s-9.7 21.4-21.5 21.4zM495.6 660.3H313.9c-11.8 0-21.4-9.6-21.4-21.4s9.6-21.4 21.4-21.4h181.8c11.8 0 21.4 9.6 21.4 21.4s-9.7 21.4-21.5 21.4z" fill="#FFFFFF" p-id="7143"></path><path d="M755 844.7H402c-22.1 0-40-17.9-40-40V343.5c0-22.1 17.9-40 40-40h353c22.1 0 40 17.9 40 40v461.3c0 22-17.9 39.9-40 39.9z" fill="#00B1FF" p-id="7144"></path><path d="M531.4 762.6h-26.2c-5.9 0-10.7-4.7-10.9-10.5l-1.9-57.2c-0.4-0.1-0.7-0.2-1.1-0.2-3.1 11.1-6.2 22.2-9.4 33.3-2.8 9.9-5.8 19.7-8.3 29.7-1 4-2.7 5.6-7 5.5-9.3-0.3-18.5-0.1-28.8-0.1 0.6-2.9 1-5.2 1.6-7.4 12.2-44.4 24.6-88.8 36.7-133.2 2.5-9.2 10.9-15.3 20.5-15.3h8.3c5.8-0.1 10.6 4.5 11 10.3l3.3 57.8c0.3 0.1 0.5 0.2 0.8 0.2 1.1-3.4 2.2-6.7 3.2-10.1 4.8-17.2 9.6-34.4 14.1-51.7 1.2-4.8 3.1-7 8.4-6.7 4.5 0.2 9.1 0.2 13.8 0.2 7.2 0 12.5 6.8 10.6 13.8-2.6 9.6-5.1 18.8-7.8 28-0.4 1.4-2.7 2.6-4.4 3.3-13.1 5.3-21.9 14.6-25.8 28.2-4.8 16.9-9.4 33.9-13.5 51-2.9 11.9-1 22.5 11.3 28.7 0.5 0.1 0.6 1 1.5 2.4zM608.6 758.4l11.8-82.5c0.8-5.4 5.4-9.4 10.8-9.4h2.1c6.7 0 11.8 6 10.8 12.6l-6.2 38.6c0.3 0.1 0.7 0.2 1 0.3 5.6-14.3 11.6-28.5 16.7-42.9 2.5-6.9 5.7-10.6 13.6-9.3 4.3 0.7 8.7 0.1 13.6 0.1-2.9 17.5-5.6 34.4-8.4 51.2 0.2 0.1 0.5 0.1 0.7 0.2 5.7-14.3 11.8-28.4 16.9-43 2.5-7 6.1-9.6 13.3-8.6 4.5 0.6 9.2 0.1 14.8 0.1-0.9 2.7-1.4 4.7-2.1 6.6-10.6 26.7-21.4 53.5-31.9 80.2-1.5 3.9-3.4 5.8-7.9 5.5-4.2-0.2-8.4-0.2-12.7-0.2-6.7 0-11.8-5.9-10.9-12.4l4.1-28.1c-0.5-0.2-1-0.3-1.5-0.5-3 7.1-6.9 14-8.7 21.4-4 16.6-13.5 23.2-30.2 19.8-2.8-0.2-5.8 0.3-9.7 0.3z" fill="#FFFFFF" p-id="7145"></path><path d="M608.9 702.3c-0.9 5.2-5.5 9.1-10.8 9.1-8.8 0-17.2 0.1-25.5-0.1-4.5-0.1-6.6 1.2-7.5 5.7-1.4 7.2-3.7 14.2-5 21.4-0.4 2 1.1 4.3 1.8 6.4 2.4-1.2 6.1-1.8 7-3.7 1.5-3.2 2.7-6.6 3.8-10.1 2.3-7.5 9.4-12.4 17.2-12.4h0.3c7.5 0 12.8 7.4 10.3 14.4-3.9 11-10.9 19.6-19.7 24.8-23.6 14-52.3-8.5-46-35.3 3.7-15.8 8-31.5 13.9-46.6 7-17.8 35.4-25.3 52.7-16.7 7.7 3.9 12.3 10 11.3 18.7-1 8.3-2.4 16.3-3.8 24.4z m-37.6-8.1c7.1 2.2 10.7 0.6 11.1-6.4 0.1-2.4 1.4-4.8 1.3-7.1 0-2.1-1.1-4.2-1.8-6.3-2.1 1.5-5.3 2.6-6.2 4.6-1.9 4.6-2.9 9.7-4.4 15.2z" fill="#FFFFFF" p-id="7146"></path><path d="M698.8 414.4H463.6c-11.8 0-21.4-9.6-21.4-21.4s9.6-21.4 21.4-21.4h235.2c11.8 0 21.4 9.6 21.4 21.4s-9.6 21.4-21.4 21.4z" fill="#0091F1" p-id="7147"></path><path d="M645.3 521.3H463.6c-11.8 0-21.4-9.6-21.4-21.4 0-11.8 9.6-21.4 21.4-21.4h181.8c11.8 0 21.4 9.6 21.4 21.4-0.1 11.8-9.7 21.4-21.5 21.4z" fill="#0091F1" p-id="7148"></path></svg>
|
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645358309458" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2051" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M619.52 578.56V808.96h194.56V660.48h-133.12v-81.92h215.04V849.92l-40.96 40.96h-276.48l-40.96-40.96V578.56z" fill="#63F7DE" p-id="2052"></path><path d="M619.52 512V215.04h194.56v172.032h-133.12v81.92h174.08l40.96-40.96V174.08l-40.96-40.96h-276.48l-40.96 40.96v337.92z" fill="#437DFF" p-id="2053"></path><path d="M445.44 890.88h-276.48l-40.96-40.96V619.52l40.96-40.96h174.08v81.92h-133.12V808.96h194.56V215.04h-194.56v172.032h133.12v81.92h-174.08l-40.96-40.96V174.08l40.96-40.96h276.48l40.96 40.96v675.84z" fill="#437DFF" p-id="2054"></path></svg>
|
After Width: | Height: | Size: 922 B |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645187533919" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8209" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 866.986667h-5.12l-276.48-78.506667c-6.826667-1.706667-11.946667-8.533333-11.946667-15.36L204.8 221.866667c0-5.12 1.706667-10.24 6.826667-13.653334 3.413333-3.413333 87.04-66.56 179.2-47.786666 49.493333 10.24 90.453333 39.253333 122.88 90.453333 51.2-58.026667 105.813333-90.453333 162.133333-93.866667 81.92-5.12 136.533333 49.493333 138.24 52.906667 3.413333 3.413333 5.12 8.533333 5.12 11.946667l-13.653333 549.546666c0 6.826667-5.12 13.653333-11.946667 15.36l-276.48 78.506667c-1.706667 1.706667-3.413333 1.706667-5.12 1.706667z m-259.413333-109.226667L512 831.146667l259.413333-73.386667 13.653334-529.066667c-13.653333-11.946667-54.613333-40.96-107.52-37.546666-52.906667 3.413333-104.106667 35.84-151.893334 98.986666-3.413333 5.12-8.533333 6.826667-15.36 6.826667-5.12 0-10.24-3.413333-13.653333-8.533333-30.72-54.613333-68.266667-85.333333-112.64-93.866667-63.146667-11.946667-124.586667 23.893333-145.066667 35.84l13.653334 527.36z" fill="#EA4942" p-id="8210"></path><path d="M385.706667 343.04h32.426666v61.44h37.546667v30.72h-37.546667v22.186667c17.066667 17.066667 34.133333 35.84 49.493334 52.906666l-18.773334 27.306667c-10.24-17.066667-20.48-32.426667-30.72-46.08v163.84h-32.426666v-155.306667c-10.24 29.013333-22.186667 54.613333-35.84 76.8l-13.653334-35.84c22.186667-32.426667 39.253333-68.266667 49.493334-107.52h-37.546667v-30.72h39.253333v-59.733333z m131.413333 162.133333c-10.24 47.786667-25.6 88.746667-46.08 122.88l-29.013333-18.773333c20.48-34.133333 35.84-71.68 44.373333-112.64l30.72 8.533333z m-13.653333 148.48l-6.826667-30.72c10.24 1.706667 20.48 1.706667 30.72 1.706667 8.533333 0 11.946667-5.12 11.946667-13.653333v-138.24h-80.213334v-30.72h192.853334v30.72h-80.213334v145.066666c0 22.186667-11.946667 34.133333-34.133333 34.133334h-34.133333z m-27.306667-293.546666h158.72v30.72h-158.72v-30.72z m141.653333 136.533333c13.653333 37.546667 25.6 78.506667 35.84 122.88l-29.013333 11.946667c-10.24-46.08-22.186667-88.746667-34.133333-126.293334l27.306666-8.533333z" fill="#EA4942" p-id="8211"></path></svg>
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645364666218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3743" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M514.219727 513.742708m-508.819876 0a508.819876 508.819876 0 1 0 1017.639751 0 508.819876 508.819876 0 1 0-1017.639751 0Z" fill="#51E4C2" p-id="3744"></path><path d="M514.219727 513.742708m-355.442485 0a355.442484 355.442484 0 1 0 710.884969 0 355.442484 355.442484 0 1 0-710.884969 0Z" fill="#FE3D50" p-id="3745"></path><path d="M826.781416 462.542708l-30.491031-205.760397c-6.824547-46.175404-48.598658-78.879801-95.123876-74.459429L494.165863 202.192298a87.625143 87.625143 0 0 0-60.708571 33.219578l-303.682783 387.975155c-29.867727 38.15513-23.094062 93.292124 15.003826 123.108969l237.491677 185.890981c38.15513 29.867727 93.241242 23.151304 123.108969-15.003826l303.682783-387.975155a87.835031 87.835031 0 0 0 17.719652-66.865292zM703.443478 277.465839a27.260025 27.260025 0 1 1 33.607553-42.931678 27.260025 27.260025 0 0 1-33.607553 42.931678z" fill="#FFFFFF" p-id="3746"></path><path d="M450.897093 890.065888l-279.55836-218.817987a12.720497 12.720497 0 0 1-2.175205-17.859578l295.128248-377.048248a12.720497 12.720497 0 0 1 17.859578-2.175205L761.703354 492.982857a12.720497 12.720497 0 0 1 2.181565 17.853218L468.750311 887.890683a12.720497 12.720497 0 0 1-17.853218 2.175205z" fill="#51E4C2" p-id="3747"></path><path d="M451.32959 865.566211l-256.318012-200.627677a12.720497 12.720497 0 0 1-2.168845-17.853217l271.010186-346.251926a12.720497 12.720497 0 0 1 17.859578-2.168844l256.318012 200.621316a12.720497 12.720497 0 0 1 2.175205 17.859578l-271.016546 346.245565a12.720497 12.720497 0 0 1-17.859578 2.175205z" fill="#2283F6" p-id="3748"></path><path d="M467.669068 842.325863l-254.015602-198.821366a14.183354 14.183354 0 0 1-2.423255-19.913938l-17.490683 22.337193a14.183354 14.183354 0 0 0 2.429615 19.913937l254.009242 198.821367a14.183354 14.183354 0 0 0 19.907578-2.429615l17.490683-22.337193a14.183354 14.183354 0 0 1-19.907578 2.429615z" fill="#2283F6" p-id="3749"></path><path d="M405.586683 905.432248l-237.491677-185.890981c-38.097888-29.823205-44.871553-84.960199-15.010186-123.108969l-14.310559 15.442683c-29.855006 38.161491-23.087702 93.292124 15.010186 123.108969l237.491677 185.897342c38.161491 29.861366 93.241242 23.151304 123.108969-15.010186l14.310559-15.442684c-29.867727 38.15513-84.960199 44.865193-123.108969 15.010187z" fill="#FE3D50" p-id="3750"></path><path d="M382.867876 737.057391l-120.456746-94.284323 51.804224-66.184745 120.456745 94.290683zM406.375354 755.45123l-13.960745-10.920547 51.804223-66.184745 13.960746 10.926907zM451.176944 790.51528l-3.688944-2.881193 51.804224-66.184745 3.688944 2.887552zM252.902559 635.325217l-3.688944-2.881192 51.804224-66.184745 3.688944 2.887552zM467.885317 803.604671l-8.249242-6.455652 51.804223-66.184746 8.249242 6.462013zM437.953988 780.167155l-23.507479-18.393838 51.804224-66.184746 23.507478 18.400199z" fill="#F8E71C" p-id="3751"></path><path d="M813.641143 144.301317l-7.41605-5.800547a6.360248 6.360248 0 0 0-8.929789 1.081242l-75.457987 96.408646a6.360248 6.360248 0 0 0 1.087602 8.929789l7.41605 5.800547a6.360248 6.360248 0 0 0 8.929789-1.081242l75.457987-96.408646a6.360248 6.360248 0 0 0-1.087602-8.929789z" fill="#2283F6" p-id="3752"></path><path d="M748.842932 237.364472l-9.006112 11.51205a7.282484 7.282484 0 0 1-10.259081 1.252969l-5.927751-4.642982a7.327006 7.327006 0 0 1-1.252969-10.25908l9.012472-11.51205a7.327006 7.327006 0 0 0 1.246608 10.259081l5.927752 4.642981a7.282484 7.282484 0 0 0 10.259081-1.252969z" fill="#2283F6" p-id="3753"></path></svg>
|
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,145 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="margin-left:50px;">
|
||||||
|
<el-form-item label="课程名称" prop="type">
|
||||||
|
<el-input :model="temp.name" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程缩略图">
|
||||||
|
<upload-image :mode="temp.url" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程类别" prop="timestamp">
|
||||||
|
<el-select v-model="temp.cat" class="filter-item" placeholder="请选择">
|
||||||
|
<el-option v-for="item in catOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程标签" prop="timestamp">
|
||||||
|
<el-select v-model="temp.tag" class="filter-item" placeholder="请选择">
|
||||||
|
<el-option v-for="item in tagOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="学习人数">
|
||||||
|
<el-input v-model="temp.creator" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程简介">
|
||||||
|
<editor
|
||||||
|
api-key="wuyv0zkbaek2eni7uc4cj2q099vfhbibrj3cv5yjymq41bod"
|
||||||
|
initialValue=""
|
||||||
|
:init="{
|
||||||
|
height: 500,
|
||||||
|
menubar: false,
|
||||||
|
language:'zh_CN',
|
||||||
|
images_upload_url: '/api/upload/image/upload',
|
||||||
|
plugins: [
|
||||||
|
'advlist autolink lists link image charmap',
|
||||||
|
'searchreplace visualblocks code fullscreen',
|
||||||
|
'print preview anchor insertdatetime media',
|
||||||
|
'paste code help wordcount table'
|
||||||
|
],
|
||||||
|
toolbar:
|
||||||
|
'undo redo | formatselect | bold italic | \
|
||||||
|
alignleft aligncenter alignright | \
|
||||||
|
bullist numlist outdent indent | image | help'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
</editor>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-button @click="dialogFormVisible = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import * as tag from '@/api/courseTag'
|
||||||
|
import * as cat from '@/api/courseCat'
|
||||||
|
import uploadImage from '@/components/Upload/SingleImage.vue'
|
||||||
|
import Editor from '@tinymce/tinymce-vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
'upload-image': uploadImage,
|
||||||
|
editor: Editor
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
statusFilter(status) {
|
||||||
|
const statusMap = {
|
||||||
|
published: 'success',
|
||||||
|
draft: 'info',
|
||||||
|
deleted: 'danger'
|
||||||
|
}
|
||||||
|
return statusMap[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onload(){
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: null,
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 0
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
limit: 20,
|
||||||
|
textMap: {
|
||||||
|
update: 'Edit',
|
||||||
|
create: 'Create'
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
catOptions: [],
|
||||||
|
tagOptions: [],
|
||||||
|
dialogStatus: 'Edit',
|
||||||
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
|
temp: {
|
||||||
|
url: '',
|
||||||
|
content: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
studentNo: [{ required: true, message: '学号为必填项', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '姓名为必填项', trigger: 'blur' }],
|
||||||
|
mobile: [{ required: true, message: '电话为必填项', trigger: 'blur' }],
|
||||||
|
school: [{ required: true, message: '学校为必填项', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
tag.getList().then(res=>{
|
||||||
|
this.tagOptions = res.data.list
|
||||||
|
})
|
||||||
|
cat.getList().then(res=>{
|
||||||
|
this.catOptions = res.data.list
|
||||||
|
this.listLoading =false
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
|
this.temp.timestamp = new Date(this.temp.timestamp)
|
||||||
|
this.dialogStatus = 'update'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.tz-line{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.tz-line button{
|
||||||
|
margin-left: 10px;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,160 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="el-filter">
|
||||||
|
<el-button @click="handleAdd" >添加</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="list"
|
||||||
|
element-loading-text="Loading"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
<el-table-column label="分类名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="300" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<el-button type="primary" size="mini" @click="handleUpdate(row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
:current-page="listQuery.pageNo"
|
||||||
|
:page-sizes="[10,15,20]"
|
||||||
|
:page-size="limit"
|
||||||
|
layout="total,prev,pager,next,jumper,sizes"
|
||||||
|
:total="total"
|
||||||
|
/>
|
||||||
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
|
||||||
|
<input type="hidden" v-model="temp.id"/>
|
||||||
|
<el-form-item label="分类名称" prop="type">
|
||||||
|
<el-input v-model="temp.name" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="save">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getList, add, update, del } from '@/api/courseCat'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
filters: {
|
||||||
|
statusFilter(status) {
|
||||||
|
const statusMap = {
|
||||||
|
published: 'success',
|
||||||
|
draft: 'info',
|
||||||
|
deleted: 'danger'
|
||||||
|
}
|
||||||
|
return statusMap[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: null,
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 0
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
limit: 20,
|
||||||
|
textMap: {
|
||||||
|
update: '编辑',
|
||||||
|
create: '添加'
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
dialogStatus: 'update',
|
||||||
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
|
temp: {
|
||||||
|
id: 0,
|
||||||
|
name: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [{ required: true, message: 'type is required', trigger: 'blur' }],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
getList(this.listQuery).then(response => {
|
||||||
|
this.list = response.data.list
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
|
this.dialogStatus = 'update'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAdd(){
|
||||||
|
this.dialogStatus = 'create'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
save(row){
|
||||||
|
if(this.dialogStatus ==='update'){
|
||||||
|
update(this.temp).then(res=>{
|
||||||
|
if(res.code === 200){
|
||||||
|
let obj =this.list.find((t)=>t.id == this.temp.id)
|
||||||
|
obj.name = this.temp.name
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
add(this.temp).then(res=>{
|
||||||
|
if(res.code === 200){
|
||||||
|
this.temp.id = res.data
|
||||||
|
this.list.unshift(this.temp)
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.temp = {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleDelete(row,index){
|
||||||
|
del(row).then(res=>{
|
||||||
|
if(res.code === 200){
|
||||||
|
this.list.splice(index,1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.tz-line{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.tz-line button{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<router-view />
|
||||||
|
</template>
|
@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="tz-line">
|
||||||
|
<el-input placeholder="输入课程名称" />
|
||||||
|
<el-button type="primary" icon="el-icon-search">查找</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="list"
|
||||||
|
element-loading-text="Loading"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
<el-table-column label="课程名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="课程类别">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.type }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="课程ID" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.id }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建人" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.creator }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="300" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<el-button type="primary" size="mini" @click="handleUpdate(row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
:current-page="listQuery.pageNo"
|
||||||
|
:page-sizes="[10,15,20]"
|
||||||
|
:page-size="limit"
|
||||||
|
layout="total,prev,pager,next,jumper,sizes"
|
||||||
|
:total="total"
|
||||||
|
/>
|
||||||
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
|
||||||
|
<el-form-item label="课程名称" prop="type">
|
||||||
|
<el-input v-model="temp.name" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程类别" prop="timestamp">
|
||||||
|
<el-select v-model="temp.type" class="filter-item" placeholder="请选择">
|
||||||
|
<el-option v-for="item in provincOtions" :key="item.id" :label="item.name" :value="item.key" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程ID" prop="title">
|
||||||
|
<el-input v-model="temp.id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建人">
|
||||||
|
<el-input v-model="temp.creator" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker v-model="temp.createTime" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getList } from '@/api/table'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
filters: {
|
||||||
|
statusFilter(status) {
|
||||||
|
const statusMap = {
|
||||||
|
published: 'success',
|
||||||
|
draft: 'info',
|
||||||
|
deleted: 'danger'
|
||||||
|
}
|
||||||
|
return statusMap[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: null,
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 0
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
limit: 20,
|
||||||
|
textMap: {
|
||||||
|
update: 'Edit',
|
||||||
|
create: 'Create'
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
provincOtions: [{
|
||||||
|
id: '1',
|
||||||
|
name: '北京'
|
||||||
|
}],
|
||||||
|
regionOptions: [{
|
||||||
|
id: 1,
|
||||||
|
name: '东南地区'
|
||||||
|
}],
|
||||||
|
levelOtions: [{
|
||||||
|
id: 1,
|
||||||
|
name: '本科'
|
||||||
|
}],
|
||||||
|
dialogStatus: '',
|
||||||
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
|
temp: {
|
||||||
|
id: undefined,
|
||||||
|
importance: 1,
|
||||||
|
remark: '',
|
||||||
|
timestamp: new Date(),
|
||||||
|
title: '',
|
||||||
|
type: '',
|
||||||
|
status: 'published'
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
type: [{ required: true, message: 'type is required', trigger: 'change' }],
|
||||||
|
timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }],
|
||||||
|
title: [{ required: true, message: 'title is required', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
getList(this.listQuery).then(response => {
|
||||||
|
const userPage = response.data.userPage
|
||||||
|
this.list = userPage.content
|
||||||
|
this.total = userPage.totalElements
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
|
this.temp.timestamp = new Date(this.temp.timestamp)
|
||||||
|
this.dialogStatus = 'update'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.tz-line{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.tz-line button{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,199 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="el-filter">
|
||||||
|
<el-button @click="handleAdd" >添加</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="list"
|
||||||
|
element-loading-text="Loading"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
<el-table-column label="分类名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="300" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<el-button type="primary" size="mini" @click="handleUpdate(row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
:current-page="listQuery.pageNo"
|
||||||
|
:page-sizes="[10,15,20]"
|
||||||
|
:page-size="limit"
|
||||||
|
layout="total,prev,pager,next,jumper,sizes"
|
||||||
|
:total="total"
|
||||||
|
/>
|
||||||
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
|
||||||
|
<input type="hidden" v-model="temp.id"/>
|
||||||
|
<el-form-item label="分类名称" prop="type">
|
||||||
|
<el-input v-model="temp.name" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="save">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getList, add, update, del } from '@/api/courseTag'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
filters: {
|
||||||
|
statusFilter(status) {
|
||||||
|
const statusMap = {
|
||||||
|
published: 'success',
|
||||||
|
draft: 'info',
|
||||||
|
deleted: 'danger'
|
||||||
|
}
|
||||||
|
return statusMap[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: null,
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 0
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
limit: 20,
|
||||||
|
textMap: {
|
||||||
|
update: '编辑',
|
||||||
|
create: '添加'
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
dialogStatus: 'update',
|
||||||
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
|
temp: {
|
||||||
|
id: 0,
|
||||||
|
name: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [{ required: true, message: 'type is required', trigger: 'blur' }],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
getList(this.listQuery).then(response => {
|
||||||
|
this.list = response.data.list
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
|
this.dialogStatus = 'update'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAdd(){
|
||||||
|
this.dialogStatus = 'create'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
save(row){
|
||||||
|
if(this.dialogStatus ==='update'){
|
||||||
|
update(this.temp).then(res=>{
|
||||||
|
if(res.code === 200){
|
||||||
|
let obj =this.list.find((t)=>t.id == this.temp.id)
|
||||||
|
obj.name = this.temp.name
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.$notify({
|
||||||
|
title: '操作成功',
|
||||||
|
message: "success",
|
||||||
|
type: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$notify({
|
||||||
|
title: '操作失败',
|
||||||
|
message: res.msg,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
add(this.temp).then(res=>{
|
||||||
|
if(res.code === 200){
|
||||||
|
this.temp.id = res.data
|
||||||
|
this.list.unshift(this.temp)
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.temp = {}
|
||||||
|
this.$notify({
|
||||||
|
title: '操作成功',
|
||||||
|
message: "success",
|
||||||
|
type: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$notify({
|
||||||
|
title: '操作失败',
|
||||||
|
message: res.msg,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleDelete(row,index){
|
||||||
|
del(row).then(res=>{
|
||||||
|
if(res.code === 200){
|
||||||
|
this.list.splice(index,1)
|
||||||
|
this.$notify({
|
||||||
|
title: '操作成功',
|
||||||
|
message: res.msg,
|
||||||
|
type: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$notify({
|
||||||
|
title: '操作失败',
|
||||||
|
message: res.msg,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.tz-line{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.tz-line button{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<router-view />
|
||||||
|
</template>
|
@ -0,0 +1,214 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="filter-container">
|
||||||
|
<el-form>
|
||||||
|
<el-form-item label="课程筛选">
|
||||||
|
<el-select>
|
||||||
|
<el-option>请选择</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-input placeholder="题干/题目ID" />
|
||||||
|
<el-button>查询</el-button>
|
||||||
|
<el-button>批量删除</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-button>新增</el-button>
|
||||||
|
<el-button>批量导入</el-button>
|
||||||
|
<el-button>批量上架</el-button>
|
||||||
|
<el-button>批量下架</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="list"
|
||||||
|
element-loading-text="Loading"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
<el-table-column label="序号" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="选择">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.type }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="题干" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.id }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="导入日期" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.creator }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="题型" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="题目层次" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="归属课程" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="300" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="{row,$index}">
|
||||||
|
<el-button type="primary" size="mini" @click="handleUpdate(row)">
|
||||||
|
上架
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
|
||||||
|
下架
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="handleUpdate(row)">
|
||||||
|
查看
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleDelete(row,$index)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
:current-page="listQuery.pageNo"
|
||||||
|
:page-sizes="[10,15,20]"
|
||||||
|
:page-size="limit"
|
||||||
|
layout="total,prev,pager,next,jumper,sizes"
|
||||||
|
:total="total"
|
||||||
|
/>
|
||||||
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
|
||||||
|
<el-form-item label="课程名称" prop="type">
|
||||||
|
<el-input v-model="temp.name" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程类别" prop="timestamp">
|
||||||
|
<el-select v-model="temp.type" class="filter-item" placeholder="请选择">
|
||||||
|
<el-option v-for="item in provincOtions" :key="item.id" :label="item.name" :value="item.key" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="课程ID" prop="title">
|
||||||
|
<el-input v-model="temp.id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建人">
|
||||||
|
<el-input v-model="temp.creator" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker v-model="temp.createTime" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getList } from '@/api/table'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
filters: {
|
||||||
|
statusFilter(status) {
|
||||||
|
const statusMap = {
|
||||||
|
published: 'success',
|
||||||
|
draft: 'info',
|
||||||
|
deleted: 'danger'
|
||||||
|
}
|
||||||
|
return statusMap[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: null,
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
pageNo: 0
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
limit: 20,
|
||||||
|
textMap: {
|
||||||
|
update: 'Edit',
|
||||||
|
create: 'Create'
|
||||||
|
},
|
||||||
|
dialogFormVisible: false,
|
||||||
|
provincOtions: [{
|
||||||
|
id: '1',
|
||||||
|
name: '北京'
|
||||||
|
}],
|
||||||
|
regionOptions: [{
|
||||||
|
id: 1,
|
||||||
|
name: '东南地区'
|
||||||
|
}],
|
||||||
|
levelOtions: [{
|
||||||
|
id: 1,
|
||||||
|
name: '本科'
|
||||||
|
}],
|
||||||
|
dialogStatus: '',
|
||||||
|
statusOptions: ['published', 'draft', 'deleted'],
|
||||||
|
temp: {
|
||||||
|
id: undefined,
|
||||||
|
importance: 1,
|
||||||
|
remark: '',
|
||||||
|
timestamp: new Date(),
|
||||||
|
title: '',
|
||||||
|
type: '',
|
||||||
|
status: 'published'
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
type: [{ required: true, message: 'type is required', trigger: 'change' }],
|
||||||
|
timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }],
|
||||||
|
title: [{ required: true, message: 'title is required', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
getList(this.listQuery).then(response => {
|
||||||
|
const userPage = response.data.userPage
|
||||||
|
this.list = userPage.content
|
||||||
|
this.total = userPage.totalElements
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.temp = Object.assign({}, row) // copy obj
|
||||||
|
this.temp.timestamp = new Date(this.temp.timestamp)
|
||||||
|
this.dialogStatus = 'update'
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].clearValidate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.tz-line{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.tz-line button{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1 +1,2 @@
|
|||||||
pic_path=/Volumes/Lexar/www/pic
|
pic_path=/Volumes/Lexar/www/pic/
|
||||||
|
pic_recourse_url=http://localhost:8899/pic/
|
Binary file not shown.
@ -0,0 +1,17 @@
|
|||||||
|
server:
|
||||||
|
port: 50013
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: tz-exam-service
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
config:
|
||||||
|
namespace: ${spring.profiles.active}
|
||||||
|
file-extension: yaml
|
||||||
|
discovery:
|
||||||
|
namespace: ${spring.profiles.active}
|
@ -0,0 +1,19 @@
|
|||||||
|
server:
|
||||||
|
port: 50015
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: tz-upload-service
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
config:
|
||||||
|
namespace: ${spring.profiles.active}
|
||||||
|
file-extension: yaml
|
||||||
|
discovery:
|
||||||
|
namespace: ${spring.profiles.active}
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
Loading…
Reference in New Issue