123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775 |
- <template>
- <div id="home">
-
- <a-row :gutter="24" class="firstLine">
-
- <a-col :xs="24" :sm="24" :md="24" :lg="6" :style="{ marginBottom: '8px', paddingRight: 0 }">
-
- <a-card title="我的" style="width: 100%;" :bordered="false" :style="{ marginBottom: '8px', height: '250px' }">
- <a-row :gutter="24">
-
- <a-col :xs="24" :sm="24" :md="12" :lg="15">
- <a-row :gutter="24">
- <a-col :xs="24" :sm="24" :md="12" :lg="7">
- <div class="userImg" style="margin-left: -10px;">
- <img v-if="avatarUrl == '1'" src="../../assets/user.jpg" width="50px;" />
- <img v-if="avatarUrl == '2'" src="../../assets/user_girl.png" width="50px;" />
- <img v-if="avatarUrl != '1' && avatarUrl != '2'" :src="avatarUrl" width="50px;" height="52px;" />
-
- </div>
- </a-col>
- <a-col :xs="24" :sm="24" :md="12" :lg="17">
- <div class="userInfo">
- <span>{{ userInfo.realname }}</span>
- <p>账号:{{ userInfo.username }}</p>
- <em>Tel:{{ userInfo.phone }}</em>
- </div>
- </a-col>
- </a-row>
- </a-col>
-
- <a-col :xs="24" :sm="24" :md="12" :lg="9" class="msgBox">
- <span> {{ todoList.length }}</span>
- <p>我的待办</p>
- <span>{{ msgTotal }}</span>
- <p>系统消息</p>
- </a-col>
- </a-row>
- </a-card>
- </a-col>
-
-
-
- <a-col :xs="24" :sm="24" :md="24" :lg="11" :style="{ marginBottom: '8px', paddingRight: 0, }">
- <MyoaTabs />
- </a-col>
-
-
-
- <a-col :xs="24" :sm="24" :md="24" :lg="7" :style="{ marginBottom: '8px',}">
-
- <a-card title="常用流程" :bordered="false" style="height: 250px;">
-
- <div v-for="(item, index) in activeKeyAll.slice(0, 6)" :key="index" class="oaBig">
- <a @click.prevent="aClick(item)" class="oaItem fl">
-
- <a-avatar shape="square" :size="36" :src="item.iconAddress" />
- <h4>{{ item.name }}</h4>
- </a>
- </div>
- </a-card>
- </a-col>
- </a-row>
-
- <a-row :gutter="24" class="secondLine">
-
-
-
- <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="9" :style="{ marginBottom: '8px', paddingRight: 0, }">
- <a-card title="企业公告" :bordered="false" style="height:400px;">
- <template #extra>
-
-
- <a href="javascript:void(0);" @click="()=>modal.visible=true">更多</a>
- </template>
- <div class="dataV">
- <dv-scroll-board class="board" :config="config" style="cursor: pointer;height:280px;" @click="getMethod" />
- </div>
- </a-card>
- </a-col>
-
- <div>
- <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="7" :style="{ marginBottom: '8px' }">
- <a-row :gutter="24">
-
-
-
- {{ mlp }}
- {{ mtp }}
- {{ olp }}
- {{ otp }}
-
-
- <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" :style="{ marginBottom: '8px', paddingRight: 0 }">
- <a-card title="友情链接" :bordered="false" style="width:100%;height:400px">
- <template #extra><a href="javascript:void(0);" @click="()=>modal1.visible=true">更多</a></template>
- <template #extra><a href="javascript:void(0);" @click="openMyLinks">更多</a></template>
- <div v-for="item in linksList.slice(0, 8)" :key="item.id" class="links">
- <button class="itemLink">
- <a href="#" @click="openItemLink(item)">
- <span width="2em" style='color:#5c5c5c'> {{ item.name }}</span>
- </a>
- </button>
- </div>
- </a-card>
- </a-col>
- </a-row>
- </a-col>
-
- <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8" :style="{ marginBottom: '8px' }">
- <a-card title="日程" :bordered="false" class="dataStyle">
- <template #extra>
- <a href="javascript:void(0);" @click="openCalTab">详情</a>
- </template>
- <a-row :gutter="24">
-
- <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
- <div class="ccfullCalendar">
- <FullCalendar :options="calendarOptions" class="eventDeal-wrap" />
- </div>
- </a-col>
- </a-row>
- </a-card>
- </a-col>
- </div>
- </a-row>
-
- <a-modal v-model="lcModal.visible" :title="lcModal.title" :footer="null" :maskClosable="false" width="90%">
- <component
- :disabled="lcModal.disabled"
- v-if="lcModal.visible"
- :is="lcModal.formComponent"
- :processData="lcModal.processData"
- :isNew="lcModal.isNew"
- @afterSubmit="afterSub"
- @close=";(lcModal.visible = false), (lcModal.disabled = false)"
- >
- </component>
- </a-modal>
-
- <detAnn-modal ref="DetAnnModal" @ok="modalFormOk" :fatherData="annDetail" style="z-index: 111;"></detAnn-modal>
-
- <j-modal
- :visible.sync="modal.visible"
- :width="1300"
- :title="modal.title"
- :fullscreen.sync="modal.fullscreen"
- :switchFullscreen="modal.switchFullscreen"
- >
-
-
- <a-table :columns="columns" id="Notice" :dataSource="annList" style="height:280px;" :customRow="clickRow" :pagination ='false' :showHeader="false" :bordered="false"></a-table>
-
-
- </j-modal>
-
- <j-modal
- :visible.sync="modal1.visible"
- :width="1300"
- :title="modal1.title"
- :fullscreen.sync="modal1.fullscreen"
- :switchFullscreen="modal1.switchFullscreen"
- >
-
- <div v-for="item in linksList.slice(0, 8)" :key="item.id" class="links">
- <button class="itemLink">
- <a href="#" @click="openItemLink(item)">
- <span width="2em"> {{ item.name }}</span>
- </a>
- </button>
- </div>
-
- </j-modal>
- </div>
- </template>
- <script>
- import Vue from 'vue'
- import MyoaTabs from '@views/dashboard/MyoaTabs.vue'
- import DetAnnModal from '@views/oa/enter-ann/add/detAnnModal.vue'
- import { mapGetters } from 'vuex'
- import { getAction } from '@/api/manage'
- import FullCalendar from '@fullcalendar/vue'
- import dayGridPlugin from '@fullcalendar/daygrid'
- import interactionPlugin from '@fullcalendar/interaction'
- import timeGridPlugin from '@fullcalendar/timegrid'
- import SchedulePlan from '@views/oa/my-plan/schedulePlan'
- import { scheduleGetListByTime, scheduleQueryById, scheduleGetLastMonth } from '@api/oa/cd-schedule'
- import { enterpriseEQueryById } from '@api/oa/cd-enterprise-announcement'
- import { enterpriseEList } from '@api/oa/cd-enterprise-announcement'
- import '@fullcalendar/daygrid/main.css'
- import JEditor from '../../components/jeecg/JEditor.vue'
- import '@/assets/less/dataVTable.less'
- import { getUserPermissionByTokenBottom, getListByCreateBy } from '@api/api.js'
- import { ACCESS_TOKEN } from '@/store/mutation-types'
- import { linksList } from '@api/oa/cd_links.js'
- export default {
- name: 'Mytodo',
- components: {
- FullCalendar,
- JEditor,
- DetAnnModal,
- MyoaTabs
- },
- data() {
- return {
- mlp: '',
- mtp: '',
- olp: '',
- otp: '',
- modal: {
- title: '企业公告',
- visible: false,
- fullscreen: false,
- switchFullscreen: true,
- },
- modal1: {
- title: '友情链接',
- visible: false,
- fullscreen: false,
- switchFullscreen: true,
- },
- menuALL: [],
- columns:[
- {
- title:'title',
- align:"left",
- ellipsis: true,
- dataIndex: 'title',
- width:600
- },
- {
- title:'createBy',
- align:"left",
- ellipsis: true,
- dataIndex: 'createBy',
- width:300
- },
- {
- title:'releaseTime',
- align:"left",
- ellipsis: true,
- dataIndex: 'releaseTime',
- width:400
- },
- ],
-
- annDetail: {},
- annList: [],
- linksList: [],
- config: {},
-
- calendarOptions: {
-
- events: [
- {
- title: '啦啦啦啦',
- start: '2021-10-13T14:30:00',
- end: '2021-10-13T14:30:00',
- extendedProps: {
- status: 'done'
- },
- backgroundColor: '#ccd5ae',
- borderColor: 'red'
- }
- ],
-
- editable: true,
- eventStartEditable: true,
- eventDurationEditable: true,
- selectable: true,
- selectMirror: true,
- selectMinDistance: 0,
- weekends: true,
- navLinks: false,
- selectHelper: false,
- selectEventOverlap: false,
- dayMaxEvents: true,
- dateClick: this.handleDateClick,
- eventsSet: this.handleEvents,
- eventClick: this.handleEventClick,
- eventDrop: this.handleEventDrop,
- eventResize: this.eventResize,
-
- plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
-
- headerToolbar: {
-
- left: '',
- center: '',
- right: ''
- },
-
-
-
-
- initialView: 'dayGridMonth',
- locale: 'zh-ch',
- firstDay: '1',
- weekNumberCalculation: 'ISO',
-
- timeGridEventMinHeight: '20',
-
- displayEventTime: false,
- allDaySlot: false,
- eventLimit: true,
- eventTimeFormat: {
- hour: 'numeric',
- minute: '2-digit',
- hour12: false
- },
- slotLabelFormat: {
- hour: '2-digit',
- minute: '2-digit',
- meridiem: false,
- hour12: false
- }
- },
- userInfo: this.$store.getters.userInfo,
- todoList: [],
- activeKeyAll: [],
- msg1Count: '0',
- msg2Count: '0',
- url: {
- listCementByUser: '/sys/annountCement/listByUser'
- },
-
- lcModal: {
- title: '',
- visible: false,
- disabled: false,
- formComponent: null,
- isNew: false
- },
- data: [],
- total: 0,
- ipagination: {
- current: 1,
- pageSize: 3,
- pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 共' + total + '条'
- },
- showQuickJumper: true,
- showSizeChanger: true,
- total: 0
- },
- avatarUrl:'1'
- }
- },
- created() {
- this.getScheduleData()
- this.getDataList()
- this.getActiveKeyAll()
- this.getAnnList()
- this.getFooterNav()
- this.getMyLinks()
- this.getMyPlan()
- let domianURL = window._CONFIG['domianURL'] + '/sys/common/static';
-
-
-
- let avatar = this.userInfo.avatar;
- let sex = this.userInfo.sex;
- if(avatar == null || avatar == '' || avatar == '[]' || avatar == []){
- if(sex == '2'){
- this.avatarUrl = '2'
- }else{
- this.avatarUrl = '1'
- }
- }else{
- this.avatarUrl = domianURL +'/'+ this.userInfo.avatar
- }
- },
- computed: {
-
- msgTotal() {
- return parseInt(this.msg1Count) + parseInt(this.msg2Count)
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- mounted() {
- this.loadData()
- this.getAnnList()
- },
- methods: {
-
- getMyPlan() {
- return new Promise(resolve => {
-
-
- scheduleGetLastMonth({ createBy: this.userInfo.username, whereTimeType: '1' }).then(res => {
- console.log('上月我计划res', res)
-
- if (res.success) {
- this.mlp = res.result
- }
- resolve()
- })
-
- scheduleGetLastMonth({ createBy: this.userInfo.username, whereTimeType: '2' }).then(res => {
- console.log('本月我计划', res)
- if (res.success) {
- this.mtp = res.result
- }
- resolve()
- })
-
- scheduleGetLastMonth({ createBy: !this.userInfo.username, whereTimeType: '1' }).then(res => {
- console.log('上月他计划', res)
- if (res.success) {
-
- this.olp = res.result
- }
- resolve()
- })
-
- scheduleGetLastMonth({ createBy: !this.userInfo.username, whereTimeType: '2' }).then(res => {
- console.log('本月他计划', res)
- if (res.success) {
-
- this.otp = res.result
- }
- resolve()
- })
- })
- },
-
- openItemLink(e) {
- window.open(e.link, '_blank')
- console.log('e.link', e.link)
- },
-
- async getMyLinks() {
-
-
- await linksList({ isRelease: '1' }).then(res => {
- console.log('友情链接后台返回结果', res)
- this.linksList = res.result.records
- console.log('this.linksList', this.linksList)
- })
- },
-
- async getFooterNav() {
- await getListByCreateBy().then(res => {
- if (res.success) {
- console.log('底部快捷菜单', res)
- this.selectList = res.result
- }
- })
- },
-
- async getAnnList() {
- await enterpriseEList({ isRelease: '1', pageSize: 1000 }).then(res => {
- if (res.success) {
-
- this.annList = res.result.records
- let scrollData = []
-
- this.annList.map((item,index) => {
- if(index<8){
-
- var annType = ''
- if (item.type == '人事') {
- annType =
- '<span style="color:rgba(128, 0, 128,.3);border:1px solid rgba(128, 0, 128,.3);padding:0 4px;border-radius:3px;">人事</span>'
- }
- if (item.type == '财务') {
- annType =
- '<span style="color:rgba(19, 194, 197,.6);border:1px solid rgba(19, 194, 197,.6);padding:0 4px;border-radius:3px;">财务</span>'
- }
- if (item.type == '项目') {
- annType =
- '<span style="color:rgba(255, 165, 0,.8);border:1px solid rgba(255, 165, 0,.8);padding:0 4px;border-radius:3px;">项目</span>'
- }
- var list = [item.id, item.title, item.createBy, item.releaseTime]
- scrollData.push(list)
- }
- })
-
- this.config = {
- oddRowBGC: 'white',
- evenRowBGC: 'white',
- columnWidth: [50, 600, 300, 400],
- align: ['center'],
- rowNum: 8,
- waitTime: 2000,
- data: scrollData
- }
- }
- })
- },
-
- getMethod(item) {
- this.$refs.DetAnnModal.annVisible = true
-
- this.$nextTick(() => {
- enterpriseEQueryById({ id: item.row[0] }).then(res => {
- this.$refs.DetAnnModal.annVisible = true
- if (res.success) {
- console.log(res.result)
- this.annDetail = res.result
- }
- })
- })
- },
-
- getScheduleData() {
- this.$nextTick(() => {
-
- scheduleGetListByTime(null).then(res => {
- if (res.success) {
-
- let list = res.result
- var eventList = []
-
- list.forEach(e => {
- let Object = {
- title: e.title,
- start: e.startTime,
- end: e.endTime,
- id: e.id,
- backgroundColor: e.backgroundColor,
- extendedProps: {
- status: 'done'
- },
- borderColor: 'none'
- }
- eventList.push(Object)
- })
-
-
- this.calendarOptions.events = eventList
- }
- })
- })
- },
-
- async getDataList() {
- this.loading = true
- await this.postFormAction('/actTask/todoList', {}).then(res => {
- this.loading = false
- if (res.success) {
- this.todoList = res.result || []
-
- this.total = this.data.leading
-
- }
- })
- },
-
- async getActiveKeyAll() {
- await this.postFormAction('/activiti_process/listData', { status: 1, roles: true }).then(res => {
- this.activeKeyAll = []
- if (res.success) {
- var result = res.result || []
- if (result.length > 0) {
- this.activeKeyAll = result
- }
- }
- })
- },
- handleEvents(info) {
-
-
-
- },
-
- handleDateClick(selectInfo) {
- this.$router.push('/oa/my-plan/schedulePlan')
- },
-
- openEnterAnn() {
- this.$router.push('/oa/enterpriseAnnouncement')
- },
-
- openMyLinks() {
- this.$router.push('/oa/myLinks')
- },
-
- openCalTab() {
- this.$router.push('/oa/my-plan/calTable')
- },
-
- loadData() {
- try {
-
- getAction(this.url.listCementByUser)
- .then(res => {
- if (res.success) {
- this.msg1Count = res.result.anntMsgTotal
- this.msg2Count = res.result.sysMsgTotal
-
- }
- })
- .catch(error => {
- console.log('系统消息通知异常', error)
- this.stopTimer = true
- console.log('清理timer')
- })
- } catch (err) {
- this.stopTimer = true
- console.log('通知异常', err)
- }
- },
- ...mapGetters(['nickname', 'avatar']),
-
- aClick(v) {
- console.log(v)
- if (!v.routeName) {
- this.$message.warning('该流程信息未配置表单,请联系开发人员!')
- return
- }
- if (v.routeName.indexOf('外部表单') != -1) {
- alert('调用其他项目页面')
- } else if (v.routeName.indexOf('自定义') != -1) {
- this.lcModal.disabled = false
- let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
- this.lcModal.formComponent = com.component
- this.lcModal.title = '发起流程:' + v.name
- this.lcModal.isNew = true
- this.lcModal.processData = v
- this.lcModal.visible = true
- } else {
- this.lcModal.disabled = false
- this.lcModal.formComponent = this.getFormComponent(v.routeName).component
- this.lcModal.title = '发起流程:' + v.name
- this.lcModal.isNew = true
- this.lcModal.processData = v
- this.lcModal.visible = true
- }
- console.log('发起', v)
- },
-
- afterSub(formData) {
- this.lcModal.visible = false
- },
-
- handleTableChange(pagination, filters, sorter) {
- if (Object.keys(sorter).length > 0) {
- this.isorter.column = sorter.field
- this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
- }
- this.ipagination = pagination
-
- },
-
- toDealWith() {
- this.$router.push({ path: '/activiti/todoManage' })
- },
- prev() {
- this.calendarApi.prev()
- console.log(this.calendarApi.prev)
- },
- modalFormOk() {},
- clickRow(record){
- return {
- on: {
- click: () => {
- this.$refs.DetAnnModal.annVisible = true
-
- this.$nextTick(() => {
- enterpriseEQueryById({ id: record.id}).then(res => {
- this.$refs.DetAnnModal.annVisible = true
- if (res.success) {
- console.log(res.result)
- this.annDetail = res.result
- }
- })
- })
- }
- }
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- @import '~@assets/less/common.less';
- // 单独首页样式
- @import '~@assets/less/mytodo.less';
- .contain {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- width: 100%;
- background: rgba(255, 255, 255, 0.3);
- }
- #home .secondLine .links .itemLink{
- background-color: #f5f5f5 !important ;
- }
- /deep/.ant-table-tbody .ant-table-row td {
- padding: 8px 8px !important;
- border-bottom:none !important;
- }
- </style>
|