liyangzheng 1 year ago
parent
commit
6ac0d4316e
2 changed files with 86 additions and 11 deletions
  1. 19 5
      src/pages/mission/components/HistoryMis.vue
  2. 67 6
      src/pages/system/modalComp/CopyLoad.vue

+ 19 - 5
src/pages/mission/components/HistoryMis.vue

@@ -30,6 +30,12 @@
                     </template>
                 </el-table-column>
                 <el-table-column prop="ct" label="创建时间" width="200" />
+                <el-table-column prop="start_time" label="开始检测时间" sortable width="200">
+                    <template #default="scoped">
+                        <span>{{ scoped.row.start_time == '1970-01-01 00:00:00' ? '暂无检测时间' : scoped.row.start_time
+                            }}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column prop="scd_name" label="SCD名称" width="auto" />
                 <el-table-column prop="station_name" label="变电站" width="120" />
                 <el-table-column prop="username" label="创建人" width="120" />
@@ -38,14 +44,22 @@
                     <template #default="scoped">
                         <!-- <el-popconfirm title="你确定删除吗?" @confirm="sureDelMis">
                             <template #reference> -->
-                        <el-button v-if="scoped.row.state=='2'||scoped.row.state=='3'" link type="primary" size="small" @click="relady(scoped.row)">重新检测</el-button>
-                        <el-button v-if="scoped.row.state!='1'" link type="danger" size="small" @click="delMis(scoped.row)">删除</el-button>
+                        <el-button v-if="scoped.row.state == '2' || scoped.row.state == '3'" link type="primary" size="small"
+                            @click="relady(scoped.row)">重新检测</el-button>
+                        <el-button v-if="scoped.row.state != '1'" link type="danger" size="small"
+                            @click="delMis(scoped.row)">删除</el-button>
+                        <!-- <el-button v-if="scoped.row.state == '2'" link type="primary" size="small"
+                            @click="relady(scoped.row)">重新检测</el-button>
+                        <el-button v-if="scoped.row.state != '1'" link type="danger" size="small"
+                            @click="delMis(scoped.row)">删除</el-button> -->
                         <!-- </template>
-                        </el-popconfirm> -->
+    </el-popconfirm> -->
                     </template>
                 </el-table-column>
             </el-table>
-            <PageNation :totals="totals" :pageNum="pageNum" :pageSize="pageSize" @pageBack="pageBack" @currentBack="currentBack"></PageNation>
+            <PageNation :totals="totals" :pageNum="pageNum" :pageSize="pageSize" @pageBack="pageBack"
+                @currentBack="currentBack">
+            </PageNation>
         </div>
         <DelHistory v-if="delModal" :delModal="delModal" :delId="delId" :reload="reload" @delBack="delBack">
         </DelHistory>
@@ -157,7 +171,7 @@ export default {
         function delBack(data) {
             delModal.value = data
         }
-        function currentBack(data){
+        function currentBack(data) {
             pageNum.value = data
         }
         onMounted(() => {

+ 67 - 6
src/pages/system/modalComp/CopyLoad.vue

@@ -6,6 +6,20 @@
                     <el-form-item label="名称" prop="name">
                         <el-input v-model="copyForm.name" />
                     </el-form-item>
+                    <el-form-item label="电压等级" prop="flashLevel">
+                        <el-select @change="flashChange" v-model="copyForm.flashLevel" placeholder="不选择默认当前电压等级"
+                            size="mini" style="width: 240px">
+                            <el-option v-for="item in flashList" :key="item.value" :label="item.label"
+                                :value="item.value" />
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="接线方式" prop="flashLevel">
+                        <el-select @change="lineChange" v-model="copyForm.lineType" placeholder="不选择默认当前接线方式"
+                            size="mini" style="width: 240px">
+                            <el-option v-for="item in lineList" :key="item.value" :label="item.label"
+                                :value="item.value" />
+                        </el-select>
+                    </el-form-item>
                 </el-form>
             </div>
             <template #footer>
@@ -23,6 +37,8 @@
 <script>
 import { ref, watch, onMounted, onBeforeUnmount, reactive } from 'vue'
 import flow from '@/api/flow/flow';
+import litLine from '@/api/litLine';
+import systemRow from '@/api/systemRow';
 import { ElLoading, ElMessage } from 'element-plus';
 export default {
     props: {
@@ -38,41 +54,74 @@ export default {
     setup(props, { emit }) {
         let dialogVisible = ref(false)//模态框打开或关闭
         let copyForm = ref({
-            name: ""
+            name: "",
+            flashLevel: "",
+            lineType: "",
         })//表单内容项
         let copyRules = reactive({
             name: [{ required: true, message: '请输入名称', trigger: 'blur' },]
         })//表单验证
         let copyRef = ref(null)//表单ref
-        let receive = ref({})//接收insidemodule传过来的模型数据
+        let receive = ref({})//接收insidemodule传过来的模型数据l
+        let flashList = ref([])//电压等级列表
+        let lineList = ref([])//接线方式列表
         // 初始化本组件函数
         function reload() {
-            dialogVisible.value = props.copyType
-            receive.value = props.coolObj
+            dialogVisible.value = props.copyType//变为true打开模态框
+            receive.value = props.coolObj//接受的接线方式信息,为对象
+            // 获取所有接线方式
+            litLine.getAllLine({ pageno: 1, pagesize: 999999 }).then(res => {
+                if (res.data) {
+                    lineList.value = res.data.map(item => {
+                        return {
+                            label: item.name,
+                            value: item.id
+                        }
+                    })
+                }
+            })
+            // 获取所有电压等级
+            systemRow.getChildren({ code: "voltage_level" }).then(res => {
+                if (res.data) {
+                    flashList.value = res.data.map(item => {
+                        return {
+                            label: item.name,
+                            value: item.id
+                        }
+                    })
+                }
+            })
         }
         // 模态框关闭
         function modalClose() {
             dialogVisible.value = false
             emit("copyBack", dialogVisible.value)
-        }//模态框确认
+        }
+        //模态框确认
         function modalSure() {
             copyRef.value.validate((val) => {
                 if (val) {
+                    // 打开加载动画
                     const loading = ElLoading.service({
                         lock: true,
                         text: '复制中',
                         background: 'rgba(0, 0, 0, 0.7)',
                     })
+                    // 调用后台接口
                     flow.copyNowMap({
                         id: receive.value.id - 0,
-                        newname: copyForm.value.name
+                        newname: copyForm.value.name,
+                        vol_id: copyForm.value.flashLevel - 0,
+                        link_style_id: copyForm.value.lineType - 0,
                     }).then(res => {
                         if (res.code == 0) {
                             ElMessage({
                                 message: "复制成功!",
                                 type: "success"
                             })
+                            // 关闭加载动画
                             loading.close()
+                            // 关闭模态框
                             dialogVisible.value = false
                             emit("copyBack", dialogVisible.value)
                         } else {
@@ -90,6 +139,14 @@ export default {
                 }
             })
         }
+        // 电压等级的选择器change方法
+        function flashChange(e) {
+            copyForm.value.flashLevel = e
+        }
+        // 接线方式的选择器的change方法
+        function lineChange(e) {
+            copyForm.value.lineType = e
+        }
         // 生命周期函数
         onMounted(() => {
             reload()//初始化
@@ -104,6 +161,10 @@ export default {
             copyRef,//表单ref
             copyRules,//表单验证项
             receive,//接收穿过来的模型数据
+            flashList,//电压等级列表
+            lineList,//接线方式列表
+            flashChange,// 电压等级的选择器change方法
+            lineChange,// 接线方式的选择器的change方法
         }
     }
 }