|
@@ -15,7 +15,7 @@
|
|
</n-select>
|
|
</n-select>
|
|
<!-- 单选id -->
|
|
<!-- 单选id -->
|
|
<n-select v-model:value="item.T_value" label-field="T_id" value-field="T_sn" :options="classList"
|
|
<n-select v-model:value="item.T_value" label-field="T_id" value-field="T_sn" :options="classList"
|
|
- v-else-if="item.T_label === 4" />
|
|
|
|
|
|
+ v-else-if="item.T_label === 4"/>
|
|
<!-- 时间 -->
|
|
<!-- 时间 -->
|
|
<n-date-picker v-model:formatted-value="item.T_value" value-format="yyyy-MM-dd HH:mm" type="datetime" clearable
|
|
<n-date-picker v-model:formatted-value="item.T_value" value-format="yyyy-MM-dd HH:mm" type="datetime" clearable
|
|
class="w-full" v-else-if="item.T_label === 7" />
|
|
class="w-full" v-else-if="item.T_label === 7" />
|
|
@@ -38,6 +38,35 @@
|
|
<n-button @click="() => handleRefresh(index)">刷新</n-button>
|
|
<n-button @click="() => handleRefresh(index)">刷新</n-button>
|
|
</n-space>
|
|
</n-space>
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
|
|
+ <!-- 时间 注释 -->
|
|
|
|
+ <template v-else-if="item.T_label === 12">
|
|
|
|
+ <n-space vertical class="w-full">
|
|
|
|
+ <n-date-picker
|
|
|
|
+ v-model:formatted-value="item.T_value[0]"
|
|
|
|
+ format="yyyy-MM-dd HH:mm"
|
|
|
|
+ :time-picker-props="{ format: 'HH:mm' }"
|
|
|
|
+ type="datetime"
|
|
|
|
+ clearable
|
|
|
|
+ />
|
|
|
|
+ <n-input v-model:value="item.T_value[1]" type="text" />
|
|
|
|
+ </n-space>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 时间区间 注释 -->
|
|
|
|
+ <template v-else-if="item.T_label === 13">
|
|
|
|
+ <n-space vertical class="w-full">
|
|
|
|
+ <n-date-picker
|
|
|
|
+ v-model:formatted-value="item.T_value[0]"
|
|
|
|
+ format="yyyy-MM-dd HH:mm"
|
|
|
|
+ :time-picker-props="{ format: 'HH:mm' }"
|
|
|
|
+ type="datetimerange"
|
|
|
|
+ clearable
|
|
|
|
+ />
|
|
|
|
+ <n-input v-model:value="item.T_value[1]" type="text" />
|
|
|
|
+ </n-space>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+
|
|
<!-- 可输入的表单项 -->
|
|
<!-- 可输入的表单项 -->
|
|
<template v-else>
|
|
<template v-else>
|
|
<n-input v-model:value="item.T_value" />
|
|
<n-input v-model:value="item.T_value" />
|
|
@@ -58,7 +87,9 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { getVerifyTemplateMapDataList } from '@/api';
|
|
|
|
|
|
+
|
|
|
|
+import { getVerifyTemplateMapDataList,putVerifyTemplateMapData} from '@/api';
|
|
|
|
+import { getToken } from '@/utils/storage/sessionToken';
|
|
import { watch } from 'vue';
|
|
import { watch } from 'vue';
|
|
import { InformationCircleOutline } from '@vicons/ionicons5';
|
|
import { InformationCircleOutline } from '@vicons/ionicons5';
|
|
|
|
|
|
@@ -89,6 +120,7 @@ const formValue = reactive({
|
|
watch(
|
|
watch(
|
|
() => props.time,
|
|
() => props.time,
|
|
(newValue) => {
|
|
(newValue) => {
|
|
|
|
+ console.log('时间',classList)
|
|
const index = formValue.formList.findIndex((item) => item.T_label === 7);
|
|
const index = formValue.formList.findIndex((item) => item.T_label === 7);
|
|
formValue.formList[index].T_value = newValue;
|
|
formValue.formList[index].T_value = newValue;
|
|
}
|
|
}
|
|
@@ -97,11 +129,60 @@ watch(
|
|
watch(
|
|
watch(
|
|
() => props.temporalInterval,
|
|
() => props.temporalInterval,
|
|
(newValue) => {
|
|
(newValue) => {
|
|
- const index = formValue.formList.findIndex((item) => item.T_label === 9);
|
|
|
|
- formValue.formList[index].T_value = newValue;
|
|
|
|
|
|
+ formValue.formList.forEach((item,i)=>{
|
|
|
|
+ if(item.T_label === 9){
|
|
|
|
+ formValue.formList[i].T_value = newValue
|
|
|
|
+ }
|
|
|
|
+ if(item.T_label === 13){
|
|
|
|
+ formValue.formList[i].T_value[0] = newValue
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
+watch(()=>formValue.formList, async(newValue,old)=>{
|
|
|
|
+ console.log('最新',newValue,old)
|
|
|
|
+ if(old.length!=0){
|
|
|
|
+ const res = await dataPicker()
|
|
|
|
+ const token = getToken();
|
|
|
|
+ putVerifyTemplateMapData({
|
|
|
|
+ User_tokey: token,
|
|
|
|
+ T_source: queryData.T_source,
|
|
|
|
+ T_task_id: queryData.T_task_id,
|
|
|
|
+ T_VerifyTemplate_id: queryData.T_VerifyTemplate_id,
|
|
|
|
+ VerifyTemplateMapData:res
|
|
|
|
+ });
|
|
|
|
+ console.log('修改值',res)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+},{deep:true})
|
|
|
|
|
|
|
|
+const dataPicker = ()=>{
|
|
|
|
+ let arr = []
|
|
|
|
+ return new Promise(resolve=>{
|
|
|
|
+ formValue.formList.forEach(item=>{
|
|
|
|
+ let obj = {...item}
|
|
|
|
+ if(obj.T_label==3 || obj.T_label==9){//多选id sn|sn|
|
|
|
|
+
|
|
|
|
+ obj.T_value!=null? obj.T_value = obj.T_value.join("|"): obj.T_value = null
|
|
|
|
+ }else if(obj.T_label==12){
|
|
|
|
+ console.log('当前为12',obj.T_value)
|
|
|
|
+ obj.T_value = obj.T_value.join("/")
|
|
|
|
+
|
|
|
|
+ }else if(obj.T_label==13){
|
|
|
|
+ console.log('当前为13',obj.T_value)
|
|
|
|
+ if(obj.T_value[0]!=null){
|
|
|
|
+ obj.T_value = obj.T_value[0].join("|") + '/' + obj.T_value[1]
|
|
|
|
+ console.log('13选择了',obj.T_value)
|
|
|
|
+ }else{
|
|
|
|
+ obj.T_value = '/'+ obj.T_value[1]==null?'':obj.T_value[1]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ arr.push(obj)
|
|
|
|
+ })
|
|
|
|
+ resolve(arr)
|
|
|
|
+ })
|
|
|
|
+ console.log('失去焦点',formValue.formList)
|
|
|
|
+}
|
|
//
|
|
//
|
|
const queryData = reactive({
|
|
const queryData = reactive({
|
|
T_source: 3,
|
|
T_source: 3,
|
|
@@ -130,9 +211,20 @@ const getTemplateList = async () => {
|
|
try {
|
|
try {
|
|
const { data: res } = await getVerifyTemplateMapDataList(queryData);
|
|
const { data: res } = await getVerifyTemplateMapDataList(queryData);
|
|
formValue.formList = res.Data || [];
|
|
formValue.formList = res.Data || [];
|
|
- formValue.formList.forEach((item) => {
|
|
|
|
- if (item.T_label === 4 || item.T_label === 9) {
|
|
|
|
|
|
+ formValue.formList.forEach((item,index) => {
|
|
|
|
+ console.log(item,item.T_value,index)
|
|
|
|
+ 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){
|
|
|
|
+ if(item.T_value==null){
|
|
|
|
+ item.T_value = [null,null]
|
|
|
|
+ }else{
|
|
|
|
+ item.T_value = item.T_value.split('/')
|
|
|
|
+ }
|
|
|
|
+ console.log('12处理哈',item.T_value )
|
|
|
|
+ }else if( item.T_label === 13){
|
|
|
|
+ item.T_value = item.T_value ? [item.T_value.split('/')[0].split('|'),item.T_value.split('/')[1]]: [null,null];
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
item.T_value = item.T_value ? item.T_value : null;
|
|
item.T_value = item.T_value ? item.T_value : null;
|
|
}
|
|
}
|