This commit is contained in:
姚宇浩 2024-11-12 09:06:41 +08:00
commit 353ead0cfc
4 changed files with 89 additions and 28 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -2,7 +2,7 @@ import axios from "axios";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import tools from "@/utils/tools"; import tools from "@/utils/tools";
import router from "../router"; import router from "../router";
// axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/' axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/'
axios.defaults.timeout = 120000; axios.defaults.timeout = 120000;
// HTTP request 拦截器 // HTTP request 拦截器

View File

@ -160,7 +160,7 @@ watch(
// } // }
// return item; // return item;
// }); // });
console.log(555, props.tableData); // console.log(555, props.tableData);
} }
); );

View File

@ -1,5 +1,10 @@
<template> <template>
<div class="module"> <div
class="module"
v-loading.fullscreen.lock="isLoading"
element-loading-text="Loading..."
element-loading-background="rgba(122, 122, 122, 0.5)"
>
<div class="displayFlex left_bg"> <div class="displayFlex left_bg">
<div class="bt_title"> <div class="bt_title">
<div class="yd_title"> <div class="yd_title">
@ -30,6 +35,7 @@
v-if="item.type == 'slot'" v-if="item.type == 'slot'"
:label="item.label" :label="item.label"
:prop="item.property" :prop="item.property"
:show-overflow-tooltip="item.tooltip"
:width="item.width || ''" :width="item.width || ''"
> >
<template #default="scope"> <template #default="scope">
@ -45,6 +51,7 @@
:label="item.label" :label="item.label"
:width="item.width || ''" :width="item.width || ''"
:prop="item.property" :prop="item.property"
:show-overflow-tooltip="item.tooltip"
/> />
</template> </template>
</el-table> </el-table>
@ -155,6 +162,7 @@
v-if="item.type == 'slot'" v-if="item.type == 'slot'"
:label="item.label" :label="item.label"
:prop="item.property" :prop="item.property"
:show-overflow-tooltip="item.tooltip"
:width="item.width || ''" :width="item.width || ''"
:align="item.align || 'left'" :align="item.align || 'left'"
> >
@ -219,6 +227,7 @@
:label="item.label" :label="item.label"
:width="item.width || ''" :width="item.width || ''"
:prop="item.property" :prop="item.property"
:show-overflow-tooltip="item.tooltip"
/> />
</template> </template>
</el-table> </el-table>
@ -297,6 +306,7 @@ const lampImages = {
const router = useRouter(); const router = useRouter();
const routers = useRoute(); const routers = useRoute();
const data = reactive({ const data = reactive({
name: "", name: "",
identNo: "", //ID identNo: "", //ID
@ -313,6 +323,7 @@ const data = reactive({
{ {
label: "地址", label: "地址",
property: "dz", property: "dz",
tooltip: true,
}, },
{ {
label: "年龄", label: "年龄",
@ -363,10 +374,11 @@ const data = reactive({
align: "center", align: "center",
type: "slot", type: "slot",
}, },
{ // {
label: "地址", // label: "",
property: "dz", // property: "dz",
}, // tooltip: true,
// },
{ {
label: "年龄", label: "年龄",
property: "nl", property: "nl",
@ -449,7 +461,7 @@ const lampScreen = (val) => {
if (selectedLamp.value === val) { if (selectedLamp.value === val) {
return; // return; //
} }
console.log(val);
if (val == 1 || val == 2) { if (val == 1 || val == 2) {
data.column_2 = [ data.column_2 = [
{ {
@ -465,10 +477,11 @@ const lampScreen = (val) => {
align: "center", align: "center",
type: "slot", type: "slot",
}, },
{ // {
label: "地址", // label: "",
property: "dz", // property: "dz",
}, // tooltip: true,
// },
{ {
label: "年龄", label: "年龄",
property: "nl", property: "nl",
@ -500,10 +513,11 @@ const lampScreen = (val) => {
align: "center", align: "center",
type: "slot", type: "slot",
}, },
{ // {
label: "地址", // label: "",
property: "dz", // property: "dz",
}, // tooltip: true,
// },
{ {
label: "年龄", label: "年龄",
property: "nl", property: "nl",
@ -519,7 +533,6 @@ const lampScreen = (val) => {
property: "operatesDeng", property: "operatesDeng",
type: "slot", type: "slot",
}, },
]; ];
} }
selectedLamp.value = val; selectedLamp.value = val;
@ -528,9 +541,10 @@ const lampScreen = (val) => {
}; };
//---------------- //----------------
/** /**
* 表格弹框 * 控制表格弹框和算法弹框的显示状态
* @param {*} dialogShow -弹框状态false表示关闭true表示开启 *
* @param {*} dialogShowSf -算法弹框状态false表示关闭true表示开启 * @param {boolean} dialogShow - 表格弹框的状态`false` 表示关闭`true` 表示打开
* @param {boolean} dialogShowSf - 算法弹框的状态`false` 表示关闭`true` 表示打开
*/ */
const dialogShow = ref(false); const dialogShow = ref(false);
const dialogShowSf = ref(false); const dialogShowSf = ref(false);
@ -748,7 +762,28 @@ const openSf = () => {
} }
}); });
}; };
const isLoading = ref(true);
let loadingCount = 0; //
//
function startLoading() {
loadingCount++;
isLoading.value = true; // true
// const isLoading = ElLoading.service({
// lock: true,
// text: 'Loading',
// background: 'rgba(0, 0, 0, 0.7)',
// })
}
//
function stopLoading() {
loadingCount--;
if (loadingCount === 0) {
isLoading.value = false; // false
}
}
const getTable = (pagination) => { const getTable = (pagination) => {
startLoading(); //
http http
.get( .get(
`${pagination.url}?page=${pagination.currentPage}&size=${pagination.pageSize}&xh=${routers.query.xh}&deng=${selectedLamp.value}` `${pagination.url}?page=${pagination.currentPage}&size=${pagination.pageSize}&xh=${routers.query.xh}&deng=${selectedLamp.value}`
@ -780,10 +815,19 @@ const getTable = (pagination) => {
// }; // };
// }); // });
// pagination2.total = res.count - 6; // pagination2.total = res.count - 6;
} else {
ElMessage.warning({ message: res.message });
} }
})
.catch((error) => {
console.error("请求失败", error);
})
.finally(() => {
stopLoading(); // stopLoading
}); });
}; };
const getTable1 = (pagination) => { const getTable1 = (pagination) => {
startLoading(); //
http http
.get(`${pagination.url}?sfzhm=${data.identNo}&xh=${routers.query.xh}`) .get(`${pagination.url}?sfzhm=${data.identNo}&xh=${routers.query.xh}`)
.then((res) => { .then((res) => {
@ -797,9 +841,16 @@ const getTable1 = (pagination) => {
message: res.message, message: res.message,
}); });
} }
})
.catch((error) => {
console.error("请求失败", error);
})
.finally(() => {
stopLoading(); // stopLoading
}); });
}; };
const getTable2 = (pagination) => { const getTable2 = (pagination) => {
startLoading(); //
http http
.get(`${pagination.url1}?dxbm=${data.dxbm}&xh=${routers.query.xh}`) .get(`${pagination.url1}?dxbm=${data.dxbm}&xh=${routers.query.xh}`)
.then((res) => { .then((res) => {
@ -813,6 +864,12 @@ const getTable2 = (pagination) => {
message: res.message, message: res.message,
}); });
} }
})
.catch((error) => {
console.error("请求失败", error);
})
.finally(() => {
stopLoading(); // stopLoading
}); });
}; };
@ -938,6 +995,7 @@ onMounted(() => {
{ {
label: "地址", label: "地址",
property: "dz", property: "dz",
tooltip: true,
}, },
]; ];
data.column_2 = [ data.column_2 = [
@ -956,10 +1014,11 @@ onMounted(() => {
label: "统一社会信用代码", label: "统一社会信用代码",
property: "dxbm", property: "dxbm",
}, },
{ // {
label: "地址", // label: "",
property: "dz", // property: "dz",
}, // tooltip: true,
// },
]; ];
} }
if (data.name == "药品安全监管") { if (data.name == "药品安全监管") {
@ -977,6 +1036,7 @@ onMounted(() => {
{ {
label: "地址", label: "地址",
property: "dz", property: "dz",
tooltip: true,
}, },
]; ];
data.column_2 = [ data.column_2 = [
@ -995,10 +1055,11 @@ onMounted(() => {
label: "许可证编号", label: "许可证编号",
property: "dxbm", property: "dxbm",
}, },
{ // {
label: "地址", // label: "",
property: "dz", // property: "dz",
}, // tooltip: true,
// },
]; ];
} }
listAssignment(); listAssignment();