From 7379f2bcf71fe80d021eb7f2118991525e41ea7e Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期四, 26 十二月 2024 17:58:30 +0800
Subject: [PATCH] 新建项目中展示赋码和标签

---
 src/views/projectEngineering/projectLibrary/component/BasicInfo.vue |   39 ++++++++++++
 src/views/projectEngineering/projectLibrary/component/TagList.vue   |   81 +++++++++++++++++++++++++++
 src/views/projectEngineering/projectLibrary/projectDetails.vue      |    7 +-
 src/views/projectManage/progress/index.vue                          |    5 +
 4 files changed, 128 insertions(+), 4 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
index b08c10f..4c29669 100644
--- a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
@@ -14,7 +14,18 @@
           </el-form-item>
         </el-col>
         <el-col :span="12" style="position: relative">
-          <div style="width: 150px; position: absolute;"><img alt="" src="../../../../assets/images/s.png"/></div>
+          <div style="width: 100%; height: 100%; position: absolute;">
+            <el-form-item class="item" label="璧嬬爜" label-width="50px" prop="coding">
+              <template slot-scope="scope">
+                <!--                <div class="yellow-dot" v-if="scope.row.coding === 'yellow'"></div>-->
+                <!--                <div class="green-dot" v-if="scope.row.coding === 'green'"></div>-->
+                <!--                <div class="red-dot" v-if="scope.row.coding === 'red'"></div>-->
+                <div class="red-dot"></div>
+                <tag-list></tag-list>
+              </template>
+            </el-form-item>
+            <!--            <img alt="" src="../../../../assets/images/s.png"/>-->
+          </div>
         </el-col>
       </el-row>
       <el-row :gutter="20">
@@ -294,6 +305,7 @@
 <script>
 // import Upload from '@element-plus/icons-vue/dist/Upload.vue';
 import Map from '@/views/components/Map/index.vue';
+import TagList from "./TagList.vue";
 // import MapMouseEvent  from '@/views/components/Map/types';
 // import UploadStandard from '@/components/uploadStandard.vue';
 // import { usePlanLibrary } from '@/hooks/detailsInformation';
@@ -309,6 +321,7 @@
     , 'sys_administrative_divisions', 'sys_centralized_management', 'sys_approval_type', 'sys_key_categories', 'sys_annual_plan'],
   components: {
     Map,
+    TagList,
     // UploadStandard,
     // RemoteSelect
   },
@@ -574,4 +587,28 @@
     width: 20px;
   }
 }
+
+.yellow-dot {
+  width: 10px; /* 鍦嗙偣鐨勫搴� */
+  height: 10px; /* 鍦嗙偣鐨勯珮搴� */
+  background-color: yellow; /* 鍦嗙偣鐨勯鑹� */
+  border-radius: 50%; /* 浣垮厓绱犲彉鎴愬渾褰� */
+  display: inline-block; /* 纭繚鍏冪礌鍙互鍜屽叾浠栧唴鑱斿厓绱犱竴璧锋樉绀� */
+}
+
+.red-dot {
+  width: 10px; /* 鍦嗙偣鐨勫搴� */
+  height: 10px; /* 鍦嗙偣鐨勯珮搴� */
+  background-color: red; /* 鍦嗙偣鐨勯鑹� */
+  border-radius: 50%; /* 浣垮厓绱犲彉鎴愬渾褰� */
+  display: inline-block; /* 纭繚鍏冪礌鍙互鍜屽叾浠栧唴鑱斿厓绱犱竴璧锋樉绀� */
+}
+
+.green-dot {
+  width: 10px; /* 鍦嗙偣鐨勫搴� */
+  height: 10px; /* 鍦嗙偣鐨勯珮搴� */
+  background-color: green; /* 鍦嗙偣鐨勯鑹� */
+  border-radius: 50%; /* 浣垮厓绱犲彉鎴愬渾褰� */
+  display: inline-block; /* 纭繚鍏冪礌鍙互鍜屽叾浠栧唴鑱斿厓绱犱竴璧锋樉绀� */
+}
 </style>
