|
@@ -15,17 +15,19 @@
|
|
|
>
|
|
|
<el-menu-item
|
|
|
v-for="(item, index) in majorDataTypeList"
|
|
|
- :index="inedx"
|
|
|
:key="index"
|
|
|
+ :index="String(index)"
|
|
|
>
|
|
|
- <i class="el-icon-s-opportunity"></i>
|
|
|
+ <HcIcon name="lightbulb" />
|
|
|
+
|
|
|
<span>{{ item.label }}</span>
|
|
|
</el-menu-item>
|
|
|
</el-menu>
|
|
|
</hc-card>
|
|
|
</template>
|
|
|
- <hc-card scrollbar>
|
|
|
+ <hc-card scrollbar v-if="isShowTree">
|
|
|
<ElTree
|
|
|
+ ref="treeRef"
|
|
|
:load="treeLoadNode"
|
|
|
:props="treeProps"
|
|
|
accordion
|
|
@@ -70,9 +72,9 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
- <template #action>
|
|
|
+ <!-- <template #action>
|
|
|
<hc-pages :pages="searchForm" @change="pageChange" />
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</hc-card>
|
|
|
</template>
|
|
|
</hc-body>
|
|
@@ -84,6 +86,8 @@ import { ref, watch } from "vue";
|
|
|
import { getArrValue, arrToId, isNullES } from "js-fast-way";
|
|
|
import mainApi from "~api/desk/wbs";
|
|
|
import { getDictionaryData } from "~src/utils/tools";
|
|
|
+import treeApi from "~api/wbs/tree";
|
|
|
+import privateApi from "~api/wbs/private";
|
|
|
|
|
|
//事件
|
|
|
const emit = defineEmits(["close"]);
|
|
@@ -98,8 +102,15 @@ watch(isShow, (val) => {
|
|
|
if (val) getDataApi();
|
|
|
});
|
|
|
//最左侧菜单
|
|
|
-const activeIndex = ref("");
|
|
|
-const selectMajorDataType = (index) => {};
|
|
|
+const activeIndex = ref("1");
|
|
|
+
|
|
|
+const selectMajorDataType = (key, keyPath) => {
|
|
|
+ activeIndex.value = key;
|
|
|
+ isShowTree.value = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ isShowTree.value = true;
|
|
|
+ }, 10);
|
|
|
+};
|
|
|
const majorDataTypeList = ref([]);
|
|
|
const getMajorDataTypeList = async () => {
|
|
|
majorDataTypeList.value = await getDictionaryData("major_data_type", true);
|
|
@@ -107,7 +118,6 @@ const getMajorDataTypeList = async () => {
|
|
|
//处理相关数据
|
|
|
const getDataApi = async () => {
|
|
|
await getMajorDataTypeList();
|
|
|
- getTreeData();
|
|
|
};
|
|
|
|
|
|
//树配置
|
|
@@ -117,16 +127,6 @@ const treeProps = {
|
|
|
isLeaf: "isLeaf",
|
|
|
};
|
|
|
|
|
|
-//获取树接口
|
|
|
-const treeData = ref([]);
|
|
|
-const getTreeData = async () => {
|
|
|
- const { data } = await mainApi.tabTypeLazyTreeAll({
|
|
|
- parentId: "12345678910",
|
|
|
- current: 1,
|
|
|
- size: 1000,
|
|
|
- });
|
|
|
- treeData.value = getArrValue(data?.records);
|
|
|
-};
|
|
|
//获取数据
|
|
|
const tabTypeLazyTree = async (parentId = "12345678910") => {
|
|
|
//发起请求
|
|
@@ -134,6 +134,7 @@ const tabTypeLazyTree = async (parentId = "12345678910") => {
|
|
|
parentId,
|
|
|
current: 1,
|
|
|
size: 1000,
|
|
|
+ majorDataType: activeIndex.value,
|
|
|
});
|
|
|
const records = getArrValue(data?.records);
|
|
|
records.forEach((item) => {
|
|
@@ -141,6 +142,8 @@ const tabTypeLazyTree = async (parentId = "12345678910") => {
|
|
|
});
|
|
|
return { data: records, total: data?.total };
|
|
|
};
|
|
|
+const treeRef = ref(null);
|
|
|
+const isShowTree = ref(true);
|
|
|
const treeLoadNode = async (node, resolve) => {
|
|
|
if (node.level === 0) {
|
|
|
const resData = await tabTypeLazyTree();
|
|
@@ -163,14 +166,7 @@ const treeLoadNode = async (node, resolve) => {
|
|
|
const nodeInfo = ref({});
|
|
|
const treeNodeTap = (data, node) => {
|
|
|
nodeInfo.value = data;
|
|
|
- searchForm.value.parentId = data.id;
|
|
|
-
|
|
|
- if (node?.level === 1) {
|
|
|
- searchClick();
|
|
|
- } else if (node?.level === 2) {
|
|
|
- searchForm.value.total = 1;
|
|
|
- tableData.value = [data];
|
|
|
- }
|
|
|
+ getTableData();
|
|
|
};
|
|
|
|
|
|
//搜索表单
|
|
@@ -178,13 +174,9 @@ const searchForm = ref({ current: 1, size: 30, total: 0 });
|
|
|
|
|
|
//搜索
|
|
|
const searchClick = () => {
|
|
|
- const { parentId } = searchForm.value;
|
|
|
- if (isNullES(parentId)) {
|
|
|
- window?.$message?.warning("请先在左侧点击一个节点");
|
|
|
- return;
|
|
|
- }
|
|
|
- searchForm.value.current = 1;
|
|
|
- getTableData();
|
|
|
+ tableData.value = tableData.value.filter((ele) => {
|
|
|
+ return ele.eName.indexOf(searchForm.value.titleName) > -1;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
//分页
|
|
@@ -202,7 +194,7 @@ const pageChange = ({ current, size }) => {
|
|
|
//表格数据
|
|
|
const tableData = ref([]);
|
|
|
const tableColumn = ref([
|
|
|
- { key: "title", name: "字段信息" },
|
|
|
+ { key: "eName", name: "字段信息" },
|
|
|
{ key: "action", name: "操作", width: 220, align: "center" },
|
|
|
]);
|
|
|
|
|
@@ -211,17 +203,36 @@ const tableLoading = ref(false);
|
|
|
const getTableData = async () => {
|
|
|
tableData.value = [];
|
|
|
tableLoading.value = true;
|
|
|
- const { data } = await mainApi.tabTypeLazyTreeAll({
|
|
|
- ...searchForm.value,
|
|
|
- total: null,
|
|
|
+ const { data } = await treeApi.getTableElments({
|
|
|
+ id: nodeInfo.value.id,
|
|
|
});
|
|
|
tableLoading.value = false;
|
|
|
- tableData.value = getArrValue(data?.records);
|
|
|
+ tableData.value = getArrValue(data);
|
|
|
searchForm.value.total = data?.total || 0;
|
|
|
};
|
|
|
//设置为文件日期
|
|
|
-const setFiledate = (row) => {};
|
|
|
-const quitFiledate = (row) => {};
|
|
|
+const setFiledate = async (row) => {
|
|
|
+ let colId = row.id;
|
|
|
+ let colKey = row.tableElementKey;
|
|
|
+ let tableId = nodeInfo.value.initTableId;
|
|
|
+ const { data, res, code, error } = await privateApi.saveTabusstime({
|
|
|
+ colId: colId,
|
|
|
+ colKey: colKey,
|
|
|
+ tableId: tableId,
|
|
|
+ });
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(res.msg);
|
|
|
+ getTableData();
|
|
|
+ }
|
|
|
+};
|
|
|
+const quitFiledate = async (row) => {
|
|
|
+ const { res, code, error } = await privateApi.removeTabusstime(row.id);
|
|
|
+ console.log(res);
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(res.msg);
|
|
|
+ getTableData();
|
|
|
+ }
|
|
|
+};
|
|
|
//关闭抽屉
|
|
|
const drawerClose = () => {
|
|
|
isShow.value = false;
|