chenmy 1 year ago
parent
commit
6ad89793a3

+ 142 - 10
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -75,7 +75,6 @@
     </div>
     <div class="traitfrom">
       <el-table :data="optionData" style="width: 100%" :highlight-current-row="true" height="74vh" v-loading="loading" :empty-text="$t(`commonMsg.nodataTable`)" element-loading-text="数据加载中...">
-        <!-- <el-table-column prop="index" :label="$t(`areaManages.areaTable.serialnum`)" type="index" sortable align="center" /> -->
         <el-table-column prop="name" :label="$t(`areaManages.areaTable.name`)" align="center" />
         <el-table-column prop="id" label="学区ID" align="center">
           <template #default="scope">
@@ -89,21 +88,34 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="code" label="学区简码" align="center">
+        <el-table-column prop="code" label="频道简码" align="center">
           <template #default="scope">
-            <div class="code-idboxs">
-             <div>XXXX</div>
+            <!-- <div class="code-idboxs">
+             <div>暂无简码</div>
               <div class="code-copyicon" title="复制学区简码">
                 <el-icon @click="copyAreaID(scope.row)">
                   <CopyDocument />
                 </el-icon>
               </div>
+            </div> -->
+
+            <div>
+              <p v-show="scope.$index !==curTarget.index ">
+               暂无简码
+              <el-icon  class="el-icon-edit-outline" @click="curTarget.index=scope.$index"><Edit /></el-icon>
+            </p>
+            <el-input
+              type="textarea"
+              :autosize="{minRows:2,maxRows:4}"
+              v-show="scope.$index ===curTarget.index "
+              v-model="scope.row.id"
+              @blur="curTarget.index=-1"
+            />
             </div>
           </template>
         </el-table-column>
         <el-table-column prop="schoolCount" label="区内学校数量" align="center" sortable :sort-method="areaSort" />
         <el-table-column prop="location" label="位置" align="center" />
-        <!-- <el-table-column prop="cityName" :label="$t(`areaManages.areaTable.city`)" align="center" /> -->
         <el-table-column prop="institution" :label="$t(`areaManages.areaTable.affiliation`)" align="center" />
         <el-table-column prop="standardName" :label="$t(`areaManages.areaTable.project`)" align="center" />
         <el-table-column :label="$t(`areaManages.areaTable.operate`)" align="center" v-if="PowerShow">
@@ -118,6 +130,41 @@
           </template>
         </el-table-column>
       </el-table>
+      <!--可编辑table-->
+      <!-- <el-table
+        :data="testDatas"
+        :row-class-name="tableRowClassName"
+        v-loading="loading" :empty-text="$t(`commonMsg.nodataTable`)" element-loading-text="数据加载中..."
+      >
+        <el-table-column v-for="(col, idx) in columnList" :key="col.prop" :index="idx">
+            <template #header>
+              <p v-show="col.show" class="customtable-header">
+                {{col.label}}
+
+              </p>
+        </template>
+          <template #default="{ row }">
+            <div v-if="col.prop !=='operate'">
+              <p v-show="row[col.prop].show" >
+              {{row[col.prop].content}} 
+              <el-icon v-show="col.prop ==='code' " class="el-icon-edit-outline" @click="$event => handleEdit(row[col.prop], $event.target)"><Edit /></el-icon>
+            </p>
+            <el-input
+              type="textarea"
+              :autosize="{minRows:2,maxRows:4}"
+              v-show="!row[col.prop].show"
+              v-model="row[col.prop].content"
+              @blur="row[col.prop].show=true"
+            />
+            </div>
+            <div v-else class="customtable-header">
+              <el-button   size="mini" @click="operation(scope.$index, scope.row, true)" type="primary">查看</el-button>
+            </div>
+          </template>
+        </el-table-column>
+        <el-button size="mini"  type="primary">查看</el-button>
+      </el-table>   -->
+      <!--可编辑table end-->
     </div>
     <div class="adjustmentDialog">
       <el-dialog v-model="adjustmentbox" title="" width="80%" @close="closeInfo" center class="interfacebbox">
