From efca22312b1c01a5251e63ea5acf766a31ddc768 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cyiyousong=E2=80=9D?= <鈥測ousong_yi@foxmail.com鈥�>
Date: Thu, 13 Apr 2023 10:39:25 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E5=8A=9E=E4=BA=8B?=
 =?UTF-8?q?=E6=8C=87=E5=8D=97=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86=E6=9D=BF?=
 =?UTF-8?q?=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../admin/src/assets/css/common.css           |   2 +-
 .../src/pages/basicset/business/business.vue  |  32 +-
 .../business/components/businessTabs1.vue     |  18 +-
 .../business/components/businessTabs2.vue     |   9 +
 .../business/components/businessTabs3.vue     |   9 +
 .../business/components/businessTabs4.vue     | 295 ++++++++++++++++++
 base-manager-ui/admin/src/router/config.js    |  13 +
 7 files changed, 347 insertions(+), 31 deletions(-)
 create mode 100644 base-manager-ui/admin/src/pages/basicset/business/components/businessTabs4.vue

diff --git a/base-manager-ui/admin/src/assets/css/common.css b/base-manager-ui/admin/src/assets/css/common.css
index f9b3dcb0..e7af4ed5 100644
--- a/base-manager-ui/admin/src/assets/css/common.css
+++ b/base-manager-ui/admin/src/assets/css/common.css
@@ -9,7 +9,7 @@
     color:#1BBC9B;
 }
 .edit{
-    color:#03d76f;
+    color:#03d76f !important;
 }
 .clofff{
     color:#fff;
diff --git a/base-manager-ui/admin/src/pages/basicset/business/business.vue b/base-manager-ui/admin/src/pages/basicset/business/business.vue
index 5ea4707d..9cab7660 100644
--- a/base-manager-ui/admin/src/pages/basicset/business/business.vue
+++ b/base-manager-ui/admin/src/pages/basicset/business/business.vue
@@ -1,16 +1,13 @@
 <template>
   <div class="business flex flexc">
     <a-tabs :activeKey="active" @change="changeRouter">
-      <a-tab-pane key="/business/businessmanage" tab="涓氬姟绠$悊">
-        <!-- <BusinessTabs2 v-if="active === 1" ref="BusinessTabs2" /> -->
-      </a-tab-pane>
+      <a-tab-pane key="/business/businessmanage" tab="涓氬姟绠$悊"> </a-tab-pane>
 
-      <a-tab-pane key="/business/mattermanage" tab="浜嬮」绠$悊">
-        <!-- <BusinessTabs1 v-if="active === 2" ref="BusinessTabs1" /> -->
-      </a-tab-pane>
+      <a-tab-pane key="/business/mattermanage" tab="浜嬮」绠$悊"> </a-tab-pane>
 
       <a-tab-pane key="/business/businessinmanage" tab="涓氬姟浜嬮」鍏宠仈">
-        <!-- <BusinessTabs3 v-if="active === 3" ref="BusinessTabs3" /> -->
+      </a-tab-pane>
+      <a-tab-pane key="/business/workguide" tab="鍔炰簨鎸囧崡鏁版嵁绠$悊">
       </a-tab-pane>
     </a-tabs>
     <div class="business-out-box flex1">
@@ -20,21 +17,12 @@
 </template>
 
 <script>
-// import BusinessTabs1 from "./components/businessTabs1.vue";
-// import BusinessTabs2 from "./components/businessTabs2.vue";
-// import BusinessTabs3 from "./components/businessTabs3.vue";
-
 export default {
-  components: {
-    // BusinessTabs1,
-    // BusinessTabs2,
-    // BusinessTabs3,
-  },
+  components: {},
 
   data() {
     return {
       siteId: "", // 绔欑偣id
-      // active: 1,
     };
   },
   computed: {
@@ -60,15 +48,7 @@ export default {
   /deep/.ant-tabs-nav-container {
     border-bottom: 1px solid rgb(224, 224, 224) !important;
   }
-  &::after {
-    content: "";
-    width: 1px;
-    height: 82vh;
-    position: absolute;
-    background-color: #eeeeee;
-    top: 44px;
-    left: 50%;
-  }
+
   .business-out-box {
     overflow-y: auto;
   }
diff --git a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs1.vue b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs1.vue
index 15df1dbd..3c5f655e 100644
--- a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs1.vue
+++ b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs1.vue
@@ -354,17 +354,18 @@ export default {
     onSelectLeftRow(record, selected) {
       if (selected && record.children && record.children.length) {
         record.children.forEach((v) => {
-          this.selectedLeftRowKeys= [...new Set([...this.selectedLeftRowKeys,v.id])]
-          this.deleteData=[...new Set([...this.deleteData,v])];
+          this.selectedLeftRowKeys = [
+            ...new Set([...this.selectedLeftRowKeys, v.id]),
+          ];
+          this.deleteData = [...new Set([...this.deleteData, v])];
         });
       } else if (!selected) {
         this.selectedLeftRowKeys = this.selectedLeftRowKeys.filter(
           (v) => v != record.id
         );
         this.deleteData = this.deleteData.filter((v) => {
-          return v.id !=record.id
+          return v.id != record.id;
         });
-      
       }
     },
     // 鎵归噺鍒犻櫎
@@ -525,6 +526,15 @@ export default {
   width: 100%;
   height: 100%;
   display: flex;
+  &::after {
+    content: "";
+    width: 1px;
+    height: 82vh;
+    position: absolute;
+    background-color: #eeeeee;
+    top: 44px;
+    left: 50%;
+  }
   .left,
   .right {
     width: 50%;
diff --git a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs2.vue b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs2.vue
index 8a3471c7..e03036b5 100644
--- a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs2.vue
+++ b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs2.vue
@@ -586,6 +586,15 @@ export default {
 .basicset-tab2 {
   width: 100%;
   display: flex;
+  &::after {
+    content: "";
+    width: 1px;
+    height: 82vh;
+    position: absolute;
+    background-color: #eeeeee;
+    top: 44px;
+    left: 50%;
+  }
   .left,
   .right {
     width: 50%;
diff --git a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs3.vue b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs3.vue
index bb035b53..cde67aec 100644
--- a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs3.vue
+++ b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs3.vue
@@ -666,6 +666,15 @@ export default {
 .basicset-tab3 {
   width: 100%;
   display: flex;
+  &::after {
+    content: "";
+    width: 1px;
+    height: 82vh;
+    position: absolute;
+    background-color: #eeeeee;
+    top: 44px;
+    left: 50%;
+  }
   .left,
   .right {
     width: 50%;
diff --git a/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs4.vue b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs4.vue
new file mode 100644
index 00000000..4817f602
--- /dev/null
+++ b/base-manager-ui/admin/src/pages/basicset/business/components/businessTabs4.vue
@@ -0,0 +1,295 @@
+rrent" <template>
+  <div class="basicset-tab4">
+    <div class="left">
+      <div class="header">
+        <h3 class="titel">绔欑偣浜嬮」鍒楄〃</h3>
+        <div class="header-bottom flex aic jcb">
+          <div class="left-btn"></div>
+          <div>
+            <a-space>
+              <a-select
+                style="min-width: 120px"
+                allowClear
+                v-model="dept"
+                class="select-department"
+                placeholder="閮ㄩ棬鎼滅储"
+              >
+                <a-select-option
+                  v-for="v in deptList"
+                  :key="v.id"
+                  :value="v.deptNumber"
+                >
+                  {{ v.name }}
+                </a-select-option>
+              </a-select>
+              <a-select
+                style="width: 120px"
+                allowClear
+                v-model="source"
+                class="select-department"
+                placeholder="浜嬮」鏉ユ簮"
+              >
+                <a-select-option :value="0"> 涓€浣撳寲娣诲姞 </a-select-option>
+                <a-select-option :value="1"> 鎵嬪姩娣诲姞 </a-select-option>
+              </a-select>
+              <a-input-search
+                v-model="searchVal"
+                placeholder="璇疯緭鍏ヤ簨椤瑰悕绉版悳绱�"
+                enter-button="鎼滅储"
+                @search="onSearch"
+                allowClear
+              />
+            </a-space>
+          </div>
+        </div>
+      </div>
+      <div class="table-content">
+        <!-- 琛ㄦ牸 -->
+        <a-table
+          bordered
+          size="middle"
+          :loading="loading"
+          :pagination="{
+            showTotal: (total) => `鍏� ${total} 鏉,
+            current: current,
+            total: total,
+            pageSize: size,
+            showSizeChanger: true,
+            showQuickJumper: true,
+            pageSizeOptions: pageSizeOptions,
+            onChange: changePage,
+            onShowSizeChange: showSizeChange,
+          }"
+          :scroll="{ y: 550 }"
+          :columns="columns"
+          :data-source="matterSiteData"
+          :rowKey="(record) => record.id"
+        >
+          <template slot="index" slot-scope="text, record, index">
+            <span>
+              {{ (current - 1) * size + index + 1 }}
+            </span>
+          </template>
+          <!-- 閮ㄩ棬 -->
+          <template slot="deptName" slot-scope="text">
+            {{ text.deptName ? text.deptName : "--" }}
+          </template>
+          <!-- 浜嬮」鍚嶇О -->
+          <template slot="matterName" slot-scope="text">
+            <a-tooltip placement="topLeft">
+              <template slot="title">
+                {{ text.matterName }}
+              </template>
+              <div class="matter-name">{{ text.matterName }}</div>
+            </a-tooltip>
+          </template>
+          <!-- 浜嬮」鏉ユ簮 -->
+          <template slot="source" slot-scope="text">
+            <a-tag v-if="text.source == 0" color="green"> 涓€浣撳寲娣诲姞 </a-tag>
+            <a-tag v-else color="blue"> 鎵嬪姩娣诲姞 </a-tag>
+          </template>
+          <!-- 鎿嶄綔 -->
+          <template slot="action" slot-scope="text">
+            <a-space size="middle">
+              <div
+                class="workguide_btn"
+                :style="{ color: text.hot == 1 ? '#03d76f' : '#1890FF' }"
+                @click="handleSiteEdit(text, 'hot')"
+              >
+                {{ text.hot == 1 ? "鍙栨秷鐑棬" : "璁剧疆鐑棬" }}
+              </div>
+              <div
+                class="workguide_btn"
+                style="width: 60px"
+                @click="handleSiteEdit(text, 'display')"
+              >
+                {{ text.display == 1 ? "鍙栨秷灞曠ず" : "灞曠ず" }}
+              </div>
+            </a-space>
+          </template>
+        </a-table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getSiteMatterList, addSitematter } from "@/services/matter";
+import { getDeptList } from "@/services/dept";
+import local from "@/utils/local";
+const columns = [
+  {
+    title: "搴忓彿",
+    width: "50px",
+    scopedSlots: { customRender: "index" },
+  },
+  {
+    title: "閮ㄩ棬",
+    width: "20%",
+    scopedSlots: {
+      customRender: "deptName",
+    },
+  },
+  {
+    title: "浜嬮」鍚嶇О",
+    // ellipsis: true,
+    align: "left",
+    scopedSlots: {
+      customRender: "matterName",
+    },
+  },
+  {
+    title: "浜嬮」鏉ユ簮",
+    scopedSlots: {
+      customRender: "source",
+    },
+  },
+  {
+    title: "鎿嶄綔",
+    width: "200px",
+    scopedSlots: {
+      customRender: "action",
+    },
+  },
+];
+
+export default {
+  components: {},
+  data() {
+    return {
+      columns,
+      loading: false,
+      source: undefined, // 宸﹁竟鏉ユ簮
+      selectedRowKeys: [],
+      matterSiteData: [], // 绔欑偣浜嬮」
+      matterDataList: [], //浜嬮」鍒楄〃鏁版嵁
+      current: 1,
+      total: 0,
+      size: 10,
+      pageSizeOptions: ["10", "30", "50", "100"],
+      siteId: local.getLocal("siteId"), // 绔欑偣id
+      deptList: [], // 绔欑偣閮ㄩ棬
+      searchVal: "", // 绔欑偣浜嬮」鎼滅储
+      dept: undefined, // 閮ㄩ棬鎼滅储
+    };
+  },
+  created() {
+    this.getDeptListData();
+    this.getMatterSiteData();
+  },
+
+  methods: {
+    // 鑾峰彇閮ㄩ棬鍒楄〃
+    async getDeptListData(obj = {}) {
+      this.deptLoading = true;
+      let res = await getDeptList({
+        siteId: this.siteId,
+        page: 1,
+        size: -1,
+        ...obj,
+      });
+      this.deptLoading = false;
+      let { code, data } = res.data;
+      if (code === 1) {
+        this.deptList = data.data;
+      }
+    },
+    // 鑾峰彇绔欑偣浜嬮」
+    async getMatterSiteData(search = {}) {
+      this.loading = true;
+      let res = await getSiteMatterList({
+        page: this.current,
+        size: this.size,
+        siteId: this.siteId,
+        source: this.source,
+        matterName: `%${this.searchVal}%`,
+        deptCode: this.dept,
+        ...search,
+      });
+      let { pageInfo, data } = res.data.data;
+      this.total = pageInfo.totalResult;
+      this.matterSiteData = data;
+      this.loading = false;
+    },
+
+    // 鎼滅储
+    onSearch() {
+      this.current = 1;
+      this.getMatterSiteData();
+    },
+
+    // 宸︾炕椤�
+    changePage(num) {
+      this.current = num;
+      this.getMatterSiteData();
+    },
+    // 宸﹁竟鏀瑰彉姣忛〉鏄剧ず鏁伴噺
+    showSizeChange(current, size) {
+      this.current = current;
+      this.size = size;
+      this.getMatterSiteData();
+    },
+    // 璁剧疆鐑棬銆佸睍绀�
+    async handleSiteEdit(row, type) {
+      let hot;
+      let display;
+      if (type === "hot") {
+        if (row.hot == 1) {
+          hot = 0;
+        } else {
+          hot = 1;
+        }
+      } else {
+        if (row.display == 1) {
+          display = 0;
+        } else {
+          display = 1;
+        }
+      }
+      let obj = {
+        id: row.id,
+      };
+      if (hot != "undefined") obj.hot = hot;
+      if (display != "undefined") obj.display = display;
+      let res = await addSitematter(obj);
+      if (res.data.code == 1) {
+        this.$message.success("璁剧疆鎴愬姛");
+        this.getMatterSiteData();
+        this.$forceUpdate();
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.business {
+  &::after {
+    content: "";
+    width: 1px;
+    height: 82vh;
+    position: absolute;
+    background-color: red;
+    top: 44px;
+    left: 50%;
+  }
+}
+.basicset-tab4 {
+  width: 100%;
+  height: 100%;
+  padding: 0px 20px;
+  .header {
+    margin-bottom: 15px;
+  }
+  .workguide_btn {
+    cursor: pointer;
+    width: 60px;
+    color: #1890ff;
+  }
+  .matter-name {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+}
+</style>
diff --git a/base-manager-ui/admin/src/router/config.js b/base-manager-ui/admin/src/router/config.js
index 1a5dd03b..b9b8b6d8 100644
--- a/base-manager-ui/admin/src/router/config.js
+++ b/base-manager-ui/admin/src/router/config.js
@@ -76,6 +76,7 @@ const options = {
                       "@/pages/basicset/business/components/businessTabs1"
                     ),
                 },
+                // 浜嬮」绠$悊
                 {
                   path: "mattermanage",
                   meta: {
@@ -86,6 +87,7 @@ const options = {
                       "@/pages/basicset/business/components/businessTabs2"
                     ),
                 },
+                // 涓氬姟浜嬮」鍏宠仈
                 {
                   path: "businessinmanage",
                   meta: {
@@ -96,6 +98,17 @@ const options = {
                       "@/pages/basicset/business/components/businessTabs3"
                     ),
                 },
+                // 鍔炰簨鎸囧崡浜嬮」绠$悊
+                {
+                  path: "workguide",
+                  meta: {
+                    invisible: true,
+                  },
+                  component: () =>
+                    import(
+                      "@/pages/basicset/business/components/businessTabs4"
+                    ),
+                },
               ],
             },
             {
-- 
2.24.3