|
@@ -73,7 +73,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="WorkStatistics">
|
|
<script setup name="WorkStatistics">
|
|
-import { ref, reactive, onMounted, computed } from 'vue';
|
|
|
|
|
|
+import { ref, reactive, onMounted, computed, watch } from 'vue';
|
|
import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next';
|
|
import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
@@ -104,52 +104,52 @@ const str2Html = (str) => {
|
|
const curRow = ref(null);
|
|
const curRow = ref(null);
|
|
const showAppendDialog = ref(false);
|
|
const showAppendDialog = ref(false);
|
|
|
|
|
|
-const fields = ref([
|
|
|
|
- {
|
|
|
|
- prop: 'serviceId',
|
|
|
|
- label: '服务单元',
|
|
|
|
- type: 'select',
|
|
|
|
- labelWidth: 90,
|
|
|
|
- colSpan: 6,
|
|
|
|
- cell: 'service',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'type',
|
|
|
|
- label: '统计维度',
|
|
|
|
- type: 'select',
|
|
|
|
- labelWidth: 80,
|
|
|
|
- colSpan: 6,
|
|
|
|
- options: dictToOptionList(STATISTICAL_DIMENSION),
|
|
|
|
- attrs: {
|
|
|
|
- onChange: () => {
|
|
|
|
- mixinSearch();
|
|
|
|
- },
|
|
|
|
|
|
+const fields = computed(() => {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ prop: 'serviceId',
|
|
|
|
+ label: '服务单元',
|
|
|
|
+ type: 'select',
|
|
|
|
+ labelWidth: 90,
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ cell: 'service',
|
|
},
|
|
},
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: 'buttons',
|
|
|
|
- colSpan: 3,
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- type: 'button',
|
|
|
|
- text: '搜索',
|
|
|
|
- onClick: () => {
|
|
|
|
|
|
+ {
|
|
|
|
+ prop: 'type',
|
|
|
|
+ label: '统计维度',
|
|
|
|
+ type: 'select',
|
|
|
|
+ labelWidth: 80,
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ options: dictToOptionList(STATISTICAL_DIMENSION),
|
|
|
|
+ attrs: {
|
|
|
|
+ onChange: () => {
|
|
mixinSearch();
|
|
mixinSearch();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // type: 'button',
|
|
|
|
- // text: '导出统计结果',
|
|
|
|
- // attrs: {
|
|
|
|
- // theme: 'success',
|
|
|
|
- // },
|
|
|
|
- // onClick: () => {
|
|
|
|
- // exportFile();
|
|
|
|
- // },
|
|
|
|
- // },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
-]);
|
|
|
|
|
|
+ },
|
|
|
|
+ params.type === 'BY_PERSON'
|
|
|
|
+ ? {
|
|
|
|
+ prop: 'personName',
|
|
|
|
+ label: '姓名',
|
|
|
|
+ labelWidth: 55,
|
|
|
|
+ colSpan: 6,
|
|
|
|
+ }
|
|
|
|
+ : null,
|
|
|
|
+ {
|
|
|
|
+ type: 'buttons',
|
|
|
|
+ colSpan: 3,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ type: 'button',
|
|
|
|
+ text: '搜索',
|
|
|
|
+ onClick: () => {
|
|
|
|
+ mixinSearch();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+});
|
|
const mixinSearch = () => {
|
|
const mixinSearch = () => {
|
|
if (params.serviceId) {
|
|
if (params.serviceId) {
|
|
tableData.value = [];
|
|
tableData.value = [];
|
|
@@ -159,6 +159,7 @@ const mixinSearch = () => {
|
|
const params = reactive({
|
|
const params = reactive({
|
|
serviceId: '',
|
|
serviceId: '',
|
|
type: 'BY_PERSON',
|
|
type: 'BY_PERSON',
|
|
|
|
+ personName: '',
|
|
});
|
|
});
|
|
|
|
|
|
const exportFile = () => {
|
|
const exportFile = () => {
|
|
@@ -349,4 +350,11 @@ const appendSuccess = () => {
|
|
showAppendDialog.value = false;
|
|
showAppendDialog.value = false;
|
|
fetchData();
|
|
fetchData();
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+watch(
|
|
|
|
+ () => params.type,
|
|
|
|
+ () => {
|
|
|
|
+ params.personName = '';
|
|
|
|
+ }
|
|
|
|
+);
|
|
</script>
|
|
</script>
|