update home
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-02 09:34:56
|
||||
* @LastEditTime: 2024-04-09 16:56:16
|
||||
* @Description:
|
||||
*/
|
||||
import { listData } from "@/api/system/dict/data"; //数据字典接口
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
createURL: '', //新增接口
|
||||
updateURL: '', //编辑提交接口
|
||||
infoURL: '', //编辑时获取单条数据接口
|
||||
codeURL: '', //获取code接口(返回结果为dataForm.code字段)
|
||||
codeURL: null, //获取code接口(返回结果为dataForm.code字段)
|
||||
optionArrUrl: [], //需要获取下拉框的方法数组
|
||||
optionArr: {}, //需要获取下拉框的方法数组的返回结果
|
||||
dictNameList: [], //数据字典name数组
|
||||
@@ -35,7 +35,7 @@ export default {
|
||||
if (this.urlOptions.optionArrUrl.length > 0) {
|
||||
this.getArr()
|
||||
}
|
||||
if (this.urlOptions.dictNameList > 0) {
|
||||
if (this.urlOptions.dictNameList.length > 0) {
|
||||
this.getDict()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
@@ -78,7 +78,7 @@ export default {
|
||||
},
|
||||
/** 查询字典数据列表 */
|
||||
getDict() {
|
||||
this.dictNameList.forEach((item,index)=>{
|
||||
this.urlOptions.dictNameList.forEach((item,index)=>{
|
||||
const queryParams = {
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
|
||||
101
src/mixins/chart.js
Normal file
101
src/mixins/chart.js
Normal file
@@ -0,0 +1,101 @@
|
||||
import * as echarts from "echarts";
|
||||
|
||||
function __resizeHandler(entries) {
|
||||
for (const entry of entries) {
|
||||
if (entry.contentBoxSize) {
|
||||
// manipulate contentBoxSize
|
||||
const contentBoxSize = Array.isArray(entry.contentBoxSize)
|
||||
? entry.contentBoxSize[0]
|
||||
: entry.contentBoxSize;
|
||||
this.chart_mixin_chartInstance.resize({
|
||||
width:
|
||||
contentBoxSize.inlineSize < this.MIN_WIDTH
|
||||
? this.MIN_WIDTH
|
||||
: contentBoxSize.inlineSize,
|
||||
height: contentBoxSize.blockSize,
|
||||
});
|
||||
} else {
|
||||
// manipulate contentRect
|
||||
this.chart_mixin_chartInstance.resize({
|
||||
width:
|
||||
entry.contentRect.width < this.MIN_WIDTH
|
||||
? this.MIN_WIDTH
|
||||
: entry.contentRect.width,
|
||||
height: entry.contentRect.height,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const resizeObserver = new ResizeObserver(__resizeHandler.bind(this));
|
||||
|
||||
return {
|
||||
MIN_WIDTH: 400,
|
||||
chart_mixin_chartInstance: null,
|
||||
chart_mixin_observer: resizeObserver,
|
||||
chart_mixin_options: {
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "4%",
|
||||
bottom: "3%",
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
data: ["Sales"],
|
||||
},
|
||||
xAxis: {
|
||||
data: [
|
||||
"shirt",
|
||||
"cardign",
|
||||
"chiffon shirt",
|
||||
"pants",
|
||||
"heels",
|
||||
"socks",
|
||||
],
|
||||
},
|
||||
yAxis: {},
|
||||
series: [
|
||||
{
|
||||
name: "Sales",
|
||||
type: "bar",
|
||||
data: [5, 20, 36, 10, 10, 20],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.$nextTick(() => {
|
||||
// this.initChart().then(() => {
|
||||
// this.initOptions(this.chart_mixin_options);
|
||||
// this.initListener();
|
||||
// });
|
||||
// });
|
||||
this.initChart();
|
||||
this.initListener();
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
(this.$refs.chart ||
|
||||
console.warn('[mixins/chart] 注意是否有 ref="chart" 的元素存在')) &&
|
||||
(this.chart_mixin_chartInstance = echarts.init(this.$refs.chart));
|
||||
// return new Promise((resolve, reject) => {
|
||||
// this.$refs.chart ? resolve(true) : reject(false);
|
||||
// });
|
||||
},
|
||||
initOptions(options) {
|
||||
this.chart_mixin_chartInstance.setOption(options);
|
||||
},
|
||||
initListener() {
|
||||
this.chart_mixin_observer.observe(this.$refs.chart);
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.chart_mixin_chartInstance) {
|
||||
this.chart_mixin_chartInstance.dispose();
|
||||
}
|
||||
},
|
||||
};
|
||||
23
src/mixins/fullscreen.js
Normal file
23
src/mixins/fullscreen.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import screenfull from "screenfull";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isFullscreen: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
|
||||
isFullscreen(val) {
|
||||
// 暴露一个全屏状态改变的回调函数
|
||||
this.fullscreenCallback(val);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (screenfull.isEnabled) {
|
||||
screenfull.on("change", () => {
|
||||
this.isFullscreen = screenfull.isFullscreen;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user