65812452 by yuanbo

增加注释

1 parent fb3fa909
......@@ -32,6 +32,11 @@ export const TableListMixin = {
},
methods: {
// 加载表格数据
/**
* @description: 加载表格数据
* @param {*} arg
* @author: renchao
*/
loadData(arg) {
if (!this.tableUrl) {
console.log('请设置tableUrl属性为接口地址!')
......@@ -63,22 +68,45 @@ export const TableListMixin = {
})
},
// 字典值配置
/**
* @description: 字典值配置
* @author: renchao
*/
initDictConfig() {
// console.log('假初始化字典值方法!')
},
// 选择所有和取消所有
/**
* @description: 选择所有和取消所有
* @param {*} checked
* @param {*} records
* @author: renchao
*/
selectAllEvent({ checked, records }) {
this.selectionRows = records
},
// 选中节点
/**
* @description: 选中节点
* @param {*} records
* @author: renchao
*/
selectChangeEvent({ records }) {
this.selectionRows = records
},
// 使用查询条件查询
/**
* @description: 使用查询条件查询
* @author: renchao
*/
searchQuery() {
this.loadData()
},
// 获取查询条件
/**
* @description: 获取查询条件
* @author: renchao
*/
getQueryParams() {
if (this.queryOptions !== '') {
this.queryParam.queryOptions = JSON.stringify(this.queryOptions)
......@@ -86,17 +114,32 @@ export const TableListMixin = {
return this.$filterNullObj(this.queryParam)
},
// 新增
/**
* @description: 新增
* @author: renchao
*/
handleAdd: function() {
this.$refs.dialogForm.add()
this.$refs.dialogForm.title = '新增'
},
// 修改
/**
* @description: 修改
* @param {*} record
* @author: renchao
*/
handleEdit: function(record) {
localStorage.setItem('record', JSON.stringify(record))
this.$refs.dialogForm.edit(record)
this.$refs.dialogForm.title = '修改'
},
// 删除
/**
* @description: 删除
* @param {*} id
* @param {*} content
* @author: renchao
*/
handleDelete: function(id, content = '') {
this.$confirm(
`<div class="customer-message-wrapper">
......@@ -137,6 +180,10 @@ export const TableListMixin = {
.catch(() => {})
},
// 批量删除
/**
* @description: 批量删除
* @author: renchao
*/
batchDel: function() {
if (!this.tableUrl) {
this.$message.error({
......@@ -174,10 +221,20 @@ export const TableListMixin = {
.catch(() => {})
},
// 新增或修改成功时,重载列表
/**
* @description: 新增或修改成功时,重载列表
* @author: renchao
*/
dialogFormOk() {
this.loadData()
},
// 导出
/**
* @description: 导出
* @param {*} data
* @param {*} name
* @author: renchao
*/
handleExportXls(data, name) {
if (name === '菜单' || name === '部门' || name === '机构' ||
name === '资源' || name === '资源分类' || name === '数据字典' || name === '行政区划') {
......@@ -205,6 +262,10 @@ export const TableListMixin = {
}
},
/* 导入 */
/**
* @description: 导入
* @author: renchao
*/
handleImportExcel(info) {}
}
}
......
......@@ -16,8 +16,16 @@ let mixin = {
this.featchData()
},
methods: {
/**
* @description: featchData
* @author: renchao
*/
featchData () {
},
/**
* @description: verificationForm
* @author: renchao
*/
verificationForm () {
return new Promise((resolve) => {
this.$refs['formList'].validate((valid) => {
......@@ -29,9 +37,17 @@ let mixin = {
})
})
},
/**
* @description: changeCertificate
* @author: renchao
*/
changeCertificate() {
},
/**
* @description: featchRule
* @author: renchao
*/
async featchRule () {
try {
let { result: { sysywsjbfieldlist } } = await ruleConfig.getRuleList(this.bsmYwsjb)
......@@ -75,4 +91,4 @@ let mixin = {
}
}
}
export default mixin
\ No newline at end of file
export default mixin
......
......@@ -21,13 +21,27 @@ let mixin = {
},
methods: {
// 表格索引得问题
/**
* @description: 表格索引得问题
* @param {*} index
* @author: renchao
*/
indexMethod (index) {
return index + 1 + (this.form.currentPage - 1) * this.formData.pageSize;
},
/**
* @description: handleSizeChange
* @param {*} val
* @author: renchao
*/
handleSizeChange (val) {
this.formData.pageSize = val
this.featchData()
},
/**
* @description: handleSearch
* @author: renchao
*/
handleSearch () {
this.form.currentPage = 1
this.tableData.data = []
......@@ -38,15 +52,29 @@ let mixin = {
this.queryClick()
}
},
/**
* @description: handleCurrentChange
* @param {*} val
* @author: renchao
*/
handleCurrentChange (val) {
this.form.currentPage = val
this.featchData()
},
/**
* @description: handleSubmit
* @author: renchao
*/
handleSubmit () {
this.tableData.data = []
this.featchData()
},
// 详情
/**
* @description: 详情
* @param {*} row
* @author: renchao
*/
handleEdit (row) {
this.$refs.editLog.isShow(row);
if (row.rectypeName) {
......@@ -70,6 +98,10 @@ let mixin = {
}
},
// 重置表单
/**
* @description: 重置表单
* @author: renchao
*/
resetForm () {
if (!this.form) return
Object.keys(this.form).forEach((key) => {
......