|
@@ -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 {
|