This commit is contained in:
赵正易 2024-12-23 14:00:39 +08:00
parent 4eec013af8
commit 1dedcadf32
8 changed files with 213 additions and 258 deletions

View File

@ -1,7 +1,7 @@
# 开发环境配置
ENV = 'development'
VITE_APP_API_HOST = 'http://localhost:8888'
VITE_APP_API_HOST = 'http://127.0.0.1:7000'
# 开发环境
VITE_APP_BASE_API = '/dev-api'

BIN
src/assets/images/door.rar Normal file

Binary file not shown.

View File

@ -1,26 +1,14 @@
<template>
<div class="component-upload-image">
<el-upload
multiple
v-bind="$attrs"
:action="uploadImgUrl"
:list-type="listType"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
name="file"
:data="uploadData"
:on-remove="handleRemove"
:show-file-list="true"
:headers="headers"
v-model:file-list="fileList"
:on-preview="handlePictureCardPreview"
:style="cssVars"
<el-upload multiple v-bind="$attrs" :action="uploadImgUrl" :list-type="listType" :on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
name="file" :data="uploadData" :on-remove="handleRemove" :show-file-list="true" :headers="headers"
v-model:file-list="fileList" :on-preview="handlePictureCardPreview" :style="cssVars"
:class="{ hide: fileList.length >= limit }">
<slot name="icon">
<el-icon class="avatar-uploader-icon"><uploadFilled /></el-icon>
<el-icon class="avatar-uploader-icon">
<uploadFilled />
</el-icon>
</slot>
<template v-slot:tip>
@ -49,9 +37,8 @@
<el-form-item label="访问路径">
<el-link type="warning" :href="dialogImageUrl" target="_blank">{{ dialogImageUrl }}</el-link>
<el-button type="danger" text icon="document-copy" plain class="ml10" v-clipboard:success="copySuccess" v-clipboard:copy="dialogImageUrl"
>复制</el-button
>
<el-button type="danger" text icon="document-copy" plain class="ml10" v-clipboard:success="copySuccess"
v-clipboard:copy="dialogImageUrl">复制</el-button>
</el-form-item>
</el-form>
</el-dialog>
@ -71,7 +58,7 @@ const props = defineProps({
// (MB)
fileSize: {
type: Number,
default: 5
default: 100
},
// , ['png', 'jpg', 'jpeg']
fileType: {
@ -228,9 +215,11 @@ function copySuccess() {
.el-upload--picture-card {
--el-upload-picture-card-size: unset;
}
.el-upload-list--picture-card {
--el-upload-list-picture-card-size: unset;
}
.el-upload__tip {
font-size: 10px;
}

View File

@ -57,7 +57,7 @@ export default {
/**
* 版权信息
*/
copyright: 'Copyright ©2023 <a target="_black" href="http://www.doan-tech.com/">苏州道安自动化有限公司</a></a> All Rights Reserved.',
copyright: 'Copyright ©2024 <a target="_black" href="http://www.doan-tech.com/">苏州道安自动化有限公司</a></a> All Rights Reserved.',
/**
* 是否显示底部栏
*/

View File

@ -26,7 +26,8 @@
<el-col :span="12">
<el-form-item label="设备认证">
<el-button type="warning" :disabled="IsIdentification" @click="handlerIdentification">扫码解锁</el-button>
<el-button type="danger" @click="IsIdentification = true" v-hasPermi="['deviceManagement:saoma:no']">权限解锁</el-button>
<el-button type="danger" @click="IsIdentification = true"
v-hasPermi="['deviceManagement:saoma:no']">权限解锁</el-button>
</el-form-item>
<el-form-item label="认证结果">
<el-tag v-if="IsIdentification" type="success" effect="dark"> 已认证 </el-tag>
@ -67,37 +68,21 @@
</el-col>
<el-col :span="24" :xs="24" :key="index" v-for="(item, index) in formGenerateDataList">
<el-form-item :label="item.title">
<el-radio-group
:disabled="!IsIdentification"
v-if="item.type === 1"
v-model="item.value"
<el-radio-group :disabled="!IsIdentification" v-if="item.type === 1" v-model="item.value"
@change="saveAchieveInspectbindForm($event, item.type, item.id)">
<el-radio v-for="(item, index) in item.children" :key="index" :label="item" :value="item" border></el-radio>
<el-radio v-for="(item, index) in item.children" :key="index" :label="item" :value="item"
border></el-radio>
</el-radio-group>
<el-checkbox-group
:disabled="!IsIdentification"
v-if="item.type === 2"
multiple
v-model="item.value"
<el-checkbox-group :disabled="!IsIdentification" v-if="item.type === 2" multiple v-model="item.value"
@change="saveAchieveInspectbindForm($event, item.type, item.id)">
<el-checkbox v-for="(item, index) in item.children" :key="index" :label="item" :value="item" border></el-checkbox>
<el-checkbox v-for="(item, index) in item.children" :key="index" :label="item" :value="item"
border></el-checkbox>
</el-checkbox-group>
<UploadImage
:disabled="!IsIdentification"
v-if="item.type === 3"
v-model="item.value"
drag
:data="{ uploadType: 1, filePath: 'device/task/execute/img' }"
:limit="1"
<UploadImage :disabled="!IsIdentification" v-if="item.type === 3" v-model="item.value" drag
:data="{ uploadType: 1, filePath: 'device/task/execute/img' }" :limit="1"
@change="saveAchieveInspectbindForm($event, item.type, item.id, item.value)"></UploadImage>
<el-input
:disabled="!IsIdentification"
v-if="item.type === 4"
type="textarea"
:maxlength="200"
:show-word-limit="true"
v-model="item.value"
placeholder="请输入"
<el-input :disabled="!IsIdentification" v-if="item.type === 4" type="textarea" :maxlength="200"
:show-word-limit="true" v-model="item.value" placeholder="请输入"
@change="saveAchieveInspectbindForm($event, item.type, item.id)" />
</el-form-item>
</el-col>
@ -106,15 +91,18 @@
<div class="tool-box">
<el-button class="tool-item" size="large" icon="Close" @click="close" circle></el-button>
<el-button class="tool-item" size="large" type="success" icon="Check" @click="over" circle></el-button>
<el-button class="tool-item" size="large" type="info" icon="DArrowLeft" @click="doDeviceStepsBack" circle></el-button>
<el-button class="tool-item" size="large" type="primary" icon="DArrowRight" @click="doDeviceStepsNext" circle></el-button>
<el-button class="tool-item" size="large" type="info" icon="DArrowLeft" @click="doDeviceStepsBack"
circle></el-button>
<el-button class="tool-item" size="large" type="primary" icon="DArrowRight" @click="doDeviceStepsNext"
circle></el-button>
</div>
</el-col>
</el-row>
<template #footer>
<div class="dialog-footer-right">
<el-button v-if="inspectStepsActive > 0" type="info" @click="doDeviceStepsBack">上一项</el-button>
<el-button v-if="inspectStepsActive < inspectStepsList.length" type="primary" @click="doDeviceStepsNext">下一项</el-button>
<el-button v-if="inspectStepsActive < inspectStepsList.length" type="primary"
@click="doDeviceStepsNext">下一项</el-button>
</div>
</template>
</el-card>
@ -154,7 +142,11 @@ const props = defineProps({
default: ''
},
planType: {
type: String,
type: [String, Number],
default: ''
},
innerType: {
type: [String, Number],
default: ''
}
})
@ -200,7 +192,7 @@ function over() {
}
})
})
.catch(() => {})
.catch(() => { })
}
function init() {
@ -222,7 +214,8 @@ function getStepsData() {
const query = {
fk_account_id: props.deviceItem.id,
fkPlanId: props.fkPlanId,
planType: props.planType
planType: props.planType,
innerType: props.innerType
}
AchieveDevicebindInspect(query).then((res) => {
const { code, data } = res

View File

@ -3,109 +3,118 @@
<el-row :gutter="20">
<el-col :span="18">
<el-steps direction="horizontal" :active="deviceStepsActive" finish-status="success">
<el-step v-for="(item,index) in deviceStepsList" :title="item.deviceName" :key="index" />
<el-step v-for="(item, index) in deviceStepsList" :title="item.deviceName" :key="index" />
</el-steps>
</el-col>
<el-col :span="6">
<div>
<el-button v-if="deviceStepsActive>0" type="info" @click="doDeviceStepsBack">上一个设备</el-button>
<el-button v-if="deviceStepsActive<deviceStepsList.length" type="primary" @click="doDeviceStepsNext">下一个设备</el-button>
<el-button v-if="deviceStepsActive > 0" type="info" @click="doDeviceStepsBack">上一个设备</el-button>
<el-button v-if="deviceStepsActive < deviceStepsList.length" type="primary"
@click="doDeviceStepsNext">下一个设备</el-button>
</div>
</el-col>
</el-row>
<TheTaskExecuteDeviceItemStep ref="ItemStepRef" v-loading="loading" :deviceItem="deviceStepData" :fkPlanId="fkPlanId" :planType="planType" :executeKey="executeKey" @doClose="close"></TheTaskExecuteDeviceItemStep>
<TheTaskExecuteDeviceItemStep ref="ItemStepRef" v-loading="loading" :deviceItem="deviceStepData"
:fkPlanId="fkPlanId" :planType="planType" :innerType="innerType" :executeKey="executeKey" @doClose="close">
</TheTaskExecuteDeviceItemStep>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'
import {
AchieveTaskbindDevice,
} from '@/api/deviceManagement/devicetaskexecute.js'
import { default as TheTaskExecuteDeviceItemStep } from './TheTaskExecuteDeviceItemStep'
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'
import {
AchieveTaskbindDevice,
} from '@/api/deviceManagement/devicetaskexecute.js'
import { default as TheTaskExecuteDeviceItemStep } from './TheTaskExecuteDeviceItemStep'
const emit = defineEmits()
const { proxy } = getCurrentInstance()
// const form = reactive({})
const planType = ref("");
const fkPlanId = ref("");
const executeKey = ref("");
const emit = defineEmits()
const { proxy } = getCurrentInstance()
// const form = reactive({})
function init() {
planType.value = proxy.$route.query.planType;
fkPlanId.value = proxy.$route.query.fkPlanId;
executeKey.value = proxy.$route.query.executeKey;
deviceStepsActive.value = 0;
deviceStepsList.value = [];
getDeviceStepsData();
}
const fkPlanId = ref("");
const executeKey = ref("");
// 1- 2-
const innerType = ref(null);
// 1- 2-
const planType = ref(null);
function close() {
proxy.$router.back();
}
const deviceStepsList = ref([]);
const deviceStepsActive = ref(0);
//
function getDeviceStepsData() {
AchieveTaskbindDevice(executeKey.value).then(res => {
const { code, data } = res;
// console.log(1, 'getDeviceStepsData', data);
if (code === 200) {
// console.log(2, data);
deviceStepsList.value = data;
}
})
}
//
const deviceStepData = computed(() => {
try {
return deviceStepsList.value[deviceStepsActive.value];
} catch (e) {
return null;
function init() {
planType.value = proxy.$route.query.planType;
innerType.value = proxy.$route.query.innerType;
fkPlanId.value = proxy.$route.query.fkPlanId;
executeKey.value = proxy.$route.query.executeKey;
deviceStepsActive.value = 0;
deviceStepsList.value = [];
getDeviceStepsData();
}
function close() {
proxy.$router.back();
}
const deviceStepsList = ref([]);
const deviceStepsActive = ref(0);
//
function getDeviceStepsData() {
AchieveTaskbindDevice(executeKey.value).then(res => {
const { code, data } = res;
// console.log(1, 'getDeviceStepsData', data);
if (code === 200) {
// console.log(2, data);
deviceStepsList.value = data;
}
});
})
}
//
const deviceStepData = computed(() => {
try {
return deviceStepsList.value[deviceStepsActive.value];
} catch (e) {
return null;
}
});
// Steps
function doDeviceStepsNext() {
if (deviceStepsActive.value >= deviceStepsList.value.length) {
return;
}
deviceStepsActive.value += 1;
// getItemSetup();
doLoading();
// Steps
function doDeviceStepsNext() {
if (deviceStepsActive.value >= deviceStepsList.value.length) {
return;
}
// Steps退
function doDeviceStepsBack() {
if (deviceStepsActive.value <= 0) {
return;
}
deviceStepsActive.value -= 1;
// getItemSetup();
doLoading();
deviceStepsActive.value += 1;
// getItemSetup();
doLoading();
}
// Steps退
function doDeviceStepsBack() {
if (deviceStepsActive.value <= 0) {
return;
}
// loading
const loading = ref(false);
deviceStepsActive.value -= 1;
// getItemSetup();
doLoading();
}
// loading
const loading = ref(false);
function doLoading() {
loading.value = true;
setTimeout(() => {
loading.value = false;
}, 500)
}
const ItemStepRef = ref(null);
onMounted(() => {
init();
});
// init();
function doLoading() {
loading.value = true;
setTimeout(() => {
loading.value = false;
}, 500)
}
const ItemStepRef = ref(null);
onMounted(() => {
init();
});
// init();
</script>
<style scoped>
.dialog-footer-left {
text-align: left;
}
.dialog-footer-left {
text-align: left;
}
.main-box {
padding: 10px;
}
.main-box {
padding: 10px;
}
</style>

View File

@ -10,22 +10,21 @@
<el-input clearable v-model.trim="queryParams.taskName" placeholder="请输入任务名称" />
</el-form-item>
<el-form-item label="任务派发时间" prop="timeRange">
<el-date-picker :clearable="true" v-model="queryParams.timeRange" type="daterange" placeholder="选择日期时间区间"></el-date-picker>
<el-date-picker :clearable="true" v-model="queryParams.timeRange" type="daterange"
placeholder="选择日期时间区间"></el-date-picker>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择任务类型" @change="handleQuery">
<el-option label="全部" :value="-1"></el-option>
<el-option
v-for="item in options.typeOptions"
:key="item.dictValue"
:label="item.dictLabel"
<el-option v-for="item in options.typeOptions" :key="item.dictValue" :label="item.dictLabel"
:value="parseInt(item.dictValue)"></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="queryParams.status" @change="handleQuery">
<el-radio-button :value="-1"> 全部 </el-radio-button>
<el-radio-button v-for="item in options.statusOptions" :key="item.dictValue" :value="parseInt(item.dictValue)">
<el-radio-button v-for="item in options.statusOptions" :key="item.dictValue"
:value="parseInt(item.dictValue)">
{{ item.dictLabel }}
</el-radio-button>
</el-radio-group>
@ -38,57 +37,47 @@
<!-- 工具区域 -->
<el-row :gutter="15" class="mb10">
<el-col :span="1.5">
<el-button type="primary" v-hasPermi="['deviceManagement:devicetaskexecute:add']" plain icon="RefreshRight" @click="handleSynchronize">
<el-button type="primary" v-hasPermi="['deviceManagement:devicetaskexecute:add']" plain icon="RefreshRight"
@click="handleSynchronize">
{{ $t('btn.synchronize') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" v-hasPermi="['deviceManagement:devicetaskexecute:delete']" plain icon="delete" @click="handleClear">
<el-button type="danger" v-hasPermi="['deviceManagement:devicetaskexecute:delete']" plain icon="delete"
@click="handleClear">
{{ $t('btn.clean') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['deviceManagement:devicetaskexecute:export']">
<el-button type="warning" plain icon="download" @click="handleExport"
v-hasPermi="['deviceManagement:devicetaskexecute:export']">
{{ $t('btn.export') }}
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table
:data="dataList"
v-loading="loading"
ref="table"
border
header-cell-class-name="el-table-header-cell"
highlight-current-row
@sort-change="sortChange"
@selection-change="handleSelectionChange">
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell"
highlight-current-row @sort-change="sortChange" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="id" label="数据库编号" align="center" v-if="columns.showColumn('id')" />
<el-table-column prop="taskId" label="任务编号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('taskId')" />
<el-table-column
prop="taskName"
label="任务名称"
align="center"
min-width="120"
:show-overflow-tooltip="true"
<el-table-column prop="taskId" label="任务编号" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('taskId')" />
<el-table-column prop="taskName" label="任务名称" align="center" min-width="120" :show-overflow-tooltip="true"
v-if="columns.showColumn('taskName')" />
<el-table-column prop="person" label="执行人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('person')" />
<el-table-column prop="person" label="执行人" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('person')" />
<el-table-column prop="type" label="任务类型" align="center" v-if="columns.showColumn('type')">
<template #default="scope">
<dict-tag :options="options.typeOptions" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column
prop="distributedTime"
label="任务派发时间"
align="center"
min-width="140"
:show-overflow-tooltip="true"
v-if="columns.showColumn('distributedTime')" />
<el-table-column prop="startTime" label="任务开始时间" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('startTime')" />
<el-table-column prop="endTime" label="任务结束时间" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('endTime')" />
<el-table-column prop="distributedTime" label="任务派发时间" align="center" min-width="140"
:show-overflow-tooltip="true" v-if="columns.showColumn('distributedTime')" />
<el-table-column prop="startTime" label="任务开始时间" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('startTime')" />
<el-table-column prop="endTime" label="任务结束时间" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('endTime')" />
<el-table-column prop="consumeTime" label="耗时min" align="center">
<template #default="scope">
<span style="color: red; font-size: larger">{{ scope.row.consumeTime }}</span>
@ -99,11 +88,16 @@
<dict-tag :options="options.statusOptions" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('remark')" />
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
<el-table-column prop="updatedTime" label="更新时间" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('remark')" />
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('createdBy')" />
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true"
v-if="columns.showColumn('createdTime')" />
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('updatedBy')" />
<el-table-column prop="updatedTime" label="更新时间" :show-overflow-tooltip="true"
v-if="columns.showColumn('updatedTime')" />
<el-table-column label="任务执行" width="100" fixed="right">
<template #default="scope">
<el-button type="info" size="small" icon="EditPen" @click="handleExecute(scope.row)">执行</el-button>
@ -112,24 +106,15 @@
<el-table-column label="操作" width="160" fixed="right">
<template #default="scope">
<el-button type="primary" size="small" icon="view" title="详情" @click="handlePreview(scope.row)"></el-button>
<el-button
type="success"
size="small"
icon="edit"
title="编辑"
v-hasPermi="['deviceManagement:devicetaskexecute:edit']"
@click="handleUpdate(scope.row)"></el-button>
<el-button
type="danger"
size="small"
icon="delete"
title="删除"
v-hasPermi="['deviceManagement:devicetaskexecute:delete']"
@click="handleDelete(scope.row)"></el-button>
<el-button type="success" size="small" icon="edit" title="编辑"
v-hasPermi="['deviceManagement:devicetaskexecute:edit']" @click="handleUpdate(scope.row)"></el-button>
<el-button type="danger" size="small" icon="delete" title="删除"
v-hasPermi="['deviceManagement:devicetaskexecute:delete']" @click="handleDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改任务执行对话框 -->
<el-dialog :title="title" :lock-scroll="false" v-model="open">
@ -143,49 +128,35 @@
<el-col :lg="12">
<el-form-item label="任务类型" prop="type">
<el-select disabled v-model="form.type" placeholder="请选择任务类型">
<el-option
v-for="item in options.typeOptions"
:key="item.dictValue"
:label="item.dictLabel"
<el-option v-for="item in options.typeOptions" :key="item.dictValue" :label="item.dictLabel"
:value="parseInt(item.dictValue)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="任务派发时间" prop="distributedTime">
<el-date-picker
disabled
v-model="form.distributedTime"
type="datetime"
:teleported="false"
<el-date-picker disabled v-model="form.distributedTime" type="datetime" :teleported="false"
placeholder="选择日期时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="任务开始时间" prop="startTime">
<el-date-picker
:disabled="opertype === 3"
v-model="form.startTime"
type="datetime"
:teleported="false"
<el-date-picker :disabled="opertype === 3" v-model="form.startTime" type="datetime" :teleported="false"
placeholder="选择日期时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="任务结束时间" prop="endTime">
<el-date-picker
:disabled="opertype === 3"
v-model="form.endTime"
type="datetime"
:teleported="false"
<el-date-picker :disabled="opertype === 3" v-model="form.endTime" type="datetime" :teleported="false"
placeholder="选择日期时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item label="状态" prop="status">
<el-radio-group :disabled="opertype === 3" v-model="form.status">
<el-radio-button v-for="item in options.statusOptions" :key="item.dictValue" :value="parseInt(item.dictValue)">
<el-radio-button v-for="item in options.statusOptions" :key="item.dictValue"
:value="parseInt(item.dictValue)">
{{ item.dictLabel }}
</el-radio-button>
</el-radio-group>
@ -193,13 +164,8 @@
</el-col>
<el-col :lg="24">
<el-form-item label="备注" prop="remark">
<el-input
:disabled="opertype === 3"
type="textarea"
:maxlength="200"
:show-word-limit="true"
v-model="form.remark"
placeholder="请输入备注" />
<el-input :disabled="opertype === 3" type="textarea" :maxlength="200" :show-word-limit="true"
v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
@ -209,7 +175,8 @@
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
<TheTaskExecuteDialog v-model="open2" :executeKey="executeKey" :fkPlanId="fkPlanId" :planType="planType"> </TheTaskExecuteDialog>
<TheTaskExecuteDialog v-model="open2" :executeKey="executeKey" :fkPlanId="fkPlanId" :planType="planType">
</TheTaskExecuteDialog>
</div>
</template>
@ -327,12 +294,15 @@ const fkPlanId = ref('')
const planType = ref(1)
//
function handleExecute(row) {
// 1- 2-
planType.value = row.type
// 1- 2-
const innerType = row.innerType
fkPlanId.value = row.planId
executeKey.value = row.id
setTaskStartTime({ id: executeKey.value })
// open2.value = true;
proxy.$router.push({ name: 'TheTaskExecuteView', query: { planType: row.type, fkPlanId: row.planId, executeKey: row.id } })
proxy.$router.push({ name: 'TheTaskExecuteView', query: { planType: row.type, fkPlanId: row.planId, executeKey: row.id, innerType } })
// proxy.$router.push({ path: '/deviceManagement/deviceTaskExecute', query: { planType: row.type, fkPlanId: row.taskId, executeKey: row.id } });
}

View File

@ -9,49 +9,37 @@
<!-- 工具区域 -->
<el-row :gutter="15" class="mb10">
<el-col :span="1.5">
<el-button type="primary" size="small" v-hasPermi="['deviceManagement:deviceformconfig:add']" plain icon="plus" @click="handleAdd">
<el-button type="primary" size="small" v-hasPermi="['deviceManagement:deviceformconfig:add']" plain icon="plus"
@click="handleAdd">
{{ $t('btn.add') }}
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table
:data="dataList"
v-loading="loading"
ref="table"
border
header-cell-class-name="el-table-header-cell"
highlight-current-row
@sort-change="sortChange">
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell"
highlight-current-row @sort-change="sortChange">
<el-table-column prop="type" label="表单类型" align="center" v-if="columns.showColumn('type')">
<template #default="scope">
<dict-tag :options="options.typeOptions" :value="scope.row.type" />
<dict-tag :options="options.typeOptions" :value="scope.row.type + ''" />
</template>
</el-table-column>
<el-table-column prop="title" label="表单标题" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('title')" />
<el-table-column prop="content" label="表单选项内容" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('content')" />
<el-table-column prop="title" label="表单标题" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('title')" />
<el-table-column prop="content" label="表单选项内容" align="center" :show-overflow-tooltip="true"
v-if="columns.showColumn('content')" />
<el-table-column label="操作" width="160">
<template #default="scope">
<el-button
type="success"
size="small"
icon="edit"
title="编辑"
v-hasPermi="['deviceManagement:deviceformconfig:edit']"
@click="handleUpdate(scope.row)"></el-button>
<el-button
type="danger"
size="small"
icon="delete"
title="删除"
v-hasPermi="['deviceManagement:deviceformconfig:delete']"
@click="handleDelete(scope.row)"></el-button>
<el-button type="success" size="small" icon="edit" title="编辑"
v-hasPermi="['deviceManagement:deviceformconfig:edit']" @click="handleUpdate(scope.row)"></el-button>
<el-button type="danger" size="small" icon="delete" title="删除"
v-hasPermi="['deviceManagement:deviceformconfig:delete']" @click="handleDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改设备检查项表单配置表对话框 -->
<el-dialog :title="title" :lock-scroll="false" v-model="open">
@ -60,10 +48,7 @@
<el-col :lg="12">
<el-form-item label="表单类型" prop="type">
<el-select v-model="form.type" placeholder="请选择表单类型">
<el-option
v-for="item in options.typeOptions"
:key="item.dictValue"
:label="item.dictLabel"
<el-option v-for="item in options.typeOptions" :key="item.dictValue" :label="item.dictLabel"
:value="parseInt(item.dictValue)"></el-option>
</el-select>
</el-form-item>
@ -180,7 +165,7 @@ const state = reactive({
multiple: true,
form: {},
rules: {
id: [{ required: true, message: 'id 雪花不能为空', trigger: 'blur' }]
//id: [{ required: true, message: 'id ', trigger: 'blur' }]
},
options: {
// eg:{ dictLabel: '', dictValue: '0'}
@ -190,8 +175,16 @@ const state = reactive({
// 使
var dictParams = [{ dictType: 'mes_device_inspect_form_config', columnName: 'typeOptions' }]
import { getOneDict } from '@/utils/dict.js'
async function initDict() {
const dictSelectList = ['mes_device_inspect_form_config']
const statusRes = await getOneDict(dictSelectList[0])
if (statusRes.code === 200) {
state.options.typeOptions = statusRes.data[0].list
}
}
proxy.getDicts(dictParams).then((response) => {
console.log(response)
response.data.forEach((element) => {
state.options[element.columnName] = element.list.map((item) => {
item.dictValue = parseInt(item.dictValue)
@ -229,6 +222,7 @@ function handleAdd() {
open.value = true
title.value = '添加设备检查项表单配置表'
opertype.value = 1
initDict()
}
//
function handleUpdate(row) {
@ -240,7 +234,7 @@ function handleUpdate(row) {
open.value = true
title.value = '修改设备检查项表单配置表'
opertype.value = 2
initDict()
form.value = {
...data
}