修改测试遇到问题

1、菜单可见性修改不起作用
2、数据字段不能修改
This commit is contained in:
myTest383
2024-12-25 16:16:08 +08:00
parent d5e263c4dd
commit 6f6e15cdb6
85 changed files with 1203 additions and 111 deletions

View File

@@ -46,7 +46,7 @@
<el-table-column prop="remarks" label="说明" align="center">
</el-table-column>
</el-table>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
<!-- 分类编辑 -->
<el-dialog :title="dialogTitle + '字典分类'" :visible.sync="editDialog" width="50%">
<el-form>
@@ -77,124 +77,133 @@
</div>
</el-dialog>
</div>
<dict-common @doback="resetState" :dictData='dictData' v-show="viewState == 2"/>
<dict-common @doback="resetState" :dictData='dictData' v-show="viewState == 2" />
</div>
</template>
<script>
import { pageList, saveDictType, putDictType, delDictType } from '@/api/system/dictType/index.js'
import dictCommon from './dictCommon.vue'
import {
pageList,
saveDictType,
putDictType,
delDictType
} from '@/api/system/dictType/index.js'
import dictCommon from './dictCommon.vue'
export default {
data() {
return {
editDialog: false,
dialogTitle: '',
form: {},
formBackup: Object.assign({}, this.form),
page: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
dictTypeName: '',
dictTypeCode: ''
}
},
tableData: [],
viewState: 1,
dictData: {}
}
},
components: {
dictCommon
},
mounted() {
this.getPageList(this.page)
},
methods: {
pagination(val) { // 分页
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getPageList(this.page)
},
onSearch() { // 查询
this.getPageList()
},
resetSearch() { // 重置
this.page.current = 1
this.getPageList()
},
getPageList() { // 获取列表
pageList(this.page).then((res) => {
if (res.success) {
this.tableData = res.data.records
this.page.total = res.data.total
} else {
this.tableData = []
this.page.total = 0
}
})
},
add() {
this.dialogTitle = '新增'
this.editDialog = true
this.form = Object.assign({}, this.formBackup)
},
editRow(row) {
this.dialogTitle = '编辑'
this.editDialog = true
this.form = Object.assign({}, row)
},
save() {
if (this.form.sid) {
putDictType(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
this.$message({
message: res.msg,
type: 'success'
})
})
} else {
saveDictType(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
this.$message({
message: res.msg,
type: 'success'
})
})
export default {
data() {
return {
editDialog: false,
dialogTitle: '',
form: {},
formBackup: Object.assign({}, this.form),
page: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
dictTypeName: '',
dictTypeCode: ''
}
},
tableData: [],
viewState: 1,
dictData: {}
}
},
deleteRow(row) {
this.$confirm('确定要删除该条数据吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDictType({ sid: row.sid }).then(res => {
this.getPageList(this.page)
this.$message({
type: 'success',
message: '删除成功!'
components: {
dictCommon
},
mounted() {
this.getPageList(this.page)
},
methods: {
pagination(val) { // 分页
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getPageList(this.page)
},
onSearch() { // 查询
this.getPageList()
},
resetSearch() { // 重置
this.page.current = 1
this.getPageList()
},
getPageList() { // 获取列表
pageList(this.page).then((res) => {
if (res.success) {
this.tableData = res.data.records
this.page.total = res.data.total
} else {
this.tableData = []
this.page.total = 0
}
})
},
add() {
this.dialogTitle = '新增'
this.editDialog = true
this.form = Object.assign({}, this.formBackup)
},
editRow(row) {
this.dialogTitle = '编辑'
this.editDialog = true
this.form = Object.assign({}, row)
},
save() {
if (this.form.sid) {
putDictType(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
// this.$message({
// message: res.msg,
// type: 'success'
// })
})
} else {
saveDictType(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
// this.$message({
// message: res.msg,
// type: 'success'
// })
})
}
},
deleteRow(row) {
this.$confirm('确定要删除该条数据吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDictType({
sid: row.sid
}).then(res => {
this.getPageList(this.page)
this.$message({
type: 'success',
message: '删除成功!'
})
})
})
})
},
guanli(row) {
this.dictData = { dictType: row.dictTypeCode }
this.viewState = 2
},
resetState() {
this.viewState = 1
},
guanli(row) {
this.dictData = {
dictType: row.dictTypeCode
}
this.viewState = 2
},
resetState() {
this.viewState = 1
}
}
}
}
</script>
<style scoped="scoped">
.my-tabs {
margin-top: 10px;
}
.my-tabs {
margin-top: 10px;
}
</style>

View File

@@ -67,10 +67,10 @@
<el-table-column prop="pageUrl" label="路由路径" align="center" />
<el-table-column prop="pageName" label="组件路径" align="center" />
<el-table-column prop="cid" label="权限标识" align="center" />
<el-table-column prop="isShow" label="状态" align="center">
<el-table-column prop="isEnable" label="状态" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShow" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
inactive-value="0" @change="enabledChange(scope.row.isShow,scope.row)" />
<el-switch v-model="scope.row.isEnable" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
inactive-value="0" @change="enabledChange(scope.row.isEnable,scope.row)" />
</template>
</el-table-column>
<el-table-column prop="sortNo" label="排序" align="center" />