Browse Source

新增功能

sunkuosheng 5 tháng trước cách đây
mục cha
commit
d9e7a6dea8

+ 8 - 1
ruoyi-ui/src/api/system/user.js

@@ -26,7 +26,14 @@ export function addUser(data) {
     data: data
     data: data
   })
   })
 }
 }
-
+// 新增用户
+export function batchInsert(data) {
+  return request({
+    url: '/system/user/batchInsert',
+    method: 'post',
+    data: data
+  })
+}
 // 修改用户
 // 修改用户
 export function updateUser(data) {
 export function updateUser(data) {
   return request({
   return request({

+ 12 - 2
ruoyi-ui/src/layout/components/Sidebar/Logo.vue

@@ -7,7 +7,7 @@
       </router-link>
       </router-link>
       <router-link v-else key="expand" class="sidebar-logo-link" :to=" {path: $route.fullPath}">
       <router-link v-else key="expand" class="sidebar-logo-link" :to=" {path: $route.fullPath}">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 class="sidebar-title">{{ title }} </h1>
+        <h1 class="sidebar-title" @click="goHome()">{{ title }} </h1>
       </router-link>
       </router-link>
     </transition>
     </transition>
   </div>
   </div>
@@ -16,7 +16,7 @@
 <script>
 <script>
 import logoImg from '@/assets/logo/logo.png'
 import logoImg from '@/assets/logo/logo.png'
 import variables from '@/assets/styles/variables.scss'
 import variables from '@/assets/styles/variables.scss'
-
+import { mapGetters } from 'vuex'
 export default {
 export default {
   name: 'SidebarLogo',
   name: 'SidebarLogo',
   props: {
   props: {
@@ -26,6 +26,9 @@ export default {
     }
     }
   },
   },
   computed: {
   computed: {
+    ...mapGetters([
+      'isAdmin',
+    ]),
     variables() {
     variables() {
       return variables;
       return variables;
     },
     },
@@ -33,6 +36,13 @@ export default {
       return this.$store.state.settings.sideTheme
       return this.$store.state.settings.sideTheme
     }
     }
   },
   },
+  methods:{
+    goHome(){
+      if(this.isAdmin){
+        this.$router.push({ path:'/index' })
+      }
+    }
+  },
   data() {
   data() {
     return {
     return {
       title: 'OKC课堂智慧分析系统',
       title: 'OKC课堂智慧分析系统',

+ 1 - 1
ruoyi-ui/src/views/login.vue

@@ -50,7 +50,7 @@
           <span v-else>登 录 中...</span>
           <span v-else>登 录 中...</span>
         </el-button>
         </el-button>
         <div style="float: left;" v-if="register">
         <div style="float: left;" v-if="register">
-          <router-link style="color: #1e1e1e" class="link-type" :to="'/register'">立即注册</router-link>
+          <router-link style="color: #30D2BE" class="link-type" :to="'/register'">立即注册</router-link>
         </div>
         </div>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>

+ 8 - 4
ruoyi-ui/src/views/register.vue

@@ -55,7 +55,7 @@
           <span v-else>注 册 中...</span>
           <span v-else>注 册 中...</span>
         </el-button>
         </el-button>
         <div style="float: right;">
         <div style="float: right;">
-          <router-link class="link-type" :to="'/login'">使用已有账户登录</router-link>
+          <router-link style="color: #30D2BE" class="link-type" :to="'/login'">使用已有账户登录</router-link>
         </div>
         </div>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
@@ -145,13 +145,16 @@ export default {
 };
 };
 </script>
 </script>
 
 
-<style rel="stylesheet/scss" lang="scss">
+<style rel="stylesheet/scss" lang="scss" scoped>
+  @import "@/assets/styles/global.scss";
 .register {
 .register {
   display: flex;
   display: flex;
   justify-content: center;
   justify-content: center;
   align-items: center;
   align-items: center;
   height: 100%;
   height: 100%;
-  background-image: url("../assets/images/login-background.jpg");
+  //background-image: url("../assets/images/bg.jpg");
+  //background-image: linear-gradient(to right,#000, #434343);
+  background-image: linear-gradient(-225deg, #47368f 0%, #3584A7 51%, #30D2BE 100%);
   background-size: cover;
   background-size: cover;
 }
 }
 .title {
 .title {
@@ -162,7 +165,8 @@ export default {
 
 
 .register-form {
 .register-form {
   border-radius: 6px;
   border-radius: 6px;
-  background: #ffffff;
+  /*background: #ffffff;*/
+  background-color: rgba(10, 10, 10, 0.17);
   width: 400px;
   width: 400px;
   padding: 25px 25px 5px 25px;
   padding: 25px 25px 5px 25px;
   .el-input {
   .el-input {

+ 83 - 2
ruoyi-ui/src/views/system/user/index.vue

@@ -91,6 +91,16 @@
               v-hasPermi="['system:user:add']"
               v-hasPermi="['system:user:add']"
             >新增</el-button>
             >新增</el-button>
           </el-col>
           </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdds"
+              v-hasPermi="['system:user:add']"
+            >批量新增</el-button>
+          </el-col>
           <el-col :span="1.5">
           <el-col :span="1.5">
             <el-button
             <el-button
               type="success"
               type="success"
@@ -307,6 +317,36 @@
         <el-button @click="cancel">取 消</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
+    <el-dialog title="批量新增" :visible.sync="open2" width="400px" append-to-body>
+      <el-form ref="form2" :model="form2" :rules="rules2" label-width="80px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item  label="账号前缀" prop="userName">
+              <el-input v-model="form2.userName" placeholder="请输入账号前缀" maxlength="30" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="form2.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="账号数量"  prop="delFlag">
+              <number v-model="form2.delFlag"  :min="1" :max="500" placeholder="请输入账号数量"></number>
+              <!--<el-input v-model="form.delFlag"  placeholder="请输入账号数量"></el-input>-->
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm2">确 定</el-button>
+        <el-button @click="open2=false">取 消</el-button>
+      </div>
+    </el-dialog>
 
 
     <!-- 用户导入对话框 -->
     <!-- 用户导入对话框 -->
     <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
     <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
@@ -341,7 +381,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
+import { listUser, getUser, delUser, addUser,batchInsert, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -384,6 +424,8 @@ export default {
       roleOptions: [],
       roleOptions: [],
       // 表单参数
       // 表单参数
       form: {},
       form: {},
+      form2:{},
+      open2:false,
       defaultProps: {
       defaultProps: {
         children: "children",
         children: "children",
         label: "label"
         label: "label"
@@ -423,6 +465,15 @@ export default {
         { key: 6, label: `创建时间`, visible: true }
         { key: 6, label: `创建时间`, visible: true }
       ],
       ],
       // 表单校验
       // 表单校验
+      rules2:{
+        userName: [
+          { required: true, message: "账号前缀不能为空", trigger: "blur" },
+          { min: 2, max: 6, message: '账号前缀长度必须介于 2 和 6 之间', trigger: 'blur' }
+        ],
+        delFlag: [
+          { required: true, message: "账号数量不能为空", trigger: "blur" }
+        ],
+      },
       rules: {
       rules: {
         userName: [
         userName: [
           { required: true, message: "用户名称不能为空", trigger: "blur" },
           { required: true, message: "用户名称不能为空", trigger: "blur" },
@@ -526,6 +577,15 @@ export default {
       };
       };
       this.resetForm("form");
       this.resetForm("form");
     },
     },
+    reset2() {
+      this.form2 = {
+        deptId: undefined,
+        userName: undefined,
+        userId: undefined,
+        delFlag: undefined,
+      };
+      this.resetForm("form2");
+    },
     /** 搜索按钮操作 */
     /** 搜索按钮操作 */
     handleQuery() {
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.queryParams.pageNum = 1;
@@ -569,6 +629,10 @@ export default {
         this.form.password = this.initPassword;
         this.form.password = this.initPassword;
       });
       });
     },
     },
+    handleAdds(){
+      this.reset2()
+      this.open2 = true;
+    },
     /** 修改按钮操作 */
     /** 修改按钮操作 */
     handleUpdate(row) {
     handleUpdate(row) {
       this.reset();
       this.reset();
@@ -603,6 +667,23 @@ export default {
       const userId = row.userId;
       const userId = row.userId;
       this.$router.push("/system/user-auth/role/" + userId);
       this.$router.push("/system/user-auth/role/" + userId);
     },
     },
+    submitForm2:function(){
+      this.$refs["form2"].validate(valid => {
+        if (valid) {
+          this.open2 = false;
+          // batchInsert(this.form2).then(response => {
+          //
+          //   this.getList();
+          // }).catch(()=>{
+          //   this.open2 = false;
+          // })
+          this.download('system/user/batchInsert', {
+            ...this.form2
+          }, `user_${new Date().getTime()}.xlsx`)
+
+        }
+      });
+    },
     /** 提交按钮 */
     /** 提交按钮 */
     submitForm: function() {
     submitForm: function() {
       this.$refs["form"].validate(valid => {
       this.$refs["form"].validate(valid => {
@@ -667,4 +748,4 @@ export default {
     }
     }
   }
   }
 };
 };
-</script>
+</script>

+ 44 - 3
ruoyi-ui/src/views/videoAnalysis/index.vue

@@ -330,6 +330,10 @@ export default {
 			startTime: 0,
 			startTime: 0,
 			// 结束截取时间
 			// 结束截取时间
 			endTime: 0,
 			endTime: 0,
+      //暂存的时间
+      temporarily:0,
+      upDatatimer:null,
+      isAuto:false,
 			radios: {
 			radios: {
 				behavior: null,
 				behavior: null,
 				media: null,
 				media: null,
@@ -431,7 +435,17 @@ export default {
   mounted(){
   mounted(){
 	  let that=this;
 	  let that=this;
     document.getElementById("video").addEventListener('pause', function () { //暂停
     document.getElementById("video").addEventListener('pause', function () { //暂停
-      that.getEndTime()
+      console.log(that.isAuto,'<----that.isAuto');
+      if(that.upDatatimer){
+        clearInterval(that.upDatatimer)
+      }
+      if(!that.isAuto){
+        that.getEndTime()
+      }
+      that.isAuto=false;
+
+
+      // Number(this.currentRecord.startTime)
     });
     });
   },
   },
 	beforeMount() {
 	beforeMount() {
@@ -653,8 +667,10 @@ export default {
 				if (this.workForm.id != null) {
 				if (this.workForm.id != null) {
 					// 修改记录
 					// 修改记录
 					updateVideoRec(data).then(response => {
 					updateVideoRec(data).then(response => {
+					  console.log(response,'<------response');
 						this.$modal.msgSuccess('修改成功')
 						this.$modal.msgSuccess('修改成功')
-						this.startTime = this.endTime
+						this.startTime = Number(response.data.endTime);
+            this.$refs.video.currentTime= Number(response.data.endTime);
 						this.endTime = 0
 						this.endTime = 0
 						this.resetWorkForm()
 						this.resetWorkForm()
 					}).then(() => {
 					}).then(() => {
@@ -709,6 +725,7 @@ export default {
 			})
 			})
 		},
 		},
 		showHistory() {
 		showHistory() {
+      this.$refs.video && this.$refs.video.pause()
 			this.getHistoryList()
 			this.getHistoryList()
 			this.historyDialog = true
 			this.historyDialog = true
 		},
 		},
@@ -720,6 +737,16 @@ export default {
 				delVideoRec(id).then((res) => {
 				delVideoRec(id).then((res) => {
 					this.$modal.msgSuccess('删除成功')
 					this.$modal.msgSuccess('删除成功')
 					this.history.pop()
 					this.history.pop()
+          if(this.history.length !== 0){
+            this.$refs.video.currentTime = Number(this.history[this.history.length - 1].startTime);
+            this.startTime = Number(this.history[this.history.length - 1].endTime);
+            this.endTime = 0;
+          }
+          // this.$refs.video.currentTime = Number(this.currentRecord.startTime)
+          // item.startShowTime = this.formatTime(item.startTime)
+          // item.endShowTime = this.formatTime(item.endTime)
+          //this.startTime = Number(this.currentRecord.startTime)
+          // this.endTime = Number(this.currentRecord.endTime)
 				})
 				})
 			}
 			}
 		},
 		},
@@ -730,6 +757,20 @@ export default {
 				this.$refs.video.currentTime = Number(this.currentRecord.startTime)
 				this.$refs.video.currentTime = Number(this.currentRecord.startTime)
 				this.startTime = Number(this.currentRecord.startTime)
 				this.startTime = Number(this.currentRecord.startTime)
 				this.endTime = Number(this.currentRecord.endTime)
 				this.endTime = Number(this.currentRecord.endTime)
+        console.log(this.startTime,'<-----');
+				this.temporarily=this.startTime;
+				let that=this;
+				// console.log(Number(this.currentRecord.endTime)*1000,'精确到毫秒');
+       this.upDatatimer=setTimeout(()=>{
+         that.isAuto=true;
+         that.$refs.video && that.$refs.video.pause()
+         clearInterval(that.upDatatimer)
+
+         that.upDatatimer=null
+        },(Number(this.currentRecord.endTime)-Number(this.currentRecord.startTime))*1000);
+        // 6.287927
+        // temporarily
+        this.$refs.video &&this.$refs.video.play()
 				this.workForm = {
 				this.workForm = {
 					id: this.currentRecord.id,
 					id: this.currentRecord.id,
 					behavior: this.currentRecord.behavior,
 					behavior: this.currentRecord.behavior,
@@ -998,7 +1039,7 @@ export default {
 			return timeStr
 			return timeStr
 		},
 		},
      formatTime(time) {
      formatTime(time) {
-		  console.log(time,'<---------时间')
+		  // console.log(time,'<---------时间')
        let timeInMilliseconds=time*1000;
        let timeInMilliseconds=time*1000;
        // 将毫秒转换为分、秒和毫秒
        // 将毫秒转换为分、秒和毫秒
        var milliseconds = timeInMilliseconds % 1000;
        var milliseconds = timeInMilliseconds % 1000;