feat: 测试提交1

dev-deviceSetting
donghao
parent 1924de58c4
commit 9a57f78974

@ -2,15 +2,15 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-12 14:35:28 * @Date: 2024-01-12 14:35:28
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-01-17 13:17:41 * @LastEditTime: 2024-01-19 16:31:46
* @FilePath: \General-AI-Platform-Web-Client\.husky\lintstagedrc.js * @FilePath: \General-AI-Platform-Web-Client\.husky\lintstagedrc.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
module.exports = { module.exports = {
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"], "*.{js,jsx,ts,tsx}": ["prettier --write"],
"{!(package)*.json}": ["prettier --write--parser json"], "{!(package)*.json}": ["prettier --write--parser json"],
"package.json": ["prettier --write"], "package.json": ["prettier --write"],
"*.vue": ["eslint --fix", "prettier --write"], "*.vue": ["prettier --write"],
"*.{vue,css,scss,postcss,less}": ["prettier --write"], "*.{vue,css,scss,postcss,less}": ["prettier --write"],
"*.md": ["prettier --write"] "*.md": ["prettier --write"]
}; };

@ -3,77 +3,77 @@ import CollapseTreeItem from "./collapseTreeItem";
import "./collapseTreeStyle.scss"; import "./collapseTreeStyle.scss";
const testDeviceTreeData = [ const testDeviceTreeData = [
{ {
name: "控制设备组1", name: "分析设备组",
id: "11", id: "11",
level: 0, level: 0,
expended: true, expended: true,
childList: [ childList: [
{ {
name: "控制器A", name: "分析设备",
id: "1101", id: "分析设备",
level: 1, level: 1
childList: [ // childList: [
{ // {
name: "控制器A1", // name: "控制器A1",
id: "1101001", // id: "1101001",
level: 2, // level: 2,
childList: [ // childList: [
{ // {
name: "控制器A1a1", // name: "控制器A1a1",
id: "110100101", // id: "110100101",
level: 3 // level: 3
}, // },
{ // {
name: "控制器A2a2", // name: "控制器A2a2",
id: "110100202", // id: "110100202",
level: 3 // level: 3
} // }
] // ]
}, // },
{ // {
name: "控制器A2", // name: "控制器A2",
id: "1101002", // id: "1101002",
level: 2 // level: 2
} // }
] // ]
}, },
{ {
name: "控制器B", name: "控制设备2",
id: "1102", id: "1102",
level: 1 level: 1
}, },
{ {
name: "控制器C", name: "控制设备3",
id: "1103", id: "1103",
level: 1 level: 1
}, },
{ {
name: "控制器D", name: "控制设备4",
id: "1104", id: "1104",
level: 1 level: 1
} }
] ]
}, },
{ {
name: "制设备组2", name: "控",
id: "12", id: "12",
level: 0, level: 0,
childList: [ childList: [
{ {
name: "控制器B", name: "监控1",
id: "1202", id: "监控1",
level: 1 level: 1
}, },
{ {
name: "控制器C", name: "监控2",
id: "1203", id: "1203",
level: 1 level: 1
},
{
name: "控制器D",
id: "1204",
level: 1
} }
// {
// name: "控制器D",
// id: "1204",
// level: 1
// }
] ]
} }
]; ];

