From 0c36b007983555fa24f63814768bec29568cb9e6 Mon Sep 17 00:00:00 2001
From: dshclm <3321914460@qq.com>
Date: Thu, 20 Jun 2024 09:07:41 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B6=89=E5=AF=86=E4=BA=BA?=
 =?UTF-8?q?=E5=91=98=E5=9F=B9=E8=AE=AD--=E6=B6=89=E5=AF=86=E4=BA=BA?=
 =?UTF-8?q?=E5=90=8D=E7=A7=B0=E9=80=89=E6=8B=A9=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../resources/templates/system/train/add.html | 64 +++++++++++++++----
 .../templates/system/train/detail.html        | 26 ++++++--
 .../templates/system/train/edit.html          | 26 ++++++--
 .../templates/system/train/examine.html       | 24 ++++++-
 .../templates/system/train/train.html         | 31 ++++++++-
 5 files changed, 145 insertions(+), 26 deletions(-)

diff --git a/ruoyi-admin/src/main/resources/templates/system/train/add.html b/ruoyi-admin/src/main/resources/templates/system/train/add.html
index 5b9cc68..6a180a8 100644
--- a/ruoyi-admin/src/main/resources/templates/system/train/add.html
+++ b/ruoyi-admin/src/main/resources/templates/system/train/add.html
@@ -38,9 +38,14 @@
             <div class="row">
                 <div class="col-sm-6">
                     <div class="form-group">
-                        <label class="col-sm-4 control-label is-required">人员名称:</label>
+                        <label class="col-sm-4 control-label is-required">涉密人员名称:</label>
                         <div class="col-sm-8">
-                            <input name="USERNAME"  required class="form-control" type="text">
+                            <select id="User" name="USERNAME" required class="form-control m-b">
+                                <option value="">---请选择---</option>
+                                <option v-for="option in userList" :value="option.userId" :key="option.userId">
+                                    {{ option.userName }}
+                                </option>
+                            </select>
                         </div>
                     </div>
                 </div>
@@ -48,7 +53,7 @@
                     <div class="form-group">
                         <label class="col-sm-4 control-label is-required ">单位名称:</label>
                         <div class="col-sm-8">
-                            <input name="deptName" required class="form-control" type="text">
+                            <input name="deptName" placeholder="请输入单位名称" required class="form-control m-b" type="text">
                         </div>
                     </div>
                 </div>
@@ -58,7 +63,7 @@
                     <div class="form-group">
                         <label class="col-sm-4 control-label is-required">部门:</label>
                         <div class="col-sm-8">
-                            <input name="PART" required class="form-control" type="text">
+                            <input name="PART" required placeholder="请输入部门" class="form-control" type="text">
                         </div>
                     </div>
                 </div>
@@ -89,9 +94,9 @@
                 </div>
                 <div class="col-sm-6">
                     <div class="form-group">
-                        <label class="col-sm-4 control-label">培训人员:</label>
+                        <label class="col-sm-4 control-label is-required">培训地点:</label>
                         <div class="col-sm-8">
-                            <input name="trainName" class="form-control" type="text">
+                            <textarea name="trainAddress" placeholder="请输入培训地点" required class="form-control"></textarea>
                         </div>
                     </div>
                 </div>
@@ -110,24 +115,45 @@
                     </div>
                 </div>
             </div>
+
             <div class="row">
-                <div class="col-sm-12">
+                <div class="col-sm-6">
                     <div class="form-group">
-                        <label class="col-sm-2 control-label is-required">培训地点:</label>
-                        <div class="col-sm-10">
-                            <textarea name="trainAddress"  required class="form-control"></textarea>
+                        <label class="col-sm-4 control-label">填报人:</label>
+                        <div class="col-sm-8">
+                            <input name="createStaffid" placeholder="请输入填报人" class="form-control" type="text" >
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <label class="col-sm-4 control-label">填报日期:</label>
+                        <div class="col-sm-8">
+                            <div class="input-group date">
+                                <input name="createDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <label class="col-sm-4 control-label">培训人员:</label>
+                        <div class="col-sm-8">
+                            <input name="trainName" placeholder="请输入培训人员" class="form-control" type="text">
                         </div>
                     </div>
                 </div>
             </div>
-
         </form>
     </div>
     <th:block th:include="include :: footer" />
     <th:block th:include="include :: datetimepicker-js" />
     <script th:inline="javascript">
         var prefix = ctx + "system/train"
