当前位置: 首页 > wzjs >正文

番禺网站建设系统高端网站定制的案例

番禺网站建设系统,高端网站定制的案例,站长工具是做什么的,wordpress是主机吗Vue.js的组件库Ant Design Vue Select 选择器没有全选功能&#xff0c;如下图所示&#xff1a; 在项目中&#xff0c;我们自己实现了全选和清空功能&#xff0c;如下所示&#xff1a; 代码如下所示&#xff1a; <!--* 参数配置 - 风力发电 - 曲线图 * 猴王软件学院 - 大强 …

Vue.js的组件库Ant Design Vue Select 选择器没有全选功能,如下图所示:

在项目中,我们自己实现了全选清空功能,如下所示:

代码如下所示:

<!--
=========================================================
* 参数配置 - 风力发电 - 曲线图
* 猴王软件学院 - 大强
* 2025-3-23
=========================================================
-->
<template><div><div class="flex-container"><div class="flex-item"><a-selectid="a-select-scene":options="options_scene"mode="combobox"style="width: 200px; height:50px;"@change="proChange_scene"showArrow="true"placeholder="请选择场景"v-model="selected_scene"></a-select></div><div class="flex-item"><a-selectid="a-select-node":options="options_node"mode="multiple"style="width: 200px; height:50px;"@change="proChange_node"showArrow="true"v-model:value="selected_node"><template #dropdownRender="{ menuNode: menu }"><div><a-button @click="allSelectedFun" type="primary" style="margin-right: 10px;">全选</a-button><a-button @click="clearFun">清空</a-button><a-divider style="margin: 5px 0;" /><v-nodes :vnodes="menu" /></div></template></a-select><div class="my-ant-select-selection-placeholder">请选择节点</div></div><div class="flex-item"><a-selectid="a-select-power":options="options_power"mode="combobox"style="width: 200px; height:50px;"@change="proChange_power"showArrow="true"placeholder="请选择功率"v-model="selected_power"></a-select></div><div class="flex-item"><a-button type="primary" preIcon="ant-design:search-outlined" @click="searchChart">查看</a-button></div></div><div ref="chartRef" :style="{ height, width }"></div></div>
</template>
<script lang="ts">
import {defineComponent, PropType, ref, Ref, reactive, watchEffect, unref, onMounted} from 'vue';
import {useECharts} from '/@/hooks/web/useECharts';
import {cloneDeep} from 'lodash-es';
import {Select} from "ant-design-vue";
import {initDictOptions} from "@/utils/dict";export default defineComponent({name: 'LineMulti',components: {Select,VNodes: (_, { attrs }) => {return attrs.vnodes;},},props: {chartData: {type: Array,default: () => [],required: true,},option: {type: Object,default: () => ({}),},type: {type: String as PropType<string>,default: 'line',},width: {type: String as PropType<string>,default: '100%',},height: {type: String as PropType<string>,default: 'calc(100vh - 78px)',},},emits: ['click'],setup(props, {emit}) {const chartRef = ref<HTMLDivElement | null>(null);const {setOptions, getInstance} = useECharts(chartRef as Ref<HTMLDivElement>);const option = reactive({tooltip: {trigger: 'axis',axisPointer: {type: 'shadow',label: {show: true,backgroundColor: '#333',},},},legend: {top: 30,},grid: {top: 60,},xAxis: {name: '时间(小时)',type: 'category',data: [],},yAxis: {name: '功率(万千瓦)',type: 'value',},series: [],});// 功率let options_power = ref<any>([]);let selected_power = ref('');// 场景let options_scene = ref<any>([]);let selected_scene = ref('');// 节点let options_node = ref<any>([]);// let selected_node = ref('');let selected_node = ref([]);/*** 功率改变函数* @param val*/function proChange_power(val) {selected_power.value = val;}/*** 场景改变函数* @param val*/function proChange_scene(val) {selected_scene.value = val;}/*** 节点改变函数* @param val*/function proChange_node(val) {selected_node.value = val;}// 全选函数function allSelectedFun() {options_node.value.forEach((item) => {let index = selected_node.value.indexOf(item.value);if (index == -1) {selected_node.value.push(item.value);}});};// 清空函数function clearFun() {selected_node.value.splice(0, selected_node.value.length);};/*** 查看图表*/function searchChart() {if (selected_scene.value == '') {alert("请选择场景!")return}if (selected_node.value == '') {alert("请选择节点!")return}if (selected_power.value == '') {alert("请选择功率!")return}if (props.option) {Object.assign(option, cloneDeep(props.option));}//节点let nodeArr = Array.from(new Set(props.chartData.map((item) => item.nodeName)));//轴数据let xAxisData = Array.from(new Set(props.chartData.map((item) => item.index)));let seriesData = [];nodeArr.forEach((node) => {selected_node.value.forEach((value) => {if (node === value) {let obj: any = {name: node, type: props.type};// update-begin-author:liusq date:2023-7-12 for: [issues/613] LineMulti 在数据不对齐时,横坐标计算错误let data = [];xAxisData.forEach((x) => {let dataArr = props.chartData.filter((item) =>x == item.index &&  // 索引selected_power.value == item.power &&  // 功率selected_scene.value == item.scene &&  // 场景node == item.nodeName // 节点);if (dataArr && dataArr.length > 0) {data.push(dataArr[0].value);} else {data.push(null);}});// update-end-author:liusq date:2023-7-12 for: [issues/613] LineMulti 在数据不对齐时,横坐标计算错误//data数据obj['data'] = data;seriesData.push(obj);}});});option.series = seriesData;option.xAxis.data = xAxisData;// option.legend.show = false;option.legend.selector = [{// 全选type: 'all',// 可以是任意你喜欢的标题title: '全选'},{// 反选type: 'inverse',// 可以是任意你喜欢的标题title: '反选'}];option.legend.selectedMode = false;option.legend.orient = 'vertical';option.legend.right = '0px';// option.legend.top = '-50px';console.log('option', option);setOptions(option);getInstance()?.off('click', onClick);getInstance()?.on('click', onClick);}function onClick(params) {emit('click', params);}/*** 初始化字典选项*/async function initDictConfig() {options_power.value = await initDictOptions('power');options_scene.value = await initDictOptions('scene');options_node.value = await initDictOptions('node');}onMounted(() => {//初始化字典选项initDictConfig();});return {options_power, options_scene, options_node,selected_power, selected_scene, selected_node,proChange_power, proChange_scene, proChange_node, chartRef, searchChart,allSelectedFun, clearFun};},
});
</script><style>
.flex-container {display: -webkit-flex;display: flex;
}.flex-item {width: 210px;
}.ant-select-multiple .ant-select-selection-overflow-item {flex: none;align-self: center;max-width: 100%;display: none;
}.my-ant-select-selection-placeholder {overflow: hidden;white-space: nowrap;text-overflow: ellipsis;flex: 1;color: rgba(0, 0, 0, 0.65);pointer-events: none;margin-top: -45px;margin-left: 20px;position: relative;
}
</style>


文章转载自:

http://XOl5axEK.Lqypx.cn
http://5ZAdShC7.Lqypx.cn
http://SwKlOC3O.Lqypx.cn
http://cdVI6680.Lqypx.cn
http://efi43zY3.Lqypx.cn
http://D8bEipWW.Lqypx.cn
http://V4RRUhkn.Lqypx.cn
http://do1Wtiky.Lqypx.cn
http://1k9j931g.Lqypx.cn
http://6eHhHhHw.Lqypx.cn
http://uGS3nx6k.Lqypx.cn
http://V5n5pJYT.Lqypx.cn
http://ksV647gI.Lqypx.cn
http://qLwfXRll.Lqypx.cn
http://PmU0IzBX.Lqypx.cn
http://AZ0i6j8S.Lqypx.cn
http://roh62Wq1.Lqypx.cn
http://NJZIiQIq.Lqypx.cn
http://4PavEyYo.Lqypx.cn
http://jKsYqbjb.Lqypx.cn
http://kx8pCYAY.Lqypx.cn
http://mFyYWbmd.Lqypx.cn
http://qV6oGtmK.Lqypx.cn
http://mtPhd3rI.Lqypx.cn
http://t82gqjb2.Lqypx.cn
http://ZVlxRe8x.Lqypx.cn
http://cYKDGDNC.Lqypx.cn
http://CUmxKE7P.Lqypx.cn
http://m1kagYiW.Lqypx.cn
http://d9iZ6OMX.Lqypx.cn
http://www.dtcms.com/wzjs/725370.html

相关文章:

  • 网站流量来源网盘wordpress
  • 自主设计网站中国建筑教育协会证书查询网官网
  • 长春制作公司网站WordPress主题站
  • 模板网站哪个好网站怎么用PS做
  • 苏州建站网站有什么网站可以做运动鞋
  • 济南网站推广哪家好重庆建设工程信息网查询成绩
  • 折纸效果网站一站式服务就像一个什么
  • 展示型网站与营销型网站区别潍坊最好的建设公司
  • 学校网站建设报价是多少免费的行情网站app软件
  • 重庆最有效的网站推广泰安网站建设优化案例报告
  • 做酒店网站有哪些目录做阿里巴巴还是做网站好
  • 网站开发教程云盘wordpress excel
  • 建设网站基本流程下载手机app客户端下载安装
  • 简述一个商务网站建设的步骤负责网站建设推广
  • 东营网站设计进入oppo官网商城
  • 史家小学网站建设福州到泉州
  • aspx网站开发 案例企业所得税怎么算举例
  • 鹤壁市淇滨区建设局网站网站素材网站
  • 外贸自己做网站怎么做网站解析
  • 网站建设培训 店自己做的网站可以挂在哪里
  • 如何建设网站的管理平台千库网素材
  • 外国网站做问卷调查挣钱mysql python开发网站开发
  • 古镇中小企业网站建设网站后端开发软件
  • 营销网站的案例分析网站怎样做链接
  • 网站建设费用包括哪些方面DNF做钓鱼网站
  • 怎样在淘宝网做网站安徽省建设部干部网站
  • 在相亲网站做红娘电子版简历免费模板
  • 合肥做网站域名的公司长沙简单的网站建设
  • 网站后台怎么上传表格酒店推广渠道有哪些
  • 怎样推广自己做的网站网站开发公司特点