|
@@ -17,85 +17,8 @@
|
|
</template>
|
|
</template>
|
|
</n-page-header>
|
|
</n-page-header>
|
|
<n-scrollbar :style="{ maxHeight: `${height - 150}px` }" trigger="none">
|
|
<n-scrollbar :style="{ maxHeight: `${height - 150}px` }" trigger="none">
|
|
- <n-form label-width="auto" size="large">
|
|
|
|
- <n-grid :cols="12" :x-gap="12">
|
|
|
|
- <n-form-item-gi
|
|
|
|
- v-for="(item, index) of formValue.formList"
|
|
|
|
- :key="item.T_VerifyTemplateMap_id"
|
|
|
|
- :span="4"
|
|
|
|
- :label="item.T_name"
|
|
|
|
- >
|
|
|
|
- <template v-if="item.T_label === 3 || item.T_label === 4">
|
|
|
|
- <n-select
|
|
|
|
- v-model:value="item.T_value"
|
|
|
|
- :multiple="item.T_label === 3 ? true : false"
|
|
|
|
- label-field="T_id"
|
|
|
|
- value-field="T_sn"
|
|
|
|
- :max-tag-count="item.T_label === 3 ? 'responsive' : undefined"
|
|
|
|
- :options="classList"
|
|
|
|
- >
|
|
|
|
- <template #action v-if="item.T_label === 3">
|
|
|
|
- <n-space>
|
|
|
|
- <n-button
|
|
|
|
- class="underline"
|
|
|
|
- text
|
|
|
|
- @click="handleSelectAll(index)"
|
|
|
|
- >全选</n-button
|
|
|
|
- >
|
|
|
|
- <n-button
|
|
|
|
- class="underline"
|
|
|
|
- text
|
|
|
|
- @click="handleSelectReverse(index)"
|
|
|
|
- >反选</n-button
|
|
|
|
- >
|
|
|
|
- </n-space>
|
|
|
|
- </template>
|
|
|
|
- </n-select>
|
|
|
|
- </template>
|
|
|
|
- <template v-else-if="item.T_label === 7 || item.T_label === 9">
|
|
|
|
- <n-date-picker
|
|
|
|
- v-model:formatted-value="item.T_value"
|
|
|
|
- value-format="yyyy-MM-dd HH:mm"
|
|
|
|
- :type="item.T_label === 7 ? 'datetime' : 'datetimerange'"
|
|
|
|
- clearable
|
|
|
|
- class="w-full"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- <template v-else-if="item.T_label === 10 || item.T_label === 11">
|
|
|
|
- <n-image class="mr-5" width="100" :src="item.T_value" />
|
|
|
|
- <n-upload
|
|
|
|
- list-type="image-card"
|
|
|
|
- @change="(options) => handleChangeByIndex(options, index)"
|
|
|
|
- :default-upload="false"
|
|
|
|
- :max="1"
|
|
|
|
- v-if="item.T_label === 10"
|
|
|
|
- >
|
|
|
|
- 点击上传
|
|
|
|
- </n-upload>
|
|
|
|
- <n-space v-else>
|
|
|
|
- <n-button @click="() => handleEdit(item)">编辑</n-button>
|
|
|
|
- <n-button @click="() => handleRefresh(index)">刷新</n-button>
|
|
|
|
- </n-space>
|
|
|
|
- </template>
|
|
|
|
- <template v-else>
|
|
|
|
- <n-input v-model:value="item.T_value" />
|
|
|
|
- </template>
|
|
|
|
- <n-popover trigger="hover">
|
|
|
|
- <template #trigger>
|
|
|
|
- <n-icon size="24" class="ml-3">
|
|
|
|
- <InformationCircleOutline />
|
|
|
|
- </n-icon>
|
|
|
|
- </template>
|
|
|
|
- <n-image
|
|
|
|
- width="200"
|
|
|
|
- :src="item.T_text"
|
|
|
|
- v-if="item.T_label === 10 || item.T_label === 11"
|
|
|
|
- />
|
|
|
|
- <span v-else>{{ item.T_text }}</span>
|
|
|
|
- </n-popover>
|
|
|
|
- </n-form-item-gi>
|
|
|
|
- </n-grid>
|
|
|
|
- </n-form>
|
|
|
|
|
|
+ <FormList :form-list="formValue.formList" />
|
|
|
|
+ <!-- <n-button @click="handleClick">button</n-button> -->
|
|
</n-scrollbar>
|
|
</n-scrollbar>
|
|
</div>
|
|
</div>
|
|
<n-modal
|
|
<n-modal
|
|
@@ -140,11 +63,7 @@
|
|
trigger="none"
|
|
trigger="none"
|
|
ref="scrollbarRef"
|
|
ref="scrollbarRef"
|
|
>
|
|
>
|
|
- <div
|
|
|
|
- class="flex items-center"
|
|
|
|
- v-for="(item, index) of items"
|
|
|
|
- :key="index"
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="flex" v-for="(item, index) of items" :key="index">
|
|
<n-badge class="mr-5" type="info" :value="index + 1" />
|
|
<n-badge class="mr-5" type="info" :value="index + 1" />
|
|
<span>{{ item }}</span>
|
|
<span>{{ item }}</span>
|
|
</div>
|
|
</div>
|
|
@@ -179,10 +98,10 @@ import {
|
|
import * as qiniu from 'qiniu-js';
|
|
import * as qiniu from 'qiniu-js';
|
|
import { getToken } from '@/utils/storage/sessionToken';
|
|
import { getToken } from '@/utils/storage/sessionToken';
|
|
import { getFileToken } from '@/common';
|
|
import { getFileToken } from '@/common';
|
|
-import { InformationCircleOutline } from '@vicons/ionicons5';
|
|
|
|
import { useWindowSize } from '@vueuse/core';
|
|
import { useWindowSize } from '@vueuse/core';
|
|
import { NButton } from 'naive-ui';
|
|
import { NButton } from 'naive-ui';
|
|
import { onBeforeUnmount } from 'vue';
|
|
import { onBeforeUnmount } from 'vue';
|
|
|
|
+import FormList from '@/components/FormList.vue';
|
|
|
|
|
|
const { height } = useWindowSize();
|
|
const { height } = useWindowSize();
|
|
|
|
|
|
@@ -200,6 +119,10 @@ const formValue = reactive({
|
|
formList: [],
|
|
formList: [],
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const handleClick = () => {
|
|
|
|
+ console.log(formValue.formList);
|
|
|
|
+};
|
|
|
|
+
|
|
// 查询数据
|
|
// 查询数据
|
|
const queryData = reactive({
|
|
const queryData = reactive({
|
|
T_source: 2,
|
|
T_source: 2,
|
|
@@ -216,45 +139,6 @@ const modal = reactive({
|
|
title: '',
|
|
title: '',
|
|
});
|
|
});
|
|
|
|
|
|
-// CAD刷新
|
|
|
|
-const handleRefresh = (index) => {
|
|
|
|
- formValue.formList[
|
|
|
|
- index
|
|
|
|
- ].T_value = `http://coldverifylocal.coldbaozhida.com/CAD/download?type=upload&filename=${queryData.T_task_id}_${queryData.T_VerifyTemplate_id}_${formValue.formList[index].T_id}.png`;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-// CAD编辑
|
|
|
|
-const handleEdit = (row) => {
|
|
|
|
- window.open(
|
|
|
|
- `http://coldverifylocal.coldbaozhida.com/CAD/?task_id=${queryData.T_task_id}&vt_id=${queryData.T_VerifyTemplate_id}&key_id=${row.T_id}`
|
|
|
|
- );
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-const handleChangeByIndex = async ({ file }, i) => {
|
|
|
|
- const token = await getFileToken(file.name.split('.')[1]);
|
|
|
|
- const observable = qiniu.upload(
|
|
|
|
- file.file,
|
|
|
|
- file.name,
|
|
|
|
- token,
|
|
|
|
- {},
|
|
|
|
- {
|
|
|
|
- useCdnDomain: true,
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- observable.subscribe({
|
|
|
|
- next: (result) => {
|
|
|
|
- // 主要用来展示进度
|
|
|
|
- console.warn(result);
|
|
|
|
- },
|
|
|
|
- error: () => {
|
|
|
|
- message.error('上传失败');
|
|
|
|
- },
|
|
|
|
- complete: (res) => {
|
|
|
|
- formValue.formList[i].T_value = res.key;
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
//
|
|
//
|
|
const handleChange = async ({ file }) => {
|
|
const handleChange = async ({ file }) => {
|
|
const token = await getFileToken(file.name.split('.')[1]);
|
|
const token = await getFileToken(file.name.split('.')[1]);
|
|
@@ -281,22 +165,6 @@ const handleChange = async ({ file }) => {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
-// 全选
|
|
|
|
-const handleSelectAll = (i) => {
|
|
|
|
- if (formValue.formList[i].T_value.length !== 0) {
|
|
|
|
- return (formValue.formList[i].T_value = []);
|
|
|
|
- }
|
|
|
|
- formValue.formList[i].T_value = classList.value.map((item) => item.T_sn);
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-// 反选
|
|
|
|
-const handleSelectReverse = (i) => {
|
|
|
|
- const arr = classList.value.map((item) => item.T_sn);
|
|
|
|
- formValue.formList[i].T_value = arr.filter(
|
|
|
|
- (item) => !formValue.formList[i].T_value.includes(item)
|
|
|
|
- );
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
// 显示上传验证对话框
|
|
// 显示上传验证对话框
|
|
const showUploadModal = () => {
|
|
const showUploadModal = () => {
|
|
modal.title = '上传验证';
|
|
modal.title = '上传验证';
|
|
@@ -383,6 +251,24 @@ const putTemplateData = async () => {
|
|
T_max_time: item.T_max_time,
|
|
T_max_time: item.T_max_time,
|
|
T_min_time: item.T_min_time,
|
|
T_min_time: item.T_min_time,
|
|
};
|
|
};
|
|
|
|
+ } else if (item.T_label === 12) {
|
|
|
|
+ return {
|
|
|
|
+ T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
|
|
+ T_value: item.T_value.join('/'),
|
|
|
|
+ T_source: item.T_source,
|
|
|
|
+ T_flow_sort: item.T_flow_sort,
|
|
|
|
+ T_max_time: item.T_max_time,
|
|
|
|
+ T_min_time: item.T_min_time,
|
|
|
|
+ };
|
|
|
|
+ } else if (item.T_label === 13) {
|
|
|
|
+ return {
|
|
|
|
+ T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
|
|
+ T_value: `${item.T_value[0].join('|')}/${item.T_value[1]}`,
|
|
|
|
+ T_source: item.T_source,
|
|
|
|
+ T_flow_sort: item.T_flow_sort,
|
|
|
|
+ T_max_time: item.T_max_time,
|
|
|
|
+ T_min_time: item.T_min_time,
|
|
|
|
+ };
|
|
} else {
|
|
} else {
|
|
return {
|
|
return {
|
|
T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
@@ -407,6 +293,10 @@ const putTemplateData = async () => {
|
|
for (let i of arr) {
|
|
for (let i of arr) {
|
|
if (i.T_label === 3 || i.T_label === 9) {
|
|
if (i.T_label === 3 || i.T_label === 9) {
|
|
obj[i.T_name] = i.T_value.join('|');
|
|
obj[i.T_name] = i.T_value.join('|');
|
|
|
|
+ } else if (i.T_label === 12) {
|
|
|
|
+ obj[i.T_name] = i.T_value.join('/');
|
|
|
|
+ } else if (i.T_label === 13) {
|
|
|
|
+ obj[i.T_name] = `${i.T_value[0].join('|')}/${i.T_value[1]}`;
|
|
} else {
|
|
} else {
|
|
obj[i.T_name] = i.T_value;
|
|
obj[i.T_name] = i.T_value;
|
|
}
|
|
}
|
|
@@ -440,6 +330,14 @@ const getTemplateList = async () => {
|
|
formValue.formList.forEach((item) => {
|
|
formValue.formList.forEach((item) => {
|
|
if (item.T_label === 3 || item.T_label === 9) {
|
|
if (item.T_label === 3 || item.T_label === 9) {
|
|
item.T_value = item.T_value ? item.T_value.split('|') : null;
|
|
item.T_value = item.T_value ? item.T_value.split('|') : null;
|
|
|
|
+ } else if (item.T_label === 12) {
|
|
|
|
+ item.T_value = item.T_value
|
|
|
|
+ ? [item.T_value.split('/')[0], item.T_value.split('/')[1]]
|
|
|
|
+ : null;
|
|
|
|
+ } else if (item.T_label === 13) {
|
|
|
|
+ item.T_value = item.T_value
|
|
|
|
+ ? [item.T_value.split('/')[0].split('|'), item.T_value.split('/')[1]]
|
|
|
|
+ : null;
|
|
} else {
|
|
} else {
|
|
item.T_value = item.T_value ? item.T_value : null;
|
|
item.T_value = item.T_value ? item.T_value : null;
|
|
}
|
|
}
|