all 5 lat temu
rodzic
commit
a7c6591ca6

+ 1 - 1
frontend_web/src/router/routes.js

@@ -34,7 +34,7 @@ const frameIn = [
         path: 'page1',
         name: 'page1',
         meta: {
-          title: '页面 1',
+          title: '数据展示',
           auth: true
         },
         component: _import('demo/page1')

+ 360 - 747
frontend_web/src/views/demo/page1/index.vue

@@ -1,814 +1,427 @@
 <template>
-  <div>
-    <el-card class="box-card" style="height: calc(100vh - 92px);">
-      <div slot="header" style="height: 20px;">
-        <span style="float: left;">
-          <i class="icon icon-table2"></i>
-        </span>
-        <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
-          <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
-          <el-breadcrumb-item :to="{ path: '/system/users' }">用户管理</el-breadcrumb-item>
-        </el-breadcrumb>
-        <span style="float: right;">
-          <el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;"
-            @click="opendatadialog(1,null,-1);resetForm('organizeform')">新增用户</el-button>
-        </span>
-        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
-          <el-form-item label="账号">
-            <el-input size="mini" style="width: 165px;" v-model="keyword" placeholder="请输入账号"></el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-dropdown split-button type="primary" size="mini" @click="seachdata" @command="searchCommand">
-              查询
-              <el-dropdown-menu slot="dropdown">
-                <!-- <el-dropdown-item command="search">高级查询</el-dropdown-item> -->
-                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </el-form-item>
-        </el-form>
-      </div>
-      <el-table :data="list" border>
-        <el-table-column label="操作" align="center">
-          <template slot-scope="scope">
-            <el-button size="small" @click="opendatadialog(2,scope.row,scope.$index);" type="text" icon="el-icon-edit"
-              title="编辑"></el-button>
-            <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除"
-              @click="deletedata(scope.row)"></el-button>
-            <!-- <el-button size="small" type="text" style="margin-left:1px" title="权限" @click="permission(scope.row)"><i class="icon icon-lock"></i></el-button> -->
-            <el-button size="small" type="text" style="margin-left:3px" title="密码重置" @click="resetpwd(scope.row)">
-              <i class="icon icon-spinner11"></i>
-            </el-button>
-            <el-button size="small" type="text" style="margin-left:3px" title="设置角色" @click="roleset(scope.row)">
-              <i class="icon icon-users"></i>
-            </el-button>
-          </template>
-        </el-table-column>
-        <el-table-column prop="Username" align="center" label="账号" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="Realname" align="center" label="用户名"></el-table-column>
-        <el-table-column prop="Departmentname" align="center" label="所属组织"></el-table-column>
-        <el-table-column prop="RealnameRole" align="center" label="角色"></el-table-column>
-        <el-table-column prop="Telephone" align="center" label="手机" show-overflow-tooltip></el-table-column>
-        <el-table-column label="座机" align="center" prop="Mobile" show-overflow-tooltip></el-table-column>
-        <el-table-column v-if="this.appclient != 'lims'" prop="Description" align="center" label="备注"
-          show-overflow-tooltip></el-table-column>
-      </el-table>
-    </el-card>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-      :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
-      :total="currentItemCount">
-    </el-pagination>
+  <d2-container>
+    <el-row :gutter="15">
+      <el-card>
+        <div style="font-size:20px">
+          信息发布
+        </div>
+        <el-table ref="multipleTable"
+                  :data="activities"
+                  border
+                  fit
+                  tooltip-effect="dark"
+                  style="width: 100%;margin: 5px;"
+                  height="280px">
+          <el-table-column prop="title"
+                           fit
+                           min-width="80px"
+                           label="信息标题"
+                           align="center"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="content"
+                           label="信息内容"
+                           align="center"
+                           min-width="160px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="createdtime"
+                           align="center"
+                           min-width="120px"
+                           label="发布时间"
+                           show-overflow-tooltip></el-table-column>
+        </el-table>
+        <el-pagination style="margin: 10px;"
+                       @size-change="handleSizeChange"
+                       @current-change="handleCurrentChange"
+                       :current-page="search.page.current"
+                       :page-sizes="[10, 15, 20]"
+                       :page-size="search.page.size"
+                       layout="total, sizes, prev, pager, next, jumper"
+                       :total="search.page.total">
+        </el-pagination>
+      </el-card>
+    </el-row>
 
-    <el-dialog :title="dialogtitle" :visible.sync="datadialogVisible" width="720px">
-      <el-form :model="userform" :rules="rulesuser" ref="userform" label-width="100px">
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="账号/Email" prop="username" required>
-              <el-input v-model="userform.username" auto-complete="off" :disabled="disabledserial"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="用户名" required prop="realname">
-              <el-input v-model="userform.realname"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="所属组织" required>
-              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                v-model="selectedorg" placeholder="请选择组织"></el-cascader>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="手机" prop="telephone">
-              <el-input v-model="userform.telephone" auto-complete="off"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="座机" prop="mobile">
-              <el-input v-model="userform.mobile" auto-complete="off"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item v-if="this.appclient != 'lims'" label="备注">
-              <el-input type="textarea" v-model="userform.description" auto-complete="off"></el-input>
+    <el-row :gutter="15"
+            style="margin-top: 10px;">
+      <el-card>
+        <div style="font-size:20px">
+          课程管理
+        </div>
+        <template style="padding: 15px;">
+          <el-form size="mini"
+                   ref="form"
+                   :inline="true"
+                   class="sbutton_padding"
+                   style="margin-top: 7px;text-align:right;">
+            <el-form-item label="学期">
+              <el-select v-model="search.term"
+                         style="width: 140px;">
+                <el-option v-for="item in term"
+                           :key="item.ItemName"
+                           :label="item.ItemName"
+                           :value="parseInt(item.ItemValue)">
+                </el-option>
+              </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item v-if=" this.appclient== 'lims'" label="签名">
-              <!-- <el-input type="textarea" v-model="userform.description" auto-complete="off"></el-input> -->
-              <el-upload style="margin-top: 10px;" class="usersignimg-uploader"
-                :action="imghost + '/api/limsupload/usersignimg'" :show-file-list="false"
-                :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
-                <img v-if="imageUrl" :src="imageUrl" class="uploadusersignimg">
-                <i v-else class="el-icon-plus usersignimg-uploader-icon"></i>
-              </el-upload>
+            <el-form-item label="班级"
+                          class="sbutton_margin">
+              <el-select ref="reftube"
+                         v-model="search.class"
+                         placeholder="请选择年级学年"
+                         style="width:100%">
+                <el-option v-for="item in activitiesclass"
+                           :key="item.value"
+                           :label="item.label"
+                           :value="item.value">
+                </el-option>
+              </el-select>
             </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="datadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savedata('userform')">确 定</el-button>
-      </div>
-    </el-dialog>
+            <el-button size="mini"
+                       type="primary"
+                       @click="initDatas()"
+                       style="margin-left:10px"
+                       @command="searchCommand"
+                       class="sbutton_margin">查 询</el-button>
+            <el-button size="mini"
+                       type="primary"
+                       @click="clearSearch"
+                       class="sbutton_margin">重 置</el-button>
+          </el-form>
+        </template>
+        <el-table ref="multipleTable"
+                  :data="activitiescourse"
+                  border
+                  fit
+                  tooltip-effect="dark"
+                  style="width: 100%"
+                  height="280px">>
 
-    <el-dialog :title="rolesettitle" :visible.sync="rolesetVisible">
-      <el-checkbox :indeterminate="isrolecheckall" v-model="roleCheckAll" @change="handleCheckAllChange">全选
-      </el-checkbox>
-      <div style="margin-top:20px;">
-        <el-checkbox-group v-model="selectedrole">
-          <el-checkbox v-for="role in rolelist" @change="handlecheckedrolechange" :label="role.Id" :value="role.Id"
-            :key="role">{{role.Realname}}</el-checkbox>
-        </el-checkbox-group>
-      </div>
-      <div slot="footer">
-        <el-button @click="rolesetVisible = false">取消</el-button>
-        <el-button type="primary" @click="rolesave()">确定</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog :title="permissiondialogtitle" :visible.sync="permissiondatadialogVisible" top="5vh">
-      <el-col :span="6" style="margin-right: 10px">
-        <div class="userpermisstreediv">
-          <el-tree style="border: 0" node-key="id" show-checkbox :data="orgtreelist" :props="orgtreeprops"
-            :default-expanded-keys="userdepartment" @check-change="userpermissorgcheckedchange" ref="userpermisstree">
-          </el-tree>
-        </div>
-      </el-col>
-      <el-col :span="17">
-        <el-form ref="alertform">
-          <el-form-item>
-            <div class="userpermissdiv">
-              <el-checkbox-group v-model="userpermissdevicesselects">
-                <el-checkbox v-for="item in equipdeviceslist" :label="item.Id+''" :key="item.Id">{{item.Code}}
-                </el-checkbox>
-              </el-checkbox-group>
-            </div>
-          </el-form-item>
-        </el-form>
-      </el-col>
-      <div slot="footer" class="dialog-footer" style="margin-top:-35px;">
-        <el-button @click="permissiondatadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savepermission()">确 定</el-button>
-      </div>
-    </el-dialog>
+          <el-table-column prop="Year"
+                           fit
+                           min-width="80px"
+                           label="学年"
+                           align="center"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Term"
+                           label="学期"
+                           align="center"
+                           min-width="160px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Title"
+                           label="标题"
+                           align="center"
+                           min-width="160px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="CourseWeek"
+                           label="教学周"
+                           align="center"
+                           min-width="160px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="content"
+                           label="班级"
+                           align="center"
+                           min-width="160px"
+                           show-overflow-tooltip></el-table-column>
+          <!-- <el-table-column prop="status"
+                           align="center"
+                           min-width="40px"
+                           label="状态"
+                           show-overflow-tooltip
+                           :formatter="formatStatus"></el-table-column> -->
+          <el-table-column prop="createdtime"
+                           align="center"
+                           min-width="120px"
+                           label="创建时间"
+                           show-overflow-tooltip></el-table-column>
+        </el-table>
+        <el-pagination style="margin: 10px;"
+                       @size-change="handleSizeChange_course"
+                       @current-change="handleCurrentChange_course"
+                       :current-page="searchcourse.page.current"
+                       :page-sizes="[10, 15, 20]"
+                       :page-size="searchcourse.page.size"
+                       layout="total, sizes, prev, pager, next, jumper"
+                       :total="searchcourse.page.total">
+        </el-pagination>
+      </el-card>
+    </el-row>
 
-  </div>
+    <el-row :gutter="15"
+            style="margin-top: 10px;">
+      <el-card>
+        <div style="font-size:20px">
+          值班管理
+        </div>
+        <el-table :data="activitiesduty"
+                  border
+                  fit
+                  tooltip-effect="dark"
+                  style="width: 100%;margin-top: 5px;"
+                  height="100%">
+          <el-table-column prop="Year"
+                           fit
+                           min-width="160px"
+                           label="学年"
+                           align="center"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Term"
+                           label="学期"
+                           align="center"
+                           min-width="120px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Title"
+                           label="标题"
+                           align="center"
+                           min-width="120px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="Name"
+                           label="状态"
+                           align="center"
+                           min-width="120px"
+                           show-overflow-tooltip></el-table-column>
+          <el-table-column prop="CreatedTime"
+                           label="创建日期"
+                           align="center"
+                           min-width="120px"
+                           show-overflow-tooltip></el-table-column>
+        </el-table>
+        <el-pagination style="margin: 10px;"
+                       @size-change="handleSizeChange"
+                       @current-change="handleCurrentChange"
+                       :current-page="searchcourse.page.current"
+                       :page-sizes="[10, 15, 20]"
+                       :page-size="searchcourse.page.size"
+                       layout="total, sizes, prev, pager, next, jumper"
+                       :total="searchcourse.page.total">
+        </el-pagination>
+      </el-card>
+    </el-row>
+  </d2-container>
 </template>
 
 <script>
-import {
-  mapGetters
-} from 'vuex'
+import itemDetailApi from '@/api/sysadmin/itemdetail'
+import ClassApi from '@/api/class'
+import InformationApi from '@/api/information'
+import CourseApi from '@/api/course'
+import DutyApi from '@/api/duty'
+// import informationInfoDialog from './components/informationInfoDialog'
 export default {
-  name: 'users',
-
+  name: 'informationIndex',
+  components: {
+    // informationInfoDialog
+  },
   data () {
-    var checkusername = (rule, value, callback) => {
-      if (!value) {
-        callback(new Error('请输入账号'))
-      } else {
-        if (this.appclient === 'lims') { // 大港油田lims系统不用邮箱
-          callback()
+    return {
+      dialogvisible: false,
+      years: [],
+      details: false,
+      activities: [],
+      activitiescourse: [],
+      activitiesduty: [],
+      activitiesclass: [],
+      informationId: -1,
+      search: {
+        title: '',
+        status: 1,
+        content: '',
+        page: {
+          total: 0,
+          current: 1,
+          size: 10
         }
-        let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
-        if (!re.test(value)) {
-          callback(new Error('请输入正确的邮箱地址'))
-        } else {
-          callback()
+      },
+      term: [],
+      searchcourse: {
+        title: '',
+        status: 1,
+        content: '',
+        page: {
+          total: 0,
+          current: 1,
+          size: 5
         }
-      }
-    }
-    return {
-      downloading: '',
-      imghost: '',
-      organdialogVisible: false,
-      currentItemCount: 0,
-      currentItemCount2: 0,
-      currentItemCount3: 0,
-      currentPage: 1,
-      size: 10,
-      rolesettitle: '',
-      rolesetVisible: false,
-      roleCheckAll: false,
-      isrolecheckall: false,
-      selectedrole: [],
-      bossSelect: [],
-      list: [],
-      rolelist: [],
-      mustrolelist: [],
-      keyword: '',
-      datadialogVisible: false,
-      dialogtitle: '',
-      disabledserial: false,
-      IsInnerOrganize: 1,
-      appclient: '',
-      userform: {
-        username: '',
-        realname: '',
-        telephone: '',
-        mobile: '',
-        sign: '',
-        description: '',
-        id: 0,
-        departmentid: '',
-        departmentname: '',
-        RealnameRole: '',
-        GroupId: '',
-        GroupName: ''
       },
-      rulesuser: {
-        username: [{
-          validator: checkusername,
-          trigger: 'blur'
-        }],
-        realname: [{
-          required: true,
-          message: '用户名',
-          trigger: 'blur'
-        }]
+      status: [{
+        key: '全部',
+        value: -1
       },
-      imageUrl: '',
-      operatingitem: 0,
-      permissiondialogtitle: '',
-      permissiondatadialogVisible: false,
-      isfristchecked: false, // 过滤点击树时出现的多次触发选择事件
-      userpermisstreedata: [], // 组织tree 数据
-      userpermissdevicesselects: [], // 设备批量设置所选设备
-      equipdeviceslist: [], // 批量设置设备设备所有数据
-      equipalllist: [], // 设备所有数据
-      checkedarr: [], // 树形控件多选框
-      orgtreelist: [],
-      orgtreeprops: {
-        value: 'id',
-        label: 'Fullname',
-        children: 'children'
+      {
+        key: '草稿',
+        value: 0
       },
-      rolelistcheckall: [],
-      selectedorg: [],
-      userdepartment: [],
-      ischeckbj: false // 过滤字段勾选时触发的选中事件
+      {
+        key: '已发布',
+        value: 1
+      }
+      ],
+      // 列表排序
+      Column: {
+        Order: '',
+        Prop: ''
+      }
     }
   },
-  computed: mapGetters({
-    authUser: 'authUser'
-  }),
-  created () {
-    this.appclient = process.env.appclient
-    this.imghost = process.env.limsimgserverhost
-    this.getorgtreelist()
-    this.initData()
-    // this.loadequipsall()
-    this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
-    this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
+  mounted () {
+    this.initDatas()
+    this.initDatasCourse()
+    this.initSelectYear()
+    this.initDatas_duty()
+    this.initDatas_class()
+    this.getTerm()
   },
   methods: {
-    initData () {
-      let _this = this
-      // paginate
-      const params = {
-        _currentPage: this.currentPage,
-        _size: this.size,
-        keyword: this.keyword
-      }
-      // request
-      this.$axios.get('users/usualwithrole', {
-        params
-      })
+    //获取字典表
+    getTerm () {
+      itemDetailApi.getItemDetailByItemCode({ ItemCode: 'Term' })
         .then(res => {
-          // response
-          _this.list = res.data.items
-          _this.currentItemCount = res.data.currentItemCount
+          console.log('---res--', res)
+          this.term = res
+          // this.initDatas()
         })
         .catch(err => {
-          // handle error
           console.error(err)
         })
-      this.$axios.get('role/list', {})
+    },
+    //class
+    initDatas_class () {
+      let _this = this
+      let params = {
+        _currentPage: this.currpage,
+        _size: this.size,
+      }
+      ClassApi.getAllClass(params)
         .then(res => {
-          // response
-          _this.rolelist = res.data.items
-          _this.roleItemCount = res.data.currentItemCount
-          for (var i = 0; i < _this.roleItemCount; i++) {
-            _this.rolelistcheckall.push(_this.rolelist[i].Id)
+          for (let i = 0; i < res.records.length; i++) {
+            this.activitiesclass.push({ value: (res.records[i].Id), label: (res.records[i].Year + "_" + res.records[i].Name) });
           }
+          // _this.activitiesclass = res.records
+          console.log('--------', _this.activitiesclass)
         })
-        .catch(err => {
-          // handle error
-          console.error(err)
-        })
-    },
-    handleAvatarSuccess (res, file) {
-      this.userform.sign = res
-      this.imageUrl = URL.createObjectURL(file.raw)
     },
-    beforeAvatarUpload (file) {
-      console.log(file)
-      const isimg = file.type.indexOf('image/') === 0
-      const isLt50k = file.size / 1024 / 50 < 1
-      if (!isimg) {
-        this.$message.error('上传图片只能是 图片 格式!')
-        return false
-      }
-      if (!isLt50k) {
-        this.$message.error('上传图片大小不能超过 50kb!')
-        return false
+    initSelectYear (year) {
+      var myDate = new Date;
+      var year = myDate.getFullYear();//获取当前年
+      for (let i = 0; i < 5; i++) {
+        this.years.push({ value: (year - i), label: (year - i) + "年" });
       }
-      return true
     },
-    roleset (val) {
-      this.rolesettitle = '用户(' + val.Realname + ')-角色管理'
-      this.rolesetVisible = true
-      this.selecteduserid = val.Id + ''
-      this.selectedrole = []
+    // 初始化列表数据,值班管理列表
+    initDatas_duty () {
       let _this = this
-      // request
-      this.$axios.get('casbin/users/getuserrole/' + this.selecteduserid, {})
+      let params = {
+        _currentPage: this.currpage,
+        _size: this.size,
+      }
+      DutyApi.getAllDuty(params)
         .then(res => {
-          _this.mustrolelist = []
-          // response
-          for (let i = 0; i < res.data.length; i++) {
-            if (_this.roleisexist(parseInt(res.data[i]))) {
-              _this.selectedrole.push(parseInt(res.data[i]))
-            }
-
-            let flag = false
-            let rdx = 0
-            for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
-              if (parseInt(_this.rolelist[rdx].Id) === parseInt(res.data[i])) {
-                flag = true
-                break
-              }
-            }
-            if (!flag) {
-              _this.mustrolelist.push(parseInt(res.data[i]))
-            }
-          }
-
-          let checkedCount = this.selectedrole.length
-          this.roleCheckAll = checkedCount === this.rolelist.length
-          this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
+          _this.activitiesduty = res.records
         })
     },
-    rolesave () {
-      let _this = this
-      for (let mdx in this.mustrolelist) {
-        if (this.selectedrole.indexOf(this.mustrolelist[mdx]) === -1) {
-          this.selectedrole.push(parseInt(this.mustrolelist[mdx]))
-        }
-      }
-      let rolestring = this.selectedrole.join(',')
-      // request
-      this.$axios.put('casbin/users/setuserrole/' + this.selecteduserid + '_' + rolestring, {})
+    // 初始化列表数据课程
+    initDatasCourse () {
+      CourseApi.getPageList(this.searchcourse)
         .then(res => {
-          // response
-          if (res.data.code === 0) {
-            _this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-            // 更新界面
-            this.list = []
-            this.initData()
-            this.rolesetVisible = false
-          } else {
-            _this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
-          }
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
+          this.activitiescourse = res.records
+          this.searchcourse.page = res
         })
     },
-    handlecheckedrolechange () {
-      let checkedCount = this.selectedrole.length
-      this.roleCheckAll = checkedCount === this.rolelist.length
-      this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
-    },
-    handleCheckAllChange (val) {
-      this.selectedrole = val ? this.rolelistcheckall : []
-      this.isrolecheckall = false
-    },
-    roleisexist (val) {
-      for (let i = 0; i < this.rolelist.length; i++) {
-        if (this.rolelist[i].Id === val) {
-          return true
+    formatStatus (row, column) {
+      for (var i = 0; i < this.status.length; i++) {
+        if (this.status[i].value == row.status) {
+          return this.status[i].key;
         }
       }
-      return false
     },
-    // loadequipsall() {
-    //   // toggle loading
-    //   let _this = this
-    //   // request
-    //   this.$axios.get('equipment/alllist', null)
-    //     .then(res => {
-    //       // response
-    //       _this.equipalllist = res.data.items
-    //       _this.equipdeviceslist = res.data.items
-    //     })
-    //     .catch(err => {
-    //       // handle error
-    //       console.error(err)
-    //       this.loading = false
-    //     })
-    // },
-    seachdata () {
-      this.list = []
-      this.currentPage = 1
-      this.initData()
-    },
-    searchCommand (command) {
-      if (command === 'clear') {
-        this.clearSearch()
+    initSearchInfo () {
+      this.search = {
+        Title: '',
+        Status: -1,
+        Content: '',
       }
     },
-    handleSizeChange (value) {
-      this.list = []
-      this.size = value
-      this.currentPage = 1
-      this.initData()
-    },
-    handleCurrentChange (value) {
-      this.currentPage = value
-      this.list = []
-      this.initData()
-    },
-    jstimehandle (val) {
-      val = val.replace('T', ' ')
-      return val.substring(0, 19)
-    },
-    opendatadialog (item, v, index) {
-      let _this = this
-      this.operatingitem = item
-      this.datadialogVisible = true
-      this.clearuserForm()
-      if (item === 1) {
-        this.dialogtitle = '新增用户'
-        this.disabledserial = false
-      } else if (item === 2) {
-        this.$axios.get('organizes/parentlist/' + v.Departmentid, {})
-          .then(res => {
-            if (res.data.code === 0) {
-              _this.dialogtitle = `编辑用户信息(${v.Realname})`
-              _this.disabledserial = true
-              _this.userform.username = v.Username
-              _this.userform.realname = v.Realname + ''
-              _this.userform.telephone = v.Telephone
-              _this.userform.mobile = v.Mobile
-              _this.userform.description = v.Description
-              _this.userform.role = v.Roleid + ''
-              _this.userform.id = v.Id
-              // 选中状态
-              _this.selectedorg = []
-              let pidarr = res.data.message.split(',')
-              for (var i = pidarr.length - 1; i >= 0; i--) {
-                if (pidarr[i] !== '0') {
-                  _this.selectedorg.push(parseInt(pidarr[i]))
-                }
-              }
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: '出现错误!'
-              })
-              this.datadialogVisible = false
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
+    //初始化分页分页对象
+    initPageInfo () {
+      this.search.page = {
+        total: 0,
+        current: 1,
+        size: 10
       }
     },
-    savedata (formName) {
-      let _this = this
-      if (this.selectedorg.length === 0) {
-        _this.$message({
-          type: 'warning',
-          message: '请选择所属组织!'
-        })
-        return
-      }
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          this.userform.departmentid = this.selectedorg[this.selectedorg.length - 1] + ''
-          if (_this.operatingitem === 1) {
-            _this.$axios.post('users', _this.userform)
-              .then(res => {
-                // response
-                if (res.data.code === 0) {
-                  _this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                  this.list = []
-                  _this.datadialogVisible = false
-                  this.initData()
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
-              })
-              .catch(err => {
-                // handle error
-                console.error(err)
-              })
-          } else if (_this.operatingitem === 2) {
-            _this.$axios.put('users/' + _this.userform.id, _this.userform)
-              .then(res => {
-                // response
-                if (res.data.code === 0) {
-                  _this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                  this.list = []
-                  _this.datadialogVisible = false
-                  // 更新界面
-                  this.initData()
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
-              })
-              .catch(() => {})
-          }
-        } else {
-          return false
-        }
-      })
-    },
-    deletedata (val) {
-      let _this = this
-      _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        _this.$axios.delete('users/' + val.Id, null)
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              this.list = []
-              // 更新界面
-              this.initData()
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(() => {})
-      }).catch(() => {})
+    // 打开 添加弹窗
+    openinformationadd () {
+      this.$refs.informationDialog.dialogvisible = true
     },
-    resetForm (formName) {
-      // this.$refs[formName].resetFields()
+    // 打开 编辑弹窗
+    informationedit (informationId) {
+      this.informationId = informationId
+      this.$refs.informationDialog.dialogvisible = true
     },
-    clearuserForm () {
-      this.userform = {
-        username: '',
-        realname: '',
-        telephone: '',
-        mobile: '',
-        description: ''
-      }
+    // 新增修改弹窗关闭 返回页面
+    handleClose () {
+      this.informationId = -1
+      this.$refs.informationDialog.dialogvisible = false
+      this.initPageInfo()
+      this.initDatas()
+      console.log("handleClose informationId" + this.informationId)
     },
-    permission (v) {
-      let _this = this
-      _this.ischeckbj = true // 过滤字段勾选时触发的选中事件
-      this.userpermissdevicesselects = []
-      this.permissiondialogtitle = `用户权限设置(${v.Realname})`
-      this.permissiondatadialogVisible = true
-      this.userform.id = v.Id
-      this.$axios.get('users/permission/' + v.Id, null)
-        .then(res => {
-          // response
-          res.data.forEach((item, k) => {
-            this.userpermissdevicesselects.push(item)
-          })
-          _this.getorgbyeid(res.data + '')
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
-        })
+    publish (information) {
+      information.status = 1
+      InformationApi.save(information)
     },
-    getorgbyeid (v) {
-      let _this = this
-      this.$axios.put('equipment/getorgidsbyeqids', {
-        EquipmentIds: v
-      })
+    // 初始化列表数据
+    initDatas () {
+      InformationApi.getList(this.search)
         .then(res => {
-          // response
-          setTimeout(function () {
-            setTimeout(function () {
-              _this.ischeckbj = false
-            }, 300)
-            // 清空树选择框
-            _this.$refs.userpermisstree.setCheckedKeys(res.data)
-          }, 100)
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
+          this.activities = res.records
+          this.search.page = res
         })
     },
-    savepermission () {
-      let _this = this
-      _this.$axios.put('users/permission/' + this.userform.id, {
-        channelids: this.userpermissdevicesselects + ''
-      })
-        .then(res => {
-          // response
-          if (res.data.code === 0) {
-            _this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-            _this.permissiondatadialogVisible = false
-          } else {
-            _this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
-          }
-        })
-        .catch(() => {})
+    //信息发布
+    handleSizeChange (val) {
+      this.search.page.size = val
+      this.search.page.current = 1
+      this.initDatas()
     },
-    resetpwd (val) {
-      let _this = this
-      _this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        _this.$axios.put('users/resetpwd/' + val.Id, null)
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(() => {})
-      }).catch(() => {})
+    handleCurrentChange (val) {
+      this.search.page.current = val
+      this.initDatas()
     },
-    // 选择组织树时触发
-    userpermissorgcheckedchange (data, checked, indeterminate) {
-      let _this = this
-      if (!_this.ischeckbj) {
-        if (!_this.isfristchecked) {
-          _this.isfristchecked = true
-          setTimeout(function () {
-            _this.isfristchecked = false
-            _this.checkorgusermanage()
-          }, 100)
-        }
-      }
+    //课程管理
+    handleSizeChange_course (val) {
+      this.search.page.size = val
+      this.search.page.current = 1
+      this.initDatasCourse()
     },
-    checkorgusermanage () {
-      let orgids = []
-      let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
-      selectnodes.forEach(row => {
-        orgids.push(row.id)
-      })
-      const params = {
-        orgids: orgids
-      }
-      let _this = this
-      this.$axios.get('equipment/getidsbyoid', {
-        params
-      })
-        .then(res => {
-          // response
-          _this.userpermissdevicesselects = []
-          if (res.data) {
-            _this.equipdeviceslist = res.data
-            res.data.forEach(row => {
-              _this.userpermissdevicesselects.push(row.Id)
-            })
-          } else {
-            _this.equipdeviceslist = _this.equipalllist
-          }
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
-          this.loading = false
-        })
+    handleCurrentChange_course (val) {
+      this.search.page.current = val
+      this.initDatasCourse()
     },
-    getorgtreelist () {
-      let _this = this
-      // request
-      let params = {
-        IsInnerOrganize: 1
+
+
+    searchCommand (command) {
+      if (command === 'search') {
+        this.dialogvisible = true
+      } else if (command === 'clear') {
+        this.clearSearch()
       }
-      _this.$axios.get('organizes/list', {
-        params
-      })
-        .then(res => {
-          _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
-        })
-        .catch(err => {
-          // handle error
-          console.error(err)
-        })
     },
     clearSearch () {
-      this.keyword = ''
-      this.list = []
-      this.initData()
+      this.initDatasCourse()
     }
+
   }
 }
 </script>
 
 <style lang="scss">
-  .el-pagination {
-    margin: 1rem 0 2rem;
-    text-align: right;
-  }
-
-  .triggerone {
-    font-size: 13px;
-    margin-left: 80px;
-  }
-
-  .plab {
-    font-size: 13px;
-    color: #999;
-  }
-
-  .userpermisstreediv {
-    border: 1px #CCCCCC solid;
-    overflow: auto;
-    height: 328px;
-    margin-right: 5px;
-  }
-
-  .userpermissdiv {
-    margin-left: 1px;
-    border: 1px #CCCCCC solid;
-    overflow: auto;
-    height: 320px;
-    padding: 4px;
-  }
-
-  .userpermissdiv .el-checkbox {
-    margin-top: 5px;
-    margin-left: 15px;
-  }
-
-  .usersignimg-uploader .el-upload {
-    border: 1px dashed #63b8ff;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
-  }
-
-  .usersignimg-uploader .el-upload:hover {
-    border-color: #228b22;
-  }
-
-  .usersignimg-uploader-icon {
-    font-size: 28px;
-    color: #63b8ff;
-    width: 66px;
-    height: 66px;
-    line-height: 66px;
-    text-align: center;
-  }
-
-  .usersignimg-uploader-icon:hover {
-    color: #228b22;
-  }
+.el-pagination {
+  margin: 1rem 0 2rem;
+  text-align: right;
+}
 
-  .uploadusersignimg {
-    width: 66px;
-    height: 66px;
-    display: block;
-  }
+.plab {
+  font-size: 13px;
+  color: #999;
+}
 </style>

BIN
frontend_web/src/views/system/index/image/logo_nmg.png


+ 80 - 43
frontend_web/src/views/system/index/page.vue

@@ -1,49 +1,86 @@
 <template>
   <d2-container>
-    <el-row :gutter="15">
-      <el-card>
-        <div style="font-size:20px">
-          信息发布
-        </div>
-        <el-table ref="multipleTable"
-                  :data="activities"
-                  border
-                  fit
-                  tooltip-effect="dark"
-                  style="width: 100%;margin: 5px;"
-                  @sort-change="orderby"
-                  height="280px">
-          <el-table-column prop="title"
-                           fit
-                           min-width="80px"
-                           label="信息标题"
-                           align="center"
-                           show-overflow-tooltip></el-table-column>
-          <el-table-column prop="content"
-                           label="信息内容"
-                           align="center"
-                           min-width="160px"
-                           show-overflow-tooltip></el-table-column>
-          <el-table-column prop="createdtime"
-                           align="center"
-                           min-width="120px"
-                           label="发布时间"
-                           show-overflow-tooltip></el-table-column>
-        </el-table>
-        <el-pagination style="margin: 10px;"
-                       @size-change="handleSizeChange"
-                       @current-change="handleCurrentChange"
-                       :current-page="search.page.current"
-                       :page-sizes="[10, 15, 20]"
-                       :page-size="search.page.size"
-                       layout="total, sizes, prev, pager, next, jumper"
-                       :total="search.page.total">
-        </el-pagination>
-      </el-card>
-      <!-- </el-card> -->
-    </el-row>
-    <!-- </div> -->
+    <template slot="header"
+              style="padding: 5px;">
+      <img class="page_logo"
+           src="././image/logo_nmg.png"
+           width="100%"
+           height="115"
+           style="margin:0px">
+    </template>
+    <el-table ref="multipleTable"
+              :data="activities"
+              border
+              fit
+              tooltip-effect="dark"
+              style="width: 100%"
+              @sort-change="orderby"
+              height="100%">
+      <!-- <el-table-column label="操作"
+                       width="160px"
+                       align="center"
+                       fixed='right'>
+        <template slot-scope="scope">
+          <el-button size="mini"
+                     title="编辑"
+                     type="primary"
+                     @click="informationedit(scope.row.id)"
+                     icon="el-icon-edit"
+                     circle></el-button>
+          <el-button size="mini"
+                     type="primary"
+                     title="发布"
+                     @click="publish(scope.row)"
+                     style="margin-left:5px;"
+                     icon="el-icon-s-promotion"
+                     circle></el-button>
+          <el-button size="mini"
+                     type="danger"
+                     title="删除"
+                     @click="deleteinformation(scope.row)"
+                     style="margin-left:5px;"
+                     icon="el-icon-delete"
+                     circle></el-button>
+
+        </template>
+      </el-table-column> -->
+      <el-table-column prop="title"
+                       fit
+                       min-width="80px"
+                       label="信息标题"
+                       align="center"
+                       show-overflow-tooltip></el-table-column>
+      <el-table-column prop="content"
+                       label="信息内容"
+                       align="center"
+                       min-width="160px"
+                       show-overflow-tooltip></el-table-column>
+      <!-- <el-table-column prop="status"
+                       align="center"
+                       min-width="40px"
+                       label="状态"
+                       show-overflow-tooltip
+                       :formatter="formatStatus"></el-table-column> -->
+      <el-table-column prop="createdtime"
+                       align="center"
+                       min-width="120px"
+                       label="发布时间"
+                       show-overflow-tooltip></el-table-column>
+    </el-table>
+    <!-- </el-card> -->
 
+    <!-- </div> -->
+    <template slot="footer">
+      <el-pagination style="margin: -10px;"
+                     @size-change="handleSizeChange"
+                     @current-change="handleCurrentChange"
+                     :current-page="search.page.current"
+                     :page-sizes="[10, 15, 20]"
+                     :page-size="search.page.size"
+                     layout="total, sizes, prev, pager, next, jumper"
+                     :total="search.page.total">
+      </el-pagination>
+    </template>
   </d2-container>
 </template>