浏览代码

2023-7-19

codeMan 1 年之前
父节点
当前提交
a24305586a

+ 2 - 0
src/components/listTemplate/index.vue

@@ -91,6 +91,7 @@
   let { selectedColumns } = storeToRefs(colStore)
   let { historyRoutes } = storeToRefs(routeTabs)
   const router = useRouter()
+  const emit = defineEmits(['emitRes'])
   const props = defineProps({
     param: Object,
     tableName:String,
@@ -130,6 +131,7 @@
   const tableData = async ()=>{
     loading.value = true
     const res = await Api.requested(props.param)
+    emit('emitRes',res)
     dataSource.value = res.data
     total.value = res.total
     sort.value = res.sort

+ 1 - 1
src/system/IOT/firmwareMag/modules/Add.vue

@@ -30,7 +30,7 @@
               rowKey="w_productid" 
               :param="productParam" 
               :filterMultiple="true" 
-              :columns="utils.TBLayout('productListTable')" title="选择所属产品"
+              :columns="utils.TBLayout('productListTable').splice(0,utils.TBLayout('productListTable').length - 1)" title="选择所属产品"
             >
               <template v-slot:slot1>
                 <a-input-search

+ 1 - 1
src/system/IOT/firmwareMag/modules/Edit.vue

@@ -30,7 +30,7 @@
               rowKey="w_productid" 
               :param="productParam" 
               :filterMultiple="true" 
-              :columns="utils.TBLayout('productListTable')" title="选择所属产品"
+              :columns="utils.TBLayout('productListTable').splice(0,utils.TBLayout('productListTable').length - 1)" title="选择所属产品"
             >
               <template v-slot:slot1>
                 <a-input-search

+ 14 - 1
src/system/moduleNormal/areaManage/index.vue

@@ -1,11 +1,22 @@
 <template>
-  <listTemp ref="list" :param="param" :tableName="'areaTable'" :searchType="searchType" @listData="listData">
+  <listTemp ref="list" :param="param" :tableName="'areaTable'" :searchType="searchType" @emitRes="listData">
     <template #operation>
       <Add @onSuccess="$refs.list.tableData()"></Add>
     </template>
     <template #tb_cell="{data}">
       <template v-if="data.column.dataIndex === 'operation'">
         <Edit :data="data.record" @onSuccess="$refs.list.tableData()"></Edit>
+        <customBtn
+          :btnName="data.record.isused ? '停用' : '启用'"
+          idName="20230608152702"
+          keyName="w_areaid"
+          :id="data.record.w_areaid"
+          type="link"
+          size="middle"
+          :paramData="[{key:'isused',value:data.record.isused ? 0 : 1}]"
+          :message="data.record.isused ? '确定停用当前区域吗?' : '确定启用当起区域吗?'"
+          @onSuccess="$refs.list.tableData"
+        />
       </template>
       <template v-if="data.column.dataIndex === 'isused'">
         <span :style="{color:utils.statusAndColor(data.record.isused ? '启用' : '停用')}">{{ data.record.isused ? '启用' : '停用' }}</span>
@@ -16,6 +27,7 @@
 </template>
 
 <script setup>
+import customBtn from '@/components/customHandleBtn/index.vue'
 import listTemp from '@/components/listTemplate/index.vue'
 import Add from './modules/Add.vue'
 import Edit from './modules/Edit.vue'
@@ -47,6 +59,7 @@ let createDeep = (array) => {
       sequence:node['sequence'],
       siteid:node['siteid'],
       w_areaid:node['w_areaid'],
+      key:node['w_areaid'],
       children:[]
     }
     if (node.sub && node.sub.length > 0) {

+ 1 - 1
src/system/moduleNormal/depManage/modules/addMainDep.vue

@@ -81,6 +81,7 @@ const showDrawer = ()=>{
 }
 const onClose = () => {
   visible.value = false;
+  depData()
   formRef.value.resetFields();
 };
 const formRef = ref()
@@ -112,7 +113,6 @@ const submit = async ()=>{
   }
 }
 onMounted(()=>{
-  depData()
 })
 defineExpose({
   /*visible*/

+ 2 - 1
src/system/moduleNormal/productCategory/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <listTemp ref="list" :param="param" :tableName="'categoryTable'" :searchType="searchType" @listData="listData">
+  <listTemp ref="list" :param="param" :tableName="'categoryTable'" :searchType="searchType" @emitRes="listData">
     <template #operation>
       <Add @onSuccess="$refs.list.tableData()"></Add>
     </template>
@@ -58,6 +58,7 @@ let createDeep = (array) => {
       remarks:node['remarks'],
       sequence:node['sequence'],
       w_prodclassid:node['w_prodclassid'],
+      key:node['w_prodclassid'],
       parentname:node['parentname'],
       children:[]
     }