侧边栏、意见修改等

master
xy 2 years ago
parent 2de51a99ca
commit 5f974f59ba

@ -2,10 +2,6 @@
ENV = 'production'
# base api
#VUE_APP_BASE_API=http://192.168.60.78:9001/
#VUE_APP_UPLOAD_API=http://192.168.60.78:9001/api/admin/upload-file
#VUE_APP_OA_URL=http://192.168.60.18:2021
VUE_APP_BASE_API=http://diaoling-test.ali251.langye.net/
VUE_APP_UPLOAD_API=http://diaoling-test.ali251.langye.net/api/admin/upload-file
VUE_APP_OA_URL=http://suzhouhedaooa.langye.net
VUE_APP_BASE_API=http://192.168.60.78:9001/
VUE_APP_UPLOAD_API=http://192.168.60.78:9001/api/admin/upload-file
VUE_APP_OA_URL=http://192.168.60.18:2021

@ -38,6 +38,7 @@
"vue-awesome": "^4.5.0",
"vue-count-to": "^1.0.13",
"vue-esign": "^1.1.4",
"vue-matomo": "^4.2.0",
"vue-router": "3.0.6",
"vuedraggable": "^2.24.3",
"vuex": "3.1.0",

@ -6,6 +6,15 @@
<script>
export default {
name: 'App'
name: 'App',
watch: {
$route(to, from) {
let locationHash = window.location.hash;
this.$matomo.setCustomUrl(locationHash.replace(/#/g, ''));
this.$matomo.trackPageView(to.meta.title) //
}
}
}
</script>

@ -100,6 +100,26 @@ audio.src = noticeAudio;
Vue.prototype.$audioPlay = () => {
audio.play()
}
import VueMatomo from 'vue-matomo'
Vue.use(VueMatomo, {
host: 'http://192.168.60.99:9000/', // 这里配置你自己的piwik服务器地址和网站ID
siteId: 8,//siteId值
// 根据router自动注册
router: router,
// // 是否需要在发送追踪信息之前请求许可
// // 默认false
requireConsent: false,
enableLinkTracking: true,
// // 是否追踪初始页面
// // 默认true
trackInitialView: false,
// // 最终的追踪js文件名
// // 默认 'piwik'
trackerFileName: 'matomo',
debug: false
});
new Vue({
el: '#app',
router,

@ -3,8 +3,9 @@ import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import { getToken } from '@/utils/auth' // get token from cookie
import { getToken, setToken } from '@/utils/auth' // get token from cookie
import getPageTitle from '@/utils/get-page-title'
import { deepCopy } from "@/utils"
NProgress.configure({ showSpinner: false }) // NProgress Configuration
@ -13,23 +14,24 @@ const whiteList = ['/login'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
// start progress bar
NProgress.start()
// set page title
document.title = getPageTitle(to.meta.title)
// determine whether the user has logged in
const hasToken = getToken()
if (to.query.tourl) {
await store.dispatch('app/toggleDevice',"mobile")
await store.dispatch('app/closeSideBar',false)
}
if (hasToken) {
if (to.path === '/login') {
// if is logged in, redirect to the home page
next({ path: '/' })
NProgress.done()
} else {
// determine whether the user has obtained his permission roles through getInfo
const hasRoles = store.getters.roles && store.getters.roles.length > 0
if (hasRoles) {
next()
to.query.tourl ? next(to.query.tourl) : next()
} else {
try {
// get user info
@ -45,7 +47,11 @@ router.beforeEach(async(to, from, next) => {
// hack method to ensure that addRoutes is complete
// set the replace: true, so the navigation will not leave a history record
next({ ...to, replace: true })
let resetTo = deepCopy(to)
resetTo.path = to.query.tourl || to.path
resetTo.replace = true
console.log(resetTo)
next(resetTo)
} catch (error) {
console.log(error)
// remove token and go to login page to re-login
@ -58,31 +64,33 @@ router.beforeEach(async(to, from, next) => {
}
} else {
/* has no token*/
if (to.query.token && to.query.tp) {
try {
await store.dispatch('user/loginskip', {
token: to.query.token,
tp: to.query.tp
})
next(to.query.tourl ? to.query.tourl : '/')
} catch (e) {
next('/login')
}
return
}
if (whiteList.indexOf(to.path) !== -1) {
// in the free login whitelist, go directly
next()
} else {
// other pages that do not have permission to access are redirected to the login page.
next(`/login?redirect=${to.path}`)
NProgress.done()
if (to.query.token && to.query.tp) {
try {
await store.dispatch('user/loginskip', {
token: to.query.token,
tp: to.query.tp
})
next(to.query.tourl || '/')
} catch (e) {
next('/login')
}
} else {
// other pages that do not have permission to access are redirected to the login page.
next(`/login?redirect=${to.path}`)
NProgress.done()
}
}
}
NProgress.done()
})
router.afterEach(() => {
// finish progress bar
store.dispatch('app/toggleDevice',"mobile")
store.dispatch('app/closeSideBar',false)
NProgress.done()
})

@ -5,7 +5,7 @@ const state = {
opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
withoutAnimation: false
},
device: 'desktop'
device: 'mobile'
}
const mutations = {

@ -1,7 +1,7 @@
import { show } from "@/api/system/customForm";
import { getparameter } from "@/api/system/dictionary";
import { index as baseFormIndex } from "@/api/system/baseForm";
import { listCommondepartment } from "@/api/common";
import { listCommondepartment, listCommonuser } from "@/api/common";
export async function resolveFormInfo(customFormId,filterType = 'table') {
const res = await show({ id: customFormId }, false);
@ -18,7 +18,15 @@ export async function resolveFormInfo(customFormId,filterType = 'table') {
return res.data;
},
],
["admins", []],
["admins",
async () => {
const res = await listCommonuser({
page: 1,
page_size: 999
});
return res.data;
}
],
]);
let { fields, relation } = res;
let fieldRes = fields.filter(i => {

@ -136,7 +136,7 @@ export default {
},
submit() {
this.smsForm.content = this.form.content
this.smsForm.content = `${ this.$refs['elEdit_feedback_department_id']?.selectedLabel ? this.$refs['elEdit_feedback_department_id'].selectedLabel + '-' : '' }${ this.$refs['elEdit_feedback_admin_id']?.selectedLabel ? this.$refs['elEdit_feedback_admin_id'].selectedLabel + '-' : '' }${ this.form.content }`
if (this.type === "add") {
this.form.transfer_id = this.transfer_id;
if (this.form.hasOwnProperty("id")) {

@ -66,9 +66,11 @@
<div class="step-label">{{ s.label }}</div>
</div>
</div>
<Button type="primary" size="small" class="list-item__btn" @click="stepClick(item,{},true)"></Button>
<Button type="primary" size="small" class="list-item__btn" @click="$emit('callback',item)"></Button>
<Icon v-if="isShowNotice(item)" type="md-alert" color="#db4f2b" class="list-item__callback" @click="$emit('callbackList',item)"/>
<div class="list-item__btn">
<Button type="primary" size="small" class="list-item__btn-show" @click="stepClick(item,{},true)"></Button>
<Button type="primary" size="small" class="list-item__btn-feedback" @click="$emit('callback',item)"></Button>
<Icon v-if="isShowNotice(item)" type="md-alert" color="#db4f2b" class="list-item__btn-callback" @click="$emit('callbackList',item)"/>
</div>
</div>
</transition-group>
</div>
@ -506,25 +508,31 @@ $list-height: calc(#{$container-height} - 5.33rem);
}
}
&__btn {
font-size: 1.3rem;
height: 2.4rem;
width: 5rem;
background: #a4ddf0;
color: #333;
border-color: #a4ddf0;
}
&__callback {
font-size: 2.2rem;
margin-left: 6px;
animation: flash 5s infinite linear;
cursor: pointer;
@keyframes flash {
0%,4%,100% {
opacity: 1;
}
2% {
opacity: 0;
display: flex;
align-items: center;
flex-basis: 12%;
&-show, &-feedback {
font-size: 1.3rem;
height: 2.4rem;
width: 5rem;
background: #a4ddf0;
color: #333;
border-color: #a4ddf0;
}
&-callback {
font-size: 2.2rem;
margin-left: 6px;
animation: flash 5s infinite linear;
cursor: pointer;
@keyframes flash {
0%,4%,100% {
opacity: 1;
}
2% {
opacity: 0;
}
}
}
}

@ -11,7 +11,7 @@
</div>
</div>
<tomorrow ref="tomorrow" :tomorrows="tomorrows"></tomorrow>
<tomorrow ref="tomorrow" :tomorrows="tomorrows" @step-click="e => $emit('step-click', e)"></tomorrow>
</div>
</template>

@ -66,9 +66,11 @@
<div class="step-label">{{ s.label }}</div>
</div>
</div>
<Button type="primary" size="small" class="list-item__btn" @click="stepClick(item,{},true)"></Button>
<Button type="primary" size="small" class="list-item__btn" @click="$emit('callback',item)"></Button>
<Icon v-if="isShowNotice(item)" type="md-alert" color="#db4f2b" class="list-item__callback" @click="$emit('callbackList',item)"/>
<div class="list-item__btn">
<Button type="primary" size="small" class="list-item__btn-show" @click="stepClick(item,{},true)"></Button>
<Button type="primary" size="small" class="list-item__btn-feedback" @click="$emit('callback',item)"></Button>
<Icon v-if="isShowNotice(item)" type="md-alert" color="#db4f2b" class="list-item__btn-callback" @click="$emit('callbackList',item)"/>
</div>
</div>
</transition-group>
</div>
@ -525,25 +527,31 @@ $list-height: calc(#{$container-height} - 5.33rem);
}
}
&__btn {
font-size: 1.3rem;
height: 2.4rem;
width: 5rem;
background: #a4ddf0;
color: #333;
border-color: #a4ddf0;
}
&__callback {
font-size: 2.2rem;
margin-left: 6px;
animation: flash 5s infinite linear;
cursor: pointer;
display: flex;
align-items: center;
flex-basis: 12%;
@keyframes flash {
0%,4%,100% {
opacity: 1;
}
2% {
opacity: 0;
&-show, &-feedback {
font-size: 1.3rem;
height: 2.4rem;
width: 5rem;
background: #a4ddf0;
color: #333;
border-color: #a4ddf0;
}
&-callback {
font-size: 2.2rem;
margin-left: 6px;
animation: flash 5s infinite linear;
cursor: pointer;
@keyframes flash {
0%,4%,100% {
opacity: 1;
}
2% {
opacity: 0;
}
}
}
}

@ -27,6 +27,15 @@
执行时间{{ timeFormat(item.start_time) }}{{ timeFormat(item.end_time,'HH:mm') }}
</div>
<div class="list-item__last">预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours', true).toFixed(2) }}小时</div>
<div class="list-item__operate">
<div v-for="(s, si) in status" :title="operateTitle(item, s)" class="step" @click="stepClick(item,s)">
<div class="step-icon">
<div class="step-icon__cir" :class="`step-icon__cir-${stepFormat(item.status,s.value)}`"></div>
<div class="step-icon__line" :class="`step-icon__line-${stepFormat(item.status,s.value)}`" v-if="si < status.length-1"></div>
</div>
<div class="step-label">{{ s.label }}</div>
</div>
</div>
</div>
</div>
</template>
@ -62,15 +71,7 @@ export default {
{
value: 4,
label: "开机"
},
{
value: 5,
label: "通知关机"
},
{
value: 6,
label: "关机"
},
}
],
statusType: [
{
@ -97,6 +98,7 @@ export default {
this.drawer = false;
},
stepClick (item,s,isDetail=false) {
if (s.value !== 2) return
if (isDetail) {
this.$emit('step-click', {
data: item,
@ -155,6 +157,20 @@ export default {
}
},
operateTitle () {
return function (item, s) {
switch (s.auth) {
case 'receive':
return item.receive_time
case 'noticeOpen':
return item.notice_open_time
case 'open':
return item.open_time
default:
return ''
}
}
}
},
}
</script>

@ -1,7 +1,7 @@
<template>
<div id="big-screen" ref="appRef">
<topBackground></topBackground>
<Title @show-done="$refs['done'].show()"></Title>
<Title ref="title" @show-done="$refs['done'].show()" @step-click="stepClick"></Title>
<toDo ref="toDo"
@step-click="stepClick"
@callbackList="({ id }) => {
@ -28,7 +28,7 @@
<detailTransfer ref="detailTransfer"
@start="start"
@pause="pause"
@refresh="getTransfer(true)"></detailTransfer>
@refresh="getTransfer(true),$refs['title'].getTomorrow()"></detailTransfer>
<callback ref="callback" @refresh="getTransfer(true)"></callback>
<callbackList ref="callbackList" @refresh="getTransfer(true)"></callbackList>
</div>
@ -86,6 +86,7 @@ export default {
time: this.$moment(),
timer: null,
transferTimer: null,
feedbackTimer: null,
}
},
methods: {
@ -119,6 +120,36 @@ export default {
window.requestAnimationFrame(this.setRem)
},
async getFeedback () {
const res = (
(await index({
table_name: "feedbacks",
page: 1,
page_size: 9999,
filter: [
{
key: "created_at",
op: "range",
value: `${this.forwardRefreshTime.format('YYYY-MM-DD HH:mm:ss')},${this.$moment().format('YYYY-MM-DD HH:mm:ss')}`
},
{
key: "status",
op: "eq",
value: "1"
}
]
},false)
).data);
res.forEach(i => {
console.log(i)
this.$notify({
title: i.equipment?.name || '调令反馈',
message: `${ i.feedback_department_id_departments_id_relation?.name ? i.feedback_department_id_departments_id_relation?.name + '-' : '' }${ i.feedback_admin_id_admins_id_relation?.name ? i.feedback_admin_id_admins_id_relation?.name + '-' : '' }${ i.content }`,
type: 'warning'
});
})
},
async getTransfer(isFirst = false) {
if (isFirst) {
this.forwardRefreshTime = this.$moment();
@ -194,6 +225,7 @@ export default {
this.getTransfer(true);
this.transferTimer = setInterval(() => {
this.getTransfer()
this.getFeedback()
},refreshTransferTime)
},
mounted() {

@ -277,7 +277,7 @@ export default {
const _this = this;
const text = row.equipment ? row.equipment.name : "";
const num = this.dispatches.reduce((pre, cur) => {
return (cur.equipment_id === row.equipment_id && cur.status !== 7 && cur.status !== 0)
return (cur.equipment_id === row.equipment_id && cur.status !== 7 && cur.status !== 0 && cur.status > 1)
? ++pre
: pre;
}, 0)
@ -1054,9 +1054,9 @@ export default {
this.$emit("createdTransfer")
this.$bus.$emit("createdTransfer");
if (isNeed) {
this.$router.push('/dispatch/handle')
}
// if (isNeed) {
// this.$router.push('/dispatch/handle')
// }
this.$store.commit('app/CLOSE_SIDEBAR')
})
.catch((_) => {

@ -120,6 +120,11 @@ export default {
key: "equipment_id",
op: "eq",
value: ""
},
{
key: "status",
op: "eq",
value: 1
}
]
},
@ -176,7 +181,7 @@ export default {
width: 100,
align: "center",
key: "last",
render: (h,{ row }) => h('span', this.$moment(row.end_time).diff(this.$moment(row.start_time),'hours',true) + '小时')
render: (h,{ row }) => h('span', this.$moment(row.end_time).diff(this.$moment(row.start_time),'hours',true).toFixed(2) + '小时')
},
{
title: "结束时间",
@ -364,29 +369,7 @@ export default {
style: {
'display': 'flex'
}
},[
h(
"Button",
{
style: {
'margin-left': '6px'
},
props: {
type: "primary",
size: "small",
},
on: {
'click': () => {
this.$refs['callback'].setId(row.id);
this.$refs['callback'].setType('add');
this.$refs['callback'].show();
}
}
},
"反馈"
),
...auths.map(i => (btnMap.get(i)))
]);
},auths.map(i => (btnMap.get(i))));
},
},
],

@ -49,7 +49,7 @@
</div>
<div class="dispatch panel">
<div class="title">已创建调令</div>
<div class="title">已创建待下发调令</div>
<div class="point-container">
<Card class="point-container__card">

@ -326,7 +326,7 @@ import { show } from "@/api/system/customForm";
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import { listdept } from "@/api/system/department";
import { listCommondepartment } from "@/api/common";
import { listCommondepartment, listCommonuser } from "@/api/common";
import LxHeader from "@/components/LxHeader/index.vue";
import headerContent from "@/components/LxHeader/XyContent.vue";
@ -364,7 +364,13 @@ export default {
customFormId: "",
tableName: "",
},
resetTable: new Map()
resetTable: new Map([
["transfer_id",{
prop: "equipment.name",
label: "点位",
width: 160
}]
])
};
},
methods: {
@ -510,7 +516,15 @@ export default {
return res.data;
},
],
["admins", []],
["admins",
async () => {
const res = await listCommonuser({
page: 1,
page_size: 999
});
return res.data;
},
],
]);
let { fields, relation } = res;
let fieldRes = fields.sort((a, b) => a.sort - b.sort);
@ -644,31 +658,21 @@ export default {
let alignLeft = [];
if (this.resetTable.get(i.field)) {
this.table.push(Object.assign(
{
prop: i.field,
label: i.name,
width: i.width,
align: alignLeft.find((m) => m === i.field) ? "left" : "center",
fixed: i.is_fixed,
},
linkOb,
this.resetTable.get(i.field)
))
return
this.table.push(this.resetTable.get(i.field))
} else {
this.table.push(
Object.assign(
{
prop: i.field,
label: i.name,
width: i.width,
align: alignLeft.find((m) => m === i.field) ? "left" : "center",
fixed: i.is_fixed,
},
linkOb
)
);
}
this.table.push(
Object.assign(
{
prop: i.field,
label: i.name,
width: i.width,
align: alignLeft.find((m) => m === i.field) ? "left" : "center",
fixed: i.is_fixed,
},
linkOb
)
);
});
this.table.unshift({
type: "index",

@ -23,7 +23,12 @@
format="yyyy-MM-dd"
style="width: 240px;"
></el-date-picker>
<Select clearable v-model="select.filter[1].value" placeholder="请选择类别" style="width: 140px;margin-left: 6px;">
<Select multiple
clearable
:max-tag-count="1"
v-model="abilityTemp"
placeholder="请选择类别"
style="width: 200px;margin-left: 6px;" @on-change="abilityChange">
<Option v-for="item in abilities" :value="item.value">{{ item.key }}</Option>
</Select>
<Select clearable v-model="selectArea" placeholder="请选择范围" style="width: 140px;margin-left: 6px;">
@ -387,6 +392,7 @@ export default {
return {
areas: [],
abilities: [],
abilityTemp: [],
window: {
width: 0,
height: 0,
@ -454,6 +460,10 @@ export default {
};
},
methods: {
abilityChange (value) {
this.select.filter[1].value = value.toString()
},
handleCheckChange (data, checked, indeterminate) {
this.treeValue = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.name).toString()
this.select.filter[3].value = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.id)

@ -281,7 +281,7 @@ export default {
new Paragraph({
spacing: {
before: 200,
line: 200
line: 300
},
indent: {
firstLine: convertInchesToTwip(0.5)
@ -296,13 +296,13 @@ export default {
size: 18
}),
new TextRun({
text: `\n内容${i1.content}`,
text: `\n内容${i1.content || ''}`,
size: 18
})
]
})
]
))
)).flat()
]
)).flat()
]
@ -311,7 +311,7 @@ export default {
})
const blob = await Packer.toBlob(document)
saveAs(blob, `${this.$moment().format('YYYY-MM-DD')}调令.docx`)
saveAs(blob, `${this.$moment(this.selectDate).format('YYYY-MM-DD')}调令.docx`)
}
},
computed: {

Loading…
Cancel
Save