diff --git a/.env.tests b/.env.tests new file mode 100644 index 0000000..62f65e2 --- /dev/null +++ b/.env.tests @@ -0,0 +1,11 @@ +# just a flag +ENV='tests' + +# 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 diff --git a/package.json b/package.json index 25fa77b..763529a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "author": "Pan ", "scripts": { "dev": "vue-cli-service serve", + "dev:prod": "vue-cli-service serve --mode production", "build:prod": "vue-cli-service build", + "build:tests": "vue-cli-service build --mode tests", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", diff --git a/src/api/common.js b/src/api/common.js index 02c7993..c772c69 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -4,11 +4,12 @@ import request from '@/utils/request' -export function listCommondepartment(params) { +export function listCommondepartment(params,isLoading) { return request({ url: '/api/admin/other/admin-department-list', method: 'get', - params:params + params:params, + isLoading: false }) } diff --git a/src/api/other/index.js b/src/api/other/index.js index 9683b8a..eb9c4ae 100644 --- a/src/api/other/index.js +++ b/src/api/other/index.js @@ -34,3 +34,12 @@ export function equipmentInfos (params) { isLoading: false }) } + +export function checkTransfer (params) { + return request({ + url: "/api/admin/other/check", + method: "get", + params, + isLoading: false + }) +} diff --git a/src/assets/notice.mp3 b/src/assets/notice.mp3 new file mode 100644 index 0000000..6efd0f9 Binary files /dev/null and b/src/assets/notice.mp3 differ diff --git a/src/main.js b/src/main.js index 1b09e5c..15796e4 100644 --- a/src/main.js +++ b/src/main.js @@ -94,6 +94,12 @@ Vue.prototype.$integrateData = (target,value) => { import dataV from '@jiaminghi/data-view'; Vue.use(dataV); +import noticeAudio from "@/assets/notice.mp3"; +let audio = new Audio(); +audio.src = noticeAudio; +Vue.prototype.$audioPlay = () => { + audio.play() +} new Vue({ el: '#app', router, diff --git a/src/utils/createTable.js b/src/utils/createTable.js index 44dcf7e..066c860 100644 --- a/src/utils/createTable.js +++ b/src/utils/createTable.js @@ -11,8 +11,11 @@ export async function resolveFormInfo(customFormId,filterType = 'table') { [ "departments", async () => { - const res = await listCommondepartment(); - return res; + const res = await listCommondepartment({ + page: 1, + page_size: 999 + }); + return res.data; }, ], ["admins", []], diff --git a/src/views/bigScreen1/component/detailTransfer.vue b/src/views/bigScreen1/component/detailTransfer.vue index 04c9fd8..7ba7f82 100644 --- a/src/views/bigScreen1/component/detailTransfer.vue +++ b/src/views/bigScreen1/component/detailTransfer.vue @@ -282,7 +282,7 @@ }}

-
+

{{ item.label }}

