Jelajahi Sumber

Merge branch 'cmy/develop-bi' into develop

chenmy 1 tahun lalu
induk
melakukan
05de570f82

+ 32 - 51
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -100,16 +100,20 @@
             </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>
+              <p  class="codeboxs" v-if="scope.$index !==curTarget.index  && scope.row.shortCode">
+               {{scope.row.shortCode}}
+              <el-icon  class="el-icon-edit-outline" @click="curTarget.index=scope.$index,curTarget.text=scope.row.shortCode"><Edit /></el-icon>
+              </p>
+              <p  class="codeboxs" v-else-if="scope.$index !==curTarget.index  && !scope.row.shortCode">
+              暂无简码
+              <el-icon  class="el-icon-edit-outline" @click="curTarget.index=scope.$index,curTarget.text=scope.row.shortCode"><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"
+              v-model="scope.row.shortCode"
+              @blur="updateShortcode(scope.row.shortCode,scope.$index)"
             />
             </div>
           </template>
@@ -710,35 +714,9 @@ export default {
     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,
+       text:'',
     })
     let { proxy } = getCurrentInstance()
     let PowerShow = proxy.$access.identifyPosition(JSON.parse(localStorage.getItem('id_token')))
@@ -858,9 +836,9 @@ export default {
         }
         optionData.value.push(...res.areas)
         store.commit('getPoint', res.areas)
+        loading.value = false
         originalDatas.value.push(...res.areas)
         optionData.value.forEach((item, index) => { item.name.includes('完整') ? optionData.value.splice(index, 1) : '' })
-        disposeTabledata(optionData.value)
       })
     }
     //处理API返回的学区json 符合table的呈现
@@ -882,6 +860,18 @@ export default {
       })
       loading.value = false
     }
+    //修改学区简码or苏格拉底频道简码 shortCode内容
+    function updateShortcode(data,index){
+      let shortCodes=data;let dataIndex=index
+      console.log(shortCodes.length,'长度')
+      if(shortCodes.length !==6){
+        ElMessage.error('简码需6位字母或数字,请重新填写')
+        optionData.value[dataIndex].shortCode=curTarget.value.text
+      }else{
+        ElMessage.success('go API')
+        curTarget.value.index=-1
+      }
+    }
     //table按钮
     async function operation (index, row, state) {
       tableData.value = []
@@ -1356,7 +1346,7 @@ export default {
         return item.name.includes(areaValues.value)
       })
       optionData.value = newArr
-      disposeTabledata(optionData.value)
+      // disposeTabledata(optionData.value)
       loading.value = false
     }
     function addSelectSchool (value) {
@@ -1462,16 +1452,6 @@ 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
@@ -1602,13 +1582,8 @@ export default {
       multiplecheck,
       multipleChange,
       multipleAdd,
-      columnList,
-      testDatas,
-      handleEdit,
-      count_col,
-      showMenu,
       curTarget,
-      disposeTabledata
+      updateShortcode
     }
   },
 }
@@ -2497,6 +2472,12 @@ export default {
   margin-bottom: 5px;
   text-align: center;
 }
+.el-icon-edit-outline{
+  opacity: 0;
+}
+.codeboxs:hover .el-icon-edit-outline{
+  opacity: 1;
+}
 </style>
 <style>
 .stagebox-table-not .el-image {

+ 8 - 3
TEAMModelBI/ClientApp/src/view/created/created.vue

@@ -109,7 +109,7 @@
               <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-input v-model="formArea.shortCode" placeholder="填写学区跳转苏格拉底频道简码" />
             </el-form-item>
           </el-form>
           <div class="submitbtn">
@@ -595,7 +595,7 @@ const areaData = {
   capacityvalue: '',
   options: [],
   areaAdmin: '',
-  code:'',
+  shortCode:'',
 }
 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
@@ -977,6 +977,11 @@ export default {
         ElMessage.error('请完善学区名称后,再进行创区操作')
         return
       }
+      if(formArea.value.shortCode.length !==6){
+        ElMessage.error('频道简码需6位字母或数字,请重新填写')
+        formArea.value.shortCode=''
+        return
+      }
       createdLoading.value = true
       loadingCreatedArea.value = true;
       //获取最后一位的名字,生成名字
@@ -1013,7 +1018,7 @@ export default {
         areaAdmin: formArea.value.areaAdmin,
         tmdId: users.tmdId,
         tmdName: users.tmdName,
-        code:formArea.value.code
+        shortCode:formArea.value.shortCode
       }
       console.log(createdParame, '创区数据')
       if (createdParame.institution === '' || createdParame.institution === undefined) {