yangfeng
2023-12-12 1519870c0e18171ced014a840e86a459dc6b00f1
src/views/dashboard/components/TaskControlModal.vue
@@ -40,6 +40,10 @@
                    <div class="info-item-two">
                      <div style="color: #4efefa; font-size: 18px; margin-bottom: 10px; margin-top: 20px">工艺参数</div>
                      <!-- 未获取到工艺参数, 且当前设备允许在没有工艺参数的情况下生产, 则提示-->
                      <div v-if="!craftParams?.length && currentDeviceAllowNoParams" class="info-item info-item-two">
                        未获取到工艺参数, 请手动设置或在云端工艺模型中上传
                      </div>
                      <div v-for="(item, index) in craftParams" :key="index" class="info-item info-item-two">
                        {{ item.Key }}:{{ item.Value || '' }}
                      </div>
@@ -52,7 +56,7 @@
        </template>
        <!--        只有获取到工艺参数才可以进行操作-->
        <template v-if="getCraftParamsTip">
        <template v-if="getCraftParamsTip && !currentDeviceAllowNoParams">
          <div class="content-tips">
            <div class="craft-params-error">
              <div class="error-icon">
@@ -108,7 +112,7 @@
        </template>
      </div>
      <template #footer>
        <template v-if="getCraftParamsTip">
        <template v-if="getCraftParamsTip && !currentDeviceAllowNoParams">
          <div class="btn">
            <BigButton bg-color="#4765c0" @click="closeModal"> 关闭 </BigButton>
          </div>
@@ -160,6 +164,7 @@
import { createMachine } from 'xstate'
import { useMachine } from '@xstate/vue'
import { CircleCloseFilled, Loading, SuccessFilled } from '@element-plus/icons-vue'
import { useDevicesStore } from '@/stores/devices'
export interface TaskControlModalProps {
  task?: Task
@@ -196,7 +201,8 @@
const craftParams = ref<CraftParam[]>()
// 获取工艺参数结果信息
const getCraftParamsTip = ref('')
// 当前设备若没有工艺参数是否允许下发
const { currentDeviceAllowNoParams } = storeToRefs(useDevicesStore())
/**
 * 获取当前展示的任务的工艺参数
 */
@@ -204,6 +210,7 @@
  if (taskId) {
    craftParams.value = []
    getCraftParamsTip.value = ''
    getCraftParams({ id: taskId }).then(
      (res) => {
        craftParams.value = res.data.Params ?? []
@@ -238,7 +245,7 @@
const safeProduce = ref('')
watch(modelData, () => {
  if (modelData.value) {
    safeProduce.value = channels?.value?.[task.value.Channel]?.Prompt?.safeProduce ?? ''
    safeProduce.value = channels?.value?.[task?.value?.Channel ?? 0]?.Prompt?.safeProduce ?? ''
  }
})
@@ -335,7 +342,7 @@
  send('开始生产')
  sendProcessParams({
    procedureId: task.value.Procedure.ID
    procedureId: task!.value!.Procedure.ID
  })
    .then(
      (res) => {
@@ -441,7 +448,13 @@
.btn {
  display: flex;
  align-items: center;
  justify-content: space-around;
  justify-content: center;
  & > button {
    margin-right: 20px;
    &:last-child {
      margin-right: 0;
    }
  }
}
.content-title {
  display: flex;