codeMan před 2 roky
rodič
revize
573902cd9c

+ 59 - 51
src/SManagement/archives_upload/index.vue

@@ -20,15 +20,23 @@
         </file-list>
         <!--富文本-->
         <file-text ref="text" v-if="uploadType == '3'">
-          <Editor ref="editor" slot="editor" :content="cacheInfo.content.content"
-            :id="uploadCacheData.sat_sharematerialid">
-          </Editor>
+          <Editor
+            ref="editor"
+            slot="editor"
+            :content="cacheInfo.content.content"
+            :id="uploadCacheData.sat_sharematerialid"
+          ></Editor>
         </file-text>
       </el-col>
       <!-- 授权范围 -->
       <el-col :span="10">
-        <scopeOfauth style="margin-left:10px;" :defaultData="defaultData" :dataid="authId"
-          appidname="sat_sharematerialid" obiectName="sat_sharematerial" @onChecked="onChecked" />
+        <scopeOfauth
+          style="margin-left:10px;"
+          :defaultData="defaultData"
+          :dataid="authId"
+          appidname="sat_sharematerialid"
+          @onChecked="onChecked"
+        />
       </el-col>
     </el-row>
   </div>
@@ -53,7 +61,7 @@ import removeFile from '@/utils/removeFile'
 import { log } from '@antv/g2plot/lib/utils'
 export default {
   name: 'index',
-  data() {
+  data () {
     return {
       //新增请求配置
       cacheInfo: {
@@ -79,7 +87,7 @@ export default {
       defaultData: {},
       authData: {},
       authId: 0,
-    };
+    }
   },
   components: {
     Header,
@@ -98,55 +106,55 @@ export default {
   },
   watch: {
   },
-  mounted() {
+  mounted () {
     //获取上传模板
     this.uploadData(JSON.parse(window.sessionStorage.getItem("newMaterial")))
   },
-  beforeDestroy() {
+  beforeDestroy () {
     // this.removeAllData()
   },
   methods: {
     //获取素材模板
-    uploadData(data) {
-      this.cacheInfo.content.sat_sharematerialid = data.sat_sharematerialid;
-      this.cacheInfo.content.title = data.title;
-      this.cacheInfo.content.sat_sharematerial_classid = data.sat_sharematerial_classid;
-      this.cacheInfo.content.content = data.content;
-      this.uploadType = data.type;
-      this.$refs.set.ruleForm.title = data.title;
-      this.$refs.set.ruleForm.category = data.sat_sharematerial_classid;
-      this.uploadCacheData.sat_sharematerialid = data.sat_sharematerialid;
-      this.uploadCacheData.attinfos = data.attinfos;
-      this.authId = this.$route.query.id;
-      setTimeout(this.randerData, 100);
-      if (data.title != '') this.uploadCacheData.status = "完成";
-      this.query_auth();
+    uploadData (data) {
+      this.cacheInfo.content.sat_sharematerialid = data.sat_sharematerialid
+      this.cacheInfo.content.title = data.title
+      this.cacheInfo.content.sat_sharematerial_classid = data.sat_sharematerial_classid
+      this.cacheInfo.content.content = data.content
+      this.uploadType = data.type
+      this.$refs.set.ruleForm.title = data.title
+      this.$refs.set.ruleForm.category = data.sat_sharematerial_classid
+      this.uploadCacheData.sat_sharematerialid = data.sat_sharematerialid
+      this.uploadCacheData.attinfos = data.attinfos
+      this.authId = this.$route.query.id
+      setTimeout(this.randerData, 100)
+      if (data.title != '') this.uploadCacheData.status = "完成"
+      this.query_auth()
     },
     /* 更新附件列表数据 */
-    randerData() {
+    randerData () {
       if (this.uploadType != 3) this.$refs.attFileList.randerData(this.uploadCacheData.attinfos)
     },
-    deleteFile(id) {
-      this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.filter(v => v.linksid != id);
-      this.randerData();
+    deleteFile (id) {
+      this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.filter(v => v.linksid != id)
+      this.randerData()
     },
     //保存
-    save() {
+    save () {
       this.$refs.set.$refs.form.validate((val) => {
         if (val) {
           //判断有无内容
           if (this.uploadType == '3') {
-            const content = this.$refs.editor.editor.getHtml();
-            if (content == "<p><br></p>") return this.$message.error('您还未编辑图文内容');
-            this.cacheInfo.content.content = content;
+            const content = this.$refs.editor.editor.getHtml()
+            if (content == "<p><br></p>") return this.$message.error('您还未编辑图文内容')
+            this.cacheInfo.content.content = content
           } else {
-            if (this.uploadCacheData.attinfos.length == 0) return this.$message.error('您还未上传附件');
+            if (this.uploadCacheData.attinfos.length == 0) return this.$message.error('您还未上传附件')
           }
-          this.cacheInfo.content.type = this.uploadType;
+          this.cacheInfo.content.type = this.uploadType
           //判断所属ID是否为初始ID
-          if (this.cacheInfo.content.sat_sharematerial_classid == '9999' + JSON.parse(window.sessionStorage.getItem("active_account")).userid) return this.$message.error('请选择素材分类');
+          if (this.cacheInfo.content.sat_sharematerial_classid == '9999' + JSON.parse(window.sessionStorage.getItem("active_account")).userid) return this.$message.error('请选择素材分类')
           this.$api.requested(this.cacheInfo).then(res => {
-            this.tool.showMessage(res,() => {
+            this.tool.showMessage(res, () => {
               this.uploadCacheData.status = '完成'
               this.insertCoursewareauth()
               this.$router.go(-1)
@@ -162,7 +170,7 @@ export default {
       })
     },
     // 查询授权信息
-    async query_auth() {
+    async query_auth () {
       const res = await this.$api.requested({
         "classname": "webmanage.saletool.sharematerial.sharematerialAuth",
         "method": "selectAuth",
@@ -173,12 +181,12 @@ export default {
       this.defaultData = res.data
     },
     // 新增授权范围
-    async insertCoursewareauth() {
+    async insertCoursewareauth () {
       let p = {
         "classname": "webmanage.saletool.sharematerial.sharematerialAuth",
         "method": "insertOrUpdate",
         "content": this.authData
-      };
+      }
       const res = await this.$api.requested(p)
       res.code === 0 ? this.$notify({
         title: '失败',
@@ -187,14 +195,14 @@ export default {
       }) : ''
     },
     // 获取保存授权范围数据
-    onChecked(param) {
+    onChecked (param) {
       this.authData = param
     },
 
     //文件上传成功
-    async onSuccess(id) {
-      console.log(id);
-      
+    async onSuccess (id) {
+      console.log(id)
+
       let param = {
         "classname": "system.attachment.Attachment",
         "method": "createFileLink",
@@ -211,17 +219,17 @@ export default {
         message: '上传失败',
         type: 'error'
       })
-      this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.concat(res.data);
-      this.randerData();
+      this.uploadCacheData.attinfos = this.uploadCacheData.attinfos.concat(res.data)
+      this.randerData()
     },
     //退出后对数据进行销毁
-    async removeAllData() {
+    async removeAllData () {
       if (this.$route.params.data) {
         this.uploadCacheData.status = "新建"
         this.uploadCacheData.sat_sharematerialid = this.create_sat_sharematerialid
       }
       if (this.uploadCacheData.status == '新建') {
-        let attinfos = this.uploadCacheData.attinfos;
+        let attinfos = this.uploadCacheData.attinfos
         //删除附件
         removeFile.removeFileList(attinfos)
         //删除素材
@@ -236,7 +244,7 @@ export default {
       }
     },
     //重置所有数据
-    reSetAllData() {
+    reSetAllData () {
       this.cacheInfo.content.title = ''
       this.cacheInfo.content.sat_sharematerial_classid = ''
       this.$refs.editor.html = ''
@@ -245,12 +253,12 @@ export default {
       this.uploadCacheData.attinfos = []
     },
     /* set组件 分类选择回调 */
-    selectChange(id) {
-      this.cacheInfo.content.sat_sharematerial_classid = id;
+    selectChange (id) {
+      this.cacheInfo.content.sat_sharematerial_classid = id
     },
     /* set组件 title填写回调 */
-    titleChange(name) {
-      this.cacheInfo.content.title = name;
+    titleChange (name) {
+      this.cacheInfo.content.title = name
     },
   },
 };

+ 19 - 19
src/SManagement/submitedit_one/components/list.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="list" v-if="list.length != 0">
-    <div class="list-item" @click="itemClick(item.sat_submiteditmodelid,item.ishistory)" v-for="(item,index) in list" :key="index">
+    <div class="list-item" @click="itemClick(item.sat_submiteditmodelid,item.ishistory)" v-for="(item,index) in list"
+      :key="index">
       <div class="header1">
         <div class="handle" :class="item.ishistory == 0 ? 'action' : 'no-action'">
           {{item.ishistory == 0 ? '进行中' : '已结束'}}
@@ -27,10 +28,10 @@ export default {
   },
   props: {
     list: {
-      type:Array
+      type: Array
     },
-    type:{
-      default() {
+    type: {
+      default () {
         return ''
       }
     }
@@ -39,17 +40,17 @@ export default {
   },
   watch: {
   },
-  mounted() {
+  mounted () {
   },
   methods: {
-    itemClick (id,history) {
-      window.sessionStorage.setItem('currentPath',this.$route.path)
-      window.sessionStorage.setItem('history',history)
+    itemClick (id, history) {
+      window.sessionStorage.setItem('currentPath', this.$route.path)
+      window.sessionStorage.setItem('history', history)
       this.$router.push({
         path: '/submiteditmag_detail',
         query: {
-          id:id,
-          type:this.type
+          id: id,
+          type: this.type
         }
       })
     }
@@ -69,7 +70,7 @@ export default {
 .list .list-item {
   width: 390px;
   height: 140px;
-  background: #F8F8F8;
+  background: #f8f8f8;
   border-radius: 4px 4px 4px 4px;
   margin: 0 16px 16px 0;
   padding: 16px;
@@ -91,17 +92,17 @@ export default {
   width: 52px;
   height: 24px;
   border-radius: 2px 2px 2px 2px;
-  border: 1px solid #CCCCCC;
+  border: 1px solid #cccccc;
   text-align: center;
   line-height: 22px;
 }
 .list .list-item .header1 .action {
-  color: #FA8C16;
-  border: 1px solid #FA8C16;
+  color: #fa8c16;
+  border: 1px solid #fa8c16;
 }
 .list .list-item .header1 .no-action {
   color: #666666;
-  border: 1px solid #CCCCCC;
+  border: 1px solid #cccccc;
 }
 .list .list-item .header1 .title {
   font-size: 14px;
@@ -134,7 +135,6 @@ export default {
   font-size: 12px;
   font-weight: 400;
   color: #999999;
-  
 }
 .list .list-item .footer .status {
   width: 36px;
@@ -146,12 +146,12 @@ export default {
   line-height: 22px;
 }
 .list .list-item .footer .read {
-  color: #FF3B30;
-  background: #FFEDEC;
+  color: #ff3b30;
+  background: #ffedec;
 }
 .list .list-item .footer .no-read {
   color: #999999;
-  background: #EEEEEE;
+  background: #eeeeee;
 }
 /deep/.el-empty {
   position: absolute;

+ 18 - 14
src/SManagement/user/role-edit/RoleEdit.vue

@@ -66,27 +66,31 @@ export default {
       })
     },
     async save () {
-      this.add.content.rolename = this.$refs.info.ruleForm.name
+      this.add.content.rolename = this.$refs.info.ruleForm.name      
       this.add.content.remarks = this.$refs.info.ruleForm.descript
       this.getAllPower()
       this.$refs.info.$refs.ruleForm.validate(async val => {
         if (val) {
           if (this.editData != 0) {
-            let res = await this.$api.requested({
-              "classname": "sale.role.role",
-              "method": "add_appauth",
-              "content": {
-                "roleid": this.roleid,
-                "systemapps": this.allPower
-              }
-            })
-            this.tool.showMessage(res, () => {
-              this.$router.back()
-            })
+            this.add.content.roleid = this.editData.roleid
+            let res = await this.$api.requested(this.add)
+            if(res.code == 1) {
+              let res = await this.$api.requested({
+                "classname": "sale.role.role",
+                "method": "add_appauth",
+                "content": {
+                  "roleid": this.roleid,
+                  "systemapps": this.allPower
+                }
+              })
+              this.tool.showMessage(res, () => {
+                this.$router.back()
+              })
+            }
           } else {
             let res = await this.$api.requested(this.add)
             if (res.code == 1) {
-              this.$api.requested({
+              let res2 = this.$api.requested({
                 "classname": "sale.role.role",
                 "method": "add_appauth",
                 "content": {
@@ -94,7 +98,7 @@ export default {
                   "systemapps": this.allPower
                 }
               })
-              this.tool.showMessage(res, () => {
+              this.tool.showMessage(res2, () => {
                 this.$router.back()
               })
             }

+ 10 - 10
src/SManagement/user/role-manage/RoleManage.vue

@@ -3,13 +3,13 @@
     <div class="top">
       <p>角色管理</p>
       <el-button type="primary" @click="addRole()" v-if="tool.checkAuth($route.name,'insert')">
-        <img src="@/assets/add.png" alt="" style="vertical-align:middle">
+        <img src="@/assets/add.png" alt style="vertical-align:middle" />
         新建角色
       </el-button>
     </div>
     <role-item :roleData="roleData" v-if="tool.checkAuth($route.name,'read') && roleData.length != 0">
       <template v-slot:icon="scope">
-        <img src="@/assets/edit.png" alt="" @click="roleEdit(scope.data)" v-if="tool.checkAuth($route.name,'update')">
+        <img src="@/assets/edit.png" alt @click="roleEdit(scope.data)" v-if="tool.checkAuth($route.name,'update')" />
       </template>
       <template v-slot:remove="scope">
         <remove-role :roleData="scope.data" v-if="tool.checkAuth($route.name,'delete')"></remove-role>
@@ -39,7 +39,7 @@ export default {
         }
       },
       roleData: []
-    };
+    }
   },
   props: [],
   components: {
@@ -61,7 +61,7 @@ export default {
     },
     //角色编辑
     roleEdit (data) {
-      window.sessionStorage.setItem('currentEditRole',JSON.stringify(data))
+      window.sessionStorage.setItem('currentEditRole', JSON.stringify(data))
       this.$router.push({
         name: 'roleEdit',
         params: {
@@ -70,12 +70,12 @@ export default {
       })
     },
     addRole () {
-      window.sessionStorage.setItem('currentEditRole',0)
-      window.sessionStorage.setItem('currentPath','/role_managent')
+      window.sessionStorage.setItem('currentEditRole', 0)
+      window.sessionStorage.setItem('currentPath', '/role_managent')
       this.$router.push({
-        path:'role_edit',
+        path: 'role_edit',
         query: {
-          id:0
+          id: 0
         }
       })
     },
@@ -84,7 +84,7 @@ export default {
 </script>
 
 <style scoped>
-*{
+* {
   box-sizing: border-box;
 }
 .role {
@@ -109,6 +109,6 @@ export default {
   position: absolute;
   left: 50%;
   top: 50%;
-  transform: translate(-50%,-50%);
+  transform: translate(-50%, -50%);
 }
 </style>

+ 2 - 0
src/SManagement/user/user-info/UserInfo.vue

@@ -57,6 +57,8 @@ export default {
   },
   created() {
     this.getUserInfo()
+    console.log(this.$options);
+    
   },
   methods: {
     //获取用户信息