|
@@ -1,10 +1,166 @@
|
|
<template>
|
|
<template>
|
|
|
|
+ <hc-tab-card :tabs="tabsData" :tab-key="tabsKey" @change="tabsChange">
|
|
|
|
+ <hc-card>
|
|
|
|
+ <template #extra>
|
|
|
|
+ <el-button hc-btn type="primary" @click="addRowClick"
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ type="danger"
|
|
|
|
+ :disabled="tableCheckKeys.length <= 0"
|
|
|
|
+ @click="batchDelClick"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button hc-btn type="warning" @click="impotClick"
|
|
|
|
+ >导入</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <hc-table
|
|
|
|
+ :loading="tableLoading"
|
|
|
|
+ :column="tableColumn"
|
|
|
|
+ :datas="tableData"
|
|
|
|
+ isCheck
|
|
|
|
+ @selection-change="tableSelectionChange"
|
|
|
|
+ >
|
|
|
|
+ <template #action="{ row, index }">
|
|
|
|
+ <el-button size="small" type="primary">编辑</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </hc-table>
|
|
|
|
+ <template #action>
|
|
|
|
+ <hc-pages :pages="searchForm" @change="pageChange" />
|
|
|
|
+ </template>
|
|
|
|
+ </hc-card>
|
|
|
|
+ </hc-tab-card>
|
|
|
|
+ <!-- 新增/修改 -->
|
|
|
|
+ <hc-dialog
|
|
|
|
+ v-model="isDataInfoShow"
|
|
|
|
+ is-footer-center
|
|
|
|
+ :title="isNullES(formModel.id) ? '新增' : '修改'"
|
|
|
|
+ @close="dialogClose"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ ref="formRef"
|
|
|
|
+ :model="formModel"
|
|
|
|
+ :rules="formRules"
|
|
|
|
+ label-position="top"
|
|
|
|
+ label-width="auto"
|
|
|
|
+ size="large"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="N值:" prop="valueN">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formModel.valueN"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请输入N值"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="保证率99%:"
|
|
|
|
+ prop="assuranceRateNinetyNinePercent"
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formModel.assuranceRateNinetyNinePercent"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="保证率95%:"
|
|
|
|
+ prop="assuranceRateNinetyFivePercent"
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formModel.assuranceRateNinetyFivePercent"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="保证率90%:" prop="assuranceRateNinetyPercent">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formModel.assuranceRateNinetyPercent"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button hc-btn @click="dialogClose">取消</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ type="primary"
|
|
|
|
+ :loading="submitLoading"
|
|
|
|
+ @click="dialogSubmit"
|
|
|
|
+ >提交</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </hc-dialog>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { onMounted, ref } from "vue";
|
|
|
|
+import mainApi from "~api/desk/test-params";
|
|
|
|
+import { getArrValue, isNullES } from "js-fast-way";
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getTableData();
|
|
|
|
+});
|
|
|
|
+const tabsKey = ref("1");
|
|
|
|
+const tabsData = ref([
|
|
|
|
+ { key: "1", name: "压实度评标参数" },
|
|
|
|
+ { key: "2", name: "温度及密度参数" },
|
|
|
|
+]);
|
|
|
|
+const tabsChange = (item) => {
|
|
|
|
+ console.log(item);
|
|
|
|
+};
|
|
|
|
+//新增、编辑
|
|
|
|
+const addRowClick = () => {
|
|
|
|
+ isDataInfoShow.value = true;
|
|
|
|
+};
|
|
|
|
|
|
|
|
+const isDataInfoShow = ref(false);
|
|
|
|
+const formModel = ref({});
|
|
|
|
+const formRules = {};
|
|
|
|
+const dialogClose = () => {};
|
|
|
|
+const submitLoading = ref(false);
|
|
|
|
+const dialogSubmit = () => {};
|
|
|
|
+const tableCheckKeys = ref([]);
|
|
|
|
+const batchDelClick = () => {};
|
|
|
|
+const impotClick = () => {};
|
|
|
|
+const tableColumn = [
|
|
|
|
+ { key: "valueN", name: "N值" },
|
|
|
|
+ { key: "assuranceRateNinetyNinePercent", name: "保证率99" },
|
|
|
|
+ { key: "assuranceRateNinetyFivePercent", name: "保证率95" },
|
|
|
|
+ { key: "assuranceRateNinetyPercent", name: "保证率90" },
|
|
|
|
+ { key: "action", name: "操作", width: 100 },
|
|
|
|
+];
|
|
|
|
+const searchForm = ref({ current: 1, size: 30, total: 0 });
|
|
|
|
+const tableData = ref([
|
|
|
|
+ { name: "名称1", text: "文本1", color: "red" },
|
|
|
|
+ { name: "名称2", text: "文本2", color: "blue" },
|
|
|
|
+ { name: "名称3", text: "文本3", color: "无" },
|
|
|
|
+]);
|
|
|
|
+const tableLoading = ref(false);
|
|
|
|
+const getTableData = async () => {
|
|
|
|
+ tableLoading.value = true;
|
|
|
|
+ const { code, msg, data } = await mainApi.getList({
|
|
|
|
+ ...searchForm.value,
|
|
|
|
+ total: null,
|
|
|
|
+ });
|
|
|
|
+ tableLoading.value = false;
|
|
|
|
+ if (code === 200) {
|
|
|
|
+ tableData.value = getArrValue(data?.records);
|
|
|
|
+ searchForm.value.total = data?.total || 0;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+//多选事件
|
|
|
|
+const tableSelectionChange = (rows) => {
|
|
|
|
+ console.log(rows);
|
|
|
|
+};
|
|
|
|
+//分页
|
|
|
|
+const pageChange = ({ current, size }) => {
|
|
|
|
+ searchForm.value.current = current;
|
|
|
|
+ searchForm.value.size = size;
|
|
|
|
+ getTableData();
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
|
-
|
|
|
|
-</style>
|
|
|
|
|
|
+<style scoped lang="scss"></style>
|