Browse Source

分类选择改动

jwyu 10 months ago
parent
commit
ba1c386e5e
1 changed files with 14 additions and 4 deletions
  1. 14 4
      src/views/etaChart/components/MoveClassify.vue

+ 14 - 4
src/views/etaChart/components/MoveClassify.vue

@@ -7,8 +7,10 @@ import { SearchIcon } from 'tdesign-icons-vue-next';
 const show = defineModel('show', { type: Boolean, default: false })
 const emits=defineEmits(['success'])
 
+const checkStrictly=ref(true)//图表分类选择是否父子级关联
+
 const filterState = reactive({
-  classify: '',
+  classify: [],
   user: '',
   searchVal: '',
   checkAll: false,
@@ -78,8 +80,9 @@ const tableColumns = [
 ]
 const tableData = ref([])
 async function getChartList() {
+  const cArr=Array.from(new Set(filterState.classify.flat())).join(',')
   const res = await apiETAChart.chartListFilter({
-    ChartClassifyIds: filterState.classify ? filterState.classify.join(',') : '',
+    ChartClassifyIds: cArr|| '',
     PageSize: pagination.value.defaultPageSize,
     CurrentIndex: pagination.value.current,
     SysUserIds: filterState.user ? filterState.user.join(',') : '',
@@ -148,9 +151,10 @@ function handleConfirmClassify() {
     MessagePlugin.warning('请选择要移动至的分类')
     return
   }
+  const cArr=Array.from(new Set(filterState.classify.flat())).join(',')
   const params={
     SelectAll: filterState.checkAll,
-    ChartClassifyIds: filterState.classify ? filterState.classify.join(',') : '', //多个分类id用英文逗号拼接
+    ChartClassifyIds: cArr|| '', //多个分类id用英文逗号拼接
     SysUserIds: filterState.user ? filterState.user.join(',') : '',
     ChartName: filterState.searchVal, //图表名称
     ChartInfoIds: selectedRowKeys.value.join(','), //选中的图表ID
@@ -182,7 +186,7 @@ function handleConfirmClassify() {
     header="编辑图表分类"
     draggable
     attach="body"
-    width="800px"
+    width="850px"
     :confirm-on-enter="true"
     :on-confirm="handleConfirmClassify"
     class="batch-move-classify-wrap"
@@ -199,9 +203,15 @@ function handleConfirmClassify() {
           multiple
           :min-collapsed-num="1"
           clearable
+          :checkStrictly="!checkStrictly"
           :showAllLevels="false"
+          :valueType="checkStrictly?'full':'single'"
           placeholder="图表分类"
         />
+        <div style="flex-shrink: 0;">
+          <span>关联子分类</span>
+          <t-switch v-model="checkStrictly"/>
+        </div>
         <!-- @change="handleRefreshList" -->
         <t-cascader
           v-model="filterState.user"