-        $("#form-train-add").validate({
+            $("#form-train-add").validate({
             focusCleanup: true
         });
         var app = new Vue({
@@ -135,11 +161,13 @@
             data: {
                 CityList: [],
                 AreaList:[],
+                userList:[],
                 City:'',
                 Area:'',
                 params:{
                     parentId:'',
-                }
+                },
+                userPost:"system/user/list"
             },
             mounted(){
                 // 初始化地市列表
@@ -147,8 +175,18 @@
                 if (this.City){
                     this.getAreaList()
                 }
+                this.getUserList()
             },
             methods:{
+                getUserList(){
+                    $.ajax({
+                        url: ctx + this.userPost,
+                        type: 'POST',
+                        success:((res)=>{
+                            this.userList = res.rows
+                        }) ,
+                    });
+                },
                 getCityList(){
                     $.ajax({
                         url: ctx + "system/area/getSysAreaList",
diff --git a/ruoyi-admin/src/main/resources/templates/system/train/detail.html b/ruoyi-admin/src/main/resources/templates/system/train/detail.html
index 98d2de3..08b1535 100644
--- a/ruoyi-admin/src/main/resources/templates/system/train/detail.html
+++ b/ruoyi-admin/src/main/resources/templates/system/train/detail.html
@@ -41,9 +41,14 @@
         <div class="row">
             <div class="col-sm-6">
                 <div class="form-group">
-                    <label class="col-sm-4 control-label">人员名称:</label>
+                    <label class="col-sm-4 control-label">涉密人名称:</label>
                     <div class="col-sm-8">
-                        <input name="USERNAME" disabled th:field="*{USERNAME}" class="form-control" type="text">
+                        <select id="User" name="USERNAME" disabled required v-model="userName" class="form-control m-b">
+                            <option value="">---请选择---</option>
+                            <option v-for="option in userList" :value="option.userId" :key="option.userId">
+                                {{ option.userName }}
+                            </option>
+                        </select>
                     </div>
                 </div>
             </div>
@@ -51,7 +56,7 @@
                 <div class="form-group">
                     <label class="col-sm-4 control-label">单位名称:</label>
                     <div class="col-sm-8">
-                        <input name="deptName" disabled th:field="*{deptName}" class="form-control" type="text">
+                        <input name="deptName" disabled th:field="*{deptName}" class="form-control m-b" type="text">
                     </div>
                 </div>
             </div>
@@ -160,9 +165,12 @@
             AreaList:[],
             City:[[${tdTrain.AREAID}]],
             Area:[[${tdTrain.FRAMEWORK}]],
+            userName:[[${tdTrain.USERNAME}]],
+            userList:[],
             params:{
                 parentId:'',
-            }
+            },
+            userPost:"system/user/list"
         },
         mounted(){
             // 初始化地市列表
@@ -170,8 +178,18 @@
             if (this.City){
                 this.getAreaList()
             }
+            this.getUserList()
         },
         methods:{
+            getUserList(){
+                $.ajax({
+                    url: ctx + this.userPost,
+                    type: 'POST',
+                    success:((res)=>{
+                        this.userList = res.rows
+                    }) ,
+                });
+            },
             getCityList(){
                 $.ajax({
                     url: ctx + "system/area/getSysAreaList",
diff --git a/ruoyi-admin/src/main/resources/templates/system/train/edit.html b/ruoyi-admin/src/main/resources/templates/system/train/edit.html
index b5bb080..7dd0d0f 100644
--- a/ruoyi-admin/src/main/resources/templates/system/train/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/system/train/edit.html
@@ -39,9 +39,14 @@
             <div class="row">
                 <div class="col-sm-6">
                     <div class="form-group">
-                        <label class="col-sm-4 control-label is-required">人员名称:</label>
+                        <label class="col-sm-4 control-label is-required">涉密人名称:</label>
                         <div class="col-sm-8">
-                            <input name="USERNAME" required th:field="*{USERNAME}" class="form-control" type="text">
+                            <select id="User" name="USERNAME" required v-model="userName" class="form-control m-b">
+                                <option value="">---请选择---</option>
+                                <option v-for="option in userList" :value="option.userId" :key="option.userId">
+                                    {{ option.userName }}
+                                </option>
+                            </select>
                         </div>
                     </div>
                 </div>
@@ -49,7 +54,7 @@
                     <div class="form-group">
                         <label class="col-sm-4 control-label is-required">单位名称:</label>
                         <div class="col-sm-8">
-                            <input name="deptName" required th:field="*{deptName}" class="form-control" type="text">
+                            <input name="deptName" required th:field="*{deptName}" class="form-control m-b" type="text">
                         </div>
                     </div>
                 </div>
@@ -132,9 +137,12 @@
                 AreaList:[],
                 City:[[${tdTrain.AREAID}]],
                 Area:[[${tdTrain.FRAMEWORK}]],
+                userName:[[${tdTrain.USERNAME}]],
+                userList:[],
                 params:{
                     parentId:'',
-                }
+                },
+                userPost:"system/user/list"
             },
             mounted(){
                 // 初始化地市列表
@@ -142,8 +150,18 @@
                 if (this.City){
                     this.getAreaList()
                 }
+                this.getUserList()
             },
             methods:{
+                getUserList(){
+                    $.ajax({
+                        url: ctx + this.userPost,
+                        type: 'POST',
+                        success:((res)=>{
+                            this.userList = res.rows
+                        }) ,
+                    });
+                },
                 getCityList(){
                     $.ajax({
                         url: ctx + "system/area/getSysAreaList",
diff --git a/ruoyi-admin/src/main/resources/templates/system/train/examine.html b/ruoyi-admin/src/main/resources/templates/system/train/examine.html
index 248afc8..fb72f01 100644
--- a/ruoyi-admin/src/main/resources/templates/system/train/examine.html
+++ b/ruoyi-admin/src/main/resources/templates/system/train/examine.html
@@ -42,7 +42,12 @@
                 <div class="form-group">
                     <label class="col-sm-4 control-label">人员名称:</label>
                     <div class="col-sm-8">
-                        <input name="USERNAME" disabled th:field="*{USERNAME}" class="form-control" type="text">
+                        <select id="User" name="USERNAME" disabled required v-model="userName" class="form-control m-b">
+                            <option value="">---请选择---</option>
+                            <option v-for="option in userList" :value="option.userId" :key="option.userId">
+                                {{ option.userName }}
+                            </option>
+                        </select>
                     </div>
                 </div>
             </div>
@@ -50,7 +55,7 @@
                 <div class="form-group">
                     <label class="col-sm-4 control-label">单位名称:</label>
                     <div class="col-sm-8">
-                        <input name="deptName" disabled th:field="*{deptName}" class="form-control" type="text">
+                        <input name="deptName" disabled th:field="*{deptName}" class="form-control m-b" type="text">
                     </div>
                 </div>
             </div>
@@ -161,9 +166,12 @@
             AreaList:[],
             City:[[${tdTrain.AREAID}]],
             Area:[[${tdTrain.FRAMEWORK}]],
+            userName:[[${tdTrain.USERNAME}]],
+            userList:[],
             params:{
                 parentId:'',
-            }
+            },
+            userPost:"system/user/list"
         },
         mounted(){
             // 初始化地市列表
@@ -171,8 +179,18 @@
             if (this.City){
                 this.getAreaList()
             }
+            this.getUserList()
         },
         methods:{
+            getUserList(){
+                $.ajax({
+                    url: ctx + this.userPost,
+                    type: 'POST',
+                    success:((res)=>{
+                        this.userList = res.rows
+                    }) ,
+                });
+            },
             getCityList(){
                 $.ajax({
                     url: ctx + "system/area/getSysAreaList",
diff --git a/ruoyi-admin/src/main/resources/templates/system/train/train.html b/ruoyi-admin/src/main/resources/templates/system/train/train.html
index 4bb2ce0..f678c64 100644
--- a/ruoyi-admin/src/main/resources/templates/system/train/train.html
+++ b/ruoyi-admin/src/main/resources/templates/system/train/train.html
@@ -82,6 +82,14 @@
                 datas = res.data
             }) ,
         });
+        let userList = []
+        $.ajax({
+            url: ctx + "system/user/list",
+            type: 'POST',
+            success:((res)=>{
+                userList = res.rows
+            }) ,
+        });
         $(function() {
             var options = {
                 url: prefix + "/list",
@@ -122,8 +130,10 @@
                 },
                 {
                     field: 'username',
-                    title: '人员名称',
-                    visible: false
+                    title: '涉密人名称',
+                    formatter:function (value, row, index) {
+                        return getUser(userList,value)
+                    }
                 },
                 {
                     field: 'deptName',
@@ -228,6 +238,23 @@
             var url = prefix + '/examine/' + id;
             $.modal.open("涉密人员培训审核", url);
         }
+        function getUser(datas,value){
+            if ($.common.isEmpty(datas) || $.common.isEmpty(value)) {
+                return '';
+            }
+            var actions = []
+            $.each(datas, function(index, user) {
+                if (user.userId ==  value) {
+                    actions.push($.common.sprintf("<span>%s</span>", user.userName));
+                    return false;
+                }
+            });
+            if (actions.length === 0) {
+                actions.push($.common.sprintf("<span>%s</span>", value))
+            }
+            return actions.join('');
+        }
+
         var app = new Vue({
             el: '#app',
             data: {