Browse Source

修改 时间线节点 bug, 修改样式

wangqin
Joe 1 year ago
parent
commit
5c886d814d
  1. 57
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/components/FormInput.vue
  2. 64
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/components/FormSelect.vue
  3. 131
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/components/FormTimePicker.vue
  4. 10
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue
  5. 16
      ruoyi-ui/src/views/JiHeExpressway/components/TimeLine/TimeLine1/index.vue
  6. 3
      ruoyi-ui/src/views/JiHeExpressway/index.vue
  7. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/index.vue
  8. 137
      ruoyi-ui/src/views/JiHeExpressway/scss/el-reset.scss
  9. 2
      ruoyi-ui/src/views/JiHeExpressway/scss/reset.scss

57
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/components/FormInput.vue

@ -1,57 +0,0 @@
<template>
<ElInput class='FormInput' v-bind="getBind" v-on="$listeners" />
</template>
<script>
export default {
name: 'FormInput',
computed: {
getBind() {
return {
placeholder: "请输入",
...this.$attrs
}
}
}
}
</script>
<style lang='scss' scoped>
.FormInput {
height: 100%;
::v-deep {
// .el-input__inner {
// background-color: #0D5F79;
// color: #fff;
// border-radius: 2px;
// border: 0;
// height: 100%;
// min-height: fit-content;
// line-height: unset;
// font-size: 12px;
// &::placeholder {
// color: #fff;
// }
// }
.el-textarea__inner {
background: #0A3E54;
border-radius: 5px;
opacity: 1;
border: 1px solid rgba(98, 224, 254, .6);
}
.el-input__count {
background-color: rgba(0, 0, 0, 0);
font-size: 12px;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #3DE8FF;
line-height: 14px;
}
}
}
</style>

64
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/components/FormSelect.vue

