Kaynağa Gözat

添加部分注释

sunjh 6 yıl önce
ebeveyn
işleme
2ad3095763

+ 14 - 0
src/components/authen/Authentication.vue

@@ -142,6 +142,7 @@ export default {
     })
   },
   methods: {
+    //初始化数据
     init () {
       this.setServiceTypes()
       this.setResourceTypes()
@@ -149,9 +150,11 @@ export default {
     //加载数据
     loadData: function () {
     },
+    //表单进入可编辑状态,可修改表单,不再使用
     modifyInfo () {
       this.isModifyMode = true
     },
+    //提交认证信息
     submitInfo () {
       //this.isModifyMode = false
       const newAuthentication = {
@@ -170,12 +173,15 @@ export default {
         notify('error', error.data.msg)
       })
     },
+    //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {
       this.isModifyMode = false
     },
+    //上传文件时移除文件的响应函数
     handleRemove (file, fileList) {
       console.log(file, fileList)
     },
+    //添加文件时的响应函数
     handleExceed (files, fileList) {
       this.$message.warning(
         `当前限制选择 1 个文件,本次选择了 ${
@@ -183,11 +189,14 @@ export default {
           } 个文件,共选择了 ${files.length + fileList.length} 个文件`
       )
     },
+    //移除文件前的响应函数
     beforeRemove (file, fileList) {
       //return this.$confirm(`确定移除 ${file.name}?`)
     },
+    //文件上传前的响应函数
     beforeFileUpload () {
     },
+    //上传文件,此处为上传图片
     uploadFile (param) {
       const formData = new FormData()
       let config = {
@@ -204,12 +213,15 @@ export default {
         notify('error', error.data.msg)
       })
     },
+    //设置服务类型
     setServiceTypes () {
       this.serviceTypes = getAllServiceTypes()
     },
+    //设置机构资源类型
     setResourceTypes () {
       this.resourceTypes = getAllAgencyResourceTypes()
     },
+    //添加一项测评机构资源
     addAgencyResource () {
       const tmpResource = {
         id: this.authentication.resource.length,
@@ -220,12 +232,14 @@ export default {
       }
       this.authentication.resource.push(tmpResource)
     },
+    //删除一项测评机构资源
     removeAgencyResource (id) {
       this.authentication.resource.splice(id, 1)
       for (var i = 0; i < this.authentication.resource.length; i++) {
         this.authentication.resource[i].id = i
       }
     },
+    //检测测评机构资源填写是否有效
     checkAgencyResourceVaild () {
       if (this.authentication.resource.length === 0) {
         return true

+ 19 - 0
src/components/cheat/AgencyAdd.vue

@@ -258,6 +258,7 @@ export default {
     })
   },
   methods: {
+    //初始化
     init () {
       this.setServiceTypes()
       this.setResourceTypes()
@@ -265,9 +266,11 @@ export default {
     //加载数据
     loadData: function () {
     },
+    //表单进入可编辑状态,可修改表单,不再使用
     modifyInfo () {
       this.isModifyMode = true
     },
+    //提交表单
     submitInfo () {
       //this.showDialog()
       const newAgency = {
@@ -292,12 +295,15 @@ export default {
         notify('error', error.data.msg)
       })
     },
+    //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {
       this.isModifyMode = false
     },
+    //上传文件时移除文件的响应函数
     handleRemove (file, fileList) {
       console.log(file, fileList)
     },
+    //添加文件时的响应函数
     handleExceed (files, fileList) {
       this.$message.warning(
         `当前限制选择 1 个文件,本次选择了 ${
@@ -305,11 +311,14 @@ export default {
           } 个文件,共选择了 ${files.length + fileList.length} 个文件`
       )
     },
+    //移除文件前的响应函数
     beforeRemove (file, fileList) {
       return this.$confirm(`确定移除 ${file.name}?`)
     },
+    //文件上传前的响应函数
     beforeFileUpload () {
     },
+    //上传文件,此处为上传图片
     uploadFile (param) {
       const formData = new FormData()
       let config = {
@@ -327,6 +336,7 @@ export default {
         notify('error', error.data.msg)
       })
     },
+    //关闭对话框时的响应函数
     handleDialogClose (done) {
       this.$confirm('确认退出?退出前请记录下登录账号和密码,否则无法找回!!!')
         .then(_ => {
@@ -336,13 +346,16 @@ export default {
         .catch(_ => {
         })
     },
+    //弹出对话框
     showDialog () {
       this.dialogVisible = true
     },
+    //隐藏对话框
     hideDialog () {
       this.dialogVisible = false
       this.resetForm()
     },
+    //TODO 跳转到登录页面
     toLogin () {
       this.hideDialog()
       this.$router.push({
@@ -350,6 +363,7 @@ export default {
         // params: {projectId: projectId, taskId: taskId}
       })
     },
+    //重置表单
     resetForm () {
       this.agency = {
         mobile: '',
@@ -365,9 +379,11 @@ export default {
         username: '',
       }
     },
+    //设置服务类型
     setServiceTypes () {
       this.serviceTypes = getAllAbilities()
     },
+    //添加一项测评机构资源
     addAgencyResource () {
       const tmpResource = {
         id: this.agency.resource.length,
@@ -378,15 +394,18 @@ export default {
       }
       this.agency.resource.push(tmpResource)
     },
+    //删除一项测评机构资源
     removeAgencyResource (id) {
       this.agency.resource.splice(id, 1)
       for (var i = 0; i < this.agency.resource.length; i++) {
         this.agency.resource[i].id = i
       }
     },
+    //设置测评机构资源类型
     setResourceTypes () {
       this.resourceTypes = getAllAgencyResourceTypes()
     },
+    //检测测评机构资源填写是否有效
     checkAgencyResourceVaild () {
       if (this.agency.resource.length === 0) {
         return true