index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <template>
  2. <d2-container>
  3. <!-- <img class="page_logo"
  4. src="./image/logo.png"
  5. width="100%"
  6. height="115"
  7. style="margin:0px"> -->
  8. <div class="background_css">
  9. <el-row style="height:100%">
  10. <el-col :span="20">
  11. &nbsp;
  12. </el-col>
  13. <el-col :span="4">
  14. <div class="login_bg5x">
  15. <a href="/#/login"
  16. alt="logo">
  17. <img src="./image/button.png"
  18. class="intelligent1-img" /> </a>
  19. </div>
  20. </el-col>
  21. </el-row>
  22. </div>
  23. <el-row :gutter="15">
  24. <el-card style="width: 100%">
  25. <div style="font-size:25px">
  26. 公告
  27. </div>
  28. <el-table ref="multipleTable"
  29. :data="activities"
  30. border
  31. fit
  32. @row-click="openDetails"
  33. tooltip-effect="light">
  34. <el-table-column prop="title"
  35. fit
  36. min-width="80px"
  37. label="信息标题"
  38. align="center"
  39. show-overflow-tooltip></el-table-column>
  40. <el-table-column prop="content"
  41. label="信息内容"
  42. align="center"
  43. min-width="160px"
  44. show-overflow-tooltip></el-table-column>
  45. <el-table-column prop="createdtime"
  46. align="center"
  47. min-width="50px"
  48. label="发布时间"></el-table-column>
  49. </el-table>
  50. <el-pagination style="margin: 10px;float:right;"
  51. @size-change="handleSizeChange"
  52. @current-change="handleCurrentChange"
  53. :current-page="search.page.current"
  54. :page-sizes="[10, 15, 20]"
  55. :page-size="search.page.size"
  56. layout="total, sizes, prev, pager, next, jumper"
  57. :total="search.page.total">
  58. </el-pagination>
  59. </el-card>
  60. </el-row>
  61. <el-row :gutter="15"
  62. style="margin-top: 10px;">
  63. <el-card>
  64. <div style="font-size:25px">
  65. 课程表
  66. </div>
  67. <template style="padding: 15px;">
  68. <el-form size="mini"
  69. ref="form"
  70. :inline="true"
  71. class="sbutton_padding"
  72. style="margin-top: 7px;text-align:right;">
  73. <el-form-item label="学年">
  74. <el-select v-model="searchcourse.Year"
  75. style="width: 140px;"
  76. filterable>
  77. <el-option v-for="item in years"
  78. :key="item.value"
  79. :label="item.label"
  80. :value="item.value">
  81. </el-option>
  82. </el-select>
  83. </el-form-item>
  84. <el-form-item label="班级"
  85. class="sbutton_margin">
  86. <el-select ref="reftube"
  87. v-model="searchcourse.ClassId"
  88. filterable
  89. placeholder="请选择"
  90. style="width:100%">
  91. <el-option v-for="item in classList"
  92. :key="item.Id"
  93. :label="item.Name"
  94. :value="parseInt(item.Id)">
  95. </el-option>
  96. </el-select>
  97. </el-form-item>
  98. <el-button size="mini"
  99. type="primary"
  100. @click="initDatasCourse()"
  101. style="margin-left:10px"
  102. @command="searchCommand"
  103. class="sbutton_margin">查 询</el-button>
  104. <el-button size="mini"
  105. type="primary"
  106. @click="clearSearch"
  107. class="sbutton_margin">重 置</el-button>
  108. </el-form>
  109. </template>
  110. <el-table ref="multipleTable"
  111. :data="activitiescourse"
  112. border
  113. @row-click="openCourseDetails"
  114. fit
  115. tooltip-effect="dark"
  116. style="width: 100%"
  117. height="280px">>
  118. <el-table-column prop="Year"
  119. fit
  120. min-width="80px"
  121. label="学年"
  122. align="center"
  123. show-overflow-tooltip></el-table-column>
  124. <el-table-column prop="Term"
  125. label="学期"
  126. align="center"
  127. min-width="160px"
  128. show-overflow-tooltip
  129. :formatter="formatTerm"></el-table-column>
  130. <el-table-column prop="Title"
  131. label="标题"
  132. align="center"
  133. min-width="160px"
  134. show-overflow-tooltip></el-table-column>
  135. <el-table-column prop="ClassId"
  136. label="班级"
  137. align="center"
  138. min-width="160px"
  139. show-overflow-tooltip
  140. :formatter="formatClass"></el-table-column>
  141. <el-table-column prop="CreatedTime"
  142. align="center"
  143. min-width="120px"
  144. label="创建时间"
  145. show-overflow-tooltip></el-table-column>
  146. </el-table>
  147. <el-pagination style="margin: 10px;float:right;"
  148. @size-change="handleSizeChange_course"
  149. @current-change="handleCurrentChange_course"
  150. :current-page="searchcourse.page.current"
  151. :page-sizes="[10, 15, 20]"
  152. :page-size="searchcourse.page.size"
  153. layout="total, sizes, prev, pager, next, jumper"
  154. :total="searchcourse.page.total">
  155. </el-pagination>
  156. </el-card>
  157. </el-row>
  158. <el-row :gutter="15"
  159. style="margin-top: 10px;">
  160. <el-card>
  161. <div style="font-size:25px">
  162. 值班表
  163. </div>
  164. <template style="padding: 15px;">
  165. <el-form size="mini"
  166. ref="form"
  167. :inline="true"
  168. class="sbutton_padding"
  169. style="margin-top: 7px;text-align:right;">
  170. <el-form-item label="学年"
  171. class="sbutton_margin">
  172. <el-select v-model="searchduty.Year"
  173. placeholder="请选择年级学年"
  174. filterable>
  175. <el-option v-for="item in years"
  176. :key="item.value"
  177. :label="item.label"
  178. :value="item.value">
  179. </el-option>
  180. </el-select>
  181. </el-form-item>
  182. <el-form-item label="学期"
  183. class="sbutton_margin">
  184. <el-select v-model="searchduty.Term"
  185. style="width: 140px;"
  186. filterable>
  187. <el-option v-for="item in termList"
  188. :key="item.ItemValue"
  189. :label="item.ItemName"
  190. :value="parseInt(item.ItemValue)">
  191. </el-option>
  192. </el-select>
  193. </el-form-item>
  194. <el-form-item label="标题"
  195. class="sbutton_margin">
  196. <el-input style="width: 140px;"
  197. v-model="searchduty.Title"
  198. placeholder="请输入标题"></el-input>
  199. </el-form-item>
  200. <el-button size="mini"
  201. type="primary"
  202. @click="initDatas_duty()"
  203. style="margin-left:10px"
  204. class="sbutton_margin">查 询</el-button>
  205. <el-button size="mini"
  206. type="primary"
  207. @click="clearSearchduty"
  208. class="sbutton_margin">重 置</el-button>
  209. </el-form>
  210. </template>
  211. <el-table :data="activitiesduty"
  212. border
  213. fit
  214. @row-click="openDutyDetails"
  215. tooltip-effect="dark"
  216. style="width: 100%;margin-top: 5px;"
  217. height="280px">
  218. <el-table-column prop="Year"
  219. fit
  220. min-width="160px"
  221. label="学年"
  222. align="center"
  223. show-overflow-tooltip></el-table-column>
  224. <el-table-column prop="Term"
  225. label="学期"
  226. align="center"
  227. min-width="160px"
  228. show-overflow-tooltip
  229. :formatter="formatTerm"></el-table-column>
  230. <el-table-column prop="Title"
  231. label="标题"
  232. align="center"
  233. min-width="120px"
  234. show-overflow-tooltip></el-table-column>
  235. <el-table-column prop="CreatedTime"
  236. label="创建日期"
  237. align="center"
  238. min-width="120px"
  239. show-overflow-tooltip></el-table-column>
  240. </el-table>
  241. <el-pagination style="margin: 10px;float:right;"
  242. @size-change="handleSizeChangeduty"
  243. @current-change="handleCurrentChangeduty"
  244. :current-page="searchduty.page.current"
  245. :page-sizes="[10, 15, 20]"
  246. :page-size="searchduty.page.size"
  247. layout="total, sizes, prev, pager, next, jumper"
  248. :total="searchduty.page.total">
  249. </el-pagination>
  250. </el-card>
  251. </el-row>
  252. <!-- 信息发布 -->
  253. <informationInfoDialog ref="informationDialog"
  254. :informationId="informationId"
  255. width="75"></informationInfoDialog>
  256. <!-- 课程管理 -->
  257. <courseInfoDialog ref="courseDialog"
  258. :courselist="courselist"
  259. width="75"></courseInfoDialog>
  260. <!-- 值班表 -->
  261. <dutyInfoDialog ref="dutyDialog"
  262. :dutydetail="dutydetail"
  263. width="75"></dutyInfoDialog>
  264. </d2-container>
  265. </template>
  266. <script>
  267. import itemDetailApi from '@/api/sysadmin/itemdetail'
  268. import ClassApi from '@/api/class'
  269. import InformationApi from '@/api/information'
  270. import CourseApi from '@/api/course'
  271. import DutyApi from '@/api/duty'
  272. import informationInfoDialog from './components/informationInfoDialog'
  273. import courseInfoDialog from './components/courseInfoDialog'
  274. import dutyInfoDialog from './components/dutyInfoDialog'
  275. export default {
  276. name: 'informationIndex',
  277. components: {
  278. informationInfoDialog,
  279. courseInfoDialog,
  280. dutyInfoDialog
  281. },
  282. data () {
  283. return {
  284. dialogvisible: false,
  285. years: [],
  286. details: false,
  287. classList: [], // 班级列表
  288. statusList: [], // 状态列表
  289. termList: [], // 学期
  290. activities: [],
  291. activitiescourse: [],
  292. courselist: [],
  293. dutydetail: [],
  294. activitiesduty: [],
  295. activitiesclass: [],
  296. informationId: -1,
  297. search: {
  298. title: '',
  299. status: 1,
  300. content: '',
  301. page: {
  302. total: 0,
  303. current: 1,
  304. size: 10
  305. }
  306. },
  307. searchduty: {
  308. Term: '',
  309. Year: '',
  310. Title: '',
  311. page: {
  312. total: 0,
  313. current: 1,
  314. size: 10
  315. }
  316. },
  317. searchcourse: {
  318. Term: '',
  319. Year: '',
  320. ClassId: '',
  321. page: {
  322. total: 0,
  323. current: 1,
  324. size: 10
  325. }
  326. },
  327. status: [{
  328. key: '全部',
  329. value: -1
  330. },
  331. {
  332. key: '草稿',
  333. value: 0
  334. },
  335. {
  336. key: '已发布',
  337. value: 1
  338. }
  339. ],
  340. // 列表排序
  341. Column: {
  342. Order: '',
  343. Prop: ''
  344. }
  345. }
  346. },
  347. mounted () {
  348. this.getTerm()
  349. this.initDatas()
  350. this.initDatasCourse()
  351. this.initSelectYear()
  352. this.initDatas_duty()
  353. // this.initDatas_class()
  354. this.getClassList()
  355. },
  356. methods: {
  357. openDetails (row) {
  358. this.informationId = row.id
  359. this.$refs.informationDialog.dialogvisible = true
  360. },
  361. // 课程
  362. openCourseDetails (row) {
  363. this.courselist.CourseId = row.Id
  364. this.courselist.Year = row.Year
  365. this.courselist.Title = row.Title
  366. this.courselist.Term = row.Term
  367. this.courselist.ClassId = row.ClassId
  368. this.$refs.courseDialog.dialogvisible = true
  369. },
  370. openDutyDetails (row) {
  371. this.dutydetail = []
  372. this.dutydetail.Id = row.Id
  373. this.dutydetail.Title = row.Title
  374. this.dutydetail.Year = row.Year
  375. this.dutydetail.Term = row.Term
  376. this.$refs.dutyDialog.dialogvisible = true
  377. },
  378. // class
  379. // initDatas_class () {
  380. // let params = {
  381. // _currentPage: this.currpage,
  382. // _size: this.size
  383. // }
  384. // ClassApi.getAllClass(params)
  385. // .then(res => {
  386. // for (let i = 0; i < res.records.length; i++) {
  387. // this.activitiesclass.push({ value: (res.records[i].Id), label: (res.records[i].Year + '_' + res.records[i].Name) })
  388. // }
  389. // })
  390. // },
  391. // 发布状态
  392. getStatus () {
  393. let _this = this
  394. itemDetailApi.getItemDetailByItemCode({ ItemCode: 'PublishStatus' })
  395. .then(res => {
  396. _this.statusList = res
  397. // this.initDatas()
  398. })
  399. .catch(err => {
  400. console.error(err)
  401. })
  402. },
  403. // 匹配状态
  404. formatStatus (row, column) {
  405. for (var i = 0; i < this.statusList.length; i++) {
  406. if (parseInt(this.statusList[i].ItemValue) === parseInt(row.Status)) {
  407. return this.statusList[i].ItemName
  408. }
  409. }
  410. },
  411. // 匹配班级
  412. formatClass (row, column) {
  413. for (var i = 0; i < this.classList.length; i++) {
  414. if (parseInt(this.classList[i].Id) === row.ClassId) {
  415. return this.classList[i].Name
  416. }
  417. }
  418. },
  419. // 获取学期
  420. getTerm () {
  421. itemDetailApi.getItemDetailByItemCode({ ItemCode: 'Term' })
  422. .then(res => {
  423. this.termList = res
  424. })
  425. .catch(err => {
  426. console.error(err)
  427. })
  428. },
  429. // 匹配学期
  430. formatTerm (row, column) {
  431. for (var i = 0; i < this.termList.length; i++) {
  432. if (parseInt(this.termList[i].ItemValue) === parseInt(row.Term)) {
  433. return this.termList[i].ItemName
  434. }
  435. }
  436. },
  437. // 获取班级列表
  438. getClassList () {
  439. let params = {
  440. _currentPage: 1,
  441. _size: 9999
  442. }
  443. ClassApi.getAllClass(params)
  444. .then(res => {
  445. this.classList = res.records
  446. })
  447. },
  448. initSelectYear (year) {
  449. var myDate = new Date()
  450. var year = myDate.getFullYear() + 1 // 获取下年
  451. for (let i = 0; i < 5; i++) {
  452. this.years.push({ value: (year - i), label: (year - i) + '年' })
  453. }
  454. },
  455. // 初始化列表数据,值班管理列表
  456. initDatas_duty () {
  457. let _this = this
  458. // let params = {
  459. // _currentPage: this.currpage,
  460. // _size: this.size,
  461. // Year: this.search.Year,
  462. // Term: this.search.Term,
  463. // Title: this.search.Title,
  464. // Order: this.search.Order,
  465. // Prop: this.search.Prop
  466. // }
  467. DutyApi.getPageList(this.searchduty)
  468. .then(res => {
  469. _this.activitiesduty = res.records
  470. _this.searchduty.page.total = res.total
  471. })
  472. },
  473. // 初始化列表数据课程
  474. initDatasCourse () {
  475. CourseApi.getPageList(this.searchcourse)
  476. .then(res => {
  477. this.activitiescourse = res.records
  478. this.searchcourse.page.total = res.total
  479. })
  480. },
  481. formatStatus (row, column) {
  482. for (var i = 0; i < this.status.length; i++) {
  483. if (this.status[i].value === row.status) {
  484. return this.status[i].key
  485. }
  486. }
  487. },
  488. initSearchInfo () {
  489. this.search = {
  490. Title: '',
  491. Status: -1,
  492. Content: ''
  493. }
  494. },
  495. // 初始化分页分页对象
  496. initPageInfo () {
  497. this.search.page = {
  498. total: 0,
  499. current: 1,
  500. size: 10
  501. }
  502. },
  503. // // 打开 添加弹窗
  504. // openinformationadd () {
  505. // this.$refs.informationDialog.dialogvisible = true
  506. // },
  507. // // 打开 编辑弹窗
  508. // informationedit (informationId) {
  509. // this.informationId = informationId
  510. // this.$refs.informationDialog.dialogvisible = true
  511. // },
  512. // 新增修改弹窗关闭 返回页面
  513. // handleClose () {
  514. // this.informationId = -1
  515. // this.$refs.informationDialog.dialogvisible = false
  516. // this.initPageInfo()
  517. // this.initDatas()
  518. // },
  519. publish (information) {
  520. information.status = 1
  521. InformationApi.save(information)
  522. },
  523. // 初始化列表数据
  524. initDatas () {
  525. InformationApi.getList(this.search)
  526. .then(res => {
  527. this.activities = res.records
  528. this.search.page = res
  529. })
  530. },
  531. // 信息发布
  532. handleSizeChange (val) {
  533. this.search.page.size = val
  534. this.search.page.current = 1
  535. this.initDatas()
  536. },
  537. handleCurrentChange (val) {
  538. this.search.page.current = val
  539. this.initDatas()
  540. },
  541. // 课程管理
  542. handleSizeChange_course (val) {
  543. this.searchcourse.page.size = val
  544. this.searchcourse.page.current = 1
  545. this.initDatasCourse()
  546. },
  547. handleCurrentChange_course (val) {
  548. this.searchcourse.page.current = val
  549. this.initDatasCourse()
  550. },
  551. // 值班表
  552. handleSizeChangeduty (val) {
  553. this.searchduty.page.size = val
  554. this.searchduty.page.current = 1
  555. this.initDatas_duty()
  556. },
  557. handleCurrentChangeduty (val) {
  558. this.searchduty.page.current = val
  559. this.initDatas_duty()
  560. },
  561. searchCommand () {
  562. // this.initDatasCourse()
  563. },
  564. clearSearch () {
  565. this.searchcourse.Year = ''
  566. this.searchcourse.ClassId = ''
  567. this.initDatasCourse()
  568. },
  569. clearSearchduty () {
  570. this.searchduty.Year = ''
  571. this.searchduty.Term = ''
  572. this.searchduty.Title = ''
  573. this.initDatas_duty()
  574. }
  575. }
  576. }
  577. </script>
  578. <style lang="scss">
  579. .background_css {
  580. text-align: center;
  581. background: url("./image/background.png");
  582. width: 100%;
  583. min-height: 135px;
  584. height: 135px;
  585. margin: 0 auto;
  586. background-size: cover;
  587. }
  588. .intelligent1-img {
  589. width: 120px;
  590. }
  591. .login_bg5x {
  592. margin-top: 65px;
  593. margin-right: 40px;
  594. // padding-left: 40px;
  595. // float: left;
  596. }
  597. // .el-pagination {
  598. // margin: 1rem 0 2rem;
  599. // text-align: left;
  600. // }
  601. .plab {
  602. font-size: 13px;
  603. color: #999;
  604. }
  605. </style>