|
@@ -105,23 +105,56 @@
|
|
</HcDialog>
|
|
</HcDialog>
|
|
|
|
|
|
<!--引用容器参数-->
|
|
<!--引用容器参数-->
|
|
- <HcDialog :show="vesselModal" title="引用容器参数" widths="700px" saveText="确认引用" isTable @close="vesselModalClose" @save="vesselModalSave">
|
|
|
|
- <HcTable ref="vesselTableRef" :column="vesselTableColumn" :datas="vesselTableData" :loading="vesselTableLoading" isCheck @selection-change="vesselTableSelection"/>
|
|
|
|
|
|
+ <HcDialog :show="vesselModal" title="引用容器参数" widths="84%" saveText="确认引用" isTable @close="vesselModalClose" @save="vesselModalSave">
|
|
|
|
+ <div class="adding-form-dialog-box">
|
|
|
|
+ <div class="dialog-tree-box">
|
|
|
|
+ <el-scrollbar>
|
|
|
|
+ <HcMenuSimple :datas="menus" :props="menuProps" :keys="menuKey" @change="menuChange"/>
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="dialog-table-box">
|
|
|
|
+ <div class="dialog-table">
|
|
|
|
+ <HcTable ref="vesselTableRef" :column="vesselTableColumn" :datas="vesselTableData" :loading="vesselTableLoading" isCheck @selection-change="vesselTableSelection"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="dialog-pages">
|
|
|
|
+ <HcPages :pages="vesselTablePage" @change="vesselTablePageChange"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</HcDialog>
|
|
</HcDialog>
|
|
|
|
|
|
<!--引用设备仪器-->
|
|
<!--引用设备仪器-->
|
|
- <HcDialog :show="deviceModal" title="引用设备仪器" widths="850px" saveText="确认引用" isTable @close="deviceModalClose" @save="deviceModalSave">
|
|
|
|
- <HcTable ref="deviceTableRef" :column="deviceTableColumn" :datas="deviceTableData" :loading="deviceTableLoading" isCheck @selection-change="deviceTableSelection"/>
|
|
|
|
|
|
+ <HcDialog :show="deviceModal" title="引用设备仪器" widths="84%" saveText="确认引用" isTable @close="deviceModalClose" @save="deviceModalSave">
|
|
|
|
+ <!-- <HcTable ref="deviceTableRef" :column="deviceTableColumn" :datas="deviceTableData" :loading="deviceTableLoading" isCheck @selection-change="deviceTableSelection"/> -->
|
|
|
|
+ <div class="adding-form-dialog-box">
|
|
|
|
+ <div class="dialog-tree-box">
|
|
|
|
+ <el-scrollbar>
|
|
|
|
+ <HcMenuSimple :datas="equipmentmenus" :props="equipmentmenuProps" :keys="equipmentmenuKey" @change="equipmentmenuChange"/>
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="dialog-table-box">
|
|
|
|
+ <div class="dialog-table">
|
|
|
|
+ <HcTable ref="deviceTableRef" :column="deviceTableColumn" :datas="deviceTableData" :loading="deviceTableLoading" isCheck @selection-change="deviceTableSelection"/>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="dialog-pages">
|
|
|
|
+ <HcPages :pages="equipmentPage" @change="equipmentTablePageChange"/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</HcDialog>
|
|
</HcDialog>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import {ref,watch,nextTick} from "vue";
|
|
import {ref,watch,nextTick} from "vue";
|
|
|
|
+import {useAppStore} from "~src/store";
|
|
import wbsApi from "~api/data-fill/wbs"
|
|
import wbsApi from "~api/data-fill/wbs"
|
|
import HcUpload from "./HcUpload.vue"
|
|
import HcUpload from "./HcUpload.vue"
|
|
import HTableForm from "~src/plugins/HTableForm"
|
|
import HTableForm from "~src/plugins/HTableForm"
|
|
import dataApi from "~api/tentative/detect/test";
|
|
import dataApi from "~api/tentative/detect/test";
|
|
|
|
+import dataApi1 from "~api/tentative/parameter/container"
|
|
|
|
+import dataApi2 from "~api/tentative/device/approach"
|
|
|
|
+import {getClassList} from "~api/tentative";
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
import {utilsText, isType, formValidate, deepClone} from "vue-utils-plus"
|
|
import {utilsText, isType, formValidate, deepClone} from "vue-utils-plus"
|
|
|
|
|
|
@@ -139,6 +172,10 @@ const props = defineProps({
|
|
type: Object,
|
|
type: Object,
|
|
default: () => ({})
|
|
default: () => ({})
|
|
},
|
|
},
|
|
|
|
+ deviceUseIds:{
|
|
|
|
+ type: String,
|
|
|
|
+ default: () => ('')
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
const {isString, getObjNullValue, getArrValue} = isType()
|
|
const {isString, getObjNullValue, getArrValue} = isType()
|
|
@@ -146,6 +183,9 @@ const {setPosInsert, setPosRange} = utilsText()
|
|
const listDatas = ref(props.datas)
|
|
const listDatas = ref(props.datas)
|
|
const isStatus = ref(props.status)
|
|
const isStatus = ref(props.status)
|
|
const baseData = ref(props.baseData)
|
|
const baseData = ref(props.baseData)
|
|
|
|
+const useAppState = useAppStore()
|
|
|
|
+const projectId = ref(useAppState.getProjectId);
|
|
|
|
+const contractId = ref(useAppState.getContractId);
|
|
|
|
|
|
//监听
|
|
//监听
|
|
watch(() => [
|
|
watch(() => [
|
|
@@ -539,12 +579,12 @@ const onRightClick = (event, KeyName, index) => {
|
|
const handleMenuSelect = ({key}) => {
|
|
const handleMenuSelect = ({key}) => {
|
|
if (key === 'vessel') {
|
|
if (key === 'vessel') {
|
|
vesselModal.value = true
|
|
vesselModal.value = true
|
|
- getVesselTableData()
|
|
|
|
|
|
+ getMenusData()
|
|
} else if (key === 'special') {
|
|
} else if (key === 'special') {
|
|
specialModalShow()
|
|
specialModalShow()
|
|
} else if (key === 'device') {
|
|
} else if (key === 'device') {
|
|
deviceModal.value = true
|
|
deviceModal.value = true
|
|
- getDeviceTableData()
|
|
|
|
|
|
+ getequipmentMenusData()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -552,18 +592,79 @@ const handleMenuSelect = ({key}) => {
|
|
const vesselModal = ref(false)
|
|
const vesselModal = ref(false)
|
|
const vesselTableRef = ref(null)
|
|
const vesselTableRef = ref(null)
|
|
|
|
|
|
|
|
+//引用容器参数菜单数据
|
|
|
|
+const menuProps = {
|
|
|
|
+ key: 'id',
|
|
|
|
+ label: 'containerName',
|
|
|
|
+}
|
|
|
|
+//引用容器参数菜单数据
|
|
|
|
+const equipmentmenuProps = {
|
|
|
|
+ key: 'id',
|
|
|
|
+ label: 'className',
|
|
|
|
+}
|
|
|
|
+const menus = ref([]);
|
|
|
|
+const getMenusData = async () => {
|
|
|
|
+ const { data } = await dataApi1.queryClassification({
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value
|
|
|
|
+ })
|
|
|
|
+ const arr = getArrValue(data)
|
|
|
|
+ menus.value = arr
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
+ const item = arr[0]
|
|
|
|
+ console.log(item,'item');
|
|
|
|
+ menuItem.value = item
|
|
|
|
+ menuKey.value = item?.id
|
|
|
|
+ getVesselTableData()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//菜单被点击
|
|
|
|
+const menuKey = ref()
|
|
|
|
+const menuItem = ref({})
|
|
|
|
+const menuChange = (item) => {
|
|
|
|
+ menuItem.value = item
|
|
|
|
+ menuKey.value = item?.id
|
|
|
|
+ getVesselTableData()
|
|
|
|
+}
|
|
|
|
+
|
|
//表格数据
|
|
//表格数据
|
|
const vesselTableColumn = ref([
|
|
const vesselTableColumn = ref([
|
|
- {key:'key1', name: '容器编号'},
|
|
|
|
|
|
+ {key:'key_1', name: '容器编号'},
|
|
])
|
|
])
|
|
const vesselTableData = ref([])
|
|
const vesselTableData = ref([])
|
|
-
|
|
|
|
|
|
+const vesselTablePage = ref({current: 1, size: 20, total: 0})
|
|
|
|
+const vesselTablePageChange = ({current, size}) => {
|
|
|
|
+ vesselTablePage.value.current = current
|
|
|
|
+ vesselTablePage.value.size = size
|
|
|
|
+ getVesselTableData()
|
|
|
|
+}
|
|
//获取表格数据
|
|
//获取表格数据
|
|
const vesselTableLoading = ref(false)
|
|
const vesselTableLoading = ref(false)
|
|
-const getVesselTableData = () => {
|
|
|
|
-
|
|
|
|
|
|
+const getVesselTableData = async () => {
|
|
|
|
+ const {id, fieldList} = menuItem.value
|
|
|
|
+ const fieldLists = getArrValue(fieldList)
|
|
|
|
+ if (fieldLists.length > 0) {
|
|
|
|
+ vesselTableLoading.value = true
|
|
|
|
+ const { error, code, data } = await dataApi1.queryPage({
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ containerId: menuKey.value,
|
|
|
|
+ fieldKey:fieldList[0].fieldKey,
|
|
|
|
+ size:vesselTablePage.value.size,
|
|
|
|
+ current:vesselTablePage.value.current,
|
|
|
|
+ })
|
|
|
|
+ //处理数据
|
|
|
|
+ vesselTableLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ vesselTableData.value = getArrValue(data['records'])
|
|
|
|
+ vesselTablePage.value.total = data.total || 0
|
|
|
|
+ } else {
|
|
|
|
+ vesselTableData.value = []
|
|
|
|
+ vesselTablePage.value.total = 0
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
//多选
|
|
//多选
|
|
const vesselTableKeys = ref([]);
|
|
const vesselTableKeys = ref([]);
|
|
const vesselTableSelection = (rows) => {
|
|
const vesselTableSelection = (rows) => {
|
|
@@ -572,7 +673,24 @@ const vesselTableSelection = (rows) => {
|
|
|
|
|
|
//确认引用
|
|
//确认引用
|
|
const vesselModalSave = () => {
|
|
const vesselModalSave = () => {
|
|
- vesselModal.value = false
|
|
|
|
|
|
+ if (vesselTableKeys.value.length>0) {
|
|
|
|
+ const item = tableFormItemNode.value
|
|
|
|
+ const form = formData.value[item.index]
|
|
|
|
+ const val =[]
|
|
|
|
+ vesselTableKeys.value.forEach((item)=>{
|
|
|
|
+ val.push(item.key_1)
|
|
|
|
+ })
|
|
|
|
+ const newval=val.join('、')
|
|
|
|
+ formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], newval)
|
|
|
|
+ vesselModal.value = false
|
|
|
|
+ let posVal = item.startPos + newval.length;
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ setPosRange(item.KeyName, posVal)
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ window?.$message?.warning('请先选择引用容器参数')
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
//关闭
|
|
//关闭
|
|
const vesselModalClose = () => {
|
|
const vesselModalClose = () => {
|
|
@@ -581,22 +699,70 @@ const vesselModalClose = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+const equipmentmenus = ref([]);
|
|
|
|
+const getequipmentMenusData = async () => {
|
|
|
|
+ const { data } = await getClassList({
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value
|
|
|
|
+ })
|
|
|
|
+ const arr = getArrValue(data)
|
|
|
|
+ equipmentmenus.value = arr
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
+ const item = arr[0]
|
|
|
|
+ equipmentmenuItem.value = item
|
|
|
|
+ equipmentmenuKey.value = item?.id
|
|
|
|
+ getDeviceTableData()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//菜单被点击
|
|
|
|
+const equipmentmenuKey = ref()
|
|
|
|
+const equipmentmenuItem = ref({})
|
|
|
|
+const equipmentmenuChange = (item) => {
|
|
|
|
+ equipmentmenuItem.value = item
|
|
|
|
+ equipmentmenuKey.value = item?.id
|
|
|
|
+ getDeviceTableData()
|
|
|
|
+}
|
|
|
|
+
|
|
//引用设备仪器
|
|
//引用设备仪器
|
|
const deviceModal = ref(false)
|
|
const deviceModal = ref(false)
|
|
const deviceTableRef = ref(null)
|
|
const deviceTableRef = ref(null)
|
|
|
|
|
|
//表格数据
|
|
//表格数据
|
|
const deviceTableColumn = ref([
|
|
const deviceTableColumn = ref([
|
|
- {key:'key1', name: '设备编号'},
|
|
|
|
- {key:'key2', name: '设备仪器名称'},
|
|
|
|
|
|
+ {key:'deviceNumber', name: '设备编号'},
|
|
|
|
+ {key:'deviceName', name: '设备仪器名称'},
|
|
])
|
|
])
|
|
const deviceTableData = ref([])
|
|
const deviceTableData = ref([])
|
|
-
|
|
|
|
|
|
+const equipmentPage = ref({current: 1, size: 20, total: 0})
|
|
|
|
+const equipmentTablePageChange = ({current, size}) => {
|
|
|
|
+ equipmentPage.value.current = current
|
|
|
|
+ equipmentPage.value.size = size
|
|
|
|
+ getDeviceTableData()
|
|
|
|
+}
|
|
//获取表格数据
|
|
//获取表格数据
|
|
const deviceTableLoading = ref(false)
|
|
const deviceTableLoading = ref(false)
|
|
-const getDeviceTableData = () => {
|
|
|
|
|
|
+const getDeviceTableData =async () => {
|
|
|
|
+ deviceTableLoading.value = true
|
|
|
|
+ const { error, code, data } = await dataApi2.queryPage({
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ deviceClassId: equipmentmenuKey.value,
|
|
|
|
+ size:equipmentPage.value.size,
|
|
|
|
+ current:equipmentPage.value.current,
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ //处理数据
|
|
|
|
+ deviceTableLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ deviceTableData.value = getArrValue(data['records'])
|
|
|
|
+ vesselTablePage.value.total = data.total || 0
|
|
|
|
+ } else {
|
|
|
|
+ deviceTableData.value = []
|
|
|
|
+ equipmentPage.value.total = 0
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
//多选
|
|
//多选
|
|
const deviceTableKeys = ref([]);
|
|
const deviceTableKeys = ref([]);
|
|
@@ -606,7 +772,30 @@ const deviceTableSelection = (rows) => {
|
|
|
|
|
|
//确认引用
|
|
//确认引用
|
|
const deviceModalSave = () => {
|
|
const deviceModalSave = () => {
|
|
- deviceModal.value = false
|
|
|
|
|
|
+ if (deviceTableKeys.value.length>0) {
|
|
|
|
+ const item = tableFormItemNode.value
|
|
|
|
+ const form = formData.value[item.index]
|
|
|
|
+ const val =[]
|
|
|
|
+ const idarr=[]
|
|
|
|
+ deviceTableKeys.value.forEach((item)=>{
|
|
|
|
+ val.push(item.deviceNumber)
|
|
|
|
+ idarr.push(item.id)
|
|
|
|
+ })
|
|
|
|
+ const newval=val.join('_');
|
|
|
|
+ const idval=idarr.join(',')
|
|
|
|
+ formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], newval)
|
|
|
|
+ vesselModal.value = false
|
|
|
|
+ let posVal = item.startPos + newval.length;
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ setPosRange(item.KeyName, posVal)
|
|
|
|
+ })
|
|
|
|
+ deviceModal.value = false;
|
|
|
|
+ emit('updeviceUseIds', idval)
|
|
|
|
+ }else{
|
|
|
|
+ window?.$message?.warning('请先选择引用容器设备')
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
//关闭
|
|
//关闭
|
|
const deviceModalClose = () => {
|
|
const deviceModalClose = () => {
|
|
@@ -684,7 +873,7 @@ const specialNodeClick = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
//事件
|
|
//事件
|
|
-const emit = defineEmits(['renew','offsetTop'])
|
|
|
|
|
|
+const emit = defineEmits(['renew','offsetTop','updeviceUseIds'])
|
|
|
|
|
|
//被点击
|
|
//被点击
|
|
const getOffsetTop = (key = '') => {
|
|
const getOffsetTop = (key = '') => {
|
|
@@ -732,6 +921,7 @@ defineExpose({
|
|
getActiveKey,
|
|
getActiveKey,
|
|
setActiveKey
|
|
setActiveKey
|
|
})
|
|
})
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -891,4 +1081,36 @@ defineExpose({
|
|
.el-form-item.special-form-item .el-form-item__content .el-input .el-input__wrapper .el-input__inner {
|
|
.el-form-item.special-form-item .el-form-item__content .el-input .el-input__wrapper .el-input__inner {
|
|
font-family: "EUDC", 宋体, v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
font-family: "EUDC", 宋体, v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
}
|
|
|
|
+//引用容器参数弹窗
|
|
|
|
+
|
|
|
|
+//关联试验数据
|
|
|
|
+.adding-form-dialog-box {
|
|
|
|
+ position: relative;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ .dialog-tree-box {
|
|
|
|
+ position: relative;
|
|
|
|
+ border-right: 1px solid #EEEEEE;
|
|
|
|
+ width: 500px;
|
|
|
|
+ height: 100%
|
|
|
|
+ }
|
|
|
|
+ .dialog-table-box {
|
|
|
|
+ position: relative;
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: 100%;
|
|
|
|
+ padding: 18px;
|
|
|
|
+ .dialog-search {
|
|
|
|
+ position: relative;
|
|
|
|
+ display: flex;
|
|
|
|
+ }
|
|
|
|
+ .dialog-table {
|
|
|
|
+ position: relative;
|
|
|
|
+ height: calc(100% - 68px);
|
|
|
|
+ padding: 18px 0;
|
|
|
|
+ }
|
|
|
|
+ .dialog-pages {
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|