65812452 by yuanbo

增加注释

1 parent fb3fa909
...@@ -32,6 +32,11 @@ export const TableListMixin = { ...@@ -32,6 +32,11 @@ export const TableListMixin = {
32 }, 32 },
33 methods: { 33 methods: {
34 // 加载表格数据 34 // 加载表格数据
35 /**
36 * @description: 加载表格数据
37 * @param {*} arg
38 * @author: renchao
39 */
35 loadData(arg) { 40 loadData(arg) {
36 if (!this.tableUrl) { 41 if (!this.tableUrl) {
37 console.log('请设置tableUrl属性为接口地址!') 42 console.log('请设置tableUrl属性为接口地址!')
...@@ -63,22 +68,45 @@ export const TableListMixin = { ...@@ -63,22 +68,45 @@ export const TableListMixin = {
63 }) 68 })
64 }, 69 },
65 // 字典值配置 70 // 字典值配置
71 /**
72 * @description: 字典值配置
73 * @author: renchao
74 */
66 initDictConfig() { 75 initDictConfig() {
67 // console.log('假初始化字典值方法!') 76 // console.log('假初始化字典值方法!')
68 }, 77 },
69 // 选择所有和取消所有 78 // 选择所有和取消所有
79 /**
80 * @description: 选择所有和取消所有
81 * @param {*} checked
82 * @param {*} records
83 * @author: renchao
84 */
70 selectAllEvent({ checked, records }) { 85 selectAllEvent({ checked, records }) {
71 this.selectionRows = records 86 this.selectionRows = records
72 }, 87 },
73 // 选中节点 88 // 选中节点
89 /**
90 * @description: 选中节点
91 * @param {*} records
92 * @author: renchao
93 */
74 selectChangeEvent({ records }) { 94 selectChangeEvent({ records }) {
75 this.selectionRows = records 95 this.selectionRows = records
76 }, 96 },
77 // 使用查询条件查询 97 // 使用查询条件查询
98 /**
99 * @description: 使用查询条件查询
100 * @author: renchao
101 */
78 searchQuery() { 102 searchQuery() {
79 this.loadData() 103 this.loadData()
80 }, 104 },
81 // 获取查询条件 105 // 获取查询条件
106 /**
107 * @description: 获取查询条件
108 * @author: renchao
109 */
82 getQueryParams() { 110 getQueryParams() {
83 if (this.queryOptions !== '') { 111 if (this.queryOptions !== '') {
84 this.queryParam.queryOptions = JSON.stringify(this.queryOptions) 112 this.queryParam.queryOptions = JSON.stringify(this.queryOptions)
...@@ -86,17 +114,32 @@ export const TableListMixin = { ...@@ -86,17 +114,32 @@ export const TableListMixin = {
86 return this.$filterNullObj(this.queryParam) 114 return this.$filterNullObj(this.queryParam)
87 }, 115 },
88 // 新增 116 // 新增
117 /**
118 * @description: 新增
119 * @author: renchao
120 */
89 handleAdd: function() { 121 handleAdd: function() {
90 this.$refs.dialogForm.add() 122 this.$refs.dialogForm.add()
91 this.$refs.dialogForm.title = '新增' 123 this.$refs.dialogForm.title = '新增'
92 }, 124 },
93 // 修改 125 // 修改
126 /**
127 * @description: 修改
128 * @param {*} record
129 * @author: renchao
130 */
94 handleEdit: function(record) { 131 handleEdit: function(record) {
95 localStorage.setItem('record', JSON.stringify(record)) 132 localStorage.setItem('record', JSON.stringify(record))
96 this.$refs.dialogForm.edit(record) 133 this.$refs.dialogForm.edit(record)
97 this.$refs.dialogForm.title = '修改' 134 this.$refs.dialogForm.title = '修改'
98 }, 135 },
99 // 删除 136 // 删除
137 /**
138 * @description: 删除
139 * @param {*} id
140 * @param {*} content
141 * @author: renchao
142 */
100 handleDelete: function(id, content = '') { 143 handleDelete: function(id, content = '') {
101 this.$confirm( 144 this.$confirm(
102 `<div class="customer-message-wrapper"> 145 `<div class="customer-message-wrapper">
...@@ -137,6 +180,10 @@ export const TableListMixin = { ...@@ -137,6 +180,10 @@ export const TableListMixin = {
137 .catch(() => {}) 180 .catch(() => {})
138 }, 181 },
139 // 批量删除 182 // 批量删除
183 /**
184 * @description: 批量删除
185 * @author: renchao
186 */
140 batchDel: function() { 187 batchDel: function() {
141 if (!this.tableUrl) { 188 if (!this.tableUrl) {
142 this.$message.error({ 189 this.$message.error({
...@@ -174,10 +221,20 @@ export const TableListMixin = { ...@@ -174,10 +221,20 @@ export const TableListMixin = {
174 .catch(() => {}) 221 .catch(() => {})
175 }, 222 },
176 // 新增或修改成功时,重载列表 223 // 新增或修改成功时,重载列表
224 /**
225 * @description: 新增或修改成功时,重载列表
226 * @author: renchao
227 */
177 dialogFormOk() { 228 dialogFormOk() {
178 this.loadData() 229 this.loadData()
179 }, 230 },
180 // 导出 231 // 导出
232 /**
233 * @description: 导出
234 * @param {*} data
235 * @param {*} name
236 * @author: renchao
237 */
181 handleExportXls(data, name) { 238 handleExportXls(data, name) {
182 if (name === '菜单' || name === '部门' || name === '机构' || 239 if (name === '菜单' || name === '部门' || name === '机构' ||
183 name === '资源' || name === '资源分类' || name === '数据字典' || name === '行政区划') { 240 name === '资源' || name === '资源分类' || name === '数据字典' || name === '行政区划') {
...@@ -205,6 +262,10 @@ export const TableListMixin = { ...@@ -205,6 +262,10 @@ export const TableListMixin = {
205 } 262 }
206 }, 263 },
207 /* 导入 */ 264 /* 导入 */
265 /**
266 * @description: 导入
267 * @author: renchao
268 */
208 handleImportExcel(info) {} 269 handleImportExcel(info) {}
209 } 270 }
210 } 271 }
......
...@@ -16,8 +16,16 @@ let mixin = { ...@@ -16,8 +16,16 @@ let mixin = {
16 this.featchData() 16 this.featchData()
17 }, 17 },
18 methods: { 18 methods: {
19 /**
20 * @description: featchData
21 * @author: renchao
22 */
19 featchData () { 23 featchData () {
20 }, 24 },
25 /**
26 * @description: verificationForm
27 * @author: renchao
28 */
21 verificationForm () { 29 verificationForm () {
22 return new Promise((resolve) => { 30 return new Promise((resolve) => {
23 this.$refs['formList'].validate((valid) => { 31 this.$refs['formList'].validate((valid) => {
...@@ -29,9 +37,17 @@ let mixin = { ...@@ -29,9 +37,17 @@ let mixin = {
29 }) 37 })
30 }) 38 })
31 }, 39 },
40 /**
41 * @description: changeCertificate
42 * @author: renchao
43 */
32 changeCertificate() { 44 changeCertificate() {
33 45
34 }, 46 },
47 /**
48 * @description: featchRule
49 * @author: renchao
50 */
35 async featchRule () { 51 async featchRule () {
36 try { 52 try {
37 let { result: { sysywsjbfieldlist } } = await ruleConfig.getRuleList(this.bsmYwsjb) 53 let { result: { sysywsjbfieldlist } } = await ruleConfig.getRuleList(this.bsmYwsjb)
...@@ -75,4 +91,4 @@ let mixin = { ...@@ -75,4 +91,4 @@ let mixin = {
75 } 91 }
76 } 92 }
77 } 93 }
78 export default mixin
...\ No newline at end of file ...\ No newline at end of file
94 export default mixin
......
...@@ -21,13 +21,27 @@ let mixin = { ...@@ -21,13 +21,27 @@ let mixin = {
21 }, 21 },
22 methods: { 22 methods: {
23 // 表格索引得问题 23 // 表格索引得问题
24 /**
25 * @description: 表格索引得问题
26 * @param {*} index
27 * @author: renchao
28 */
24 indexMethod (index) { 29 indexMethod (index) {
25 return index + 1 + (this.form.currentPage - 1) * this.formData.pageSize; 30 return index + 1 + (this.form.currentPage - 1) * this.formData.pageSize;
26 }, 31 },
32 /**
33 * @description: handleSizeChange
34 * @param {*} val
35 * @author: renchao
36 */
27 handleSizeChange (val) { 37 handleSizeChange (val) {
28 this.formData.pageSize = val 38 this.formData.pageSize = val
29 this.featchData() 39 this.featchData()
30 }, 40 },
41 /**
42 * @description: handleSearch
43 * @author: renchao
44 */
31 handleSearch () { 45 handleSearch () {
32 this.form.currentPage = 1 46 this.form.currentPage = 1
33 this.tableData.data = [] 47 this.tableData.data = []
...@@ -38,15 +52,29 @@ let mixin = { ...@@ -38,15 +52,29 @@ let mixin = {
38 this.queryClick() 52 this.queryClick()
39 } 53 }
40 }, 54 },
55 /**
56 * @description: handleCurrentChange
57 * @param {*} val
58 * @author: renchao
59 */
41 handleCurrentChange (val) { 60 handleCurrentChange (val) {
42 this.form.currentPage = val 61 this.form.currentPage = val
43 this.featchData() 62 this.featchData()
44 }, 63 },
64 /**
65 * @description: handleSubmit
66 * @author: renchao
67 */
45 handleSubmit () { 68 handleSubmit () {
46 this.tableData.data = [] 69 this.tableData.data = []
47 this.featchData() 70 this.featchData()
48 }, 71 },
49 // 详情 72 // 详情
73 /**
74 * @description: 详情
75 * @param {*} row
76 * @author: renchao
77 */
50 handleEdit (row) { 78 handleEdit (row) {
51 this.$refs.editLog.isShow(row); 79 this.$refs.editLog.isShow(row);
52 if (row.rectypeName) { 80 if (row.rectypeName) {
...@@ -70,6 +98,10 @@ let mixin = { ...@@ -70,6 +98,10 @@ let mixin = {
70 } 98 }
71 }, 99 },
72 // 重置表单 100 // 重置表单
101 /**
102 * @description: 重置表单
103 * @author: renchao
104 */
73 resetForm () { 105 resetForm () {
74 if (!this.form) return 106 if (!this.form) return
75 Object.keys(this.form).forEach((key) => { 107 Object.keys(this.form).forEach((key) => {
......