epans 11 mesi fa
parent
commit
59aa5214f5

+ 5 - 2
src/router/index.js

@@ -45,12 +45,14 @@ import FeedCostSet from '@/views/basicSettings/FeedCostSet.vue'
 
 import User from '@/views/systemManagement/User.vue'
 import Role from '@/views/systemManagement/Role.vue'
+import MenuManagement from '@/views/systemManagement/MenuManagement.vue'
 
 import messageTemplete from '@/views/messageCenter/messageTemplete.vue'
 import MessagesReceive from '@/views/messageCenter/MessagesReceive.vue'
 import MessageSend from '@/views/messageCenter/MessageSend.vue'
  
 
+
 Vue.use(Router)
 
 const router =  new Router({
@@ -108,10 +110,11 @@ const router =  new Router({
   
         { path: '/User', component: User },
         { path: '/Role', component: Role },
-
+        { path: '/MenuManagement',  name: 'MenuManagement', component: MenuManagement },
+        
         { path: '/messageTemplete', component: messageTemplete },
         { path: '/MessagesReceive', component: MessagesReceive },
-        { path: '/MessageSend', component: MessageSend },
+        { path: '/MessageSend',component: MessageSend },
         
 
  

+ 41 - 0
src/views/messageCenter/MessageSend100.vue

@@ -0,0 +1,41 @@
+<template>
+ 
+  <div>
+        1.0.2版本页面,待开发
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+  
+       
+    }
+  },
+  created(){
+    
+    
+  },
+  methods:{
+
+    
+     
+
+  }
+}
+</script>
+ 
+<style scoped>
+
+</style>

+ 498 - 0
src/views/messageCenter/MessageSend102.vue

@@ -0,0 +1,498 @@
+<template>
+ 
+  <div>
+<!-- 102 -->
+
+    <el-card class="box-card">
+      <!-- 搜索区域 -->
+      <div class="search-bx1">
+          <el-input v-model="searchData.name" placeholder="消息名称"  style="width: 220px;" class="g-mr20" clearable />
+          <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 250px;" />
+          <el-button type="primary" class ="btn-search"  @click="form_search">搜索</el-button>
+          <el-button type="primary" class ="btn-clear"  @click="form_clear">重置</el-button>
+          <!-- <el-button type="primary"  class ="btn-add"  v-if="isButtonEdit" @click="form_add">添加</el-button> -->
+           <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
+      </div>
+
+ 
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="序号"  width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.id }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息名称" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息内容" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+         
+        <el-table-column label="发送时间" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="接收用户" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+  
+
+        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_see(scope.row)">查看</el-button>
+             <!-- 修改按钮 -->
+            
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- 分页区域 -->
+      <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
+    </el-card>
+
+
+    <!-- 弹窗 新增or修改 -->
+    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
+      <div class="">
+        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
+    
+            <el-form-item label="类型名称:" prop="name">
+                <el-input   v-model="addForm.name"  :disabled="addFormStatus=='see'"   ></el-input>  
+            </el-form-item>
+          
+
+       
+            <el-form-item label="消息内容:" prop="content">
+              <el-input ref="content" v-model="addForm.content" type="textarea" maxlength="200"  style="width: 100%;" :rows="3"  :disabled="addFormStatus=='see'"/>
+            </el-form-item>
+
+         
+            
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+       
+          <el-button @click="addFormShow = false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+ 
+    
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+ 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/message_template/list',
+      //接口 - 新增 - 表格
+      url_add_table:'/api/v1/ops/message_template/add',  
+      //接口 - 修改 - 表格
+      url_edit_table:'/api/v1/ops/message_template/update', 
+      //接口 - 删除 - 表格
+      url_delete_table:'/api/v1/ops/message_template/is_show', 
+      
+      //接口 - 下拉框 列表 
+      url_get_select1:'/role/getAll',
+
+      //按钮权限
+      isButtonEdit:false,
+
+      //获取 - 表格数据 - 参数
+      searchData:{
+        name: "",
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+ 
+      
+      pastureList:[
+    
+      ],
+
+    
+
+ 
+
+
+      addFormShow:false,
+      addFormStatus: '',
+      addFormTxt: {  edit: '修改',  create: '新增' },
+      addForm:{
+        name:'',id:'' ,content:'' ,is_show: 1
+      },
+
+      addFormRules:{
+        name: [ { required: true, message: '名称必填', trigger: 'blur' },  ],
+        content: [ { required: true, message: '内容必填', trigger: 'blur' },  ],
+
+      },
+
+     
+       
+    }
+  },
+  created(){
+      //获取按钮权限
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
+     //获取下拉框
+     // this.get_select_list1()
+
+      //表格 - 初始化 
+      //this.get_table_data()
+
+     
+
+    
+  },
+  methods:{
+
+    get_auto_buttons() {
+      // 编辑
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+    },
+    
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataGet(me.url_get_select1, {"roleName": "",  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.roleList = []
+          } else {
+            me.roleList = e.data
+          }
+
+         
+  
+        })
+
+
+        ajaxDataGet('/authdata/pasture', {  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("牧场下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.pastureList = []
+          } else {
+            me.pastureList = e.data
+          }
+  
+        })
+
+    
+    },
+
+    
+    //获取 表格
+    get_table_data() {
+ 
+     var me = this
+
+     me.tableLoading = true
+     console.log("searchData======>", me.searchData)
+
+      var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.tableList = e.data.list
+            me.searchData.total = e.data.total;	// 总数
+            me.searchData.page = e.data.page;	//页码
+            me.searchData.page_size = e.data.page_size;	//每页数量
+           
+          } else {
+            me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          }
+
+          setTimeout(() => {
+            me.tableLoading = false
+          }, 100)
+  
+        })
+
+       
+    },
+    //搜索 查询表格
+    form_search(){
+      var me = this
+      console.log('请求表格列表searchData',me.searchData)
+      me.get_table_data()
+
+    },
+
+    //重置 表格
+    form_clear(){
+      var me = this
+      me.searchData.name = ""
+      me.get_table_data()
+    },
+
+    //监听 page_size 改变的事件
+    change_size_page(item){
+      console.log(item)
+     // this.searchData.page_size = item
+      //  this.getUserList()
+    },
+
+    //监听 page 改变的事件
+    change_current_page(item){
+      console.log(item)
+       this.searchData.page = item
+       this.get_table_data()
+    },
+
+    //清空弹窗表单信息
+    reset_form(){
+      this.addForm.name = ''
+    },
+
+    //新增
+    form_add() {
+      this.reset_form()
+      this.addFormStatus = 'create'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_edit(row) {
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'edit'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_see(row) {
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'see'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+
+    //新增关闭
+    add_dialog_close(){
+       //内容重置
+       this.$refs['addFormRef'].resetFields()
+    },
+
+    //新增 保存
+    add_dialog_save() {
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+           ajaxDataPost(me.url_add_table, send_data).then(e => {
+                console.log("新增结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '新增成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+    //编辑 保存
+    edit_dialog_save(){
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "id": me.addForm.id,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+         ajaxDataPut(me.url_edit_table, send_data).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+
+
+    
+    
+
+
+
+    form_delete(row) {
+      var me = this
+
+       me.$confirm('是否删除此条内容?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+            console.log("删除的ID参数:", row.id)
+            //加载 - 发送新增保存
+            ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success',  message: '删除成功!'  });
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '删除失败!' + e.msg, duration: 2000 })
+                }
+            })
+
+        
+ 
+          
+        }).catch(() => {
+          me.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+
+
+       
+    },
+
+ 
+    form_export() {
+        //获取请求表格数据的参数
+        //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+        //请求表格
+        // GetDataByName(this.download.getdataListParm).then(response => {
+        //     if (response.data.list !== null) {
+        //       this.download.list = response.data.list
+        //     } else {
+        //       this.download.list = []
+        //     }
+        //     var excelDatas = [
+        //       {
+        //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+        //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+        //         tableDatas: this.download.list,
+        //         sheetName: 'Sheet1'
+        //       }
+        //     ]
+        //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+        // })
+
+        var excelDatas = [
+            {
+                tHeader: ['表头1', '表头2', '表头3', '表头4',],
+                filterVal: ['title1', 'title2', 'title3', 'title4'],
+                tableDatas: [ 
+                    {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                    {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                    {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+                ],
+                sheetName: 'Sheet1'
+            }
+        ]
+        json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    }
+
+     
+
+  }
+}
+</script>
+<!-- 加了scoped,则是仅在此组件里生效 -->
+<style scoped>
+
+</style>

+ 41 - 0
src/views/messageCenter/MessagesReceive100.vue

@@ -0,0 +1,41 @@
+<template>
+ 
+  <div>
+        1.0.2版本页面,待开发
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+  
+       
+    }
+  },
+  created(){
+    
+    
+  },
+  methods:{
+
+    
+     
+
+  }
+}
+</script>
+ 
+<style scoped>
+
+</style>

+ 505 - 0
src/views/messageCenter/MessagesReceive102.vue

@@ -0,0 +1,505 @@
+<template>
+ 
+  <div>
+<!-- 102 -->
+
+    <el-card class="box-card">
+      <!-- 搜索区域 -->
+      <div class="search-bx1">
+          <el-input v-model="searchData.name" placeholder="消息名称"  style="width: 220px;" class="g-mr20" clearable />
+          <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 250px;" />
+          <el-button type="primary" class ="btn-search"  @click="form_search">搜索</el-button>
+          <el-button type="primary" class ="btn-clear"  @click="form_clear">重置</el-button>
+          <!-- <el-button type="primary"  class ="btn-add"  v-if="isButtonEdit" @click="form_add">添加</el-button> -->
+           <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
+      </div>
+
+ 
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="序号"  width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.id }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息名称" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息内容" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+         
+        <el-table-column label="接收时间" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="消息状态" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+  
+
+        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_see(scope.row)">查看</el-button>
+             <!-- 修改按钮 -->
+            
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- 分页区域 -->
+      <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
+    </el-card>
+
+
+    <!-- 弹窗 新增or修改 -->
+    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
+      <div class="">
+        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
+    
+            <el-form-item label="类型名称:" prop="name">
+                <el-input   v-model="addForm.name"  :disabled="addFormStatus=='see'"   ></el-input>  
+            </el-form-item>
+          
+
+       
+            <el-form-item label="消息内容:" prop="content">
+              <el-input ref="content" v-model="addForm.content" type="textarea" maxlength="200"  style="width: 100%;" :rows="3"  :disabled="addFormStatus=='see'"/>
+            </el-form-item>
+
+         
+            
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+       
+          <el-button @click="addFormShow = false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+ 
+    
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+ 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/message_template/list',
+      //接口 - 新增 - 表格
+      url_add_table:'/api/v1/ops/message_template/add',  
+      //接口 - 修改 - 表格
+      url_edit_table:'/api/v1/ops/message_template/update', 
+      //接口 - 删除 - 表格
+      url_delete_table:'/api/v1/ops/message_template/is_show', 
+      
+      //接口 - 下拉框 列表 
+      url_get_select1:'/role/getAll',
+
+      //按钮权限
+      isButtonEdit:false,
+
+      //获取 - 表格数据 - 参数
+      searchData:{
+        name: "",
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+ 
+      
+      pastureList:[
+    
+      ],
+
+    
+
+ 
+
+
+      addFormShow:false,
+      addFormStatus: '',
+      addFormTxt: {  edit: '修改',  create: '新增' },
+      addForm:{
+        name:'',id:'' ,content:'' ,is_show: 1
+      },
+
+      addFormRules:{
+        name: [ { required: true, message: '名称必填', trigger: 'blur' },  ],
+        content: [ { required: true, message: '内容必填', trigger: 'blur' },  ],
+
+      },
+
+     
+       
+    }
+  },
+  created(){
+      //获取按钮权限
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
+     //获取下拉框
+     // this.get_select_list1()
+
+      //表格 - 初始化 
+      //this.get_table_data()
+
+     
+
+    
+  },
+  methods:{
+
+    get_auto_buttons() {
+      // 编辑
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+    },
+    
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataGet(me.url_get_select1, {"roleName": "",  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.roleList = []
+          } else {
+            me.roleList = e.data
+          }
+
+         
+  
+        })
+
+
+        ajaxDataGet('/authdata/pasture', {  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("牧场下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.pastureList = []
+          } else {
+            me.pastureList = e.data
+          }
+  
+        })
+
+    
+    },
+
+    
+    //获取 表格
+    get_table_data() {
+ 
+     var me = this
+
+     me.tableLoading = true
+     console.log("searchData======>", me.searchData)
+
+      var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.tableList = e.data.list
+            me.searchData.total = e.data.total;	// 总数
+            me.searchData.page = e.data.page;	//页码
+            me.searchData.page_size = e.data.page_size;	//每页数量
+           
+          } else {
+            me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          }
+
+          setTimeout(() => {
+            me.tableLoading = false
+          }, 100)
+  
+        })
+
+       
+    },
+    //搜索 查询表格
+    form_search(){
+      var me = this
+         this.$router.push({name: 'MenuManagement' , query: { id: 'create', isEdit: 'edit' }})
+      // console.log('请求表格列表searchData',me.searchData)
+      // me.get_table_data()
+
+    },
+
+    //重置 表格
+    form_clear(){
+      var me = this
+      me.searchData.name = ""
+      me.get_table_data()
+    },
+
+    //监听 page_size 改变的事件
+    change_size_page(item){
+      console.log(item)
+     // this.searchData.page_size = item
+      //  this.getUserList()
+    },
+
+    //监听 page 改变的事件
+    change_current_page(item){
+      console.log(item)
+       this.searchData.page = item
+       this.get_table_data()
+    },
+
+    //清空弹窗表单信息
+    reset_form(){
+      this.addForm.name = ''
+      this.addForm.id = undefined
+      this.addForm.content = ''
+      this.addForm.is_show = 1
+
+ 
+    },
+
+    //新增
+    form_add() {
+      this.reset_form()
+      this.addFormStatus = 'create'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_edit(row) {
+      this.reset_form()
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'edit'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_see(row) {
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'see'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+
+    //新增关闭
+    add_dialog_close(){
+       //内容重置
+       this.$refs['addFormRef'].resetFields()
+    },
+
+    //新增 保存
+    add_dialog_save() {
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+           ajaxDataPost(me.url_add_table, send_data).then(e => {
+                console.log("新增结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '新增成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+    //编辑 保存
+    edit_dialog_save(){
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "id": me.addForm.id,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+         ajaxDataPut(me.url_edit_table, send_data).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+
+
+    
+    
+
+
+
+    form_delete(row) {
+      var me = this
+
+       me.$confirm('是否删除此条内容?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+            console.log("删除的ID参数:", row.id)
+            //加载 - 发送新增保存
+            ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success',  message: '删除成功!'  });
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '删除失败!' + e.msg, duration: 2000 })
+                }
+            })
+
+        
+ 
+          
+        }).catch(() => {
+          me.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+
+
+       
+    },
+
+ 
+    form_export() {
+        //获取请求表格数据的参数
+        //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+        //请求表格
+        // GetDataByName(this.download.getdataListParm).then(response => {
+        //     if (response.data.list !== null) {
+        //       this.download.list = response.data.list
+        //     } else {
+        //       this.download.list = []
+        //     }
+        //     var excelDatas = [
+        //       {
+        //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+        //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+        //         tableDatas: this.download.list,
+        //         sheetName: 'Sheet1'
+        //       }
+        //     ]
+        //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+        // })
+
+        var excelDatas = [
+            {
+                tHeader: ['表头1', '表头2', '表头3', '表头4',],
+                filterVal: ['title1', 'title2', 'title3', 'title4'],
+                tableDatas: [ 
+                    {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                    {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                    {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+                ],
+                sheetName: 'Sheet1'
+            }
+        ]
+        json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    }
+
+     
+
+  }
+}
+</script>
+<!-- 加了scoped,则是仅在此组件里生效 -->
+<style scoped>
+
+</style>

+ 54 - 21
src/views/messageCenter/messageTemplete102.vue

@@ -1,7 +1,7 @@
 <template>
  
   <div>
-
+<!-- 102 -->
 
     <el-card class="box-card">
       <!-- 搜索区域 -->
@@ -28,20 +28,20 @@
         </el-table-column>
         <el-table-column label="消息内容" min-width="150px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.number }}</span>
+            <span>{{ scope.row.content }}</span>
           </template>
         </el-table-column>
          
  
         <el-table-column  label="状态"  min-width="100px" align="center">
           <template slot-scope="scope">
-            <el-switch v-model="scope.row.mg_state" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"   />
+            <el-switch v-model="scope.row.is_show" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"  @change="change_enable(scope.row)" />
           </template>
         </el-table-column>
 
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
-
+            <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_see(scope.row)">查看</el-button>
              <!-- 修改按钮 -->
              <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
@@ -59,19 +59,19 @@
     <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
       <div class="">
         <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
+    
             <el-form-item label="类型名称:" prop="name">
                 <el-input   v-model="addForm.name"  :disabled="addFormStatus=='see'"   ></el-input>  
             </el-form-item>
+          
 
-      
-            
-            <el-form-item label="状态:" prop="is_default" style="text-align:left">
-                <el-switch v-model="addForm.is_default" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="2" :disabled="addFormStatus=='see'"  />
+       
+            <el-form-item label="消息内容:" prop="content">
+              <el-input ref="content" v-model="addForm.content" type="textarea" maxlength="200"  style="width: 100%;" :rows="3"  :disabled="addFormStatus=='see'"/>
             </el-form-item>
 
-
-            <el-form-item label="消息内容:" prop="remark">
-              <el-input ref="remark" v-model="addForm.remark" type="textarea" maxlength="200"  style="width: 100%;" :rows="3"  :disabled="addFormStatus=='see'"/>
+            <el-form-item label="状态:" prop="is_show" style="text-align:left">
+                <el-switch v-model="addForm.is_show" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="2" :disabled="addFormStatus=='see'"  />
             </el-form-item>
 
  
@@ -79,7 +79,7 @@
             
         </el-form>
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
+          <el-button type="primary"  v-if="addFormStatus==='create' || addFormStatus==='edit'"  @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
           <el-button @click="addFormShow = false">关闭</el-button>
         </div>
       </div>
@@ -107,13 +107,13 @@ export default {
  
 
       //接口 - 获取 - 表格
-      url_get_table:'/api/v1/ops/base_setting/calf_type/list',
+      url_get_table:'/api/v1/ops/message_template/list',
       //接口 - 新增 - 表格
-      url_add_table:'/api/v1/ops/base_setting/calf_type/add',  
+      url_add_table:'/api/v1/ops/message_template/add',  
       //接口 - 修改 - 表格
-      url_edit_table:'/api/v1/ops/base_setting/calf_type/update', 
+      url_edit_table:'/api/v1/ops/message_template/update', 
       //接口 - 删除 - 表格
-      url_delete_table:'/api/v1/ops/base_setting/calf_type/is_show', 
+      url_delete_table:'/api/v1/ops/message_template/is_show', 
       
       //接口 - 下拉框 列表 
       url_get_select1:'/role/getAll',
@@ -132,7 +132,7 @@ export default {
       tableLoading: false,
       //表格内容
       tableList:[
-        //  { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
         // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
         // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
         // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
@@ -161,12 +161,12 @@ export default {
       addFormStatus: '',
       addFormTxt: {  edit: '修改',  create: '新增' },
       addForm:{
-        name:'',id:'' 
+        name:'',id:'' ,content:'' ,is_show: 1
       },
 
       addFormRules:{
-        name: [ { required: true, message: '类型名称必填', trigger: 'blur' },  ],
-   
+        name: [ { required: true, message: '名称必填', trigger: 'blur' },  ],
+        content: [ { required: true, message: '内容必填', trigger: 'blur' },  ],
 
       },
 
@@ -309,6 +309,23 @@ export default {
       })
     },
 
+    //设置 默认
+    change_enable(row){
+      var me = this
+      console.log(row)
+      //加载 - 保存
+      ajaxDataPut('/api/v1/ops/message_template/is_show/' +row.id, {}).then(e => {
+                console.log("更改结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success',  message: '设置成功!'  });
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '设置失败!' + e.msg, duration: 2000 })
+                }
+      })
+    },
+
     //编辑
     form_edit(row) {
       console.log('行内容row=========', row)
@@ -321,6 +338,18 @@ export default {
       })
     },
 
+    //编辑
+    form_see(row) {
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'see'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
 
     //新增关闭
     add_dialog_close(){
@@ -337,6 +366,8 @@ export default {
           //发起请求
           var send_data = {
               "name": me.addForm.name,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
           }
           console.log("弹窗参数:", send_data)
 
@@ -369,13 +400,15 @@ export default {
           var send_data = {
               "name": me.addForm.name,
               "id": me.addForm.id,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
           }
           console.log("弹窗参数:", send_data)
 
           //关闭弹窗
           // me.addFormShow = false
          //加载 - 发送新增保存
-         ajaxDataPut(me.url_edit_table, send_data).then(e => {
+         ajaxDataPost(me.url_edit_table, send_data).then(e => {
                 console.log("编辑结果:",e)
                 //打印请求成功结果
                 if(e.code == 200  ){

+ 41 - 0
src/views/systemManagement/MenuManagement.vue

@@ -0,0 +1,41 @@
+<template>
+ 
+  <div>
+        1.0.2版本页面,待开发
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+  
+       
+    }
+  },
+  created(){
+    
+    
+  },
+  methods:{
+
+    
+     
+
+  }
+}
+</script>
+ 
+<style scoped>
+
+</style>

+ 529 - 0
src/views/systemManagement/MenuManagement102.vue

@@ -0,0 +1,529 @@
+<template>
+ 
+  <div>
+
+
+    <el-card class="box-card">
+      <!-- 搜索区域 -->
+      <div class="search-bx1">
+          <el-input v-model="searchData.name" placeholder="用户名称"  style="width: 220px;" class="g-mr20" clearable />
+          <el-input v-model="searchData.name" placeholder="员工姓名"  style="width: 220px;" class="g-mr20" clearable />
+          <el-input v-model="searchData.name" placeholder="手机号"  style="width: 220px;" class="g-mr20" clearable />
+          <el-button type="primary"   @click="form_search">搜索</el-button>
+          <el-button type="primary"   @click="form_clear">重置</el-button>
+          <el-button type="primary"   v-if="isButtonEdit"  @click="form_add">添加</el-button>
+           <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
+      </div>
+
+ 
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="序号"  width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.id }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="用户名称" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="员工姓名" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.employee_name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="手机号" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.phone }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="更新时间" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.created_at_format }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="更新用户" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.create_user }}</span>
+          </template>
+        </el-table-column>
+         
+ 
+        <!-- <el-table-column  label="状态"  min-width="100px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.mg_state" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"   />
+          </template>
+        </el-table-column> -->
+
+        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="scope">
+             <!-- 修改按钮 -->
+             <el-button  v-if="isButtonEdit"  type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <!-- 删除按钮 -->
+             <el-button  v-if="isButtonEdit"  type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- 分页区域 -->
+      <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
+    </el-card>
+
+
+    <!-- 弹窗 新增or修改 -->
+    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
+      <div class="">
+        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
+            <el-form-item label="用户名称:" prop="name">
+                <el-input   v-model="addForm.name"  ></el-input>  
+            </el-form-item>
+            <el-form-item label="员工姓名:" prop="employee_name">
+                <el-input   v-model="addForm.employee_name"  ></el-input>  
+            </el-form-item>
+            <el-form-item label="手机号:" prop="phone">
+                <el-input   v-model="addForm.phone"  ></el-input>  
+            </el-form-item>
+             
+            <el-form-item label="角色名称:" prop="rolesId">
+                <el-select ref="rolesId" v-model="addForm.rolesId" filterable placeholder="请选择" class="filter-item" style="width: 100%;" @change="change_rolesId">
+                  <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+           
+            
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
+          <el-button @click="addFormShow = false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+ 
+    
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+ 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/system/user/list',
+      //接口 - 新增 - 表格
+      url_add_table:'/api/v1/system/user/add',  
+      //接口 - 修改 - 表格
+      url_edit_table:'/api/v1/system/user/edit', 
+      //接口 - 删除 - 表格
+      url_delete_table:'/api/v1/system/user', 
+      
+      //接口 - 下拉框 列表 
+      url_get_select1:'/role/getAll',
+
+      //按钮权限
+      isButtonEdit:false,
+
+      //获取 - 表格数据 - 参数
+      searchData:{
+        name: "",
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        //  { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+
+      
+      roleList:[
+    
+      ],
+
+    
+
+ 
+
+
+      addFormShow:false,
+      addFormStatus: '',
+      addFormTxt: {  edit: '修改',  create: '新增' },
+      addForm:{
+        name:'',id:'' ,employee_name:'', phone:'',rolesId:undefined,
+      },
+
+ 
+
+      addFormRules:{
+        name: [
+          { required: true, message: '类型必填', trigger: 'blur' },
+        ],
+   
+
+      },
+
+     
+       
+    }
+  },
+  created(){
+      //获取按钮权限
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
+     //获取下拉框
+       this.get_select_list1()
+
+      //表格 - 初始化 
+      this.get_table_data()
+
+     
+
+    
+  },
+  methods:{
+
+    
+    
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataPost('/api/v1/system/role/list?page=1&page_size=1000', { }).then(e => {
+          console.log("下拉框1:",e)
+
+        
+
+          if(e.code == 200 ){
+              me.roleList = e.data.list
+             
+            
+            } else {
+              me.roleList = []
+            }
+
+         
+  
+        })
+
+
+        
+
+    
+    },
+
+    
+    //获取 表格
+    get_table_data() {
+ 
+     var me = this
+
+     me.tableLoading = true
+     console.log("searchData======>", me.searchData)
+
+      var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.tableList = e.data.list
+            me.searchData.total = e.data.total;	// 总数
+            me.searchData.page = e.data.page;	//页码
+            me.searchData.page_size = e.data.page_size;	//每页数量
+           
+          } else {
+            me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          }
+
+          setTimeout(() => {
+            me.tableLoading = false
+          }, 100)
+  
+        })
+
+       
+    },
+    //搜索 查询表格
+    form_search(){
+      var me = this
+      console.log('请求表格列表searchData',me.searchData)
+      me.get_table_data()
+
+    },
+
+    change_rolesId(item){
+      this.$set(this.addForm, 'rolesId', item)
+      
+      this.$forceUpdate()
+  },
+
+    //重置 表格
+    form_clear(){
+      var me = this
+      me.searchData.name = ""
+      me.get_table_data()
+    },
+
+    //监听 page_size 改变的事件
+    change_size_page(item){
+      console.log(item)
+     // this.searchData.page_size = item
+      //  this.getUserList()
+    },
+
+    //监听 page 改变的事件
+    change_current_page(item){
+      console.log(item)
+       this.searchData.page = item
+       this.get_table_data()
+    },
+
+    //清空弹窗表单信息
+    reset_form(){
+      this.addForm.name = ''
+   
+      this.addForm.employee_name = ''
+      this.addForm.phone = ''
+      this.addForm.rolesId = undefined
+
+ 
+    },
+
+    //新增
+    form_add() {
+      this.reset_form()
+      this.addFormStatus = 'create'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_edit(row) {
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+
+
+ 
+        if(row.role_ids.length !== 0){
+          this.addForm.rolesId = row.role_ids[0]
+        } else {
+          this.addForm.rolesId = ""
+        }
+ 
+
+
+      this.addFormStatus = 'edit'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+
+    //新增关闭
+    add_dialog_close(){
+       //内容重置
+       this.$refs['addFormRef'].resetFields()
+    },
+
+    //新增 保存
+    add_dialog_save() {
+      var me = this
+      console.log(me.addForm.rolesId)
+      this.$refs['addFormRef'].validate(valid => {
+
+        var roleArr = [{id:"",name:""}]
+        if(me.addForm.rolesId){
+          roleArr[0].id = me.addForm.rolesId
+        } 
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "phone": me.addForm.phone,
+              "employee_name": me.addForm.employee_name,
+              "roles": roleArr,
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+           ajaxDataPost(me.url_add_table, send_data).then(e => {
+                console.log("新增结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '新增成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+    //编辑 保存
+    edit_dialog_save(){
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+
+          var roleArr = [{id:"",name:""}]
+          if(me.addForm.rolesId){
+            roleArr[0].id = me.addForm.rolesId
+          } 
+          var send_data = {
+           
+              "id": me.addForm.id,
+              "name": me.addForm.name,
+              "phone": me.addForm.phone,
+              "employee_name": me.addForm.employee_name,
+              "roles":roleArr
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+         ajaxDataPost(me.url_edit_table, send_data).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+
+
+    
+    
+
+
+
+    form_delete(row) {
+      var me = this
+
+       me.$confirm('是否删除此条内容?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+            console.log("删除的ID参数:", row.id)
+            //加载 - 发送新增保存
+            ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success',  message: '删除成功!'  });
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '删除失败!' + e.msg, duration: 2000 })
+                }
+            })
+
+        
+ 
+          
+        }).catch(() => {
+          me.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+
+
+       
+    },
+
+ 
+    form_export() {
+    //获取请求表格数据的参数
+    //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+    //请求表格
+    // GetDataByName(this.download.getdataListParm).then(response => {
+    //     if (response.data.list !== null) {
+    //       this.download.list = response.data.list
+    //     } else {
+    //       this.download.list = []
+    //     }
+    //     var excelDatas = [
+    //       {
+    //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+    //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+    //         tableDatas: this.download.list,
+    //         sheetName: 'Sheet1'
+    //       }
+    //     ]
+    //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    // })
+
+    var excelDatas = [
+        {
+            tHeader: ['表头1', '表头2', '表头3', '表头4',],
+            filterVal: ['title1', 'title2', 'title3', 'title4'],
+            tableDatas: [ 
+                {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+            ],
+            sheetName: 'Sheet1'
+        }
+    ]
+    json2excel(excelDatas, '表格大标题', true, 'xlsx')
+}
+
+     
+
+  }
+}
+</script>
+<!-- 加了scoped,则是仅在此组件里生效 -->
+<style scoped>
+
+</style>

File diff suppressed because it is too large
+ 378 - 162
src/views/workManagement/WorkTaskAssign1022.vue


Some files were not shown because too many files changed in this diff