Browse Source

Merge branch 'cmy/develop-bi' into develop

chenmy 2 years ago
parent
commit
5961e8929d

+ 60 - 19
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -104,13 +104,30 @@
       </el-table>
     </div>
     <div class="adjustmentDialog">
-      <el-dialog v-model="adjustmentbox" title="" width="90%" @close="closeInfo" center class="interfacebbox">
+      <el-dialog v-model="adjustmentbox" title="" width="80%" @close="closeInfo" center class="interfacebbox">
         <el-tabs v-model="activeName">
           <el-tab-pane :label="$t(`areaManages.operational.areaAddSchool.title`)" name="add">
             <div class="haveSchool">
               <div class="schoolLeft" v-loading="loadingSchoolList" element-loading-text="数据加载中..." v-if="PowerShow">
                 <div class="haveSchool-title">
-                  <div>{{ $t(`areaManages.operational.areaAddSchool.schooltitle`) }}</div>
+                  <div class="select-text">{{ $t(`areaManages.operational.areaAddSchool.schooltitle`) }}</div>
+                  <div class="select-click">
+                    <el-dropdown trigger="click" @command="handleCommand">
+                      <span class="el-dropdown-link">
+                        {{dropdownValue}}
+                        <el-icon class="el-icon--right">
+                          <ArrowDown />
+                        </el-icon>
+                      </span>
+                      <template #dropdown>
+                        <el-dropdown-menu>
+                          <el-dropdown-item command="all">显示所有学校</el-dropdown-item>
+                          <el-dropdown-item command="virtual">只看虚拟学校</el-dropdown-item>
+                          <el-dropdown-item command="entity">只看实体学校</el-dropdown-item>
+                        </el-dropdown-menu>
+                      </template>
+                    </el-dropdown>
+                  </div>
                   <div class="search-school">
                     <el-input v-model="schoolSeach" placeholder="输入学校名称搜索" clearable>
                       <!-- <template #prepend>
@@ -601,7 +618,7 @@ import { useRouter } from 'vue-router'
 import Ability from '@/components/Ability.vue'
 import option from '@/static/region.json'
 import loadingsz from '@/components/loading/partial.vue'
-import { CopyDocument, ArrowRight, ArrowLeft, Search, Back } from '@element-plus/icons-vue'
+import { CopyDocument, ArrowRight, ArrowLeft, Search, Back, ArrowDown } from '@element-plus/icons-vue'
 import useClipboard from 'vue-clipboard3'
 import jwt_decode from 'jwt-decode'
 const optionsData = option
@@ -613,7 +630,8 @@ export default {
     ArrowRight,
     ArrowLeft,
     Search,
-    Back
+    Back,
+    ArrowDown
   },
   setup () {
     let { proxy } = getCurrentInstance()
@@ -719,6 +737,7 @@ export default {
     let manaJoinValue = ref('')
     //未加入学区学校搜索
     let schoolSeach = ref('')
+    let dropdownValue = ref('显示所有学校')
     onMounted(() => {
       provinceOptions.value.optionInfo = optionsData
     })
@@ -1042,7 +1061,6 @@ export default {
           ElMessage.error('人员搜索异常')
         })
     }