diff --git a/src/views/projectEngineering/projectLibrary/component/TagList.vue b/src/views/projectEngineering/projectLibrary/component/TagList.vue
new file mode 100644
index 0000000..04ca707
--- /dev/null
+++ b/src/views/projectEngineering/projectLibrary/component/TagList.vue
@@ -0,0 +1,81 @@
+<template>
+  <div>
+    <el-button v-if="!inputVisible" class="button-new-tag" size="small" @click="showInput">+ 鏍囩</el-button>
+    <el-input
+      v-else
+      class="input-new-tag"
+      v-model="inputValue"
+      ref="saveTagInput"
+      size="small"
+      @keyup.enter.native="handleInputConfirm"
+      @blur="handleInputConfirm"
+    >
+    </el-input>
+    <div class="tags-container">
+      <el-tag
+        v-for="tag in dynamicTags"
+        :key="tag"
+        closable
+        :disable-transitions="false"
+        @close="handleClose(tag)">
+        {{tag}}
+      </el-tag>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      dynamicTags: ['閲嶇偣鏍囪', '鍙戞敼鍏虫敞', '骞村害椤圭洰'],
+      inputVisible: false,
+      inputValue: ''
+    };
+  },
+  methods: {
+    handleClose(tag) {
+      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
+    },
+
+    showInput() {
+      this.inputVisible = true;
+      this.$nextTick(_ => {
+        this.$refs.saveTagInput.$refs.input.focus();
+      });
+    },
+
+    handleInputConfirm() {
+      let inputValue = this.inputValue;
+      if (inputValue) {
+        this.dynamicTags.push(inputValue);
+      }
+      this.inputVisible = false;
+      this.inputValue = '';
+    }
+  }
+}
+</script>
+
+<style>
+.el-tag + .el-tag {
+  margin-left: 10px;
+
+}
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+  vertical-align: bottom;
+}
+
+.tags-container {
+  margin-top: 10px; /* 鏍规嵁闇�瑕佽皟鏁撮棿璺� */
+}
+</style>
diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue
index 1dc8685..6204cbf 100644
--- a/src/views/projectEngineering/projectLibrary/projectDetails.vue
+++ b/src/views/projectEngineering/projectLibrary/projectDetails.vue
@@ -34,12 +34,12 @@
         v-if="componentName.name == 'BasicInfo'"
         class="save-button"
         type="primary"
-        @click="submit(0)"
+        @click="saveProject(0)"
         >鑽夌</el-button
       >
 <!--      <el-button class="save-button" type="primary" @click="submit(1)"-->
 <!--        >淇濆瓨</el-button>-->
-      <el-button class="save-button" type="primary" @click="saveProject"
+      <el-button class="save-button" type="primary" @click="saveProject(1)"
       >淇濆瓨</el-button>
       <el-button class="reset-button" @click="reset">閲嶇疆</el-button>
       <!-- <el-button v-else class="cancel-button" @click="cancel">鍙栨秷</el-button> -->
@@ -144,7 +144,8 @@
     reset() {
       this.$refs.childRef.reset();
     },
-    saveProject() {
+    saveProject(num) {
+      this.projectForm.projectInfoForm.usedStatus = num;
       editProject(this.projectForm).then((res) => {
         this.$message.success("淇濆瓨鎴愬姛");
       })
diff --git a/src/views/projectManage/progress/index.vue b/src/views/projectManage/progress/index.vue
index b077bc5..6d4e54a 100644
--- a/src/views/projectManage/progress/index.vue
+++ b/src/views/projectManage/progress/index.vue
@@ -109,6 +109,11 @@
           }}
         </template>
       </el-table-column>
+      <el-table-column label="寮傚父闂" align="center" prop="exception" >
+        <template slot-scope="scope">
+          {{ scope.row.exception === 0 ? '璁″垝瓒呮湡' : scope.row.exception === 1 ? '杩涘害瓒呮湡' : '' }}
+        </template>
+      </el-table-column>
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button

--
Gitblit v1.8.0