|
@@ -1,142 +0,0 @@
|
|
|
-<template>
|
|
|
- <BasicModal
|
|
|
- v-bind="$attrs"
|
|
|
- @register="register"
|
|
|
- title="优先级设置"
|
|
|
- @ok="handleSubmit"
|
|
|
- :height="300"
|
|
|
- :min-height="0"
|
|
|
- >
|
|
|
- <div class="pt-2px pr-3px">
|
|
|
- <div style="padding-left: 125px; line-height: 32px;" v-if="model.numList && model.numList.length">仅计算成功、封存场景支持迁移</div>
|
|
|
- <BasicForm @register="registerForm" :model="model">
|
|
|
- <template #text="{ model, field }">
|
|
|
- {{ model[field] }}
|
|
|
- </template>
|
|
|
- </BasicForm>
|
|
|
- </div>
|
|
|
- </BasicModal>
|
|
|
-</template>
|
|
|
-<script lang="ts">
|
|
|
- import { defineComponent, ref, nextTick, onMounted, reactive } from 'vue';
|
|
|
- import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
- import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
- import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { updateModelingLevel, mqQueueConfigList, getInfo } from '/@/api/operate';
|
|
|
- import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
-
|
|
|
- const { t } = useI18n();
|
|
|
- export default defineComponent({
|
|
|
- components: { BasicModal, BasicForm },
|
|
|
- props: {
|
|
|
- userData: { type: Object },
|
|
|
- },
|
|
|
- emits: ['update', 'register'],
|
|
|
- setup(props, { emit }) {
|
|
|
- const modelRef = ref({
|
|
|
- num: '',
|
|
|
- numList: []
|
|
|
- });
|
|
|
- const fileFlow = reactive({
|
|
|
- file: null,
|
|
|
- });
|
|
|
- const { createMessage } = useMessage();
|
|
|
- const schemas: FormSchema[] = [
|
|
|
- {
|
|
|
- field: 'num',
|
|
|
- component: 'Input',
|
|
|
- label: 'num',
|
|
|
- show: false,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'cameraId',
|
|
|
- component: 'Input',
|
|
|
- label: 'num',
|
|
|
- show: false,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'configId',
|
|
|
- component: 'ApiRadioGroup',
|
|
|
- label: '优先级',
|
|
|
- required: true,
|
|
|
- colProps: {
|
|
|
- span: 16,
|
|
|
- },
|
|
|
- defaultValue: 2,
|
|
|
- componentProps: {
|
|
|
- placeholder: '请输入相机SN码',
|
|
|
- maxLength: 15,
|
|
|
- api: mqQueueConfigList,
|
|
|
- // numberToString: true,
|
|
|
- labelField: 'remark',
|
|
|
- valueField: 'id',
|
|
|
- immediate: true,
|
|
|
- params: {
|
|
|
- agentName: '',
|
|
|
- },
|
|
|
- onChange: (data) => {
|
|
|
- console.log('data', data);
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
- ];
|
|
|
- const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
|
|
|
- labelWidth: 120,
|
|
|
- schemas,
|
|
|
- showActionButtonGroup: false,
|
|
|
- actionColOptions: {
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- });
|
|
|
- onMounted(() => {});
|
|
|
- let addListFunc = () => {};
|
|
|
- const [register, { closeModal }] = useModalInner((data) => {
|
|
|
- console.log(data);
|
|
|
- data && onDataReceive(data);
|
|
|
- });
|
|
|
-
|
|
|
- async function onDataReceive(data) {
|
|
|
- let { id } = await getInfo(data);
|
|
|
- modelRef.value = data;
|
|
|
- resetFields();
|
|
|
- updateSchema({
|
|
|
- field: 'type',
|
|
|
- ifShow: false,
|
|
|
- });
|
|
|
- setFieldsValue({
|
|
|
- ...data,
|
|
|
- configId: id,
|
|
|
- });
|
|
|
- }
|
|
|
- const handleSubmit = async () => {
|
|
|
- try {
|
|
|
- const params = await validate();
|
|
|
- const res = await updateModelingLevel(params);
|
|
|
- console.log('res', res);
|
|
|
- closeModal();
|
|
|
- resetFields();
|
|
|
- createMessage.success('优先级设置成功。');
|
|
|
- emit('update');
|
|
|
- } catch (error) {
|
|
|
- console.log('not passing', error);
|
|
|
- }
|
|
|
- };
|
|
|
- function handleVisibleChange(v) {
|
|
|
- // console.log(v);
|
|
|
- // v && props.userData && nextTick(() => onDataReceive(props.userData));
|
|
|
- }
|
|
|
- return {
|
|
|
- register,
|
|
|
- schemas,
|
|
|
- registerForm,
|
|
|
- model: modelRef,
|
|
|
- fileFlow,
|
|
|
- handleVisibleChange,
|
|
|
- handleSubmit,
|
|
|
- addListFunc,
|
|
|
- resetFields,
|
|
|
- t,
|
|
|
- };
|
|
|
- },
|
|
|
- });
|
|
|
-</script>
|