Browse Source

改bug

wangqin
hui 9 months ago
parent
commit
944f14f8f8
  1. 3
      ruoyi-ui/src/main.js
  2. 35
      ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue
  3. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue
  4. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue

3
ruoyi-ui/src/main.js

@ -3,7 +3,6 @@ import CollapseTransition from "element-ui/lib/transitions/collapse-transition";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import Element from "element-ui"; import Element from "element-ui";
import clickoutside from "element-ui/src/utils/clickoutside";
import "./assets/styles/element-variables.scss"; import "./assets/styles/element-variables.scss";
import "./views/iot/css/iot.css"; import "./views/iot/css/iot.css";
import "@/assets/styles/index.scss"; // global css import "@/assets/styles/index.scss"; // global css
@ -128,8 +127,6 @@ Vue.component("evtDialogVideo", evtDialogVideo);
Vue.component(CollapseTransition.name, CollapseTransition); Vue.component(CollapseTransition.name, CollapseTransition);
// Vue.component('reproductionImage', reproductionImage) // Vue.component('reproductionImage', reproductionImage)
Vue.directive("clickoutside", clickoutside);
Vue.use(directive); Vue.use(directive);
Vue.use(plugins); Vue.use(plugins);
// Vue.use(gisMap) // Vue.use(gisMap)

35
ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue

@ -1,5 +1,6 @@
<template> <template>
<div class="from-content" style="width: 100%"> <div class="from-content" style="width: 100%">
<!-- <div ref="mask" style="position: fixed; z-index: 9999999; left: 0; top:0; bottom: 0; right: 0; background: rgba(0, 0, 0, 0.5);" @click.prevent="onClickMask" v-if="visible"></div> -->
<ElPopover <ElPopover
ref="PopoverRef" ref="PopoverRef"
placement="bottom" placement="bottom"
@ -10,7 +11,6 @@
v-model="visible" v-model="visible"
@show="handleShow" @show="handleShow"
style="width: 100%" style="width: 100%"
v-clickoutside="handlerClose"
> >
<div <div
class="InputSearch input" class="InputSearch input"
@ -22,16 +22,17 @@
style="width: 100%" style="width: 100%"
v-model="value" v-model="value"
:placeholder="placeholder" :placeholder="placeholder"
clearable
@change="handleSearch" @change="handleSearch"
></ElInput> ></ElInput>
<img src="./search.svg" v-show="!disable" @click="visible = !visible" /> <img src="./search.svg" v-show="!disable" @click="onOpenPop" />
</div> </div>
<div <div
class="InputSearch" class="InputSearch"
v-else v-else
slot="reference" slot="reference"
ref="ReferenceInputRef" ref="ReferenceInputRef"
@click="visible = !visible" @click="onOpenPop"
> >
<span>{{ placeholder }}</span> <span>{{ placeholder }}</span>
<img src="./search.svg"/> <img src="./search.svg"/>
@ -105,6 +106,7 @@ export default {
}, },
data() { data() {
return { return {
isClickedBtn: false,
visible: false, visible: false,
types: this.type, types: this.type,
value: "", value: "",
@ -126,18 +128,36 @@ export default {
}; };
}, },
}, },
mounted(){
// document.getElementById("app")
document.addEventListener("click" , ()=>{
if(!this.isClickedBtn){
setTimeout(() => {
this.visible = false;
}, 100)
}
this.isClickedBtn = false;
} , false)
},
methods: { methods: {
onOpenPop(){
this.isClickedBtn = true;
this.visible = !this.visible;
},
onClickMask(){
this.visible = false;
},
handleShow() { handleShow() {
if (this.width) return; if (this.width) return;
this.width = this.$refs.ReferenceInputRef.getBoundingClientRect().width; this.width = this.$refs.ReferenceInputRef.getBoundingClientRect().width;
}, },
handleResetForm() { handleResetForm() {
this.visible = true; // this.visible = true;
this.$refs.FormConfigRef?.reset(); this.$refs.FormConfigRef?.reset();
this.$refs.FormConfigRef.$refs.ElFormRef.resetFields(); this.$refs.FormConfigRef.$refs.ElFormRef.resetFields();
this.$refs.PopoverRef.doClose(); // this.$refs.PopoverRef.doClose();
this.$emit( this.$emit(
"handleSearch", "handleSearch",
@ -173,10 +193,7 @@ export default {
console.log("catch"); console.log("catch");
}); });
} }
}, }
handlerClose() {
this.visible = false;
},
}, },
}; };
</script> </script>

4
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue

@ -129,8 +129,8 @@ export default {
methods: { methods: {
async handleSwitcherChange(value, data) { async handleSwitcherChange(value, data) {
data.state = value; data.state = value;
let op = ["关闭", "开启"][+data.state];
const isContinue = await confirm({ message: "是否要删除该辖段信息?" }) const isContinue = await confirm({ message: `${op}该支路?` })
.catch(() => { .catch(() => {
data.state = !value; data.state = !value;
}); });

5
ruoyi-ui/src/views/JiHeExpressway/pages/service/sensitive/index.vue

@ -32,7 +32,6 @@
type="input" type="input"
params="word" params="word"
:disable="true" :disable="true"
:placeholder="searchText"
@handleSearch="handleSearch" @handleSearch="handleSearch"
/> />
</div> </div>
@ -140,10 +139,6 @@ export default {
key: "word", key: "word",
label: "关键词", label: "关键词",
}, },
{
key: "id",
label: "id",
},
{ {
key: "createTime", key: "createTime",
label: "创建时间", label: "创建时间",

Loading…
Cancel
Save