提交 692d0f6f authored 作者: matian's avatar matian

updates

上级 64c6fa21
import httpRequest from '@/utils/axios'
// 获取分类列表
export function getCategoryList(params: { type: string; category_name?: string }) {
export function getCategoryList(params: { type: string }) {
return httpRequest.get('/api/resource/v1/backend/category/list', { params })
}
// 新建分类
......
......@@ -11,7 +11,6 @@ const dialogVisible = ref(false)
let form = reactive({
category_name: ''
})
interface ICategory {
category_name: number
depth: string
......@@ -19,7 +18,7 @@ interface ICategory {
lft: string
need_pass: string
rgt: string
status: string
status_name: string
children?: ICategory[]
}
let tableData = $ref<ICategory[]>([])
......@@ -70,9 +69,7 @@ const handleAddCategory = () => {
const getParent = (node: string, tree: any) => {
let result: any = []
function find(node: string, tree: any) {
console.log(node, tree[0], 'tree')
tree.children.forEach((item: any) => {
// console.log(item, 'item000')
if (item.id === node) {
result.push(tree)
}
......@@ -211,7 +208,7 @@ onMounted(() => {
</el-table-column>
<el-table-column prop="category_name" label="类别名称" align="center" class-name="handle" />
<el-table-column prop="depth" label="层级" align="center" />
<el-table-column prop="status" label="状态" align="center"> </el-table-column>
<el-table-column prop="status_name" label="状态" align="center"> </el-table-column>
<el-table-column align="center" label="操作" width="300px">
<template #default="scope">
<el-button type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
......
......@@ -26,7 +26,8 @@ const rules = reactive<FormRules>({
name: [{ required: true, message: '请输入讲师姓名', trigger: 'blur' }],
title: [{ required: true, message: ' 请输入职位', trigger: 'blur' }]
})
const listOptions = {
const listOptions = $computed(() => {
return {
remote: {
params: { type: '' }
},
......@@ -44,6 +45,7 @@ const listOptions = {
{ label: '操作', slots: 'table-operate', width: 300, align: 'center' }
]
}
})
const handleDelete = (row: any) => {
console.log('删除', row)
......@@ -82,7 +84,7 @@ onMounted(() => {
<el-row>
<el-col :span="8">
<el-form-item label="讲师图片:" prop="avatar">
<div v-if="isEdit === '1'">暂无照片</div>
<div v-if="isEdit === '1'" class="avatar_box">暂无照片</div>
<AppUpload v-model="ruleForm.avatar" v-else />
</el-form-item>
</el-col>
......@@ -133,4 +135,12 @@ onMounted(() => {
font-size: 14px;
color: #606266;
}
.avatar_box {
width: 150px;
height: 200px;
text-align: center;
line-height: 200px;
color: #ccc;
border: 1px dashed #ccc;
}
</style>
......@@ -3,7 +3,8 @@ import { ElMessage,ElMessageBox } from 'element-plus'
import { getTeacherList, deleteTeacher } from '../api'
const router = useRouter()
const appList = ref()
const listOptions = {
const listOptions = $computed(() => {
return {
remote: {
httpRequest: getTeacherList,
params: { type: '' }
......@@ -25,6 +26,7 @@ const listOptions = {
{ label: '操作', slots: 'table-operate', width: 230, align: 'center' }
]
}
})
// 删除讲师
const handleDelete = (row: any) => {
ElMessageBox.confirm('确定要删除吗?', '提示').then(() => {
......
......@@ -4,8 +4,8 @@ import { getVideoList } from '../api'
const appList = ref()
const isCard = ref(false)
const listOptions = {
const listOptions = $computed(() => {
return {
remote: {
httpRequest: getVideoList,
params: { type: '' },
......@@ -33,6 +33,7 @@ const listOptions = {
{ id: 2, title: '视频标题', type: '视频分类' }
]
}
})
</script>
<template>
......
......@@ -7,7 +7,8 @@ const appList = ref()
const isShowDialog = ref(false)
const isEdit = ref(false)
const editData = ref({})
const listOptions = {
const listOptions = $computed(() => {
return {
remote: {
httpRequest: getCoverList,
params: { type: '' }
......@@ -26,6 +27,7 @@ const listOptions = {
{ label: '操作', slots: 'table-operate', width: 230, align: 'center' }
]
}
})
// 删除
const handleDelete = (row: any) => {
ElMessageBox.confirm('确定要删除吗?', '提示').then(() => {
......
......@@ -3,14 +3,13 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import { useMapStore } from '@/stores/map'
import { getDictionaryList, createDictionary, updateDictionary, delDictionary } from '../api'
import AddDialog from '../component/AddDialog.vue'
const store = useMapStore()
const statusList = store.mapList.filter((item: any) => item.key === 'system_status')[0].values
const router = useRouter()
const appList = ref()
const isShowDialog = ref(false) // 新增字典弹框状态
const isEdit = ref(false) //是否可编辑
const rowInfo = ref({})
const store = useMapStore()
// 状态
//表单每行数据
......@@ -31,7 +30,7 @@ const listOptions = $computed(() => {
type: 'select',
prop: 'status',
label: '字典状态:',
options: statusList
options: store.mapList?.filter((item: any) => item.key === 'system_status')[0]?.values || []
},
{
type: 'input',
......@@ -53,20 +52,6 @@ const listOptions = $computed(() => {
{ label: '备注 ', prop: 'remark', align: 'center' },
{ label: '创建时间', prop: 'created_time', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', width: 300 }
],
data: [
{
key: 1,
name: '用户性别',
type: 'sex',
status: '0',
remark: '用户性别列表',
created_time: '2022-05-30',
rowList: [
{ key: 1, name: '用户性别', type: 'sex', status: '0', remark: '用户性别列表', created_time: '2022-05-30' },
{ key: 2, name: '用户年龄', type: 'age', status: '1', remark: '用户年龄列表', created_time: '2022-05-31' }
]
}
]
}
})
......@@ -144,13 +129,7 @@ const handleConfirm = (val: any) => {
</el-space>
</template>
<template v-if="isShowDialog === true">
<AddDialog
v-model:isShowDialog="isShowDialog"
:isEdit="isEdit"
:rowInfo="rowInfo"
:statusList="statusList"
@confirm="handleConfirm"
/>
<AddDialog v-model:isShowDialog="isShowDialog" :isEdit="isEdit" :rowInfo="rowInfo" @confirm="handleConfirm" />
</template>
</AppList>
</AppCard>
......
......@@ -10,8 +10,8 @@ const title = ref('')
const type = route.query.type as string
const isEdit = ref(false)
const isListAddDialog = ref(false)
const listOptions = {
const listOptions = $computed(() => {
return {
remote: {
httpRequest: getDictionaryItemList,
params: { data_dictionary_id: route.query.id }
......@@ -30,7 +30,8 @@ const listOptions = {
{ label: '创建时间', prop: 'created_time', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', minWidth: 180 }
]
}
}
})
const handleAdd = () => {
isListAddDialog.value = true
isEdit.value = false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论