¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $fysp } from '../index'; |
| | | |
| | | export default { |
| | | /** |
| | | * è°æ´åä»»å¡ä¿¡æ¯ |
| | | * @param {Object} subtask |
| | | * @returns |
| | | */ |
| | | adjustSubtask(subtask){ |
| | | return $fysp.post(`subtask/adjust`, subtask).then((res) => res.data); |
| | | }, |
| | | }; |
| | |
| | | ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] |
| | | ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] |
| | | ElCalendar: typeof import('element-plus/es')['ElCalendar'] |
| | | ElCard: typeof import('element-plus/es')['ElCard'] |
| | | ElCascader: typeof import('element-plus/es')['ElCascader'] |
| | |
| | | ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] |
| | | ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] |
| | | ElOption: typeof import('element-plus/es')['ElOption'] |
| | | ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] |
| | | ElPagination: typeof import('element-plus/es')['ElPagination'] |
| | | ElPopover: typeof import('element-plus/es')['ElPopover'] |
| | | ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | | ElRow: typeof import('element-plus/es')['ElRow'] |
| | | ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
| | | ElSegmented: typeof import('element-plus/es')['ElSegmented'] |
| | |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | ElTag: typeof import('element-plus/es')['ElTag'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | ElTooltip: typeof import('element-plus/es')['ElTooltip'] |
| | | ElTree: typeof import('element-plus/es')['ElTree'] |
| | | ElUpload: typeof import('element-plus/es')['ElUpload'] |
| | | Footer: typeof import('./components/core/Footer.vue')['default'] |
| | |
| | | <template> |
| | | <div class="wrapper"> |
| | | <div class="text-title"> |
| | | {{ item.name }} |
| | | </div> |
| | | <div class="text-info"> |
| | | <div class="text-label"> |
| | | <el-icon class="m-r-4" size="16"><LocationInformation /></el-icon> |
| | | <span>ä»»å¡å°åï¼</span> |
| | | </div> |
| | | {{ item.scenseaddress }} |
| | | </div> |
| | | <div class="text-info"> |
| | | <div class="text-label"> |
| | | <!-- <el-icon><Clock /></el-icon> --> |
| | | <el-icon class="m-r-4" size="16"><AlarmClock /></el-icon> |
| | | <span>任塿¶é´ï¼</span> |
| | | </div> |
| | | {{ $fm.formatYMD(item.planstarttime) }} |
| | | </div> |
| | | <div class="text-info"> |
| | | <div class="text-label"> |
| | | <el-icon class="m-r-4" size="16"><User /></el-icon> |
| | | ä»»å¡äººåï¼ |
| | | </div> |
| | | {{ item.executorrealtimes }} |
| | | </div> |
| | | <el-row justify="end" style="margin-top: 4px"> |
| | | <slot :item="item"></slot> |
| | | <el-row justify="space-between" class="m-t-4"> |
| | | <el-col :span="20"> |
| | | <div class="text-title"> |
| | | <el-tag |
| | | size="small" |
| | | :type="statusType.type" |
| | | effect="plain" |
| | | class="m-r-4 m-b-4" |
| | | > |
| | | <el-space :size="4"> |
| | | <el-icon size="16"> |
| | | <component :is="statusType.icon"></component> |
| | | </el-icon> |
| | | {{ item.status }} |
| | | </el-space> |
| | | </el-tag> |
| | | {{ item.name }} |
| | | </div> |
| | | <div class="text-info"> |
| | | <div class="text-label"> |
| | | <el-icon class="m-r-4" size="16"><LocationInformation /></el-icon> |
| | | <span>ä»»å¡å°åï¼</span> |
| | | </div> |
| | | {{ item.scenseaddress }} |
| | | </div> |
| | | <div class="text-info"> |
| | | <div class="text-label"> |
| | | <!-- <el-icon><Clock /></el-icon> --> |
| | | <el-icon class="m-r-4" size="16"><AlarmClock /></el-icon> |
| | | <span>任塿¶é´ï¼</span> |
| | | </div> |
| | | {{ $fm.formatYMD(item.planstarttime) }} |
| | | </div> |
| | | <div class="text-info"> |
| | | <div class="text-label"> |
| | | <el-icon class="m-r-4" size="16"><User /></el-icon> |
| | | ä»»å¡äººåï¼ |
| | | </div> |
| | | {{ item.executorrealtimes }} |
| | | </div> |
| | | <el-space class="m-t-4"> |
| | | <el-tag size="small" type="info" effect="" |
| | | >é®é¢ï¼{{ status.proNum }}</el-tag |
| | | > |
| | | <el-tag size="small" type="info" effect="" |
| | | >æ´æ¹ï¼{{ status.changeNum }}</el-tag |
| | | > |
| | | <el-tag size="small" :type="changePerType" effect="" |
| | | >æ´æ¹çï¼{{ status.changePer }}</el-tag |
| | | > |
| | | </el-space> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <slot :item="item"></slot> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch, computed } from 'vue'; |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import ProCheckProxy from '@/views/fysp/check/ProCheckProxy'; |
| | | |
| | | /** |
| | | * ç管对象 |
| | | */ |
| | |
| | | default: () => {} |
| | | } |
| | | }); |
| | | |
| | | const loading = ref(false); |
| | | const proList = ref([]); |
| | | const status = ref({}); |
| | | |
| | | const statusType = computed(() => { |
| | | switch (props.item.status) { |
| | | case 'æªæ§è¡': |
| | | return { |
| | | type: 'danger', |
| | | icon: 'WarningFilled' |
| | | }; |
| | | case 'æ£å¨æ§è¡': |
| | | return { |
| | | type: 'success', |
| | | icon: 'Timer' |
| | | }; |
| | | case 'å·²ç»æ': |
| | | return { |
| | | type: 'info', |
| | | icon: 'SuccessFilled' |
| | | }; |
| | | default: |
| | | return { |
| | | type: 'danger', |
| | | icon: 'Warning' |
| | | }; |
| | | } |
| | | }); |
| | | |
| | | const changePerType = computed(() => { |
| | | if (status.value.changeNum == 0) { |
| | | if (status.value.proNum == 0) { |
| | | return 'success'; |
| | | } else { |
| | | return 'danger'; |
| | | } |
| | | } else if (status.value.proNum == status.value.changeNum) { |
| | | return 'success'; |
| | | } else { |
| | | return 'warning'; |
| | | } |
| | | }); |
| | | |
| | | watch( |
| | | () => props.item, |
| | | (nV, oV) => { |
| | | if (nV != oV) { |
| | | fetchProblems(nV); |
| | | } |
| | | }, |
| | | { immediate: true } |
| | | ); |
| | | |
| | | function fetchProblems(subtask) { |
| | | loading.value = true; |
| | | taskApi |
| | | .getProBySubtask(subtask.stguid) |
| | | .then((res) => { |
| | | proList.value = res; |
| | | status.value = ProCheckProxy.calProStatus(res); |
| | | }) |
| | | .finally(() => { |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .wrapper { |
| | |
| | | <el-col v-if="curSubTaskList" :span="8"> |
| | | <CompSubTaskList |
| | | create |
| | | :data="curSubTaskList" |
| | | v-model="curSubTaskList" |
| | | :loading="subTaskLoading" |
| | | height="56vh" |
| | | @add="subTaskDrawer = true" |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <FYForm |
| | | :form-info="formInfo" |
| | | :rules="rules" |
| | | :useCancel="true" |
| | | @submit="submit" |
| | | @cancel="cancel" |
| | | > |
| | | <template #form-item="{ formObj }"> |
| | | <el-form-item label="ä»»å¡åç§°" prop="name"> |
| | | <el-input disabled v-model="formObj.name" placeholder="ä»»å¡åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="åºæ¯å°å" prop="name"> |
| | | <el-input |
| | | disabled |
| | | v-model="formObj.scenseaddress" |
| | | placeholder="åºæ¯å°å" |
| | | /> |
| | | </el-form-item> |
| | | <FYOptionTime |
| | | label="è®¡åæ¶é´" |
| | | prop="planstarttime" |
| | | :initValue="false" |
| | | type="date" |
| | | v-model:value="formObj.planstarttime" |
| | | ></FYOptionTime> |
| | | <el-form-item label="æ§è¡äºº" prop="_executors"> |
| | | <el-select |
| | | v-model="formObj._executors" |
| | | multiple |
| | | clearable |
| | | collapse-tags |
| | | placeholder="éæ©æ§è¡äºº" |
| | | :max-collapse-tags="3" |
| | | style="width: 300px" |
| | | > |
| | | <el-option |
| | | v-for="s in executorOptions" |
| | | :key="s.value" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | </FYForm> |
| | | </template> |
| | | <script setup> |
| | | import { ref, computed, onMounted, reactive } from 'vue'; |
| | | import subtaskApi from '@/api/fysp/subtaskApi'; |
| | | import userApi from '@/api/fysp/userApi'; |
| | | |
| | | const props = defineProps({ |
| | | //åºæ¬ä¿¡æ¯ |
| | | modelValue: Object, |
| | | //æ¯å建æè
æ´æ° |
| | | create: Boolean |
| | | }); |
| | | |
| | | const emit = defineEmits(['submit', 'cancel']); |
| | | |
| | | // 任塿§è¡äººé项 |
| | | const executorOptions = ref([]); |
| | | const formInfo = computed(() => { |
| | | return { |
| | | ...props.modelValue, |
| | | _executors: props.modelValue |
| | | ? props.modelValue.executorguids.split('#') |
| | | : [] |
| | | }; |
| | | }); |
| | | |
| | | const rules = reactive({ |
| | | name: [ |
| | | { |
| | | required: true, |
| | | message: 'åºæ¯åç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | _scenetype: [ |
| | | { |
| | | required: true, |
| | | message: 'åºæ¯ç±»åä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | function getExecutors(data) { |
| | | const ids = []; |
| | | const uNames = []; |
| | | const rNames = []; |
| | | executorOptions.value.forEach((e) => { |
| | | const index = data._executors.indexOf(e.value); |
| | | if (index != -1) { |
| | | ids.push(e.data.guid); |
| | | uNames.push(e.data.acountname); |
| | | rNames.push(e.data.realname); |
| | | } |
| | | }); |
| | | return { |
| | | id: ids.join('#'), |
| | | uName: uNames.join('#'), |
| | | rName: rNames.join('#') |
| | | }; |
| | | } |
| | | |
| | | // å建æ°åºæ¯ |
| | | function createScene(v, success, fail) { |
| | | // return sceneApi |
| | | // .createScene(v) |
| | | // .then(() => { |
| | | // emit('onSubmit', v); |
| | | // success(); |
| | | // }) |
| | | // .catch((err) => { |
| | | // fail(err); |
| | | // }); |
| | | } |
| | | // æ´æ°åºæ¯ |
| | | function updateScene(v, success, fail) { |
| | | return subtaskApi |
| | | .adjustSubtask(v) |
| | | .then(() => { |
| | | emit('submit', v); |
| | | success(); |
| | | }) |
| | | .catch((err) => { |
| | | fail(err); |
| | | }); |
| | | } |
| | | function submit(v, success, fail) { |
| | | return props.create |
| | | ? createScene(v.value, success, fail) |
| | | : updateScene(v.value, success, fail); |
| | | } |
| | | function cancel() { |
| | | emit('cancel'); |
| | | } |
| | | |
| | | function initOptions() { |
| | | userApi.getUserByType(1).then((res) => { |
| | | executorOptions.value = res.map((v) => { |
| | | return { |
| | | label: v.realname, |
| | | value: v.guid, |
| | | data: v |
| | | }; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | initOptions(); |
| | | }); |
| | | </script> |
| | |
| | | <el-row justify="space-between"> |
| | | <el-text>åæ¥è®¡å</el-text> |
| | | <el-button |
| | | v-show="create && data && data.length > 0" |
| | | v-show="create && modelValue && modelValue.length > 0" |
| | | type="success" |
| | | size="small" |
| | | @click="add" |
| | |
| | | <div> |
| | | <el-scrollbar v-loading="loading" :height="height"> |
| | | <el-space |
| | | v-if="data && data.length > 0" |
| | | v-if="modelValue && modelValue.length > 0" |
| | | fill |
| | | :fill-ratio="100" |
| | | direction="vertical" |
| | | style="width: 100%" |
| | | > |
| | | <ItemSubTask v-for="s in data" :key="s.guid" :item="s"> |
| | | <ItemSubTask v-for="s in modelValue" :key="s.guid" :item="s"> |
| | | <template #default="{ item }"> |
| | | <el-button type="danger" size="small" @click="remove(item)" |
| | | >ç§»é¤</el-button |
| | | > |
| | | <el-space direction="vertical"> |
| | | <el-button plain type="primary" size="small" @click="edit(item)" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | | :disabled="item.status != 'æªæ§è¡'" |
| | | type="default" |
| | | size="small" |
| | | @click="remove(item)" |
| | | >ç§»é¤</el-button |
| | | > |
| | | </el-space> |
| | | </template> |
| | | </ItemSubTask> |
| | | </el-space> |
| | |
| | | </div> |
| | | </el-scrollbar> |
| | | </div> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="600" |
| | | title="ä¸é®å建æ»ä»»å¡" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | :show-close="false" |
| | | > |
| | | <CompSubTaskEdit |
| | | v-model="activeItem" |
| | | @submit="dialogVisible = false" |
| | | @cancel="dialogVisible = false" |
| | | ></CompSubTaskEdit> |
| | | </el-dialog> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch, onMounted } from 'vue'; |
| | | import { ref, computed, watch, onMounted, onUnmounted } from 'vue'; |
| | | import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; |
| | | import CompSubTaskEdit from './CompSubTaskEdit.vue'; |
| | | |
| | | const props = defineProps({ |
| | | data: Array, |
| | | modelValue: Array, |
| | | height: { |
| | | type: String, |
| | | default: '70vh' |
| | |
| | | create: Boolean, |
| | | loading: Boolean |
| | | }); |
| | | const curSubTaskList = ref([]); |
| | | |
| | | const emit = defineEmits(['add', 'remove']); |
| | | const dialogVisible = ref(false) |
| | | const activeItem = ref(null) |
| | | const data = computed(() => props.modelValue); |
| | | |
| | | const emit = defineEmits(['edit', 'add', 'remove', 'update:modelValue']); |
| | | |
| | | function remove(item) { |
| | | emit('remove', item); |
| | | if (item.status == 'æªæ§è¡') { |
| | | ElMessageBox.confirm('æ¯å¦ç§»é¤ç管任å¡', `ç§»é¤ç¡®è®¤`, { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = data.value.indexOf(item); |
| | | data.value.splice(index, 1); |
| | | |
| | | emit('update:modelValue', data.value); |
| | | emit('remove', item); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function edit(item) { |
| | | activeItem.value = item |
| | | dialogVisible.value = true |
| | | emit('edit'); |
| | | } |
| | | |
| | | function add() { |
| | | emit('add'); |
| | | } |
| | | |
| | | onUnmounted(()=>{ |
| | | dialogVisible.value = false |
| | | }) |
| | | </script> |