Commit f5908581 authored by 罗超's avatar 罗超

1

parent 17b724aa
...@@ -109,7 +109,9 @@ service.interceptors.response.use( ...@@ -109,7 +109,9 @@ service.interceptors.response.use(
/** 请求有响应 */ /** 请求有响应 */
async (response: AxiosResponse) => { async (response: AxiosResponse) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.Code === 1) {
return Promise.resolve(response) return Promise.resolve(response)
}
} else { } else {
const __text = getErrorCode2text(response) const __text = getErrorCode2text(response)
return Promise.reject(new Error(__text)) return Promise.reject(new Error(__text))
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<tr v-if="data && data.length==0"> <tr v-if="data && data.length==0">
<td :colspan="8" align="center">暂无数据</td> <td :colspan="8" align="center">暂无数据</td>
</tr> </tr>
<draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd"> <draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd" :clone="cloneFun">
<template #item="{ element }"> <template #item="{ element }">
<tr> <tr>
<td><span>{{element.Name}}</span></td> <td><span>{{element.Name}}</span></td>
...@@ -57,88 +57,21 @@ ...@@ -57,88 +57,21 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent , onMounted } from 'vue' import { defineComponent ,ref, onMounted } from 'vue'
import customerService from '@/api/customer' import customerService from '@/api/customer'
import draggable from "vuedraggable"; import draggable from "vuedraggable";
export default defineComponent({ export default defineComponent({
components: { draggable }, components: { draggable },
setup() { setup() {
const data = [{ const data =ref([]);
DeptId: 0,
DeptName: "-",
Digits: 0,
Enable: 1,
Id: 21,
InputType: "2",
IsDefault: 0,
IsLock: 0,
IsSystem: 0,
Name: "姓名",
Options: "[\r\n {\r\n \"Id\": 0,\r\n \"Name\": \"\"\r\n }\r\n]",
OptionsList: [{ Id: 0, Name: "" }],
Required: 1,
Sort: 1,
Type: 1,
TypeName: "单行文本",
UpdateBy: 1,
UpdateByName: "管理员",
UpdateTime: "2021-09-28 11:06:00",
WordNum: 11,
}, {
DeptId: 0,
DeptName: "-",
Digits: 0,
Enable: 1,
Id: 15,
InputType: "1",
IsDefault: 0,
IsLock: 0,
IsSystem: 0,
Name: "性别",
Options: "[\r\n {\r\n \"Id\": 1,\r\n \"Name\": \"\"\r\n },\r\n {\r\n \"Id\": 2,\r\n \"Name\": \"\"\r\n }\r\n]",
OptionsList: [{ Id: 1, Name: "男" }, { Id: 2, Name: "女" }],
Required: 1,
Sort: 5,
Type: 3,
TypeName: "单选",
UpdateBy: 1,
UpdateByName: "管理员",
UpdateTime: "2021-09-28 11:08:19",
WordNum: 1,
},{
DeptId: 0,
DeptName: "-",
Digits: 0,
Enable: 1,
Id: 13,
InputType: "1",
IsDefault: 0,
IsLock: 0,
IsSystem: 0,
Name: "性别2",
Options: "[\r\n {\r\n \"Id\": 1,\r\n \"Name\": \"\"\r\n },\r\n {\r\n \"Id\": 2,\r\n \"Name\": \"\"\r\n }\r\n]",
OptionsList: [{ Id: 1, Name: "男" }, { Id: 2, Name: "女" }],
Required: 1,
Sort: 5,
Type: 3,
TypeName: "单选2",
UpdateBy: 1,
UpdateByName: "管理员2",
UpdateTime: "2021-09-28 11:08:19",
WordNum: 1,
}];
const changePage = () => { const changePage = () => {
customerService.getCustomerFiledList({ Enable: -1 }).then((res) => { customerService.getCustomerFiledList({ Enable: -1 }).then((res) => {
console.log(res) console.log(132,res)
data.value=res.data.Data
}) })
} }
// const getdata = (e) => { const datadragEnd = (e:any) => {
// console.log(e,'拖动中的元素') console.log('拖动结束',e)
// }
const datadragEnd = () => {
console.log('拖动结束')
} }
onMounted(() => { onMounted(() => {
...@@ -148,7 +81,7 @@ ...@@ -148,7 +81,7 @@
return { return {
data, data,
changePage, changePage,
datadragEnd datadragEnd,
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment