|
@@ -54,7 +54,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="标签" prop="tags">
|
|
|
+ <el-form-item label="设备标签" prop="tags">
|
|
|
<el-select
|
|
|
v-model="tableData.param.tags"
|
|
|
multiple
|
|
@@ -62,7 +62,7 @@
|
|
|
allow-create
|
|
|
default-first-option
|
|
|
placeholder="请输入标签"
|
|
|
- style="width: 225px"
|
|
|
+ style="width: 260px"
|
|
|
clearable
|
|
|
>
|
|
|
</el-select>
|
|
@@ -421,35 +421,13 @@ export default defineComponent({
|
|
|
// 获取部门树
|
|
|
const getDeptTree = () => {
|
|
|
systemApi.dept.getList({status: -1}).then((res: any) => {
|
|
|
- // 完整打印响应对象
|
|
|
- console.log('部门树完整响应:', JSON.stringify(res));
|
|
|
-
|
|
|
- try {
|
|
|
- // 尝试多种可能的数据访问路径
|
|
|
- if (res && res.data && res.data.Data) {
|
|
|
- deptOptions.value = res.data.Data;
|
|
|
- console.log('路径1 - res.data.Data:', deptOptions.value);
|
|
|
- } else if (res && res.Data) {
|
|
|
- deptOptions.value = res.Data;
|
|
|
- console.log('路径2 - res.Data:', deptOptions.value);
|
|
|
- } else if (Array.isArray(res)) {
|
|
|
- deptOptions.value = res;
|
|
|
- console.log('路径3 - res是数组:', deptOptions.value);
|
|
|
- } else {
|
|
|
- // 尝试直接使用原始数据
|
|
|
- console.log('找不到有效的部门数据路径,响应类型:', typeof res);
|
|
|
- console.log('响应顶级属性:', Object.keys(res));
|
|
|
- if (res && typeof res === 'object') {
|
|
|
- for (const key in res) {
|
|
|
- console.log(`res.${key} 类型:`, typeof res[key]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- console.error('处理部门数据时出错:', err);
|
|
|
+ if (Array.isArray(res)) {
|
|
|
+ deptOptions.value = res;
|
|
|
+ } else {
|
|
|
+ console.error('获取部门树失败,返回数据不是数组', res);
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
- console.error('获取部门树出错:', error);
|
|
|
+ console.error('获取部门树出错', error);
|
|
|
});
|
|
|
};
|
|
|
|