Browse Source

温度及密度参数

iZaiZaiA 2 years ago
parent
commit
ff72688751
1 changed files with 130 additions and 11 deletions
  1. 130 11
      src/views/tentative/parameter/density.vue

+ 130 - 11
src/views/tentative/parameter/density.vue

@@ -1,30 +1,149 @@
 <template>
-    <div class="hc-layout-box">
-        温度及密码参数
+    <div class="hc-page-box">
+        <HcCard>
+            <template #header>
+                <HcTooltip keys="tentative_parameter_density_add">
+                    <el-button type="primary" hc-btn @click="addFormModalClick">
+                        <HcIcon name="add-circle"/>
+                        <span>新增</span>
+                    </el-button>
+                </HcTooltip>
+                <HcTooltip keys="tentative_parameter_density_edit">
+                    <el-button hc-btn @click="editFormModalClick">
+                        <HcIcon name="edit"/>
+                        <span>编辑</span>
+                    </el-button>
+                </HcTooltip>
+                <HcTooltip keys="tentative_parameter_density_del">
+                    <el-button hc-btn @click="delModalClick">
+                        <HcIcon name="delete-bin-2"/>
+                        <span>删除</span>
+                    </el-button>
+                </HcTooltip>
+            </template>
+            <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck @selection-change="tableSelection"></HcTable>
+            <template #action>
+                <HcPages :pages="searchForm" @change="pageChange"/>
+            </template>
+        </HcCard>
+
+        <!--新增/编辑-->
+        <HcDialog :show="addEditFormModal" title="新增/编辑 温度信息" widths="30rem" :loading="addEditFormLoading" @close="addEditFormModalClose" @save="addEditFormClick">
+            <el-form ref="addEditFormRef" :model="addEditFormModel" :rules="addEditFormRules" label-width="auto" size="large">
+                <el-form-item label="温度" prop="key1">
+                    <el-input v-model="addEditFormModel.key1"/>
+                </el-form-item>
+                <el-form-item label="水密度" prop="key22">
+                    <el-input v-model="addEditFormModel.key2"/>
+                </el-form-item>
+            </el-form>
+        </HcDialog>
+
     </div>
 </template>
 
 <script setup>
-import {ref,watch,onMounted} from "vue";
-import {useRouter, useRoute} from 'vue-router'
+import {ref} from "vue";
 import {useAppStore} from "~src/store";
 
 //初始变量
-const router = useRouter()
-const useRoutes = useRoute()
 const useAppState = useAppStore()
-//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);
 const contractId = ref(useAppState.getContractId);
 
-</script>
+//搜索表单
+const searchForm = ref({queryValue: null, current: 1, size: 20, total: 0})
 
-<style lang="scss" scoped>
+//回车搜索
+const keyUpEvent = (e) => {
+    if (e.key === "Enter") {
+        searchForm.value.current = 1;
+        getTableData()
+    }
+}
 
-</style>
+//搜索
+const searchClick = () => {
+    searchForm.value.current = 1;
+    getTableData()
+}
+
+//分页被点击
+const pageChange = ({current, size}) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableRef = ref(null)
+const tableColumn = ref([
+    {key:'key1', name: '温度'},
+    {key:'key2', name: '密度'},
+])
+
+//获取数据
+const tableLoading = ref(false)
+const tableData = ref([])
+const getTableData = async () => {
+
+}
 
-<style lang="scss">
+//多选
+const tableCheckedKeys = ref([]);
+const tableSelection = (rows) => {
+    tableCheckedKeys.value = rows.filter((item) => {
+        return (item??'') !== '';
+    })
+}
+
+//新增/编辑 材料进场
+const addEditFormModal = ref(false)
+const addFormModalClick = () => {
+    addEditFormModal.value = true
+}
+const editFormModalClick = () => {
+    addEditFormModal.value = true
+}
+const addEditFormModalClose = () => {
+    addEditFormModal.value = false
+}
+
+//新增/编辑 表单
+const addEditFormRef = ref(null)
+const addEditFormModel = ref({})
+const addEditFormRules = {
+    key2: {
+        required: true,
+        trigger: 'blur',
+        message: "请输入"
+    },
+}
+
+//新增/编辑 保存
+const addEditFormLoading = ref(false)
+const addEditFormClick = () => {
+
+}
+
+//删除
+const delModalClick = () => {
+    window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
+        showCancelButton: true,
+        confirmButtonText: '确认删除',
+        cancelButtonText: '取消',
+        type: 'warning',
+        callback: (action) => {
+            if (action === 'confirm') {
+                //removeContractTreeNode()
+            }
+        }
+    })
+}
+</script>
+
+<style lang="scss" scoped>
 
 </style>