-
     function addAreaadmin () {
       let data = searchData.value
         ? { tmdId: searchData.value.id, tmdName: searchData.value.name, tmdPic: searchData.value.picture, areaId: currentlySelect.value.id, areaName: currentlySelect.value.name }
@@ -1271,6 +1289,12 @@ export default {
       let newdata = notjoinPrimitive.value.filter((item) => { return item.name.includes(values) })
       notjoinSchool.value = JSON.parse(JSON.stringify(newdata))
     }
+    //学校显示(虚拟、实体)
+    function handleCommand (value) {
+      value === 'all' ? dropdownValue.value = '显示所有学校' : ''
+      value === 'virtual' ? dropdownValue.value = '只看虚拟学校' : ''
+      value === 'entity' ? dropdownValue.value = '只看实体学校' : ''
+    }
     watch(abilityModel, (newdata) => {
       console.log(newdata)
       newdata
@@ -1395,7 +1419,9 @@ export default {
       removeSelect,
       schoolSeach,
       notjoinSchoolarea,
-      notjoinPrimitive
+      notjoinPrimitive,
+      handleCommand,
+      dropdownValue
     }
   },
 }
@@ -1425,7 +1451,7 @@ export default {
 }
 
 .schoolLeft {
-  width: 35%;
+  width: 40%;
   height: 65vh;
   padding: 0.5%;
   border-right: 1px dashed #ccc;
@@ -1446,7 +1472,7 @@ export default {
 }
 
 .details-list-school {
-  padding: 20px 40px 20px 15px;
+  padding: 10px 40px 10px 15px;
   display: flex;
   flex-wrap: wrap;
   line-height: 22px;
@@ -1476,8 +1502,8 @@ export default {
 
 .list-school-name {
   width: 65%;
-  padding-left: 1%;
-  margin-top: 1.5%;
+  /* padding-left: 1%;
+  margin-top: 1.5%; */
 }
 
 .list-school-name div {
@@ -1513,7 +1539,7 @@ export default {
 }
 
 .schoolRight {
-  width: 65%;
+  width: 60%;
   float: left;
 }
 .schoolRight-alternative {
@@ -1768,21 +1794,29 @@ export default {
 .haveSchool-title {
   width: 100%;
   line-height: 40px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  flex-wrap: nowrap;
 }
-.haveSchool-title div {
-  display: inline-block;
-  /* vertical-align: top; */
-  width: 20%;
+.select-text {
+  width: 13%;
+  padding-left: 2%;
+}
+.select-click {
+  width: 25%;
+  line-height: 40px;
 }
 .search-school {
-  width: 50% !important;
-  vertical-align: center;
+  width: 45%;
 }
 .search-school div {
   width: 100%;
 }
 .synchronization-title {
   float: right;
+  top: 30px;
+  right: 0.5%;
   height: 22px;
   line-height: 20px;
   margin: 2px 4px 2px 0;
@@ -1809,7 +1843,7 @@ export default {
 }
 .copyicon {
   position: absolute;
-  top: -8%;
+  top: -7%;
   right: 0%;
   cursor: pointer;
   opacity: 0;
@@ -2297,7 +2331,7 @@ export default {
 }
 
 .details-list-school .el-image {
-  width: 65%;
+  width: 60%;
   margin: 3% 0% 0% 3%;
 }
 
@@ -2458,4 +2492,11 @@ export default {
     width: 95% !important;
   }
 }
+.select-click .el-dropdown {
+  width: 100% !important;
+  line-height: 40px;
+}
+.select-click .el-dropdown .el-dropdown-link {
+  color: #2d8cf0;
+}
 </style>

+ 134 - 10
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -174,7 +174,7 @@
       </el-auto-resizer>
     </div>
     <div class="addschool-dialog">
-      <el-dialog v-model="adddialog" title="学校搜索" width="30%" :close-on-click-modal="false">
+      <el-dialog v-model="adddialog" title="学校搜索" width="50%" :close-on-click-modal="false">
         <div class="addschool-box">
           <div>
             <el-input v-model="addvalue" placeholder="搜索学校简码" class="input-with-select">
@@ -184,17 +184,22 @@
             </el-input>
           </div>
           <div class="school-list">
-            <div class="notsearch-box" v-if="!addschool.id"><img src="@/assets/img/notsearch.png" /></div>
-            <div class="search-result" v-else-if="addschool.id">
+            <!-- <div class="notsearch-box" v-if="!tableData.length =="><img src="@/assets/img/notsearch.png" /></div> -->
+            <div class="search-result">
               <p>搜索结果:</p>
               <div class="result-box">
-                <p><span>学校名称:</span><span class="result-text">{{addschool.name}}</span></p>
+                <!-- <p><span>学校名称:</span><span class="result-text">{{addschool.name}}</span></p>
                 <p><span>学校简码:</span><span class="result-text">{{addschool.id}}</span></p>
                 <p><span>学校地址:</span><span class="result-text">{{addschool.region}}{{addschool.province}}{{addschool.city}}{{addschool.dist}}</span></p>
                 <div class="school-type">
                   <div>学校类型:</div>
                   <div><el-tag v-if="addschool.isvirtual">虚拟学校</el-tag><el-tag v-else-if="!addschool.isvirtual" type="success">实体学校</el-tag></div>
-                </div>
+                </div> -->
+                <el-auto-resizer>
+                  <template #default="{ height, width }">
+                    <el-table-v2 :columns="searchColumns" :data="tableData" :width="width" :height="height" :estimated-row-height="40" :sort-by="sortState" @column-sort="onSort" fixed />
+                  </template>
+                </el-auto-resizer>
               </div>
             </div>
           </div>
@@ -202,10 +207,10 @@
         <template #footer>
           <span class="dialog-footer">
             <el-button @click="adddialog = false">取消</el-button>
-            <el-button type="primary" @click="addschoolfn()" v-if="addschool.id">
+            <el-button type="primary" @click="addschoolfn()" v-if="checkboxArr.length !==0">
               添加
             </el-button>
-            <el-button type="info" v-if="!addschool.id" disabled>
+            <el-button type="info" v-if="checkboxArr.length ===0" disabled>
               添加
             </el-button>
           </span>
@@ -262,8 +267,8 @@
 </template>
 <script setup>
 import option_cn from '@/static/regions/region_cn.json'
-import { ref, getCurrentInstance, watch } from 'vue'
-import { ElMessage, TableV2SortOrder, ElLoading } from 'element-plus'
+import { ref, getCurrentInstance, watch, h } from 'vue'
+import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox } from 'element-plus'
 import { Search, CirclePlus } from '@element-plus/icons-vue'
 import Details from './details.vue'
 let { proxy } = getCurrentInstance()
@@ -351,6 +356,91 @@ let columns = ref([
     )
   },
 ])
+const searchColumns = [
+  {
+    cellRenderer: (data) =>
+      h(
+        ElCheckbox,
+        // { onClick: () => handleDelete(data), type: "danger", icon: "Delete" },
+        { onChange: () => selectChange(data.rowData) },
+        { default: () => "" }
+      ),
+    width: 50,//当前列的宽度,必须设置
+    // fixed: true,//是否固定列
+    align: 'center',
+    headerClass: 'cheboxclass',
+    // cellRenderer: ({ rowData }) => {
+    //   const onChange = (value: CheckboxValueType) => (rowData.checked = value)
+    //   return <SelectionCell value={rowData.checked} onChange={onChange} />
+    // },
+  },
+  {
+    // key: "name",
+    // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
+    title: "校徽",
+    width: 150,
+    fixed: false,
+    align: 'center',
+    headerClass: 'serachclass',
+    cellRenderer: (data) => (
+      <>
+        <el-image style="width: 45px; height: 45px;margin:5px" src={data.rowData.picture} fit="contain" v-show={data.rowData.picture ? true : false}></el-image>
+        <div style=" width: 45px;height: 45px;line-height: 45px;text-align: center;background-color: #bdc3c7;font-size: 10px;color: #ecf0f1;margin:5px;" v-show={!data.rowData.picture ? true : false}>暂无图片</div>
+      </>
+    )
+  },
+  {
+    key: "name",
+    dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
+    title: "名称",
+    width: 200,
+    fixed: false,
+    headerClass: 'serachclass',
+    align: 'center',
+  },
+  {
+    // key: "name",
+    // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
+    title: "规模版本",
+    width: 100,
+    fixed: false,
+    align: 'center',
+    headerClass: 'serachclass',
+    // sortable: true,
+    cellRenderer: (data) => (
+      <>
+        <div style="color:#409EFF" v-show={data.rowData.scale === 0 && (data.rowData.size < 100 || data.rowData.size == 100) ? true : false}>基础版</div>
+        <div style="color:#67C23A" v-show={(data.rowData.scale === 300 && data.rowData.size === 500) || (data.rowData.size > 100 && (!data.rowData.service.includes('YMPCVCIM') && !data.rowData.service.includes('VLY6J6N6') && !data.rowData.service.includes('VABAJ6NV'))) ? true : false}>标准版</div>
+        <div style="color: #e6a23c;" v-show={data.rowData.service.includes('YMPCVCIM') || data.rowData.service.includes('VLY6J6N6') || data.rowData.service.includes('VABAJ6NV') ? true : false}>专业版</div>
+      </>
+    ),
+  },
+  {
+    key: "id",
+    dataKey: "id",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
+    title: "学校简码",//显示在单元格表头的文本
+    width: 150,//当前列的宽度,必须设置
+    align: 'center',
+    headerClass: 'serachclass',
+  },
+  // {
+  //   key: "location",
+  //   dataKey: "location",
+  //   title: "位置",
+  //   align: 'center',
+  //   width: 200,
+  //   headerClass: 'serachclass',
+  // },
+  {
+    key: "areaName",
+    dataKey: "areaName",
+    title: "所属学区",
+    width: 150,
+    align: 'center',
+    headerClass: 'serachclass',
+  },
+];
+let tableData = ref([])
 let filterdata = ref([])
 let productData = ref({
   dataType: '结果类型',
@@ -404,6 +494,7 @@ let clickNum = ref({
 })
 let timeScope = ref('daterange')
 let cellWidth = ref((100 / columns.value.length).toFixed(2))
+let searchWidth = ref((107 / searchColumns.length).toFixed(2))
 let options = ref([])
 let optionsValue = ref()
 const props2 = {
@@ -469,7 +560,9 @@ let dataSource = ref({
   school: [],
   area: [],
   composite: [],
+  originalSchool: []
 })
+let checkboxArr = ref([])
 let timer = ref()
 let oldKeyword = ref('')
 let adddialog = ref(false)
@@ -516,6 +609,9 @@ function dataInit () {
       console.log(dataList, 'result!')
       options.value = dataList
       dataSource.value.composite = dataList
+      dataSource.value.originalSchool = res.scInfos
+      tableData.value = res.scInfos
+      console.log(dataSource.value.composite, '检查是否是所有学校')
     }).catch((err) => {
       ElMessage.error('API异常,基础数据获取异常')
     })
@@ -732,6 +828,21 @@ function addschoolfn () {
   }
   adddialog.value = false
 }
+//获取所有学校列表 5.18日 调整搜索为 学校列表的形式 
+function selectChange (value) {
+  console.log(value)
+  if (checkboxArr.value.length === 0) {
+    checkboxArr.value.push(value)
+  } else {
+    let indexNums = checkboxArr.value.findIndex(item => item.id === value.id)
+    if (indexNums === -1) {
+      checkboxArr.value.push(value)
+    } else {
+      checkboxArr.value.splice(indexNums, 1)
+    }
+  }
+  console.log(checkboxArr.value)
+}
 // init()
 dataInit()
 filterDistrict()
@@ -904,7 +1015,7 @@ watch(clickNum, (newv) => {
 }
 .school-list {
   width: 100%;
-  height: 40vh;
+  /* height: 40vh; */
   margin-top: 1%;
 }
 .notsearch-box img {
@@ -916,6 +1027,8 @@ watch(clickNum, (newv) => {
   text-align: left;
 }
 .result-box {
+  width: 100%;
+  height: 45vh;
   padding: 1% 1% 0% 2%;
   border-radius: 5px;
   box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
@@ -966,4 +1079,15 @@ watch(clickNum, (newv) => {
 .aresclass .el-select {
   width: 100%;
 }
+.result-box .serachclass,
+.result-box .el-table-v2__row-cell {
+  width: v-bind(searchWidth + "%") !important;
+  /* width: 12% !important; */
+}
+.result-box .cheboxclass {
+  width: 7% !important;
+}
+.result-box .el-table-v2__row-cell:nth-child(1) {
+  width: 7% !important;
+}
 </style>