@@ -26,7 +26,7 @@ @@ -70,14 +71,6 @@ export default { data() { return { status: [ - { - value: 2, - label: "已接收" - }, - { - value: 3, - label: "已开启通知" - }, { value: 4, label: "已开启" @@ -92,16 +85,12 @@ export default { }, ], statusType: [ - { - label: "存在执行中", - color: "linear-gradient(to top left,#527ded, #527ded43)", - }, { label: "超时", color: "linear-gradient(to top left,#d15d52, #d15d5243)" }, { - label: "即将执行", + label: "即将结束", color: "linear-gradient(to top left,#ecc069, #ecc06943)" } ], @@ -130,6 +119,18 @@ export default { }) } }, + + + sortTransfer (index) { + const formatter = this.timeStatusFormat.bind(this) + if (index === 0) { + let filterArr = this.scrollList.filter(i => (formatter(i) === 4)) + this.scrollList = Array.from(new Set([...filterArr,...this.scrollList].map(i => JSON.stringify(i)))).map(i => JSON.parse(i)) + } else if (index === 1) { + let filterArr = this.scrollList.filter(i => (formatter(i) === 3)) + this.scrollList = Array.from(new Set([...filterArr,...this.scrollList].map(i => JSON.stringify(i)))).map(i => JSON.parse(i)) + } + } }, computed: { time () { @@ -147,15 +148,20 @@ export default { timeStatusFormat () { return function (item) { - //1 普通 2 进行中 3 倒计时 4 超时 + //1 普通 2 存在进行中 3 倒计时 4 超时 const diffMins = this.$moment(item.end_time).diff(this.time,"minutes"); if (diffMins <= 5 && diffMins >= 0) { + if (!item._isPlay) { + item._isPlay = true + this.$audioPlay() + } return 3 } - if (this.doing.filter(i => (i.id === item.id))?.length > 1) { - return 2 - } if (diffMins < 0) { + if (!item._isPlay) { + item._isPlay = true + this.$audioPlay() + } return 4 } return 1 @@ -184,7 +190,10 @@ export default { watch: { doing (newVal) { if (newVal && newVal instanceof Array) { - this.scrollList = deepCopy(newVal) + this.scrollList = deepCopy(newVal).map(i => { + i._isPlay = false + return i + }) this.$nextTick(() => { const isScroll = this.$refs['listItems']?.$el?.getBoundingClientRect()?.height > this.$refs['elScrollbar']?.$el?.getBoundingClientRect()?.height; @@ -268,6 +277,7 @@ $list-height: calc(#{$container-height} - 5.33rem); display: flex; align-items: center; border-bottom: 1px #fff solid; + cursor: pointer; padding: 1.2rem 2rem; @@ -327,11 +337,11 @@ $list-height: calc(#{$container-height} - 5.33rem); text-align: center; } &__last { - flex-basis: 6%; + flex-basis: 9%; text-align: center; } &__operate { - flex-basis: 30%; + flex-basis: 22%; display: flex; align-items: center; justify-content: center; diff --git a/src/views/bigScreen1/component/done.vue b/src/views/bigScreen1/component/done.vue index 7e5cbc5..953b1d8 100644 --- a/src/views/bigScreen1/component/done.vue +++ b/src/views/bigScreen1/component/done.vue @@ -43,7 +43,7 @@
实际执行时间:{{ timeFormat(item.act_start_time) }}至{{ timeFormat(item.act_end_time,'HH:mm') }}
-
预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours', true) }}时
+
已用时长 {{ $moment(item.act_end_time).diff($moment(item.act_start_time),'hours', true).toFixed(2) }}小时
@@ -303,11 +303,11 @@ $list-height: calc(#{$container-height} - 5.33rem); text-align: center; } &__last { - flex-basis: 9%; + flex-basis: 11%; text-align: center; } &__operate { - flex-basis: 30%; + flex-basis: 24%; display: flex; align-items: center; justify-content: center; diff --git a/src/views/bigScreen1/component/toDo.vue b/src/views/bigScreen1/component/toDo.vue index 1bec6b5..67cfea1 100644 --- a/src/views/bigScreen1/component/toDo.vue +++ b/src/views/bigScreen1/component/toDo.vue @@ -4,7 +4,7 @@

待执行

-
+

{{ item.label }}

@@ -26,7 +26,7 @@ @@ -82,14 +83,6 @@ export default { value: 4, label: "开机" }, - { - value: 5, - label: "通知关机" - }, - { - value: 6, - label: "关机" - }, ], statusType: [ { @@ -132,6 +125,19 @@ export default { } }, + sortTransfer (index) { + const formatter = this.timeStatusFormat.bind(this) + if (index === 0) { + let filterArr = this.scrollList.filter(i => (formatter(i) === 2)) + this.scrollList = Array.from(new Set([...filterArr,...this.scrollList].map(i => JSON.stringify(i)))).map(i => JSON.parse(i)) + } else if (index === 1) { + let filterArr = this.scrollList.filter(i => (formatter(i) === 4)) + this.scrollList = Array.from(new Set([...filterArr,...this.scrollList].map(i => JSON.stringify(i)))).map(i => JSON.parse(i)) + } else if (index === 2) { + let filterArr = this.scrollList.filter(i => (formatter(i) === 3)) + this.scrollList = Array.from(new Set([...filterArr,...this.scrollList].map(i => JSON.stringify(i)))).map(i => JSON.parse(i)) + } + } }, computed: { time () { @@ -149,15 +155,23 @@ export default { timeStatusFormat () { return function (item) { - //1 普通 2 进行中 3 倒计时 4 超时 + //1 普通 2 存在进行中 3 倒计时 4 超时 const diffMins = this.$moment(item.start_time).diff(this.time,"minutes"); if (diffMins <= 5 && diffMins >= 0) { + if (!item._isPlay) { + item._isPlay = true + this.$audioPlay() + } return 3 } if (this.toDo.filter(i => (i.id === item.id))?.length > 1) { return 2 } if (diffMins < 0) { + if (!item._isPlay) { + item._isPlay = true + this.$audioPlay() + } return 4 } return 1 @@ -177,6 +191,8 @@ export default { } }, + }, + created() { }, mounted() { }, @@ -186,7 +202,10 @@ export default { watch: { toDo (newVal) { if (newVal && newVal instanceof Array) { - this.scrollList = deepCopy(newVal) + this.scrollList = deepCopy(newVal).map(i => { + i._isPlay = false + return i + }) this.$nextTick(() => { const isScroll = this.$refs['listItems']?.$el?.getBoundingClientRect()?.height > this.$refs['elScrollbar']?.$el?.getBoundingClientRect()?.height; @@ -247,6 +266,7 @@ $list-height: calc(#{$container-height} - 5.33rem); display: flex; justify-content: center; align-items: center; + cursor: pointer; margin-left: 2rem; &__color { @@ -329,11 +349,11 @@ $list-height: calc(#{$container-height} - 5.33rem); text-align: center; } &__last { - flex-basis: 6%; + flex-basis: 9%; text-align: center; } &__operate { - flex-basis: 30%; + flex-basis: 22%; display: flex; align-items: center; justify-content: center; diff --git a/src/views/order/component/createDispatch.vue b/src/views/order/component/createDispatch.vue index 5d678e5..4fcf167 100644 --- a/src/views/order/component/createDispatch.vue +++ b/src/views/order/component/createDispatch.vue @@ -121,7 +121,7 @@ @@ -258,15 +343,21 @@ export default { padding: 8px 0; } +.name { + text-indent: 30px; + line-height: 1.5; + + padding: 6px 0; +} .time { + text-indent: 60px; line-height: 1.5; - padding: 0 4px; } .content { + text-indent: 60px; line-height: 1.5; - padding: 0 4px; } .item + .item { margin-top: 20px; diff --git a/vue.config.js b/vue.config.js index 459de67..726cdd9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -24,7 +24,7 @@ module.exports = { * In most cases please use '/' !!! * Detail: https://cli.vuejs.org/config/#publicpath */ - publicPath: '/admin_test/', + publicPath: process.env.NODE_ENV === 'tests' ? '/admin_test' : '/admin', outputDir: './dist', assetsDir: 'static', css: { @@ -35,6 +35,10 @@ module.exports = { sass:{ prependData: '@import "@/styles/index.scss";' } + }, + extract: { // 打包后css文件名称添加时间戳 + filename: `static/css/[name].css`, + chunkFilename: `static/css/chunk.[id].css` } }, lintOnSave: process.env.NODE_ENV === 'development', @@ -65,7 +69,11 @@ module.exports = { alias: { '@': resolve('src') } - } + }, + output: { + filename: 'static/js/[name].[contenthash].js', + chunkFilename: 'static/js/[name].[contenthash].js' + }, }, chainWebpack(config) { // it can improve the speed of the first screen, it is recommended to turn on preload