@@ -646,7 +693,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, ArrowDown } from '@element-plus/icons-vue'
+import { CopyDocument, ArrowRight, ArrowLeft, Search, Back, ArrowDown,Edit } from '@element-plus/icons-vue'
 import useClipboard from 'vue-clipboard3'
 import jwt_decode from 'jwt-decode'
 const optionsData = option
@@ -659,9 +706,40 @@ export default {
     ArrowLeft,
     Search,
     Back,
-    ArrowDown
+    ArrowDown,
+    Edit
   },
   setup () {
+    let columnList=ref( [
+        { prop: "name", label: '名称', show: true },
+        { prop: "id", label: '学区ID', show: true },
+        { prop: "code", label: '频道简码', show: true },
+        { prop: "schoolCount", label: '区内学校数量', show: true },
+        { prop: "location", label: '位置', show: true },
+        { prop: "institution", label: '所属机构', show: true },
+        { prop: "standardName", label: '微能力点方案', show: true },
+        { prop: "operate", label: '操作', show: true },
+    ])
+    let testDatas=ref([
+    //   {
+    //       name: { content: '张三', show: true},
+    //       age: { content: 24, show: true },
+    //       city: { content: '广州', show: true },
+    //       tel: { content: '13312345678', show: true },
+    //       operate:{content:'',state:true}
+    //     },{
+    //       name: { content: '李四', show: true },
+    //       age: { content: 25, show: true },
+    //       city: { content: '九江', show: true },
+    //       tel: { content: '18899998888', show: true },
+    //       operate:{content:'',state:true}
+    // }
+    ])
+    let count_col=ref(0)
+    let showMenu=ref(false)
+    let curTarget=ref({
+       index:-1,
+    })
     let { proxy } = getCurrentInstance()
     let PowerShow = proxy.$access.identifyPosition(JSON.parse(localStorage.getItem('id_token')))
     const { toClipboard } = useClipboard()
@@ -779,16 +857,35 @@ export default {
           res.areas[i].location = res.areas[i].provName + res.areas[i].cityName
         }
         optionData.value.push(...res.areas)
-        loading.value = false
         store.commit('getPoint', res.areas)
         originalDatas.value.push(...res.areas)
         optionData.value.forEach((item, index) => { item.name.includes('完整') ? optionData.value.splice(index, 1) : '' })
+        disposeTabledata(optionData.value)
+      })
+    }
+    //处理API返回的学区json 符合table的呈现
+    function disposeTabledata(data){
+      let initData=data
+      initData.forEach((item)=>{
+         let pushData={
+          name:{content:item.name,show:true},
+          id:{content:item.id,show:true},
+          code:{content:'暂无简码',show:true},
+          schoolCount:{content:item.schoolCount,show:true},
+          location:{content:item.provName+item.cityName,show:true},
+          institution:{content:item.institution,show:true},
+          standardName:{content:item.standardName,show:true},
+          standardName:{content:item.standardName,show:true},
+          operate:{content:'',state:true}
+        }
+        testDatas.value.push(pushData)
       })
+      loading.value = false
     }
     //table按钮
     async function operation (index, row, state) {
       tableData.value = []
-      console.log(row)
+      console.log(index,row,state,'打开学区传输内容')
       loadingSchoolList.value = true
       currentlySelect.value = row
       let dialogData = JSON.parse(JSON.stringify(originalDatas.value))
@@ -1259,6 +1356,7 @@ export default {
         return item.name.includes(areaValues.value)
       })
       optionData.value = newArr
+      disposeTabledata(optionData.value)
       loading.value = false
     }
     function addSelectSchool (value) {
@@ -1364,6 +1462,16 @@ export default {
       })
       position.value = ''
     }
