Browse Source

试验管理,打印空表

iZaiZaiA 2 years ago
parent
commit
e878b36593

+ 13 - 2
src/views/tentative/detect/test-form.vue

@@ -63,6 +63,10 @@
                     <HcIcon name="arrow-go-back"/>
                     <span>撤回上报流程</span>
                 </el-button>
+                <el-button hc-btn @click="toBackClick">
+                    <HcIcon name="delete-back"/>
+                    <span>返回</span>
+                </el-button>
             </template>
         </HcCard>
 
@@ -118,11 +122,12 @@
 <script setup>
 import {ref, watch, onMounted} from "vue";
 import {useAppStore} from "~src/store";
-import {useRoute} from 'vue-router'
+import {useRouter, useRoute} from 'vue-router'
 import ListItem from "./components/ListItem.vue"
 import WbsTree from "../../data-fill/components/WbsTree.vue"
 
 //变量
+const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId);
@@ -263,7 +268,13 @@ const linksSampleModalClose = () => {
     linksSampleModal.value = false
 }
 
-
+//返回
+const toBackClick = () => {
+    router.push({
+        path: '/tentative/detect/test',
+        query: {}
+    })
+}
 </script>
 
 <style lang="scss" scoped>

+ 139 - 14
src/views/tentative/laboratory/print.vue

@@ -1,30 +1,155 @@
 <template>
-    <div class="hc-layout-box">
-        打印空表
+    <div class="hc-page-layout-box">
+        <div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'">
+            <div class="hc-project-box">
+                <div class="hc-project-icon-box">
+                    <HcIcon name="stack"/>
+                </div>
+                <div class="ml-2 project-name-box">
+                    <span class="text-xl text-cut project-alias">{{projectInfo['projectAlias']}}</span>
+                    <div class="text-xs text-cut project-name">{{projectInfo['name']}}</div>
+                </div>
+            </div>
+            <div class="hc-tree-box">
+                <el-scrollbar>
+                    <WbsTree :autoExpandKeys="treeAutoExpandKeys" :projectId="projectId" :contractId="contractId" isColor @nodeTap="wbsElTreeClick"/>
+                </el-scrollbar>
+            </div>
+            <!--左右拖动-->
+            <div class="horizontal-drag-line" @mousedown="onmousedown"/>
+        </div>
+        <div class="hc-page-content-box">
+            <HcCard :scrollbar="false" actionSize="lg">
+                <template #header>
+                    <HcTooltip keys="tentative_laboratory_print_print">
+                        <el-button hc-btn>
+                            <HcIcon name="printer"/>
+                            <span>打印</span>
+                        </el-button>
+                    </HcTooltip>
+                    <HcTooltip keys="tentative_laboratory_print_print_all">
+                        <el-button hc-btn>
+                            <HcIcon name="printer" fill/>
+                            <span>全部打印</span>
+                        </el-button>
+                    </HcTooltip>
+                </template>
+                <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck @selection-change="tableSelection"/>
+                <template #action>
+                    <HcPages :pages="searchForm" @change="pageChange"/>
+                </template>
+            </HcCard>
+        </div>
     </div>
 </template>
 
 <script setup>
-import {ref,watch,onMounted} from "vue";
-import {useRouter, useRoute} from 'vue-router'
+import {ref, watch, onMounted} from "vue";
 import {useAppStore} from "~src/store";
+import WbsTree from "../../data-fill/components/WbsTree.vue"
+import {getStoreData, setStoreData} from '~src/utils/storage'
 
-//初始变量
-const router = useRouter()
-const useRoutes = useRoute()
+//变量
 const useAppState = useAppStore()
-//const {getObjValue, getArrValue} = isType()
-
-//全局变量
 const projectId = ref(useAppState.getProjectId);
 const contractId = ref(useAppState.getContractId);
+const projectInfo = ref(useAppState.getProjectInfo);
+const isCollapse = ref(useAppState.getCollapse)
 
-</script>
+//监听
+watch(() => [
+    useAppState.getCollapse
+], ([Collapse]) => {
+    isCollapse.value = Collapse
+})
 
-<style lang="scss" scoped>
+//自动展开缓存
+const treeAutoExpandKeys = ref(getStoreData('wbsTreeExpandKeys') || [])
 
-</style>
+//渲染完成
+onMounted(() => {
+
+})
+
+//搜索表单
+const searchForm = ref({
+    contractId: null, type: null, approval: null, betweenTime: null,
+    current: 1, size: 20, total: 0
+})
+
+//树相关的变量
+const primaryKeyId = ref('')
+const nodeItemInfo = ref({})
+const nodeDataInfo = ref({})
+
+//树被点击
+const wbsElTreeClick = ({node, data, keys}) => {
+    nodeItemInfo.value = node
+    nodeDataInfo.value = data
+    primaryKeyId.value = data['primaryKeyId'] || ''
+    //缓存自动展开
+    treeAutoExpandKeys.value = keys
+    setStoreData('wbsTreeExpandKeys',keys)
+    //改变搜索表单数据
+    //searchForm.value.wbsId = data['contractIdRelation'] ? data['id'] : data['primaryKeyId']
+    //searchForm.value.contractIdRelation = data['contractIdRelation']
+    searchForm.value.current = 1;
+    getTableData()
+}
+
+//分页被点击
+const pageChange = ({current, size}) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
 
-<style lang="scss">
+//表格数据
+const tableRef = ref(null)
+const tableColumn = ref([
+    {key:'key1', name: '表名'}
+])
+
+//获取数据
+const tableLoading = ref(false)
+const tableData = ref([])
+const getTableData = async () => {
+
+}
+
+//多选
+const tableCheckedKeys = ref([]);
+const tableSelection = (rows) => {
+    tableCheckedKeys.value = rows.filter((item) => {
+        return (item??'') !== '';
+    })
+}
+
+
+//拼接ID
+const rowsToId = (rows) => {
+    return rows.map((obj) => {
+        return obj.id;
+    }).join(",")
+}
+
+//左右拖动,改变树形结构宽度
+const leftWidth = ref(382);
+const onmousedown = () => {
+    const leftNum = isCollapse.value ? 142 : 272
+    document.onmousemove = (ve) => {
+        let diffVal = ve.clientX - leftNum;
+        if(diffVal >= 310 && diffVal <= 900) {
+            leftWidth.value = diffVal;
+        }
+    }
+    document.onmouseup = () => {
+        document.onmousemove = null;
+        document.onmouseup = null;
+    }
+}
+</script>
+
+<style lang="scss" scoped>
 
 </style>

+ 2 - 2
src/views/tentative/laboratory/user.vue

@@ -13,7 +13,7 @@
                 </div>
             </template>
             <template #extra>
-                <HcTooltip keys="tentative_parameter_density_add">
+                <HcTooltip keys="tentative_laboratory_user_add">
                     <el-button type="primary" hc-btn @click="addFormModalClick">
                         <HcIcon name="add-circle"/>
                         <span>新增</span>
@@ -25,7 +25,7 @@
                         <span>编辑</span>
                     </el-button>
                 </HcTooltip>
-                <HcTooltip keys="tentative_parameter_density_del">
+                <HcTooltip keys="tentative_laboratory_user_del">
                     <el-button hc-btn @click="delModalClick">
                         <HcIcon name="delete-bin-2"/>
                         <span>删除</span>