@ -1,64 +0,0 @@
<template>
<ElSelect class='FormSelect' v-bind="$attrs" v-on="$listeners">
<ElOption v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
<slot></slot>
</ElOption>
</ElSelect>
</template>
<script>
export default {
name: 'FormSelect',
props: {
// options: {
// /**
// * {
// * value: any;
// * label: any;
// * }[]
// */
// type: Array,
// default: () => []
// }
},
data() {
return {
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
value: ''
}
}
}
</script>
<style lang='scss' scoped>
.FormSelect {
::v-deep {
.el-input {
.el-input__inner {
font-size: 12px;
}
.el-input__suffix {
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
</style>

131
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/components/FormTimePicker.vue

@ -1,131 +0,0 @@
<template>
<ElTimePicker class="TimeSelect" v-bind="getBind" v-on="$listeners" />
</template>
<script>
export default {
name: 'TimeSelect',
computed: {
getBind() {
return {
placeholder: "请选择时间",
...this.$attrs
}
}
}
}
</script>
<style lang='scss'>
body {
.el-time-range-picker.el-popper,
.el-popper.el-time-panel {
background: #064258;
border-radius: 3px;
border: 0;
.el-time-range-picker__body,
.el-time-panel__content {
border-radius: 9px;
&::after {
border: 0;
// background-image: url(~@screen/images/active.svg);
}
&::before {
border: 0;
margin-top: -12px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: url(~@screen/images/active.svg);
width: 100%;
margin-left: 0;
padding: 0;
}
.el-time-spinner__arrow {
color: #fff;
}
.el-time-spinner__item {
color: rgba(0, 209, 255, .51);
&:hover:not(.disabled):not(.active) {
background-color: unset;
color: rgba(0, 209, 255, 1);
}
}
.active {
color: rgba(0, 209, 255);
}
}
.el-time-range-picker__body {
border: 1px solid #00B3CC;
}
.el-time-panel__content {
&::before {
margin-top: -15px;
}
}
.el-time-range-picker__content {
.el-time-range-picker__cell {
.el-time-range-picker__header {
color: #fff;
}
}
}
.el-time-panel__footer {
border-top: 0;
.cancel {
color: #FFFFFF;
}
.confirm {
color: #01B4DE;
}
}
.popper__arrow {
border-bottom-color: #064258;
&::after {
border-bottom-color: #064258;
}
}
}
}
</style>
<style lang='scss' scoped>
.TimeSelect {
::v-deep {
.el-range-input {
background-color: #0D5F79;
}
.el-range-separator {
color: #56CEFE;
}
&,
.el-input__inner {
background-color: #0D5F79;
color: #fff;
border-radius: 2px;
border: 0;
&::placeholder {
color: #fff;
}
}
}
}
</style>

10
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue

@ -3,21 +3,19 @@
<ElFormItem class="formItem" :rules="rules && rules[item.key]" v-for="(item, index) in formList" :key="item.key" <ElFormItem class="formItem" :rules="rules && rules[item.key]" v-for="(item, index) in formList" :key="item.key"
:label="item.label" :style="gridStyle(item, index)"> :label="item.label" :style="gridStyle(item, index)">
<slot :name="item.key" :data="item" :formData="formData"> <slot :name="item.key" :data="item" :formData="formData">
<component :is="getComponent(item.type)" v-bind="item.options" /> <component :is="getComponent(item.type)" v-bind="item.options" placeholder="请输入" v-model="formData[item.key]" />
</slot> </slot>
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>
</template> </template>
<script> <script>
import FormInput from "./components/FormInput.vue";
import FormTimePicker from "./components/FormTimePicker.vue";
export default { export default {
name: 'FormConfig', name: 'FormConfig',
components: { components: {
FormInput, // FormInput,
FormTimePicker // FormTimePicker
}, },
props: { props: {
/** /**
@ -75,7 +73,7 @@ export default {
} }
}, },
getComponent(type) { getComponent(type) {
return `Form${type.replace(/^[a-z]/, word => word.toUpperCase())}` return `El${type.replace(/^[a-z]/, word => word.toUpperCase())}`
} }
} }
} }

16
ruoyi-ui/src/views/JiHeExpressway/components/TimeLine/TimeLine1/index.vue

@ -1,5 +1,5 @@
<template> <template>
<div :class='["TimeLine1", { "auto-size": autoSize }]'> <div :class='["TimeLine1", { "auto-size": autoSize }]' ref="TimeLine1Ref">
<!-- 节点 --> <!-- 节点 -->
<div class="node" v-for="(item, index) in data" ref="nodeRefs"> <div class="node" v-for="(item, index) in data" ref="nodeRefs">
<span class="top-label"> <span class="top-label">
@ -89,9 +89,10 @@ export default {
watch: { watch: {
data: { data: {
handler(data) { handler(data) {
let needFilter = false
const nodeLinesWidth = []; const nodeLinesWidth = [];
const filterDistance = this.filterDistance || (num => num); const filterDistance = num => needFilter ? this.filterDistance(num) : num;
const removeDistance = 20 + 4 * 2; const removeDistance = 20 + 4 * 2;
@ -100,7 +101,8 @@ export default {
this.$refs.nodeRefs[index].querySelector('.center'), this.$refs.nodeRefs[index].querySelector('.center'),
this.$refs.nodeRefs[index + 1].querySelector('.center')) this.$refs.nodeRefs[index + 1].querySelector('.center'))
) - removeDistance ) - removeDistance
} };
function getSpecialDistance(index) { function getSpecialDistance(index) {
return filterDistance(getDistanceBetweenElements( return filterDistance(getDistanceBetweenElements(
this.$refs.nodeRefs[index].parentElement, this.$refs.nodeRefs[index].parentElement,
@ -128,12 +130,20 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
const timeLine1RefDom = this.$refs.TimeLine1Ref;
if (timeLine1RefDom.clientWidth != timeLine1RefDom.getBoundingClientRect().width) {
needFilter = true
}
getLineWidths(); getLineWidths();
}) })
}, },
immediate: true immediate: true
} }
}, },
mounted() {
// console.log()
console.log(this.$refs.nodeRefs[0].getBoundingClientRect())
},
methods: { methods: {
getBorderImageStyle(item) { getBorderImageStyle(item) {
const linearColor = item.isActive ? (this.lineActiveColor || `${this.activeColor}, ${this.activeColor}`) : (this.lineNormalColor || `${this.normalColor}, ${this.normalColor}`) const linearColor = item.isActive ? (this.lineActiveColor || `${this.activeColor}, ${this.activeColor}`) : (this.lineNormalColor || `${this.normalColor}, ${this.normalColor}`)

3
ruoyi-ui/src/views/JiHeExpressway/index.vue

@ -32,7 +32,8 @@ export default {
}; };
</script> </script>
<style lang="scss" scope src="./scss/index.scss"></style> <style lang="scss" scope src="./scss/reset.scss" />
<style lang="scss" scope src="./scss/el-reset.scss" />
<style scoped lang="scss"> <style scoped lang="scss">
.pageBox { .pageBox {
background: #13272F; background: #13272F;

10
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DisposalProcess/index.vue

@ -27,9 +27,9 @@
<TimeLine1 :data="timeLine1List" :filterDistance="filterDistance" /> <TimeLine1 :data="timeLine1List" :filterDistance="filterDistance" />
<TimeLine2 :data="timeLine2List" style="flex: 1;" /> <TimeLine2 :data="timeLine2List" style="flex: 1;" />
<div class="bottom"> <div class="bottom">
<FormSelect placeholder="请选择关键点" /> <ElSelect placeholder="请选择关键点" />
<RadioGroup :list="[{ key: 'input', label: '输入' }, { key: 'upload', label: '上传' }]" value="input" type="button" /> <RadioGroup :list="[{ key: 'input', label: '输入' }, { key: 'upload', label: '上传' }]" value="input" type="button" />
<FormInput placeholder="请输入调度指令" /> <ElInput placeholder="请输入调度指令" />
<ButtonGradient class="title-button special-button"> <ButtonGradient class="title-button special-button">
发送 发送
</ButtonGradient> </ButtonGradient>
@ -44,8 +44,6 @@
import Card from "./../../components/Card.vue"; import Card from "./../../components/Card.vue";
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue';
import RadioGroup from '@screen/components/RadioGroup/index.vue'; import RadioGroup from '@screen/components/RadioGroup/index.vue';
import FormSelect from '@screen/components/FormConfig/components/FormSelect.vue';
import FormInput from '@screen/components/FormConfig/components/FormInput.vue';
import TimeLine1 from "@screen/components/TimeLine/TimeLine1/index"; import TimeLine1 from "@screen/components/TimeLine/TimeLine1/index";
import TimeLine2 from "@screen/components/TimeLine/TimeLine2/index"; import TimeLine2 from "@screen/components/TimeLine/TimeLine2/index";
@ -61,8 +59,6 @@ export default {
TimeLine1, TimeLine1,
TimeLine2, TimeLine2,
RadioGroup, RadioGroup,
FormInput,
FormSelect
}, },
emit: ['fullHeight'], emit: ['fullHeight'],
data() { data() {
@ -80,7 +76,7 @@ export default {
}, },
methods: { methods: {
filterDistance(distance) { filterDistance(distance) {
return distance return 1 / this.adpScale.scaleX * distance
}, },
handleFullHeight() { handleFullHeight() {
this.isFullHeight = !this.isFullHeight; this.isFullHeight = !this.isFullHeight;

137
ruoyi-ui/src/views/JiHeExpressway/scss/el-reset.scss

@ -137,6 +137,12 @@ body {
input.el-input__inner { input.el-input__inner {
font-size: 12px; font-size: 12px;
} }
.el-input__suffix {
display: flex;
align-items: center;
justify-content: center;
}
} }
div.el-textarea { div.el-textarea {
textarea.el-textarea__inner { textarea.el-textarea__inner {
@ -155,4 +161,135 @@ body {
line-height: 14px; line-height: 14px;
} }
} }
div.el-time-panel.el-popper,
div.el-time-range-picker.el-popper {
background: #064258;
border-radius: 3px;
border: 0;
.el-time-range-picker__body,
.el-time-panel__content {
border-radius: 9px;
&::after {
border: 0;
}
&::before {
border: 0;
margin-top: -12px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: url(~@screen/images/active.svg);
width: 100%;
margin-left: 0;
padding: 0;
}
.el-time-spinner__arrow {
color: #fff;
}
.el-time-spinner__item {
color: rgba(0, 209, 255, 0.51);
&:hover:not(.disabled):not(.active) {
background-color: unset;
color: rgba(0, 209, 255, 1);
}
}
.active {
color: rgba(0, 209, 255);
}
}
.el-time-range-picker__body {
border: 1px solid #00b3cc;
}
.el-time-panel__content {
&::before {
margin-top: -15px;
}
}
.el-time-range-picker__content {
.el-time-range-picker__cell {
.el-time-range-picker__header {
color: #fff;
}
}
}
.el-time-panel__footer {
border-top: 0;
.cancel {
color: #ffffff;
}
.confirm {
color: #01b4de;
}
}
.el-range-input {
background-color: #0d5f79;
}
.el-range-separator {
color: #56cefe;
}
&,
.el-input__inner {
background-color: #0d5f79;
color: #fff;
border-radius: 2px;
border: 0;
&::placeholder {
color: #fff;
}
}
&[x-placement^="top"] {
div.popper__arrow {
border-top-color: #275e79;
&::after {
border-top-color: #275e79;
}
}
}
&[x-placement^="left"] {
div.popper__arrow {
border-left-color: #275e79;
&::after {
border-left-color: #275e79;
}
}
}
&[x-placement^="right"] {
div.popper__arrow {
border-right-color: #275e79;
&::after {
border-right-color: #275e79;
}
}
}
&[x-placement^="bottom"] {
div.popper__arrow {
border-bottom-color: #275e79;
&::after {
border-bottom-color: #275e79;
}
}
}
}
} }

2
ruoyi-ui/src/views/JiHeExpressway/scss/index.scss → ruoyi-ui/src/views/JiHeExpressway/scss/reset.scss

@ -1,5 +1,3 @@
@import url(./el-reset.scss);
body { body {
input, input,
textarea { textarea {
Loading…
Cancel
Save