+    //编辑table
+    function handleEdit(cell,pEl){
+      console.log(pEl.nextSibling,'编辑按钮btn')
+      // const editIputEl = Array.from(pEl.nextSibling.childNodes).find(n => ['INPUT','TEXTAREA'].includes(n.tagName))
+      //console.log(editIputEl,'结果')
+      cell.show = false
+      // editIputEl && this.$nextTick(() => {
+      //   editIputEl.focus()
+      // })
+    }
     watch(abilityModel, (newdata) => {
       console.log(newdata)
       newdata
@@ -1493,7 +1601,14 @@ export default {
       dropdownValue,
       multiplecheck,
       multipleChange,
-      multipleAdd
+      multipleAdd,
+      columnList,
+      testDatas,
+      handleEdit,
+      count_col,
+      showMenu,
+      curTarget,
+      disposeTabledata
     }
   },
 }
@@ -2378,6 +2493,10 @@ export default {
   color: #636e72;
   font-weight: none;
 }
+.customtable-header{
+  margin-bottom: 5px;
+  text-align: center;
+}
 </style>
 <style>
 .stagebox-table-not .el-image {
@@ -2395,6 +2514,9 @@ export default {
   width: 98%;
   margin: 0 auto;
   /* padding: 1%; */
+  overflow: hidden;
+  height:80vh;
+  overflow-y: auto;
 }
 
 .traitfrom .el-form-item {
@@ -2579,6 +2701,16 @@ export default {
 .select-school .el-input{
   width:100% !important;
 }
+.traitfrom .el-scrollbar{
+  line-height: 80px;
+}
+.traitfrom .el-table .el-table__cell{
+  padding: 15px 0px;
+}
+.traitfrom .el-scrollbar .cell p{
+  margin-bottom: 0px;
+  text-align: center;
+}
 @media screen and (max-width: 2600px) {
   .select-box-items {
     width: 25%;

+ 32 - 27
TEAMModelBI/ClientApp/src/view/created/created.vue

@@ -108,6 +108,9 @@
             <el-form-item :label="$t(`areaManages.createdArea.areaSelect`)" class="region">
               <el-cascader v-model="provinceOptions.provinceValue" :options="provinceOptions.optionInfo" :props="regionParams" placeholder="选择学区所在地" @change="cascaderArea" />
             </el-form-item>
+            <el-form-item label="频道简码" class="special">
+              <el-input v-model="formArea.code" placeholder="填写学区频道简码" />
+            </el-form-item>
           </el-form>
           <div class="submitbtn">
             <el-button type="primary" @click="createdArea()" :loading="createdLoading">
@@ -192,10 +195,10 @@
               <el-checkbox label="大学"></el-checkbox> -->
               </el-radio-group>
             </el-form-item>
-            <el-form-item label="创校流程" class="school-form-grading">
+            <!-- <el-form-item label="创校流程" class="school-form-grading">
               <el-radio v-model="item.modules" label="default" size="large">普通创校</el-radio>
               <el-radio v-model="item.modules" label="art" size="large">评测创校</el-radio>
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item label="预设管理员" class="scholl-admin" prop="presupposeAdmin">
               <el-input v-model="item.presupposeAdmin" placeholder="输入醍摩豆账号或手机号,预设学校管理员" />
               <p class="repetition-hint" v-if="repetition.admin">该管理员用户不存在,请检查</p>
@@ -571,7 +574,7 @@ import * as excel from '../../until/excel.js'
 import option from '@/static/region.json'
 import router from '@/router/index.js'
 import { useRoute } from 'vue-router'
- import { useI18n } from 'vue-i18n'
+import { useI18n } from 'vue-i18n'
 import option_cn from '@/static/regions/region_cn.json'
 import option_gl from '@/static/regions/region_gl.json'
 const chinaData = new EluiChinaAreaDht.ChinaArea().chinaAreaflat
@@ -592,6 +595,7 @@ const areaData = {
   capacityvalue: '',
   options: [],
   areaAdmin: '',
+  code:'',
 }
 const siteValue = window.location.host === 'localhost:5001' ? 'cn' : window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
 const optionsData = siteValue === 'cn' ? option_cn : option_gl
@@ -620,7 +624,7 @@ const schoolAssets = {
   address: '',
   areaId: '',
   lang: "1",
-  modules:'default',
+  // modules:'default',
   schoolLocation: {
     region: '',
     regionvalue: '',
@@ -647,7 +651,7 @@ export default {
   components: { EluiChinaAreaDht, Search, StarFilled },
   setup () {
     const siteValue = window.location.host === 'localhost:5001' ? 'cn' : window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
-     const { t } = useI18n()
+    const { t } = useI18n()
     const labelPosition = 'right'
     let { proxy } = getCurrentInstance()
     const store = useStore()
@@ -1009,6 +1013,7 @@ export default {
         areaAdmin: formArea.value.areaAdmin,
         tmdId: users.tmdId,
         tmdName: users.tmdName,
+        code:formArea.value.code
       }
       console.log(createdParame, '创区数据')
       if (createdParame.institution === '' || createdParame.institution === undefined) {
@@ -1126,7 +1131,7 @@ export default {
           lang: schoolForm.value[0].lang === '1' ? 'zh-CN' : schoolForm.value[0].lang === '2' ? 'zh-TW' : schoolForm.value[0].lang === '3' ? 'en-US' : 'zh-CN',
           areaId: schoolForm.value[i].areaIdcreated,
           code: schoolForm.value[i].code,
-          modules:schoolForm.value[i].modules === 'default' ? []:['art']
+          // modules:schoolForm.value[i].modules === 'default' ? []:['art']
         })
       }
       let parameter = { biSchools: datas, lang: schoolForm.value[0].lang === '1' ? 'zh-CN' : schoolForm.value[0].lang === '2' ? 'zh-TW' : schoolForm.value[0].lang === '3' ? 'en-US' : 'zh-CN' }
@@ -1164,7 +1169,7 @@ export default {
       schoolForm.value[0].lang = "1"
       schoolForm.value[0].areaIdcreated = ''
       schoolForm.value[0].code = ''
-      schoolForm.value[0].modules  = 'default'
+      // schoolForm.value[0].modules  = 'default'
       provinceOptions.value.provinceValue = ''
     }
     //处理取消和确认并返回
@@ -1338,6 +1343,7 @@ export default {
       console.log(data, '提交的数据')
       proxy.$api.verifyContent(data).then((res) => {
         console.log(res, '数据验证的结果')
+        res.state === 200 ? (batchDatas.forEach((item) => { item.dataState = true }), batchVerify(presentData, loadingverify), codeShow.value = true) : ''
         if (res.state === 200) {
           //处理简码
           res.createScInfo.forEach((items) => {
@@ -1348,7 +1354,6 @@ export default {
             }
           })
         }
-        res.state === 200 ? (batchDatas.forEach((item) => { item.dataState = true }), batchVerify(presentData, loadingverify), codeShow.value = true) : ''
         if (res.state === 201) {
           codeShow.value = false
           batchTablesArr.value = true; verifyState.value = false
@@ -1552,7 +1557,7 @@ export default {
       console.log(schoolForm.value)
       let schooldata = schoolForm.value
       let provinceName = (siteValue === 'cn') ? schooldata[0].schoolLocation.province : schooldata[0].schoolLocation.region ////國際站以region為省名獲取學校簡碼
-      let param = [{ id: '', name: schooldata[0].name, province: provinceName, aname: schooldata[0].name, city: schooldata[0].schoolLocation.city, createCount: 0 }]
+      let param = [{ id: '', name: schooldata[0].name, province: provinceName, aname: schooldata[0].name, city: schooldata[0].schoolLocation.area, createCount: 0 }]
       let data = { schools: param }
       console.log(data, '提交数据')
       proxy.$api.getSchoolcode(data).then((res) => {
@@ -1732,10 +1737,10 @@ export default {
         })
       }
 
-      let datas = { regionId: '', name: '', nameFuzzy: false, shortCode: '', shortCodeFuzzy: false, codeOrShortCode: verifyData[0].code }
+      let datas = { regionId: regionCodeNow, name: verifyData[0].name, nameFuzzy: false, shortCode: verifyData[0].code, shortCodeFuzzy: false }
       proxy.$api.verifyDatainbb(datas).then((res) => {
         console.log(res.length, '核验数据')
-        res.length == 0 ? (verifyForstate.value.state = true, verifyForstate.value.pass = true, ElMessage.success('数据已通过核验,可执行创校')) : (verifyForstate.value.state = false, verifyForstate.value.pass = false, ElMessage.error('数据未通过核验,BB学校资料库已存在此学校代码或简码。'))
+        res.length == 0 ? (verifyForstate.value.state = true, verifyForstate.value.pass = true, ElMessage.success('数据已通过核验,可执行创校')) : (verifyForstate.value.state = false, verifyForstate.value.pass = false, ElMessage.error('数据未通过核验,请检查表单内容'))
       }).catch((error) => {
         ElMessage.error('API异常,数据核验失败')
       })
@@ -1747,25 +1752,25 @@ export default {
       let scArr = value
       let snameList = []; let scodeList = []; let shortArr = []; let regionList = []; let regionInfoRowNow = [];
       let regionCodeTmp = ''
-        scArr.forEach((item) => {
-        // snameList.push(item.name);
-        // scodeList.push(item.id);
+      scArr.forEach((item) => {
+        snameList.push(item.name);
+        scodeList.push(item.id);
         shortArr.push(item.id);
-        // regionInfoRowNow = regionInfoList.filter(function (rgitem) { return rgitem.name.includes(item.region) })
-        // regionCodeTmp = (regionInfoRowNow.length > 0 && regionInfoRowNow[0].hasOwnProperty('code')) ? regionInfoRowNow[0]['code'] : ''
-        // if (regionCodeTmp != '' && !regionList.includes(regionCodeTmp)) {
-        //   regionList.push(regionCodeTmp)
-        // }
+        regionInfoRowNow = regionInfoList.filter(function (rgitem) { return rgitem.name.includes(item.region) })
+        regionCodeTmp = (regionInfoRowNow.length > 0 && regionInfoRowNow[0].hasOwnProperty('code')) ? regionInfoRowNow[0]['code'] : ''
+        if (regionCodeTmp != '' && !regionList.includes(regionCodeTmp)) {
+          regionList.push(regionCodeTmp)
+        }
       })
-      let data = { nameList: snameList, codeList: scodeList, codeOrShortCodeList: shortArr }
-      // if (siteValue === 'cn') {
-      //   data['regionId'] = 'CN'
-      // } else {
-      //   data['regionId'] = (regionList.length == 1) ? regionList[0] : ''
-      //   data['regionIdList'] = (regionList.length > 1) ? regionList : []
-      // }
+      let data = { nameList: snameList, codeList: scodeList, shortCodeList: shortArr }
+      if (siteValue === 'cn') {
+        data['regionId'] = 'CN'
+      } else {
+        data['regionId'] = (regionList.length == 1) ? regionList[0] : ''
+        data['regionIdList'] = (regionList.length > 1) ? regionList : []
+      }
       proxy.$api.verifyDatainbb(data).then((res) => {
-        res.length == 0 ? (ElMessage.success('数据已通过核验,可执行创校'), batchTablesArr.value = true) : (ElMessage.error('数据未通过核验,BB学校资料库已存在此学校代码或简码,请检查表单内容'), batchTablesArr.value = true, verifyState.value = false)
+        res.length == 0 ? (ElMessage.success('数据已通过核验,可执行创校'), batchTablesArr.value = true) : (ElMessage.error('数据未通过核验,请检查表单内容'), batchTablesArr.value = true, verifyState.value = false)
       }).catch((error) => {
         ElMessage.error('API异常,批量数据核验失败')
       })