修改课程管理弹窗

main
king 1 year ago
parent 85451d9ca5
commit c85cecbf0f
  1. 4
      pnpm-lock.yaml
  2. 2
      src/pages/manage/courseAdmin/components/search.tsx
  3. 10
      src/pages/manage/courseAdmin/courseAdmin.tsx

@ -1,4 +1,4 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
@ -12444,7 +12444,7 @@ packages:
dependencies:
object-assign: 4.1.1
react: 18.0.0
react-is: 16.13.1
react-is: 18.2.0
dev: false
/react@18.0.0:

@ -88,7 +88,7 @@ export const Search: FC<Props> = ({param, setParam}) => {
{deps.length ?
<>
{
deps.map(dep => <View
deps?.map(dep => <View
key={dep.id}
className={styles.radioBox}
onClick={() => changeDepId(dep.id)}>

@ -26,7 +26,7 @@ const CourseAdmin: FC = () => {
courseApi.getCourseAll({...param, page_size: param.page_size * (replace ? param.page : 1)}).then(res => {
setTotal(res.total)
if (param.page === 1 || replace) {
setData(res.data)
setData(res.data || [])
} else {
setData([
...data,
@ -53,7 +53,7 @@ const CourseAdmin: FC = () => {
if (curs.length === data.length) {
setCurs([])
} else {
setCurs(data.map(d => d.id))
setCurs(data?.map(d => d.id))
}
}
@ -72,7 +72,7 @@ const CourseAdmin: FC = () => {
Taro.showModal({
title: '删除警告',
content: "删除后所有部门不可查看",
confirmText:'删除',
confirmText: '删除',
async success({confirm}) {
if (confirm) {
try {
@ -108,7 +108,7 @@ const CourseAdmin: FC = () => {
* @param required []
*/
function batchChangDep(ids: number[], depList = [], required = []) {
if (!ids.length) {
if (!ids?.length) {
Taro.showToast({title: '请选择课程', icon: 'none'})
return
}
@ -153,7 +153,7 @@ const CourseAdmin: FC = () => {
<View className={styles.curList}>
{
data.map((d, index) => <View key={d.id} className={styles.curBox}>
data?.map((d, index) => <View key={d.id} className={styles.curBox}>
<View className={styles.curTitle} onClick={() => addCurs(d.id)}>
{batch && <Radio
checked={curs.includes(d.id)}

Loading…
Cancel
Save