Browse Source

reactor:延期申请和修改的样式问题修复;

zhangchong 9 months ago
parent
commit
7c6c59bcc4

+ 0 - 34
src/components/Empty/index.vue

@@ -1,34 +0,0 @@
-<template>
-	<div class="empty-container h100 w100">
-		<!-- 无数据 -->
-		<template v-if="props.type === 'data'">
-			<el-empty :description="description">
-			</el-empty>
-		</template>
-	</div>
-</template>
-
-<script lang="ts" name="emptyHotline" setup>
-// 定义父组件传过来的值
-const props = defineProps({
-	type: {
-		required: false,
-		type: String,
-		default: 'data',
-	},
-	description: {
-		required: false,
-		type: String,
-		default: '暂无数据',
-	},
-	hidden: {
-		type: Boolean,
-		default: false,
-	},
-});
-</script>
-<style scoped lang="scss">
-:deep(.el-empty__description) {
-  margin-top:0;
-}
-</style>

+ 0 - 175
src/components/Hotspot/test.vue

@@ -1,175 +0,0 @@
-<template>
-  <el-tree-select
-    v-model="state.id"
-    :props="treeProps"
-    :data="state.treeData"
-    :filterable="props.filterable"
-    :render-after-expand="false"
-    :clearable="props.clearable"
-    remote
-    node-key="id"
-    :filter-method="filterMethod"
-    :load="loadNode"
-    v-loading="loading"
-    lazy
-    :disabled="props.disabled"
-    :placeholder="props.placeholder"
-    check-strictly
-    :show-checkbox="props.showCheckbox"
-    :default-expanded-keys="defaultExpandedKeys"
-    check-on-click-node
-    hightlight-current
-  >
-  </el-tree-select>
-</template>
-<script setup lang="tsx">
-import { ref, reactive, toRefs, watch, computed } from 'vue';
-import { hotSpotSearch, hotSpotType } from "@/api/business/order";
-import { treeEventClass, treeEventClassSearch } from "@/api/auxiliary/eventClass";
-import { removeDuplicate } from "@/utils/arrayOperation";
-const props = defineProps({
-  modelValue: {
-    type: [String, Array,null],
-    default: () => null,
-  },
-  type: {
-    type: String,
-    default: 'hotspot',
-  },
-  disabled: {
-    type: Boolean,
-    default: false,
-  },
-  placeholder: {
-    type: String,
-    default: '请选择',
-  },
-  externalArr: {
-    // 外部传入的父级id数组 懒加载时使用
-    type: Array,
-    default: () => [],
-  },
-  showCheckbox: {
-    // 是否显示多选
-    type: Boolean,
-    default: false,
-  },
-  clearable: {
-    type: Boolean,
-    default: false,
-  },
-  checkStrictly: {
-    // 任意一级
-    type: Boolean,
-    default: false,
-  },
-  filterable: {
-    type: Boolean,
-    default: true,
-  },
-})
-const emit = defineEmits(['choose', 'update:modelValue', 'confirm']);
-
-const inputPlaceholder = computed(() => {
-  return props.type === 'hotspot' ? '热点名称' : '事件名称';
-});
-const treeProps = computed(() => {
-  return {
-    label: props.type === 'hotspot' ? 'hotSpotFullName' : 'eventFullName',
-    children: 'children',
-    isLeaf: 'hasChild',
-  };
-});
-const loading = ref(false);
-const state = reactive<any>({
-  id: '',
-  name: '',
-  treeData: [],
-  externalArr: [],
-  external: [],
-  checkedKeys: [],
-  checkNodes: [],
-});
-// 递归查找父级Id
-const getParentId = (val: any, arr: string[]) => {
-  if (val.data.parentId) {
-    arr.push(val.data.parentId);
-    getParentId(val.parent, arr);
-  }
-  return removeDuplicate(arr);
-};
-// 搜索方法
-const defaultExpandedKeys = ref([]);
-const filterMethod = async (value: string)=>{
-  const { type } = props;
-  const method = type === 'hotspot' ? hotSpotSearch : treeEventClassSearch;
-  if (value) {
-    // lazyShow.value = false; //当输入框有值时关闭懒加载
-    loading.value = true;
-    method(value)
-      .then((res) => {
-        state.treeData.length = 0;
-        state.treeData = res.result ?? [];
-        treeRef.value!.filter(value);
-        defaultExpandedKeys.value = ['']
-        if (props.showCheckbox && state.checkedKeys.length) {
-          treeRef.value.setCheckedKeys(state.checkedKeys);
-        }
-        if (props.modelValue) {
-          setTimeout(() => {
-            treeRef.value.setCurrentKey(props.modelValue);
-          }, 100);
-        }
-        loading.value = false;
-      })
-      .catch((e) => {
-        loading.value = false;
-      });
-  } else if (value == '' || value == ' ' || value == null) {
-    loading.value = true;
-    const method = type === 'hotspot' ? hotSpotType : treeEventClass;
-    const { result } = await method({ id: null });
-    state.treeData = result ?? [];
- /*   state.id = modelValue;
-    if (showCheckbox) {
-      treeRef.value.setCheckedKeys(modelValue);
-      const nodes = treeRef.value.getCheckedNodes();
-      if (type === 'hotspot') state.name = nodes.map((item: any) => item.hotSpotFullName).join(',') ?? '';
-      else state.name = nodes.map((item: any) => item.eventFullName).join(',') ?? '';
-    } else {
-      treeRef.value.setCurrentKey(modelValue);
-      const currentNode = treeRef.value.getNode(modelValue);
-      if (type === 'hotspot') state.name = currentNode.data.hotSpotFullName;
-      else state.name = currentNode.data.eventFullName;
-    }*/
-    loading.value = false;
-  }
-}
-// 懒加载
-const treeRef = ref<RefType>();
-const loadNode = async (node: any, resolve: any) => {
-  if (node.isLeaf) return resolve([]);
-  const { showCheckbox, type, modelValue } = props;
-  try {
-    loading.value = true;
-    const method = type === 'hotspot' ? hotSpotType : treeEventClass;
-    const { result } = await method({ id: node.data.id ? node.data.id : null });
-    resolve(result);
-    state.id = modelValue;
-    if (showCheckbox) {
-      treeRef.value.setCheckedKeys(modelValue);
-      const nodes = treeRef.value.getCheckedNodes();
-      if (type === 'hotspot') state.name = nodes.map((item: any) => item.hotSpotFullName).join(',') ?? '';
-      else state.name = nodes.map((item: any) => item.eventFullName).join(',') ?? '';
-    } else {
-      treeRef.value.setCurrentKey(modelValue);
-      const currentNode = treeRef.value.getNode(modelValue);
-      if (type === 'hotspot') state.name = currentNode.data.hotSpotFullName;
-      else state.name = currentNode.data.eventFullName;
-    }
-    loading.value = false;
-  } catch (e) {
-    loading.value = false;
-  }
-};
-</script>

+ 2 - 2
src/components/ProcessAudit/index.vue

@@ -42,16 +42,16 @@
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" v-loading="state.loading">
 						<el-form-item label="延期申请数量" prop="timeLimitCount" :rules="[{ required: true, message: '请填写延期申请数量', trigger: 'blur' }]">
-							<el-row :gutter="10">
+							<el-row :gutter="10" class="w100">
 								<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 									<el-input-number
 										placeholder="延期申请数量"
 										v-model="state.delayForm.timeLimitCount"
 										controls-position="right"
-										class="w100"
 										@input="computeTime"
 										:min="1"
 										:max="99"
+										class="w100"
 									></el-input-number>
 								</el-col>
 								<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-loading="state.loading">

+ 1 - 1
src/views/business/delay/components/Delay-edit.vue

@@ -39,7 +39,7 @@
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" v-loading="state.loading">
 						<el-form-item label="延期申请数量" prop="timeLimitCount" :rules="[{ required: true, message: '请填写延期申请数量', trigger: 'blur' }]">
-							<el-row :gutter="10">
+							<el-row :gutter="10" class="w100">
 								<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 									<el-input-number
 										placeholder="延期申请数量"