@ -91,7 +91,7 @@ const props = defineProps({
position: relative; position: relative;
width: 100%; width: 100%;
height: calc(100vh - 48px - 2 * 24px); height: calc(100vh - 48px - 2 * 24px);
overflow: scroll; overflow: hidden;
/* height: 100vh; */ /* height: 100vh; */
overflow-x: hidden; overflow-x: hidden;

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-12 14:35:28 * @Date: 2024-01-12 14:35:28
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-01-17 10:02:25 * @LastEditTime: 2024-01-19 15:04:59
* @FilePath: \General-AI-Platform-Web-Client\src\layout\components\notice\index.vue * @FilePath: \General-AI-Platform-Web-Client\src\layout\components\notice\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
@ -67,8 +67,7 @@ notices.value.map(v => (noticesNum.value += v.list.length));
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 40px; width: 40px;
height: 48px;
/* height: 48px; */
margin-right: 10px; margin-right: 10px;
cursor: pointer; cursor: pointer;

@ -6,6 +6,7 @@ export default {
title: $t("menus.hsComputePowerAllocation"), title: $t("menus.hsComputePowerAllocation"),
icon: "icon-suanlipeizhi", icon: "icon-suanlipeizhi",
// showLink: false, // showLink: false,
bodyClass: ["computePowerAllocation_page"],
rank: 6, rank: 6,
roles: ["admin", "common"] roles: ["admin", "common"]
}, },

@ -18,7 +18,6 @@ const animation1 = ref(null); //获取dom;
</li> </li>
</ul> </ul>
<img src="" alt="" /> <img src="" alt="" />
{{ animation1 }}
</div> </div>
</template> </template>

@ -2,7 +2,9 @@
import TreeCard from "./components/TreeCard.vue"; import TreeCard from "./components/TreeCard.vue";
import DeviceCard from "./components/DeviceCard.vue"; import DeviceCard from "./components/DeviceCard.vue";
import { getCardList } from "@/api/list"; import { getCardList } from "@/api/list";
import { onMounted, reactive, ref } from "vue"; import { onMounted, ref, watch, onBeforeUnmount, nextTick } from "vue";
import { emitter } from "@/utils/mitt";
defineOptions({ defineOptions({
name: "DeviceList" name: "DeviceList"
}); });
@ -24,9 +26,9 @@ const deviceList = ref([]);
const searchValue = ref(""); const searchValue = ref("");
const formData = reactive({ const formData = ref({
deviceSort: "", deviceSort: "",
deviceState: "", state: "",
isEnabled: "" isEnabled: ""
}); });
const dataLoading = ref(true); const dataLoading = ref(true);
@ -43,11 +45,26 @@ const onCurrentChange = (current: number) => {
const getCardListData = async () => { const getCardListData = async () => {
try { try {
const { data } = await getCardList(); const { data } = await getCardList();
deviceList.value = data.list;
console.log(data.list); console.log(data.list);
let finalList = data.list;
if (formData.value.deviceSort) {
finalList = finalList.filter(
item => item.deviceSort === formData.value.deviceSort
);
}
if (formData.value.state) {
finalList = finalList.filter(item => item.state === formData.value.state);
}
if (formData.value.isEnabled) {
finalList = finalList.filter(
item => item.isEnabled + "" === formData.value.isEnabled
);
}
deviceList.value = finalList;
pagination.value = { pagination.value = {
...pagination.value, ...pagination.value,
total: data.list.length total: finalList.length
}; };
} catch (e) { } catch (e) {
console.log(e); console.log(e);
@ -57,6 +74,32 @@ const getCardListData = async () => {
}, 500); }, 500);
} }
}; };
nextTick(() => {
emitter.on("changCollapseTreeNodeId", data => {
formData.value = {
...formData.value,
deviceSort: data
};
});
});
onBeforeUnmount(() => {
// `changCollapseTreeNodeId`
emitter.off("changCollapseTreeNodeId");
});
watch(
() => formData.value,
() => {
console.log(formData, "formData");
getCardListData();
},
{
deep: true
}
);
onMounted(() => { onMounted(() => {
getCardListData(); getCardListData();
}); });
@ -74,7 +117,7 @@ onMounted(() => {
<el-form :inline="true" :model="formData" class="demo-form-inline"> <el-form :inline="true" :model="formData" class="demo-form-inline">
<el-form-item label="设备分类"> <el-form-item label="设备分类">
<el-select <el-select
v-model="formData.deviceState" v-model="formData.deviceSort"
placeholder="设备分类" placeholder="设备分类"
clearable clearable
> >
@ -83,24 +126,20 @@ onMounted(() => {
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备状态"> <el-form-item label="设备状态">
<el-select <el-select v-model="formData.state" placeholder="设备状态" clearable>
v-model="formData.deviceState" <el-option label="在线" value="在线" />
placeholder="设备状态" <el-option label="故障" value="故障" />
clearable <el-option label="离线" value="离线" />
>
<el-option label="在线" value="1" />
<el-option label="故障" value="2" />
<el-option label="离线" value="0" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否启用"> <el-form-item label="是否启用">
<el-select <el-select
v-model="formData.deviceState" v-model="formData.isEnabled"
placeholder="是否启用" placeholder="是否启用"
clearable clearable
> >
<el-option label="已启用" value="1" /> <el-option label="已启用" value="true" />
<el-option label="未启用" value="0" /> <el-option label="未启用" value="false" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>

Loading…
Cancel
Save