修bug
This commit is contained in:
@@ -118,7 +118,6 @@ export default {
|
|||||||
data.sort((a, b) => a.id - b.id);
|
data.sort((a, b) => a.id - b.id);
|
||||||
this.allDevices = data;
|
this.allDevices = data;
|
||||||
this.tableData = this.buildTreeData(data);
|
this.tableData = this.buildTreeData(data);
|
||||||
console.log('Final tableData:', this.tableData); // 添加这行日志
|
|
||||||
this.originalTableData = [...this.tableData]; // 保存原始顺序
|
this.originalTableData = [...this.tableData]; // 保存原始顺序
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.error = err.message || '未知错误';
|
this.error = err.message || '未知错误';
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
try {
|
try {
|
||||||
const data = await deviceTemplateService.getDeviceTemplates();
|
const response = await deviceTemplateService.getDeviceTemplates();
|
||||||
this.tableData = data;
|
// 确保只将数组部分赋值给 tableData
|
||||||
|
this.tableData = response.data || [];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.error = err.message || '未知错误';
|
this.error = err.message || '未知错误';
|
||||||
console.error('加载设备模板列表失败:', err);
|
console.error('加载设备模板列表失败:', err);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const { VueLoaderPlugin } = require('vue-loader');
|
const { VueLoaderPlugin } = require('vue-loader');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
const webpack = require('webpack'); // 引入 webpack 模块
|
||||||
|
|
||||||
module.exports = (env, argv) => {
|
module.exports = (env, argv) => {
|
||||||
const isDevelopment = argv.mode === 'development';
|
const isDevelopment = argv.mode === 'development';
|
||||||
@@ -38,6 +39,12 @@ module.exports = (env, argv) => {
|
|||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: './index.html',
|
template: './index.html',
|
||||||
filename: 'index.html'
|
filename: 'index.html'
|
||||||
|
}),
|
||||||
|
// 添加 Vue 特性标志的定义
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
__VUE_OPTIONS_API__: JSON.stringify(true),
|
||||||
|
__VUE_PROD_DEVTOOLS__: JSON.stringify(isDevelopment),
|
||||||
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(isDevelopment)
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
devServer: {
|
devServer: {
|
||||||
|
|||||||
Reference in New Issue
Block a user