文字修改 提示音等

master
xy 2 years ago
parent 4b234ee560
commit e23c9025af

@ -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

@ -5,7 +5,9 @@
"author": "Pan <panfree23@gmail.com>",
"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",

@ -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
})
}

@ -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
})
}

Binary file not shown.

@ -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,

@ -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", []],

@ -282,7 +282,7 @@
}}
</p>
<img
style="height: 50px"
style="height: 100px"
class="d-flex"
:src="
data.start_sign_uploads_id_relation
@ -301,7 +301,7 @@
}}
</p>
<img
style="height: 50px"
style="height: 100px"
class="d-flex"
:src="
data.end_sign_uploads_id_relation
@ -421,6 +421,7 @@ export default {
return;
}
}
this.zIndex = PopupManager.nextZIndex()
this.isShow = true;
},
@ -545,7 +546,7 @@ export default {
this.hide();
},
},
computed: {},
computed: {}
};
</script>
@ -564,7 +565,7 @@ $height: 74vh;
width: $width;
height: $height;
border-radius: 22px / 12px;
z-index: 11;
position: fixed;
top: calc(50% - (#{$height} / 2));
left: calc(50% - (#{$width} / 2));

@ -4,7 +4,7 @@
<p>执行中</p>
<div class="type">
<div class="type-item" v-for="item in statusType">
<div class="type-item" v-for="(item, index) in statusType" @click="sortTransfer(index)">
<div class="type-item__color" :style="{ 'background': item.color }"></div>
<p class="type-item__label">{{ item.label }}</p>
</div>
@ -26,7 +26,7 @@
</template>
<template v-else-if="timeStatusFormat(item) === 4">
<div class="list-item__status-4"></div>
<p>超时未执行</p>
<p>超时</p>
</template>
<template v-else>
@ -43,7 +43,7 @@
<div class="list-item__time">
执行时间{{ 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) }}</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" class="step" @click="stepClick(item,s)">
<div class="step-icon">
@ -59,6 +59,7 @@
</transition-group>
</div>
</el-scrollbar>
</div>
</template>
@ -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;

@ -43,7 +43,7 @@
<div class="list-item__time">
实际执行时间{{ timeFormat(item.act_start_time) }}{{ timeFormat(item.act_end_time,'HH:mm') }}
</div>
<div class="list-item__last">预计时长 {{ $moment(item.end_time).diff($moment(item.start_time),'hours', true) }}</div>
<div class="list-item__last">已用时长 {{ $moment(item.act_end_time).diff($moment(item.act_start_time),'hours', true).toFixed(2) }}</div>
<div class="list-item__operate">
<div v-for="(s, si) in status" class="step">
<div class="step-icon">
@ -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;

@ -4,7 +4,7 @@
<p>待执行</p>
<div class="type">
<div class="type-item" v-for="item in statusType">
<div class="type-item" v-for="(item, index) in statusType" @click="sortTransfer(index)">
<div class="type-item__color" :style="{ 'background': item.color }"></div>
<p class="type-item__label">{{ item.label }}</p>
</div>
@ -26,7 +26,7 @@
</template>
<template v-else-if="timeStatusFormat(item) === 4">
<div class="list-item__status-4"></div>
<p>超时未执行</p>
<p>超时</p>
</template>
<template v-else>
@ -43,7 +43,7 @@
<div class="list-item__time">
执行时间{{ 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) }}小时</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" class="step" @click="stepClick(item,s)">
<div class="step-icon">
@ -59,6 +59,7 @@
</transition-group>
</div>
</el-scrollbar>
</div>
</template>
@ -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;

@ -121,7 +121,7 @@
</template>
<script>
import { equipmentInfos } from "@/api/other"
import { equipmentInfos, checkTransfer } from "@/api/other"
import { uuid } from "@/utils";
import { index, save, destroy } from "@/api/system/baseForm";
import { deepCopy } from "@/utils";
@ -833,40 +833,29 @@ export default {
const uid = uuid();
let promiseAll = [];
submitData.forEach((i) => {
let loadingInstance = this.$loading({
lock: true,
background: "rgba(0,0,0,0.4)",
text: "正在加载中...",
});
for (let j = 0;j < submitData.length;j++) {
let i = submitData[j]
delete i["equipment_id-span"];
delete i["_index"];
delete i["_rowKey"];
if (this.createType === 2) {
const startDay = this.$moment(this.date).startOf("week");
let weekArr = [];
for (let a = 1; a <= 7; a++) {
weekArr.push(
this.$moment(startDay).add(a, "days").format("YYYY-MM-DD")
);
}
weekArr.forEach((j) => {
promiseAll.push(
save(
{
...i,
table_name: "transfers",
start_time: `${j} ${i.start_time}`,
end_time: `${j} ${i.end_time}`,
no: uid,
status: 1,
shifouzouliucheng: isNeed
},
false
)
);
});
} else {
i.start_time = `${this.date} ${i.start_time}`;
i.end_time = `${this.date} ${i.end_time}`;
i.no = uid;
i.status = 1;
i.start_time = `${this.date} ${i.start_time}`;
i.end_time = `${this.date} ${i.end_time}`;
i.no = uid;
i.status = 1;
try {
const res = await checkTransfer({
start_time: i.start_time,
end_time: i.end_time,
equipment_id: i.equipment_id
})
promiseAll.push(
save(
{
@ -877,13 +866,68 @@ export default {
false
)
);
} catch (e) {
}
});
let loadingInstance = this.$loading({
lock: true,
background: "rgba(0,0,0,0.4)",
text: "正在加载中...",
});
}
// submitData.forEach((i) => {
// delete i["equipment_id-span"];
// delete i["_index"];
// delete i["_rowKey"];
//
// if (this.createType === 2) {
// const startDay = this.$moment(this.date).startOf("week");
// let weekArr = [];
// for (let a = 1; a <= 7; a++) {
// weekArr.push(
// this.$moment(startDay).add(a, "days").format("YYYY-MM-DD")
// );
// }
// weekArr.forEach((j) => {
// promiseAll.push(
// save(
// {
// ...i,
// table_name: "transfers",
// start_time: `${j} ${i.start_time}`,
// end_time: `${j} ${i.end_time}`,
// no: uid,
// status: 1,
// shifouzouliucheng: isNeed
// },
// false
// )
// );
// });
// } else {
// i.start_time = `${this.date} ${i.start_time}`;
// i.end_time = `${this.date} ${i.end_time}`;
// i.no = uid;
// i.status = 1;
//
// checkTransfer({
// start_time: i.start_time,
// end_time: i.end_time,
// equipment_id: i.equipment_id
// }).then(res => {
// if (res.errcode) {
//
// } else {
// promiseAll.push(
// save(
// {
// table_name: "transfers",
// ...i,
// shifouzouliucheng: isNeed
// },
// false
// )
// );
// }
// })
//
// }
// });
Promise.all(promiseAll)
.then((res) => {
this.reset();

@ -32,8 +32,11 @@
<div class="point panel">
<div style="display: flex;justify-content: space-between;align-items: center;">
<div class="title">创建调令</div>
<el-button size="mini" type="primary" @click="isShowCreate = !isShowCreate">{{ isShowCreate ? '收起' : '展开'}}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<div class="title">
<span>创建调令</span>
<Button type="primary" size="small" style="margin-left: 10px;" @click="$emit('quickCreate')"></Button>
</div>
<Button size="small" type="primary" @click="isShowCreate = !isShowCreate">{{ isShowCreate ? '收起' : '展开'}}<i class="el-icon-arrow-down el-icon--right"></i></Button>
</div>
<transition name="create">
@ -221,6 +224,8 @@ export default {
.title {
font-weight: 600;
font-size: 16px;
display: flex;
align-items: center;
padding: 10px 20px;
position: relative;

@ -7,6 +7,7 @@
text="快速调令"
>
<template #content>
<Button type="primary" style="width: 120px;" @click="$emit('normalCreate')"></Button>
<Button type="primary" style="width: 120px;" @click="add"></Button>
</template>
</LxHeader>

@ -1,11 +1,7 @@
<template>
<div>
<template v-if="isQuick">
<quickCreate :equipments="equipments"></quickCreate>
</template>
<template v-else>
<normalCreate></normalCreate>
</template>
<quickCreate v-show="isQuick" :equipments="equipments" @normalCreate="isQuick = false"></quickCreate>
<normalCreate v-show="!isQuick" @quickCreate="isQuick = true"></normalCreate>
<el-backtop target=".app-wrapper"></el-backtop>
</div>
@ -42,18 +38,18 @@ export default {
},
computed: {},
mounted() {
if (this.$route.params.cloneTransfer) {
this.isQuick = false
} else {
this.$confirm('选择调令创建方式','调令方式',{
confirmButtonText: '快速调令',
cancelButtonText: '普通调令',
type: 'info',
closeOnPressEscape: false,
closeOnClickModal: false,
showClose: false
}).then(_ => this.isQuick = true).catch(_ => this.isQuick = false)
}
// if (this.$route.params.cloneTransfer) {
// this.isQuick = false
// } else {
// this.$confirm('','',{
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'info',
// closeOnPressEscape: false,
// closeOnClickModal: false,
// showClose: false
// }).then(_ => this.isQuick = true).catch(_ => this.isQuick = false)
// }
},
created() {
this.getEquipments();

@ -295,6 +295,7 @@
<el-row :gutter="10">
<el-col :span="4">
<el-tree :data="equipments"
node-key="id"
:style="{ 'max-height': treeHeight, 'overflow': 'scroll' }"
ref="elTree"
:props="{ children: 'children', label: 'name' }"
@ -333,6 +334,9 @@
>
<template #callback="{ row }">
<Button size="small" type="primary" @click="$refs['callbackList'].setId(row.id),$refs['callbackList'].show()"></Button>
<template v-if="row.id_feedbacks_transfer_id_relation.length > 0">
<Icon type="md-alert" color="#db4f2b" style="margin-left: 6px;font-size: 16px;" />
</template>
</template>
</xy-table>
</el-col>
@ -464,10 +468,16 @@ export default {
page_size: 9999
},false))?.data || []
this.equipments = this.areas.map(i => ({
id: `area_${i.value}`,
name: i.key,
children: res.filter(j => j.area === i.value)
}))
console.log(this.equipments)
this.$nextTick(() => {
this.areas.forEach(i => {
this.$refs['elTree'].setChecked(`area_${i.value}`, true, true)
})
})
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {

@ -12,13 +12,13 @@
<header-content :auths="auths_auth_mixin">
<template #search>
<div style="display: flex">
<el-date-picker v-model="selectDate" size="small" style="width: 140px;"></el-date-picker>
<Button
style="margin-left: 10px"
type="primary"
@click="getTransfer"
>查询</Button
>
<el-date-picker v-model="selectDate" size="small" :clearable="false" style="width: 140px;" @change="getTransfer"></el-date-picker>
<!-- <Button-->
<!-- style="margin-left: 10px"-->
<!-- type="primary"-->
<!-- @click="getTransfer"-->
<!-- >查询</Button-->
<!-- >-->
</div>
</template>
<Button type="primary" @click="exportDocx"></Button>
@ -31,16 +31,25 @@
<el-card>
<div class="title">{{ $moment(selectDate).format('YYYY-MM-DD') }}调度指令执行情况</div>
<div v-for="(item, index) in transfers" :key="item.id" class="item">
<div class="sub-title">{{ numberToChinese(index+1) }}. {{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}</div>
<div class="time">
<span>时间</span>
<span>{{ $moment(item.act_start_time).format('YYYY-MM-DD HH:mm') }} - {{ $moment(item.act_end_time).format('HH:mm') }}</span>
</div>
<div class="content">
<span>{{ item.equipment_id_equipments_id_relation ? area(item.equipment_id_equipments_id_relation.area) : '' }}</span>
<p style="text-indent: 30px;line-height: 1.2;padding: 20px 0;">{{ weather.weather }}</p>
<div v-for="(item, index) in showData" :key="item.value">
<div class="item" v-if="item._data.length > 0">
<div class="sub-title">{{ numberToChinese(index+1) }}. {{ item.key }}</div>
<span>{{ item.content }}</span>
<div v-for="(item1, index1) in item._data" :key="item1.id">
<div class="name">
{{index1+1}}.{{ item1.equipment_id_equipments_id_relation ? item1.equipment_id_equipments_id_relation.name : '' }}
</div>
<div class="time">
<span>时间</span>
<span>{{ $moment(item1.act_start_time).format('YYYY-MM-DD HH:mm') }} - {{ $moment(item1.act_end_time).format('HH:mm') }}</span>
</div>
<div class="content">
<span>内容</span>
<span>{{ item1.content }}</span>
</div>
</div>
</div>
</div>
</el-card>
@ -58,11 +67,12 @@ import {
convertInchesToTwip
} from "docx";
import { saveAs } from 'file-saver';
import { index } from "@/api/system/baseForm";
import { index, save } from "@/api/system/baseForm";
import headerContent from "@/components/LxHeader/XyContent.vue";
import LxHeader from "@/components/LxHeader/index.vue";
import { authMixin } from "@/mixin/authMixin";
import { show } from "@/api/system/customFormField";
import { info, weather} from "@/api/other";
export default {
components: {
LxHeader,
@ -73,11 +83,56 @@ export default {
return {
types: [],
areas: [],
weather: {},
transfers: [],
showData: [],
selectDate: new Date(),
}
},
methods: {
async getWeatherInfo () {
let infoObj = {
weather: '',
water: '',
rain: '',
prevent: '',
early_warning: ''
}
const weatherInfo = await weather()
infoObj.weather = `${weatherInfo.weather},${weatherInfo.wD}${weatherInfo.wS},${weatherInfo.sendibleTemp}-${weatherInfo.temp}°C`
const infos = (await info({
date: this.$moment().format('YYYY-MM-DD')
}))[0]
infoObj.water = `${infos?.daily_water?.map(i => i.range + i.stnm + i.s_value + 'm,')?.toString()}`
infoObj.rain = `${infos?.daily_rain?.map(i => i.type + i.rain_value + 'mm,')?.toString()}`
this.weather = infoObj
await save({
table_name: 'waters',
date: this.$moment().format('YYYY-MM-DD'),
...infoObj
},false)
},
async getWeather () {
const res = (await index({
table_name: 'waters',
filter: [
{
key: 'date',
op: 'eq',
value: this.$moment().format('YYYY-MM-DD')
}
]
},false)).data[0]
if (!res) {
await this.getWeatherInfo()
} else {
this.weather = res
}
},
numberToChinese (num) {
if (num == 10) {
return '十'
@ -142,23 +197,40 @@ export default {
},
async getTransfer () {
this.transfers = (await index({
table_name: "transfers",
page: 1,
page_size: 999,
filter: [
{
key: 'start_time',
op: 'range',
value: `${this.$moment(this.selectDate).startOf('days').format('YYYY-MM-DD HH:mm:ss')},${this.$moment(this.selectDate).endOf('days').format('YYYY-MM-DD HH:mm:ss')}`
},
{
key: 'status',
op: 'eq',
value: 7
try {
this.transfers = (await index({
table_name: "transfers",
page: 1,
page_size: 999,
filter: [
{
key: 'start_time',
op: 'range',
value: `${this.$moment(this.selectDate).startOf('days').format('YYYY-MM-DD HH:mm:ss')},${this.$moment(this.selectDate).endOf('days').format('YYYY-MM-DD HH:mm:ss')}`
},
{
key: 'status',
op: 'eq',
value: 7
}
]
})).data
this.showData = this.areas.map(i => {
return {
...i,
_data: []
}
]
})).data
})
this.transfers.forEach(item => {
let filterData = this.showData.find(i => i.value === item.equipment_id_equipments_id_relation.area)
if (filterData) {
filterData._data.push(item)
}
})
} catch (e) {
}
},
async exportDocx () {
@ -184,12 +256,12 @@ export default {
},
children: [
new TextRun({
text: "今日小雨转晴北风2级气温22℃~29℃。水情信息8:00新塘3.06m环城河北3.02m觅渡桥2.99m人民桥3.00m16:00新塘3.03m环城河北2.90m觅渡桥2.92m人民桥2.95m。",
text: this.weather.weather,
size: 18,
})
]
}),
...this.transfers.map((i, index) => (
...this.showData.filter(i => (i._data && i._data.length>0)).map((i, index) => (
[
new Paragraph({
spacing: {
@ -198,27 +270,39 @@ export default {
},
children: [
new TextRun({
text: `${this.numberToChinese(index+1)}${i.equipment_id_equipments_id_relation?.name}`,
text: `${this.numberToChinese(index+1)}${i.key}`,
size: 28,
bold: true,
}),
]
}),
new Paragraph({
spacing: {
before: 200,
line: 400
},
indent: {
firstLine: convertInchesToTwip(0.5)
},
children: [
new TextRun({
text: `1、时间${this.$moment(i.act_start_time).format('YYYY-MM-DD HH:mm')} - ${this.$moment(i.act_end_time).format('YYYY-MM-DD HH:mm')} 2、实际执行情况${i.content}`,
size: 18,
...i._data.map((i1, index1) => (
[
new Paragraph({
spacing: {
before: 200,
line: 200
},
indent: {
firstLine: convertInchesToTwip(0.5)
},
children: [
new TextRun({
text: `${index1+1}. ${i1.equipment_id_equipments_id_relation.name}`,
size: 24,
}),
new TextRun({
text: `\n时间 ${this.$moment(i1.act_start_time).format('YYYY-MM-DD HH:mm')} - ${this.$moment(i1.act_end_time).format('HH:mm')}`,
size: 18
}),
new TextRun({
text: `\n内容${i1.content}`,
size: 18
})
]
})
]
})
))
]
)).flat()
]
@ -227,7 +311,7 @@ export default {
})
const blob = await Packer.toBlob(document)
saveAs(blob, 'test.docx')
saveAs(blob, `${this.$moment().format('YYYY-MM-DD')}调令.docx`)
}
},
computed: {
@ -240,6 +324,7 @@ export default {
created() {
this.getArea()
this.getTransfer()
this.getWeather()
}
}
</script>
@ -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;

@ -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

Loading…
Cancel
Save