|
@@ -1,96 +1,104 @@
|
|
|
<script setup>
|
|
|
-import {getTemplateByCodeAndType} from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
|
|
|
-import {getWindowSize} from "@/utils/window-size";
|
|
|
-import {BizException, ExceptionEnum} from "@/utils/BizException";
|
|
|
-import XEUtils from 'xe-utils'
|
|
|
-import {jyJcRestriction} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
+import { getTemplateByCodeAndType } from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
|
|
|
+import { getWindowSize } from "@/utils/window-size";
|
|
|
+import { BizException, ExceptionEnum } from "@/utils/BizException";
|
|
|
+import XEUtils from "xe-utils";
|
|
|
+import { jyJcRestriction } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
|
|
|
|
|
|
const props = defineProps({
|
|
|
isCheck: {
|
|
|
type: Boolean,
|
|
|
- default: true
|
|
|
+ default: true,
|
|
|
},
|
|
|
data: {
|
|
|
type: Array,
|
|
|
},
|
|
|
- height: [String, Number]
|
|
|
-})
|
|
|
+ height: [String, Number],
|
|
|
+});
|
|
|
|
|
|
-const emits = defineEmits(['node-click', 'delClick'])
|
|
|
+const emits = defineEmits(["node-click", "delClick"]);
|
|
|
|
|
|
-const vxeTableRef = ref(null)
|
|
|
-const dialog = ref(false)
|
|
|
-const tempList = ref([])
|
|
|
+const vxeTableRef = ref(null);
|
|
|
+const dialog = ref(false);
|
|
|
+const tempList = ref([]);
|
|
|
|
|
|
-const cellClick = ({row}) => {
|
|
|
- getTemplateByCodeAndType(row.code, props.isCheck ? '3' : '2').then((res) => {
|
|
|
- dialog.value = true
|
|
|
- tempList.value = res
|
|
|
- })
|
|
|
-}
|
|
|
+const cellClick = ({ row }) => {
|
|
|
+ getTemplateByCodeAndType(row.code, props.isCheck ? "3" : "2").then(res => {
|
|
|
+ dialog.value = true;
|
|
|
+ tempList.value = res;
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const confirm = () => {
|
|
|
- let temp = vxeTableRef.value.getCheckboxRecords()
|
|
|
+ let temp = vxeTableRef.value.getCheckboxRecords();
|
|
|
if (XEUtils.isEmpty(temp)) {
|
|
|
BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择数据。");
|
|
|
}
|
|
|
- selectAll(temp)
|
|
|
-}
|
|
|
+ selectAll(temp);
|
|
|
+};
|
|
|
|
|
|
const checkboxConfig = reactive({
|
|
|
- labelField: 'name',
|
|
|
- checkMethod: ({row}) => {
|
|
|
- return jyJcRestriction(row, false)
|
|
|
+ labelField: "name",
|
|
|
+ checkMethod: ({ row }) => {
|
|
|
+ return jyJcRestriction(row, false);
|
|
|
},
|
|
|
-})
|
|
|
+});
|
|
|
|
|
|
-const selectAll = (data) => {
|
|
|
+const selectAll = data => {
|
|
|
if (data) {
|
|
|
data.forEach(item => {
|
|
|
- emits('node-click', item)
|
|
|
- })
|
|
|
+ emits("node-click", item);
|
|
|
+ });
|
|
|
}
|
|
|
- dialog.value = false
|
|
|
-}
|
|
|
+ dialog.value = false;
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<vxe-table
|
|
|
- style="width: 100%; height: 100%"
|
|
|
- border
|
|
|
- height="100%"
|
|
|
- @cell-click="cellClick"
|
|
|
- :scroll-x="{gt: 0,enabled: false}"
|
|
|
- :scroll-y="{gt: 0 ,enabled: true}"
|
|
|
- :column-config="{resizable: true}"
|
|
|
- :row-config="{height: 24}"
|
|
|
- class="vxe-padding_zero vxe-header-max_content"
|
|
|
- show-header-overflow
|
|
|
- show-overflow
|
|
|
- :data="props.data">
|
|
|
- <vxe-column field="name" title="名称"/>
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ border
|
|
|
+ height="100%"
|
|
|
+ @cell-click="cellClick"
|
|
|
+ :scroll-x="{ gt: 0, enabled: false }"
|
|
|
+ :scroll-y="{ gt: 0, enabled: true }"
|
|
|
+ :column-config="{ resizable: true }"
|
|
|
+ :row-config="{ height: 24 }"
|
|
|
+ class="vxe-padding_zero vxe-header-max_content"
|
|
|
+ show-header-overflow
|
|
|
+ show-overflow
|
|
|
+ :data="props.data"
|
|
|
+ >
|
|
|
+ <vxe-column field="name" title="名称" />
|
|
|
<vxe-column title="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="danger" text @click.stop.prevent="emits('delClick',scope.row)">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ text
|
|
|
+ @click.stop.prevent="emits('delClick', scope.row)"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
|
|
|
|
<el-dialog v-model="dialog" title="模板">
|
|
|
- <vxe-table :data="tempList"
|
|
|
- :height="getWindowSize.h - 400"
|
|
|
- style="width: 100%"
|
|
|
- border
|
|
|
- :checkbox-config="checkboxConfig"
|
|
|
- ref="vxeTableRef"
|
|
|
- :scroll-x="{gt: 0,enabled: false}"
|
|
|
- :scroll-y="{gt: 0 ,enabled: true}"
|
|
|
- :column-config="{resizable: true}"
|
|
|
- :row-config="{height: 24}"
|
|
|
- class="vxe-header-max_content"
|
|
|
- show-header-overflow
|
|
|
- show-overflow>
|
|
|
- <vxe-column type="checkbox" title="名称"/>
|
|
|
+ <vxe-table
|
|
|
+ :data="tempList"
|
|
|
+ :height="getWindowSize.h - 400"
|
|
|
+ style="width: 100%"
|
|
|
+ border
|
|
|
+ :checkbox-config="checkboxConfig"
|
|
|
+ ref="vxeTableRef"
|
|
|
+ :scroll-x="{ gt: 0, enabled: false }"
|
|
|
+ :scroll-y="{ gt: 0, enabled: true }"
|
|
|
+ :column-config="{ resizable: true }"
|
|
|
+ :row-config="{ height: 24 }"
|
|
|
+ class="vxe-header-max_content"
|
|
|
+ show-header-overflow
|
|
|
+ show-overflow
|
|
|
+ >
|
|
|
+ <vxe-column type="checkbox" title="名称" />
|
|
|
</vxe-table>
|
|
|
|
|
|
<template #footer>
|
|
@@ -98,9 +106,6 @@ const selectAll = (data) => {
|
|
|
<el-button type="primary" @click="confirm">确认</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
</template>
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped lang="scss"></style>
|